Revision: 43454
Author:   raymond
Date:     2008-11-13 13:37:10 +0000 (Thu, 13 Nov 2008)

Log Message:
-----------
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
    trunk/extensions/Collection/Collection.php

Property Changed:
----------------
    trunk/extensions/Collection/Collection.php

Modified: trunk/extensions/Collection/Collection.body.php
===================================================================
--- trunk/extensions/Collection/Collection.body.php     2008-11-13 11:10:56 UTC 
(rev 43453)
+++ trunk/extensions/Collection/Collection.body.php     2008-11-13 13:37:10 UTC 
(rev 43454)
@@ -204,16 +204,16 @@
        function renderSpecialPage() {
                global $wgCollectionFormats;
                global $wgCollectionVersion;
+               global $wgCollectionStyleVersion;
                global $wgJsMimeType;
                global $wgScriptPath;
                global $wgOut;
-               global $wgStyleVersion;
-               
+
                $this->setHeaders();
                $wgOut->addInlineScript( "var wgCollectionVersion = 
\"$wgCollectionVersion\";" );               
-               $wgOut->addScript( "<script type=\"$wgJsMimeType\" 
src=\"$wgScriptPath/extensions/Collection/collection/jquery.js?$wgStyleVersion&amp;$wgCollectionVersion\"></script>"
 );
-               $wgOut->addScript( "<script type=\"$wgJsMimeType\" 
src=\"$wgScriptPath/extensions/Collection/collection/jquery.ui.js?$wgStyleVersion&amp;$wgCollectionVersion\"></script>"
 );
-               $wgOut->addScript( "<script type=\"$wgJsMimeType\" 
src=\"$wgScriptPath/extensions/Collection/collection/collection.js?$wgStyleVersion&amp;$wgCollectionVersion\"></script>"
 );
+               $wgOut->addScript( "<script type=\"$wgJsMimeType\" 
src=\"$wgScriptPath/extensions/Collection/collection/jquery.js?$wgCollectionStyleVersion\"></script>"
 );
+               $wgOut->addScript( "<script type=\"$wgJsMimeType\" 
src=\"$wgScriptPath/extensions/Collection/collection/jquery.ui.js?$wgCollectionStyleVersion\"></script>"
 );
+               $wgOut->addScript( "<script type=\"$wgJsMimeType\" 
src=\"$wgScriptPath/extensions/Collection/collection/collection.js?$wgCollectionStyleVersion\"></script>"
 );
                
                $template = new CollectionPageTemplate();
                $template->set( 'collection', $_SESSION['wsCollection'] );
@@ -736,13 +736,13 @@
        
        function renderRenderingPage() {
                global $wgCollectionVersion;
+               global $wgCollectionStyleVersion;
                global $wgJsMimeType;
                global $wgLang;
                global $wgOut;
                global $wgRequest;
                global $wgScriptPath;
                global $wgServer;
-               global $wgStyleVersion;
 
                $response = self::mwServeCommand( 'render_status', array(
                        'collection_id' => $wgRequest->getVal( 'collection_id' 
),
@@ -768,8 +768,8 @@
                        $wgOut->addInlineScript( 'var writer = "' . urlencode( 
$response['writer']) . '";' );
                        $wgOut->addInlineScript( 'var collection_rendering = 
true;' );
                        $wgOut->addInlineScript( "var wgCollectionVersion = 
\"$wgCollectionVersion\";" );               
-                       $wgOut->addScript( "<script type=\"$wgJsMimeType\" 
src=\"$wgScriptPath/extensions/Collection/collection/jquery.js?$wgStyleVersion&amp;$wgCollectionVersion\"></script>"
 );
-                       $wgOut->addScript( "<script type=\"$wgJsMimeType\" 
src=\"$wgScriptPath/extensions/Collection/collection/collection.js?$wgStyleVersion&amp;$wgCollectionVersion\"></script>"
 );
+                       $wgOut->addScript( "<script type=\"$wgJsMimeType\" 
src=\"$wgScriptPath/extensions/Collection/collection/jquery.js?$wgCollectionStyleVersion\"></script>"
 );
+                       $wgOut->addScript( "<script type=\"$wgJsMimeType\" 
src=\"$wgScriptPath/extensions/Collection/collection/collection.js?$wgCollectionStyleVersion\"></script>"
 );
                        $wgOut->setPageTitle( wfMsg( 'coll-rendering_title' ) );
 
                        if ( isset($response['status']['status'] ) && 
$response['status']['status'] ) {

Modified: trunk/extensions/Collection/Collection.php
===================================================================
--- trunk/extensions/Collection/Collection.php  2008-11-13 11:10:56 UTC (rev 
43453)
+++ trunk/extensions/Collection/Collection.php  2008-11-13 13:37:10 UTC (rev 
43454)
@@ -37,6 +37,9 @@
 
 # Configuration:
 
+/** Bump the version number every time you change any of the JavaScript files 
*/
+$wgCollectionStyleVersion = 1;
+
 /** URL of mw-serve render server */
 $wgCollectionMWServeURL = 'http://tools.pediapress.com/mw-serve/';
 
@@ -95,6 +98,8 @@
        'name' => 'Collection',
        'version' => '1.1',
        'author' => 'PediaPress GmbH',
+       'svn-date' => '$LastChangedDate$',
+       'svn-revision' => '$LastChangedRevision$',
        'url' => 'http://www.mediawiki.org/wiki/Extension:Collection',
        'description' => 'Collect articles, generate PDFs',
        'descriptionmsg' => 'coll-desc',


Property changes on: trunk/extensions/Collection/Collection.php
___________________________________________________________________
Added: svn:keywords
   + LastChangedDate LastChangedRevision



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to