[MediaWiki-CVS] SVN: [115019] branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/ common.css
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/115019 Revision: 115019 Author: awjrichards Date: 2012-04-24 00:10:27 + (Tue, 24 Apr 2012) Log Message: --- MFG Change-Id: I2e4772836a9815855ce46fcb3784f7e26fed56bf Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/common.css Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/common.css === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/common.css 2012-04-23 23:58:30 UTC (rev 115018) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/common.css 2012-04-24 00:10:27 UTC (rev 115019) @@ -230,7 +230,6 @@ table { display: block; overflow-x: auto; - -webkit-overflow-scrolling: touch; } table.toc h2 { ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114983] branches/wmf/1.19wmf1/extensions/MobileFrontend/ MobileFrontend.i18n.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114983 Revision: 114983 Author: awjrichards Date: 2012-04-20 01:21:29 + (Fri, 20 Apr 2012) Log Message: --- Cherry pick from git, Change-Id: Id229229e4975ca34c3d439443aab2391f1b31201 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.i18n.php Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.i18n.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.i18n.php 2012-04-19 22:17:01 UTC (rev 114982) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.i18n.php 2012-04-20 01:21:29 UTC (rev 114983) @@ -52,7 +52,7 @@ 'mobile-frontend-leave-feedback-submit' = 'Submit feedback', 'mobile-frontend-leave-feedback-link-text' = 'MobileFrontend Extension feedback', 'mobile-frontend-leave-feedback' = 'Mobile site feedback', - 'mobile-frontend-leave-feedback-title' = 'Mobile site feedback', + 'mobile-frontend-leave-feedback-page-title' = 'Mobile site feedback', 'mobile-frontend-feedback-page' = 'Project:Mobile Extension Feedback', 'mobile-frontend-feedback-no-subject' = '(no subject)', 'mobile-frontend-feedback-no-message' = 'Please enter a message here', ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114937] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114937 Revision: 114937 Author: awjrichards Date: 2012-04-17 17:18:35 + (Tue, 17 Apr 2012) Log Message: --- Fix for bug 36024, MFG Change-Id: I9676454ebd0c552ade4d375d3b1577c8f1568d7a Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/application.js branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-04-17 12:50:26 UTC (rev 114936) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-04-17 17:18:35 UTC (rev 114937) @@ -961,10 +961,13 @@ 'wgScriptPath' = $wgScriptPath, 'isFilePage' = $isFilePage, 'zeroRatedBanner' = self::$zeroRatedBanner, - 'useFormatCookieName' = 'stopMobileRedirect', - 'useFormatCookieDuration' = $this-getUseFormatCookieDuration(), + 'stopMobileRedirectCookieName' = 'stopMobileRedirect', + 'stopMobileRedirectCookieDuration' = $this-getUseFormatCookieDuration(), + 'stopMobileRedirectCookieDomain' = $this-getBaseDomain(), + 'useFormatCookieName' = $this-getUseFormatCookieName(), + 'useFormatCookieDuration' = -1, 'useFormatCookiePath' = $wgCookiePath, - 'useFormatCookieDomain' = $this-getBaseDomain(), + 'useFormatCookieDomain' = $_SERVER['HTTP_HOST'], ); $applicationTemplate-setByArray( $options ); wfProfileOut( __METHOD__ ); @@ -1280,8 +1283,8 @@ } // check cookies for what to display - $useFormatCookie = $this-getUseFormatCookie(); - if ( $useFormatCookie == 'mobile' ) { + $useMobileFormat = $this-getUseFormatCookie(); + if ( $useMobileFormat == 'true' ) { return true; } $stopMobileRedirect = $this-getStopMobileRedirectCookie(); @@ -1392,7 +1395,7 @@ * @param int $string The expiration to set * @param bool $force Whether or not to force the cookie getting set */ - public function setUseFormatCookie( $cookieFormat, $expiry = null, $force = false ) { + public function setUseFormatCookie( $cookieFormat = 'true', $expiry = null, $force = false ) { global $wgCookiePath, $wgCookieSecure; // sanity check before setting the cookie @@ -1404,7 +1407,7 @@ $expiry = $this-getUseFormatCookieExpiry(); } - setcookie( $this-getUseFormatCookieName(), $cookieFormat, $expiry, $wgCookiePath, $this-getBaseDomain(), $wgCookieSecure ); + setcookie( $this-getUseFormatCookieName(), $cookieFormat, $expiry, $wgCookiePath, $_SERVER['HTTP_HOST'], $wgCookieSecure ); wfIncrStats( 'mobile.useformat_' . $cookieFormat . '_cookie_set' ); } @@ -1420,7 +1423,7 @@ public function getUseFormatCookieName() { if ( !isset( self::$useFormatCookieName ) ) { - self::$useFormatCookieName = 'mf_useformat'; + self::$useFormatCookieName = 'mf_mobileFormat'; } return self::$useFormatCookieName; } @@ -1506,7 +1509,7 @@ // if no mobileurl template, set mobile cookie if ( !strlen( trim( $wgMobileUrlTemplate ) ) ) { - if ( !$temporary ) $this-setUseFormatCookie( $view ); + if ( !$temporary ) $this-setUseFormatCookie(); $this-setUseFormat( $view ); } else { // else redirect to mobile domain @@ -1517,12 +1520,16 @@ } } elseif ( $view == 'desktop' ) { // set stopMobileRedirect cookie - if ( !$temporary ) $this-setStopMobileRedirectCookie(); + if ( !$temporary ) { + $this-setStopMobileRedirectCookie
[MediaWiki-CVS] SVN: [114938] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114938 Revision: 114938 Author: awjrichards Date: 2012-04-17 17:58:54 + (Tue, 17 Apr 2012) Log Message: --- MFG Change-Id: I242facaa01b0aa9970c2ece01fbd775ed39a88b4 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.php branches/wmf/1.19wmf1/extensions/MobileFrontend/skins/SkinMobile.php branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-04-17 17:18:35 UTC (rev 114937) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-04-17 17:58:54 UTC (rev 114938) @@ -1,14 +1,9 @@ ?php -class ExtMobileFrontend { +class ExtMobileFrontend extends ContextSource { public $contentFormat = ''; - /** -* @var Title -*/ - public static $title; - public static $htmlTitle; public static $randomPageUrl; public static $format; public static $search; @@ -53,12 +48,24 @@ private $contentTransformations = true; private $device; - public function __construct() { + public function __construct( IContextSource $context ) { global $wgMFConfigProperties; + $this-setContext( $context ); $this-wmlContext = new WmlContext(); $this-setPropertiesFromArray( $wgMFConfigProperties ); } + public function attachHooks() { + global $wgHooks; + $wgHooks['RequestContextCreateSkin'][] = array( $this, 'requestContextCreateSkin' ); + $wgHooks['BeforePageRedirect'][] = array( $this, 'beforePageRedirect' ); + $wgHooks['SkinTemplateOutputPageBeforeExec'][] = array( $this, 'addMobileFooter' ); + $wgHooks['TestCanonicalRedirect'][] = array( $this, 'testCanonicalRedirect' ); + $wgHooks['ResourceLoaderTestModules'][] = array( $this, 'addTestModules' ); + $wgHooks['GetCacheVaryCookies'][] = array( $this, 'getCacheVaryCookies' ); + $wgHooks['ResourceLoaderRegisterModules'][] = array( $this, 'resourceLoaderRegisterModules' ); + } + public function requestContextCreateSkin( $context, $skin ) { // check whether or not the user has requested to toggle their view $mobileAction = $this-getMobileAction(); @@ -193,7 +200,7 @@ * @return bool */ public function addMobileFooter( $obj, $tpl ) { - global $wgRequest, $wgServer; + global $wgServer; wfProfileIn( __METHOD__ ); $title = $obj-getTitle(); @@ -201,7 +208,7 @@ if ( ! $isSpecial ) { $footerlinks = $tpl-data['footerlinks']; - $mobileViewUrl = $wgRequest-escapeAppendQuery( 'mobileaction=toggle_view_mobile' ); + $mobileViewUrl = $this-getRequest()-escapeAppendQuery( 'mobileaction=toggle_view_mobile' ); $mobileViewUrl = $this-getMobileUrl( $wgServer . $mobileViewUrl ); $tpl-set( 'mobileview', a href='{$mobileViewUrl}' class='noprint' . wfMsg( 'mobile-frontend-view' ) . /a ); @@ -226,10 +233,12 @@ } public function getMsg() { - global $wgRequest, $wgServer, $wgMobileRedirectFormAction; + global $wgServer, $wgMobileRedirectFormAction; wfProfileIn( __METHOD__ ); - self::$viewNormalSiteURL = $this-getDesktopUrl( wfExpandUrl( $wgRequest-escapeAppendQuery( 'mobileaction=toggle_view_desktop' ) ) ); + self::$viewNormalSiteURL = $this-getDesktopUrl( wfExpandUrl( + $this-getRequest()-escapeAppendQuery( 'mobileaction=toggle_view_desktop' ) ) + ); self::$mobileRedirectFormAction = ( $wgMobileRedirectFormAction !== false ) ? $wgMobileRedirectFormAction @@ -272,19 +281,15 @@ /** * @param $out OutputPage -* @param $text String * @return bool */ - public function beforePageDisplayHTML( $out ) { - global $wgRequest; + public function beforePageDisplayHTML( $out ) { wfProfileIn( __METHOD__ ); - // Note: The WebRequest Class calls are made in this block because - // since PHP 5.1.x, all objects have their destructors called - // before the output buffer callback function executes. - // Thus, globalized objects will not be available as expected in the function
[MediaWiki-CVS] SVN: [114940] branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/ beta_opensearch.js
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114940 Revision: 114940 Author: awjrichards Date: 2012-04-17 18:39:36 + (Tue, 17 Apr 2012) Log Message: --- MFT Change-Id: Ice848193da9ce8d4ab8e9917fc574c3b6c0a828d Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.js Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.js === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.js 2012-04-17 18:28:43 UTC (rev 114939) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.js 2012-04-17 18:39:36 UTC (rev 114940) @@ -172,6 +172,7 @@ function initClearSearch() { var clearSearch = document.getElementById( 'clearsearch' ), + results = document.getElementById( 'results' ), search = document.getElementById( 'search' ); function clearSearchBox( event ) { ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114942] branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114942 Revision: 114942 Author: awjrichards Date: 2012-04-17 18:58:10 + (Tue, 17 Apr 2012) Log Message: --- Updating minified JS to match previous updates Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/application.min.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.min.js Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/application.min.js === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/application.min.js 2012-04-17 18:54:52 UTC (rev 114941) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/application.min.js 2012-04-17 18:58:10 UTC (rev 114942) @@ -1 +1 @@ -MobileFrontend=(function(){var a;function b(d){return mwMobileFrontendConfig.messages[d]||}function c(){var h,g=document.getElementById(content),e=document.getElementById(mainpage);a(document.body).addClass(jsEnabled);if(ee.childNodes.length===0b(empty-homepage)){g.innerHTML=b(empty-homepage)}h=document.getElementById(languageselection);function d(){var k;if(h){k=h.options[h.selectedIndex].value;if(k){location.href=k}}}a(h).bind(change,d);function f(){var k=document.getElementById(nav).style;k.display=k.display===block?none:block}a(document.getElementById(logo)).bind(click,f);function j(){var n=MobileFrontend.setting(useFormatCookieName);var m=MobileFrontend.setting(useFormatCookieDuration);var l=MobileFrontend.setting(useFormatCookiePath);var k=MobileFrontend.setting(useFormatCookieDomain);m=m/(24*60*60);MobileFrontend.banner.writeCookie(n,true,m,l,k)}a(document.getElementById(mf-display-toggle)).bind(click,j);function i(){var l=document.querySelectordocument.querySelector('meta[name=viewport]'),k=navigator.userAgent;if(lk.match(/iPhone|iPad/i)){l.content=minimum-scale=1.0, maximum-scale=1.0;document.addEventListener(gesturestart,function(){l.content=minimum-scale=0.25, maximum-scale=1.6},false)}}i();window.scrollTo(0,1)}a=typeof jQuery!==undefined?jQuery:function(f){if(typeof(f)===string){if(document.querySelectorAll){return[].slice.call(document.querySelectorAll(f))}}else{if(!f){f=document.createElement(div)}}function g(m,l){if(m.indexOf){return m.indexOf(l)-1}else{for(var k=0;km.length;k++){if(l===m[k]){return true}}return false}}function e(k){var l=f.className.split( );return g(l,k)}function h(k){var l=f.className,m=l.split( );m.push(k);f.className=m.join( )}function i(k){var m=f.className,n=m.split( ),o=[],l;for(l=0;ln.length;l++){if(n[l]!==k){o.push(n[l])}}f.className=o.join( )}function j(l,k){f.addEventListener(l,k,false)}function d(){f.parentNode.removeChild(f)}return{addClass:h,bind:j,hasClass:e,remove:d,removeClass:i}};a.ajax=a.ajax||function(f){var d,e;if(window.XMLHttpRequest){d=new XMLHttpRequest()}else{d=new ActiveXObject(Microsoft.XMLHTTP)}if(d.overrideMimeType){d.overrideMimeType(text/xml)}d.onreadystatechange=function(){if(d.readyState===4d.status===200){f.success(d.responseXML)}};d.open(GET,f.url,true);d.send()};c();return{init:c,message:b,setting:function(d){return mwMobileFrontendConfig.settings[d]||},utils:a}}()); \ No newline at end of file +MobileFrontend=(function(){var a;function b(d){return mwMobileFrontendConfig.messages[d]||}function c(){var h,g=document.getElementById(content),e=document.getElementById(mainpage);a(document.body).addClass(jsEnabled);if(ee.childNodes.length===0b(empty-homepage)){g.innerHTML=b(empty-homepage)}h=document.getElementById(languageselection);function d(){var k;if(h){k=h.options[h.selectedIndex].value;if(k){location.href=k}}}a(h).bind(change,d);function f(){var k=document.getElementById(nav).style;k.display=k.display===block?none:block}a(document.getElementById(logo)).bind(click,f);function j(){var q=MobileFrontend.setting(useFormatCookieName);var p=MobileFrontend.setting(useFormatCookieDuration);var n=MobileFrontend.setting(useFormatCookiePath);var m=MobileFrontend.setting(useFormatCookieDomain);p=p/(24*60*60);MobileFrontend.banner.writeCookie(q,,p,n,m);var k=MobileFrontend.setting(stopMobileRedirectCookieName);var o=MobileFrontend.setting(stopMobileRedirectCookieDuration);var l=MobileFrontend.setting(stopMobileRedirectCookieDomain);o=o/(24*60*60);MobileFrontend.banner.writeCookie(k,true,o,n,l)}a(document.getElementById(mf-display-toggle)).bind(click,j);function i(){var l=document.querySelectordocument.querySelector('meta[name=viewport]'),k=navigator.userAgent;if(lk.match(/iPhone|iPad/i)){l.content=minimum-scale=1.0, maximum-scale=1.0;document.addEventListener(gesturestart,function(){l.content=minimum-scale=0.25, maximum-scale=1.6},false)}}i();window.scrollTo(0,1)}a=typeof jQuery!==undefined?jQuery:function(f){if(typeof(f)===string){if(document.querySelectorAll){return[].slice.call(document.querySelectorAll(f))}}else{if(!f){f=document.createElement(div)}}function
[MediaWiki-CVS] SVN: [114943] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114943 Revision: 114943 Author: awjrichards Date: 2012-04-17 19:07:05 + (Tue, 17 Apr 2012) Log Message: --- MFG Change-Id: Iba41db4e90333a01ffc9dc52a3d3de0c460cbfd9 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.min.js branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/firefox.css branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/hacks.css Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.js === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.js 2012-04-17 18:58:10 UTC (rev 114942) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.js 2012-04-17 19:07:05 UTC (rev 114943) @@ -73,13 +73,7 @@ var el, newEv, topResult = u( '.suggestions-result a' )[0]; if( topResult ) { - if ( 'fireEvent' in topResult ) { - topResult.fireEvent( 'click' ); - } else { - newEv = document.createEvent( 'HTMLEvents' ); - newEv.initEvent( 'click', true, true ); - topResult.dispatchEvent( newEv ); - } + window.location.href = topResult.getAttribute( 'href' ); ev.preventDefault(); } else { performSearch( ev ); Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.min.js === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.min.js 2012-04-17 18:58:10 UTC (rev 114942) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.min.js 2012-04-17 19:07:05 UTC (rev 114943) @@ -1 +1 @@ -MobileFrontend.opensearch=(function(){var b=/api.php,k=-1,c=500,x=15,p,i=document.getElementById(search),a=document.getElementById(searchbox),q=document.getElementById(content),n=document.getElementById(footer),w=MobileFrontend.setting(scriptPath)+/extensions/MobileFrontend/stylesheets/images/blank.gif,t=document.getElementById(clearsearch),h=false,l=MobileFrontend.utils;b=MobileFrontend.setting(scriptPath)+b;function y(){var u;a=document.getElementById(searchbox);header=document.getElementById(header);q=document.getElementById(content);n=document.getElementById(footer);if(!h){MobileFrontend.utils(document.body).addClass(full-screen-search);u=document.getElementById(remove-results);if(!u){u=document.createElement(img);u.setAttribute(id,remove-results);l(u).bind(click,v);u.setAttribute(src,w);u.setAttribute(alt,MobileFrontend.message(remove-results));header.insertBefore(u,header.firstChild)}h=true}}l(i).bind(focus,y);function v(){MobileFrontend.utils(document.body).removeClass(full-screen-search);if(h){h=false}}var j=function(u){if(u){u.preventDefault()}clearTimeout(k);p=i.value;if(p.length1){p=encodeURIComponent(p);k=setTimeout(function(){g(p)},c)}};var m;window.setInterval(function(){var u=i.value;if(u.length1u!==m){m=u;l(a).addClass(notEmpty);j()}else{if(!u){l(a).removeClass(notEmpty)}}},c);l(document.getElementById(searchForm)).bind(submit,function(B){var u,C,A=l(.suggestions-result a)[0];if(A){if(fireEvent in A){A.fireEvent(click)}else{C=document.createEvent(HTMLEvents);C.initEvent(click,true,true);A.dispatchEvent(C)}B.preventDefault()}else{j(B)}});function z(u){if(i.value.length===0){v()}else{j(u)}}l(i).bind(blur,z);function g(u){l(i).addClass(searching);url=b+?action=opensearchlimit=+x+namespace=0format=xmlsearch=+u;l.ajax({url:url,success:function(A){if(l(document.body).hasClass(full-screen-search)){o(f(A));l(i).removeClass(searching)}}})}function f(D){var E=[],A,B,C,u=D.getElementsByTagName(Item);for(A=0;Au.length;A++){B=u[A];C={label:B.getElementsByTagName(Text)[0].textContent,value:B.getElementsByTagName(Url)[0].textContent};E.push(C)}return E}function d(B){var A=document.createTextNode(B),u=document.createElement(div);u.appendChild(A);return u.innerHTML}function s(u){return u.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,\\$)}function o(I){var C=document.getElementById(results),E,D,B=d(document.getElementById(search).value),H,A,u,F,G;if(!I||I.length1){C.innerHTML='ul class=suggestions-results title=No Resultsli class=suggestions-resultNo Results/li/div'}else{if(C.firstChild){C.removeChild(C.firstChild)}E=document.createElement(ul);E.className=suggestions-results;C.appendChild(E);for(D=0;DI.length;D++){H=I[D];u=document.createElement(li);u.setAttribute(title,H.label);u.className=suggestions-result;F=document.createElement(a);F.setAttribute(href
[MediaWiki-CVS] SVN: [114944] branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114944 Revision: 114944 Author: awjrichards Date: 2012-04-17 19:41:02 + (Tue, 17 Apr 2012) Log Message: --- MFG Change-Id: If58174170d9ffdfc29873aea4312aba80f59f776 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/opensearch.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/opensearch.min.js Added Paths: --- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/filepage.min.js Added: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/filepage.min.js === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/filepage.min.js (rev 0) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/filepage.min.js 2012-04-17 19:41:02 UTC (rev 114944) @@ -0,0 +1 @@ +(function(){function h(k){if(k.substr(0,1)===#){var l=document.getElementById(k.substr(1));if(l===null){return[]}else{return[l]}}else{if(k.substr(0,1)===.){return document.getElementsByClassName(k.substr(1))}else{throw new Error(Unrecognized selector +k)}}}function f(k,n){var l=h(k);for(var m=0;ml.length;m++){l[m].style.display=n}}function j(k){f(k,block)}function e(k){f(k,none)}var d={file:[#file,.fullMedia,#mw-imagepage-content],filehistory:[#filehistory,#mw-imagepage-section-filehistory,#mw-imagepage-reupload-link,#mw-imagepage-edit-external],filelinks:[#filelinks,#mw-imagepage-section-linkstoimage],metadata:[#metadata,.mw-imagepage-section-metadata,]};function b(k){return function(o){for(id in d){if(d.hasOwnProperty(id)){var n=d[id],l;if(id===k){l=j}else{l=e}for(var m=0;mn.length;m++){l(n[m])}function a(r){var l=document.getElementById(filetoc);if(l){var n=l.getElementsByTagName(a);if(n){for(var o=0;on.length;o++){var p=n[o],m=p.href,k=m.search(#),q=m.substr(k+1);if(q==r){n[o].onclick=b(r)}for(id in d){if(d.hasOwnProperty(id)){a(id)}}function c(){var l=document.getElementById(file);if(l){var k=l.getElementsByTagName(a);if(k.length){k[0].onclick=function(){return falsec();var g=file;if(window.location.hash){var i=window.location.hash.substr(1);if(i in d){g=i}}b(g)()})(); \ No newline at end of file Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/filepage.min.js ___ Added: svn:eol-style + native Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/opensearch.js === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/opensearch.js 2012-04-17 19:07:05 UTC (rev 114943) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/opensearch.js 2012-04-17 19:41:02 UTC (rev 114944) @@ -1,5 +1,7 @@ /*global document, window, MobileFrontend, navigator, placeholder */ /*jslint sloppy: true, white:true, maxerr: 50, indent: 4, plusplus: true*/ +// TODO: enable for opera mini 6 users +if( window.navigator.userAgent.indexOf( 'Opera Mini/6' ) === -1 ) { MobileFrontend.opensearch = (function() { var apiUrl = '/api.php', timer = -1, typingDelay = 500, numResults = 5, @@ -189,3 +191,4 @@ }; }()); +} Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/opensearch.min.js === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/opensearch.min.js 2012-04-17 19:07:05 UTC (rev 114943) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/opensearch.min.js 2012-04-17 19:41:02 UTC (rev 114944) @@ -1 +1 @@ -MobileFrontend.opensearch=(function(){var l=/api.php,c=-1,f=500,g=5,h=document.getElementById(results),p=document.getElementById(search),k=document.getElementById(searchbox),m=MobileFrontend.utils;l=MobileFrontend.setting(scriptPath)+l;function b(){var q=document.getElementById(results);q.style.display=none}function e(r){var q;if(!r){r=window.event}if(r.target){q=r.target}else{if(r.srcElement){q=r.srcElement}}if(q.nodeType===3){q=q.parentNode}r.cancelBubble=true;r.stopPropagation();if(!(q.className===suggestion-result||q.className===search-result-item||q.className===suggestions-result||q.className===sq-val-update)){b()}}window.onload=function(){m(p).bind(keyup,function(){clearTimeout(c);var q=this.value;if(q.length1){h.innerHTML=}else{c=setTimeout(function(){o(q)},f)}})};function o(q){q=encodeURIComponent(q);url=l+?action=opensearchlimit=+g+namespace=0format=xmlsearch=+q;m.ajax({url:url,success:function(r){j(i(r))}})}function i(u){var v=[],r,s,t,q=u.getElementsByTagName(Item);for(r=0;rq.length;r++){s=q[r];t={label:s.getElementsByTagName(Text)[0].textContent,value:s.getElementsByTagName(Url)[0].textContent};v.push(t)}return v}function d(r){var q=document.getElementById(search);if(q){q.value=r+ ;q.focus();o
[MediaWiki-CVS] SVN: [114947] branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ ApplicationTemplate.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114947 Revision: 114947 Author: awjrichards Date: 2012-04-17 21:26:46 + (Tue, 17 Apr 2012) Log Message: --- MFG Change-Id: If5d0cd73d9be288e4475a95c58fa747ab3eb37fb Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-04-17 21:06:32 UTC (rev 114946) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-04-17 21:26:46 UTC (rev 114947) @@ -60,7 +60,7 @@ $jsconfig['messages']['empty-homepage'] = wfMsg( 'mobile-frontend-empty-homepage' ); $firstHeading = ''; } else { - $firstHeading = Html::element( 'h1', array( 'id' = 'firstHeading' ), + $firstHeading = Html::rawElement( 'h1', array( 'id' = 'firstHeading' ), $this-data['pageTitle'] ); } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114934] branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ ApplicationTemplate.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114934 Revision: 114934 Author: awjrichards Date: 2012-04-16 22:13:38 + (Mon, 16 Apr 2012) Log Message: --- MFG Change-Id: I92ca039541c6956a48a6600150ae16b367f278c5 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-04-16 21:49:23 UTC (rev 114933) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-04-16 22:13:38 UTC (rev 114934) @@ -29,11 +29,11 @@ $noticeHtml = ( isset( $this-data['noticeHtml'] ) ) ? $this-data['noticeHtml'] : ''; $startScriptTag = 'script type=text/javascript src='; - $endScriptTag = '/script'; + $endScriptTag = ?version={$wgMobileResourceVersion}\/script; $javaScriptPath = $this-data['wgExtensionAssetsPath'] . '/MobileFrontend/javascripts/'; $jQuerySupport = $this-data['device']['supports_jquery']; - $jQueryScript = $jQuerySupport ? $startScriptTag . $javaScriptPath . 'jquery-1.7.2.min.js' . $endScriptTag : ''; + $jQueryScript = $jQuerySupport ? {$startScriptTag}{$javaScriptPath}jquery-1.7.2.min.js{$endScriptTag} : ''; $filePageScript = ( $this-data['isFilePage'] ) ? $startScriptTag . $javaScriptPath . 'filepage.js?version=' . $wgMobileResourceVersion . $endScriptTag : ''; $robots = isset( $this-data['robots'] ) ? \n {$this-data['robots']} : ''; @@ -64,7 +64,7 @@ if( $this-data['isBetaGroupMember'] $jQuerySupport ) { $betajs = HTML - {$startScriptTag}{$javaScriptPath}references.{$resourceSuffix}js?version={$wgMobileResourceVersion}{$endScriptTag} + {$startScriptTag}{$javaScriptPath}references.{$resourceSuffix}js{$endScriptTag} HTML; } else { $betajs = ; @@ -95,10 +95,10 @@ /div {$this-data['footerHtml']} !--[if gt IE 9]!-- - {$startScriptTag}{$javaScriptPath}application.{$resourceSuffix}js?version={$wgMobileResourceVersion}{$endScriptTag} - {$startScriptTag}{$javaScriptPath}toggle.{$resourceSuffix}js?version={$wgMobileResourceVersion}{$endScriptTag} - {$startScriptTag}{$javaScriptPath}banner.{$resourceSuffix}js?version={$wgMobileResourceVersion}{$endScriptTag} - {$startScriptTag}{$javaScriptPath}{$betaPrefix}opensearch.{$resourceSuffix}js?version={$wgMobileResourceVersion}{$endScriptTag} + {$startScriptTag}{$javaScriptPath}application.{$resourceSuffix}js{$endScriptTag} + {$startScriptTag}{$javaScriptPath}toggle.{$resourceSuffix}js{$endScriptTag} + {$startScriptTag}{$javaScriptPath}banner.{$resourceSuffix}js{$endScriptTag} + {$startScriptTag}{$javaScriptPath}{$betaPrefix}opensearch.{$resourceSuffix}js{$endScriptTag} {$betajs} {$filePageScript} !--[endif]-- ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114886] branches/wmf/1.19wmf1/extensions/MobileFrontend/ DeviceDetection.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114886 Revision: 114886 Author: awjrichards Date: 2012-04-13 19:29:52 + (Fri, 13 Apr 2012) Log Message: --- Picking up missing changes from previous merge Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/DeviceDetection.php Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/DeviceDetection.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/DeviceDetection.php 2012-04-13 19:21:51 UTC (rev 114885) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/DeviceDetection.php 2012-04-13 19:29:52 UTC (rev 114886) @@ -17,7 +17,7 @@ /** * @return array */ - public function availableFormats() { + public function getAvailableFormats() { $formats = array ( 'html' = array ( 'view_format' = 'html', @@ -247,11 +247,21 @@ } /** +* @param $userAgent +* @param string $acceptHeader +* @return array +*/ + public function detectDevice( $userAgent, $acceptHeader = '' ) { + $formatName = $this-detectFormatName( $userAgent, $acceptHeader ); + return $this-getDevice( $formatName ); + } + + /** * @param $formatName * @return array */ - public function format( $formatName ) { - $format = $this-availableFormats(); + public function getDevice( $formatName ) { + $format = $this-getAvailableFormats(); return ( isset( $format[$formatName] ) ) ? $format[$formatName] : array(); } @@ -260,7 +270,7 @@ * @param $acceptHeader string * @return string */ - public function formatName( $userAgent, $acceptHeader = '' ) { + public function detectFormatName( $userAgent, $acceptHeader = '' ) { $formatName = ''; if ( preg_match( '/Android/', $userAgent ) ) { @@ -334,4 +344,18 @@ } return $formatName; } + + /** +* @return array: List of all device-specific stylesheets +*/ + public function getCssFiles() { + $devices = $this-getAvailableFormats(); + $files = array(); + foreach ( $devices as $dev ) { + if ( isset( $dev['css_file_name'] ) ) { + $files[] = $dev['css_file_name']; + } + } + return array_unique( $files ); + } } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114887] branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/ images/blank.gif
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114887 Revision: 114887 Author: awjrichards Date: 2012-04-13 19:39:57 + (Fri, 13 Apr 2012) Log Message: --- Picking up blank gif Added Paths: --- branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/images/blank.gif Added: branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/images/blank.gif === (Binary files differ) Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/images/blank.gif ___ Added: svn:mime-type + image/gif ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114889] branches/wmf/1.19wmf1/extensions/MobileFrontend/ MobileFrontend.body.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114889 Revision: 114889 Author: awjrichards Date: 2012-04-13 20:34:20 + (Fri, 13 Apr 2012) Log Message: --- Picking up fix for bug 35940 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-04-13 20:19:46 UTC (rev 114888) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-04-13 20:34:20 UTC (rev 114889) @@ -1102,7 +1102,9 @@ public function getDesktopUrl( $url ) { $parsedUrl = wfParseUrl( $url ); $this-updateDesktopUrlHost( $parsedUrl ); - return wfAssembleUrl( $parsedUrl ); + $this-updateDesktopUrlQuery( $parsedUrl ); + $desktopUrl = wfAssembleUrl( $parsedUrl ); + return $desktopUrl; } /** @@ -1155,6 +1157,19 @@ } /** +* Update the query portion of a given URL to remove any 'useformat' params +* @param $parsedUrl array +* Result of parseUrl() or wfParseUrl() +*/ + protected function updateDesktopUrlQuery( $parsedUrl ) { + if ( strpos( $parsedUrl['query'], 'useformat' ) !== false ) { + $query = wfCgiToArray( html_entity_decode( $parsedUrl['query'] ) ); + unset( $query['useformat'] ); + $parsedUrl['query'] = wfArrayToCgi( $query ); + } + } + + /** * Update path of given URL to conform to mobile URL template. * * NB: this is not actually being used anywhere at the moment. It will ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114892] trunk/tools/gerrit-dippybird/dippy-bird.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114892 Revision: 114892 Author: awjrichards Date: 2012-04-13 21:48:37 + (Fri, 13 Apr 2012) Log Message: --- s/gerrit approve/gerrit review/ Modified Paths: -- trunk/tools/gerrit-dippybird/dippy-bird.php Modified: trunk/tools/gerrit-dippybird/dippy-bird.php === --- trunk/tools/gerrit-dippybird/dippy-bird.php 2012-04-13 21:25:16 UTC (rev 114891) +++ trunk/tools/gerrit-dippybird/dippy-bird.php 2012-04-13 21:48:37 UTC (rev 114892) @@ -124,7 +124,7 @@ // loop through patchsets and submit them one by one foreach ( $patchset_ids as $patchset_id ) { // prepare command to execute - $cmd = ssh -p {$config_opts['port']} {$config_opts['username']}@{$config_opts['server']} gerrit approve --verified 1 --code-review 2 --submit $patchset_id; + $cmd = ssh -p {$config_opts['port']} {$config_opts['username']}@{$config_opts['server']} gerrit review --verified 1 --code-review 2 --submit $patchset_id; if ( $this-getConfigOpt( 'verbose' ) ) { echo Executing: . $cmd . PHP_EOL; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114893] trunk/tools/gerrit-dippybird/dippy-bird.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114893 Revision: 114893 Author: awjrichards Date: 2012-04-13 22:03:16 + (Fri, 13 Apr 2012) Log Message: --- Abstracted 'git review' stuff into a new method, gerritReviewWrapper in perparation for adding capacity for other gerrit review options (eg abandon) Modified Paths: -- trunk/tools/gerrit-dippybird/dippy-bird.php Modified: trunk/tools/gerrit-dippybird/dippy-bird.php === --- trunk/tools/gerrit-dippybird/dippy-bird.php 2012-04-13 21:48:37 UTC (rev 114892) +++ trunk/tools/gerrit-dippybird/dippy-bird.php 2012-04-13 22:03:16 UTC (rev 114893) @@ -107,6 +107,12 @@ * @return mixed */ public function executeSubmit( $results ) { + $review_opts = '--verified 1 --code-review 2'; + $action = 'submit'; + $this-gerritReviewWrapper( $results, $action, $review_opts ); + } + + protected function gerritReviewWrapper( $results, $action, $review_opts = '' ) { // If there are less than two items in the array, there are no changesets on which to operate if ( count( $results ) 2 ) { // nothing to process @@ -114,7 +120,7 @@ } // prepare to do... stuff - $submitted = 0; + $num_handled = 0; $opts = array( 'port', 'server', 'username' ); $config_opts = $this-getConfigOptsByArray( $opts ); @@ -124,7 +130,7 @@ // loop through patchsets and submit them one by one foreach ( $patchset_ids as $patchset_id ) { // prepare command to execute - $cmd = ssh -p {$config_opts['port']} {$config_opts['username']}@{$config_opts['server']} gerrit review --verified 1 --code-review 2 --submit $patchset_id; + $cmd = ssh -p {$config_opts['port']} {$config_opts['username']}@{$config_opts['server']} gerrit review {$review_opts} --{$action} $patchset_id; if ( $this-getConfigOpt( 'verbose' ) ) { echo Executing: . $cmd . PHP_EOL; @@ -134,13 +140,13 @@ if ( !$this-getConfigOpt( 'pretend' ) ) { exec( escapeshellcmd( $cmd ), $cmd_results, $status ); if ( $status !== 0 ) { - $msg = Problem executing submit . PHP_EOL; + $msg = Problem executing $action . PHP_EOL; $this-bail( 1, $msg ); } } - $submitted++; + $num_handled++; } - echo $submitted changesets submitted. . PHP_EOL; + echo $action performed on $num_handled changesets. . PHP_EOL; } /** ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114894] trunk/tools/gerrit-dippybird/dippy-bird.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114894 Revision: 114894 Author: awjrichards Date: 2012-04-13 22:04:36 + (Fri, 13 Apr 2012) Log Message: --- Run stylize.php on dippybird Modified Paths: -- trunk/tools/gerrit-dippybird/dippy-bird.php Modified: trunk/tools/gerrit-dippybird/dippy-bird.php === --- trunk/tools/gerrit-dippybird/dippy-bird.php 2012-04-13 22:03:16 UTC (rev 114893) +++ trunk/tools/gerrit-dippybird/dippy-bird.php 2012-04-13 22:04:36 UTC (rev 114894) @@ -41,10 +41,10 @@ ); protected $validActions = array( - //'approve' = 'executeApprove', - //'verify' = 'executeVerify', + // 'approve' = 'executeApprove', + // 'verify' = 'executeVerify', 'submit' = 'executeSubmit', - //'abandon' = 'executeAbandon', + // 'abandon' = 'executeAbandon', ); public function __construct() { @@ -71,7 +71,7 @@ $results = $this-executeQuery(); // execute the action to take on the query results - $this-{$action_method}( $results ); + $this- { $action_method } ( $results ); echo Thanks for playing! . PHP_EOL; echo 3, . PHP_EOL; @@ -158,7 +158,7 @@ $patchset_ids = array(); foreach ( $results as $result ) { $patchset_id = self::extractPatchSetId( $result ); - if ( !is_null( $patchset_id )) { + if ( !is_null( $patchset_id ) ) { $patchset_ids[] = $patchset_id; } } @@ -172,7 +172,7 @@ */ public static function extractPatchSetId( $result ) { $changeset = json_decode( $result, true ); - if( isset( $changeset['currentPatchSet']['revision'] ) ) { + if ( isset( $changeset['currentPatchSet']['revision'] ) ) { return $changeset['currentPatchSet']['revision']; } return null; @@ -433,7 +433,7 @@ if ( !$this-isValidAction( $action ) ) { $msg = Invalid action requested . PHP_EOL; $msg .= Valid actions include: . PHP_EOL; - foreach( $this-validActions as $action = $method ) { + foreach ( $this-validActions as $action = $method ) { $msg .= \t$action . PHP_EOL; } $this-bail( 1, $msg ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114895] trunk/tools/gerrit-dippybird/dippy-bird.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114895 Revision: 114895 Author: awjrichards Date: 2012-04-13 22:05:25 + (Fri, 13 Apr 2012) Log Message: --- Renamed 'run' method - 'dip' Modified Paths: -- trunk/tools/gerrit-dippybird/dippy-bird.php Modified: trunk/tools/gerrit-dippybird/dippy-bird.php === --- trunk/tools/gerrit-dippybird/dippy-bird.php 2012-04-13 22:04:36 UTC (rev 114894) +++ trunk/tools/gerrit-dippybird/dippy-bird.php 2012-04-13 22:05:25 UTC (rev 114895) @@ -1,7 +1,7 @@ ?php $dippy_bird = new DippyBird(); -$dippy_bird-run(); +$dippy_bird-dip(); class DippyBird { @@ -55,7 +55,7 @@ } } - public function run() { + public function dip() { $this-handleOpts(); if ( !$this-isConfigSane() ) { // bail and fail ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114898] trunk/tools/gerrit-dippybird/dippy-bird.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114898 Revision: 114898 Author: awjrichards Date: 2012-04-13 22:23:15 + (Fri, 13 Apr 2012) Log Message: --- Added some method docs, added executeAbandon() method, now using --verified=+1 notation for submit Modified Paths: -- trunk/tools/gerrit-dippybird/dippy-bird.php Modified: trunk/tools/gerrit-dippybird/dippy-bird.php === --- trunk/tools/gerrit-dippybird/dippy-bird.php 2012-04-13 22:16:03 UTC (rev 114897) +++ trunk/tools/gerrit-dippybird/dippy-bird.php 2012-04-13 22:23:15 UTC (rev 114898) @@ -44,7 +44,7 @@ // 'approve' = 'executeApprove', // 'verify' = 'executeVerify', 'submit' = 'executeSubmit', - // 'abandon' = 'executeAbandon', + 'abandon' = 'executeAbandon', ); public function __construct() { @@ -55,6 +55,12 @@ } } + /** +* Execution method +* +* Performs sanity check, execute specific gerrit query, then performs +* specified action. +*/ public function dip() { $this-handleOpts(); if ( !$this-isConfigSane() ) { @@ -79,6 +85,7 @@ } /** +* Execute specified gerrit query * @return array */ public function executeQuery() { @@ -103,15 +110,34 @@ } /** +* Execute gerrit review --submit to review and submit patchsets * @param array $results -* @return mixed */ public function executeSubmit( $results ) { - $review_opts = '--verified 1 --code-review 2'; + $review_opts = '--verified=+1 --code-review=+2'; $action = 'submit'; $this-gerritReviewWrapper( $results, $action, $review_opts ); } + /** +* Execute gerrit review --abandon to abandon patchsets +* @param array $results +*/ + public function executeAbandon( $results ) { + $action = 'abandon'; + $this-gerritReviewWrapper( $results, $action ); + } + + /** +* A wrapper around the 'gerrit review' command +* +* Given a set of results from a gerrit query, perform one of the available +* gerrit review actions +* @see $this-validActions +* @param array $results +* @param string $action +* @param string $review_opts +*/ protected function gerritReviewWrapper( $results, $action, $review_opts = '' ) { // If there are less than two items in the array, there are no changesets on which to operate if ( count( $results ) 2 ) { ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114900] trunk/tools/gerrit-dippybird/dippy-bird.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114900 Revision: 114900 Author: awjrichards Date: 2012-04-13 22:48:22 + (Fri, 13 Apr 2012) Log Message: --- Added 'abandon' action to documentation Modified Paths: -- trunk/tools/gerrit-dippybird/dippy-bird.php Modified: trunk/tools/gerrit-dippybird/dippy-bird.php === --- trunk/tools/gerrit-dippybird/dippy-bird.php 2012-04-13 22:45:02 UTC (rev 114899) +++ trunk/tools/gerrit-dippybird/dippy-bird.php 2012-04-13 22:48:22 UTC (rev 114900) @@ -354,6 +354,7 @@ Description: Given a gerrit search query, perform a selected 'aciton'. Valid actions currently include: submit: Verify, approve, and submit changeset + abandon: Abandon changeset Usage: php dippy-bird.php --username=username --server=gerrit servername --port=gerrit port [--verbose] [--debug] [--help] ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114901] trunk/tools/gerrit-dippybird/dippy-bird.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114901 Revision: 114901 Author: awjrichards Date: 2012-04-13 22:52:03 + (Fri, 13 Apr 2012) Log Message: --- Added support for gerrit review --restore Modified Paths: -- trunk/tools/gerrit-dippybird/dippy-bird.php Modified: trunk/tools/gerrit-dippybird/dippy-bird.php === --- trunk/tools/gerrit-dippybird/dippy-bird.php 2012-04-13 22:48:22 UTC (rev 114900) +++ trunk/tools/gerrit-dippybird/dippy-bird.php 2012-04-13 22:52:03 UTC (rev 114901) @@ -45,6 +45,7 @@ // 'verify' = 'executeVerify', 'submit' = 'executeSubmit', 'abandon' = 'executeAbandon', + 'restore' = 'executeRestore', ); public function __construct() { @@ -127,6 +128,15 @@ $action = 'abandon'; $this-gerritReviewWrapper( $results, $action ); } + + /** +* Execute gerrit review --restore to restore previously abandoed patchsets +* @param array $results +*/ + public function executeRestore( $results ) { + $action = 'restore'; + $this-gerritReviewWrapper( $results, $action ); + } /** * A wrapper around the 'gerrit review' command @@ -355,6 +365,7 @@ actions currently include: submit: Verify, approve, and submit changeset abandon: Abandon changeset + restore: Restore previously abandoned changesets Usage: php dippy-bird.php --username=username --server=gerrit servername --port=gerrit port [--verbose] [--debug] [--help] ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114906] trunk/tools/gerrit-dippybird/dippy-bird.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114906 Revision: 114906 Author: awjrichards Date: 2012-04-14 00:27:44 + (Sat, 14 Apr 2012) Log Message: --- Added ability to perform code review operations (without submitting changesets) Modified Paths: -- trunk/tools/gerrit-dippybird/dippy-bird.php Modified: trunk/tools/gerrit-dippybird/dippy-bird.php === --- trunk/tools/gerrit-dippybird/dippy-bird.php 2012-04-14 00:22:52 UTC (rev 114905) +++ trunk/tools/gerrit-dippybird/dippy-bird.php 2012-04-14 00:27:44 UTC (rev 114906) @@ -38,11 +38,18 @@ 'required' = false, 'value' = false, ), + 'verify' = array( + 'required' = false, + 'value' = false, + ), + 'review' = array( + 'required' = false, + 'value' = false, + ), ); protected $validActions = array( - // 'approve' = 'executeApprove', - // 'verify' = 'executeVerify', + 'review' = 'executeReview', 'submit' = 'executeSubmit', 'abandon' = 'executeAbandon', 'restore' = 'executeRestore', @@ -72,6 +79,9 @@ // determine the 'action' to take $action = $this-getConfigOpt( 'action' ); + if ( $action == 'review' ) { + $this-isValidCodeReview(); + } $action_method = $this-getActionMethod( $action ); // fetch the results of the query @@ -115,7 +125,7 @@ * @param array $results */ public function executeSubmit( $results ) { - $review_opts = '--verified=+1 --code-review=+2'; + $review_opts = '--verified=+1 --code-review=+2 --submit'; $action = 'submit'; $this-gerritReviewWrapper( $results, $action, $review_opts ); } @@ -126,19 +136,76 @@ */ public function executeAbandon( $results ) { $action = 'abandon'; - $this-gerritReviewWrapper( $results, $action ); + $this-gerritReviewWrapper( $results, $action, '--abandon' ); } - + /** * Execute gerrit review --restore to restore previously abandoed patchsets * @param array $results */ public function executeRestore( $results ) { $action = 'restore'; - $this-gerritReviewWrapper( $results, $action ); + $this-gerritReviewWrapper( $results, $action, '--restore' ); } /** +* Execute gerrit review code review operations +* @param array $results +*/ + public function executeReview( $results ) { + $opts = $this-getConfigOptsByArray( array( 'verify', 'review' ) ); + $review_opts = array(); + if ( !is_null( $opts['verify'] ) ) { + $review_opts[] = --verified={$opts['verify']}; + } + if ( !is_null( $opts['review'] ) ) { + $review_opts[] = --code-review={$opts['review']}; + } + $review_opts = implode( , $review_opts ); + $action = 'code review'; + $this-gerritReviewWrapper( $results, $action, $review_opts ); + } + + /** +* Validate code review options +*/ + public function isValidCodeReview() { + $msg = There is a problem with your 'review' options: . PHP_EOL; + $opts = $this-getConfigOptsByArray( array( 'verify', 'review' ) ); + if ( $opts['verify'] === false $opts['review'] === false ) { + $msg .= 'review' action requires either 'verify' and/or 'review' options. . PHP_EOL; + $this-bail( 1, $msg ); + } + + $fail = false; + // valid 'verify' options + $valid_verify = array( + +1, + 0, + -1, + ); + if ( !is_null( $opts['verify'] ) !in_array( $opts['verify'], $valid_verify ) ) { + $msg .= 'verify' must be one of: -1, 0, +1 . PHP_EOL; + $fail = true; + } + $valid_review = array( + -2, + -1, + 0, + +1, + +2, + ); + if ( !is_null( $opts['review'] ) !in_array( $opts['review'], $valid_review ) ) { + $msg .= 'review' must be one of: -2, -1, 0, +1, +2 . PHP_EOL; + $fail = true; + } + if ( $fail
[MediaWiki-CVS] SVN: [114716] branches/wmf/1.19wmf1/extensions/MobileFrontend/ MobileFrontend.body.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114716 Revision: 114716 Author: awjrichards Date: 2012-04-04 19:11:50 + (Wed, 04 Apr 2012) Log Message: --- MFG Change-Id: I5bfa27fd46de233cf8f08eee60575b9381151ac6 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-04-04 18:46:00 UTC (rev 114715) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-04-04 19:11:50 UTC (rev 114716) @@ -1341,7 +1341,7 @@ $mobileToken = preg_replace( /%h[0-9]\.{0,1}/, , $mobileUrlHostTemplate ); // replace the mobile token with nothing, resulting in the normal hostname - $parsedUrl['host'] = str_replace( $mobileToken, '', $parsedUrl['host'] ); + $parsedUrl['host'] = str_replace( '.' . $mobileToken, '.', $parsedUrl['host'] ); } /** ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114669] branches/wmf/1.19wmf1/extensions/MobileFrontend/ MobileFrontend.body.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114669 Revision: 114669 Author: awjrichards Date: 2012-04-02 22:21:55 + (Mon, 02 Apr 2012) Log Message: --- MFG change-id: I590b2185df9ca1be287835cb8901fef020fd026a Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-04-02 22:08:41 UTC (rev 114668) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-04-02 22:21:55 UTC (rev 114669) @@ -286,19 +286,10 @@ $languageUrls = array(); - /** -* Provide correct method name depending on MW 1.19 or MW 1.20 -*/ - if ( method_exists( 'Language', 'fetchLanguageName' )) { - $langFetchMethodName = 'fetchLanguageName'; - } else { - $langFetchMethodName = 'getLanguageName'; - } - $languageUrls[] = array( 'href' = self::$currentURL, 'text' = self::$htmlTitle, - 'language' = Language::$langFetchMethodName( $wgLanguageCode ), + 'language' = $wgContLang-getLanguageName( $wgLanguageCode ), 'class' = 'interwiki-' . $wgLanguageCode, 'lang' = $wgLanguageCode, ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114670] branches/wmf/1.19wmf1/extensions/MobileFrontend/ MobileFrontend.body.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114670 Revision: 114670 Author: awjrichards Date: 2012-04-02 22:38:43 + (Mon, 02 Apr 2012) Log Message: --- MFG change-id: I031286e302a24c124a10b86a6b3ddbff60fab496 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-04-02 22:21:55 UTC (rev 114669) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-04-02 22:38:43 UTC (rev 114670) @@ -304,10 +304,10 @@ $languageUrl = $this-getMobileUrl( $nt-getFullURL() ); $languageUrls[] = array( 'href' = $languageUrl, - 'text' = ( Language::$langFetchMethodName( $nt-getInterwiki() ) != '' - ? Language::$langFetchMethodName( $nt-getInterwiki() ) + 'text' = ( $wgContLang-getLanguageName( $nt-getInterwiki() ) != '' + ? $wgContLang-getLanguageName( $nt-getInterwiki() ) : $l ), - 'language' = Language::$langFetchMethodName( $lang ), + 'language' = $wgContLang-getLanguageName( $lang ), 'class' = $class, 'lang' = $lang, ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114671] branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ ApplicationTemplate.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114671 Revision: 114671 Author: awjrichards Date: 2012-04-02 22:59:06 + (Mon, 02 Apr 2012) Log Message: --- Reverting change from change-id: Ib2cad740d11d29d1c9e7f7786120cff7a3f566a0 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-04-02 22:38:43 UTC (rev 114670) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-04-02 22:59:06 UTC (rev 114671) @@ -19,7 +19,7 @@ if ( $zeroRatedBanner ) { if ( strstr( $zeroRatedBanner, 'id=zero-rated-bannerspan' ) ) { $dismissNotification = ( isset( $this-data['dismissNotification'] )) ? $this-data['dismissNotification'] : ''; - $zeroRatedBanner = str_replace( 'id=zero-rated-bannerspan', 'id=zero-rated-bannerspan', $zeroRatedBanner ); + $zeroRatedBanner = str_replace( 'id=zero-rated-bannerspan', 'id=zero-rated-bannerspan class=notify-closea id=dismiss-notification title=' . $dismissNotification . '×/a/spanspan', $zeroRatedBanner ); } } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114673] branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ ApplicationTemplate.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114673 Revision: 114673 Author: awjrichards Date: 2012-04-02 23:25:33 + (Mon, 02 Apr 2012) Log Message: --- Revert r114671 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-04-02 23:22:07 UTC (rev 114672) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-04-02 23:25:33 UTC (rev 114673) @@ -19,7 +19,7 @@ if ( $zeroRatedBanner ) { if ( strstr( $zeroRatedBanner, 'id=zero-rated-bannerspan' ) ) { $dismissNotification = ( isset( $this-data['dismissNotification'] )) ? $this-data['dismissNotification'] : ''; - $zeroRatedBanner = str_replace( 'id=zero-rated-bannerspan', 'id=zero-rated-bannerspan class=notify-closea id=dismiss-notification title=' . $dismissNotification . '×/a/spanspan', $zeroRatedBanner ); + $zeroRatedBanner = str_replace( 'id=zero-rated-bannerspan', 'id=zero-rated-bannerspan', $zeroRatedBanner ); } } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114637] trunk/tools
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114637 Revision: 114637 Author: awjrichards Date: 2012-03-30 23:11:37 + (Fri, 30 Mar 2012) Log Message: --- Initial import of 'DippyBird', a tool to perform bulk actions on Gerrit changesets. Currently supports submitting (with approval +2, verify +1) changesets, can eaisly extend to review, abandon, etc. Added Paths: --- trunk/tools/gerrit-dippybird/ trunk/tools/gerrit-dippybird/._dippy-bird.php trunk/tools/gerrit-dippybird/dippy-bird.php Added: trunk/tools/gerrit-dippybird/._dippy-bird.php === (Binary files differ) Property changes on: trunk/tools/gerrit-dippybird/._dippy-bird.php ___ Added: svn:mime-type + application/octet-stream Added: trunk/tools/gerrit-dippybird/dippy-bird.php === --- trunk/tools/gerrit-dippybird/dippy-bird.php (rev 0) +++ trunk/tools/gerrit-dippybird/dippy-bird.php 2012-03-30 23:11:37 UTC (rev 114637) @@ -0,0 +1,426 @@ +?php + +$dippy_bird = new DippyBird(); +$dippy_bird-run(); + + +class DippyBird { + protected $configOpts = array( + 'port' = array( + 'required' = true, + 'value' = null, + ), + 'server' = array( + 'required' = true, + 'value' = null, + ), + 'username' = array( + 'required' = true, + 'value' = null, + ), + 'query' = array( + 'required' = true, + 'value' = null, + ), + 'action' = array( + 'required' = false, + 'value' = null, + ), + 'pretend' = array( + 'required' = false, + 'value' = false, + ), + 'verbose' = array( + 'required' = false, + 'value' = false, + ), + 'debug' = array( + 'required' = false, + 'value' = false, + ), + ); + + protected $validActions = array( + //'approve' = 'executeApprove', + //'verify' = 'executeVerify', + 'submit' = 'executeSubmit', + //'abandon' = 'executeAbandon', + ); + + public function __construct() { + // if a config file is present, load it + $config_file = dirname( __FILE__ ) . / . config.ini; + if ( file_exists( $config_file ) ) { + $this-loadConfiguration( $config_file ); + } + } + + public function run() { + $this-handleOpts(); + if ( !$this-isConfigSane() ) { + // bail and fail + $msg = There is something wrong in your arguments or configuration.; + $this-bail( 1, $msg ); + } + + // determine the 'action' to take + $action = $this-getConfigOpt( 'action' ); + $action_method = $this-getActionMethod( $action ); + + // fetch the results of the query + $results = $this-executeQuery(); + + // execute the action to take on the query results + $this-{$action_method}( $results ); + + echo Thanks for playing! . PHP_EOL; + echo 3, . PHP_EOL; + echo Dippy bird . PHP_EOL; + } + + public function executeQuery() { + // config options we need + $opts = array( 'port', 'server', 'username', 'query' ); + $config_opts = $this-getConfigOptsByArray( $opts ); + $cmd = ssh -p {$config_opts['port']} {$config_opts['username']}@{$config_opts['server']} gerrit query {$config_opts['query']} --format=JSON --current-patch-set; + if ( $this-getConfigOpt( 'verbose' ) ) { + echo Executing query: . $cmd . PHP_EOL; + } + $results = array(); + exec( escapeshellcmd( $cmd ), $results, $status ); + if ( $status === 0 ) { + if ( $this-getConfigOpt( 'debug' ) ) { + echo Query results: . print_r( $results, true ) . PHP_EOL; + } + return $results; + } else { + $msg = There was a problem executing your query. . PHP_EOL; + $msg .= Exiting with status: $status; + $this-bail
[MediaWiki-CVS] SVN: [114638] trunk/tools/gerrit-dippybird/._dippy-bird.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114638 Revision: 114638 Author: awjrichards Date: 2012-03-30 23:12:28 + (Fri, 30 Mar 2012) Log Message: --- Deleting accientally imported temp file Removed Paths: - trunk/tools/gerrit-dippybird/._dippy-bird.php Deleted: trunk/tools/gerrit-dippybird/._dippy-bird.php === (Binary files differ) ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114576] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114576 Revision: 114576 Author: awjrichards Date: 2012-03-28 21:31:56 + (Wed, 28 Mar 2012) Log Message: --- Picking up mf_useformat cookie fixes - MFG Change-Id: Iec23d682, Change-Id: I0f6a4405, Change_Id: I45b38d55; Updating minified JS for application.js and banner.js Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.php branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/application.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/application.min.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/banner.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/banner.min.js branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-28 21:31:04 UTC (rev 114575) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-28 21:31:56 UTC (rev 114576) @@ -1161,7 +1161,7 @@ } public function getApplicationTemplate() { - global $wgAppleTouchIcon, $wgExtensionAssetsPath, $wgScriptPath; + global $wgAppleTouchIcon, $wgExtensionAssetsPath, $wgScriptPath, $wgCookiePath; wfProfileIn( __METHOD__ ); $applicationTemplate = new ApplicationTemplate(); $options = array( @@ -1181,6 +1181,8 @@ 'hideText' = self::$messages[ 'mobile-frontend-hide-button' ], 'useFormatCookieName' = self::$useFormatCookieName, 'useFormatCookieDuration' = $this-getUseFormatCookieDuration(), + 'useFormatCookiePath' = $wgCookiePath, + 'useFormatCookieDomain' = $this-getBaseDomain(), ); $applicationTemplate-setByArray( $options ); wfProfileOut( __METHOD__ ); @@ -1491,15 +1493,15 @@ } public function checkUseFormatCookie() { - global $wgRequest, $wgCookiePrefix, $wgScriptPath; - + global $wgRequest, $wgScriptPath; + if ( !isset( self::$useFormatCookieName )) { - self::$useFormatCookieName = $wgCookiePrefix . 'mf_useformat'; + self::$useFormatCookieName = 'mf_useformat'; } $useFormat = $this-getUseFormat(); - $useFormatFromCookie = $wgRequest-getCookie( 'mf_useformat' ); - + $useFormatFromCookie = $wgRequest-getCookie( 'mf_useformat', '' ); + // fetch format from cookie and set it if one is not otherwise specified if( !strlen( $useFormat ) !is_null( $useFormatFromCookie ) ) { $this-setUseFormat( $useFormatFromCookie ); @@ -1527,13 +1529,13 @@ * @param string $useFormat The format to store in the cookie */ protected function setUseFormatCookie( $useFormat ) { - global $wgCookiePath, $wgCookieSecure, $wgCookieDomain; + global $wgCookiePath, $wgCookieSecure; $expiry = $this-getUseFormatCookieExpiry(); - + // use regular php setcookie() rather than WebResponse::setCookie // so we can ignore $wgCookieHttpOnly since the protection it provides // is irrelevant for this cookie. - setcookie( self::$useFormatCookieName, $useFormat, $expiry, $wgCookiePath, $wgCookieDomain, $wgCookieSecure ); + setcookie( self::$useFormatCookieName, $useFormat, $expiry, $wgCookiePath, $this-getBaseDomain(), $wgCookieSecure ); wfIncrStats( 'mobile.useformat_' . $useFormat . '_cookie_set' ); } @@ -1552,8 +1554,7 @@ } public function getCacheVaryCookies( $out, $cookies ) { - global $wgCookiePrefix; - $cookies[] = $wgCookiePrefix . 'mf_useformat'; + $cookies[] = 'mf_useformat'; return true; } Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.php 2012-03-28 21:31:04 UTC (rev 114575) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.php 2012-03-28 21:31:56 UTC (rev 114576) @@ -156,6
[MediaWiki-CVS] SVN: [114498] branches/wmf/1.19wmf1/extensions/MobileFrontend/library/
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114498 Revision: 114498 Author: awjrichards Date: 2012-03-26 21:45:04 + (Mon, 26 Mar 2012) Log Message: --- Followup r114497, removing WURFL Removed Paths: - branches/wmf/1.19wmf1/extensions/MobileFrontend/library/ ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114500] branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114500 Revision: 114500 Author: awjrichards Date: 2012-03-26 21:59:13 + (Mon, 26 Mar 2012) Log Message: --- MFG Change-Id: I53b08a96e98647667821bab4c3d03e77c4c5323d Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.min.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/references.min.js Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.min.js === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.min.js 2012-03-26 21:48:04 UTC (rev 114499) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.min.js 2012-03-26 21:59:13 UTC (rev 114500) @@ -1 +1 @@ -MobileFrontend.opensearch=(function(){var c=/api.php,m=-1,d=500,A=15,q,k=document.getElementById(search),a=document.getElementById(searchbox),r=document.getElementById(content),o=document.getElementById(footer),y=document.getElementById(clearsearch),j=false,x,w,n=MobileFrontend.utils;c=MobileFrontend.setting(scriptPath)+c;function s(){results.style.display=none}x=n('meta[name=viewport]');if(x){x=x[0];w=x.getAttribute(content)}function h(){if(x){x.setAttribute(content,minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0);n(document.body).bind(gesturestart,function(){x.setAttribute(content,w)})}}h();k.onfocus=function(){var u,B;a=document.getElementById(searchbox);header=document.getElementById(header);r=document.getElementById(content);o=document.getElementById(footer);h();if(!j){MobileFrontend.utils(document.body).addClass(full-screen-search);u=document.getElementById(remove-results);if(!u){u=document.createElement(a);u.setAttribute(href,#);u.setAttribute(id,remove-results);n(u).bind(click,z);B=document.createElement(div);B.setAttribute(id,left-arrow);u.appendChild(B);header.insertBefore(u,header.firstChild)}j=true}};function z(){MobileFrontend.utils(document.body).removeClass(full-screen-search);if(j){j=false}}function b(B){var u;if(!B){B=window.event}if(B.target){u=B.target}else{if(B.srcElement){u=B.srcElement}}if(u.nodeType===3){u=u.parentNode}B.cancelBubble=true;B.stopPropagation();if(u.className===suggestion-result||u.className===search-result-item||u.className===suggestions-result||u.className===sq-val-update||u.id===results||u.id===search||u.id===searchbox||u.id===sq||u.id===placeholder||u.id===clearsearch||u.tagName===BODY){if(u.id===clearsearchresults){results.innerHTML=}}else{s()}}var l=function(u){u.preventDefault();clearTimeout(m);q=k.value;if(q.length1){results.innerHTML=}else{q=encodeURIComponent(q);m=setTimeout(function(){i(q)},d)}};n(k).bind(keyup,l);n(document.getElementById(searchForm)).bind(submit,l);n(k).bind(blur,l);function i(u){n(k).addClass(searching);url=c+?action=opensearchlimit=+A+namespace=0format=xmlsearch=+u;n.ajax({url:url,success:function(B){if(n(document.body).hasClass(full-screen-search)){p(g(B));n(k).removeClass(searching)}}})}function g(E){var F=[],B,C,D,u=E.getElementsByTagName(Item);for(B=0;Bu.length;B++){C=u[B];D={label:C.getElementsByTagName(Text)[0].textContent,value:C.getElementsByTagName(Url)[0].textContent};F.push(D)}return F}function e(C){var B=document.createTextNode(C),u=document.createElement(div);u.appendChild(B);return u.innerHTML}function v(u){return u.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,\\$)}function p(J){var D=document.getElementById(results),F,E,C=e(document.getElementById(search).value),I,B,u,G,H;D.style.display=block;if(k){k.focus()}if(!J||J.length1){D.innerHTML='ul class=suggestions-results title=No Resultsli class=suggestions-resultNo Results/li/div'}else{if(D.firstChild){D.removeChild(D.firstChild)}F=document.createElement(ul);F.className=suggestions-results;D.appendChild(F);for(E=0;EJ.length;E++){I=J[E];u=document.createElement(li);u.setAttribute(title,I.label);u.className=suggestions-result;G=document.createElement(a);G.setAttribute(href,I.value.replace(/^(?:\/\/|[^\/]+)*\//,/));G.className=search-result-item;H=document.createTextNode(I.label);G.appendChild(H);u.appendChild(G);F.appendChild(u);B=v(C);G.innerHTML=G.innerHTML.replace(new RegExp((+B+),ig),strong$1/strong)}}}function f(){var D=document.getElementById(clearsearch),u=document.getElementById(search);function B(E){u.value=;E.preventDefault()}function C(){u.select()}n(D).bind(mousedown,B);n(u).bind(click,C)}function t(){var u=document.getElementById(results);u.onmousedown=b;document.body.onmousedown=b;document.body.ontouchstart=b;u.ontouchstart=b}t();f();return{init:t,initClearSearch:f,writeResults:p,createObjectArray:g,removeResults:z}}()); \ No newline at end of file +MobileFrontend.opensearch=(function(){var b=/api.php,k=-1,c=500,y=15,p,i=document.getElementById(search),a=document.getElementById(searchbox),q=document.getElementById(content),n=document.getElementById(footer),w
[MediaWiki-CVS] SVN: [114502] branches/wmf/1.19wmf1/extensions/MobileFrontend/ MobileFrontend.body.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114502 Revision: 114502 Author: awjrichards Date: 2012-03-26 22:46:12 + (Mon, 26 Mar 2012) Log Message: --- MFT Change-Id: I510fe48f5aa7e1de0f2b2155fde02c646c5eeb63 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-26 22:12:37 UTC (rev 114501) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-26 22:46:12 UTC (rev 114502) @@ -269,10 +269,19 @@ $languageUrls = array(); + /** +* Provide correct method name depending on MW 1.19 or MW 1.20 +*/ + if ( method_exists( 'Language', 'fetchLanguageName' )) { + $langFetchMethodName = 'fetchLanguageName'; + } else { + $langFetchMethodName = 'getLanguageName'; + } + $languageUrls[] = array( 'href' = self::$currentURL, 'text' = self::$htmlTitle, - 'language' = Language::fetchLanguageName( $wgLanguageCode ), + 'language' = Language::$langFetchMethodName( $wgLanguageCode ), 'class' = 'interwiki-' . $wgLanguageCode, 'lang' = $wgLanguageCode, ); @@ -287,10 +296,10 @@ $languageUrl = $this-getMobileUrl( $nt-getFullURL() ); $languageUrls[] = array( 'href' = $languageUrl, - 'text' = ( Language::fetchLanguageName( $nt-getInterwiki() ) != '' - ? Language::fetchLanguageName( $nt-getInterwiki() ) + 'text' = ( Language::$langFetchMethodName( $nt-getInterwiki() ) != '' + ? Lanuage::$langFetchMethodName( $nt-getInterwiki() ) : $l ), - 'language' = Language::fetchLanguageName( $lang ), + 'language' = Language::$langFetchMethodName( $lang ), 'class' = $class, 'lang' = $lang, ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114503] branches/wmf/1.19wmf1/extensions/MobileFrontend/ MobileFrontend.body.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114503 Revision: 114503 Author: awjrichards Date: 2012-03-26 22:54:31 + (Mon, 26 Mar 2012) Log Message: --- MFG Change-Id: Ie47095aeae42fdb1e2768879dc668f37e06c8729 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-26 22:46:12 UTC (rev 114502) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-26 22:54:31 UTC (rev 114503) @@ -297,7 +297,7 @@ $languageUrls[] = array( 'href' = $languageUrl, 'text' = ( Language::$langFetchMethodName( $nt-getInterwiki() ) != '' - ? Lanuage::$langFetchMethodName( $nt-getInterwiki() ) + ? Language::$langFetchMethodName( $nt-getInterwiki() ) : $l ), 'language' = Language::$langFetchMethodName( $lang ), 'class' = $class, ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114504] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114504 Revision: 114504 Author: awjrichards Date: 2012-03-26 23:03:08 + (Mon, 26 Mar 2012) Log Message: --- Followup r114497; Adding files that got missed in previous sync to git origin/master head Added Paths: --- branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/images/logo-copyright-en.png branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/HtmlFormatterTest.php Added: branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/images/logo-copyright-en.png === (Binary files differ) Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/images/logo-copyright-en.png ___ Added: svn:mime-type + image/png Added: branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/HtmlFormatterTest.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/HtmlFormatterTest.php (rev 0) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/HtmlFormatterTest.php 2012-03-26 23:03:08 UTC (rev 114504) @@ -0,0 +1,73 @@ +?php + +/** + * @group MobileFrontend + */ +class HtmlFormatterTest extends MediaWikiTestCase { + /** +* @dataProvider getHtmlData +*/ + public function testTransform( $input, $expected, $callback = false ) { + $t = Title::newFromText( 'Mobile' ); + $input = self::normalize( $input ); + $formatter = new HtmlFormatter( HtmlFormatter::wrapHTML( $input ), $t, 'XHTML' ); + if ( $callback ) { + $callback( $formatter ); + } + $formatter-filterContent(); + $html = $formatter-getText(); + $this-assertEquals( self::normalize( $expected ), self::normalize( $html ) ); + } + + private static function normalize( $s ) { + return str_replace( \n, '', + str_replace( \r, '', $s ) // yay to Windows! + ); + } + + public function getHtmlData() { + $disableImages = function( HtmlFormatter $f ) { + $f-removeImages(); + }; + $removeTags = function( HtmlFormatter $f ) { + $f-remove( array( 'table', '.foo', '#bar', 'div.baz' ) ); + $f-whitelistIds( 'jedi' ); + }; + $flattenSomeStuff = function( HtmlFormatter $f ) { + $f-flatten( array( 's', 'div' ) ); + }; + $flattenEverything = function( HtmlFormatter $f ) { + $f-flattenAllTags(); + }; + return array( + // remove images if asked + array( + 'img src=/foo/bar.jpgBlah/img', + 'Blah', + $disableImages, + ), + // basic tag removal + array( + 'tabletrtdfoo/td/tr/tablediv class=foofoo/divspan id=barbar/span +strong class=foo id=barfoobar/strongdiv class=notfootest/divdiv class=baz/ +span class=bazbaz/span span class=foo id=jedijedi/span', + + 'div class=notfootest/div +span class=bazbaz/span span class=foo id=jedijedi/span', + $removeTags, + ), + // don't flatten tags that start like chosen ones + array( + 'divsfoo/s spanbar/span/div', + 'foo spanbar/span', + $flattenSomeStuff, + ), + // total flattening + array( + 'div style=foobarsup2/sup/div', + 'bar2', + $flattenEverything, + ), + ); + } +} Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/HtmlFormatterTest.php ___ Added: svn:eol-style + native ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114506] branches/wmf/1.19wmf1/extensions/MobileFrontend/ MobileFrontend.body.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114506 Revision: 114506 Author: awjrichards Date: 2012-03-27 00:08:09 + (Tue, 27 Mar 2012) Log Message: --- MFG Change-Id: Ibc499458fabc35b0fae00f5b3da1f35e830ebf0e Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-26 23:20:40 UTC (rev 114505) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-27 00:08:09 UTC (rev 114506) @@ -249,7 +249,7 @@ // Need to stash the results of the wfMsg call before the Output Buffering handler // because at this point the database connection is shut down, etc. - self::$messages['mobile-frontend-copyright'] = $copyright; + self::$messages['mobile-frontend-footer-copyright'] = $copyright; foreach ( self::$messageKeys as $messageKey ) { ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114507] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114507 Revision: 114507 Author: awjrichards Date: 2012-03-27 00:27:27 + (Tue, 27 Mar 2012) Log Message: --- MFG Change-Id: I5bec6e19260adf98d6b83a108ae79059b04eb0ca, Change-Id: I30f908c273b867b17ce1c0c4520e6c978f567798 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-27 00:08:09 UTC (rev 114506) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-27 00:27:27 UTC (rev 114507) @@ -429,6 +429,7 @@ } self::$device = $device-format( $formatName ); + $this-checkUserStatus(); $this-setDefaultLogo(); // honor useformat=mobile-wap if it's set, otherwise determine by device @@ -495,8 +496,6 @@ $this-disableCaching(); $this-sendXDeviceVaryHeader(); $this-sendApplicationVersionVaryHeader(); - $this-checkUserStatus(); - $this-setDefaultLogo(); $this-checkUserLoggedIn(); if ( self::$title-isSpecial( 'Userlogin' ) self::$isBetaGroupMember ) { Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css 2012-03-27 00:08:09 UTC (rev 114506) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css 2012-03-27 00:27:27 UTC (rev 114507) @@ -786,6 +786,7 @@ top: 0; left: 0; height: 40px; + line-height: 40px; /* prevent text jumping as you search */ } #searchbox { ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114509] branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/ beta_common.css
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114509 Revision: 114509 Author: awjrichards Date: 2012-03-27 00:41:21 + (Tue, 27 Mar 2012) Log Message: --- MFG Change-Id: I92f0a9e44af704461fdad4ac3fa3faed7fa6f7c7 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css 2012-03-27 00:32:14 UTC (rev 114508) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css 2012-03-27 00:41:21 UTC (rev 114509) @@ -786,6 +786,9 @@ top: 0; left: 0; height: 40px; +} + +#search { line-height: 40px; /* prevent text jumping as you search */ } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114384] trunk/extensions/MobileFrontend/MobileFrontend.body.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114384 Revision: 114384 Author: awjrichards Date: 2012-03-21 17:55:36 + (Wed, 21 Mar 2012) Log Message: --- Adding wfIncrStats() call when mf_useformat cookie gets set Modified Paths: -- trunk/extensions/MobileFrontend/MobileFrontend.body.php Modified: trunk/extensions/MobileFrontend/MobileFrontend.body.php === --- trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-21 17:46:57 UTC (rev 114383) +++ trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-21 17:55:36 UTC (rev 114384) @@ -1520,6 +1520,7 @@ // so we can ignore $wgCookieHttpOnly since the protection it provides // is irrelevant for this cookie. setcookie( self::$useFormatCookieName, $useFormat, $expiry, $wgCookiePath, $wgCookieDomain, $wgCookieSecure ); + wfIncrStats( 'mobile.useformat_' . $useFormat . '_cookie_set' ); } /** ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114385] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114385 Revision: 114385 Author: awjrichards Date: 2012-03-21 18:02:21 + (Wed, 21 Mar 2012) Log Message: --- MFT r114384 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/ Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Modified: svn:mergeinfo - /trunk/extensions/MobileFrontend:99727,114313,114315,114319,114341 + /trunk/extensions/MobileFrontend:99727,114313,114315,114319,114341,114384 Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-21 17:55:36 UTC (rev 114384) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-21 18:02:21 UTC (rev 114385) @@ -1520,6 +1520,7 @@ // so we can ignore $wgCookieHttpOnly since the protection it provides // is irrelevant for this cookie. setcookie( self::$useFormatCookieName, $useFormat, $expiry, $wgCookiePath, $wgCookieDomain, $wgCookieSecure ); + wfIncrStats( 'mobile.useformat_' . $useFormat . '_cookie_set' ); } /** ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114409] trunk/extensions/MobileFrontend/MobileFrontend.body.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114409 Revision: 114409 Author: awjrichards Date: 2012-03-21 21:36:05 + (Wed, 21 Mar 2012) Log Message: --- No longer setting useformat cookie if URL = /?useformat=mobile or $wgScriptPath/?useformat=mobile to avoid some pitfalls with certain server setups including WMF, where if varnish sees a / URL, it will append ?useformat=mobile to ensure proper handling of the mobile site + home page. This case should only happen in the event the user is following an external link or typing in the (mobile) URL themselves and does not represent an election for the mobile view in the same wasy as clicking on the mobile view link and should not be considered as such. Modified Paths: -- trunk/extensions/MobileFrontend/MobileFrontend.body.php Modified: trunk/extensions/MobileFrontend/MobileFrontend.body.php === --- trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-21 21:28:09 UTC (rev 114408) +++ trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-21 21:36:05 UTC (rev 114409) @@ -1457,7 +1457,7 @@ } public function checkUseFormatCookie() { - global $wgRequest, $wgCookiePrefix; + global $wgRequest, $wgCookiePrefix, $wgScriptPath; if ( !isset( self::$useFormatCookieName )) { self::$useFormatCookieName = $wgCookiePrefix . 'mf_useformat'; @@ -1471,9 +1471,15 @@ $this-setUseFormat( $useFormatFromCookie ); } - // set appropriate cookie if necessary - if ( ( $useFormatFromCookie != 'mobile' $useFormat == 'mobile' ) || - ( $useFormatFromCookie != 'desktop' $useFormat == 'desktop' ) ) { + // set appropriate cookie if necessary, ignoring certain URL patterns + // eg initial requests to a mobile-specific domain with no path. this + // is intended to avoid pitfalls for certain server configurations + // but should not get in the way of out-of-the-box configs + $reqUrl = $wgRequest-getRequestUrl(); + $urlsToIgnore = array( '/?useformat=mobile', $wgScriptPath . '/?useformat=mobile' ); + if ( ( ( $useFormatFromCookie != 'mobile' $useFormat == 'mobile' ) || + ( $useFormatFromCookie != 'desktop' $useFormat == 'desktop' ) ) + !in_array( $reqUrl, $urlsToIgnore ) ) { $this-setUseFormatCookie( $useFormat ); } } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114413] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114413 Revision: 114413 Author: awjrichards Date: 2012-03-21 21:51:47 + (Wed, 21 Mar 2012) Log Message: --- MFT r114409 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/ Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Modified: svn:mergeinfo - /trunk/extensions/MobileFrontend:99727,114313,114315,114319,114341,114384 + /trunk/extensions/MobileFrontend:99727,114313,114315,114319,114341,114384,114409 Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-21 21:42:17 UTC (rev 114412) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-21 21:51:47 UTC (rev 114413) @@ -1483,7 +1483,7 @@ } public function checkUseFormatCookie() { - global $wgRequest, $wgCookiePrefix; + global $wgRequest, $wgCookiePrefix, $wgScriptPath; if ( !isset( self::$useFormatCookieName )) { self::$useFormatCookieName = $wgCookiePrefix . 'mf_useformat'; @@ -1497,9 +1497,15 @@ $this-setUseFormat( $useFormatFromCookie ); } - // set appropriate cookie if necessary - if ( ( $useFormatFromCookie != 'mobile' $useFormat == 'mobile' ) || - ( $useFormatFromCookie != 'desktop' $useFormat == 'desktop' ) ) { + // set appropriate cookie if necessary, ignoring certain URL patterns + // eg initial requests to a mobile-specific domain with no path. this + // is intended to avoid pitfalls for certain server configurations + // but should not get in the way of out-of-the-box configs + $reqUrl = $wgRequest-getRequestUrl(); + $urlsToIgnore = array( '/?useformat=mobile', $wgScriptPath . '/?useformat=mobile' ); + if ( ( ( $useFormatFromCookie != 'mobile' $useFormat == 'mobile' ) || + ( $useFormatFromCookie != 'desktop' $useFormat == 'desktop' ) ) + !in_array( $reqUrl, $urlsToIgnore ) ) { $this-setUseFormatCookie( $useFormat ); } } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114306] trunk/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114306 Revision: 114306 Author: awjrichards Date: 2012-03-20 20:41:11 + (Tue, 20 Mar 2012) Log Message: --- Added methods to return a desktop view URL (reversing the URL using the mobile URL template); Changed 'Desktop view' URL to use new methods; Added corresponding test Modified Paths: -- trunk/extensions/MobileFrontend/MobileFrontend.body.php trunk/extensions/MobileFrontend/tests/MobileFrontendTest.php Modified: trunk/extensions/MobileFrontend/MobileFrontend.body.php === --- trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-20 20:30:29 UTC (rev 114305) +++ trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-20 20:41:11 UTC (rev 114306) @@ -231,7 +231,7 @@ self::$disableImagesURL = $wgRequest-escapeAppendQuery( 'disableImages=1' ); self::$enableImagesURL = $wgRequest-escapeAppendQuery( 'enableImages=1' ); - self::$viewNormalSiteURL = $wgRequest-escapeAppendQuery( 'useformat=desktop' ); + self::$viewNormalSiteURL = $this-getDesktopUrl( wfExpandUrl( $wgRequest-escapeAppendQuery( 'useformat=desktop' ) ) ); self::$currentURL = $wgRequest-getFullRequestURL(); self::$leaveFeedbackURL = $wgRequest-escapeAppendQuery( 'mobileaction=leave_feedback' ); @@ -1257,6 +1257,17 @@ } return wfAssembleUrl( $parsedUrl ); } + + /** +* Take a URL and return a copy that removes any mobile tokens +* @param string +* @return string +*/ + public function getDesktopUrl( $url ) { + $parsedUrl = wfParseUrl( $url ); + $this-updateDesktopUrlHost( $parsedUrl ); + return wfAssembleUrl( $parsedUrl ); + } /** * Update host of given URL to conform to mobile URL template. @@ -1290,6 +1301,24 @@ } /** +* Update the host of a given URL to strip out any mobile tokens +* @param $parsedUrl array +* Result of parseUrl() or wfParseUrl() +*/ + protected function updateDesktopUrlHost( $parsedUrl ) { + $mobileUrlHostTemplate = $this-parseMobileUrlTemplate( 'host' ); + if ( !strlen( $mobileUrlHostTemplate ) ) { + return; + } + + // identify the mobile token by stripping out normal host parts + $mobileToken = preg_replace( /%h[0-9]\.{0,1}/, , $mobileUrlHostTemplate ); + + // replace the mobile token with nothing, resulting in the normal hostname + $parsedUrl['host'] = str_replace( $mobileToken, '', $parsedUrl['host'] ); + } + + /** * Update path of given URL to conform to mobile URL template. * * NB: this is not actually being used anywhere at the moment. It will Modified: trunk/extensions/MobileFrontend/tests/MobileFrontendTest.php === --- trunk/extensions/MobileFrontend/tests/MobileFrontendTest.php 2012-03-20 20:30:29 UTC (rev 114305) +++ trunk/extensions/MobileFrontend/tests/MobileFrontendTest.php 2012-03-20 20:41:11 UTC (rev 114306) @@ -87,6 +87,15 @@ $this-assertEquals( http://en.m.wikipedia.org/wiki/Gustavus_Airport;, wfAssembleUrl( $parsedUrl ) ); } + public function testUpdateDesktopUrlHost() { + global $wgMobileUrlTemplate, $wgExtMobileFrontend; + $updateMobileUrlHost = self::getMethod( updateDesktopUrlHost ); + $wgMobileUrlTemplate = %h0.m.%h1.%h2; + $parsedUrl = wfParseUrl( http://en.m.wikipedia.org/wiki/Gustavus_Airport; ); + $updateMobileUrlHost-invokeArgs( $wgExtMobileFrontend, array( $parsedUrl ) ); + $this-assertEquals( http://en.wikipedia.org/wiki/Gustavus_Airport;, wfAssembleUrl( $parsedUrl ) ); + } + public function testUpdateMobileUrlPath() { global $wgMobileUrlTemplate, $wgExtMobileFrontend, $wgScriptPath; $wgScriptPath = '/wiki'; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114309] branches/wmf/1.19wmf1/extensions/MobileFrontend/
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114309 Revision: 114309 Author: awjrichards Date: 2012-03-20 21:15:18 + (Tue, 20 Mar 2012) Log Message: --- Moving MobileFrontend out of the way to sync from trunk Removed Paths: - branches/wmf/1.19wmf1/extensions/MobileFrontend/ ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114310] branches/wmf/1.19wmf1/extensions/MobileFrontend/
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114310 Revision: 114310 Author: awjrichards Date: 2012-03-20 21:15:29 + (Tue, 20 Mar 2012) Log Message: --- Syncing MobileFrontend to r114306 from trunk Added Paths: --- branches/wmf/1.19wmf1/extensions/MobileFrontend/ Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Added: svn:mergeinfo + /trunk/extensions/MobileFrontend:99727 ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114314] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114314 Revision: 114314 Author: awjrichards Date: 2012-03-20 21:40:50 + (Tue, 20 Mar 2012) Log Message: --- MFT r114313 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/api/ApiQueryExtracts.php Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/ Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Modified: svn:mergeinfo - /trunk/extensions/MobileFrontend:99727 + /trunk/extensions/MobileFrontend:99727,114313 Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/api/ApiQueryExtracts.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/api/ApiQueryExtracts.php 2012-03-20 21:37:52 UTC (rev 114313) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/api/ApiQueryExtracts.php 2012-03-20 21:40:50 UTC (rev 114314) @@ -424,7 +424,7 @@ public function onHtmlReady( $html ) { if ( $this-plainText ) { $html = preg_replace( '/\s*(h([1-6])\b)/i', - ApiQueryExtracts::SECTION_MARKER_START . '$2' . ApiQueryExtracts::SECTION_MARKER_END . '$1' , + \n\n . ApiQueryExtracts::SECTION_MARKER_START . '$2' . ApiQueryExtracts::SECTION_MARKER_END . '$1' , $html ); } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114316] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114316 Revision: 114316 Author: awjrichards Date: 2012-03-20 21:45:59 + (Tue, 20 Mar 2012) Log Message: --- MFT r114315 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/ Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Modified: svn:mergeinfo - /trunk/extensions/MobileFrontend:99727,114313 + /trunk/extensions/MobileFrontend:99727,114313,114315 Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css 2012-03-20 21:43:13 UTC (rev 114315) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css 2012-03-20 21:45:59 UTC (rev 114316) @@ -289,6 +289,7 @@ button.show, button.hide { /* for non-js browsers */ display: none; + overflow: hidden; } .togglingEnabled button.hide, ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114320] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114320 Revision: 114320 Author: awjrichards Date: 2012-03-20 22:34:20 + (Tue, 20 Mar 2012) Log Message: --- MFT r114319 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/api/ApiQueryExtracts.php Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/ Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Modified: svn:mergeinfo - /trunk/extensions/MobileFrontend:99727,114313,114315 + /trunk/extensions/MobileFrontend:99727,114313,114315,114319 Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/api/ApiQueryExtracts.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/api/ApiQueryExtracts.php 2012-03-20 22:32:29 UTC (rev 114319) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/api/ApiQueryExtracts.php 2012-03-20 22:34:20 UTC (rev 114320) @@ -147,7 +147,6 @@ $regexp = '/^(.*?)(?=h[1-6]\b)/s'; } if ( preg_match( $regexp, $text, $matches ) ) { - wfDebugDieBacktrace(); $text = $matches[0]; } return $text; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114339] trunk/extensions/MobileFrontend/MobileFrontend.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114339 Revision: 114339 Author: awjrichards Date: 2012-03-21 00:31:54 + (Wed, 21 Mar 2012) Log Message: --- Followup r114332, r114336 - updating in MobileFrontend.php to reflect changes to custom logo handling in ExtMobileFrontend::setDefaultLogo() Modified Paths: -- trunk/extensions/MobileFrontend/MobileFrontend.php Modified: trunk/extensions/MobileFrontend/MobileFrontend.php === --- trunk/extensions/MobileFrontend/MobileFrontend.php 2012-03-21 00:31:52 UTC (rev 114338) +++ trunk/extensions/MobileFrontend/MobileFrontend.php 2012-03-21 00:31:54 UTC (rev 114339) @@ -154,13 +154,14 @@ * See $itemsToRemove for more information. */ $wgMFRemovableClasses = array(); + /** * Make the logos configurable. * Key for site. * Key for logo. * Example: array('site' = 'mysite', 'logo' = 'mysite_logo.png'); */ -$wgMFCustomLogos = array( array() ); +$wgMFCustomLogos = array(); // Unit tests $wgHooks['UnitTestsList'][] = 'efExtMobileFrontendUnitTests'; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114341] trunk/extensions/MobileFrontend/MobileFrontend.body.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114341 Revision: 114341 Author: awjrichards Date: 2012-03-21 01:04:25 + (Wed, 21 Mar 2012) Log Message: --- Making sure that useformat=mobile-wap is honored Modified Paths: -- trunk/extensions/MobileFrontend/MobileFrontend.body.php Modified: trunk/extensions/MobileFrontend/MobileFrontend.body.php === --- trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-21 01:02:17 UTC (rev 114340) +++ trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-21 01:04:25 UTC (rev 114341) @@ -443,7 +443,9 @@ self::$device = $device-format( $formatName ); $this-setDefaultLogo(); - $this-contentFormat = self::parseContentFormat( self::$device['view_format'] ); + // honor useformat=mobile-wap if it's set, otherwise determine by device + $viewFormat = ( $this-getUseFormat() == 'mobile-wap' ) ? 'mobile-wap' : self::$device['view_format']; + $this-contentFormat = self::parseContentFormat( $viewFormat ); if ( $mobileAction == 'leave_feedback' ) { echo $this-renderLeaveFeedbackXHTML(); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114342] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114342 Revision: 114342 Author: awjrichards Date: 2012-03-21 01:05:44 + (Wed, 21 Mar 2012) Log Message: --- MFT r114341 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/ Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Modified: svn:mergeinfo - /trunk/extensions/MobileFrontend:99727,114313,114315,114319 + /trunk/extensions/MobileFrontend:99727,114313,114315,114319,114341 Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-21 01:04:25 UTC (rev 114341) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-21 01:05:44 UTC (rev 114342) @@ -443,7 +443,9 @@ self::$device = $device-format( $formatName ); $this-setDefaultLogo(); - $this-contentFormat = self::parseContentFormat( self::$device['view_format'] ); + // honor useformat=mobile-wap if it's set, otherwise determine by device + $viewFormat = ( $this-getUseFormat() == 'mobile-wap' ) ? 'mobile-wap' : self::$device['view_format']; + $this-contentFormat = self::parseContentFormat( $viewFormat ); if ( $mobileAction == 'leave_feedback' ) { echo $this-renderLeaveFeedbackXHTML(); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114167] branches
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114167 Revision: 114167 Author: awjrichards Date: 2012-03-19 18:50:32 + (Mon, 19 Mar 2012) Log Message: --- Creating a branch for myself for experimental dev pending git migration Added Paths: --- branches/awjrichards/ branches/awjrichards/extensions/ branches/awjrichards/extensions/MobileFrontend/ ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114169] branches/awjrichards/extensions/MobileFrontend/
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114169 Revision: 114169 Author: awjrichards Date: 2012-03-19 18:57:30 + (Mon, 19 Mar 2012) Log Message: --- Removing empty created dir Removed Paths: - branches/awjrichards/extensions/MobileFrontend/ ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114191] trunk/extensions/MobileFrontend/templates/SearchTemplate.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114191 Revision: 114191 Author: awjrichards Date: 2012-03-19 21:37:02 + (Mon, 19 Mar 2012) Log Message: --- htmlspecialchars - Xml::escapeJsString Modified Paths: -- trunk/extensions/MobileFrontend/templates/SearchTemplate.php Modified: trunk/extensions/MobileFrontend/templates/SearchTemplate.php === --- trunk/extensions/MobileFrontend/templates/SearchTemplate.php 2012-03-19 21:24:48 UTC (rev 114190) +++ trunk/extensions/MobileFrontend/templates/SearchTemplate.php 2012-03-19 21:37:02 UTC (rev 114191) @@ -8,14 +8,14 @@ public function getHTML() { - $searchField = htmlspecialchars( $this-data['searchField'] ); + $searchField = Xml::escapeJsString( $this-data['searchField'] ); $mainPageUrl = $this-data['mainPageUrl']; $randomPageUrl = $this-data['randomPageUrl']; $homeButton = $this-data['messages']['mobile-frontend-home-button']; $randomButton = $this-data['messages']['mobile-frontend-random-button']; - $clearText = htmlentities( $this-data['messages']['mobile-frontend-clear-search'], ENT_QUOTES ); + $clearText = Xml::escapeJsString( $this-data['messages']['mobile-frontend-clear-search'] ); $searchValue = $this-data['messages']['mobile-frontend-search-submit']; - $placeholder = htmlentities( $this-data['messages']['mobile-frontend-placeholder'], ENT_QUOTES ); + $placeholder = Xml::escapeJsString( $this-data['messages']['mobile-frontend-placeholder'] ); $scriptUrl = wfScript(); $searchBoxDisplayNone = ( $this-data['hideSearchBox'] ) ? ' style=display: none; ' : ''; ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114193] trunk/extensions/MobileFrontend/templates/ApplicationTemplate .php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114193 Revision: 114193 Author: awjrichards Date: 2012-03-19 21:41:49 + (Mon, 19 Mar 2012) Log Message: --- Bumping css/js version #s Modified Paths: -- trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php Modified: trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php === --- trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-19 21:40:39 UTC (rev 114192) +++ trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-19 21:41:49 UTC (rev 114193) @@ -36,7 +36,7 @@ $jQuerySupport = $this-data['device']['supports_jquery']; $jQueryScript = $jQuerySupport ? $startScriptTag . $javaScriptPath . 'jquery-1.7.1.min.js' . $endScriptTag : ''; - $filePageScript = ( $this-data['isFilePage'] ) ? $startScriptTag . $javaScriptPath . 'filepage.js?version=122920111241' . $endScriptTag : ''; + $filePageScript = ( $this-data['isFilePage'] ) ? $startScriptTag . $javaScriptPath . 'filepage.js?version=1332193250' . $endScriptTag : ''; $startLinkTag = link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/; $endLinkTag = ' media='all' rel='Stylesheet' type='text/css' /; @@ -59,7 +59,7 @@ if( $this-data['isBetaGroupMember'] $jQuerySupport ) { $betajs = HTML - {$startScriptTag}{$javaScriptPath}references.{$resourceSuffix}js?version=1331257310{$endScriptTag} + {$startScriptTag}{$javaScriptPath}references.{$resourceSuffix}js?version=1332193250{$endScriptTag} HTML; } else { $betajs = ; @@ -71,8 +71,8 @@ head title{$this-data['htmlTitle']}/title meta http-equiv=content-type content=application/xhtml+xml; charset=utf-8 / - link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$betaPrefix}common.css?version=1331678715' media='all' rel='Stylesheet' type='text/css' / - link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$cssFileName}.css?version=1331678715' media='all' rel='Stylesheet' type='text/css' / + link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$betaPrefix}common.css?version=1332193250' media='all' rel='Stylesheet' type='text/css' / + link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$cssFileName}.css?version=1332193250' media='all' rel='Stylesheet' type='text/css' / {$filePageStyle} meta name=viewport content=initial-scale=1.0 {$appleTouchIconTag} @@ -90,10 +90,10 @@ /div {$this-data['footerHtml']} !--[if gt IE 9]!-- - {$startScriptTag}{$javaScriptPath}application.{$resourceSuffix}js?version=1331257310{$endScriptTag} - {$startScriptTag}{$javaScriptPath}toggle.{$resourceSuffix}js?version=1331257310{$endScriptTag} - {$startScriptTag}{$javaScriptPath}banner.{$resourceSuffix}js?version=1331257310{$endScriptTag} - {$startScriptTag}{$javaScriptPath}{$betaPrefix}opensearch.{$resourceSuffix}js?version=1331250599{$endScriptTag} + {$startScriptTag}{$javaScriptPath}application.{$resourceSuffix}js?version=1332193250{$endScriptTag} + {$startScriptTag}{$javaScriptPath}toggle.{$resourceSuffix}js?version=1332193250{$endScriptTag} + {$startScriptTag}{$javaScriptPath}banner.{$resourceSuffix}js?version=1332193250{$endScriptTag} + {$startScriptTag}{$javaScriptPath}{$betaPrefix}opensearch.{$resourceSuffix}js?version=1332193250{$endScriptTag} {$betajs} {$filePageScript} !--[endif]-- ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114197] branches/wmf/1.19wmf1/extensions/MobileFrontend/
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114197 Revision: 114197 Author: awjrichards Date: 2012-03-19 22:00:45 + (Mon, 19 Mar 2012) Log Message: --- Removing MobileFrontend in prep for svn cp from turnk Removed Paths: - branches/wmf/1.19wmf1/extensions/MobileFrontend/ ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114198] branches/wmf/1.19wmf1/extensions/MobileFrontend/
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114198 Revision: 114198 Author: awjrichards Date: 2012-03-19 22:00:50 + (Mon, 19 Mar 2012) Log Message: --- Copy MobileFrontend from trunk at r113447 Added Paths: --- branches/wmf/1.19wmf1/extensions/MobileFrontend/ Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Added: svn:mergeinfo + /trunk/extensions/MobileFrontend:99727 ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114200] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114200 Revision: 114200 Author: awjrichards Date: 2012-03-19 22:16:13 + (Mon, 19 Mar 2012) Log Message: --- r113463, r113465, r113466, r113469, r113470, r113471, r113472 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.js branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/SearchTemplate.php branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/js/fixtures.js Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/ Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Modified: svn:mergeinfo - /trunk/extensions/MobileFrontend:99727 + /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472 Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.js === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.js 2012-03-19 22:10:05 UTC (rev 114199) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.js 2012-03-19 22:16:13 UTC (rev 114200) @@ -3,18 +3,13 @@ MobileFrontend.opensearch = (function() { var apiUrl = '/api.php', timer = -1, typingDelay = 500, numResults = 15, term, - results = document.getElementById( 'results' ), search = document.getElementById( 'search' ), sq = document.getElementById( 'sq' ), sb = document.getElementById( 'searchbox' ), - logo = document.getElementById( 'logo' ), - goButton = document.getElementById( 'goButton' ), content = document.getElementById( 'content' ), footer = document.getElementById( 'footer' ), - zeroRatedBanner = document.getElementById( 'zero-rated-banner' ) || - document.getElementById( 'zero-rated-banner-red' ), clearSearch = document.getElementById( 'clearsearch' ), - focused = false, ol = {}, + focused = false, u = MobileFrontend.utils; if ( scriptPath ) { @@ -40,8 +35,7 @@ resetViewPort(); search.onfocus = function() { - var pE, pT, pTT, rrd, rrdD, - removeResultsEl; + var rrd, rrdD; sb = document.getElementById( 'searchbox' ); sq = document.getElementById( 'sq' ); content = document.getElementById( 'content' ); @@ -51,25 +45,8 @@ if ( !focused ) { MobileFrontend.utils( document.body ).addClass( 'full-screen-search' ); - pE = document.getElementById( 'placeholder' ); - if ( !pE ) { - pT = document.createElement( 'span' ); - pTT = document.createTextNode(placeholder); - pT.setAttribute( 'id', 'placeholder' ); - pT.appendChild(pTT); - sb.insertBefore( pT, sb.firstChild ); - } - pE = document.getElementById( 'placeholder' ); - if ( pE ) { - pE.style.display = 'block'; - } - - if ( pE search.value !== '' ) { - pE.style.display = 'none'; - } - - removeResultsEl = document.getElementById( 'remove-results' ); - if ( !removeResultsEl ) { + rrd = document.getElementById( 'remove-results' ); + if ( !rrd ) { rrd = document.createElement( 'a' ); rrd.setAttribute( 'href', '#' ); rrd.setAttribute( 'id', 'remove-results' ); @@ -85,12 +62,7 @@ function removeResults() { MobileFrontend.utils( document.body ).removeClass( 'full-screen-search' ); - var removeResultsEl, pE = document.getElementById( 'placeholder' ); - if ( pE ) { - pE.style.display = 'none'; - } - if ( focused ) { focused = false; } @@ -182,8 +154,8 @@ } function htmlEntities( str ) { - var text = document.createTextNode( str ); - var el = document.createElement( 'div' ); + var text = document.createTextNode( str
[MediaWiki-CVS] SVN: [114201] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114201 Revision: 114201 Author: awjrichards Date: 2012-03-19 22:18:07 + (Mon, 19 Mar 2012) Log Message: --- MFT r113486, r113488, r113512, r113553, r113640, r113642, r113644, r113645, r113685, r113693, r113695, r113714, r113720, r113721, r113726, r113730, r113769, r113770, r113771, r113778 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/Makefile branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php branches/wmf/1.19wmf1/extensions/MobileFrontend/api/ApiQueryExcerpts.php branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/application.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/application.min.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.min.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/opensearch.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/opensearch.min.js branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/common.css branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/js/fixtures.js branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/js/test_application.js Added Paths: --- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/toggle.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/toggle.min.js branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/js/test_toggle.js Removed Paths: - branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_application.js Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/ Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Modified: svn:mergeinfo - /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472 + /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778 Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/Makefile === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/Makefile2012-03-19 22:16:13 UTC (rev 114200) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/Makefile2012-03-19 22:18:07 UTC (rev 114201) @@ -2,5 +2,5 @@ java -jar yuicompressor-2.4.6.jar javascripts/application.js -o javascripts/application.min.js java -jar yuicompressor-2.4.6.jar javascripts/banner.js -o javascripts/banner.min.js java -jar yuicompressor-2.4.6.jar javascripts/opensearch.js -o javascripts/opensearch.min.js - java -jar yuicompressor-2.4.6.jar javascripts/beta_application.js -o javascripts/beta_application.min.js + java -jar yuicompressor-2.4.6.jar javascripts/toggle.js -o javascripts/toggle.min.js java -jar yuicompressor-2.4.6.jar javascripts/beta_opensearch.js -o javascripts/beta_opensearch.min.js Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-19 22:16:13 UTC (rev 114200) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-19 22:18:07 UTC (rev 114201) @@ -1276,6 +1276,7 @@ $testModules['qunit']['ext.mobilefrontend.tests'] = array( 'scripts' = array( 'tests/js/fixtures.js', 'javascripts/application.js', 'javascripts/opensearch.js', 'javascripts/banner.js', + 'javascripts/toggle.js', 'tests/js/test_toggle.js', 'tests/js/test_application.js', 'tests/js/test_opensearch.js', 'tests/js/test_banner.js' ), 'dependencies' = array( ), 'localBasePath' = dirname( __FILE__ ), Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/api/ApiQueryExcerpts.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/api/ApiQueryExcerpts.php 2012-03-19 22:16:13 UTC (rev 114200) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/api/ApiQueryExcerpts.php 2012-03-19 22:18:07 UTC (rev 114201) @@ -197,7 +197,7 @@ public function getExamples() { return array( - 'api.php?action=queryprop=excerptlength=175titles=Therion' = 'Get a 175-character
[MediaWiki-CVS] SVN: [114202] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114202 Revision: 114202 Author: awjrichards Date: 2012-03-19 22:23:33 + (Mon, 19 Mar 2012) Log Message: --- MFT r113807, r113831, r113832, r113865, r113866, r113870, r113871, r113872, r113876, r113880, r113881, r113882, r113883, r113885, r113887, r113897, r113898, r113899, r113900, r113901 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.i18n.php branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.php branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/toggle.js branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/common.css branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/operamini.css branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/FooterTemplate.php branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/SearchTemplate.php branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/MobileFrontendTest.php branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/js/test_application.js branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/js/test_toggle.js Added Paths: --- branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/images/arrow-left-beta.png branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/images/close-button-beta.png Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/ Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Modified: svn:mergeinfo - /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778 + /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778,113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901 Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-19 22:18:07 UTC (rev 114201) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-19 22:23:33 UTC (rev 114202) @@ -26,7 +26,6 @@ public static $searchField; public static $disableImagesURL; public static $enableImagesURL; - public static $disableMobileSiteURL; public static $viewNormalSiteURL; public static $currentURL; public static $displayNoticeId; @@ -72,7 +71,6 @@ 'mobile-frontend-hide-button', 'mobile-frontend-back-to-top-of-section', 'mobile-frontend-regular-site', - 'mobile-frontend-perm-stop-redirect', 'mobile-frontend-home-button', 'mobile-frontend-random-button', 'mobile-frontend-are-you-sure', @@ -231,8 +229,7 @@ self::$disableImagesURL = $wgRequest-escapeAppendQuery( 'disableImages=1' ); self::$enableImagesURL = $wgRequest-escapeAppendQuery( 'enableImages=1' ); - self::$disableMobileSiteURL = $wgRequest-escapeAppendQuery( 'mobileaction=disable_mobile_site' ); - self::$viewNormalSiteURL = $wgRequest-escapeAppendQuery( 'mobileaction=view_normal_site' ); + self::$viewNormalSiteURL = $wgRequest-escapeAppendQuery( 'useformat=desktop' ); self::$currentURL = $wgRequest-getFullRequestURL(); self::$leaveFeedbackURL = $wgRequest-escapeAppendQuery( 'mobileaction=leave_feedback' ); @@ -477,12 +474,6 @@ exit(); } - if ( $mobileAction == 'disable_mobile_site' $this-contentFormat == 'XHTML' ) { - echo $this-renderDisableMobileSiteXHTML(); - wfProfileOut( __METHOD__ ); - exit(); - } - if ( $mobileAction == 'opt_in_mobile_site' $this-contentFormat == 'XHTML' ) { echo $this-renderOptInMobileSiteXHTML(); wfProfileOut( __METHOD__ ); @@ -716,6 +707,7 @@ } $wgOut-addVaryHeader( 'Cookie' ); $wgOut-addVaryHeader( 'X-Carrier' ); + $wgOut-addVaryHeader( 'X-Images' ); wfProfileOut( __METHOD__ ); return true
[MediaWiki-CVS] SVN: [114203] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114203 Revision: 114203 Author: awjrichards Date: 2012-03-19 22:24:16 + (Mon, 19 Mar 2012) Log Message: --- MFT r113930 Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/ branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/toggle.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/toggle.min.js branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/js/test_toggle.js Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Modified: svn:mergeinfo - /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778,113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901 + /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778,113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901,113930 Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/toggle.js ___ Added: svn:eol-style + native Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/toggle.min.js ___ Added: svn:eol-style + native Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/js/test_toggle.js ___ Added: svn:eol-style + native ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114205] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114205 Revision: 114205 Author: awjrichards Date: 2012-03-19 22:25:24 + (Mon, 19 Mar 2012) Log Message: --- MFT r113942, r113971, r113987, r114005, r114025, r114100 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/Makefile branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/application.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/application.min.js branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/DisableTemplate.php branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/FooterTemplate.php Added Paths: --- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/references.js Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/ Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Modified: svn:mergeinfo - /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778,113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901,113930 + /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778,113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901,113930,113942,113971,113987,114005,114025,114100 Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/Makefile === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/Makefile2012-03-19 22:25:17 UTC (rev 114204) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/Makefile2012-03-19 22:25:24 UTC (rev 114205) @@ -3,4 +3,5 @@ java -jar yuicompressor-2.4.6.jar javascripts/banner.js -o javascripts/banner.min.js java -jar yuicompressor-2.4.6.jar javascripts/opensearch.js -o javascripts/opensearch.min.js java -jar yuicompressor-2.4.6.jar javascripts/toggle.js -o javascripts/toggle.min.js + java -jar yuicompressor-2.4.6.jar javascripts/references.js -o javascripts/references.min.js java -jar yuicompressor-2.4.6.jar javascripts/beta_opensearch.js -o javascripts/beta_opensearch.min.js Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-19 22:25:17 UTC (rev 114204) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-19 22:25:24 UTC (rev 114205) @@ -43,6 +43,7 @@ public static $logoutHtml; public static $loginHtml; public static $zeroRatedBanner; + public static $useFormatCookieName; protected $useFormat; @@ -190,7 +191,7 @@ * @return bool */ public function addMobileFooter( $obj, $tpl ) { - global $wgRequest; + global $wgRequest, $wgServer; wfProfileIn( __METHOD__ ); $title = $obj-getTitle(); @@ -202,6 +203,7 @@ $this-removeQueryStringParameter( $wgRequest-appendQuery( 'useformat=mobile' ), 'mobileaction' ) ); + $mobileViewUrl = $this-getMobileUrl( $wgServer . $mobileViewUrl ); $tpl-set( 'mobileview', a href='{$mobileViewUrl}' class='noprint' . wfMsg( 'mobile-frontend-view' ) . /a ); $footerlinks['places'][] = 'mobileview'; $tpl-set( 'footerlinks', $footerlinks ); @@ -1163,6 +1165,8 @@ 'zeroRatedBanner' = self::$zeroRatedBanner, 'showText' = self::$messages[ 'mobile-frontend-show-button' ], 'hideText' = self::$messages[ 'mobile-frontend-hide-button' ], + 'useFormatCookieName' = self::$useFormatCookieName, + 'useFormatCookieDuration' = $this-getUseFormatCookieDuration(), ); $applicationTemplate-setByArray( $options ); wfProfileOut( __METHOD__ ); @@ -1445,8 +1449,12
[MediaWiki-CVS] SVN: [114206] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114206 Revision: 114206 Author: awjrichards Date: 2012-03-19 22:26:47 + (Mon, 19 Mar 2012) Log Message: --- MFT r114134, r114136, r114144, r114145, r114150, r114152, r114157 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/references.js branches/wmf/1.19wmf1/extensions/MobileFrontend/library/WURFL/Handlers/Utils.php branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/SearchTemplate.php Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/ Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Modified: svn:mergeinfo - /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778,113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901,113930,113942,113971,113987,114005,114025,114100 + /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778,113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901,113930,113942,113971,113987,114005,114025,114100,114134,114136,114144-114145,114150,114152,114157 Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/references.js === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/references.js 2012-03-19 22:25:24 UTC (rev 114205) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/references.js 2012-03-19 22:26:47 UTC (rev 114206) @@ -1,7 +1,12 @@ if( typeof jQuery !== 'undefined' ) { MobileFrontend.references = (function($) { - var calculatePosition; + var calculatePosition, hashtest, options = {}; + hashtest = window.location.hash.substr(1).match(/refspeed:([0-9]*)/); + options.animationSpeed = hashtest ? parseInt( hashtest[1], 10 ) : 500; + hashtest = window.location.hash.substr(1).match(/refanimation:([a-z]*)/); + options.animation = hashtest ? hashtest[1] : null; + function collect() { var references = {}; $( 'ol.references li' ).each(function(i, el) { @@ -28,27 +33,51 @@ function init() { $( 'div id=mf-referencesdiv/div/div' ).hide().appendTo( document.body ); - var close = function( ev ) { - $( '#mf-references' ).fadeOut( 500 ); - }; + var close = function() { + var top; + lastLink = null; + if( options.animation === 'none' ) { + $( '#mf-references' ).hide(); + } else if( options.animation === 'slide' ){ + top = window.innerHeight + window.pageYOffset; + $( '#mf-references' ).show().animate( { top: top }, options.animationSpeed ); + } else { + $( '#mf-references' ).fadeOut( options.animationSpeed ); + } + }, lastLink; $( 'buttonclose/button' ).click( close ).appendTo( '#mf-references' ); $( '.mw-cite-backlink a' ).click( close ); var data, html, href, references = collect(); $( 'sup a' ).click( function(ev) { + var top, oh; href = $(this).attr( 'href' ); data = href href.charAt(0) === '#' ? references[ href.substr( 1, href.length ) ] : null; - if( data ) { - html = 'h3[' + data.label + ']/h3' + data.html; + if( !$(#mf-references).is(:visible) || lastLink !== href) { + lastLink = href; + if( data ) { + html = 'h3[' + data.label + ']/h3' + data.html; + } else { + html = $( 'a /' ).text( $(this).text
[MediaWiki-CVS] SVN: [114207] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114207 Revision: 114207 Author: awjrichards Date: 2012-03-19 22:28:20 + (Mon, 19 Mar 2012) Log Message: --- MFT r114177, r114184, r114190, r114191, r114193 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.min.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/references.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/toggle.min.js branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/common.css branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/SearchTemplate.php Added Paths: --- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/references.min.js Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/ Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Modified: svn:mergeinfo - /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778,113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901,113930,113942,113971,113987,114005,114025,114100,114134,114136,114144-114145,114150,114152,114157 + /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778,113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901,113930,113942,113971,113987,114005,114025,114100,114134,114136,114144-114145,114150,114152,114157,114177,114184,114190-114191,114193 Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.min.js === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.min.js 2012-03-19 22:26:47 UTC (rev 114206) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.min.js 2012-03-19 22:28:20 UTC (rev 114207) @@ -1 +1 @@ -MobileFrontend.opensearch=(function(){var c=/api.php,m=-1,d=500,z=15,q,l=document.getElementById(search),t=document.getElementById(sq),a=document.getElementById(searchbox),r=document.getElementById(content),o=document.getElementById(footer),x=document.getElementById(clearsearch),k=false,n=MobileFrontend.utils;c=MobileFrontend.setting(scriptPath)+c;function s(){results.style.display=none}function h(){if(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)){var u=n('meta[name=viewport]');if(u){u=u[0];u.content=width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0;n(document.body).bind(gesturestart,function(){u.content=width=device-width, initial-scale=1.0})}}}h();l.onfocus=function(){var u,A;a=document.getElementById(searchbox);t=document.getElementById(sq);r=document.getElementById(content);o=document.getElementById(footer);h();if(!k){MobileFrontend.utils(document.body).addClass(full-screen-search);u=document.getElementById(remove-results);if(!u){u=document.createElement(a);u.setAttribute(href,#);u.setAttribute(id,remove-results);n(u).bind(click,y);A=document.createElement(div);A.setAttribute(id,left-arrow);u.appendChild(A);t.insertBefore(u,t.firstChild)}k=true}};function y(){MobileFrontend.utils(document.body).removeClass(full-screen-search);if(k){k=false}if(x){x.style.display=none}}function b(A){var u;if(!A){A=window.event}if(A.target){u=A.target}else{if(A.srcElement){u=A.srcElement}}if(u.nodeType===3){u=u.parentNode}A.cancelBubble=true;A.stopPropagation();if(u.className===suggestion-result||u.className===search-result-item||u.className===suggestions-result||u.className===sq-val-update||u.id===results||u.id===search||u.id===searchbox||u.id===sq||u.id===placeholder||u.id===clearsearch||u.tagName===BODY){if(u.id===clearsearchresults){results.innerHTML=}}else{s()}}window.onload=function(){n(l).bind(keyup,function(){clearTimeout(m);q=this.value;if(q.length1){results.innerHTML=}else{q=encodeURIComponent(q);m=setTimeout(function(){j(q)},d)}})};function j(u){url=c+?action=opensearchlimit=+z+namespace=0format=xmlsearch=+u;n.ajax({url:url,success:function(A){p(g(A))}})}function g(D){var E=[],A,B,C,u=D.getElementsByTagName(Item);for(A=0;Au.length;A++){B=u[A];C={label:B.getElementsByTagName(Text)[0].textContent,value:B.getElementsByTagName(Url)[0].textContent};E.push(C)}return E}function i(A){var u=document.getElementById(search);if(u){u.value=A+ ;u.focus();j(u.value)}}function e(B){var A=document.createTextNode(B),u=document.createElement(div);u.appendChild(A);return u.innerHTML}function w(u){return
[MediaWiki-CVS] SVN: [114211] trunk/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114211 Revision: 114211 Author: awjrichards Date: 2012-03-19 23:19:35 + (Mon, 19 Mar 2012) Log Message: --- Added invocation of GetCacheVaryCookies hook to ad 'mf_useformat' cookie to x-vary-options Modified Paths: -- trunk/extensions/MobileFrontend/MobileFrontend.body.php trunk/extensions/MobileFrontend/MobileFrontend.php trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php Modified: trunk/extensions/MobileFrontend/MobileFrontend.body.php === --- trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-19 23:14:49 UTC (rev 114210) +++ trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-19 23:19:35 UTC (rev 114211) @@ -1503,6 +1503,11 @@ return $expiry; } + public function getCacheVaryCookies( $out, $cookies ) { + global $wgCookiePrefix; + $cookies[] = $wgCookiePrefix . 'mf_useformat'; + } + /** * Determine the duration the cookie should last. * Modified: trunk/extensions/MobileFrontend/MobileFrontend.php === --- trunk/extensions/MobileFrontend/MobileFrontend.php 2012-03-19 23:14:49 UTC (rev 114210) +++ trunk/extensions/MobileFrontend/MobileFrontend.php 2012-03-19 23:19:35 UTC (rev 114211) @@ -121,6 +121,8 @@ */ $wgMobileRedirectFormAction = false; +$wgMobileResourceVersion; + $wgExtMobileFrontend = null; $wgExtensionFunctions[] = 'efMobileFrontend_Setup'; @@ -134,6 +136,7 @@ $wgHooks['APIGetDescription'][] = 'ApiParseExtender::onAPIGetDescription'; $wgHooks['OpenSearchXml'][] = 'ApiQueryExtracts::onOpenSearchXml'; + function efMobileFrontend_Setup() { global $wgExtMobileFrontend, $wgHooks; $wgExtMobileFrontend = new ExtMobileFrontend(); @@ -142,6 +145,7 @@ $wgHooks['SkinTemplateOutputPageBeforeExec'][] = array( $wgExtMobileFrontend, 'addMobileFooter' ); $wgHooks['TestCanonicalRedirect'][] = array( $wgExtMobileFrontend, 'testCanonicalRedirect' ); $wgHooks['ResourceLoaderTestModules'][] = array( $wgExtMobileFrontend, 'addTestModules' ); + $wgHooks['GetCacheVaryCookies'][] = array( $wgExtMobileFrontend, 'getCacheVaryCookies' ); } /** Modified: trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php === --- trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-19 23:14:49 UTC (rev 114210) +++ trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-19 23:19:35 UTC (rev 114211) @@ -7,7 +7,7 @@ class ApplicationTemplate extends MobileFrontendTemplate { public function getHTML() { - + global $wgMobileResourceVersion; if ( $this-data['wgAppleTouchIcon'] !== false ) { $appleTouchIconTag = Html::element( 'link', array( 'rel' = 'apple-touch-icon', 'href' = $this-data['wgAppleTouchIcon'] ) ); } else { @@ -36,7 +36,7 @@ $jQuerySupport = $this-data['device']['supports_jquery']; $jQueryScript = $jQuerySupport ? $startScriptTag . $javaScriptPath . 'jquery-1.7.1.min.js' . $endScriptTag : ''; - $filePageScript = ( $this-data['isFilePage'] ) ? $startScriptTag . $javaScriptPath . 'filepage.js?version=1332193250' . $endScriptTag : ''; + $filePageScript = ( $this-data['isFilePage'] ) ? $startScriptTag . $javaScriptPath . 'filepage.js?version=' . $wgMobileResourceVersion . $endScriptTag : ''; $startLinkTag = link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/; $endLinkTag = ' media='all' rel='Stylesheet' type='text/css' /; @@ -59,7 +59,7 @@ if( $this-data['isBetaGroupMember'] $jQuerySupport ) { $betajs = HTML - {$startScriptTag}{$javaScriptPath}references.{$resourceSuffix}js?version=1332193250{$endScriptTag} + {$startScriptTag}{$javaScriptPath}references.{$resourceSuffix}js?version={$wgMobileResourceVersion}{$endScriptTag} HTML; } else { $betajs = ; @@ -71,8 +71,8 @@ head title{$this-data['htmlTitle']}/title meta http-equiv=content-type content=application/xhtml+xml; charset=utf-8 / - link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$betaPrefix}common.css?version=1332193250' media='all' rel='Stylesheet' type='text/css' / - link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$cssFileName}.css?version=1332193250' media='all' rel='Stylesheet' type='text/css
[MediaWiki-CVS] SVN: [114212] trunk/extensions/MobileFrontend/templates/ApplicationTemplate .php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114212 Revision: 114212 Author: awjrichards Date: 2012-03-19 23:21:58 + (Mon, 19 Mar 2012) Log Message: --- Finishing implementation of accidentally checked in in previous commit Modified Paths: -- trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php Modified: trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php === --- trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-19 23:19:35 UTC (rev 114211) +++ trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-19 23:21:58 UTC (rev 114212) @@ -90,10 +90,10 @@ /div {$this-data['footerHtml']} !--[if gt IE 9]!-- - {$startScriptTag}{$javaScriptPath}application.{$resourceSuffix}js?version=1332193250{$endScriptTag} - {$startScriptTag}{$javaScriptPath}toggle.{$resourceSuffix}js?version=1332193250{$endScriptTag} - {$startScriptTag}{$javaScriptPath}banner.{$resourceSuffix}js?version=1332193250{$endScriptTag} - {$startScriptTag}{$javaScriptPath}{$betaPrefix}opensearch.{$resourceSuffix}js?version=1332193250{$endScriptTag} + {$startScriptTag}{$javaScriptPath}application.{$resourceSuffix}js?version={$wgMobileResourceVersion}{$endScriptTag} + {$startScriptTag}{$javaScriptPath}toggle.{$resourceSuffix}js?version={$wgMobileResourceVersion}{$endScriptTag} + {$startScriptTag}{$javaScriptPath}banner.{$resourceSuffix}js?version={$wgMobileResourceVersion}{$endScriptTag} + {$startScriptTag}{$javaScriptPath}{$betaPrefix}opensearch.{$resourceSuffix}js?version={$wgMobileResourceVersion}{$endScriptTag} {$betajs} {$filePageScript} !--[endif]-- ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114213] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114213 Revision: 114213 Author: awjrichards Date: 2012-03-19 23:25:18 + (Mon, 19 Mar 2012) Log Message: --- MFT r114211, r114212 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.php branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/ Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Modified: svn:mergeinfo - /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778,113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901,113930,113942,113971,113987,114005,114025,114100,114134,114136,114144-114145,114150,114152,114157,114177,114184,114190-114191,114193 + /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778,113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901,113930,113942,113971,113987,114005,114025,114100,114134,114136,114144-114145,114150,114152,114157,114177,114184,114190-114191,114193,114211-114212 Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-19 23:21:58 UTC (rev 114212) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-19 23:25:18 UTC (rev 114213) @@ -1502,6 +1502,11 @@ return $expiry; } + public function getCacheVaryCookies( $out, $cookies ) { + global $wgCookiePrefix; + $cookies[] = $wgCookiePrefix . 'mf_useformat'; + } + /** * Determine the duration the cookie should last. * Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.php 2012-03-19 23:21:58 UTC (rev 114212) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.php 2012-03-19 23:25:18 UTC (rev 114213) @@ -120,6 +120,8 @@ */ $wgMobileRedirectFormAction = false; +$wgMobileResourceVersion; + $wgExtMobileFrontend = null; $wgExtensionFunctions[] = 'efMobileFrontend_Setup'; @@ -132,6 +134,7 @@ $wgHooks['APIGetParamDescription'][] = 'ApiParseExtender::onAPIGetParamDescription'; $wgHooks['APIGetDescription'][] = 'ApiParseExtender::onAPIGetDescription'; + function efMobileFrontend_Setup() { global $wgExtMobileFrontend, $wgHooks; $wgExtMobileFrontend = new ExtMobileFrontend(); @@ -140,6 +143,7 @@ $wgHooks['SkinTemplateOutputPageBeforeExec'][] = array( $wgExtMobileFrontend, 'addMobileFooter' ); $wgHooks['TestCanonicalRedirect'][] = array( $wgExtMobileFrontend, 'testCanonicalRedirect' ); $wgHooks['ResourceLoaderTestModules'][] = array( $wgExtMobileFrontend, 'addTestModules' ); + $wgHooks['GetCacheVaryCookies'][] = array( $wgExtMobileFrontend, 'getCacheVaryCookies' ); } /** Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-19 23:21:58 UTC (rev 114212) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-19 23:25:18 UTC (rev 114213) @@ -7,7 +7,7 @@ class ApplicationTemplate extends MobileFrontendTemplate { public function getHTML() { - + global $wgMobileResourceVersion; if ( $this-data['wgAppleTouchIcon'] !== false ) { $appleTouchIconTag = Html::element( 'link', array( 'rel' = 'apple-touch-icon', 'href' = $this-data['wgAppleTouchIcon'] ) ); } else { @@ -36,7 +36,7 @@ $jQuerySupport = $this-data['device']['supports_jquery']; $jQueryScript = $jQuerySupport ? $startScriptTag . $javaScriptPath . 'jquery-1.7.1.min.js' . $endScriptTag : ''; - $filePageScript = ( $this-data['isFilePage'] ) ? $startScriptTag . $javaScriptPath . 'filepage.js?version=1332193250' . $endScriptTag : ''; + $filePageScript = ( $this-data['isFilePage'] ) ? $startScriptTag . $javaScriptPath . 'filepage.js?version
[MediaWiki-CVS] SVN: [114214] trunk/extensions/MobileFrontend/MobileFrontend.body.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114214 Revision: 114214 Author: awjrichards Date: 2012-03-19 23:32:55 + (Mon, 19 Mar 2012) Log Message: --- Followup r114211, adding return true to hook invocation Modified Paths: -- trunk/extensions/MobileFrontend/MobileFrontend.body.php Modified: trunk/extensions/MobileFrontend/MobileFrontend.body.php === --- trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-19 23:25:18 UTC (rev 114213) +++ trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-19 23:32:55 UTC (rev 114214) @@ -1506,6 +1506,7 @@ public function getCacheVaryCookies( $out, $cookies ) { global $wgCookiePrefix; $cookies[] = $wgCookiePrefix . 'mf_useformat'; + return true; } /** ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114216] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114216 Revision: 114216 Author: awjrichards Date: 2012-03-19 23:33:57 + (Mon, 19 Mar 2012) Log Message: --- MFT r114214 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/ Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Modified: svn:mergeinfo - /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778,113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901,113930,113942,113971,113987,114005,114025,114100,114134,114136,114144-114145,114150,114152,114157,114177,114184,114190-114191,114193,114211-114212 + /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778,113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901,113930,113942,113971,113987,114005,114025,114100,114134,114136,114144-114145,114150,114152,114157,114177,114184,114190-114191,114193,114211-114212,114214 Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-19 23:33:25 UTC (rev 114215) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-19 23:33:57 UTC (rev 114216) @@ -1505,6 +1505,7 @@ public function getCacheVaryCookies( $out, $cookies ) { global $wgCookiePrefix; $cookies[] = $wgCookiePrefix . 'mf_useformat'; + return true; } /** ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114220] trunk/extensions/MobileFrontend/MobileFrontend.body.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114220 Revision: 114220 Author: awjrichards Date: 2012-03-20 00:13:47 + (Tue, 20 Mar 2012) Log Message: --- Changing mf_useformat cookie name to not use cookie prefix Modified Paths: -- trunk/extensions/MobileFrontend/MobileFrontend.body.php Modified: trunk/extensions/MobileFrontend/MobileFrontend.body.php === --- trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-20 00:04:36 UTC (rev 114219) +++ trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-20 00:13:47 UTC (rev 114220) @@ -1453,7 +1453,7 @@ global $wgRequest, $wgCookiePrefix; if ( !isset( self::$useFormatCookieName )) { - self::$useFormatCookieName = $wgCookiePrefix . 'mf_useformat'; + self::$useFormatCookieName = 'mf_useformat'; } $useFormat = $this-getUseFormat(); @@ -1505,7 +1505,7 @@ public function getCacheVaryCookies( $out, $cookies ) { global $wgCookiePrefix; - $cookies[] = $wgCookiePrefix . 'mf_useformat'; + $cookies[] = 'mf_useformat'; return true; } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114221] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114221 Revision: 114221 Author: awjrichards Date: 2012-03-20 00:14:56 + (Tue, 20 Mar 2012) Log Message: --- MFT r114220 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/ Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Modified: svn:mergeinfo - /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778,113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901,113930,113942,113971,113987,114005,114025,114100,114134,114136,114144-114145,114150,114152,114157,114177,114184,114190-114191,114193,114211-114212,114214 + /trunk/extensions/MobileFrontend:99727,113463,113465-113466,113469-113472,113486,113488,113512,113553,113640,113642,113644-113645,113685,113693,113695,113714,113720-113721,113726,113730,113769-113771,113778,113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901,113930,113942,113971,113987,114005,114025,114100,114134,114136,114144-114145,114150,114152,114157,114177,114184,114190-114191,114193,114211-114212,114214,114220 Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-20 00:13:47 UTC (rev 114220) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-20 00:14:56 UTC (rev 114221) @@ -1452,7 +1452,7 @@ global $wgRequest, $wgCookiePrefix; if ( !isset( self::$useFormatCookieName )) { - self::$useFormatCookieName = $wgCookiePrefix . 'mf_useformat'; + self::$useFormatCookieName = 'mf_useformat'; } $useFormat = $this-getUseFormat(); @@ -1504,7 +1504,7 @@ public function getCacheVaryCookies( $out, $cookies ) { global $wgCookiePrefix; - $cookies[] = $wgCookiePrefix . 'mf_useformat'; + $cookies[] = 'mf_useformat'; return true; } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114225] trunk/extensions/MobileFrontend/MobileFrontend.body.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114225 Revision: 114225 Author: awjrichards Date: 2012-03-20 00:30:39 + (Tue, 20 Mar 2012) Log Message: --- Revert r114220 Modified Paths: -- trunk/extensions/MobileFrontend/MobileFrontend.body.php Modified: trunk/extensions/MobileFrontend/MobileFrontend.body.php === --- trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-20 00:28:30 UTC (rev 114224) +++ trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-20 00:30:39 UTC (rev 114225) @@ -1453,7 +1453,7 @@ global $wgRequest, $wgCookiePrefix; if ( !isset( self::$useFormatCookieName )) { - self::$useFormatCookieName = 'mf_useformat'; + self::$useFormatCookieName = $wgCookiePrefix . 'mf_useformat'; } $useFormat = $this-getUseFormat(); @@ -1505,7 +1505,7 @@ public function getCacheVaryCookies( $out, $cookies ) { global $wgCookiePrefix; - $cookies[] = 'mf_useformat'; + $cookies[] = $wgCookiePrefix . 'mf_useformat'; return true; } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [114229] branches/awjrichards/extensions
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114229 Revision: 114229 Author: awjrichards Date: 2012-03-20 01:02:41 + (Tue, 20 Mar 2012) Log Message: --- Sync to trunk plus playing around with FormSpecialPage for contact form, seems too constraining Modified Paths: -- branches/awjrichards/extensions/MobileFrontend/MobileFrontend.body.php branches/awjrichards/extensions/MobileFrontend/MobileFrontend.i18n.php branches/awjrichards/extensions/MobileFrontend/MobileFrontend.php branches/awjrichards/extensions/MobileFrontend/javascripts/beta_opensearch.min.js branches/awjrichards/extensions/MobileFrontend/javascripts/references.js branches/awjrichards/extensions/MobileFrontend/javascripts/toggle.min.js branches/awjrichards/extensions/MobileFrontend/stylesheets/common.css branches/awjrichards/extensions/MobileFrontend/templates/ApplicationTemplate.php branches/awjrichards/extensions/MobileFrontend/templates/SearchTemplate.php Added Paths: --- branches/awjrichards/extensions/MobileFrontend/ branches/awjrichards/extensions/MobileFrontend/javascripts/references.min.js Property changes on: branches/awjrichards/extensions/MobileFrontend ___ Added: svn:mergeinfo + /trunk/extensions/MobileFrontend:99727,114170-114227 Modified: branches/awjrichards/extensions/MobileFrontend/MobileFrontend.body.php === --- trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-19 18:57:30 UTC (rev 114169) +++ branches/awjrichards/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-20 01:02:41 UTC (rev 114229) @@ -1503,6 +1503,12 @@ return $expiry; } + public function getCacheVaryCookies( $out, $cookies ) { + global $wgCookiePrefix; + $cookies[] = $wgCookiePrefix . 'mf_useformat'; + return true; + } + /** * Determine the duration the cookie should last. * Modified: branches/awjrichards/extensions/MobileFrontend/MobileFrontend.i18n.php === --- trunk/extensions/MobileFrontend/MobileFrontend.i18n.php 2012-03-19 18:57:30 UTC (rev 114169) +++ branches/awjrichards/extensions/MobileFrontend/MobileFrontend.i18n.php 2012-03-20 01:02:41 UTC (rev 114229) @@ -75,6 +75,8 @@ 'mobile-frontend-dismiss-notification' = 'dismiss this notification', 'mobile-frontend-sopa-notice' = 'h3 id=sopa-noticeThank you for protecting Wikipedia./h3br/a href=http://en.wikipedia.org/wiki/Wikipedia:SOPA_initiative/Mobile_Learn_more;(We’re not done yet.)/a', 'mobile-frontend-clear-search' = 'Clear', + 'mobilefrontendcontactus' = 'Contact us', + 'mobile-frontend-contact-us-email-default' = 'Your email address', ); /** Message documentation (Message documentation) @@ -113,6 +115,8 @@ 'mobile-frontend-placeholder' = 'Phrase used to prompt user to use search interface for mobile full screen search', 'mobile-frontend-dismiss-notification' = 'Phrase used to dismiss the top banner notification', 'mobile-frontend-clear-search' = 'Tooltip for clear button that appears when you type into search box', + 'mobilefrontendcontactus' = 'Title for SpecialMobileFrontendContactUs - a contact form.', + 'mobile-frontend-contact-us-email-default' = 'Default text to appear in the email textfield on the contact page', ); /** Ṫuroyo (Ṫuroyo) @@ -3544,8 +3548,11 @@ 'mobile-frontend-clear-search' = '지우기', ); -/** Karachay-Balkar (Къарачай-Малкъар) */ +/** Karachay-Balkar (Къарачай-Малкъар) + * @author Iltever + */ $messages['krc'] = array( + 'mobile-frontend-desc' = 'Мобил интерфейс', 'mobile-frontend-search-submit' = 'Бар', 'mobile-frontend-search-results' = 'Излеуню эсеблери', 'mobile-frontend-no-article-found' = 'Статья табылмады', @@ -3562,15 +3569,29 @@ 'mobile-frontend-error-page-title' = 'Проблемабыз барды!', 'mobile-frontend-error-page-text' = 'Мобил Википедия тири ишлене тургъан стадиядады, биз бек кюрешебиз бютеу ичиндеги халатларыбызны кетерирге деб. Бу халатны юсюнден билдириу келгенди бизге, къысха заманны ичинде тюзетирге деб турабыз. Кесек замандан джангыдан къарагъыз.', 'mobile-frontend-are-you-sure' = 'Таукелмисиз ?', - 'mobile-frontend-explain-disable' = 'Википедияны мобил версиясын джукълатыргъа таукелмисиз? bДжукълатны/b сайласагъыз, Википедиягъа энди кирген сагъатыгъызда сайтны мобил аппартлагъа версиясына автомат джибериллик тюйюлсюз.', + 'mobile-frontend-explain-disable' = '{{SITENAME}}ны мобил версиясын джукълатыргъа таукелмисиз? bДжукълатны/b сайласагъыз, {{SITENAME}}гъа энди кирген сагъатыгъызда сайтны мобил аппартлагъа версиясына автомат джибериллик тюйюлсюз
[MediaWiki-CVS] SVN: [114230] branches/awjrichards/extensions
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114230 Revision: 114230 Author: awjrichards Date: 2012-03-20 01:04:19 + (Tue, 20 Mar 2012) Log Message: --- Move experimental branch to a more experimental branch name so it doesnt get in my way Added Paths: --- branches/awjrichards/extensions/MobileFrontend_contact_formspecialpage/ Removed Paths: - branches/awjrichards/extensions/MobileFrontend/ ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [113971] trunk/extensions/MobileFrontend/templates/DisableTemplate.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113971 Revision: 113971 Author: awjrichards Date: 2012-03-15 23:08:18 + (Thu, 15 Mar 2012) Log Message: --- Fix for bug 35249, makes disable mobile version confirmation page properly redirect after confirmation Modified Paths: -- trunk/extensions/MobileFrontend/templates/DisableTemplate.php Modified: trunk/extensions/MobileFrontend/templates/DisableTemplate.php === --- trunk/extensions/MobileFrontend/templates/DisableTemplate.php 2012-03-15 23:03:51 UTC (rev 113970) +++ trunk/extensions/MobileFrontend/templates/DisableTemplate.php 2012-03-15 23:08:18 UTC (rev 113971) @@ -8,7 +8,9 @@ public function getHTML() { - $currentURL = str_replace( 'mobileaction=disable_mobile_site', '', $this-data['currentURL'] ); // TODO: $currentURl is unused + + $currentURL = str_replace( 'mobileaction=disable_mobile_site', '', $this-data['currentURL'] ); + $currentURL = str_replace( 'useformat=mobile', '', $currentURL ); $mobileRedirectFormAction = $this-data['mobileRedirectFormAction']; $disableHtml = HTML @@ -20,7 +22,7 @@ /p div id='disableButtons' form action='{$mobileRedirectFormAction}' method='get' - input name='to' type='hidden' value='{$this-data['currentURL']}' / + input name='to' type='hidden' value='{$currentURL}' / input name='expires_in_days' type='hidden' value='3650' / button id='disableButton' type='submit'{$this-data['disableButton']}/button /form ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [113973] branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ DisableTemplate.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113973 Revision: 113973 Author: awjrichards Date: 2012-03-15 23:10:53 + (Thu, 15 Mar 2012) Log Message: --- MFT r113971 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/DisableTemplate.php Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/DisableTemplate.php Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/DisableTemplate.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/DisableTemplate.php 2012-03-15 23:10:14 UTC (rev 113972) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/DisableTemplate.php 2012-03-15 23:10:53 UTC (rev 113973) @@ -8,7 +8,9 @@ public function getHTML() { - $currentURL = str_replace( 'mobileaction=disable_mobile_site', '', $this-data['currentURL'] ); // TODO: $currentURl is unused + + $currentURL = str_replace( 'mobileaction=disable_mobile_site', '', $this-data['currentURL'] ); + $currentURL = str_replace( 'useformat=mobile', '', $currentURL ); $mobileRedirectFormAction = $this-data['mobileRedirectFormAction']; $disableHtml = HTML @@ -20,7 +22,7 @@ /p div id='disableButtons' form action='{$mobileRedirectFormAction}' method='get' - input name='to' type='hidden' value='{$this-data['currentURL']}' / + input name='to' type='hidden' value='{$currentURL}' / input name='expires_in_days' type='hidden' value='3650' / button id='disableButton' type='submit'{$this-data['disableButton']}/button /form Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/DisableTemplate.php ___ Added: svn:mergeinfo + /trunk/extensions/MobileFrontend/templates/DisableTemplate.php:99727,113442,113444,113471-113472,113486,113512,113553,113778,113971 ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [113987] trunk/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113987 Revision: 113987 Author: awjrichards Date: 2012-03-16 01:27:26 + (Fri, 16 Mar 2012) Log Message: --- * Adds ExtMobileFrontend::$useFormatCookieName property so we can pass full mf_useformat cookie name to application.js * Makes 'Mobile view' URL generation generate a full URL using the mobile URL template * Refactors determining cookie's duration logic into its own method * Uses native PHP setcookie() to set mf_useformat cookie * Makes clicking on 'Desktop view' link use Javascript to change the cookie value to 'desktop' before redirecting the user (specifically to bypass WMF mobile varnish servers once squid config changes are complete [see rt #2645]) Modified Paths: -- trunk/extensions/MobileFrontend/MobileFrontend.body.php trunk/extensions/MobileFrontend/javascripts/application.js trunk/extensions/MobileFrontend/javascripts/application.min.js trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php trunk/extensions/MobileFrontend/templates/FooterTemplate.php Modified: trunk/extensions/MobileFrontend/MobileFrontend.body.php === --- trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-16 01:26:34 UTC (rev 113986) +++ trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-16 01:27:26 UTC (rev 113987) @@ -43,6 +43,7 @@ public static $logoutHtml; public static $loginHtml; public static $zeroRatedBanner; + public static $useFormatCookieName; protected $useFormat; @@ -190,7 +191,7 @@ * @return bool */ public function addMobileFooter( $obj, $tpl ) { - global $wgRequest; + global $wgRequest, $wgServer; wfProfileIn( __METHOD__ ); $title = $obj-getTitle(); @@ -202,6 +203,7 @@ $this-removeQueryStringParameter( $wgRequest-appendQuery( 'useformat=mobile' ), 'mobileaction' ) ); + $mobileViewUrl = $this-getMobileUrl( $wgServer . $mobileViewUrl ); $tpl-set( 'mobileview', a href='{$mobileViewUrl}' class='noprint' . wfMsg( 'mobile-frontend-view' ) . /a ); $footerlinks['places'][] = 'mobileview'; $tpl-set( 'footerlinks', $footerlinks ); @@ -1164,6 +1166,8 @@ 'zeroRatedBanner' = self::$zeroRatedBanner, 'showText' = self::$messages[ 'mobile-frontend-show-button' ], 'hideText' = self::$messages[ 'mobile-frontend-hide-button' ], + 'useFormatCookieName' = self::$useFormatCookieName, + 'useFormatCookieDuration' = $this-getUseFormatCookieDuration(), ); $applicationTemplate-setByArray( $options ); wfProfileOut( __METHOD__ ); @@ -1446,8 +1450,12 @@ } public function checkUseFormatCookie() { - global $wgRequest; + global $wgRequest, $wgCookiePrefix; + if ( !isset( self::$useFormatCookieName )) { + self::$useFormatCookieName = $wgCookiePrefix . 'mf_useformat'; + } + $useFormat = $this-getUseFormat(); $useFormatFromCookie = $wgRequest-getCookie( 'mf_useformat' ); @@ -1472,27 +1480,44 @@ * @param string The format to store in the cookie */ protected function setUseFormatCookie( $useFormat ) { - global $wgRequest; + global $wgRequest, $wgCookiePath, $wgCookieSecure, $wgCookieDomain; $expiry = $this-getUseFormatCookieExpiry(); - $wgRequest-response()-setCookie( 'mf_useformat', $useFormat, $expiry ); + + // use regular php setcookie() rather than WebResponse::setCookie + // so we can ignore $wgCookieHttpOnly since the protection it provides + // is irrelevant for this cookie. + setcookie( self::$useFormatCookieName, $useFormat, $expiry, $wgCookiePath, $wgCookieDomain, $wgCookieSecure ); } /** * Get the expiration time for the mf_useformat cookie * -* If $wgMobileFrontendFormatCookieExpiry as a non-0 value, * @param int The base time (in seconds since Epoch) from which to calculate * cookie expiration. If null, time() is used. +* @return int The time (in seconds since Epoch) that the cookie should expire */ protected function
[MediaWiki-CVS] SVN: [113865] trunk/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113865 Revision: 113865 Author: awjrichards Date: 2012-03-14 21:55:22 + (Wed, 14 Mar 2012) Log Message: --- * Changing how 'sticky cookies' work as well as how manually switching between mobile/desktop views works. If on desktop view, clicking on 'Mobile view' will switch the user into the mobile view, and will persist until either the cookie expires or user manually switches back to desktop view. Same is true for desktop view. * Changed corresponding language in i18n file. * Removed 'permanantly disable mobile view' functionality and language from i18n file * Added global variable to set useformat cookie expiration length. Defaults to $wgCookieExpirationx Modified Paths: -- trunk/extensions/MobileFrontend/MobileFrontend.body.php trunk/extensions/MobileFrontend/MobileFrontend.i18n.php trunk/extensions/MobileFrontend/MobileFrontend.php Modified: trunk/extensions/MobileFrontend/MobileFrontend.body.php === --- trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-14 21:53:30 UTC (rev 113864) +++ trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-14 21:55:22 UTC (rev 113865) @@ -26,7 +26,6 @@ public static $searchField; public static $disableImagesURL; public static $enableImagesURL; - public static $disableMobileSiteURL; public static $viewNormalSiteURL; public static $currentURL; public static $displayNoticeId; @@ -72,7 +71,6 @@ 'mobile-frontend-hide-button', 'mobile-frontend-back-to-top-of-section', 'mobile-frontend-regular-site', - 'mobile-frontend-perm-stop-redirect', 'mobile-frontend-home-button', 'mobile-frontend-random-button', 'mobile-frontend-are-you-sure', @@ -231,8 +229,7 @@ self::$disableImagesURL = $wgRequest-escapeAppendQuery( 'disableImages=1' ); self::$enableImagesURL = $wgRequest-escapeAppendQuery( 'enableImages=1' ); - self::$disableMobileSiteURL = $wgRequest-escapeAppendQuery( 'mobileaction=disable_mobile_site' ); - self::$viewNormalSiteURL = $wgRequest-escapeAppendQuery( 'mobileaction=view_normal_site' ); + self::$viewNormalSiteURL = $wgRequest-escapeAppendQuery( 'useformat=desktop' ); self::$currentURL = $wgRequest-getFullRequestURL(); self::$leaveFeedbackURL = $wgRequest-escapeAppendQuery( 'mobileaction=leave_feedback' ); @@ -478,12 +475,6 @@ exit(); } - if ( $mobileAction == 'disable_mobile_site' $this-contentFormat == 'XHTML' ) { - echo $this-renderDisableMobileSiteXHTML(); - wfProfileOut( __METHOD__ ); - exit(); - } - if ( $mobileAction == 'opt_in_mobile_site' $this-contentFormat == 'XHTML' ) { echo $this-renderOptInMobileSiteXHTML(); wfProfileOut( __METHOD__ ); @@ -858,54 +849,6 @@ } /** -* @return string -*/ - private function renderDisableMobileSiteXHTML() { - wfProfileIn( __METHOD__ ); - if ( $this-contentFormat == 'XHTML' ) { - $this-getMsg(); - $areYouSure = self::$messages['mobile-frontend-are-you-sure']; - $explainDisable = self::$messages['mobile-frontend-explain-disable']; - $disableButton = self::$messages['mobile-frontend-disable-button']; - $backButton = self::$messages['mobile-frontend-back-button']; - $htmlTitle = $areYouSure; - $title = $areYouSure; - $searchTemplate = $this-getSearchTemplate(); - $searchWebkitHtml = $searchTemplate-getHTML(); - $footerTemplate = $this-getFooterTemplate(); - $footerHtml = $footerTemplate-getHTML(); - $disableTemplate = new DisableTemplate(); - $options = array( - 'currentURL' = self::$currentURL, - 'mobileRedirectFormAction' = self::$mobileRedirectFormAction, - 'areYouSure' = $areYouSure, - 'explainDisable' = $explainDisable, - 'disableButton' = $disableButton, - 'backButton' = $backButton, - 'htmlTitle' = $htmlTitle
[MediaWiki-CVS] SVN: [113866] trunk/extensions/MobileFrontend/tests/MobileFrontendTest.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113866 Revision: 113866 Author: awjrichards Date: 2012-03-14 22:14:08 + (Wed, 14 Mar 2012) Log Message: --- Followup r113865, fixing unit tests I broke Modified Paths: -- trunk/extensions/MobileFrontend/tests/MobileFrontendTest.php Modified: trunk/extensions/MobileFrontend/tests/MobileFrontendTest.php === --- trunk/extensions/MobileFrontend/tests/MobileFrontendTest.php 2012-03-14 21:55:22 UTC (rev 113865) +++ trunk/extensions/MobileFrontend/tests/MobileFrontendTest.php 2012-03-14 22:14:08 UTC (rev 113866) @@ -219,15 +219,14 @@ array( false, null, array() ), array( true, 'webkit', array() ), array( false, 'webkit', array( 'action' = 'edit' ) ), - array( false, 'webkit', array( 'mobileaction' = 'view_normal_site' ) ), + array( false, 'webkit', array( 'useformat' = 'desktop' ) ), array( true, null, array( 'useformat' = 'mobile-wap' ) ), array( false, null, array( 'useformat' = 'mobile-wap', 'action' = 'edit' ) ), array( false, null, array( 'useformat' = 'mobile-wap', 'action' = 'history' ) ), - array( false, null, array( 'useformat' = 'mobile-wap', 'mobileaction' = 'view_normal_site' ) ), + array( false, null, array( 'useformat' = 'desktop' ) ), array( true, null, array( 'useformat' = 'mobile' ) ), array( false, null, array( 'useformat' = 'mobile', 'action' = 'edit' ) ), array( false, null, array( 'useformat' = 'mobile', 'action' = 'history' ) ), - array( false, null, array( 'useformat' = 'mobile', 'mobileaction' = 'view_normal_site' ) ), ); } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [113870] trunk/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113870 Revision: 113870 Author: awjrichards Date: 2012-03-14 22:50:20 + (Wed, 14 Mar 2012) Log Message: --- Followup r113865, removing 'disable mobile site permanantly' elements from footer template Modified Paths: -- trunk/extensions/MobileFrontend/MobileFrontend.body.php trunk/extensions/MobileFrontend/templates/FooterTemplate.php Modified: trunk/extensions/MobileFrontend/MobileFrontend.body.php === --- trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-14 22:34:54 UTC (rev 113869) +++ trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-14 22:50:20 UTC (rev 113870) @@ -1398,7 +1398,7 @@ $action = $this-getAction(); - if ( $action === 'edit' || $action === 'history' ) { + if ( $action === 'edit' ){// || $action === 'history' ) { return false; } Modified: trunk/extensions/MobileFrontend/templates/FooterTemplate.php === --- trunk/extensions/MobileFrontend/templates/FooterTemplate.php 2012-03-14 22:34:54 UTC (rev 113869) +++ trunk/extensions/MobileFrontend/templates/FooterTemplate.php 2012-03-14 22:50:20 UTC (rev 113870) @@ -9,14 +9,12 @@ public function getHTML() { $regularSite = $this-data['messages']['mobile-frontend-regular-site']; - $permStopRedirect = $this-data['messages']['mobile-frontend-perm-stop-redirect']; $copyright = $this-data['messages']['mobile-frontend-copyright']; $disableImages = $this-data['messages']['mobile-frontend-disable-images']; $enableImages = $this-data['messages']['mobile-frontend-enable-images']; $leaveFeedback = $this-data['messages']['mobile-frontend-leave-feedback']; $leaveFeedbackURL = $this-data['leaveFeedbackURL']; - $disableMobileSiteURL = $this-data['disableMobileSiteURL']; $viewNormalSiteURL = $this-data['viewNormalSiteURL']; if ( $this-data['disableImages'] == 0 ) { @@ -39,9 +37,6 @@ div class='nav' id='footmenu' div class='mwm-notice' a href={$viewNormalSiteURL}{$regularSite}/a | a href={$imagesURL}{$imagesToggle}/a {$feedbackLink} {$logoutLink} - div id=perm - a href={$disableMobileSiteURL}{$permStopRedirect}/a - /div /div /div div id='copyright'{$copyright}/div ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [113871] trunk/extensions/MobileFrontend/templates/FooterTemplate.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113871 Revision: 113871 Author: awjrichards Date: 2012-03-14 22:53:40 + (Wed, 14 Mar 2012) Log Message: --- Revert r113870, accidentally checked in code Modified Paths: -- trunk/extensions/MobileFrontend/templates/FooterTemplate.php Modified: trunk/extensions/MobileFrontend/templates/FooterTemplate.php === --- trunk/extensions/MobileFrontend/templates/FooterTemplate.php 2012-03-14 22:50:20 UTC (rev 113870) +++ trunk/extensions/MobileFrontend/templates/FooterTemplate.php 2012-03-14 22:53:40 UTC (rev 113871) @@ -9,12 +9,14 @@ public function getHTML() { $regularSite = $this-data['messages']['mobile-frontend-regular-site']; + $permStopRedirect = $this-data['messages']['mobile-frontend-perm-stop-redirect']; $copyright = $this-data['messages']['mobile-frontend-copyright']; $disableImages = $this-data['messages']['mobile-frontend-disable-images']; $enableImages = $this-data['messages']['mobile-frontend-enable-images']; $leaveFeedback = $this-data['messages']['mobile-frontend-leave-feedback']; $leaveFeedbackURL = $this-data['leaveFeedbackURL']; + $disableMobileSiteURL = $this-data['disableMobileSiteURL']; $viewNormalSiteURL = $this-data['viewNormalSiteURL']; if ( $this-data['disableImages'] == 0 ) { @@ -37,6 +39,9 @@ div class='nav' id='footmenu' div class='mwm-notice' a href={$viewNormalSiteURL}{$regularSite}/a | a href={$imagesURL}{$imagesToggle}/a {$feedbackLink} {$logoutLink} + div id=perm + a href={$disableMobileSiteURL}{$permStopRedirect}/a + /div /div /div div id='copyright'{$copyright}/div ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [113872] trunk/extensions/MobileFrontend/templates/FooterTemplate.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113872 Revision: 113872 Author: awjrichards Date: 2012-03-14 22:56:40 + (Wed, 14 Mar 2012) Log Message: --- Follow up r113870, r113865, checking in only what I meant to the first time! Removing 'disable mobile site permanantly' elements from footer template Modified Paths: -- trunk/extensions/MobileFrontend/templates/FooterTemplate.php Modified: trunk/extensions/MobileFrontend/templates/FooterTemplate.php === --- trunk/extensions/MobileFrontend/templates/FooterTemplate.php 2012-03-14 22:53:40 UTC (rev 113871) +++ trunk/extensions/MobileFrontend/templates/FooterTemplate.php 2012-03-14 22:56:40 UTC (rev 113872) @@ -9,14 +9,12 @@ public function getHTML() { $regularSite = $this-data['messages']['mobile-frontend-regular-site']; - $permStopRedirect = $this-data['messages']['mobile-frontend-perm-stop-redirect']; $copyright = $this-data['messages']['mobile-frontend-copyright']; $disableImages = $this-data['messages']['mobile-frontend-disable-images']; $enableImages = $this-data['messages']['mobile-frontend-enable-images']; $leaveFeedback = $this-data['messages']['mobile-frontend-leave-feedback']; $leaveFeedbackURL = $this-data['leaveFeedbackURL']; - $disableMobileSiteURL = $this-data['disableMobileSiteURL']; $viewNormalSiteURL = $this-data['viewNormalSiteURL']; if ( $this-data['disableImages'] == 0 ) { @@ -39,9 +37,6 @@ div class='nav' id='footmenu' div class='mwm-notice' a href={$viewNormalSiteURL}{$regularSite}/a | a href={$imagesURL}{$imagesToggle}/a {$feedbackLink} {$logoutLink} - div id=perm - a href={$disableMobileSiteURL}{$permStopRedirect}/a - /div /div /div div id='copyright'{$copyright}/div ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [113876] trunk/extensions/MobileFrontend/MobileFrontend.body.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113876 Revision: 113876 Author: awjrichards Date: 2012-03-14 23:24:18 + (Wed, 14 Mar 2012) Log Message: --- Followup r113871, finishing revert of r113870 Modified Paths: -- trunk/extensions/MobileFrontend/MobileFrontend.body.php Modified: trunk/extensions/MobileFrontend/MobileFrontend.body.php === --- trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-14 23:16:09 UTC (rev 113875) +++ trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-14 23:24:18 UTC (rev 113876) @@ -1398,7 +1398,7 @@ $action = $this-getAction(); - if ( $action === 'edit' ){// || $action === 'history' ) { + if ( $action === 'edit' || $action === 'history' ) { return false; } ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [113887] trunk/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113887 Revision: 113887 Author: awjrichards Date: 2012-03-15 01:43:17 + (Thu, 15 Mar 2012) Log Message: --- * Abstracted cookie expiration time handling to its own method * Added unit tests for cookie expiration time handling method as well as getUseFormat() * Wanted to add further unit tests around cookie handling, but I cannot get PHPUnit playing nicely with cookies. At first it was causing header issues until prielly suggested disabling output buffereing for the test method, which quieted the errors. However, setcookie() seems to have actual effect in the tests (see commented out tests in this commit). Open to suggestions :) Modified Paths: -- trunk/extensions/MobileFrontend/MobileFrontend.body.php trunk/extensions/MobileFrontend/tests/MobileFrontendTest.php Modified: trunk/extensions/MobileFrontend/MobileFrontend.body.php === --- trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-15 01:42:34 UTC (rev 113886) +++ trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-15 01:43:17 UTC (rev 113887) @@ -1472,11 +1472,25 @@ * @param string The format to store in the cookie */ protected function setUseFormatCookie( $useFormat ) { - global $wgRequest, $wgCookieExpiration, $wgMobileFrontendFormatCookieExpiry; - $cookieDuration = ( $wgMobileFrontendFormatCookieExpiry ) ? + global $wgRequest; + $expiry = $this-getUseFormatCookieExpiry(); + $wgRequest-response()-setCookie( 'mf_useformat', $useFormat, $expiry ); + } + + /** +* Get the expiration time for the mf_useformat cookie +* +* If $wgMobileFrontendFormatCookieExpiry as a non-0 value, +* @param int The base time (in seconds since Epoch) from which to calculate +* cookie expiration. If null, time() is used. +*/ + protected function getUseFormatCookieExpiry( $startTime=null ) { + global $wgCookieExpiration, $wgMobileFrontendFormatCookieExpiry; + $cookieDuration = ( abs( intval( $wgMobileFrontendFormatCookieExpiry ) ) 0 ) ? $wgMobileFrontendFormatCookieExpiry : $wgCookieExpiration; - $expire = time() + $cookieDuration; - $wgRequest-response()-setCookie( 'mf_useformat', $useFormat, $expire ); + if ( intval( $startTime ) === 0 ) $startTime = time(); + $expiry = $startTime + $cookieDuration; + return $expiry; } public function getVersion() { Modified: trunk/extensions/MobileFrontend/tests/MobileFrontendTest.php === --- trunk/extensions/MobileFrontend/tests/MobileFrontendTest.php 2012-03-15 01:42:34 UTC (rev 113886) +++ trunk/extensions/MobileFrontend/tests/MobileFrontendTest.php 2012-03-15 01:43:17 UTC (rev 113887) @@ -301,4 +301,65 @@ array( 'edit' ), ); } + + /** +* @dataProvider getUseFormatProvider +*/ + public function testGetUseFormat( $explicit, $requestParam, $expected ) { + global $wgRequest, $wgExtMobileFrontend; + $wgRequest-setVal( 'useformat', $requestParam ); + $wgExtMobileFrontend-setUseFormat( $explicit ); + $this-assertEquals( $expected, $wgExtMobileFrontend-getUseFormat() ); + } + + public function getUseFormatProvider() { + return array( + array( 'mobile', null, 'mobile' ), + array( null, 'mobile', 'mobile' ), + array( null, null, '' ), + array( 'desktop', 'mobile', 'desktop' ), + ); + } + + public function testGetUseFormatCookieExpiry() { + global $wgExtMobileFrontend, $wgCookieExpiration, $wgMobileFrontendFormatCookieExpiry; + $getUseFormatCookieExpiry = self::getMethod( 'getUseFormatCookieExpiry' ); + + $origMFCookieExpiry = $wgMobileFrontendFormatCookieExpiry; + $startTime = time(); + $wgMobileFrontendFormatCookieExpiry = 60; + $mfCookieExpected = $startTime + 60; + $this-assertTrue( $mfCookieExpected == $getUseFormatCookieExpiry-invokeArgs( $wgExtMobileFrontend, array( $startTime ) ), 'Using MobileFrontend expiry.' ); + + $wgMobileFrontendFormatCookieExpiry = null; + $defaultMWCookieExpected = $startTime + $wgCookieExpiration; + $this-assertTrue( $defaultMWCookieExpected == $getUseFormatCookieExpiry-invokeArgs( $wgExtMobileFrontend, array( $startTime ) ), 'Using
[MediaWiki-CVS] SVN: [113769] trunk/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113769 Revision: 113769 Author: awjrichards Date: 2012-03-13 22:06:54 + (Tue, 13 Mar 2012) Log Message: --- Bumping CSS version Modified Paths: -- trunk/extensions/MobileFrontend/MobileFrontend.i18n.php trunk/extensions/MobileFrontend/MobileFrontend.php trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php Modified: trunk/extensions/MobileFrontend/MobileFrontend.i18n.php === --- trunk/extensions/MobileFrontend/MobileFrontend.i18n.php 2012-03-13 22:01:57 UTC (rev 113768) +++ trunk/extensions/MobileFrontend/MobileFrontend.i18n.php 2012-03-13 22:06:54 UTC (rev 113769) @@ -76,6 +76,10 @@ 'mobile-frontend-dismiss-notification' = 'dismiss this notification', 'mobile-frontend-sopa-notice' = 'h3 id=sopa-noticeThank you for protecting Wikipedia./h3br/a href=http://en.wikipedia.org/wiki/Wikipedia:SOPA_initiative/Mobile_Learn_more;(We’re not done yet.)/a', 'mobile-frontend-clear-search' = 'Clear', + + //SpecialMobileFrontendContactUs + 'mobilefrontendcontactus' = 'Contact us', + 'mobilefrontendcontactus-description' = 'A contact page for MobileFrontend', ); /** Message documentation (Message documentation) @@ -112,6 +116,9 @@ 'mobile-frontend-placeholder' = 'Phrase used to prompt user to use search interface for mobile full screen search', 'mobile-frontend-dismiss-notification' = 'Phrase used to dismiss the top banner notification', 'mobile-frontend-clear-search' = 'Tooltip for clear button that appears when you type into search box', + + //SpecialMobileFrontendContactUs + 'mobilefrontendcontactus-description' = '{{desc}}', ); /** Achinese (Acèh) */ Modified: trunk/extensions/MobileFrontend/MobileFrontend.php === --- trunk/extensions/MobileFrontend/MobileFrontend.php 2012-03-13 22:01:57 UTC (rev 113768) +++ trunk/extensions/MobileFrontend/MobileFrontend.php 2012-03-13 22:06:54 UTC (rev 113769) @@ -64,12 +64,24 @@ 'ApplicationWmlTemplate' = 'templates/ApplicationWmlTemplate', 'ThanksNoticeTemplate' = 'templates/ThanksNoticeTemplate', 'SopaNoticeTemplate' = 'templates/SopaNoticeTemplate', + + // special pages + 'SpecialMobileFrontendContactUs' = 'special/SpecialMobileFrontendContactUs', ); foreach ( $autoloadClasses as $className = $classFilename ) { $wgAutoloadClasses[$className] = $cwd/$classFilename.php; } +// Special page definitions (classes autloaded above) +$specialPages = array( + 'MobileFrontendContactUs' = 'SpecialMobileFrontendContactUs', +); + +foreach ( $specialPages as $specialPageName = $specialClassName ) { + $wgSpecialPages[ $specialPageName ] = $specialClassName; +} + /** * Path to the logo used in the mobile view * Modified: trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php === --- trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-13 22:01:57 UTC (rev 113768) +++ trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-13 22:06:54 UTC (rev 113769) @@ -61,8 +61,8 @@ head title{$this-data['htmlTitle']}/title meta http-equiv=content-type content=application/xhtml+xml; charset=utf-8 / - link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$betaPrefix}common.css?version=1331257310' media='all' rel='Stylesheet' type='text/css' / - link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$cssFileName}.css?version=1331257310' media='all' rel='Stylesheet' type='text/css' / + link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$betaPrefix}common.css?version=1331676342' media='all' rel='Stylesheet' type='text/css' / + link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$cssFileName}.css?version=1331676342' media='all' rel='Stylesheet' type='text/css' / {$filePageStyle} meta name=viewport content=initial-scale=1.0 {$appleTouchIconTag} ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [113770] trunk/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113770 Revision: 113770 Author: awjrichards Date: 2012-03-13 22:07:44 + (Tue, 13 Mar 2012) Log Message: --- Revert r113769, mistakenly checked in code Modified Paths: -- trunk/extensions/MobileFrontend/MobileFrontend.i18n.php trunk/extensions/MobileFrontend/MobileFrontend.php trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php Modified: trunk/extensions/MobileFrontend/MobileFrontend.i18n.php === --- trunk/extensions/MobileFrontend/MobileFrontend.i18n.php 2012-03-13 22:06:54 UTC (rev 113769) +++ trunk/extensions/MobileFrontend/MobileFrontend.i18n.php 2012-03-13 22:07:44 UTC (rev 113770) @@ -76,10 +76,6 @@ 'mobile-frontend-dismiss-notification' = 'dismiss this notification', 'mobile-frontend-sopa-notice' = 'h3 id=sopa-noticeThank you for protecting Wikipedia./h3br/a href=http://en.wikipedia.org/wiki/Wikipedia:SOPA_initiative/Mobile_Learn_more;(We’re not done yet.)/a', 'mobile-frontend-clear-search' = 'Clear', - - //SpecialMobileFrontendContactUs - 'mobilefrontendcontactus' = 'Contact us', - 'mobilefrontendcontactus-description' = 'A contact page for MobileFrontend', ); /** Message documentation (Message documentation) @@ -116,9 +112,6 @@ 'mobile-frontend-placeholder' = 'Phrase used to prompt user to use search interface for mobile full screen search', 'mobile-frontend-dismiss-notification' = 'Phrase used to dismiss the top banner notification', 'mobile-frontend-clear-search' = 'Tooltip for clear button that appears when you type into search box', - - //SpecialMobileFrontendContactUs - 'mobilefrontendcontactus-description' = '{{desc}}', ); /** Achinese (Acèh) */ Modified: trunk/extensions/MobileFrontend/MobileFrontend.php === --- trunk/extensions/MobileFrontend/MobileFrontend.php 2012-03-13 22:06:54 UTC (rev 113769) +++ trunk/extensions/MobileFrontend/MobileFrontend.php 2012-03-13 22:07:44 UTC (rev 113770) @@ -64,24 +64,12 @@ 'ApplicationWmlTemplate' = 'templates/ApplicationWmlTemplate', 'ThanksNoticeTemplate' = 'templates/ThanksNoticeTemplate', 'SopaNoticeTemplate' = 'templates/SopaNoticeTemplate', - - // special pages - 'SpecialMobileFrontendContactUs' = 'special/SpecialMobileFrontendContactUs', ); foreach ( $autoloadClasses as $className = $classFilename ) { $wgAutoloadClasses[$className] = $cwd/$classFilename.php; } -// Special page definitions (classes autloaded above) -$specialPages = array( - 'MobileFrontendContactUs' = 'SpecialMobileFrontendContactUs', -); - -foreach ( $specialPages as $specialPageName = $specialClassName ) { - $wgSpecialPages[ $specialPageName ] = $specialClassName; -} - /** * Path to the logo used in the mobile view * Modified: trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php === --- trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-13 22:06:54 UTC (rev 113769) +++ trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-13 22:07:44 UTC (rev 113770) @@ -61,8 +61,8 @@ head title{$this-data['htmlTitle']}/title meta http-equiv=content-type content=application/xhtml+xml; charset=utf-8 / - link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$betaPrefix}common.css?version=1331676342' media='all' rel='Stylesheet' type='text/css' / - link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$cssFileName}.css?version=1331676342' media='all' rel='Stylesheet' type='text/css' / + link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$betaPrefix}common.css?version=1331257310' media='all' rel='Stylesheet' type='text/css' / + link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$cssFileName}.css?version=1331257310' media='all' rel='Stylesheet' type='text/css' / {$filePageStyle} meta name=viewport content=initial-scale=1.0 {$appleTouchIconTag} ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [113771] trunk/extensions/MobileFrontend/templates/ApplicationTemplate .php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113771 Revision: 113771 Author: awjrichards Date: 2012-03-13 22:08:28 + (Tue, 13 Mar 2012) Log Message: --- Bumping CSS version Modified Paths: -- trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php Modified: trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php === --- trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-13 22:07:44 UTC (rev 113770) +++ trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-13 22:08:28 UTC (rev 113771) @@ -61,8 +61,8 @@ head title{$this-data['htmlTitle']}/title meta http-equiv=content-type content=application/xhtml+xml; charset=utf-8 / - link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$betaPrefix}common.css?version=1331257310' media='all' rel='Stylesheet' type='text/css' / - link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$cssFileName}.css?version=1331257310' media='all' rel='Stylesheet' type='text/css' / + link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$betaPrefix}common.css?version=1331676342' media='all' rel='Stylesheet' type='text/css' / + link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$cssFileName}.css?version=1331676342' media='all' rel='Stylesheet' type='text/css' / {$filePageStyle} meta name=viewport content=initial-scale=1.0 {$appleTouchIconTag} ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [113774] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113774 Revision: 113774 Author: awjrichards Date: 2012-03-13 22:35:03 + (Tue, 13 Mar 2012) Log Message: --- MFT r113471, r113472, r113486, r113512, r113553 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/api/ApiQueryExcerpts.php branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/common.css Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/ branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Modified: svn:mergeinfo - /trunk/extensions/MobileFrontend:99727,113442,113444 + /trunk/extensions/MobileFrontend:99727,113442,113444,113471-113472,113486,113512,113553 Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/api/ApiQueryExcerpts.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/api/ApiQueryExcerpts.php 2012-03-13 22:33:00 UTC (rev 113773) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/api/ApiQueryExcerpts.php 2012-03-13 22:35:03 UTC (rev 113774) @@ -197,7 +197,7 @@ public function getExamples() { return array( - 'api.php?action=queryprop=excerptlength=175titles=Therion' = 'Get a 175-character excerpt', + 'api.php?action=queryprop=excerptsexlength=175titles=Therion' = 'Get a 175-character excerpt', ); } Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css 2012-03-13 22:33:00 UTC (rev 113773) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css 2012-03-13 22:35:03 UTC (rev 113774) @@ -1,8 +1,8 @@ html, -body { - margin: 0; - padding: 0; - height: 100%; +body { + margin: 0; + padding: 0; + height: 100%; } html { @@ -106,38 +106,16 @@ text-align: center; } -.suggestions-results { - font-size: 1.4em; - cursor: pointer; - margin: 0; - padding: 0; -} - -.suggestions-results hr { - margin: 0; -} - -.suggestions-result { - color: black; - margin: 0; - line-height: 2.6em; - padding: 0.01em 0.25em; - postion: relative; - border-bottom: solid 1px #99; -} - .suggestions-result a { text-decoration: none; color: #666; } -.suggestions-result a:link { - text-decoration: none; - color:#666; -} + .suggestions-result a:visited { text-decoration: none; color:#666; } + .suggestions-result a:hover { text-decoration: none; color:#666; @@ -146,9 +124,11 @@ text-decoration: none; color:#666; } + .suggestions-result:hover { background-color: #ACD1E9; } + a.sq-val-update { font-size: 1.3em; display: block; @@ -160,15 +140,15 @@ width: 1.5em; text-align: center; } -a.sq-val-update:link { - text-decoration: none; -} + a.sq-val-update:visited { text-decoration: none; } + a.sq-val-update:hover { text-decoration: none; } + a.sq-val-update:active { text-decoration: none; } @@ -518,6 +498,7 @@ -moz-border-radius: 5px; background: #f9f9f9; margin-bottom: 10px; + text-align: center; } .thumb .thumbinner[style] { @@ -610,7 +591,7 @@ height: 25px; width: 27px; padding-bottom: 0; - text-indent: 999px; + text-indent: -999px; } html[dir=rtl] .goButton { @@ -785,11 +766,19 @@ position: relative; border-bottom: solid 1px #999; font-size: 1.4em; + cursor: pointer; + margin: 0; } .full-screen-search .suggestions-result { line-height: 2.6em; border: none; + color: black; + margin: 0; + line-height: 2.6em; + padding: 0.01em 0.25em; + position: relative; + border-bottom: solid 1px #99; } .full-screen-search .suggestions-result a:visited { @@ -841,13 +830,3 @@ .full-screen-search #nav { display: none !important; } - -#placeholder { - position: absolute; - left: 38px; - z-index: 2; - top: 0; - color: #666; - font-size: 16px; - padding-top: 10px; -} Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/common.css === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/common.css 2012-03-13 22:33:00 UTC (rev 113773) +++ branches/wmf/1.19wmf1
[MediaWiki-CVS] SVN: [113778] trunk/extensions/MobileFrontend/templates/ApplicationTemplate .php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113778 Revision: 113778 Author: awjrichards Date: 2012-03-13 22:45:55 + (Tue, 13 Mar 2012) Log Message: --- Bumping CSS version Modified Paths: -- trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php Modified: trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php === --- trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-13 22:43:14 UTC (rev 113777) +++ trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-13 22:45:55 UTC (rev 113778) @@ -61,8 +61,8 @@ head title{$this-data['htmlTitle']}/title meta http-equiv=content-type content=application/xhtml+xml; charset=utf-8 / - link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$betaPrefix}common.css?version=1331676342' media='all' rel='Stylesheet' type='text/css' / - link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$cssFileName}.css?version=1331676342' media='all' rel='Stylesheet' type='text/css' / + link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$betaPrefix}common.css?version=1331678715' media='all' rel='Stylesheet' type='text/css' / + link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$cssFileName}.css?version=1331678715' media='all' rel='Stylesheet' type='text/css' / {$filePageStyle} meta name=viewport content=initial-scale=1.0 {$appleTouchIconTag} ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [113489] branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ ApplicationTemplate.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113489 Revision: 113489 Author: awjrichards Date: 2012-03-09 17:39:21 + (Fri, 09 Mar 2012) Log Message: --- MFT r113488 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-09 17:30:07 UTC (rev 113488) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-09 17:39:21 UTC (rev 113489) @@ -40,8 +40,8 @@ $startLinkTag = link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/; $endLinkTag = ' media='all' rel='Stylesheet' type='text/css' /; $filePageStyle = ( $this-data['isFilePage'] ) ? $startLinkTag . 'filepage.css' . $endLinkTag : ''; - $buttonHideText = htmlentities( $this-data['hideText'], ENT_QUOTES ); - $buttonShowText = htmlentities( $this-data['showText'], ENT_QUOTES ); + $buttonHideText = Xml::escapeJsString( $this-data['hideText'] ); + $buttonShowText = Xml::escapeJsString( $this-data['showText'] ); $applicationHtml = HTML Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php ___ Modified: svn:mergeinfo - /trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php:99727,113428,113442,113444,113447 + /trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php:99727,113428,113442,113444,113447,113488 ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [113532] trunk/extensions/CheckUser/api/ApiQueryCheckUser.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113532 Revision: 113532 Author: awjrichards Date: 2012-03-09 22:16:48 + (Fri, 09 Mar 2012) Log Message: --- Typo fix, followup r110807 Modified Paths: -- trunk/extensions/CheckUser/api/ApiQueryCheckUser.php Modified: trunk/extensions/CheckUser/api/ApiQueryCheckUser.php === --- trunk/extensions/CheckUser/api/ApiQueryCheckUser.php2012-03-09 22:10:07 UTC (rev 113531) +++ trunk/extensions/CheckUser/api/ApiQueryCheckUser.php2012-03-09 22:16:48 UTC (rev 113532) @@ -93,7 +93,7 @@ } else { $user_id = User::idFromName( $target ); if ( !$user_id ) { - $this-dieUsage( 'Target user does not exists', 'nosuchuser' ); + $this-dieUsage( 'Target user does not exist', 'nosuchuser' ); } $this-addWhereFld( 'cuc_user_text', $target ); $log_type = array( 'useredits', 'user' ); ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [113536] trunk/extensions/SwiftMedia/wmf/rewrite.py
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113536 Revision: 113536 Author: awjrichards Date: 2012-03-09 22:45:14 + (Fri, 09 Mar 2012) Log Message: --- Followup r45, typo fix Modified Paths: -- trunk/extensions/SwiftMedia/wmf/rewrite.py Modified: trunk/extensions/SwiftMedia/wmf/rewrite.py === --- trunk/extensions/SwiftMedia/wmf/rewrite.py 2012-03-09 22:30:45 UTC (rev 113535) +++ trunk/extensions/SwiftMedia/wmf/rewrite.py 2012-03-09 22:45:14 UTC (rev 113536) @@ -141,7 +141,7 @@ # However, someone may have a formerly valid link to a file, so we # should do them the favor of giving them a 404. try: -# break apach the url, url-encode it, and put it back together +# break apart the url, url-encode it, and put it back together urlobj = list(urlparse.urlsplit(reqorig.url)) urlobj[2] = urllib2.quote(urlobj[2], '%/') encodedurl = urlparse.urlunsplit(urlobj) ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [113406] branches/wmf/1.19wmf1/includes/WebRequest.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113406 Revision: 113406 Author: awjrichards Date: 2012-03-08 21:22:45 + (Thu, 08 Mar 2012) Log Message: --- MFT r112732 Modified Paths: -- branches/wmf/1.19wmf1/includes/WebRequest.php Property Changed: branches/wmf/1.19wmf1/includes/WebRequest.php Modified: branches/wmf/1.19wmf1/includes/WebRequest.php === --- branches/wmf/1.19wmf1/includes/WebRequest.php 2012-03-08 21:22:15 UTC (rev 113405) +++ branches/wmf/1.19wmf1/includes/WebRequest.php 2012-03-08 21:22:45 UTC (rev 113406) @@ -379,7 +379,24 @@ return $ret; } + /** +* Unset an arbitrary value from our get/post data. +* +* @param $key String: key name to use +* @return Mixed: old value if one was present, null otherwise +*/ + public function unsetVal( $key ) { + if ( !isset( $this-data[$key] ) ) { + $ret = null; + } else { + $ret = $this-data[$key]; + unset( $this-data[$key] ); + } + return $ret; + } + + /** * Fetch an array from the input or return $default if it's not set. * If source was scalar, will return an array with a single element. * If no source and no default, returns NULL. Property changes on: branches/wmf/1.19wmf1/includes/WebRequest.php ___ Added: svn:mergeinfo + /branches/JSTesting/includes/WebRequest.php:100352-107913 /branches/REL1_15/phase3/includes/WebRequest.php:51646 /branches/new-installer/phase3/includes/WebRequest.php:43664-66004 /branches/sqlite/includes/WebRequest.php:58211-58321 /branches/wmf/1.18wmf1/includes/WebRequest.php:97508,111667 /branches/wmf-deployment/includes/WebRequest.php:53381 /trunk/phase3/includes/WebRequest.php:111029,111034,111067,111085,28,44,111251,111397,111427,111571,111574,111597,111658,111673,111695,111697,111750,111827,111965-111967,112021,112045-112046,112049,112061-112063,112065-112066,112070-112071,112079,112128,112132-112133,112152,112184,112259,112290,112347,112374,112378,112381,112383,112397,112408,112474,112526,112534,112563,112700,112732,112839-112840,112843,112855,112866,112951,112995,113099,113169,113312 ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [113417] branches/wmf/1.19wmf1/extensions/MobileFrontend/
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113417 Revision: 113417 Author: awjrichards Date: 2012-03-08 23:01:42 + (Thu, 08 Mar 2012) Log Message: --- Removing MobileFrontend in preparation for full sync from trunk Removed Paths: - branches/wmf/1.19wmf1/extensions/MobileFrontend/ ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [113418] branches/wmf/1.19wmf1/extensions/MobileFrontend/
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113418 Revision: 113418 Author: awjrichards Date: 2012-03-08 23:02:23 + (Thu, 08 Mar 2012) Log Message: --- Sync'ing MobileFrontend from trunk Added Paths: --- branches/wmf/1.19wmf1/extensions/MobileFrontend/ Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Added: svn:mergeinfo + /trunk/extensions/MobileFrontend:99727 ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [113428] trunk/extensions/MobileFrontend/templates/ApplicationTemplate .php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113428 Revision: 113428 Author: awjrichards Date: 2012-03-08 23:54:30 + (Thu, 08 Mar 2012) Log Message: --- Updating version # for js/css Modified Paths: -- trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php Modified: trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php === --- trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-08 23:39:19 UTC (rev 113427) +++ trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-08 23:54:30 UTC (rev 113428) @@ -48,8 +48,8 @@ head title{$this-data['htmlTitle']}/title meta http-equiv=content-type content=application/xhtml+xml; charset=utf-8 / - link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$betaPrefix}common.css?version=1331146675' media='all' rel='Stylesheet' type='text/css' / - link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$cssFileName}.css?version=1331146675' media='all' rel='Stylesheet' type='text/css' / + link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$betaPrefix}common.css?version=1331250586' media='all' rel='Stylesheet' type='text/css' / + link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$cssFileName}.css?version=1331250586' media='all' rel='Stylesheet' type='text/css' / {$filePageStyle} meta name=viewport content=width=device-width, initial-scale=1.0 {$appleTouchIconTag} @@ -71,9 +71,9 @@ /div {$this-data['footerHtml']} !--[if gt IE 9]!-- - {$startScriptTag}{$javaScriptPath}{$betaPrefix}application.{$resourceSuffix}js?version=1331146675{$endScriptTag} - {$startScriptTag}{$javaScriptPath}banner.{$resourceSuffix}js?version=1331146675{$endScriptTag} - {$startScriptTag}{$javaScriptPath}{$betaPrefix}opensearch.{$resourceSuffix}js?version=1331146675{$endScriptTag} + {$startScriptTag}{$javaScriptPath}{$betaPrefix}application.{$resourceSuffix}js?version=1331250586{$endScriptTag} + {$startScriptTag}{$javaScriptPath}banner.{$resourceSuffix}js?version=1331250586{$endScriptTag} + {$startScriptTag}{$javaScriptPath}{$betaPrefix}opensearch.{$resourceSuffix}js?version=1331250586{$endScriptTag} {$filePageScript} !--[endif]-- /body ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [113430] branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ ApplicationTemplate.php
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113430 Revision: 113430 Author: awjrichards Date: 2012-03-08 23:56:01 + (Thu, 08 Mar 2012) Log Message: --- MFT r113428 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-08 23:55:51 UTC (rev 113429) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-08 23:56:01 UTC (rev 113430) @@ -48,8 +48,8 @@ head title{$this-data['htmlTitle']}/title meta http-equiv=content-type content=application/xhtml+xml; charset=utf-8 / - link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$betaPrefix}common.css?version=1331146675' media='all' rel='Stylesheet' type='text/css' / - link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$cssFileName}.css?version=1331146675' media='all' rel='Stylesheet' type='text/css' / + link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$betaPrefix}common.css?version=1331250586' media='all' rel='Stylesheet' type='text/css' / + link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$cssFileName}.css?version=1331250586' media='all' rel='Stylesheet' type='text/css' / {$filePageStyle} meta name=viewport content=width=device-width, initial-scale=1.0 {$appleTouchIconTag} @@ -71,9 +71,9 @@ /div {$this-data['footerHtml']} !--[if gt IE 9]!-- - {$startScriptTag}{$javaScriptPath}{$betaPrefix}application.{$resourceSuffix}js?version=1331146675{$endScriptTag} - {$startScriptTag}{$javaScriptPath}banner.{$resourceSuffix}js?version=1331146675{$endScriptTag} - {$startScriptTag}{$javaScriptPath}{$betaPrefix}opensearch.{$resourceSuffix}js?version=1331146675{$endScriptTag} + {$startScriptTag}{$javaScriptPath}{$betaPrefix}application.{$resourceSuffix}js?version=1331250586{$endScriptTag} + {$startScriptTag}{$javaScriptPath}banner.{$resourceSuffix}js?version=1331250586{$endScriptTag} + {$startScriptTag}{$javaScriptPath}{$betaPrefix}opensearch.{$resourceSuffix}js?version=1331250586{$endScriptTag} {$filePageScript} !--[endif]-- /body Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php ___ Added: svn:mergeinfo + /trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php:99727,113428 ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [113439] trunk/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113439 Revision: 113439 Author: awjrichards Date: 2012-03-09 00:40:30 + (Fri, 09 Mar 2012) Log Message: --- Makes useformat=mobile sticky with a cookie. Changese ExtMobileFrontend::useFormat to protected var accessible with get/set methods. Updated tests to reflect changes Modified Paths: -- trunk/extensions/MobileFrontend/MobileFrontend.body.php trunk/extensions/MobileFrontend/tests/MobileFrontendTest.php Modified: trunk/extensions/MobileFrontend/MobileFrontend.body.php === --- trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-09 00:38:35 UTC (rev 113438) +++ trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-09 00:40:30 UTC (rev 113439) @@ -20,7 +20,6 @@ public static $format; public static $search; public static $callback; - public static $useFormat; public static $disableImages; public static $enableImages; public static $isMainPage = false; @@ -46,6 +45,8 @@ public static $loginHtml; public static $zeroRatedBanner; + protected $useFormat; + /** * @var string xDevice header information */ @@ -350,8 +351,9 @@ // This is stated to be intended behavior, as per the following: [http://bugs.php.net/bug.php?id=40104] $xDevice = $this-getXDevice(); - self::$useFormat = $wgRequest-getText( 'useformat' ); - $this-wmlContext-setUseFormat( self::$useFormat ); + $this-checkUseFormatCookie(); + $useFormat = $this-getUseFormat(); + $this-wmlContext-setUseFormat( $useFormat ); $mobileAction = $this-getMobileAction(); if ( !$this-shouldDisplayMobileView() ) { @@ -1371,12 +1373,12 @@ if ( !$this-isFauxMobileDevice() ) { return; } - + $useFormat = $this-getUseFormat(); if ( !isset( $parsedUrl[ 'query' ] )) { - $parsedUrl[ 'query' ] = 'useformat=' . urlencode( self::$useFormat ); + $parsedUrl[ 'query' ] = 'useformat=' . urlencode( $useFormat ); } else { $query = wfCgiToArray( $parsedUrl[ 'query' ] ); - $query[ 'useformat' ] = urlencode( self::$useFormat ); + $query[ 'useformat' ] = urlencode( $useFormat ); $parsedUrl[ 'query' ] = wfArrayToCgi( $query ); } } @@ -1427,7 +1429,8 @@ } protected function isFauxMobileDevice() { - if ( self::$useFormat !== 'mobile' self::$useFormat !== 'mobile-wap') { + $useFormat = $this-getUseFormat(); + if ( $useFormat !== 'mobile' $useFormat !== 'mobile-wap') { return false; } @@ -1477,6 +1480,47 @@ return $this-action; } + public function getUseFormat() { + global $wgRequest; + if ( !isset( $this-useFormat ) ) { + $useFormat = $wgRequest-getText( 'useformat' ); + $this-setUseFormat( $useFormat ); + } + return $this-useFormat; + } + + public function setUseFormat( $useFormat ) { + $this-useFormat = $useFormat; + } + + public function checkUseFormatCookie() { + global $wgRequest; + + $useFormat = $this-getUseFormat(); + $useFormatFromCookie = $wgRequest-getCookie( 'mf_useformat' ); + if( !strlen( $useFormat ) !is_null( $useFormatFromCookie ) ) { + $this-setUseFormat( $useFormatFromCookie ); + } + + // if we should not be displaying the mobile view, make sure cookies are unset etc. + if ( !$this-shouldDisplayMobileView() ) { + // make sure cookie is unset for appropriate mobile actions + $mobileAction = $this-getMobileAction(); + if ( in_array( $mobileAction, array( 'view_normal_site', 'disable_mobile_site' ) ) ) { + $wgRequest-response()-setCookie( 'mf_useformat', false, time() - 3600 ); + } + + // make sure useformat is unset + $this-setUseFormat( '' ); + return; + } + + // if getUseFormat and no cookie set, set the cookie + if ( is_null( $useFormatFromCookie ) strlen( $useFormat ) ) { + $wgRequest-response()-setCookie
[MediaWiki-CVS] SVN: [113442] trunk/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113442 Revision: 113442 Author: awjrichards Date: 2012-03-09 01:21:46 + (Fri, 09 Mar 2012) Log Message: --- Making show/hide buttons translatable Modified Paths: -- trunk/extensions/MobileFrontend/MobileFrontend.body.php trunk/extensions/MobileFrontend/javascripts/application.js trunk/extensions/MobileFrontend/javascripts/application.min.js trunk/extensions/MobileFrontend/javascripts/beta_application.js trunk/extensions/MobileFrontend/javascripts/beta_application.min.js trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php Modified: trunk/extensions/MobileFrontend/MobileFrontend.body.php === --- trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-09 01:18:32 UTC (rev 113441) +++ trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-09 01:21:46 UTC (rev 113442) @@ -1218,6 +1218,8 @@ 'wgScriptPath' = $wgScriptPath, 'isFilePage' = self::$isFilePage, 'zeroRatedBanner' = self::$zeroRatedBanner, + 'showText' = wfMessage( 'mobile-frontend-show-button' ), + 'hideText' = wfMessage( 'mobile-frontend-hide-button' ), ); $applicationTemplate-setByArray( $options ); wfProfileOut( __METHOD__ ); Modified: trunk/extensions/MobileFrontend/javascripts/application.js === --- trunk/extensions/MobileFrontend/javascripts/application.js 2012-03-09 01:18:32 UTC (rev 113441) +++ trunk/extensions/MobileFrontend/javascripts/application.js 2012-03-09 01:21:46 UTC (rev 113442) @@ -24,7 +24,7 @@ function createButton( visible ) { var btn, label; btn = document.createElement( 'button' ); - label = document.createTextNode( visible ? 'Show' : 'Hide' ); + label = document.createTextNode( visible ? showText : hideText ); btn.className = visible ? 'show' : 'hide'; btn.appendChild( label ); btn.style.display = visible ? 'inline-block' : 'none'; Modified: trunk/extensions/MobileFrontend/javascripts/application.min.js === --- trunk/extensions/MobileFrontend/javascripts/application.min.js 2012-03-09 01:18:32 UTC (rev 113441) +++ trunk/extensions/MobileFrontend/javascripts/application.min.js 2012-03-09 01:21:46 UTC (rev 113442) @@ -1 +1 @@ -MobileFrontend=(function(){var a;function c(){var j,k,f,o,r,h,n=a(.section_heading);a(document.body).addClass(jsEnabled);window.wm_toggle_section=b;var h=a(.section_heading button);for(j=0;jh.length;j++){a(h[j]).remove()}function m(){var i=this.id?this.id.split(_)[1]:-1;if(i-1){b(i)}}function p(t){var s,i;s=document.createElement(button);i=document.createTextNode(t?Show:Hide);s.className=t?show:hide;s.appendChild(i);s.style.display=t?inline-block:none;return s}if(!n){n=[]}else{a(document.body).addClass(togglingEnabled)}for(j=0;jn.length;j++){r=n[j];r.removeAttribute(onclick);r.insertBefore(p(true),r.firstChild);r.insertBefore(p(false),r.firstChild);a(r).bind(click,m)}k=document.getElementById(results);f=document.getElementById(languageselection);function g(){var i;if(f){i=f.options[f.selectedIndex].value;if(i){location.href=i}}}a(f).bind(change,g);function l(){var i=document.getElementById(nav).style;i.display=i.display===block?none:block}a(document.getElementById(logo)).bind(click,l);function q(){var i=this.hash||document.location.hash;if(i.indexOf(#)===0){e(i)}}q();for(o=document.getElementsByTagName(a),j=0;jo.length;j++){a(o[j]).bind(click,q)}window.scrollTo(0,1)}function e(i){var g=document.getElementById(i.substr(1)),h,f;if(g){h=g;while(hh.className!==content_blockh.className!==section_heading){h=h.parentNode}if(hh.style.display!==block){f=parseInt(h.id.split(_)[1],10);b(f)}}}function b(g){var f=document.getElementById(section_+g),l=f.getElementsByTagName(button),h,j,k;for(h=0;h=1;h++){j=l[h].style;j.display=j.display===none||(h!j.display)?inline-block:none}for(h=0,d=[content_,anchor_];h=1;h++){k=document.getElementById(d[h]+g);if(k){k.style.display=k.style.display===block?none:block}}}a=typeof jQuery!==undefined?jQuery:function(g){if(typeof(g)===string){if(document.querySelectorAll){return[].slice.call(document.querySelectorAll(g))}}function h(k){var l=g.className,m=l.split( );m.push(k);g.className=m.join( )}function i(k){var m=g.className,n=m.split( ),o=[],l;for(l=0;ln.length;l++){if(n[l]!==k){o.push(n[l])}}g.className=o.join
[MediaWiki-CVS] SVN: [113444] trunk/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113444 Revision: 113444 Author: awjrichards Date: 2012-03-09 01:32:54 + (Fri, 09 Mar 2012) Log Message: --- Followup r113442, using internal message array and escaping button messages Modified Paths: -- trunk/extensions/MobileFrontend/MobileFrontend.body.php trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php Modified: trunk/extensions/MobileFrontend/MobileFrontend.body.php === --- trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-09 01:24:43 UTC (rev 113443) +++ trunk/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-09 01:32:54 UTC (rev 113444) @@ -1218,8 +1218,8 @@ 'wgScriptPath' = $wgScriptPath, 'isFilePage' = self::$isFilePage, 'zeroRatedBanner' = self::$zeroRatedBanner, - 'showText' = wfMessage( 'mobile-frontend-show-button' ), - 'hideText' = wfMessage( 'mobile-frontend-hide-button' ), + 'showText' = self::$messages[ 'mobile-frontend-show-button' ], + 'hideText' = self::$messages[ 'mobile-frontend-hide-button' ], ); $applicationTemplate-setByArray( $options ); wfProfileOut( __METHOD__ ); Modified: trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php === --- trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-09 01:24:43 UTC (rev 113443) +++ trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php 2012-03-09 01:32:54 UTC (rev 113444) @@ -40,7 +40,10 @@ $startLinkTag = link href='{$this-data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/; $endLinkTag = ' media='all' rel='Stylesheet' type='text/css' /; $filePageStyle = ( $this-data['isFilePage'] ) ? $startLinkTag . 'filepage.css' . $endLinkTag : ''; + $buttonHideText = htmlentities( $this-data['hideText'], ENT_QUOTES ); + $buttonShowText = htmlentities( $this-data['showText'], ENT_QUOTES ); + $applicationHtml = HTML !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; @@ -59,8 +62,8 @@ var title = {$this-data['htmlTitle']}; var scriptPath = {$this-data['wgScriptPath']}; var placeholder = {$this-data['placeholder']}; - var showText = {$this-data['showText']}; - var hideText = {$this-data['hideText']}; + var showText = {$buttonShowText}; + var hideText = {$buttonHideText}; //]] /script /head ___ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
[MediaWiki-CVS] SVN: [113445] branches/wmf/1.19wmf1/extensions/MobileFrontend
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113445 Revision: 113445 Author: awjrichards Date: 2012-03-09 01:35:11 + (Fri, 09 Mar 2012) Log Message: --- MFT r113442, r113444 Modified Paths: -- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/application.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/application.min.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_application.js branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_application.min.js branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php Property Changed: branches/wmf/1.19wmf1/extensions/MobileFrontend/ branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend ___ Modified: svn:mergeinfo - /trunk/extensions/MobileFrontend:99727 + /trunk/extensions/MobileFrontend:99727,113442,113444 Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-09 01:32:54 UTC (rev 113444) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php 2012-03-09 01:35:11 UTC (rev 113445) @@ -1216,6 +1216,8 @@ 'wgScriptPath' = $wgScriptPath, 'isFilePage' = self::$isFilePage, 'zeroRatedBanner' = self::$zeroRatedBanner, + 'showText' = self::$messages[ 'mobile-frontend-show-button' ], + 'hideText' = self::$messages[ 'mobile-frontend-hide-button' ], ); $applicationTemplate-setByArray( $options ); wfProfileOut( __METHOD__ ); Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/application.js === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/application.js 2012-03-09 01:32:54 UTC (rev 113444) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/application.js 2012-03-09 01:35:11 UTC (rev 113445) @@ -24,7 +24,7 @@ function createButton( visible ) { var btn, label; btn = document.createElement( 'button' ); - label = document.createTextNode( visible ? 'Show' : 'Hide' ); + label = document.createTextNode( visible ? showText : hideText ); btn.className = visible ? 'show' : 'hide'; btn.appendChild( label ); btn.style.display = visible ? 'inline-block' : 'none'; Modified: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/application.min.js === --- branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/application.min.js 2012-03-09 01:32:54 UTC (rev 113444) +++ branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/application.min.js 2012-03-09 01:35:11 UTC (rev 113445) @@ -1 +1 @@ -MobileFrontend=(function(){var a;function c(){var j,k,f,o,r,h,n=a(.section_heading);a(document.body).addClass(jsEnabled);window.wm_toggle_section=b;var h=a(.section_heading button);for(j=0;jh.length;j++){a(h[j]).remove()}function m(){var i=this.id?this.id.split(_)[1]:-1;if(i-1){b(i)}}function p(t){var s,i;s=document.createElement(button);i=document.createTextNode(t?Show:Hide);s.className=t?show:hide;s.appendChild(i);s.style.display=t?inline-block:none;return s}if(!n){n=[]}else{a(document.body).addClass(togglingEnabled)}for(j=0;jn.length;j++){r=n[j];r.removeAttribute(onclick);r.insertBefore(p(true),r.firstChild);r.insertBefore(p(false),r.firstChild);a(r).bind(click,m)}k=document.getElementById(results);f=document.getElementById(languageselection);function g(){var i;if(f){i=f.options[f.selectedIndex].value;if(i){location.href=i}}}a(f).bind(change,g);function l(){var i=document.getElementById(nav).style;i.display=i.display===block?none:block}a(document.getElementById(logo)).bind(click,l);function q(){var i=this.hash||document.location.hash;if(i.indexOf(#)===0){e(i)}}q();for(o=document.getElementsByTagName(a),j=0;jo.length;j++){a(o[j]).bind(click,q)}window.scrollTo(0,1)}function e(i){var g=document.getElementById(i.substr(1)),h,f;if(g){h=g;while(hh.className!==content_blockh.className!==section_heading){h=h.parentNode}if(hh.style.display!==block){f=parseInt(h.id.split(_)[1],10