r114223 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114222‎ | r114223 | r114224 >
Date:00:26, 20 March 2012
Author:awjrichards
Status:ok (Comments)
Tags:
Comment:
Modified paths:
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/Makefile (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.i18n.php (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.php (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/api/ApiQueryExcerpts.php (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/application.js (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/application.min.js (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_application.js (added) (history)
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.js (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.min.js (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/opensearch.js (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/opensearch.min.js (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/references.js (deleted) (history)
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/references.min.js (deleted) (history)
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/toggle.js (deleted) (history)
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/toggle.min.js (deleted) (history)
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/library/WURFL/Handlers/Utils.php (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/common.css (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/images/arrow-left-beta.png (deleted) (history)
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/images/close-button-beta.png (deleted) (history)
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/operamini.css (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/DisableTemplate.php (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/FooterTemplate.php (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/SearchTemplate.php (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/MobileFrontendTest.php (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/js/fixtures.js (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/js/test_application.js (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/js/test_toggle.js (deleted) (history)

Diff [purge]

Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/js/test_toggle.js
@@ -1,55 +0,0 @@
2 -module("MobileFrontend toggle.js: wm_toggle_section", {
3 - setup: function() {
4 - MFET.createFixtures();
5 - MFE.toggle.init();
6 - $("#section_1,#content_1,#anchor_1").addClass("openSection");
7 - },
8 - teardown: function() {
9 - MFET.cleanFixtures();
10 - window.location.hash = "#";
11 - }
12 -});
13 -
14 -test("wm_toggle_section", function() {
15 - strictEqual($("#section_1").hasClass("openSection"), true, "openSection class present");
16 - MFE.toggle.wm_toggle_section("1");
17 - strictEqual($("#content_1").hasClass("openSection"), false, "check content is closed on a toggle");
18 - strictEqual($("#anchor_1").hasClass("openSection"), false, "check anchor is closed on toggle");
19 - strictEqual($("#section_1").hasClass("openSection"), false, "check section is closed");
20 -
21 - // perform second toggle
22 - MFE.toggle.wm_toggle_section("1");
23 - strictEqual($("#content_1").hasClass("openSection"), true, "check content reopened");
24 - strictEqual($("#anchor_1").hasClass("openSection"), true, "check anchor reopened");
25 - strictEqual($("#section_1").hasClass("openSection"), true, "check section has reopened");
26 -});
27 -
28 -test("wm_reveal_for_hash", function() {
29 - MFE.toggle.wm_reveal_for_hash("#First_Section");
30 - applyCss();
31 - strictEqual($("#content_1").is(":visible"), true, "check content is visible on a toggle");
32 - strictEqual($("#anchor_1").is(":visible"), true, "check anchor is visible on toggle");
33 - strictEqual($("#section_1 .hide").is(":visible"), true, "check hide button now visible");
34 - strictEqual($("#section_1 .show").is(":visible"), false, "check show button now hidden");
35 -});
36 -
37 -test("wm_reveal_for_hash", function() {
38 - MFE.toggle.wm_reveal_for_hash("#First_Section_2");
39 - strictEqual($("#content_1").hasClass("openSection"), true, "check content is visible on a toggle");
40 - strictEqual($("#anchor_1").hasClass("openSection"), true, "check anchor is visible on toggle");
41 - strictEqual($("#section_1").hasClass("openSection"), true, "check section is marked as open");
42 -});
43 -
44 -test("clicking hash links", function() {
45 - MFET.triggerEvent($("[href=#First_Section_2]")[0], "click");
46 - strictEqual($("#content_1").hasClass("openSection"), true, "check content is visible on a toggle");
47 - strictEqual($("#anchor_1").hasClass("openSection"), true, "check anchor is visible on toggle");
48 - strictEqual($("#section_1").hasClass("openSection"), true, "check section marked as open");
49 -});
50 -
51 -test("clicking a heading toggles it", function() {
52 - var visibilityStart = $("#content_2").hasClass("openSection");
53 - MFET.triggerEvent($("#section_2")[0], "click");
54 - strictEqual(visibilityStart, false, "check content is hidden at start");
55 - strictEqual($("#content_2").hasClass("openSection"), true, "check content is shown on a toggle");
56 -});
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/js/fixtures.js
@@ -1,13 +1,3 @@
2 -var mwMobileFrontendConfig = {
3 - messages: {
4 - showText: "show",
5 - hideText: "hide"
6 - },
7 - settings: {
8 - scriptPath: "/"
9 - }
10 -};
11 -
122 window.MobileFrontendTests = {
133 cleanFixtures: function() {
144 // note the ZeroRatedMobileAccess extension attaches a banner to the qunit test suite
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/js/test_application.js
@@ -1,22 +1,14 @@
22 var MFE = MobileFrontend;
33 var MFET = window.MobileFrontendTests;
44
5 -module("MobileFrontend application.js: utils", {
6 - setup: function() {
7 - var section = '<div class="t_section_heading"></div>';
8 - $('<div id="mfetest">' + section + '<div id="t_section_1">' + section + '</div>').appendTo(document.body);
9 - },
10 - teardown: function() {
11 - $("#mfetest").remove();
12 - }
13 -});
 5+module("MobileFrontend application.js: utils");
146
157 test("Basic selector support (#id)", function() {
16 - strictEqual(MFE.utils("#t_section_1").length, 1, "only one element matches this selector");
 8+ strictEqual(MFE.utils("#section_1").length, 1, "only one element matches this selector");
179 });
1810
1911 test("Basic selector support (.className)", function() {
20 - strictEqual(MFE.utils(".t_section_heading").length, 2, "only two elements matches this selector");
 12+ strictEqual(MFE.utils(".section_heading").length, 2, "only two elements matches this selector");
2113 });
2214
2315 test("Basic selector support (tag name)", function() {
@@ -65,3 +57,61 @@
6658 strictEqual(visible3, false, "toggle");
6759 });
6860
 61+module("MobileFrontend application.js: wm_toggle_section", {
 62+ setup: function() {
 63+ MFET.createFixtures();
 64+ MFE.init();
 65+ $("#content_1,#anchor_1,#section_1 .hide").hide();
 66+ $("#section_1 .show").show();
 67+ },
 68+ teardown: function() {
 69+ MFET.cleanFixtures();
 70+ window.location.hash = "#";
 71+ }
 72+});
 73+
 74+test("wm_toggle_section", function() {
 75+ MFE.wm_toggle_section("1");
 76+ strictEqual($("#content_1").is(":visible"), true, "check content is visible on a toggle");
 77+ strictEqual($("#anchor_1").is(":visible"), true, "check anchor is visible on toggle");
 78+ strictEqual($("#section_1 .hide").is(":visible"), true, "check hide button now visible");
 79+ strictEqual($("#section_1 .show").is(":visible"), false, "check show button now hidden");
 80+
 81+ // perform second toggle
 82+ MFE.wm_toggle_section("1");
 83+ strictEqual($("#content_1").is(":visible"), false, "check content is hidden on a toggle");
 84+ strictEqual($("#anchor_1").is(":visible"), false, "check anchor is hidden on toggle");
 85+ strictEqual($("#section_1 .hide").is(":visible"), false, "check hide button now hidden");
 86+ strictEqual($("#section_1 .show").is(":visible"), true, "check show button now visible");
 87+});
 88+
 89+test("wm_reveal_for_hash", function() {
 90+ MFE.wm_reveal_for_hash("#First_Section");
 91+ strictEqual($("#content_1").is(":visible"), true, "check content is visible on a toggle");
 92+ strictEqual($("#anchor_1").is(":visible"), true, "check anchor is visible on toggle");
 93+ strictEqual($("#section_1 .hide").is(":visible"), true, "check hide button now visible");
 94+ strictEqual($("#section_1 .show").is(":visible"), false, "check show button now hidden");
 95+});
 96+
 97+test("wm_reveal_for_hash", function() {
 98+ MFE.wm_reveal_for_hash("#First_Section_2");
 99+ strictEqual($("#content_1").is(":visible"), true, "check content is visible on a toggle");
 100+ strictEqual($("#anchor_1").is(":visible"), true, "check anchor is visible on toggle");
 101+ strictEqual($("#section_1 .hide").is(":visible"), true, "check hide button now visible");
 102+ strictEqual($("#section_1 .show").is(":visible"), false, "check show button now hidden");
 103+});
 104+
 105+test("clicking hash links", function() {
 106+ MFET.triggerEvent($("[href=#First_Section_2]")[0], "click");
 107+ strictEqual($("#content_1").is(":visible"), true, "check content is visible on a toggle");
 108+ strictEqual($("#anchor_1").is(":visible"), true, "check anchor is visible on toggle");
 109+ strictEqual($("#section_1 .hide").is(":visible"), true, "check hide button now visible");
 110+ strictEqual($("#section_1 .show").is(":visible"), false, "check show button now hidden");
 111+});
 112+
 113+test("clicking a heading toggles it", function() {
 114+ var visibilityStart = $("#content_1").is(":visible");
 115+ MFET.triggerEvent($("#section_1")[0], "click");
 116+ strictEqual(visibilityStart, false, "check content is hidden at start");
 117+ strictEqual($("#content_1").is(":visible"), true, "check content is hidden on a toggle");
 118+});
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/MobileFrontendTest.php
@@ -219,14 +219,15 @@
220220 array( false, null, array() ),
221221 array( true, 'webkit', array() ),
222222 array( false, 'webkit', array( 'action' => 'edit' ) ),
223 - array( false, 'webkit', array( 'useformat' => 'desktop' ) ),
 223+ array( false, 'webkit', array( 'mobileaction' => 'view_normal_site' ) ),
224224 array( true, null, array( 'useformat' => 'mobile-wap' ) ),
225225 array( false, null, array( 'useformat' => 'mobile-wap', 'action' => 'edit' ) ),
226226 array( false, null, array( 'useformat' => 'mobile-wap', 'action' => 'history' ) ),
227 - array( false, null, array( 'useformat' => 'desktop' ) ),
 227+ array( false, null, array( 'useformat' => 'mobile-wap', 'mobileaction' => 'view_normal_site' ) ),
228228 array( true, null, array( 'useformat' => 'mobile' ) ),
229229 array( false, null, array( 'useformat' => 'mobile', 'action' => 'edit' ) ),
230230 array( false, null, array( 'useformat' => 'mobile', 'action' => 'history' ) ),
 231+ array( false, null, array( 'useformat' => 'mobile', 'mobileaction' => 'view_normal_site' ) ),
231232 );
232233 }
233234
@@ -301,65 +302,4 @@
302303 array( 'edit' ),
303304 );
304305 }
305 -
306 - /**
307 - * @dataProvider getUseFormatProvider
308 - */
309 - public function testGetUseFormat( $explicit, $requestParam, $expected ) {
310 - global $wgRequest, $wgExtMobileFrontend;
311 - $wgRequest->setVal( 'useformat', $requestParam );
312 - $wgExtMobileFrontend->setUseFormat( $explicit );
313 - $this->assertEquals( $expected, $wgExtMobileFrontend->getUseFormat() );
314 - }
315 -
316 - public function getUseFormatProvider() {
317 - return array(
318 - array( 'mobile', null, 'mobile' ),
319 - array( null, 'mobile', 'mobile' ),
320 - array( null, null, '' ),
321 - array( 'desktop', 'mobile', 'desktop' ),
322 - );
323 - }
324 -
325 - public function testGetUseFormatCookieExpiry() {
326 - global $wgExtMobileFrontend, $wgCookieExpiration, $wgMobileFrontendFormatCookieExpiry;
327 - $getUseFormatCookieExpiry = self::getMethod( 'getUseFormatCookieExpiry' );
328 -
329 - $origMFCookieExpiry = $wgMobileFrontendFormatCookieExpiry;
330 - $startTime = time();
331 - $wgMobileFrontendFormatCookieExpiry = 60;
332 - $mfCookieExpected = $startTime + 60;
333 - $this->assertTrue( $mfCookieExpected == $getUseFormatCookieExpiry->invokeArgs( $wgExtMobileFrontend, array( $startTime ) ), 'Using MobileFrontend expiry.' );
334 -
335 - $wgMobileFrontendFormatCookieExpiry = null;
336 - $defaultMWCookieExpected = $startTime + $wgCookieExpiration;
337 - $this->assertTrue( $defaultMWCookieExpected == $getUseFormatCookieExpiry->invokeArgs( $wgExtMobileFrontend, array( $startTime ) ), 'Using default MediaWiki cookie expiry.' );
338 -
339 - // reset global back to original value
340 - $wgMobileFrontendFormatCookieExpiry = $origMFCookieExpiry;
341 - }
342 -
343 - /**
344 - * @outputBuffering enabled
345 - */
346 - /*public function testCookie() {
347 - global $wgRequest;
348 - $wgRequest->response()->setCookie( 'foo', 'bar' );
349 - $this->assertEquals( $wgRequest->getCookie( 'foo' ), 'bar' );
350 - setcookie( 'foobar', 'pants' );
351 - $this->asertEquals( $_COOKIE[ 'foobar' ], 'pants' );
352 - }
353 -
354 - /**
355 - * NB this will not work as PHPUnit seems to not make it possible to set
356 - * and retrieve cookies. Note above test, testCookie() - both assertions
357 - * currently fail, making testing ExtMobileFrontend::checkUserFormatCookie()
358 - * impossible.
359 - *
360 - * @outputBuffering enabled
361 - */
362 - /*public function testCheckUseFormatCookie() {
363 -
364 - }
365 - */
366306 }
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/library/WURFL/Handlers/Utils.php
@@ -174,12 +174,12 @@
175175 }
176176
177177 /**
178 - * The nth($ordinal) occurrence of $needle in $haystack or -1 if no match is found
 178+ * The nth($ordinal) occurance of $needle in $haystack or -1 if no match is found
179179 * @param string $haystack
180180 * @param string $needle
181181 * @param int $ordinal
182182 * @throws InvalidArgumentException
183 - * @return int Char index of occurrence
 183+ * @return int Char index of occurance
184184 */
185185 public static function ordinalIndexOf($haystack, $needle, $ordinal) {
186186 if (is_null ( $haystack ) || empty ( $haystack )) {
@@ -206,7 +206,7 @@
207207 }
208208
209209 /**
210 - * First occurrence of a / character
 210+ * First occurance of a / character
211211 * @param string $string Haystack
212212 * @return int Char index
213213 */
@@ -216,7 +216,7 @@
217217 }
218218
219219 /**
220 - * Second occurrence of a / character
 220+ * Second occurance of a / character
221221 * @param string $string Haystack
222222 * @return int Char index
223223 */
@@ -228,7 +228,7 @@
229229 }
230230
231231 /**
232 - * First occurrence of a space character
 232+ * First occurance of a space character
233233 * @param string $string Haystack
234234 * @return int Char index
235235 */
@@ -238,7 +238,7 @@
239239 }
240240
241241 /**
242 - * First occurrence of a ; character or length
 242+ * First occurance of a ; character or length
243243 * @param string $string Haystack
244244 * @return int Char index
245245 */
@@ -247,7 +247,7 @@
248248 }
249249
250250 /**
251 - * First occurrence of $toMatch string or length
 251+ * First occurance of $toMatch string or length
252252 * @param string $string Haystack
253253 * @param string $toMatch Needle
254254 * @return int Char index
@@ -339,4 +339,4 @@
340340 public static function removeLocale($userAgent) {
341341 return preg_replace ( self::LANGUAGE_PATTERN, "", $userAgent, 1 );
342342 }
343 -}
 343+}
\ No newline at end of file
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php
@@ -26,6 +26,7 @@
2727 public static $searchField;
2828 public static $disableImagesURL;
2929 public static $enableImagesURL;
 30+ public static $disableMobileSiteURL;
3031 public static $viewNormalSiteURL;
3132 public static $currentURL;
3233 public static $displayNoticeId;
@@ -43,7 +44,6 @@
4445 public static $logoutHtml;
4546 public static $loginHtml;
4647 public static $zeroRatedBanner;
47 - public static $useFormatCookieName;
4848
4949 protected $useFormat;
5050
@@ -72,6 +72,7 @@
7373 'mobile-frontend-hide-button',
7474 'mobile-frontend-back-to-top-of-section',
7575 'mobile-frontend-regular-site',
 76+ 'mobile-frontend-perm-stop-redirect',
7677 'mobile-frontend-home-button',
7778 'mobile-frontend-random-button',
7879 'mobile-frontend-are-you-sure',
@@ -191,7 +192,7 @@
192193 * @return bool
193194 */
194195 public function addMobileFooter( &$obj, &$tpl ) {
195 - global $wgRequest, $wgServer;
 196+ global $wgRequest;
196197 wfProfileIn( __METHOD__ );
197198
198199 $title = $obj->getTitle();
@@ -203,7 +204,6 @@
204205 $this->removeQueryStringParameter( $wgRequest->appendQuery( 'useformat=mobile' ), 'mobileaction' )
205206 );
206207
207 - $mobileViewUrl = $this->getMobileUrl( $wgServer . $mobileViewUrl );
208208 $tpl->set( 'mobileview', "<a href='{$mobileViewUrl}' class='noprint'>" . wfMsg( 'mobile-frontend-view' ) . "</a>" );
209209 $footerlinks['places'][] = 'mobileview';
210210 $tpl->set( 'footerlinks', $footerlinks );
@@ -231,7 +231,8 @@
232232
233233 self::$disableImagesURL = $wgRequest->escapeAppendQuery( 'disableImages=1' );
234234 self::$enableImagesURL = $wgRequest->escapeAppendQuery( 'enableImages=1' );
235 - self::$viewNormalSiteURL = $wgRequest->escapeAppendQuery( 'useformat=desktop' );
 235+ self::$disableMobileSiteURL = $wgRequest->escapeAppendQuery( 'mobileaction=disable_mobile_site' );
 236+ self::$viewNormalSiteURL = $wgRequest->escapeAppendQuery( 'mobileaction=view_normal_site' );
236237 self::$currentURL = $wgRequest->getFullRequestURL();
237238 self::$leaveFeedbackURL = $wgRequest->escapeAppendQuery( 'mobileaction=leave_feedback' );
238239
@@ -476,6 +477,12 @@
477478 exit();
478479 }
479480
 481+ if ( $mobileAction == 'disable_mobile_site' && $this->contentFormat == 'XHTML' ) {
 482+ echo $this->renderDisableMobileSiteXHTML();
 483+ wfProfileOut( __METHOD__ );
 484+ exit();
 485+ }
 486+
480487 if ( $mobileAction == 'opt_in_mobile_site' && $this->contentFormat == 'XHTML' ) {
481488 echo $this->renderOptInMobileSiteXHTML();
482489 wfProfileOut( __METHOD__ );
@@ -709,7 +716,6 @@
710717 }
711718 $wgOut->addVaryHeader( 'Cookie' );
712719 $wgOut->addVaryHeader( 'X-Carrier' );
713 - $wgOut->addVaryHeader( 'X-Images' );
714720 wfProfileOut( __METHOD__ );
715721 return true;
716722 }
@@ -851,6 +857,54 @@
852858 }
853859
854860 /**
 861+ * @return string
 862+ */
 863+ private function renderDisableMobileSiteXHTML() {
 864+ wfProfileIn( __METHOD__ );
 865+ if ( $this->contentFormat == 'XHTML' ) {
 866+ $this->getMsg();
 867+ $areYouSure = self::$messages['mobile-frontend-are-you-sure'];
 868+ $explainDisable = self::$messages['mobile-frontend-explain-disable'];
 869+ $disableButton = self::$messages['mobile-frontend-disable-button'];
 870+ $backButton = self::$messages['mobile-frontend-back-button'];
 871+ $htmlTitle = $areYouSure;
 872+ $title = $areYouSure;
 873+ $searchTemplate = $this->getSearchTemplate();
 874+ $searchWebkitHtml = $searchTemplate->getHTML();
 875+ $footerTemplate = $this->getFooterTemplate();
 876+ $footerHtml = $footerTemplate->getHTML();
 877+ $disableTemplate = new DisableTemplate();
 878+ $options = array(
 879+ 'currentURL' => self::$currentURL,
 880+ 'mobileRedirectFormAction' => self::$mobileRedirectFormAction,
 881+ 'areYouSure' => $areYouSure,
 882+ 'explainDisable' => $explainDisable,
 883+ 'disableButton' => $disableButton,
 884+ 'backButton' => $backButton,
 885+ 'htmlTitle' => $htmlTitle,
 886+ 'title' => $title,
 887+ );
 888+ $disableTemplate->setByArray( $options );
 889+ $disableHtml = $disableTemplate->getHTML();
 890+
 891+ $contentHtml = $disableHtml;
 892+ $applicationTemplate = $this->getApplicationTemplate();
 893+ $options = array(
 894+ 'htmlTitle' => $htmlTitle,
 895+ 'searchWebkitHtml' => $searchWebkitHtml,
 896+ 'contentHtml' => $contentHtml,
 897+ 'footerHtml' => $footerHtml,
 898+ );
 899+ $applicationTemplate->setByArray( $options );
 900+ $applicationHtml = $applicationTemplate->getHTML();
 901+ wfProfileOut( __METHOD__ );
 902+ return $applicationHtml;
 903+ }
 904+ wfProfileOut( __METHOD__ );
 905+ return '';
 906+ }
 907+
 908+ /**
855909 * @return DomElement
856910 */
857911 public function renderLogin() {
@@ -1110,6 +1164,7 @@
11111165 $options = array(
11121166 'messages' => self::$messages,
11131167 'leaveFeedbackURL' => self::$leaveFeedbackURL,
 1168+ 'disableMobileSiteURL' => self::$disableMobileSiteURL,
11141169 'viewNormalSiteURL' => self::$viewNormalSiteURL,
11151170 'disableImages' => self::$disableImages,
11161171 'disableImagesURL' => self::$disableImagesURL,
@@ -1165,8 +1220,6 @@
11661221 'zeroRatedBanner' => self::$zeroRatedBanner,
11671222 'showText' => self::$messages[ 'mobile-frontend-show-button' ],
11681223 'hideText' => self::$messages[ 'mobile-frontend-hide-button' ],
1169 - 'useFormatCookieName' => self::$useFormatCookieName,
1170 - 'useFormatCookieDuration' => $this->getUseFormatCookieDuration(),
11711224 );
11721225 $applicationTemplate->setByArray( $options );
11731226 wfProfileOut( __METHOD__ );
@@ -1223,7 +1276,6 @@
12241277 $testModules['qunit']['ext.mobilefrontend.tests'] = array(
12251278 'scripts' => array( 'tests/js/fixtures.js', 'javascripts/application.js',
12261279 'javascripts/opensearch.js', 'javascripts/banner.js',
1227 - 'javascripts/toggle.js', 'tests/js/test_toggle.js',
12281280 'tests/js/test_application.js', 'tests/js/test_opensearch.js', 'tests/js/test_banner.js' ),
12291281 'dependencies' => array( ),
12301282 'localBasePath' => dirname( __FILE__ ),
@@ -1388,20 +1440,15 @@
13891441 }
13901442
13911443 protected function shouldDisplayMobileView() {
1392 - // always display desktop view if it's explicitly requested
1393 - $useFormat = $this->getUseFormat();
1394 - if ( $useFormat == 'desktop' ) {
 1444+ if ( !$this->isMobileDevice() && !$this->isFauxMobileDevice() ) {
13951445 return false;
13961446 }
1397 -
1398 - if ( !$this->isMobileDevice() && !$this->isFauxMobileDevice() ) {
1399 - return false;
1400 - }
14011447
14021448 $action = $this->getAction();
 1449+ $mobileAction = $this->getMobileAction();
14031450
1404 -
1405 - if ( $action === 'edit' || $action === 'history' ) {
 1451+ if ( $action === 'edit' || $action === 'history' ||
 1452+ $mobileAction === 'view_normal_site' ) {
14061453 return false;
14071454 }
14081455
@@ -1449,80 +1496,33 @@
14501497 }
14511498
14521499 public function checkUseFormatCookie() {
1453 - global $wgRequest, $wgCookiePrefix;
 1500+ global $wgRequest;
14541501
1455 - if ( !isset( self::$useFormatCookieName )) {
1456 - self::$useFormatCookieName = 'mf_useformat';
1457 - }
1458 -
14591502 $useFormat = $this->getUseFormat();
14601503 $useFormatFromCookie = $wgRequest->getCookie( 'mf_useformat' );
1461 -
1462 - // fetch format from cookie and set it if one is not otherwise specified
14631504 if( !strlen( $useFormat ) && !is_null( $useFormatFromCookie ) ) {
14641505 $this->setUseFormat( $useFormatFromCookie );
14651506 }
14661507
1467 - // set appropriate cookie if necessary
1468 - if ( ( $useFormatFromCookie != 'mobile' && $useFormat == 'mobile' ) ||
1469 - ( $useFormatFromCookie != 'desktop' && $useFormat == 'desktop' ) ) {
1470 - $this->setUseFormatCookie( $useFormat );
 1508+ // if we should not be displaying the mobile view, make sure cookies are unset etc.
 1509+ if ( !$this->shouldDisplayMobileView() ) {
 1510+ // make sure cookie is unset for appropriate mobile actions
 1511+ $mobileAction = $this->getMobileAction();
 1512+ if ( in_array( $mobileAction, array( 'view_normal_site', 'disable_mobile_site' ) ) ) {
 1513+ $wgRequest->response()->setCookie( 'mf_useformat', false, time() - 3600 );
 1514+ }
 1515+
 1516+ // make sure useformat is unset
 1517+ $this->setUseFormat( '' );
 1518+ return;
14711519 }
1472 - }
1473 -
1474 - /**
1475 - * Set the mf_useformat cookie
1476 - *
1477 - * This cookie can determine whether or not a user should see the mobile
1478 - * version of pages.
1479 - *
1480 - * @param string The format to store in the cookie
1481 - */
1482 - protected function setUseFormatCookie( $useFormat ) {
1483 - global $wgRequest, $wgCookiePath, $wgCookieSecure, $wgCookieDomain;
1484 - $expiry = $this->getUseFormatCookieExpiry();
14851520
1486 - // use regular php setcookie() rather than WebResponse::setCookie
1487 - // so we can ignore $wgCookieHttpOnly since the protection it provides
1488 - // is irrelevant for this cookie.
1489 - setcookie( self::$useFormatCookieName, $useFormat, $expiry, $wgCookiePath, $wgCookieDomain, $wgCookieSecure );
 1521+ // if getUseFormat and no cookie set, set the cookie
 1522+ if ( is_null( $useFormatFromCookie ) && strlen( $useFormat ) ) {
 1523+ $wgRequest->response()->setCookie( 'mf_useformat', $useFormat, 0 );
 1524+ }
14901525 }
14911526
1492 - /**
1493 - * Get the expiration time for the mf_useformat cookie
1494 - *
1495 - * @param int The base time (in seconds since Epoch) from which to calculate
1496 - * cookie expiration. If null, time() is used.
1497 - * @return int The time (in seconds since Epoch) that the cookie should expire
1498 - */
1499 - protected function getUseFormatCookieExpiry( $startTime=null ) {
1500 - $cookieDuration = $this->getUseFormatCookieDuration();
1501 - if ( intval( $startTime ) === 0 ) $startTime = time();
1502 - $expiry = $startTime + $cookieDuration;
1503 - return $expiry;
1504 - }
1505 -
1506 - public function getCacheVaryCookies( $out, &$cookies ) {
1507 - global $wgCookiePrefix;
1508 - $cookies[] = 'mf_useformat';
1509 - return true;
1510 - }
1511 -
1512 - /**
1513 - * Determine the duration the cookie should last.
1514 - *
1515 - * If $wgMobileFrontendFormatcookieExpiry has a non-0 value, use that
1516 - * for the duration. Otherwise, fall back to $wgCookieExpiration.
1517 - *
1518 - * @return int The number of seconds for which the cookie should last.
1519 - */
1520 - protected function getUseFormatCookieDuration() {
1521 - global $wgMobileFrontendFormatCookieExpiry, $wgCookieExpiration;
1522 - $cookieDuration = ( abs( intval( $wgMobileFrontendFormatCookieExpiry ) ) > 0 ) ?
1523 - $wgMobileFrontendFormatCookieExpiry : $wgCookieExpiration;
1524 - return $cookieDuration;
1525 - }
1526 -
15271527 public function getVersion() {
15281528 return __CLASS__ . ': $Id$';
15291529 }
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/api/ApiQueryExcerpts.php
@@ -197,7 +197,7 @@
198198
199199 public function getExamples() {
200200 return array(
201 - 'api.php?action=query&prop=excerpts&exlength=175&titles=Therion' => 'Get a 175-character excerpt',
 201+ 'api.php?action=query&prop=excerpt&length=175&titles=Therion' => 'Get a 175-character excerpt',
202202 );
203203 }
204204
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/references.js
@@ -1,86 +0,0 @@
2 -if( typeof jQuery !== 'undefined' ) {
3 - MobileFrontend.references = (function($) {
4 - var calculatePosition, hashtest, options = {};
5 -
6 - hashtest = window.location.hash.substr(1).match(/refspeed:([0-9]*)/);
7 - options.animationSpeed = hashtest ? parseInt( hashtest[1], 10 ) : 500;
8 - hashtest = window.location.hash.substr(1).match(/refanimation:([a-z]*)/);
9 - options.animation = hashtest ? hashtest[1] : null;
10 -
11 - function collect() {
12 - var references = {};
13 - $( 'ol.references li' ).each(function(i, el) {
14 - references[ $(el).attr( 'id' ) ] = {
15 - html: $(el).html(),
16 - label: i + 1
17 - };
18 - });
19 - return references;
20 - }
21 -
22 - // TODO: only apply to places that need it
23 - // http://www.quirksmode.org/blog/archives/2010/12/the_fifth_posit.html
24 - // https://github.com/Modernizr/Modernizr/issues/167
25 - calculatePosition = function() {
26 - var h = $( '#mf-references' ).outerHeight();
27 - $( '#mf-references' ).css( {
28 - top: ( window.innerHeight + window.pageYOffset ) - h,
29 - bottom: 'auto',
30 - position: 'absolute'
31 - } );
32 - };
33 - $( document ).scroll(calculatePosition);
34 -
35 - function init() {
36 - $( '<div id="mf-references"><div></div></div>' ).hide().appendTo( document.body );
37 - var close = function() {
38 - var top;
39 - lastLink = null;
40 - if( options.animation === 'none' ) {
41 - $( '#mf-references' ).hide();
42 - } else if( options.animation === 'slide' ){
43 - top = window.innerHeight + window.pageYOffset;
44 - $( '#mf-references' ).show().animate( { top: top }, options.animationSpeed );
45 - } else {
46 - $( '#mf-references' ).fadeOut( options.animationSpeed );
47 - }
48 - }, lastLink;
49 - $( '<button>close</button>' ).click( close ).appendTo( '#mf-references' );
50 - $( '.mw-cite-backlink a' ).click( close );
51 -
52 - var data, html, href, references = collect();
53 - $( 'sup a' ).unbind('click').click( function(ev) {
54 - var top, oh;
55 - href = $(this).attr( 'href' );
56 - data = href && href.charAt(0) === '#' ?
57 - references[ href.substr( 1, href.length ) ] : null;
58 -
59 - if( !$("#mf-references").is(":visible") || lastLink !== href) {
60 - lastLink = href;
61 - if( data ) {
62 - html = '<h3>[' + data.label + ']</h3>' + data.html;
63 - } else {
64 - html = $( '<a />' ).text( $(this).text() ).
65 - attr( 'href', href ).appendTo('<div />').parent().html();
66 - }
67 - $( '#mf-references div' ).html( html );
68 - calculatePosition();
69 - if( options.animation === 'none' ) {
70 - $( '#mf-references' ).show();
71 - } else if( options.animation === 'slide' ){
72 - top = window.innerHeight + window.pageYOffset;
73 - oh = $( '#mf-references' ).outerHeight();
74 - $( '#mf-references' ).show().css( { 'top': top } ).
75 - animate( { top: top - oh }, options.animationSpeed );
76 - } else {
77 - $( '#mf-references' ).fadeIn( options.animationSpeed );
78 - }
79 - } else {
80 - close();
81 - }
82 - ev.preventDefault();
83 - });
84 - }
85 - init();
86 - })(jQuery);
87 -}
\ No newline at end of file
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/toggle.js
@@ -1,97 +0,0 @@
2 -/*global document, window */
3 -/*jslint sloppy: true, white:true, maxerr: 50, indent: 4, plusplus: true*/
4 -MobileFrontend.toggle = (function() {
5 - var u = MobileFrontend.utils;
6 -
7 - function init() {
8 - var i, a, heading, btns,
9 - sectionHeadings = u( '.section_heading' );
10 -
11 - // TODO: remove in future - currently enables toggling in Wikipedia Mobile App v < 1.1
12 - window.wm_toggle_section = wm_toggle_section;
13 - btns = u( '.section_heading button' );
14 - for( i = 0; i < btns.length; i++ ) {
15 - u( btns[i] ).remove();
16 - }
17 -
18 - function openSectionHandler() {
19 - var sectionNumber = this.id ? this.id.split( '_' )[1] : -1;
20 - if( sectionNumber > -1 ) {
21 - wm_toggle_section( sectionNumber );
22 - }
23 - }
24 - function createButton( visible ) {
25 - var btn, label;
26 - btn = document.createElement( 'button' );
27 - label = document.createTextNode( MobileFrontend.message( visible ? 'expand-section' : 'collapse-section' ) );
28 - btn.className = visible ? 'show' : 'hide';
29 - btn.appendChild( label );
30 - return btn;
31 - }
32 - if(!sectionHeadings) {
33 - sectionHeadings = [];
34 - } else {
35 - u( document.body ).addClass( 'togglingEnabled' );
36 - }
37 - for( i = 0; i < sectionHeadings.length; i++ ) {
38 - heading = sectionHeadings[i];
39 - heading.removeAttribute( 'onclick' ); // TODO: remove any legacy onclick handlers
40 - heading.insertBefore( createButton( true ), heading.firstChild );
41 - heading.insertBefore( createButton( false ), heading.firstChild );
42 - u( heading ).bind( 'click', openSectionHandler );
43 - }
44 -
45 - function checkHash() {
46 - var hash = this.hash || document.location.hash;
47 - if ( hash.indexOf( '#' ) === 0 ) {
48 - wm_reveal_for_hash( hash );
49 - }
50 - }
51 - checkHash();
52 - for ( a = document.getElementsByTagName( 'a' ), i = 0; i < a.length; i++ ) {
53 - u( a[i] ).bind( 'click', checkHash );
54 - }
55 - }
56 -
57 - function wm_reveal_for_hash( hash ) {
58 - var targetel = document.getElementById( hash.substr(1) ),
59 - p, section_idx;
60 - if ( targetel ) {
61 - p = targetel;
62 - while ( p && !u(p).hasClass( 'content_block' ) &&
63 - !u(p).hasClass( 'section_heading' ) ) {
64 - p = p.parentNode;
65 - }
66 - if ( p && p.style.display !== 'block' ) {
67 - section_idx = parseInt( p.id.split( '_' )[1], 10 );
68 - wm_toggle_section( section_idx );
69 - }
70 - }
71 - }
72 -
73 - function wm_toggle_section( section_id ) {
74 - var b = document.getElementById( 'section_' + section_id ),
75 - bb = b.getElementsByTagName( 'button' ), i, s, e;
76 - if( u(b).hasClass( 'openSection' ) ) {
77 - u(b).removeClass( 'openSection' );
78 - } else {
79 - u(b).addClass( 'openSection' );
80 - }
81 - for ( i = 0, d = ['content_','anchor_']; i<=1; i++ ) {
82 - e = document.getElementById( d[i] + section_id );
83 - if ( e && u( e ).hasClass( 'openSection' ) ) {
84 - u( e ).removeClass( 'openSection' )
85 - } else {
86 - u( e ).addClass( 'openSection' )
87 - }
88 - }
89 - }
90 -
91 - init();
92 - return {
93 - wm_reveal_for_hash: wm_reveal_for_hash,
94 - wm_toggle_section: wm_toggle_section,
95 - init: init
96 - };
97 -
98 -})();
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/references.min.js
@@ -1 +0,0 @@
2 -if(typeof jQuery!=="undefined"){MobileFrontend.references=(function(d){var b,f,a={};f=window.location.hash.substr(1).match(/refspeed:([0-9]*)/);a.animationSpeed=f?parseInt(f[1],10):500;f=window.location.hash.substr(1).match(/refanimation:([a-z]*)/);a.animation=f?f[1]:null;function c(){var g={};d("ol.references li").each(function(h,j){g[d(j).attr("id")]={html:d(j).html(),label:h+1}});return g}b=function(){var g=d("#mf-references").outerHeight();d("#mf-references").css({top:(window.innerHeight+window.pageYOffset)-g,bottom:"auto",position:"absolute"})};d(document).scroll(b);function e(){d('<div id="mf-references"><div></div></div>').hide().appendTo(document.body);var l=function(){var m;j=null;if(a.animation==="none"){d("#mf-references").hide()}else{if(a.animation==="slide"){m=window.innerHeight+window.pageYOffset;d("#mf-references").show().animate({top:m},a.animationSpeed)}else{d("#mf-references").fadeOut(a.animationSpeed)}}},j;d("<button>close</button>").click(l).appendTo("#mf-references");d(".mw-cite-backlink a").click(l);var k,i,g,h=c();d("sup a").unbind("click").click(function(m){var o,n;g=d(this).attr("href");k=g&&g.charAt(0)==="#"?h[g.substr(1,g.length)]:null;if(!d("#mf-references").is(":visible")||j!==g){j=g;if(k){i="<h3>["+k.label+"]</h3>"+k.html}else{i=d("<a />").text(d(this).text()).attr("href",g).appendTo("<div />").parent().html()}d("#mf-references div").html(i);b();if(a.animation==="none"){d("#mf-references").show()}else{if(a.animation==="slide"){o=window.innerHeight+window.pageYOffset;n=d("#mf-references").outerHeight();d("#mf-references").show().css({top:o}).animate({top:o-n},a.animationSpeed)}else{d("#mf-references").fadeIn(a.animationSpeed)}}}else{l()}m.preventDefault()})}e()})(jQuery)};
\ No newline at end of file
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/toggle.min.js
@@ -1 +0,0 @@
2 -MobileFrontend.toggle=(function(){var a=MobileFrontend.utils;function c(){var l,f,n,m,h=a(".section_heading");window.wm_toggle_section=b;m=a(".section_heading button");for(l=0;l<m.length;l++){a(m[l]).remove()}function k(){var i=this.id?this.id.split("_")[1]:-1;if(i!==-1){b(i)}}function g(p){var o,i;o=document.createElement("button");i=document.createTextNode(MobileFrontend.message(p?"expand-section":"collapse-section"));o.className=p?"show":"hide";o.appendChild(i);return o}if(!h){h=[]}else{a(document.body).addClass("togglingEnabled")}for(l=0;l<h.length;l++){n=h[l];n.removeAttribute("onclick");n.insertBefore(g(true),n.firstChild);n.insertBefore(g(false),n.firstChild);a(n).bind("click",k)}function j(){var i=this.hash||document.location.hash;if(i.indexOf("#")===0){e(i)}}j();for(f=document.getElementsByTagName("a"),l=0;l<f.length;l++){a(f[l]).bind("click",j)}}function e(i){var g=document.getElementById(i.substr(1)),h,f;if(g){h=g;while(h&&!a(h).hasClass("content_block")&&!a(h).hasClass("section_heading")){h=h.parentNode}if(h&&!a(h).hasClass("openSection")){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;if(a(f).hasClass("openSection")){a(f).removeClass("openSection")}else{a(f).addClass("openSection")}for(h=0,d=["content_","anchor_"];h<=1;h++){k=document.getElementById(d[h]+g);if(k&&a(k).hasClass("openSection")){a(k).removeClass("openSection")}else{a(k).addClass("openSection")}}}c();return{wm_reveal_for_hash:e,wm_toggle_section:b,init:c}})();
\ No newline at end of file
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.min.js
@@ -1 +1 @@
2 -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}if(y){y.style.display="none"}}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==="clearsearch"&&results){results.innerHTML=""}}else{s()}}var l=function(u){u.preventDefault();clearTimeout(m);q=k.value;if(q.length<1){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){url=c+"?action=opensearch&limit="+A+"&namespace=0&format=xml&search="+u;n.ajax({url:url,success:function(B){if(n(document.body).hasClass("full-screen-search")){p(g(B))}}})}function g(E){var F=[],B,C,D,u=E.getElementsByTagName("Item");for(B=0;B<u.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.length<1){D.innerHTML='<ul class="suggestions-results" title="No Results"><li class="suggestions-result">No 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;E<J.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 E=document.getElementById("clearsearch"),u=document.getElementById("search");function C(){if(E){if(u.value.length>0){E.style.display="block"}else{E.style.display="none"}}}function B(F){u.value="";E.style.display="none";F.preventDefault()}function D(){u.select()}n(E).bind("mousedown",B);n(u).bind("keyup",C);n(u).bind("click",D)}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
 2+MobileFrontend.opensearch=(function(){var c="/api.php",p=-1,f=500,E=15,v,w=document.getElementById("results"),o=document.getElementById("search"),z=document.getElementById("sq"),a=document.getElementById("searchbox"),e=document.getElementById("logo"),g=document.getElementById("goButton"),y=document.getElementById("content"),s=document.getElementById("footer"),F=document.getElementById("zero-rated-banner")||document.getElementById("zero-rated-banner-red"),C=document.getElementById("clearsearch"),n=false,q={},r=MobileFrontend.utils;if(scriptPath){c=scriptPath+c}function x(){w.style.display="none"}function k(){if(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)){var u=r('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";r(document.body).bind("gesturestart",function(){u.content="width=device-width, initial-scale=1.0"})}}}k();o.onfocus=function(){var u,J,K,G,H,I;a=document.getElementById("searchbox");z=document.getElementById("sq");y=document.getElementById("content");s=document.getElementById("footer");k();if(!n){MobileFrontend.utils(document.body).addClass("full-screen-search");u=document.getElementById("placeholder");if(!u){J=document.createElement("span");K=document.createTextNode(placeholder);J.setAttribute("id","placeholder");J.appendChild(K);a.insertBefore(J,a.firstChild)}u=document.getElementById("placeholder");if(u){u.style.display="block"}if(u&&o.value!==""){u.style.display="none"}I=document.getElementById("remove-results");if(!I){G=document.createElement("a");G.setAttribute("href","#");G.setAttribute("id","remove-results");r(G).bind("click",D);H=document.createElement("div");H.setAttribute("id","left-arrow");G.appendChild(H);z.insertBefore(G,z.firstChild)}n=true}};function D(){MobileFrontend.utils(document.body).removeClass("full-screen-search");var G,u=document.getElementById("placeholder");if(u){u.style.display="none"}if(n){n=false}if(C){C.style.display="none"}}function b(G){var u;if(!G){G=window.event}if(G.target){u=G.target}else{if(G.srcElement){u=G.srcElement}}if(u.nodeType===3){u=u.parentNode}G.cancelBubble=true;G.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==="clearsearch"&&w){w.innerHTML=""}}else{x()}}window.onload=function(){r(o).bind("keyup",function(){clearTimeout(p);v=this.value;if(v.length<1){w.innerHTML=""}else{v=encodeURIComponent(v);p=setTimeout(function(){m(v)},f)}})};function m(u){url=c+"?action=opensearch&limit="+E+"&namespace=0&format=xml&search="+u;r.ajax({url:url,success:function(G){t(j(G))}})}function j(J){var K=[],G,H,I,u=J.getElementsByTagName("Item");for(G=0;G<u.length;G++){H=u[G];I={label:H.getElementsByTagName("Text")[0].textContent,value:H.getElementsByTagName("Url")[0].textContent};K.push(I)}return K}function l(G){var u=document.getElementById("search");if(u){u.value=G+" ";u.focus();m(u.value)}}function h(H){var G=document.createTextNode(H);var u=document.createElement("div");u.appendChild(G);return u.innerHTML}function B(u){return u.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function t(P){var J=document.getElementById("results"),L,K,I=h(document.getElementById("search").value),H,O,G,u,M,N;J.style.display="block";if(o){o.focus()}if(!P||P.length<1){J.innerHTML='<div class="suggestions-results" title="No Results">No Results</div>'}else{if(J.firstChild){J.removeChild(J.firstChild)}L=document.createElement("div");L.className="suggestions-results";J.appendChild(L);H=function(){var Q=this.parentNode.getAttribute("title");l(Q)};for(K=0;K<P.length;K++){O=P[K];u=document.createElement("div");M=document.createElement("a");u.setAttribute("title",O.label);u.className="suggestions-result";N=document.createTextNode("+");M.appendChild(N);M.className="sq-val-update";r(M).bind("click",H);u.appendChild(M);M=document.createElement("a");M.setAttribute("href",O.value.replace(/^(?:\/\/|[^\/]+)*\//,"/"));M.className="search-result-item";N=document.createTextNode(O.label);M.appendChild(N);u.appendChild(M);L.appendChild(u);G=B(I);M.innerHTML=M.innerHTML.replace(new RegExp("("+G+")","ig"),"<strong>$1</strong>")}}}function d(){var u=document.getElementById("placeholder");if(u){u.style.display="none"}}function i(){var K=document.getElementById("clearsearch"),G=document.getElementById("search"),u=document.getElementById("results");function I(){if(K){if(G.value.length>0){K.style.display="block"}else{K.style.display="none"}}}function H(L){G.value="";K.style.display="none";if(L){L.preventDefault()}}function J(){G.select()}r(K).bind("mousedown",H);r(G).bind("keyup",I);r(G).bind("keydown",d);r(G).bind("click",J)}function A(){var u=document.getElementById("results");u.onmousedown=b;document.body.onmousedown=b;document.body.ontouchstart=b;u.ontouchstart=b;o.onpaste=d}A();i();return{init:A,initClearSearch:i,writeResults:t,createObjectArray:j,removeResults:D}}());
\ No newline at end of file
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/application.min.js
@@ -1 +1 @@
2 -MobileFrontend=(function(){var a;function b(){var e;a(document.body).addClass("jsEnabled");e=document.getElementById("languageselection");function c(){var g;if(e){g=e.options[e.selectedIndex].value;if(g){location.href=g}}}a(e).bind("change",c);function d(){var g=document.getElementById("nav").style;g.display=g.display==="block"?"none":"block"}a(document.getElementById("logo")).bind("click",d);function f(){var h=MobileFrontend.setting("useFormatCookieName");var g=MobileFrontend.setting("useFormatCookieDuration");g=g/(24*60*60);MobileFrontend.banner.writeCookie(h,"desktop",g)}a(document.getElementById("mf-display-toggle")).bind("click",f);window.scrollTo(0,1)}a=typeof jQuery!=="undefined"?jQuery:function(e){if(typeof(e)==="string"){if(document.querySelectorAll){return[].slice.call(document.querySelectorAll(e))}}else{if(!e){e=document.createElement("div")}}function d(i){var j=e.className.split(" ");return j.indexOf(i)>-1}function f(i){var j=e.className,k=j.split(" ");k.push(i);e.className=k.join(" ")}function g(j){var l=e.className,m=l.split(" "),n=[],k;for(k=0;k<m.length;k++){if(m[k]!==j){n.push(m[k])}}e.className=n.join(" ")}function h(j,i){e.addEventListener(j,i,false)}function c(){e.parentNode.removeChild(e)}return{addClass:f,bind:h,hasClass:d,remove:c,removeClass:g}};a.ajax=a.ajax||function(e){var c,d;if(window.XMLHttpRequest){c=new XMLHttpRequest()}else{c=new ActiveXObject("Microsoft.XMLHTTP")}if(c.overrideMimeType){c.overrideMimeType("text/xml")}c.onreadystatechange=function(){if(c.readyState===4&&c.status===200){e.success(c.responseXML)}};c.open("GET",e.url,true);c.send()};b();return{init:b,message:function(c){return mwMobileFrontendConfig.messages[c]||""},setting:function(c){return mwMobileFrontendConfig.settings[c]||""},utils:a}}());
\ No newline at end of file
 2+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;j<h.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?showText:hideText);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;j<n.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;j<o.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(h&&h.className!=="content_block"&&h.className!=="section_heading"){h=h.parentNode}if(h&&h.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;l<n.length;l++){if(n[l]!==k){o.push(n[l])}}g.className=o.join(" ")}function j(l,k){g.addEventListener(l,k,false)}function f(){g.parentNode.removeChild(g)}return{addClass:h,bind:j,remove:f,removeClass:i}};a.ajax=a.ajax||function(h){var f,g;if(window.XMLHttpRequest){f=new XMLHttpRequest()}else{f=new ActiveXObject("Microsoft.XMLHTTP")}if(f.overrideMimeType){f.overrideMimeType("text/xml")}f.onreadystatechange=function(){if(f.readyState===4&&f.status===200){h.success(f.responseXML)}};f.open("GET",h.url,true);f.send()};c();return{wm_reveal_for_hash:e,wm_toggle_section:b,init:c,utils:a}}());
\ No newline at end of file
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/opensearch.js
@@ -8,7 +8,9 @@
99 sb = document.getElementById( 'searchbox' ),
1010 u = MobileFrontend.utils;
1111
12 - apiUrl = MobileFrontend.setting( 'scriptPath' ) + apiUrl;
 12+ if ( scriptPath ) {
 13+ apiUrl = scriptPath + apiUrl;
 14+ }
1315
1416 function hideResults() {
1517 var results = document.getElementById( 'results' );
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/opensearch.min.js
@@ -1 +1 @@
2 -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.length<1){h.innerHTML=""}else{c=setTimeout(function(){o(q)},f)}})};function o(q){q=encodeURIComponent(q);url=l+"?action=opensearch&limit="+g+"&namespace=0&format=xml&search="+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;r<q.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(q.value)}}function j(B){var t=document.getElementById("results"),w,u,s,A,q,y,z,r=document.getElementById("sq"),v=document.getElementById("header");t.style.display="block";var x=r.offsetParent.offsetTop+r.offsetHeight+r.offsetTop-1+v.offsetTop;t.style.top=x+"px";if(!B||B.length<1){t.innerHTML='<div class="suggestions-results"><div class="suggestions-result">No results</div></div>'}else{if(t.firstChild){t.removeChild(t.firstChild)}w=document.createElement("div");w.className="suggestions-results";t.appendChild(w);s=function(){var C=this.parentNode.getAttribute("title");d(C)};for(u=0;u<B.length;u++){A=B[u];q=document.createElement("div");y=document.createElement("a");q.setAttribute("title",A.label);q.className="suggestions-result";z=document.createTextNode("+");y.appendChild(z);y.className="sq-val-update";m(y).bind("click",s);q.appendChild(y);y=document.createElement("a");y.setAttribute("href",A.value.replace(/^(?:\/\/|[^\/]+)*\//,"/"));y.className="search-result-item";z=document.createTextNode(A.label);y.appendChild(z);q.appendChild(y);w.appendChild(q)}}}function a(){var v=document.getElementById("clearsearch"),r=document.getElementById("search"),q=document.getElementById("results");function t(){if(v){if(r.value.length>0){v.style.display="block"}else{v.style.display="none";if(q){q.style.display="none"}}}}function s(w){r.value="";v.style.display="none";if(q){q.style.display="none"}if(w){w.preventDefault()}}function u(){r.select()}m(v).bind("mousedown",s);m(r).bind("keyup",t);m(r).bind("click",u)}function n(){var q=document.getElementById("results");q.onmousedown=e;document.body.onmousedown=e;document.body.ontouchstart=e;q.ontouchstart=e}n();a();return{init:n,initClearSearch:a,writeResults:j,createObjectArray:i}}());
\ No newline at end of file
 2+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;if(scriptPath){l=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.length<1){h.innerHTML=""}else{c=setTimeout(function(){o(q)},f)}})};function o(q){q=encodeURIComponent(q);url=l+"?action=opensearch&limit="+g+"&namespace=0&format=xml&search="+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;r<q.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(q.value)}}function j(B){var t=document.getElementById("results"),w,u,s,A,q,y,z,r=document.getElementById("sq"),v=document.getElementById("header");t.style.display="block";var x=r.offsetParent.offsetTop+r.offsetHeight+r.offsetTop-1+v.offsetTop;t.style.top=x+"px";if(!B||B.length<1){t.innerHTML='<div class="suggestions-results"><div class="suggestions-result">No results</div></div>'}else{if(t.firstChild){t.removeChild(t.firstChild)}w=document.createElement("div");w.className="suggestions-results";t.appendChild(w);s=function(){var C=this.parentNode.getAttribute("title");d(C)};for(u=0;u<B.length;u++){A=B[u];q=document.createElement("div");y=document.createElement("a");q.setAttribute("title",A.label);q.className="suggestions-result";z=document.createTextNode("+");y.appendChild(z);y.className="sq-val-update";m(y).bind("click",s);q.appendChild(y);y=document.createElement("a");y.setAttribute("href",A.value.replace(/^(?:\/\/|[^\/]+)*\//,"/"));y.className="search-result-item";z=document.createTextNode(A.label);y.appendChild(z);q.appendChild(y);w.appendChild(q)}}}function a(){var v=document.getElementById("clearsearch"),r=document.getElementById("search"),q=document.getElementById("results");function t(){if(v){if(r.value.length>0){v.style.display="block"}else{v.style.display="none";if(q){q.style.display="none"}}}}function s(w){r.value="";v.style.display="none";if(q){q.style.display="none"}if(w){w.preventDefault()}}function u(){r.select()}m(v).bind("mousedown",s);m(r).bind("keyup",t);m(r).bind("click",u)}function n(){var q=document.getElementById("results");q.onmousedown=e;document.body.onmousedown=e;document.body.ontouchstart=e;q.ontouchstart=e}n();a();return{init:n,initClearSearch:a,writeResults:j,createObjectArray:i}}());
\ No newline at end of file
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_application.js
@@ -0,0 +1,183 @@
 2+/*global document, window */
 3+/*jslint sloppy: true, white:true, maxerr: 50, indent: 4, plusplus: true*/
 4+/*
 5+TODO: getElementsByClassName not supported by IE < 9
 6+TODO: addEventListener not supported by IE < 9
 7+*/
 8+MobileFrontend = (function() {
 9+ var utilities;
 10+
 11+ function init() {
 12+ var i, search, clearSearch, results, languageSelection, a, heading, btns,
 13+ sectionHeadings = utilities( '.section_heading' );
 14+ utilities( document.body ).addClass( 'jsEnabled' );
 15+
 16+ // TODO: remove in future - currently enables toggling in Wikipedia Mobile App v < 1.1
 17+ window.wm_toggle_section = wm_toggle_section;
 18+ var btns = utilities( '.section_heading button' );
 19+ for( i = 0; i < btns.length; i++ ) {
 20+ utilities( btns[i] ).remove();
 21+ }
 22+
 23+ function openSectionHandler() {
 24+ var sectionNumber = this.id ? this.id.split( '_' )[1] : -1;
 25+ if( sectionNumber > -1 ) {
 26+ wm_toggle_section( sectionNumber );
 27+ }
 28+ }
 29+ function createButton( visible ) {
 30+ var btn, label;
 31+ btn = document.createElement( 'button' );
 32+ label = document.createTextNode( visible ? showText : hideText );
 33+ btn.className = visible ? 'show' : 'hide';
 34+ btn.appendChild( label );
 35+ btn.style.display = visible ? 'inline-block' : 'none';
 36+ return btn;
 37+ }
 38+ if(!sectionHeadings) {
 39+ sectionHeadings = [];
 40+ } else {
 41+ utilities( document.body ).addClass( 'togglingEnabled' );
 42+ }
 43+ for( i = 0; i < sectionHeadings.length; i++ ) {
 44+ heading = sectionHeadings[i];
 45+ heading.removeAttribute( 'onclick' ); // TODO: remove any legacy onclick handlers
 46+ heading.insertBefore( createButton( true ), heading.firstChild );
 47+ heading.insertBefore( createButton( false ), heading.firstChild );
 48+ utilities( heading ).bind( 'click', openSectionHandler );
 49+ }
 50+ results = document.getElementById( 'results' );
 51+ languageSelection = document.getElementById( 'languageselection' );
 52+
 53+ function navigateToLanguageSelection() {
 54+ var url;
 55+ if ( languageSelection ) {
 56+ url = languageSelection.options[languageSelection.selectedIndex].value;
 57+ if ( url ) {
 58+ location.href = url;
 59+ }
 60+ }
 61+ }
 62+ utilities( languageSelection ).bind( 'change', navigateToLanguageSelection );
 63+
 64+ function logoClick() {
 65+ var n = document.getElementById( 'nav' ).style;
 66+ n.display = n.display === 'block' ? 'none' : 'block';
 67+ }
 68+ utilities( document.getElementById( 'logo' ) ).bind( 'click', logoClick );
 69+
 70+ function checkHash() {
 71+ var hash = this.hash || document.location.hash;
 72+ if ( hash.indexOf( '#' ) === 0 ) {
 73+ wm_reveal_for_hash( hash );
 74+ }
 75+ }
 76+ checkHash();
 77+ for ( a = document.getElementsByTagName( 'a' ), i = 0; i < a.length; i++ ) {
 78+ utilities( a[i] ).bind( 'click', checkHash );
 79+ }
 80+
 81+ // Try to scroll and hide URL bar
 82+ window.scrollTo( 0, 1 );
 83+ }
 84+
 85+ function wm_reveal_for_hash( hash ) {
 86+ var targetel = document.getElementById( hash.substr(1) ),
 87+ p, section_idx;
 88+ if ( targetel ) {
 89+ p = targetel;
 90+ while ( p && p.className !== 'content_block' &&
 91+ p.className !== 'section_heading' ) {
 92+ p = p.parentNode;
 93+ }
 94+ if ( p && p.style.display !== 'block' ) {
 95+ section_idx = parseInt( p.id.split( '_' )[1], 10 );
 96+ wm_toggle_section( section_idx );
 97+ }
 98+ }
 99+ }
 100+
 101+ function wm_toggle_section( section_id ) {
 102+ var b = document.getElementById( 'section_' + section_id ),
 103+ bb = b.getElementsByTagName( 'button' ), i, s, e;
 104+ for ( i = 0; i <= 1; i++ ) {
 105+ s = bb[i].style;
 106+ s.display = s.display === 'none' || ( i && !s.display ) ? 'inline-block' : 'none';
 107+ }
 108+ for ( i = 0, d = ['content_','anchor_']; i<=1; i++ ) {
 109+ e = document.getElementById( d[i] + section_id );
 110+ if ( e ) {
 111+ e.style.display = e.style.display === 'block' ? 'none' : 'block';
 112+ }
 113+ }
 114+ }
 115+
 116+ utilities = typeof jQuery !== 'undefined' ? jQuery : function( el ) {
 117+ if( typeof(el) === 'string' ) {
 118+ if( document.querySelectorAll ) {
 119+ return [].slice.call( document.querySelectorAll( el ) );
 120+ }
 121+ }
 122+
 123+ function addClass( name ) {
 124+ var className = el.className,
 125+ classNames = className.split( ' ' );
 126+ classNames.push(name); // TODO: only push if unique
 127+ el.className = classNames.join( ' ' );
 128+ }
 129+
 130+ function removeClass( name ) {
 131+ var className = el.className,
 132+ classNames = className.split( ' ' ),
 133+ newClasses = [], i;
 134+ for( i = 0; i < classNames.length; i++ ) {
 135+ if( classNames[i] !== name ) {
 136+ newClasses.push( classNames[i] );
 137+ }
 138+ }
 139+ el.className = newClasses.join( ' ' );
 140+ }
 141+
 142+ function bind( type, handler ) {
 143+ el.addEventListener( type, handler, false );
 144+ }
 145+
 146+ function remove() {
 147+ el.parentNode.removeChild(el);
 148+ }
 149+
 150+ return {
 151+ addClass: addClass,
 152+ bind: bind,
 153+ remove: remove,
 154+ removeClass: removeClass
 155+ };
 156+ }
 157+ utilities.ajax = utilities.ajax || function( options ) {
 158+ var xmlHttp, url;
 159+ if ( window.XMLHttpRequest ) {
 160+ xmlHttp = new XMLHttpRequest();
 161+ } else {
 162+ xmlHttp = new ActiveXObject( 'Microsoft.XMLHTTP' );
 163+ }
 164+ if( xmlHttp.overrideMimeType ) { // non standard
 165+ xmlHttp.overrideMimeType( 'text/xml' );
 166+ }
 167+ xmlHttp.onreadystatechange = function() {
 168+ if ( xmlHttp.readyState === 4 && xmlHttp.status === 200 ) {
 169+ options.success( xmlHttp.responseXML );
 170+ }
 171+ };
 172+ xmlHttp.open( 'GET', options.url, true );
 173+ xmlHttp.send();
 174+ };
 175+
 176+ init();
 177+ return {
 178+ wm_reveal_for_hash: wm_reveal_for_hash,
 179+ wm_toggle_section: wm_toggle_section,
 180+ init: init,
 181+ utils: utilities
 182+ };
 183+
 184+}());
Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_application.js
___________________________________________________________________
Added: svn:eol-style
1185 + native
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.js
@@ -3,42 +3,47 @@
44 MobileFrontend.opensearch = (function() {
55 var apiUrl = '/api.php', timer = -1, typingDelay = 500,
66 numResults = 15, term,
 7+ results = document.getElementById( 'results' ),
78 search = document.getElementById( 'search' ),
 9+ sq = document.getElementById( 'sq' ),
810 sb = document.getElementById( 'searchbox' ),
 11+ logo = document.getElementById( 'logo' ),
 12+ goButton = document.getElementById( 'goButton' ),
913 content = document.getElementById( 'content' ),
1014 footer = document.getElementById( 'footer' ),
 15+ zeroRatedBanner = document.getElementById( 'zero-rated-banner' ) ||
 16+ document.getElementById( 'zero-rated-banner-red' ),
1117 clearSearch = document.getElementById( 'clearsearch' ),
12 - focused = false,
13 - viewportmeta, originalViewport,
 18+ focused = false, ol = {},
1419 u = MobileFrontend.utils;
1520
16 - apiUrl = MobileFrontend.setting( 'scriptPath' ) + apiUrl;
 21+ if ( scriptPath ) {
 22+ apiUrl = scriptPath + apiUrl;
 23+ }
1724
1825 function hideResults() {
1926 results.style.display = 'none';
2027 }
21 -
22 - viewportmeta = u( 'meta[name="viewport"]' )
23 - if ( viewportmeta ) {
24 - viewportmeta = viewportmeta[0];
25 - originalViewport = viewportmeta.getAttribute( 'content' );
26 - }
27 - // prevent auto-zoom in on clicking search for certain browsers e.g. palm pre and ipad
2828 function resetViewPort() {
29 - if ( viewportmeta ) {
30 - viewportmeta.setAttribute( 'content', 'minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0');
31 - u( document.body ).bind( 'gesturestart', function () {
32 - viewportmeta.setAttribute( 'content', originalViewport );
33 - } );
 29+ if ( navigator.userAgent.match( /iPhone/i ) || navigator.userAgent.match( /iPad/i ) ) {
 30+ var viewportmeta = u( 'meta[name="viewport"]' );
 31+ if ( viewportmeta ) {
 32+ viewportmeta = viewportmeta[0];
 33+ viewportmeta.content = 'width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0';
 34+ u( document.body ).bind( 'gesturestart', function () {
 35+ viewportmeta.content = 'width=device-width, initial-scale=1.0';
 36+ } );
 37+ }
3438 }
3539 }
3640
3741 resetViewPort();
3842
3943 search.onfocus = function() {
40 - var rrd, rrdD;
 44+ var pE, pT, pTT, rrd, rrdD,
 45+ removeResultsEl;
4146 sb = document.getElementById( 'searchbox' );
42 - header = document.getElementById( 'header' );
 47+ sq = document.getElementById( 'sq' );
4348 content = document.getElementById( 'content' );
4449 footer = document.getElementById( 'footer' );
4550 resetViewPort();
@@ -46,8 +51,25 @@
4752 if ( !focused ) {
4853 MobileFrontend.utils( document.body ).addClass( 'full-screen-search' );
4954
50 - rrd = document.getElementById( 'remove-results' );
51 - if ( !rrd ) {
 55+ pE = document.getElementById( 'placeholder' );
 56+ if ( !pE ) {
 57+ pT = document.createElement( 'span' );
 58+ pTT = document.createTextNode(placeholder);
 59+ pT.setAttribute( 'id', 'placeholder' );
 60+ pT.appendChild(pTT);
 61+ sb.insertBefore( pT, sb.firstChild );
 62+ }
 63+ pE = document.getElementById( 'placeholder' );
 64+ if ( pE ) {
 65+ pE.style.display = 'block';
 66+ }
 67+
 68+ if ( pE && search.value !== '' ) {
 69+ pE.style.display = 'none';
 70+ }
 71+
 72+ removeResultsEl = document.getElementById( 'remove-results' );
 73+ if ( !removeResultsEl ) {
5274 rrd = document.createElement( 'a' );
5375 rrd.setAttribute( 'href', '#' );
5476 rrd.setAttribute( 'id', 'remove-results' );
@@ -55,7 +77,7 @@
5678 rrdD = document.createElement( 'div' );
5779 rrdD.setAttribute( 'id', 'left-arrow' );
5880 rrd.appendChild( rrdD );
59 - header.insertBefore( rrd, header.firstChild );
 81+ sq.insertBefore( rrd, sq.firstChild );
6082 }
6183 focused = true;
6284 }
@@ -63,7 +85,12 @@
6486
6587 function removeResults() {
6688 MobileFrontend.utils( document.body ).removeClass( 'full-screen-search' );
 89+ var removeResultsEl, pE = document.getElementById( 'placeholder' );
6790
 91+ if ( pE ) {
 92+ pE.style.display = 'none';
 93+ }
 94+
6895 if ( focused ) {
6996 focused = false;
7097 }
@@ -111,14 +138,14 @@
112139 window.onload = function () {
113140 u( search ).bind( 'keyup',
114141 function() {
115 - clearTimeout( timer );
116 - term = search.value;
117 - if ( term.length < 1 ) {
118 - results.innerHTML = '';
119 - } else {
120 - term = encodeURIComponent( term );
121 - timer = setTimeout( function () { searchApi( term ); }, typingDelay );
122 - }
 142+ clearTimeout( timer );
 143+ term = this.value;
 144+ if ( term.length < 1 ) {
 145+ results.innerHTML = '';
 146+ } else {
 147+ term = encodeURIComponent( term );
 148+ timer = setTimeout( function () { searchApi( term ); }, typingDelay );
 149+ }
123150 } );
124151 };
125152
@@ -145,9 +172,18 @@
146173 return sections;
147174 }
148175
 176+ function sqValUpdate( sqValue ) {
 177+ var search = document.getElementById( 'search' );
 178+ if ( search ) {
 179+ search.value = sqValue + ' ';
 180+ search.focus();
 181+ searchApi( search.value );
 182+ }
 183+ }
 184+
149185 function htmlEntities( str ) {
150 - var text = document.createTextNode( str ),
151 - el = document.createElement( 'div' );
 186+ var text = document.createTextNode( str );
 187+ var el = document.createElement( 'div' );
152188 el.appendChild( text );
153189 return el.innerHTML;
154190 }
@@ -159,27 +195,37 @@
160196 function writeResults( sections ) {
161197 var results = document.getElementById( 'results' ), suggestions, i,
162198 term = htmlEntities( document.getElementById( 'search' ).value ),
163 - section, escapedTerm, suggestionsResult, link, label;
 199+ suggestionListener, section, escapedTerm, suggestionsResult, link, label;
164200
165201 results.style.display = 'block';
166202 if ( search ) {
167203 search.focus();
168204 }
169205 if ( !sections || sections.length < 1 ) {
170 - results.innerHTML = '<ul class="suggestions-results" title="No Results"><li class="suggestions-result">No Results</li></div>';
 206+ results.innerHTML = "<div class=\"suggestions-results\" title=\"No Results\">No Results</div>";
171207 } else {
172208 if( results.firstChild ) {
173209 results.removeChild( results.firstChild );
174210 }
175 - suggestions = document.createElement( 'ul' );
 211+ suggestions = document.createElement( 'div' );
176212 suggestions.className = 'suggestions-results';
177213 results.appendChild( suggestions );
 214+ suggestionListener = function() {
 215+ var title = this.parentNode.getAttribute( 'title' );
 216+ sqValUpdate( title );
 217+ };
178218
179219 for ( i = 0; i < sections.length; i++ ) {
180220 section = sections[i];
181 - suggestionsResult = document.createElement( 'li' );
 221+ suggestionsResult = document.createElement( 'div' );
 222+ link = document.createElement( 'a' );
182223 suggestionsResult.setAttribute( 'title', section.label );
183224 suggestionsResult.className = 'suggestions-result';
 225+ label = document.createTextNode( '+' );
 226+ link.appendChild(label);
 227+ link.className = 'sq-val-update';
 228+ u( link ).bind( 'click', suggestionListener );
 229+ suggestionsResult.appendChild( link );
184230
185231 link = document.createElement( 'a' );
186232 link.setAttribute( 'href', section.value.replace( /^(?:\/\/|[^\/]+)*\//, '/' ) );
@@ -198,9 +244,17 @@
199245 }
200246 }
201247
 248+ function handleDefaultText() {
 249+ var pE = document.getElementById( 'placeholder' );
 250+ if ( pE ) {
 251+ pE.style.display = 'none';
 252+ }
 253+ }
 254+
202255 function initClearSearch() {
203256 var clearSearch = document.getElementById( 'clearsearch' ),
204 - search = document.getElementById( 'search' );
 257+ search = document.getElementById( 'search' ),
 258+ results = document.getElementById( 'results' );
205259 function handleClearSearchLink() {
206260 if ( clearSearch ) {
207261 if ( search.value.length > 0 ) {
@@ -224,6 +278,7 @@
225279 }
226280 u( clearSearch ).bind( 'mousedown', clearSearchBox );
227281 u( search ).bind( 'keyup', handleClearSearchLink );
 282+ u( search ).bind( 'keydown', handleDefaultText );
228283 u( search ).bind( 'click', onFocusHandler );
229284 }
230285
@@ -233,6 +288,7 @@
234289 document.body.onmousedown = whichElement;
235290 document.body.ontouchstart = whichElement;
236291 results.ontouchstart = whichElement;
 292+ search.onpaste = handleDefaultText;
237293 }
238294 init();
239295 initClearSearch();
@@ -245,4 +301,4 @@
246302 removeResults: removeResults
247303 };
248304
249 -}());
 305+}());
\ No newline at end of file
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/application.js
@@ -4,9 +4,45 @@
55 var utilities;
66
77 function init() {
8 - var languageSelection;
 8+ var i, results, languageSelection, a, heading, btns,
 9+ sectionHeadings = utilities( '.section_heading' );
910 utilities( document.body ).addClass( 'jsEnabled' );
1011
 12+ // TODO: remove in future - currently enables toggling in Wikipedia Mobile App v < 1.1
 13+ window.wm_toggle_section = wm_toggle_section;
 14+ var btns = utilities( '.section_heading button' );
 15+ for( i = 0; i < btns.length; i++ ) {
 16+ utilities( btns[i] ).remove();
 17+ }
 18+
 19+ function openSectionHandler() {
 20+ var sectionNumber = this.id ? this.id.split( '_' )[1] : -1;
 21+ if( sectionNumber > -1 ) {
 22+ wm_toggle_section( sectionNumber );
 23+ }
 24+ }
 25+ function createButton( visible ) {
 26+ var btn, label;
 27+ btn = document.createElement( 'button' );
 28+ label = document.createTextNode( visible ? showText : hideText );
 29+ btn.className = visible ? 'show' : 'hide';
 30+ btn.appendChild( label );
 31+ btn.style.display = visible ? 'inline-block' : 'none';
 32+ return btn;
 33+ }
 34+ if(!sectionHeadings) {
 35+ sectionHeadings = [];
 36+ } else {
 37+ utilities( document.body ).addClass( 'togglingEnabled' );
 38+ }
 39+ for( i = 0; i < sectionHeadings.length; i++ ) {
 40+ heading = sectionHeadings[i];
 41+ heading.removeAttribute( 'onclick' ); // TODO: remove any legacy onclick handlers
 42+ heading.insertBefore( createButton( true ), heading.firstChild );
 43+ heading.insertBefore( createButton( false ), heading.firstChild );
 44+ utilities( heading ).bind( 'click', openSectionHandler );
 45+ }
 46+ results = document.getElementById( 'results' );
1147 languageSelection = document.getElementById( 'languageselection' );
1248
1349 function navigateToLanguageSelection() {
@@ -26,33 +62,58 @@
2763 }
2864 utilities( document.getElementById( 'logo' ) ).bind( 'click', logoClick );
2965
30 - function desktopViewClick() {
31 - var cookieName = MobileFrontend.setting( 'useFormatCookieName' );
32 - var cookieDuration = MobileFrontend.setting( 'useFormatCookieDuration' );
33 - // convert from seconds to days
34 - cookieDuration = cookieDuration / ( 24 * 60 * 60 );
35 - MobileFrontend.banner.writeCookie( cookieName, 'desktop', cookieDuration );
 66+ function checkHash() {
 67+ var hash = this.hash || document.location.hash;
 68+ if ( hash.indexOf( '#' ) === 0 ) {
 69+ wm_reveal_for_hash( hash );
 70+ }
3671 }
37 - utilities( document.getElementById( 'mf-display-toggle' ) ).bind( 'click', desktopViewClick );
 72+ checkHash();
 73+ for ( a = document.getElementsByTagName( 'a' ), i = 0; i < a.length; i++ ) {
 74+ utilities( a[i] ).bind( 'click', checkHash );
 75+ }
3876
3977 // Try to scroll and hide URL bar
4078 window.scrollTo( 0, 1 );
4179 }
4280
 81+ function wm_reveal_for_hash( hash ) {
 82+ var targetel = document.getElementById( hash.substr(1) ),
 83+ p, section_idx;
 84+ if ( targetel ) {
 85+ p = targetel;
 86+ while ( p && p.className !== 'content_block' &&
 87+ p.className !== 'section_heading' ) {
 88+ p = p.parentNode;
 89+ }
 90+ if ( p && p.style.display !== 'block' ) {
 91+ section_idx = parseInt( p.id.split( '_' )[1], 10 );
 92+ wm_toggle_section( section_idx );
 93+ }
 94+ }
 95+ }
 96+
 97+ function wm_toggle_section( section_id ) {
 98+ var b = document.getElementById( 'section_' + section_id ),
 99+ bb = b.getElementsByTagName( 'button' ), i, s, e;
 100+ for ( i = 0; i <= 1; i++ ) {
 101+ s = bb[i].style;
 102+ s.display = s.display === 'none' || ( i && !s.display ) ? 'inline-block' : 'none';
 103+ }
 104+ for ( i = 0, d = ['content_','anchor_']; i<=1; i++ ) {
 105+ e = document.getElementById( d[i] + section_id );
 106+ if ( e ) {
 107+ e.style.display = e.style.display === 'block' ? 'none' : 'block';
 108+ }
 109+ }
 110+ }
 111+
43112 utilities = typeof jQuery !== 'undefined' ? jQuery : function( el ) {
44113 if( typeof(el) === 'string' ) {
45114 if( document.querySelectorAll ) {
46115 return [].slice.call( document.querySelectorAll( el ) );
47116 }
48 - } else if( !el ) {
49 - el = document.createElement( 'div' );
50117 }
51 -
52 - function hasClass( name ) {
53 - var classNames = el.className.split( ' ' );
54 - return classNames.indexOf( name ) > -1;
55 - }
56 -
57118 function addClass( name ) {
58119 var className = el.className,
59120 classNames = className.split( ' ' );
@@ -83,7 +144,6 @@
84145 return {
85146 addClass: addClass,
86147 bind: bind,
87 - hasClass: hasClass,
88148 remove: remove,
89149 removeClass: removeClass
90150 };
@@ -109,13 +169,9 @@
110170
111171 init();
112172 return {
 173+ wm_reveal_for_hash: wm_reveal_for_hash,
 174+ wm_toggle_section: wm_toggle_section,
113175 init: init,
114 - message: function( name ) {
115 - return mwMobileFrontendConfig.messages[name] || '';
116 - },
117 - setting: function( name ) {
118 - return mwMobileFrontendConfig.settings[name] || '';
119 - },
120176 utils: utilities
121177 };
122178
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.i18n.php
@@ -26,7 +26,8 @@
2727 'mobile-frontend-hide-button' => 'Hide',
2828 'mobile-frontend-disable-button' => 'Disable',
2929 'mobile-frontend-back-button' => 'Back',
30 - 'mobile-frontend-regular-site' => 'Desktop view',
 30+ 'mobile-frontend-regular-site' => 'View this page on regular {{SITENAME}}',
 31+ 'mobile-frontend-perm-stop-redirect' => 'Permanently disable mobile site',
3132 'mobile-frontend-error-page-title' => 'We have a problem!',
3233 'mobile-frontend-error-page-text' => '{{SITENAME}} mobile is still under active development and we are working hard to fix all of our internal errors. We have been notified about this error and will be fixing it soon. Please check back!',
3334 'mobile-frontend-are-you-sure' => 'Are you sure?',
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/common.css
@@ -182,7 +182,6 @@
183183
184184 html[dir="rtl"] #results {
185185 left: 41px;
186 - right: 53px;
187186 }
188187
189188 .search_bar .search {
@@ -333,30 +332,20 @@
334333 margin: 0px;
335334 }
336335
337 -button.show,
338 -button.hide { /* for non-js browsers */
 336+button.show {
339337 display: none;
340338 }
341339
342 -.togglingEnabled button.hide,
343 -.togglingEnabled .openSection button.show {
344 - display: none;
345 -}
346 -
347 -.togglingEnabled .openSection button.hide,
348340 .togglingEnabled button.show {
349341 display: inline-block;
350342 }
351343
352344 .togglingEnabled .content_block,
353 -.togglingEnabled .section_anchors {
 345+.togglingEnabled .section_anchors,
 346+button.section_heading.hide {
354347 display: none;
355348 }
356349
357 -.togglingEnabled .openSection {
358 - display: block;
359 -}
360 -
361350 .mwm-notice {
362351 padding: 5px;
363352 background: #dddddd;
@@ -537,7 +526,6 @@
538527 -moz-border-radius: 5px;
539528 background: #f9f9f9;
540529 margin-bottom: 10px;
541 - text-align: center;
542530 }
543531
544532 .thumb .thumbinner[style] {
@@ -587,7 +575,6 @@
588576 #footer {
589577 margin: 0 8px;
590578 clear: both;
591 - font-size: 0.8em;
592579 }
593580
594581 #logo {
@@ -638,7 +625,7 @@
639626 height: 25px;
640627 width: 27px;
641628 padding-bottom: 0;
642 - text-indent: -999px;
 629+ text-indent: 999px;
643630 }
644631
645632 html[dir="rtl"] .goButton {
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/images/close-button-beta.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/images/arrow-left-beta.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css
@@ -1,8 +1,8 @@
22 html,
3 -body {
4 - margin: 0;
5 - padding: 0;
6 - height: 100%;
 3+body {
 4+ margin: 0;
 5+ padding: 0;
 6+ height: 100%;
77 }
88
99 html {
@@ -10,7 +10,7 @@
1111 }
1212
1313 body {
14 - font-size: 1em;
 14+ font-size: 0.8em;
1515 line-height: 1;
1616 color: black;
1717 background: white;
@@ -19,21 +19,24 @@
2020 }
2121
2222 .clearlink {
23 - top: 9px;
24 - right: -18px;
25 - width: 18px;
26 - height: 20px;
27 - background: url(images/close-button-beta.png) no-repeat scroll 0 0 transparent;
28 - margin: 0;
29 - display: block;
30 - background-position: right center;
31 - background-size: auto 12px;
 23+ background: url(images/close-button.png?v=1) no-repeat scroll 0 0 transparent;
 24+ background-position: center center;
3225 cursor: pointer;
 26+ zoom: 1;
3327 position: absolute;
 28+ right: 0.25em;
 29+ top: 10%;
 30+ margin: 1px;
 31+ height: 42px;
 32+ width: 42px;
 33+ margin-top: -6px;
 34+ z-index: 99;
 35+ border: 0px solid;
 36+ display: none;
3437 }
3538
3639 html[dir="rtl"] .clearlink {
37 - left: 0;
 40+ left: 0.25em;
3841 right: auto;
3942 }
4043
@@ -103,16 +106,38 @@
104107 text-align: center;
105108 }
106109
 110+.suggestions-results {
 111+ font-size: 1.4em;
 112+ cursor: pointer;
 113+ margin: 0;
 114+ padding: 0;
 115+}
 116+
 117+.suggestions-results hr {
 118+ margin: 0;
 119+}
 120+
 121+.suggestions-result {
 122+ color: black;
 123+ margin: 0;
 124+ line-height: 2.6em;
 125+ padding: 0.01em 0.25em;
 126+ postion: relative;
 127+ border-bottom: solid 1px #999999;
 128+}
 129+
107130 .suggestions-result a {
108131 text-decoration: none;
109132 color: #666;
110133 }
111 -
 134+.suggestions-result a:link {
 135+ text-decoration: none;
 136+ color:#666;
 137+}
112138 .suggestions-result a:visited {
113139 text-decoration: none;
114140 color:#666;
115141 }
116 -
117142 .suggestions-result a:hover {
118143 text-decoration: none;
119144 color:#666;
@@ -121,13 +146,36 @@
122147 text-decoration: none;
123148 color:#666;
124149 }
125 -
126150 .suggestions-result:hover {
127151 background-color: #ACD1E9;
128152 }
 153+a.sq-val-update {
 154+ font-size: 1.3em;
 155+ display: block;
 156+ font-weight: normal;
 157+ text-decoration: none;
 158+ color: #666;
 159+ position: absolute;
 160+ right: 0;
 161+ width: 1.5em;
 162+ text-align: center;
 163+}
 164+a.sq-val-update:link {
 165+ text-decoration: none;
 166+}
 167+a.sq-val-update:visited {
 168+ text-decoration: none;
 169+}
 170+a.sq-val-update:hover {
 171+ text-decoration: none;
 172+}
 173+a.sq-val-update:active {
 174+ text-decoration: none;
 175+}
129176
130177 a.search-result-item {
131178 display: block;
 179+ margin-right: 2em;
132180 }
133181
134182 /* TODO: support browsers which do not support data uris */
@@ -136,7 +184,18 @@
137185 padding-right: 13px;
138186 }
139187
 188+#results {
 189+ display: none;
 190+ background-color: #ffffff;
 191+ border-top: none;
 192+ z-index: 2;
 193+ position: absolute;
 194+ left: 53px;
 195+ top: 35px;
 196+}
 197+
140198 .search_bar .search {
 199+ width: 90%;
141200 -webkit-appearance: none;
142201 border-top-width: 0px;
143202 border-right-width: 0px;
@@ -146,10 +205,6 @@
147206 outline-width: initial;
148207 outline-color: initial;
149208 padding: 0;
150 - font-size: 1.2em;
151 - padding-right: 16px;
152 - width: 100%;
153 - vertical-align: middle; /* don't use line height here as placeholder on ripple positions incorrectly */
154209 }
155210
156211 #search::-webkit-search-cancel-button {
@@ -283,54 +338,20 @@
284339 margin: 0px;
285340 }
286341
287 -.section_heading {
288 - cursor: pointer;
289 -}
290 -
291 -button.show,
292 -button.hide { /* for non-js browsers */
 342+button.show {
293343 display: none;
294344 }
295345
296 -.togglingEnabled button.hide,
297 -.togglingEnabled .openSection button.show {
298 - display: none;
299 -}
300 -
301 -.togglingEnabled .openSection button.hide,
302346 .togglingEnabled button.show {
303347 display: inline-block;
304348 }
305349
306 -.openSection button.hide,
307 -.openSection button.show {
308 - opacity: 1;
309 -}
310 -
311 -.togglingEnabled .section_anchors {
 350+.togglingEnabled .content_block,
 351+.togglingEnabled .section_anchors,
 352+button.section_heading.hide {
312353 display: none;
313354 }
314355
315 -.togglingEnabled .content_block {
316 - max-height: 0;
317 - position: relative;
318 - overflow: hidden;
319 - -webkit-transition: max-height 0.2s ease-in;
320 - -moz-transition: max-height 0.2s ease-in;
321 - -o-transition: max-height 0.2s ease-in;
322 - transition: max-height 0.2s ease-in;
323 -}
324 -
325 -.togglingEnabled .openSection.section_anchors {
326 - display: block;
327 -}
328 -
329 -.togglingEnabled .openSection.content_block {
330 - max-height: 9999px; /* large number as height: auto is not effected by transitions */
331 - -webkit-transition: max-height 0.7s ease-in;
332 - transition: max-height 0.7s ease-in;
333 -}
334 -
335356 .mwm-notice {
336357 padding: 5px;
337358 background: #dddddd;
@@ -497,7 +518,6 @@
498519 -moz-border-radius: 5px;
499520 background: #f9f9f9;
500521 margin-bottom: 10px;
501 - text-align: center;
502522 }
503523
504524 .thumb .thumbinner[style] {
@@ -535,14 +555,13 @@
536556 }
537557
538558 #header {
539 - margin: 0;
 559+ margin: 8px 8px 0 8px;
540560 position: relative;
541 - border-bottom: solid 1px #CCC;
542561 }
543562
544563 #content_wrapper {
545564 clear: both;
546 - margin: 22px 22px;
 565+ margin: 0 8px;
547566 }
548567
549568 #footer {
@@ -552,60 +571,51 @@
553572
554573 #logo {
555574 position: absolute;
556 - height: 22px;
557 - cursor: pointer;
558 - left: 22px;
559 - top: 9px;
560 - width: 35px;
 575+ top: 4px;
 576+ left: 5px;
561577 }
562578
563 -html[dir="rtl"] #searchbox {
564 - padding: 0px 54px 0px 20px;
565 -}
566 -
567579 #zero-language-search.search_bar,
568580 #searchbox {
569581 width: auto;
570582 position: relative;
571 - padding: 0px 40px 0px 73px; /* right = width of #logo (35px) + 22px + 16px
572 - left = width of close button + 22px */
 583+ padding: 8px 32px 8px 44px;
 584+ border: 1px solid #cccccc;
573585 -webkit-border-radius: 2px;
574586 -moz-border-radius: 2px;
575 - -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
576587 }
577588
578 -.full-screen-search #searchbox {
579 - padding: 0px 40px 0px 54px; /* right = width of #logo (18px) + 22px + 16px */
580 -}
581 -
582589 #zero-language-search.search_bar {
583590 padding: 8px 32px 8px 0px;
584591 }
585592
586 -html[dir="rtl"] #remove-results,
587 -html[dir="rtl"] #logo {
588 - right: 18px;
589 - left: auto;
 593+#searchbox #form {
 594+ padding-right: 34px;
 595+ width: 100%;
 596+ margin-bottom: 0;
590597 }
591598
 599+html[dir="rtl"] #logo,
592600 .goButton {
593601 position: absolute;
594 - right: -18px;
 602+ right: 2px;
595603 left: auto;
596 - top: 0px;
 604+}
 605+
 606+.goButton {
 607+ top: 2px;
597608 border: 0;
598 - background: url(images/s.gif) no-repeat center left;
 609+ background: url(images/s.gif) no-repeat top left;
599610 background-size: 27px 25px;
600 - height: 40px;
 611+ height: 25px;
601612 width: 27px;
602613 padding-bottom: 0;
603 - text-indent: -999px;
604 - cursor: pointer;
 614+ text-indent: 999px;
605615 }
606616
607617 html[dir="rtl"] .goButton {
608618 right: auto;
609 - left: 0;
 619+ left: 2px;
610620 }
611621
612622 #searchbox a,
@@ -714,67 +724,44 @@
715725 full screen search css
716726 */
717727 .full-screen-search #header {
718 - -webkit-box-shadow: 3px 1px 8px #333;
719 - -moz-box-shadow: 3px 1px 8px #333;
720 - -o-box-shadow: 3px 1px 8px #333;
721 - box-shadow: 3px 1px 8px #333;
722 - z-index: 2;
723728 margin: 0;
724 - background-color: white;
725729 }
726730
727 -#results,
728 -#content_wrapper {
729 - transition: all 0.3s ease-in-out;
730 - -webkit-transition: all 0.3s ease-in-out;
731 - -moz-transition: all 0.3s ease-in-out;
732 - -o-transition: all 0.3s ease-in-out;
733 -}
734 -
735 -#content_wrapper,
736 -.full-screen-search #results {
737 - opacity: 1;
738 - height: auto;
739 -}
740 -
741 -#results,
742 -.full-screen-search #content_wrapper {
743 - height: 0;
744 - overflow: hidden;
745 - opacity: 0;
746 -}
747 -
 731+.full-screen-search #content,
748732 .full-screen-search #footer,
749733 .full-screen-search #zero-rated-banner-red,
750734 .full-screen-search #zero-rated-banner {
751735 display: none;
752736 }
753737
754 -#search::-webkit-search-decoration {
755 - display: none;
 738+.full-screen-search #search {
 739+ height: 30px; /* height of #sq - 2px border */
 740+ font-size: 1.2em;
756741 }
757742
758 -#header,
759 -#search,
760 -#sq,
761 -#header form,
762 -#searchbox {
763 - position: relative;
764 - right: 0;
765 - top: 0;
766 - left: 0;
767 - height: 40px;
 743+html[dir="rtl"] .full-screen-search #sq {
 744+ padding-left: 0;
 745+ padding-right: 44px;
768746 }
769747
770 -#searchbox {
771 - margin: 0;
772 -}
773 -
774748 .full-screen-search #sq {
 749+ position: relative;
 750+ padding-left: 44px;
775751 margin-right: 0;
776752 font-size: 16px;
 753+ border: none;
 754+ background-color: transparent;
777755 }
778756
 757+.full-screen-search #searchbox {
 758+ position: absolute;
 759+ width: 100%;
 760+ padding: 0;
 761+ top: 0;
 762+ left: 0;
 763+ border: none;
 764+}
 765+
779766 .full-screen-search #logo,
780767 .full-screen-search .goButton {
781768 display: none;
@@ -783,32 +770,26 @@
784771 .full-screen-search #results {
785772 left: 0px;
786773 width: 100% !important;
787 - max-height: 99999px;
788 - border: none;
789 - z-index: 1;
 774+ min-height: 100%;
 775+ border-bottom: none;
 776+ border-left: none;
 777+ border-right: none;
 778+ border-top: 1px solid #A6A6A6;
790779 background-color: #E6E6E6;
791 - position: relative;
792 - opacity: 1;
 780+ display: block;
793781 }
794782
795783 .full-screen-search .suggestions-results {
 784+ line-height: 2.6em;
796785 padding: 0;
797786 position: relative;
798 - padding-bottom: 20px;
 787+ border-bottom: solid 1px #999;
799788 font-size: 1.4em;
800 - cursor: pointer;
801 - margin: 0;
802 - background-color: white;
803789 }
804790
805791 .full-screen-search .suggestions-result {
806 - color: #666;
 792+ line-height: 2.6em;
807793 border: none;
808 - position: relative;
809 - border-bottom: solid 1px #999999;
810 - border-bottom: solid 1px #eee;
811 - padding: 12px 56px;
812 - font-size: 0.9em;
813794 }
814795
815796 .full-screen-search .suggestions-result a:visited {
@@ -818,16 +799,16 @@
819800 #remove-results {
820801 display: none;
821802 position: absolute;
822 - width: 18px;
 803+ width: 40px;
823804 height: 40px;
824805 text-align: center;
825806 line-height: 40px;
826 - background: url(images/arrow-left-beta.png) no-repeat scroll 0 0 transparent;
827 - background-position: left center;
828 - background-size: auto 18px;
 807+ background: url(images/arrow-left.png) no-repeat scroll 0 0 transparent;
 808+ background-position: center center;
829809 cursor: pointer;
830 - left: 24px;
831 - top: 6px; /* (#header height - background height) / 2 */
 810+ zoom: 1;
 811+ left: -3px;
 812+ top: 3px;
832813 margin: 1px;
833814 margin-top: -6px;
834815 z-index: 99;
@@ -836,57 +817,37 @@
837818 overflow: hidden;
838819 }
839820
840 -.full-screen-search #remove-results {
841 - display: block;
 821+html[dir="rtl"] #remove-results {
 822+ right: 0px;
 823+ left: auto;
842824 }
843825
844 -.full-screen-search #nav {
845 - display: none !important;
 826+.full-screen-search #results {
 827+ display: block !important;
846828 }
847829
848 -#mf-references {
849 - -webkit-transition: bottom 0.1s ease-in-out;
850 - -moz-transition: bottom 0.1s ease-in-out;
851 - -o-transition: bottom 0.1s ease-in-out;
852 - transition: bottom 0.1s ease-in-out;
853 - position: fixed;
854 - bottom: 0;
855 - left: 0;
856 - right: 0;
857 - background-color: #E4E4E4;
858 - padding: 22px;
859 - -webkit-box-shadow: 0px -20px 10px -16px #aaa;
860 - -moz-box-shadow: 0px -20px 10px -16px #aaa;
861 - -o-box-shadow: 0px -20px 10px -16px #aaa;
862 - box-shadow: 0px -20px 10px -16px #aaa;
863 - word-break: break-word;
864 - line-height: 1.4em;
865 - font-size: 0.8em;
 830+.full-screen-search #remove-results {
 831+ display: block;
866832 }
867833
868 -#mf-references button {
869 - top: 22px;
870 - right: 22px; /* padding of #content_wrapper */
871 - width: 16px;
872 - height: 12px;
873 - background: url(images/close-button-beta.png) no-repeat scroll 0 0 transparent;
874 - margin: 0;
875 - background-position: right center;
876 - background-size: auto 12px;
877 - cursor: pointer;
878 - position: absolute;
879 - text-indent: -999px;
880 - border: none;
 834+.full-screen-search .clearlink {
 835+ background: url(images/close-button.png?v=1) no-repeat scroll 0 0 transparent;
 836+ top: 0px;
 837+ right: 0px;
 838+ height: 42px;
 839+ width: 42px;
881840 }
882841
883 -#mf-references h3 {
884 - margin: 0;
885 - padding-right: 4px;
886 - line-height: 1em;
887 - display: inline;
 842+.full-screen-search #nav {
 843+ display: none !important;
888844 }
889845
890 -#mf-references a:visited,
891 -#mf-references a {
892 - color: #3354C0;
 846+#placeholder {
 847+ position: absolute;
 848+ left: 38px;
 849+ z-index: 2;
 850+ top: 0;
 851+ color: #666;
 852+ font-size: 16px;
 853+ padding-top: 10px;
893854 }
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/operamini.css
@@ -31,3 +31,5 @@
3232 span.idx {
3333 display: none;
3434 }
 35+
 36+
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/Makefile
@@ -2,6 +2,5 @@
33 java -jar yuicompressor-2.4.6.jar javascripts/application.js -o javascripts/application.min.js
44 java -jar yuicompressor-2.4.6.jar javascripts/banner.js -o javascripts/banner.min.js
55 java -jar yuicompressor-2.4.6.jar javascripts/opensearch.js -o javascripts/opensearch.min.js
6 - java -jar yuicompressor-2.4.6.jar javascripts/toggle.js -o javascripts/toggle.min.js
7 - java -jar yuicompressor-2.4.6.jar javascripts/references.js -o javascripts/references.min.js
 6+ java -jar yuicompressor-2.4.6.jar javascripts/beta_application.js -o javascripts/beta_application.min.js
87 java -jar yuicompressor-2.4.6.jar javascripts/beta_opensearch.js -o javascripts/beta_opensearch.min.js
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.php
@@ -103,16 +103,6 @@
104104 $wgMobileUrlTemplate = '';
105105
106106 /**
107 - * The number of seconds the 'useformat' cookie should be valid
108 - *
109 - * The useformat cookie gets set when a user manually elects to view
110 - * either the mobile or desktop view of the site.
111 - *
112 - * If this value is not set, it will default to $wgCookieExpiration
113 - */
114 -$wgMobileFrontendFormatCookieExpiry;
115 -
116 -/**
117107 * URL for script used to disable mobile site
118108 * (protocol, host, optional port; path portion)
119109 *
@@ -120,8 +110,6 @@
121111 */
122112 $wgMobileRedirectFormAction = false;
123113
124 -$wgMobileResourceVersion;
125 -
126114 $wgExtMobileFrontend = null;
127115
128116 $wgExtensionFunctions[] = 'efMobileFrontend_Setup';
@@ -134,7 +122,6 @@
135123 $wgHooks['APIGetParamDescription'][] = 'ApiParseExtender::onAPIGetParamDescription';
136124 $wgHooks['APIGetDescription'][] = 'ApiParseExtender::onAPIGetDescription';
137125
138 -
139126 function efMobileFrontend_Setup() {
140127 global $wgExtMobileFrontend, $wgHooks;
141128 $wgExtMobileFrontend = new ExtMobileFrontend();
@@ -143,7 +130,6 @@
144131 $wgHooks['SkinTemplateOutputPageBeforeExec'][] = array( &$wgExtMobileFrontend, 'addMobileFooter' );
145132 $wgHooks['TestCanonicalRedirect'][] = array( &$wgExtMobileFrontend, 'testCanonicalRedirect' );
146133 $wgHooks['ResourceLoaderTestModules'][] = array( &$wgExtMobileFrontend, 'addTestModules' );
147 - $wgHooks['GetCacheVaryCookies'][] = array( &$wgExtMobileFrontend, 'getCacheVaryCookies' );
148134 }
149135
150136 /**
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/FooterTemplate.php
@@ -9,12 +9,14 @@
1010 public function getHTML() {
1111
1212 $regularSite = $this->data['messages']['mobile-frontend-regular-site'];
 13+ $permStopRedirect = $this->data['messages']['mobile-frontend-perm-stop-redirect'];
1314 $copyright = $this->data['messages']['mobile-frontend-copyright'];
1415 $disableImages = $this->data['messages']['mobile-frontend-disable-images'];
1516 $enableImages = $this->data['messages']['mobile-frontend-enable-images'];
1617 $leaveFeedback = $this->data['messages']['mobile-frontend-leave-feedback'];
1718
1819 $leaveFeedbackURL = $this->data['leaveFeedbackURL'];
 20+ $disableMobileSiteURL = $this->data['disableMobileSiteURL'];
1921 $viewNormalSiteURL = $this->data['viewNormalSiteURL'];
2022
2123 if ( $this->data['disableImages'] == 0 ) {
@@ -36,7 +38,10 @@
3739 <div id='footer' {$footerDisplayNone}>
3840 <div class='nav' id='footmenu'>
3941 <div class='mwm-notice'>
40 - <a href="{$viewNormalSiteURL}" id="mf-display-toggle">{$regularSite}</a> | <a href="{$imagesURL}">{$imagesToggle}</a> {$feedbackLink} {$logoutLink}
 42+ <a href="{$viewNormalSiteURL}">{$regularSite}</a> | <a href="{$imagesURL}">{$imagesToggle}</a> {$feedbackLink} {$logoutLink}
 43+ <div id="perm">
 44+ <a href="{$disableMobileSiteURL}">{$permStopRedirect}</a>
 45+ </div>
4146 </div>
4247 </div>
4348 <div id='copyright'>{$copyright}</div>
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/ApplicationTemplate.php
@@ -7,7 +7,7 @@
88 class ApplicationTemplate extends MobileFrontendTemplate {
99
1010 public function getHTML() {
11 - global $wgMobileResourceVersion;
 11+
1212 if ( $this->data['wgAppleTouchIcon'] !== false ) {
1313 $appleTouchIconTag = Html::element( 'link', array( 'rel' => 'apple-touch-icon', 'href' => $this->data['wgAppleTouchIcon'] ) );
1414 } else {
@@ -34,36 +34,16 @@
3535 $endScriptTag = '"></script>';
3636 $javaScriptPath = $this->data['wgExtensionAssetsPath'] . '/MobileFrontend/javascripts/';
3737
38 - $jQuerySupport = $this->data['device']['supports_jquery'];
39 - $jQueryScript = $jQuerySupport ? $startScriptTag . $javaScriptPath . 'jquery-1.7.1.min.js' . $endScriptTag : '';
40 - $filePageScript = ( $this->data['isFilePage'] ) ? $startScriptTag . $javaScriptPath . 'filepage.js?version=' . $wgMobileResourceVersion . $endScriptTag : '';
 38+ $jQueryScript = ( $this->data['device']['supports_jquery'] ) ? $startScriptTag . $javaScriptPath . 'jquery-1.7.1.min.js' . $endScriptTag : '';
 39+ $filePageScript = ( $this->data['isFilePage'] ) ? $startScriptTag . $javaScriptPath . 'filepage.js?version=122920111241' . $endScriptTag : '';
4140
4241 $startLinkTag = "<link href='{$this->data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/";
4342 $endLinkTag = "' media='all' rel='Stylesheet' type='text/css' />";
4443 $filePageStyle = ( $this->data['isFilePage'] ) ? $startLinkTag . 'filepage.css' . $endLinkTag : '';
45 - $buttonHideText = Xml::escapeJsString( $this->data['hideText'] );
46 - $buttonShowText = Xml::escapeJsString( $this->data['showText'] );
 44+ $buttonHideText = htmlentities( $this->data['hideText'], ENT_QUOTES );
 45+ $buttonShowText = htmlentities( $this->data['showText'], ENT_QUOTES );
4746
48 - $jsconfig = array(
49 - 'messages' => array(
50 - 'expand-section' => $buttonShowText,
51 - 'collapse-section' => $buttonHideText
52 - ),
53 - 'settings' => array(
54 - 'scriptPath' => ( $this->data['wgScriptPath'] ),
55 - 'useFormatCookieName' => ( $this->data['useFormatCookieName'] ),
56 - 'useFormatCookieDuration' => ( $this->data['useFormatCookieDuration'] ),
57 - ),
58 - );
59 - $configuration = FormatJSON::encode( $jsconfig );
6047
61 - if( $this->data['isBetaGroupMember'] && $jQuerySupport ) {
62 - $betajs = <<<HTML
63 - {$startScriptTag}{$javaScriptPath}references.{$resourceSuffix}js?version={$wgMobileResourceVersion}{$endScriptTag}
64 -HTML;
65 - } else {
66 - $betajs = "";
67 - }
6848 $applicationHtml = <<<HTML
6949 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
7050 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -71,14 +51,20 @@
7252 <head>
7353 <title>{$this->data['htmlTitle']}</title>
7454 <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
75 - <link href='{$this->data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$betaPrefix}common.css?version={$wgMobileResourceVersion}' media='all' rel='Stylesheet' type='text/css' />
76 - <link href='{$this->data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$cssFileName}.css?version={$wgMobileResourceVersion}' media='all' rel='Stylesheet' type='text/css' />
 55+ <link href='{$this->data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$betaPrefix}common.css?version=1331257310' media='all' rel='Stylesheet' type='text/css' />
 56+ <link href='{$this->data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/{$cssFileName}.css?version=1331257310' media='all' rel='Stylesheet' type='text/css' />
7757 {$filePageStyle}
78 - <meta name="viewport" content="initial-scale=1.0">
 58+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7959 {$appleTouchIconTag}
8060 {$jQueryScript}
81 - <script type="text/javascript">
82 - var mwMobileFrontendConfig = {$configuration};
 61+ <script type='text/javascript'>
 62+ //<![CDATA[
 63+ var title = "{$this->data['htmlTitle']}";
 64+ var scriptPath = "{$this->data['wgScriptPath']}";
 65+ var placeholder = "{$this->data['placeholder']}";
 66+ var showText = "{$buttonShowText}";
 67+ var hideText = "{$buttonHideText}";
 68+ //]]>
8369 </script>
8470 </head>
8571 <body>
@@ -90,11 +76,9 @@
9177 </div>
9278 {$this->data['footerHtml']}
9379 <!--[if gt IE 9]><!-->
94 - {$startScriptTag}{$javaScriptPath}application.{$resourceSuffix}js?version={$wgMobileResourceVersion}{$endScriptTag}
95 - {$startScriptTag}{$javaScriptPath}toggle.{$resourceSuffix}js?version={$wgMobileResourceVersion}{$endScriptTag}
96 - {$startScriptTag}{$javaScriptPath}banner.{$resourceSuffix}js?version={$wgMobileResourceVersion}{$endScriptTag}
97 - {$startScriptTag}{$javaScriptPath}{$betaPrefix}opensearch.{$resourceSuffix}js?version={$wgMobileResourceVersion}{$endScriptTag}
98 - {$betajs}
 80+ {$startScriptTag}{$javaScriptPath}{$betaPrefix}application.{$resourceSuffix}js?version=1331257310{$endScriptTag}
 81+ {$startScriptTag}{$javaScriptPath}banner.{$resourceSuffix}js?version=1331257310{$endScriptTag}
 82+ {$startScriptTag}{$javaScriptPath}{$betaPrefix}opensearch.{$resourceSuffix}js?version=1331250599{$endScriptTag}
9983 {$filePageScript}
10084 <!--[endif]-->
10185 </body>
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/DisableTemplate.php
@@ -8,9 +8,7 @@
99
1010 public function getHTML() {
1111
12 -
13 - $currentURL = str_replace( '&mobileaction=disable_mobile_site', '', $this->data['currentURL'] );
14 - $currentURL = str_replace( '&useformat=mobile', '', $currentURL );
 12+ $currentURL = str_replace( '&mobileaction=disable_mobile_site', '', $this->data['currentURL'] ); // TODO: $currentURl is unused
1513 $mobileRedirectFormAction = $this->data['mobileRedirectFormAction'];
1614
1715 $disableHtml = <<<HTML
@@ -22,7 +20,7 @@
2321 </p>
2422 <div id='disableButtons'>
2523 <form action='{$mobileRedirectFormAction}' method='get'>
26 - <input name='to' type='hidden' value='{$currentURL}' />
 24+ <input name='to' type='hidden' value='{$this->data['currentURL']}' />
2725 <input name='expires_in_days' type='hidden' value='3650' />
2826 <button id='disableButton' type='submit'>{$this->data['disableButton']}</button>
2927 </form>
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/SearchTemplate.php
@@ -8,14 +8,12 @@
99
1010 public function getHTML() {
1111
12 - $searchField = Xml::escapeJsString( $this->data['searchField'] );
 12+ $searchField = htmlspecialchars( $this->data['searchField'] );
1313 $mainPageUrl = $this->data['mainPageUrl'];
1414 $randomPageUrl = $this->data['randomPageUrl'];
1515 $homeButton = $this->data['messages']['mobile-frontend-home-button'];
1616 $randomButton = $this->data['messages']['mobile-frontend-random-button'];
17 - $clearText = Xml::escapeJsString( $this->data['messages']['mobile-frontend-clear-search'] );
18 - $searchValue = $this->data['messages']['mobile-frontend-search-submit'];
19 - $placeholder = Xml::escapeJsString( $this->data['messages']['mobile-frontend-placeholder'] );
 17+ $clearText = htmlentities( $this->data['messages']['mobile-frontend-clear-search'], ENT_QUOTES );
2018
2119 $scriptUrl = wfScript();
2220 $searchBoxDisplayNone = ( $this->data['hideSearchBox'] ) ? ' style="display: none;" ' : '';
@@ -26,16 +24,17 @@
2725
2826 $languageSelection = $this->data['buildLanguageSelection'] . '<br/>';
2927 $languageSelectionText = '<b>' . $this->data['messages']['mobile-frontend-language'] . ':</b><br/>';
30 - $languageSelectionDiv = $languageSelectionText . $languageSelection;
 28+ $languageSelectionDiv = '<div id="languageselectionsection">' . $languageSelectionText . $languageSelection . '</div>';
3129
3230 $searchWebkitHtml = <<<HTML
 31+ {$openSearchResults}
3332 <div id='header'>
3433 <div id='searchbox' {$logoDisplayNone}>
3534 <img width="35" height="22" alt='Logo' id='logo' src='{$this->data['wgMobileFrontendLogo']}' {$logoDisplayNone} />
3635 <form action='{$scriptUrl}' class='search_bar' method='get' {$searchBoxDisplayNone}>
3736 <input type="hidden" value="Special:Search" name="title" />
3837 <div id="sq" class="divclearable">
39 - <input type="search" name="search" id="search" size="22" value="{$searchField}" autocorrect="off" autocomplete="off" autocapitalize="off" maxlength="1024" class="search" placeholder="{$placeholder}" />
 38+ <input type="search" name="search" id="search" size="22" value="{$searchField}" autocorrect="off" autocomplete="off" autocapitalize="off" maxlength="1024" class="search" />
4039 <div class="clearlink" id="clearsearch" title="{$clearText}"></div>
4140 </div>
4241 <button id='goButton' class='goButton' type='submit'></button>
@@ -47,7 +46,6 @@
4847 <a href="{$randomPageUrl}" id="randomButton" class="button">{$randomButton}</a>
4948 </div>
5049 </div>
51 - {$openSearchResults}
5250 HTML;
5351 return $searchWebkitHtml;
5452 }
Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend
___________________________________________________________________
Modified: svn:mergeinfo
5553 Reverse-merged /trunk/extensions/MobileFrontend:r113463,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

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r114197Removing MobileFrontend in prep for svn cp from turnkawjrichards22:00, 19 March 2012
r114200r113463, r113465, r113466, r113469, r113470, r113471, r113472awjrichards22:16, 19 March 2012
r114201MFT r113486, r113488, r113512, r113553, r113640, r113642, r113644, r113645, r...awjrichards22:18, 19 March 2012
r114202MFT r113807, r113831, r113832, r113865, r113866, r113870, r113871, r113872, r...awjrichards22:23, 19 March 2012
r114203MFT r113930awjrichards22:24, 19 March 2012
r114205MFT r113942, r113971, r113987, r114005, r114025, r114100awjrichards22:25, 19 March 2012
r114206MFT r114134, r114136, r114144, r114145, r114150, r114152, r114157awjrichards22:26, 19 March 2012
r114207MFT r114177, r114184, r114190, r114191, r114193awjrichards22:28, 19 March 2012
r114213MFT r114211, r114212awjrichards23:25, 19 March 2012
r114216MFT r114214awjrichards23:33, 19 March 2012
r114221MFT r114220awjrichards00:14, 20 March 2012

Comments

#Comment by Awjrichards (talk | contribs)   00:27, 20 March 2012

Rolled back today's deployment due to operational configuration issues that we couldn't get resolved due to it being too late in the day. Will resume and try again tomorrow.

Status & tagging log