Index: trunk/extensions/MobileFrontend/MobileFrontend.body.php |
— | — | @@ -1503,6 +1503,11 @@ |
1504 | 1504 | return $expiry; |
1505 | 1505 | } |
1506 | 1506 | |
| 1507 | + public function getCacheVaryCookies( $out, &$cookies ) { |
| 1508 | + global $wgCookiePrefix; |
| 1509 | + $cookies[] = $wgCookiePrefix . 'mf_useformat'; |
| 1510 | + } |
| 1511 | + |
1507 | 1512 | /** |
1508 | 1513 | * Determine the duration the cookie should last. |
1509 | 1514 | * |
Index: trunk/extensions/MobileFrontend/MobileFrontend.php |
— | — | @@ -121,6 +121,8 @@ |
122 | 122 | */ |
123 | 123 | $wgMobileRedirectFormAction = false; |
124 | 124 | |
| 125 | +$wgMobileResourceVersion; |
| 126 | + |
125 | 127 | $wgExtMobileFrontend = null; |
126 | 128 | |
127 | 129 | $wgExtensionFunctions[] = 'efMobileFrontend_Setup'; |
— | — | @@ -134,6 +136,7 @@ |
135 | 137 | $wgHooks['APIGetDescription'][] = 'ApiParseExtender::onAPIGetDescription'; |
136 | 138 | $wgHooks['OpenSearchXml'][] = 'ApiQueryExtracts::onOpenSearchXml'; |
137 | 139 | |
| 140 | + |
138 | 141 | function efMobileFrontend_Setup() { |
139 | 142 | global $wgExtMobileFrontend, $wgHooks; |
140 | 143 | $wgExtMobileFrontend = new ExtMobileFrontend(); |
— | — | @@ -142,6 +145,7 @@ |
143 | 146 | $wgHooks['SkinTemplateOutputPageBeforeExec'][] = array( &$wgExtMobileFrontend, 'addMobileFooter' ); |
144 | 147 | $wgHooks['TestCanonicalRedirect'][] = array( &$wgExtMobileFrontend, 'testCanonicalRedirect' ); |
145 | 148 | $wgHooks['ResourceLoaderTestModules'][] = array( &$wgExtMobileFrontend, 'addTestModules' ); |
| 149 | + $wgHooks['GetCacheVaryCookies'][] = array( &$wgExtMobileFrontend, 'getCacheVaryCookies' ); |
146 | 150 | } |
147 | 151 | |
148 | 152 | /** |
Index: trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php |
— | — | @@ -7,7 +7,7 @@ |
8 | 8 | class ApplicationTemplate extends MobileFrontendTemplate { |
9 | 9 | |
10 | 10 | public function getHTML() { |
11 | | - |
| 11 | + global $wgMobileResourceVersion; |
12 | 12 | if ( $this->data['wgAppleTouchIcon'] !== false ) { |
13 | 13 | $appleTouchIconTag = Html::element( 'link', array( 'rel' => 'apple-touch-icon', 'href' => $this->data['wgAppleTouchIcon'] ) ); |
14 | 14 | } else { |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | |
38 | 38 | $jQuerySupport = $this->data['device']['supports_jquery']; |
39 | 39 | $jQueryScript = $jQuerySupport ? $startScriptTag . $javaScriptPath . 'jquery-1.7.1.min.js' . $endScriptTag : ''; |
40 | | - $filePageScript = ( $this->data['isFilePage'] ) ? $startScriptTag . $javaScriptPath . 'filepage.js?version=1332193250' . $endScriptTag : ''; |
| 40 | + $filePageScript = ( $this->data['isFilePage'] ) ? $startScriptTag . $javaScriptPath . 'filepage.js?version=' . $wgMobileResourceVersion . $endScriptTag : ''; |
41 | 41 | |
42 | 42 | $startLinkTag = "<link href='{$this->data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/"; |
43 | 43 | $endLinkTag = "' media='all' rel='Stylesheet' type='text/css' />"; |
— | — | @@ -59,7 +59,7 @@ |
60 | 60 | |
61 | 61 | if( $this->data['isBetaGroupMember'] && $jQuerySupport ) { |
62 | 62 | $betajs = <<<HTML |
63 | | - {$startScriptTag}{$javaScriptPath}references.{$resourceSuffix}js?version=1332193250{$endScriptTag} |
| 63 | + {$startScriptTag}{$javaScriptPath}references.{$resourceSuffix}js?version={$wgMobileResourceVersion}{$endScriptTag} |
64 | 64 | HTML; |
65 | 65 | } else { |
66 | 66 | $betajs = ""; |
— | — | @@ -71,8 +71,8 @@ |
72 | 72 | <head> |
73 | 73 | <title>{$this->data['htmlTitle']}</title> |
74 | 74 | <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" /> |
75 | | - <link href='{$this->data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$betaPrefix}common.css?version=1332193250' media='all' rel='Stylesheet' type='text/css' /> |
76 | | - <link href='{$this->data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$cssFileName}.css?version=1332193250' media='all' rel='Stylesheet' type='text/css' /> |
| 75 | + <link href='{$this->data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$betaPrefix}common.css?version={$wgMobileResourceVersion}' media='all' rel='Stylesheet' type='text/css' /> |
| 76 | + <link href='{$this->data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$cssFileName}.css?version={$wgMobileResourceVersion}' media='all' rel='Stylesheet' type='text/css' /> |
77 | 77 | {$filePageStyle} |
78 | 78 | <meta name="viewport" content="initial-scale=1.0"> |
79 | 79 | {$appleTouchIconTag} |