https://www.mediawiki.org/wiki/Special:Code/MediaWiki/109515
Revision: 109515 Author: siebrand Date: 2012-01-19 10:41:23 +0000 (Thu, 19 Jan 2012) Log Message: ----------- Follow-up r109402: remove use of $wgLiveletsMagic and just use the string per CR. Update message documentation. Modified Paths: -------------- trunk/extensions/Livelets/Livelets.i18n.php trunk/extensions/Livelets/Livelets.php Modified: trunk/extensions/Livelets/Livelets.i18n.php =================================================================== --- trunk/extensions/Livelets/Livelets.i18n.php 2012-01-19 10:35:13 UTC (rev 109514) +++ trunk/extensions/Livelets/Livelets.i18n.php 2012-01-19 10:41:23 UTC (rev 109515) @@ -20,11 +20,7 @@ * @author Raymond */ $messages['qqq'] = array( - 'livelets-desc' => "{{desc}} - -Further description on http://www.mediawiki.org/wiki/Extension:Livelets - -According to that page, the functionality of this extension is not limited to the Main Page but can be used in all pages. ''Therefore, the phrase \"the main page content\" '''should be translated as \"the main content of the page\",''' not as \"the content of the main page\".''", + 'livelets-desc' => "{{desc}} Further description on https://www.mediawiki.org/wiki/Extension:Livelets. According to that page, the functionality of this extension is not limited to the Main Page but can be used in all pages. ''Therefore, the phrase \"the main page content\" '''should be translated as \"the main content of the page\",''' not as \"the content of the main page\".''", ); /** Asturian (Asturianu) Modified: trunk/extensions/Livelets/Livelets.php =================================================================== --- trunk/extensions/Livelets/Livelets.php 2012-01-19 10:35:13 UTC (rev 109514) +++ trunk/extensions/Livelets/Livelets.php 2012-01-19 10:41:23 UTC (rev 109515) @@ -14,11 +14,8 @@ die( 'This is not a valid entry point to MediaWiki.' ); } -define( 'LIVELETS_VERSION', '1.1.0, 2012-01-18' ); +define( 'LIVELETS_VERSION', '1.1.0, 2012-01-19' ); -# the parser-function name for doing live-transclusions -$wgLiveletsMagic = 'live'; - # Settings for the event-driven live method $wgLiveletsUseSWF = false; # Set this to true to use SWF to make livelets fully event-driven (no polling for change) $wgLiveletsSwfBg = '#ffffff'; # The background colour of the embedded SWF @@ -32,6 +29,7 @@ 'url' => 'https://www.mediawiki.org/wiki/Extension:Livelets', 'version' => LIVELETS_VERSION ); + $dir = dirname( __FILE__ ); $wgExtensionMessagesFiles['Livelets'] = "$dir/Livelets.i18n.php"; $wgExtensionMessagesFiles['LiveletsMagic'] = "$dir/Livelets.i18n.magic.php"; @@ -65,10 +63,10 @@ # Called at extension setup time function setup() { - global $wgOut, $wgParser, $wgLiveletsMagic, $wgLiveletsUseSwf; + global $wgOut, $wgParser, $wgLiveletsUseSwf; # Activate the parser-function - $wgParser->setFunctionHook( $wgLiveletsMagic, array( $this, 'renderContainer' ) ); + $wgParser->setFunctionHook( 'live', array( $this, 'renderContainer' ) ); # Embed the SWF if enabled (SWF must be requested from Livelets.pl) if ( $wgLiveletsUseSwf ) { @@ -100,12 +98,10 @@ # This early hook called from the Ajax bypass whereby the parser has yet to process wikitext function onArticleAfterFetchContent( &$article, &$content ) { - global $wgLiveletsMagic; - # Replace the wikitext with just the content of the requested livelet foreach( $this->examineBraces( $content ) as $brace ) { - if ( $brace['NAME'] == "#$wgLiveletsMagic:" && --$this->request_id < 0 ) { - $len = strlen( $wgLiveletsMagic ); + if ( $brace['NAME'] == "#live:" && --$this->request_id < 0 ) { + $len = strlen( 'live' ); $content = substr( $content, $brace['OFFSET'] + $len + 4, $brace['LENGTH'] - $len - 6 ); break; } _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs