Changeset 3994


Ignore:
Timestamp:
05/30/09 17:32:56 (3 years ago)
Author:
MichaelTempest
Message:

Item5628: Merge to trunk.

Add a URL parameter based on the TinyMCEPlugin.pm $VERSION to the .js URLs (as suggested by Colas Nahaboo)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/TinyMCEPlugin/lib/Foswiki/Plugins/TinyMCEPlugin.pm

    r3973 r3994  
    227227        ); 
    228228    } 
     229    # URL-encode the version number to include in the .js URLs, so that the browser re-fetches the .js 
     230    # when this plugin is upgraded. 
     231    my $encodedVersion = $VERSION; 
     232    # SMELL: This regex (and the one applied to $metainit, above) duplicates Foswiki::urlEncode(), 
     233    #        but Foswiki::Func.pm does not expose that function, so plugins may not use it 
     234    $encodedVersion =~ s/([^0-9a-zA-Z-_.:~!*'\/%])/'%'.sprintf('%02x',ord($1))/ge; 
    229235    Foswiki::Func::addToHEAD( 'tinyMCE', <<SCRIPT); 
    230236<meta name="TINYMCEPLUGIN_INIT" content="$metainit" /> 
    231 <script language="javascript" type="text/javascript" src="$tmceURL/tiny_mce$USE_SRC.js"></script> 
    232 <script language="javascript" type="text/javascript" src="$pluginURL/foswiki_tiny$USE_SRC.js"></script> 
    233 <script language="javascript" type="text/javascript" src="$pluginURL/foswiki$USE_SRC.js"></script> 
     237<script language="javascript" type="text/javascript" src="$tmceURL/tiny_mce$USE_SRC.js?v=$encodedVersion"></script> 
     238<script language="javascript" type="text/javascript" src="$pluginURL/foswiki_tiny$USE_SRC.js?v=$encodedVersion"></script> 
     239<script language="javascript" type="text/javascript" src="$pluginURL/foswiki$USE_SRC.js?v=$encodedVersion"></script> 
    234240SCRIPT 
    235241 
Note: See TracChangeset for help on using the changeset viewer.