Appending a hash of WCF's version to all JS files
authorAlexander Ebert <ebert@woltlab.com>
Tue, 28 May 2013 13:36:46 +0000 (15:36 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 28 May 2013 13:36:46 +0000 (15:36 +0200)
22 files changed:
com.woltlab.wcf/template/__commentJavaScript.tpl
com.woltlab.wcf/template/__messageFormPoll.tpl
com.woltlab.wcf/template/aclPermissions.tpl
com.woltlab.wcf/template/headInclude.tpl
com.woltlab.wcf/template/imageViewer.tpl
com.woltlab.wcf/template/login.tpl
com.woltlab.wcf/template/lostPassword.tpl
com.woltlab.wcf/template/messageFormAttachments.tpl
com.woltlab.wcf/template/moderationActivation.tpl
com.woltlab.wcf/template/moderationReport.tpl
com.woltlab.wcf/template/poll.tpl
com.woltlab.wcf/template/register.tpl
com.woltlab.wcf/template/searchArea.tpl
com.woltlab.wcf/template/tagInput.tpl
com.woltlab.wcf/template/user.tpl
com.woltlab.wcf/template/userPanel.tpl
wcfsetup/install/files/acp/templates/labelAdd.tpl
wcfsetup/install/files/acp/templates/labelGroupAdd.tpl
wcfsetup/install/files/acp/templates/tagAdd.tpl
wcfsetup/install/files/acp/templates/userAdd.tpl
wcfsetup/install/files/acp/templates/userList.tpl
wcfsetup/install/files/lib/system/WCF.class.php

index a65ddf64899ab8b58d7ecff22e732d829644b609..275474aa32340b7e4ecc52d612e0c9dba3424dbd 100644 (file)
@@ -1,5 +1,5 @@
-<script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.Comment{if !ENABLE_DEBUG_MODE}.min{/if}.js"></script>
-<script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.Moderation{if !ENABLE_DEBUG_MODE}.min{/if}.js"></script>
+<script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.Comment{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
+<script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.Moderation{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
 <script type="text/javascript">
        //<![CDATA[
        $(function() {
index 3e201a9af71a265df2cdf442b2384b03cfc3deea..3c0bb028e97131c5b05f10219adb32507ba12bdb 100644 (file)
@@ -1,5 +1,5 @@
 {if $__showPoll|isset && $__showPoll}
-       <script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.Poll{if !ENABLE_DEBUG_MODE}.min{/if}.js"></script>
+       <script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.Poll{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
        <script type="text/javascript">
                //<![CDATA[
                $(function() {
index 2b7c4a6473d3099d8333d89396ec7fb84720b9bc..8e6e16f3b7aff363027407acd7517a10f99c290f 100644 (file)
@@ -1,4 +1,4 @@
-<script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.ACL{if !ENABLE_DEBUG_MODE}.min{/if}.js"></script>
+<script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.ACL{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
 <script type="text/javascript">
        //<![CDATA[
        $(function() {
index 542521b9cfb14b1fdc3667700ba2e159afff94f3..e706e5b386c1c2e1fabfd5dea672e939b372646d 100644 (file)
 <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
 <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js"></script>
 {else}
-<script type="text/javascript" src="{@$__wcf->getPath()}js/3rdParty/jquery.min.js"></script>
-<script type="text/javascript" src="{@$__wcf->getPath()}js/3rdParty/jquery-ui.min.js"></script>
+<script type="text/javascript" src="{@$__wcf->getPath()}js/3rdParty/jquery.min.js?v={@$__wcfVersion}"></script>
+<script type="text/javascript" src="{@$__wcf->getPath()}js/3rdParty/jquery-ui.min.js?v={@$__wcfVersion}"></script>
 {/if}
 {if JQUERY_SOURCE != 'local'}
 <script type="text/javascript">
        //<![CDATA[
        if (!window.jQuery) {
-               document.write('<script type="text/javascript" src="{@$__wcf->getPath()}js/3rdParty/jquery.min.js"><\/script>');
-               document.write('<script type="text/javascript" src="{@$__wcf->getPath()}js/3rdParty/jquery-ui.min.js"><\/script>');
+               document.write('<script type="text/javascript" src="{@$__wcf->getPath()}js/3rdParty/jquery.min.js?v={@$__wcfVersion}"><\/script>');
+               document.write('<script type="text/javascript" src="{@$__wcf->getPath()}js/3rdParty/jquery-ui.min.js?v={@$__wcfVersion}"><\/script>');
        }
        //]]>
 </script>
 {/if}
-<script type="text/javascript" src="{@$__wcf->getPath()}js/3rdParty/jquery-ui.nestedSortable.js"></script>
-<script type="text/javascript" src="{@$__wcf->getPath()}js/3rdParty/jquery-ui.timepicker.min.js"></script>
-<script type="text/javascript" src="{@$__wcf->getPath()}js/WCF{if !ENABLE_DEBUG_MODE}.min{/if}.js"></script>
+<script type="text/javascript" src="{@$__wcf->getPath()}js/3rdParty/jquery-ui.nestedSortable.js?v={@$__wcfVersion}"></script>
+<script type="text/javascript" src="{@$__wcf->getPath()}js/3rdParty/jquery-ui.timepicker.min.js?v={@$__wcfVersion}"></script>
+<script type="text/javascript" src="{@$__wcf->getPath()}js/WCF{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
 <script type="text/javascript">
        //<![CDATA[
        WCF.User.init({@$__wcf->user->userID}, '{@$__wcf->user->username|encodeJS}');
        //]]>
 </script>
-<script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.Message{if !ENABLE_DEBUG_MODE}.min{/if}.js"></script>
-<script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.User{if !ENABLE_DEBUG_MODE}.min{/if}.js"></script>
-<script type="text/javascript" src="{@$__wcf->getPath('wcf')}js/WCF.Like{if !ENABLE_DEBUG_MODE}.min{/if}.js"></script>
+<script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.Message{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
+<script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.User{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
+<script type="text/javascript" src="{@$__wcf->getPath('wcf')}js/WCF.Like{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
 {event name='javascriptInclude'}
 
 <!-- Stylesheets -->
index 602943bc8068b985f834aabfc0a1afb4f394b042..b59ffd6324ec2d2cbeee6f866629996ee5ed7d7c 100644 (file)
@@ -1,6 +1,6 @@
 {if !$__imageViewerLoaded|isset}
        <script type="text/javascript" src="{@$__wcf->getPath()}js/3rdParty/slimbox2.min.js"></script>
-       <script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.ImageViewer{if !ENABLE_DEBUG_MODE}.min{/if}.js"></script>
+       <script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.ImageViewer{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
        <script type="text/javascript">
                //<![CDATA[
                var $imageViewer = null;
index 095557ffb790c09452029e76ebf892f0c4f7f1e8..577656bc900de12a13f78a1aec05c7a792c1dccf 100644 (file)
@@ -5,7 +5,7 @@
        
        {include file='headInclude'}
        
-       <script type="text/javascript" src="{@$__wcf->getPath('wcf')}js/WCF.User{if !ENABLE_DEBUG_MODE}.min{/if}.js"></script>
+       <script type="text/javascript" src="{@$__wcf->getPath('wcf')}js/WCF.User{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
        <script type="text/javascript">
                //<![CDATA[
                $(function() {
index e29c1db4226205905404d027c9986e558423fba5..7be49bfce74a3bb7afc5f87ecd94588fd967c8d9 100644 (file)
@@ -4,7 +4,7 @@
        <title>{lang}wcf.user.lostPassword{/lang} - {PAGE_TITLE|language}</title>
        {include file='headInclude'}
        
-       <script type="text/javascript" src="{@$__wcf->getPath('wcf')}js/WCF.User{if !ENABLE_DEBUG_MODE}.min{/if}.js"></script>
+       <script type="text/javascript" src="{@$__wcf->getPath('wcf')}js/WCF.User{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
        <script type="text/javascript">
                //<![CDATA[
                $(function() {
index 65a550841a092116e4f4550dd47ecdc6575b2303..6c97a96a65d9b449b4a36ac3b77e6b078dec3805 100644 (file)
@@ -33,7 +33,7 @@
        {event name='fields'}
 </div>
 
-<script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.Attachment{if !ENABLE_DEBUG_MODE}.min{/if}.js"></script>
+<script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.Attachment{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
 <script type="text/javascript">
        //<![CDATA[
        $(function() {
index 14dbecca6ffa2dcc21c3f4b99944d24a059986e9..010f00cb50b1acdebe1b17b8669c6ee4baf4f155 100644 (file)
@@ -5,7 +5,7 @@
        
        {include file='headInclude'}
        
-       <script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.Moderation{if !ENABLE_DEBUG_MODE}.min{/if}.js"></script>
+       <script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.Moderation{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
        <script type="text/javascript">
                //<![CDATA[
                $(function() {
index d4e8e69bb6f3399d909355da5004da861ad3981e..7ccadf38b6c861cf2ea5d08cf64637f23791e5f0 100644 (file)
@@ -5,7 +5,7 @@
        
        {include file='headInclude'}
        
-       <script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.Moderation{if !ENABLE_DEBUG_MODE}.min{/if}.js"></script>
+       <script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.Moderation{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
        <script type="text/javascript">
                //<![CDATA[
                $(function() {
index ce38bcff2a387a6d9034d32da17cd30ba350ddbe..9810cb73417244d12329c631264ae4cc9effcbfe 100644 (file)
@@ -1,6 +1,6 @@
 {if $__wcf->getUser()->userID && !$__pollLoadedJavaScript|isset}
        {assign var=__pollLoadedJavaScript value=true}
-       <script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.Poll{if !ENABLE_DEBUG_MODE}.min{/if}.js"></script>
+       <script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.Poll{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
        <script type="text/javascript">
                //<![CDATA[
                $(function() {
index a9d01d697ae6c5f6d359ca0dd30d0ec997ff5775..8ab4031b000f12b6d64cffcecf6bac4a8cc2b038 100644 (file)
@@ -4,7 +4,7 @@
        <title>{lang}wcf.user.register{/lang} - {PAGE_TITLE|language}</title>
        {include file='headInclude'}
        
-       <script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.User{if !ENABLE_DEBUG_MODE}.min{/if}.js"></script>
+       <script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.User{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
        <script type="text/javascript">
                //<![CDATA[
                $(function() {
index 8cd2752e4419a4cea41657d52c3d391a0eca7e77..b56a0fd191cf7de9b0906c3889362814eb841ad1 100644 (file)
@@ -25,7 +25,7 @@
        </form>
 </aside>
 
-<script type="text/javascript" src="{@$__wcf->getPath('wcf')}js/WCF.Search.Message{if !ENABLE_DEBUG_MODE}.min{/if}.js"></script>
+<script type="text/javascript" src="{@$__wcf->getPath('wcf')}js/WCF.Search.Message{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
 <script type="text/javascript">
        //<![CDATA[
        $(function() {
index 910eb81783c1e32289bdefa8530bcc99dc5c6cef..b81ac0b56dfe6a9872efe6f34e10dacc322251e6 100644 (file)
@@ -6,7 +6,7 @@
                <small>{lang}wcf.tagging.tags.description{/lang}</small>
        </dd>
 </dl>
-<script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.Tagging{if !ENABLE_DEBUG_MODE}.min{/if}.js"></script>
+<script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.Tagging{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
 <script type="text/javascript">
        //<![CDATA[
        $(function() {
index 796b32c79df1b202abe46e3f7971892b744bc081..59f2854e89c081e69fccfd31f14f335ef88d550c 100644 (file)
@@ -7,7 +7,7 @@
        
        <link rel="canonical" href="{link controller='User' object=$user}{/link}" />
        
-       <script type="text/javascript" src="{@$__wcf->getPath('wcf')}js/WCF.User{if !ENABLE_DEBUG_MODE}.min{/if}.js"></script>
+       <script type="text/javascript" src="{@$__wcf->getPath('wcf')}js/WCF.User{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
        {event name='javascriptInclude'}
        <script type="text/javascript">
                //<![CDATA[
index 5247a34b3bc2e94a83d1e0c1a0047f77a3b61caf..bb4c687d9bfc58dfff09646ac26e22d4a3854e10 100644 (file)
                                <span>{lang}wcf.moderation.moderation{/lang}</span>
                                {if $__wcf->getModerationQueueManager()->getOutstandingModerationCount()}<span class="badge badgeInverse">{#$__wcf->getModerationQueueManager()->getOutstandingModerationCount()}</span>{/if}
                        </a>
-                       <script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.Moderation{if !ENABLE_DEBUG_MODE}.min{/if}.js"></script>
+                       <script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.Moderation{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
                        <script type="text/javascript">
                                //<![CDATA[
                                $(function() {
index 5929108ee80ad30df01bc4ebc817850108db3c2d..93289d0ba7c2ab47beab3ceff4a5c57821185f8a 100644 (file)
@@ -1,5 +1,5 @@
 {include file='header'}
-<script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.Label{if !ENABLE_DEBUG_MODE}.min{/if}.js"></script>
+<script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.Label{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
 <script type="text/javascript">
        //<![CDATA[
        $(function() {
index f6517bc104f7cbc6817e4cd592c751ab31f64bed..2cf58522faba50c8c653de7fdfd5d2ce583a77ee 100644 (file)
@@ -1,7 +1,7 @@
 {include file='header'}
 
 {include file='aclPermissions'}
-<script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.Label{if !ENABLE_DEBUG_MODE}.min{/if}.js"></script>
+<script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.Label{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
 <script type="text/javascript">
        //<![CDATA[
        $(function() {
index ae76dceba2da4b42bfed499339fd9d4b0bf4c2f4..cc34816c99222ae82a33b3f72640f7c3bd388d63 100644 (file)
@@ -85,7 +85,7 @@
                                        </dd>
                                </dl>
                                
-                               <script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.Tagging{if !ENABLE_DEBUG_MODE}.min{/if}.js"></script>
+                               <script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.Tagging{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
                                <script type="text/javascript">
                                        //<![CDATA[
                                        $(function() {
index b3c52091d092a1000615ef0d6c6d1d31ac85e4b0..aff7d9b5f7be602683daf4696fca328a97babada 100644 (file)
                                        </dl>
                                </fieldset>
                                
-                               <script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.Message{if !ENABLE_DEBUG_MODE}.min{/if}.js"></script>
-                               <script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.User{if !ENABLE_DEBUG_MODE}.min{/if}.js"></script>
+                               <script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.Message{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
+                               <script type="text/javascript" src="{@$__wcf->getPath()}js/WCF.User{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
                                <script type="text/javascript">
                                        //<![CDATA[
                                        $(function() {
index 82a314f5066f52343cd131edbb3350af8346ca46..da92ce206e250718ce78a513f1f321bf31b46712 100644 (file)
@@ -7,7 +7,7 @@
 {include file='header'}
 
 {event name='javascriptInclude'}
-<script type="text/javascript" src="{@$__wcf->getPath()}acp/js/WCF.ACP.User{if !ENABLE_DEBUG_MODE}.min{/if}.js"></script>
+<script type="text/javascript" src="{@$__wcf->getPath()}acp/js/WCF.ACP.User{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
 <script type="text/javascript">
        //<![CDATA[
        $(function() {
index f3c94d1c1e40cb91e20f72f37cfe6eb72a9595f6..69c3122ffd3f249b9eab588c5c69780f5d0879a3 100644 (file)
@@ -514,7 +514,10 @@ class WCF {
         */
        protected function assignDefaultTemplateVariables() {
                self::getTPL()->registerPrefilter(array('event', 'hascontent', 'lang'));
-               self::getTPL()->assign(array('__wcf' => $this));
+               self::getTPL()->assign(array(
+                       '__wcf' => $this,
+                       '__wcfVersion' => StringUtil::substring(sha1(WCF_VERSION), 0, 8)
+               ));
        }
        
        /**