Make extension compatible with MediaWiki 1.35.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Sat, 12 Jun 2021 21:57:02 +0000 (21:57 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Sat, 12 Jun 2021 21:57:02 +0000 (21:57 +0000)
git-svn-id: http://www.winterrodeln.org/svn/servermediawiki/mediawiki_extensions/wrvideo/trunk@2940 7aebc617-e5e2-0310-91dc-80fb5f6d2477

extension.json
wrvideo.body.php
wrvideo.php [deleted file]

index 5166c56cb1dcbaa39defa04c2e1777d703e6a01f..f739c262a1af9389f09ab7dddc9ea3ad06c8a150 100644 (file)
@@ -2,7 +2,7 @@
        "name": "Winterrodeln Video",
        "version": "0.0.1",
        "author": "Philipp Spitzer",
-       "url": "http://www.winterrodeln.org/trac/wiki/WrVideo",
+       "url": "https://www.winterrodeln.org/trac/wiki/WrVideo",
        "description": "This extension embeds a video in a mediawiki page. Currently vimeo is supported.",
        "type": "parserhook",
        "MessagesDirs": {
        "AutoloadClasses": {
                "WrVideo": "wrvideo.body.php"
        },
-       "ResourceModules": {
-               "ext.wrvideo": []
-       },
-       "ResourceFileModulePaths": {
-               "localBasePath": "",
-               "remoteExtPath": "wrvideo"
-       },
        "Hooks": {
-               "ParserFirstCallInit": "wrVideoParserFirstCallInit"
+               "ParserFirstCallInit": "WrVideo::ParserFirstCallInitHook"
        },
        "manifest_version": 1
 }
index 9be74ab427c12a977d70172865b0dae7fde48fd9..21c9c4689a1d620b575af0ebded6d6a036e0e20c 100644 (file)
@@ -1,4 +1,19 @@
 <?php
+/* This extension embeds a video in a mediawiki page.
+Currently vimeo is supported.
+
+
+To embed the vimeo video
+https://vimeo.com/104778486
+
+the following HTML code has to be inserted into mediawiki:
+<iframe src="//player.vimeo.com/video/104778486?byline=0&amp;portrait=0&amp;color=51735d" width="500" height="281" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
+
+This extension allows this by the following tag:
+<wrvideo id="104778486" />
+<wrvideo id="104778486" width="500" height="281" />
+*/
+
 
 // WrVideo
 // -------
@@ -45,6 +60,11 @@ class WrVideo {
                return array($doc->saveHTML($doc->firstChild), 'markerType' => 'nowiki');
        }
 
+       public static function ParserFirstCallInitHook(Parser &$parser) {
+               $parser->setHook('wrvideo', 'WrVideo::render');
+               return true;
+       }
+
 }
 
 ?>
diff --git a/wrvideo.php b/wrvideo.php
deleted file mode 100644 (file)
index 4e03f9c..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<?php
-/* This extension embeds a video in a mediawiki page.
-Currently vimeo is supported.
-
-
-To embed the vimeo video
-https://vimeo.com/104778486
-
-the following HTML code has to be inserted into mediawiki:
-<iframe src="//player.vimeo.com/video/104778486?byline=0&amp;portrait=0&amp;color=51735d" width="500" height="281" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
-
-This extension allows this by the following tag:
-<wrvideo id="104778486" />
-<wrvideo id="104778486" width="500" height="281" />
-
-*/
-
-$wgExtensionCredits['parserhook'][] = array(
-       'name' => 'Winterrodeln Video',
-       'version' => '0.0.1',
-       'author' =>'Philipp Spitzer', 
-       'url' => 'http://www.winterrodeln.org/trac/wiki/WrVideo', 
-       'description' => 'This extension embeds a video in a mediawiki page. Currently vimeo is supported.'
-);
-
-
-
-$wgResourceModules['ext.wrvideo'] = array(
-       'localBasePath' => dirname( __FILE__ ),
-       'remoteExtPath' => 'wrvideo'
-);
-
-
-$wgAutoloadClasses['WrVideo'] = dirname(__FILE__) . '/wrvideo.body.php';
-$wgMessagesDirs['wrvideo'] = __DIR__ . '/i18n';
-$wgHooks['ParserFirstCallInit'][] = 'wrVideoParserFirstCallInit';
-
-
-function wrVideoParserFirstCallInit($parser) {
-       $parser->setHook('wrvideo', 'WrVideo::render');
-       return true;
-}
-
-
-?>