r43454 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43453‎ | r43454 | r43455 >
Date:13:37, 13 November 2008
Author:raymond
Status:old
Tags:
Comment:
Use a more common method to ensure that users will load the most recent .js files.
Now it is independent from the core variable $wgStyleVersion and the program version variable.
Modified paths:
  • /trunk/extensions/Collection/Collection.body.php (modified) (history)
  • /trunk/extensions/Collection/Collection.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Collection/Collection.php
@@ -37,6 +37,9 @@
3838
3939 # Configuration:
4040
 41+/** Bump the version number every time you change any of the JavaScript files */
 42+$wgCollectionStyleVersion = 1;
 43+
4144 /** URL of mw-serve render server */
4245 $wgCollectionMWServeURL = 'http://tools.pediapress.com/mw-serve/';
4346
@@ -95,6 +98,8 @@
9699 'name' => 'Collection',
97100 'version' => '1.1',
98101 'author' => 'PediaPress GmbH',
 102+ 'svn-date' => '$LastChangedDate$',
 103+ 'svn-revision' => '$LastChangedRevision$',
99104 'url' => 'http://www.mediawiki.org/wiki/Extension:Collection',
100105 'description' => 'Collect articles, generate PDFs',
101106 'descriptionmsg' => 'coll-desc',
Property changes on: trunk/extensions/Collection/Collection.php
___________________________________________________________________
Added: svn:keywords
102107 + LastChangedDate LastChangedRevision
Index: trunk/extensions/Collection/Collection.body.php
@@ -204,16 +204,16 @@
205205 function renderSpecialPage() {
206206 global $wgCollectionFormats;
207207 global $wgCollectionVersion;
 208+ global $wgCollectionStyleVersion;
208209 global $wgJsMimeType;
209210 global $wgScriptPath;
210211 global $wgOut;
211 - global $wgStyleVersion;
212 -
 212+
213213 $this->setHeaders();
214214 $wgOut->addInlineScript( "var wgCollectionVersion = \"$wgCollectionVersion\";" );
215 - $wgOut->addScript( "<script type=\"$wgJsMimeType\" src=\"$wgScriptPath/extensions/Collection/collection/jquery.js?$wgStyleVersion&amp;$wgCollectionVersion\"></script>" );
216 - $wgOut->addScript( "<script type=\"$wgJsMimeType\" src=\"$wgScriptPath/extensions/Collection/collection/jquery.ui.js?$wgStyleVersion&amp;$wgCollectionVersion\"></script>" );
217 - $wgOut->addScript( "<script type=\"$wgJsMimeType\" src=\"$wgScriptPath/extensions/Collection/collection/collection.js?$wgStyleVersion&amp;$wgCollectionVersion\"></script>" );
 215+ $wgOut->addScript( "<script type=\"$wgJsMimeType\" src=\"$wgScriptPath/extensions/Collection/collection/jquery.js?$wgCollectionStyleVersion\"></script>" );
 216+ $wgOut->addScript( "<script type=\"$wgJsMimeType\" src=\"$wgScriptPath/extensions/Collection/collection/jquery.ui.js?$wgCollectionStyleVersion\"></script>" );
 217+ $wgOut->addScript( "<script type=\"$wgJsMimeType\" src=\"$wgScriptPath/extensions/Collection/collection/collection.js?$wgCollectionStyleVersion\"></script>" );
218218
219219 $template = new CollectionPageTemplate();
220220 $template->set( 'collection', $_SESSION['wsCollection'] );
@@ -736,13 +736,13 @@
737737
738738 function renderRenderingPage() {
739739 global $wgCollectionVersion;
 740+ global $wgCollectionStyleVersion;
740741 global $wgJsMimeType;
741742 global $wgLang;
742743 global $wgOut;
743744 global $wgRequest;
744745 global $wgScriptPath;
745746 global $wgServer;
746 - global $wgStyleVersion;
747747
748748 $response = self::mwServeCommand( 'render_status', array(
749749 'collection_id' => $wgRequest->getVal( 'collection_id' ),
@@ -768,8 +768,8 @@
769769 $wgOut->addInlineScript( 'var writer = "' . urlencode( $response['writer']) . '";' );
770770 $wgOut->addInlineScript( 'var collection_rendering = true;' );
771771 $wgOut->addInlineScript( "var wgCollectionVersion = \"$wgCollectionVersion\";" );
772 - $wgOut->addScript( "<script type=\"$wgJsMimeType\" src=\"$wgScriptPath/extensions/Collection/collection/jquery.js?$wgStyleVersion&amp;$wgCollectionVersion\"></script>" );
773 - $wgOut->addScript( "<script type=\"$wgJsMimeType\" src=\"$wgScriptPath/extensions/Collection/collection/collection.js?$wgStyleVersion&amp;$wgCollectionVersion\"></script>" );
 772+ $wgOut->addScript( "<script type=\"$wgJsMimeType\" src=\"$wgScriptPath/extensions/Collection/collection/jquery.js?$wgCollectionStyleVersion\"></script>" );
 773+ $wgOut->addScript( "<script type=\"$wgJsMimeType\" src=\"$wgScriptPath/extensions/Collection/collection/collection.js?$wgCollectionStyleVersion\"></script>" );
774774 $wgOut->setPageTitle( wfMsg( 'coll-rendering_title' ) );
775775
776776 if ( isset($response['status']['status'] ) && $response['status']['status'] ) {

Status & tagging log