aboutsummaryrefslogtreecommitdiffstats
path: root/extensions/SVGZoom/SVGZoom.hooks.php
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/SVGZoom/SVGZoom.hooks.php')
-rw-r--r--extensions/SVGZoom/SVGZoom.hooks.php37
1 files changed, 37 insertions, 0 deletions
diff --git a/extensions/SVGZoom/SVGZoom.hooks.php b/extensions/SVGZoom/SVGZoom.hooks.php
new file mode 100644
index 000000000000..50c772c8ebc1
--- /dev/null
+++ b/extensions/SVGZoom/SVGZoom.hooks.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Hooks for Usability Initiative extensions
+ *
+ * @file
+ * @ingroup Extensions
+ */
+
+class SVGZoomHooks {
+
+ /* Static Members */
+
+ /**
+ * BeforePageDisplay hook
+ * Adds scripts
+ */
+ public static function addResources( $out ) {
+ global $wgTitle, $wgJsMimeType, $wgScriptPath, $wgSVGZoomScriptVersion;
+
+ /*
+ * We should probably check if we are in the image namespace, and if the $wgTitle->getText() ends in .svg
+ */
+
+ $out->addScript(
+ Xml::element(
+ 'script',
+ array(
+ 'type' => $wgJsMimeType,
+ 'src' => "{$wgScriptPath}/extensions/SVGZoom/SVGZoom.js?{$wgSVGZoomScriptVersion}",
+ ),
+ '',
+ false
+ )
+ );
+ return true;
+ }
+} \ No newline at end of file