Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/js/test_toggle.js |
— | — | @@ -1,16 +1,8 @@ |
2 | | -function applyCss() { |
3 | | - $(".hide").show(); |
4 | | - $(".show").hide(); |
5 | | - $(".openSection .hide").hide(); |
6 | | - $(".openSection .show").show(); |
7 | | -} |
8 | | - |
9 | 2 | module("MobileFrontend toggle.js: wm_toggle_section", { |
10 | 3 | setup: function() { |
11 | 4 | MFET.createFixtures(); |
12 | 5 | MFE.toggle.init(); |
13 | | - $("#section_1").addClass("openSection"); |
14 | | - $("#content_1,#anchor_1,#section_1 .hide").hide(); |
| 6 | + $("#section_1,#content_1,#anchor_1").addClass("openSection"); |
15 | 7 | }, |
16 | 8 | teardown: function() { |
17 | 9 | MFET.cleanFixtures(); |
— | — | @@ -21,20 +13,15 @@ |
22 | 14 | test("wm_toggle_section", function() { |
23 | 15 | strictEqual($("#section_1").hasClass("openSection"), true, "openSection class present"); |
24 | 16 | MFE.toggle.wm_toggle_section("1"); |
25 | | - applyCss(); |
26 | | - strictEqual($("#content_1").is(":visible"), true, "check content is visible on a toggle"); |
27 | | - strictEqual($("#anchor_1").is(":visible"), true, "check anchor is visible on toggle"); |
28 | | - strictEqual($("#section_1").hasClass("openSection"), false, "openSection class removed"); |
29 | | - strictEqual($("#section_1 .hide").is(":visible"), true, "check hide button now visible"); |
30 | | - strictEqual($("#section_1 .show").is(":visible"), false, "check show button now hidden"); |
| 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"); |
31 | 20 | |
32 | 21 | // perform second toggle |
33 | 22 | MFE.toggle.wm_toggle_section("1"); |
34 | | - applyCss(); |
35 | | - strictEqual($("#content_1").is(":visible"), false, "check content is hidden on a toggle"); |
36 | | - strictEqual($("#anchor_1").is(":visible"), false, "check anchor is hidden on toggle"); |
37 | | - strictEqual($("#section_1 .hide").is(":visible"), false, "check hide button now hidden"); |
38 | | - strictEqual($("#section_1 .show").is(":visible"), true, "check show button now visible"); |
| 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"); |
39 | 26 | }); |
40 | 27 | |
41 | 28 | test("wm_reveal_for_hash", function() { |
— | — | @@ -48,26 +35,21 @@ |
49 | 36 | |
50 | 37 | test("wm_reveal_for_hash", function() { |
51 | 38 | MFE.toggle.wm_reveal_for_hash("#First_Section_2"); |
52 | | - applyCss(); |
53 | | - strictEqual($("#content_1").is(":visible"), true, "check content is visible on a toggle"); |
54 | | - strictEqual($("#anchor_1").is(":visible"), true, "check anchor is visible on toggle"); |
55 | | - strictEqual($("#section_1 .hide").is(":visible"), true, "check hide button now visible"); |
56 | | - strictEqual($("#section_1 .show").is(":visible"), false, "check show button now hidden"); |
| 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"); |
57 | 42 | }); |
58 | 43 | |
59 | 44 | test("clicking hash links", function() { |
60 | 45 | MFET.triggerEvent($("[href=#First_Section_2]")[0], "click"); |
61 | | - applyCss(); |
62 | | - strictEqual($("#content_1").is(":visible"), true, "check content is visible on a toggle"); |
63 | | - strictEqual($("#anchor_1").is(":visible"), true, "check anchor is visible on toggle"); |
64 | | - strictEqual($("#section_1 .hide").is(":visible"), true, "check hide button now visible"); |
65 | | - strictEqual($("#section_1 .show").is(":visible"), false, "check show button now hidden"); |
| 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"); |
66 | 49 | }); |
67 | 50 | |
68 | 51 | test("clicking a heading toggles it", function() { |
69 | | - var visibilityStart = $("#content_1").is(":visible"); |
70 | | - MFET.triggerEvent($("#section_1")[0], "click"); |
71 | | - applyCss(); |
| 52 | + var visibilityStart = $("#content_2").hasClass("openSection"); |
| 53 | + MFET.triggerEvent($("#section_2")[0], "click"); |
72 | 54 | strictEqual(visibilityStart, false, "check content is hidden at start"); |
73 | | - strictEqual($("#content_1").is(":visible"), true, "check content is hidden on a toggle"); |
| 55 | + strictEqual($("#content_2").hasClass("openSection"), true, "check content is shown on a toggle"); |
74 | 56 | }); |
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/js/test_application.js |
— | — | @@ -1,14 +1,22 @@ |
2 | 2 | var MFE = MobileFrontend; |
3 | 3 | var MFET = window.MobileFrontendTests; |
4 | 4 | |
5 | | -module("MobileFrontend application.js: utils"); |
| 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 | +}); |
6 | 14 | |
7 | 15 | test("Basic selector support (#id)", function() { |
8 | | - strictEqual(MFE.utils("#section_1").length, 1, "only one element matches this selector"); |
| 16 | + strictEqual(MFE.utils("#t_section_1").length, 1, "only one element matches this selector"); |
9 | 17 | }); |
10 | 18 | |
11 | 19 | test("Basic selector support (.className)", function() { |
12 | | - strictEqual(MFE.utils(".section_heading").length, 2, "only two elements matches this selector"); |
| 20 | + strictEqual(MFE.utils(".t_section_heading").length, 2, "only two elements matches this selector"); |
13 | 21 | }); |
14 | 22 | |
15 | 23 | test("Basic selector support (tag name)", function() { |
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/tests/MobileFrontendTest.php |
— | — | @@ -219,15 +219,14 @@ |
220 | 220 | array( false, null, array() ), |
221 | 221 | array( true, 'webkit', array() ), |
222 | 222 | array( false, 'webkit', array( 'action' => 'edit' ) ), |
223 | | - array( false, 'webkit', array( 'mobileaction' => 'view_normal_site' ) ), |
| 223 | + array( false, 'webkit', array( 'useformat' => 'desktop' ) ), |
224 | 224 | array( true, null, array( 'useformat' => 'mobile-wap' ) ), |
225 | 225 | array( false, null, array( 'useformat' => 'mobile-wap', 'action' => 'edit' ) ), |
226 | 226 | array( false, null, array( 'useformat' => 'mobile-wap', 'action' => 'history' ) ), |
227 | | - array( false, null, array( 'useformat' => 'mobile-wap', 'mobileaction' => 'view_normal_site' ) ), |
| 227 | + array( false, null, array( 'useformat' => 'desktop' ) ), |
228 | 228 | array( true, null, array( 'useformat' => 'mobile' ) ), |
229 | 229 | array( false, null, array( 'useformat' => 'mobile', 'action' => 'edit' ) ), |
230 | 230 | array( false, null, array( 'useformat' => 'mobile', 'action' => 'history' ) ), |
231 | | - array( false, null, array( 'useformat' => 'mobile', 'mobileaction' => 'view_normal_site' ) ), |
232 | 231 | ); |
233 | 232 | } |
234 | 233 | |
— | — | @@ -302,4 +301,65 @@ |
303 | 302 | array( 'edit' ), |
304 | 303 | ); |
305 | 304 | } |
| 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 | + */ |
306 | 366 | } |
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php |
— | — | @@ -26,7 +26,6 @@ |
27 | 27 | public static $searchField; |
28 | 28 | public static $disableImagesURL; |
29 | 29 | public static $enableImagesURL; |
30 | | - public static $disableMobileSiteURL; |
31 | 30 | public static $viewNormalSiteURL; |
32 | 31 | public static $currentURL; |
33 | 32 | public static $displayNoticeId; |
— | — | @@ -72,7 +71,6 @@ |
73 | 72 | 'mobile-frontend-hide-button', |
74 | 73 | 'mobile-frontend-back-to-top-of-section', |
75 | 74 | 'mobile-frontend-regular-site', |
76 | | - 'mobile-frontend-perm-stop-redirect', |
77 | 75 | 'mobile-frontend-home-button', |
78 | 76 | 'mobile-frontend-random-button', |
79 | 77 | 'mobile-frontend-are-you-sure', |
— | — | @@ -231,8 +229,7 @@ |
232 | 230 | |
233 | 231 | self::$disableImagesURL = $wgRequest->escapeAppendQuery( 'disableImages=1' ); |
234 | 232 | self::$enableImagesURL = $wgRequest->escapeAppendQuery( 'enableImages=1' ); |
235 | | - self::$disableMobileSiteURL = $wgRequest->escapeAppendQuery( 'mobileaction=disable_mobile_site' ); |
236 | | - self::$viewNormalSiteURL = $wgRequest->escapeAppendQuery( 'mobileaction=view_normal_site' ); |
| 233 | + self::$viewNormalSiteURL = $wgRequest->escapeAppendQuery( 'useformat=desktop' ); |
237 | 234 | self::$currentURL = $wgRequest->getFullRequestURL(); |
238 | 235 | self::$leaveFeedbackURL = $wgRequest->escapeAppendQuery( 'mobileaction=leave_feedback' ); |
239 | 236 | |
— | — | @@ -477,12 +474,6 @@ |
478 | 475 | exit(); |
479 | 476 | } |
480 | 477 | |
481 | | - if ( $mobileAction == 'disable_mobile_site' && $this->contentFormat == 'XHTML' ) { |
482 | | - echo $this->renderDisableMobileSiteXHTML(); |
483 | | - wfProfileOut( __METHOD__ ); |
484 | | - exit(); |
485 | | - } |
486 | | - |
487 | 478 | if ( $mobileAction == 'opt_in_mobile_site' && $this->contentFormat == 'XHTML' ) { |
488 | 479 | echo $this->renderOptInMobileSiteXHTML(); |
489 | 480 | wfProfileOut( __METHOD__ ); |
— | — | @@ -716,6 +707,7 @@ |
717 | 708 | } |
718 | 709 | $wgOut->addVaryHeader( 'Cookie' ); |
719 | 710 | $wgOut->addVaryHeader( 'X-Carrier' ); |
| 711 | + $wgOut->addVaryHeader( 'X-Images' ); |
720 | 712 | wfProfileOut( __METHOD__ ); |
721 | 713 | return true; |
722 | 714 | } |
— | — | @@ -857,54 +849,6 @@ |
858 | 850 | } |
859 | 851 | |
860 | 852 | /** |
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 | | - /** |
909 | 853 | * @return DomElement |
910 | 854 | */ |
911 | 855 | public function renderLogin() { |
— | — | @@ -1164,7 +1108,6 @@ |
1165 | 1109 | $options = array( |
1166 | 1110 | 'messages' => self::$messages, |
1167 | 1111 | 'leaveFeedbackURL' => self::$leaveFeedbackURL, |
1168 | | - 'disableMobileSiteURL' => self::$disableMobileSiteURL, |
1169 | 1112 | 'viewNormalSiteURL' => self::$viewNormalSiteURL, |
1170 | 1113 | 'disableImages' => self::$disableImages, |
1171 | 1114 | 'disableImagesURL' => self::$disableImagesURL, |
— | — | @@ -1441,15 +1384,20 @@ |
1442 | 1385 | } |
1443 | 1386 | |
1444 | 1387 | protected function shouldDisplayMobileView() { |
1445 | | - if ( !$this->isMobileDevice() && !$this->isFauxMobileDevice() ) { |
| 1388 | + // always display desktop view if it's explicitly requested |
| 1389 | + $useFormat = $this->getUseFormat(); |
| 1390 | + if ( $useFormat == 'desktop' ) { |
1446 | 1391 | return false; |
1447 | 1392 | } |
| 1393 | + |
| 1394 | + if ( !$this->isMobileDevice() && !$this->isFauxMobileDevice() ) { |
| 1395 | + return false; |
| 1396 | + } |
1448 | 1397 | |
1449 | 1398 | $action = $this->getAction(); |
1450 | | - $mobileAction = $this->getMobileAction(); |
1451 | 1399 | |
1452 | | - if ( $action === 'edit' || $action === 'history' || |
1453 | | - $mobileAction === 'view_normal_site' ) { |
| 1400 | + |
| 1401 | + if ( $action === 'edit' || $action === 'history' ) { |
1454 | 1402 | return false; |
1455 | 1403 | } |
1456 | 1404 | |
— | — | @@ -1501,29 +1449,49 @@ |
1502 | 1450 | |
1503 | 1451 | $useFormat = $this->getUseFormat(); |
1504 | 1452 | $useFormatFromCookie = $wgRequest->getCookie( 'mf_useformat' ); |
| 1453 | + |
| 1454 | + // fetch format from cookie and set it if one is not otherwise specified |
1505 | 1455 | if( !strlen( $useFormat ) && !is_null( $useFormatFromCookie ) ) { |
1506 | 1456 | $this->setUseFormat( $useFormatFromCookie ); |
1507 | 1457 | } |
1508 | 1458 | |
1509 | | - // if we should not be displaying the mobile view, make sure cookies are unset etc. |
1510 | | - if ( !$this->shouldDisplayMobileView() ) { |
1511 | | - // make sure cookie is unset for appropriate mobile actions |
1512 | | - $mobileAction = $this->getMobileAction(); |
1513 | | - if ( in_array( $mobileAction, array( 'view_normal_site', 'disable_mobile_site' ) ) ) { |
1514 | | - $wgRequest->response()->setCookie( 'mf_useformat', false, time() - 3600 ); |
1515 | | - } |
1516 | | - |
1517 | | - // make sure useformat is unset |
1518 | | - $this->setUseFormat( '' ); |
1519 | | - return; |
| 1459 | + // set appropriate cookie if necessary |
| 1460 | + if ( ( $useFormatFromCookie != 'mobile' && $useFormat == 'mobile' ) || |
| 1461 | + ( $useFormatFromCookie != 'desktop' && $useFormat == 'desktop' ) ) { |
| 1462 | + $this->setUseFormatCookie( $useFormat ); |
1520 | 1463 | } |
1521 | | - |
1522 | | - // if getUseFormat and no cookie set, set the cookie |
1523 | | - if ( is_null( $useFormatFromCookie ) && strlen( $useFormat ) ) { |
1524 | | - $wgRequest->response()->setCookie( 'mf_useformat', $useFormat, 0 ); |
1525 | | - } |
1526 | 1464 | } |
1527 | 1465 | |
| 1466 | + /** |
| 1467 | + * Set the mf_useformat cookie |
| 1468 | + * |
| 1469 | + * This cookie can determine whether or not a user should see the mobile |
| 1470 | + * version of pages. |
| 1471 | + * |
| 1472 | + * @param string The format to store in the cookie |
| 1473 | + */ |
| 1474 | + protected function setUseFormatCookie( $useFormat ) { |
| 1475 | + global $wgRequest; |
| 1476 | + $expiry = $this->getUseFormatCookieExpiry(); |
| 1477 | + $wgRequest->response()->setCookie( 'mf_useformat', $useFormat, $expiry ); |
| 1478 | + } |
| 1479 | + |
| 1480 | + /** |
| 1481 | + * Get the expiration time for the mf_useformat cookie |
| 1482 | + * |
| 1483 | + * If $wgMobileFrontendFormatCookieExpiry as a non-0 value, |
| 1484 | + * @param int The base time (in seconds since Epoch) from which to calculate |
| 1485 | + * cookie expiration. If null, time() is used. |
| 1486 | + */ |
| 1487 | + protected function getUseFormatCookieExpiry( $startTime=null ) { |
| 1488 | + global $wgCookieExpiration, $wgMobileFrontendFormatCookieExpiry; |
| 1489 | + $cookieDuration = ( abs( intval( $wgMobileFrontendFormatCookieExpiry ) ) > 0 ) ? |
| 1490 | + $wgMobileFrontendFormatCookieExpiry : $wgCookieExpiration; |
| 1491 | + if ( intval( $startTime ) === 0 ) $startTime = time(); |
| 1492 | + $expiry = $startTime + $cookieDuration; |
| 1493 | + return $expiry; |
| 1494 | + } |
| 1495 | + |
1528 | 1496 | public function getVersion() { |
1529 | 1497 | return __CLASS__ . ': $Id$'; |
1530 | 1498 | } |
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/toggle.js |
— | — | @@ -79,8 +79,10 @@ |
80 | 80 | } |
81 | 81 | for ( i = 0, d = ['content_','anchor_']; i<=1; i++ ) { |
82 | 82 | e = document.getElementById( d[i] + section_id ); |
83 | | - if ( e ) { |
84 | | - e.style.display = e.style.display === 'block' ? 'none' : 'block'; |
| 83 | + if ( e && u( e ).hasClass( 'openSection' ) ) { |
| 84 | + u( e ).removeClass( 'openSection' ) |
| 85 | + } else { |
| 86 | + u( e ).addClass( 'openSection' ) |
85 | 87 | } |
86 | 88 | } |
87 | 89 | } |
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/javascripts/beta_opensearch.js |
— | — | @@ -4,12 +4,12 @@ |
5 | 5 | var apiUrl = '/api.php', timer = -1, typingDelay = 500, |
6 | 6 | numResults = 15, term, |
7 | 7 | search = document.getElementById( 'search' ), |
8 | | - sq = document.getElementById( 'sq' ), |
9 | 8 | sb = document.getElementById( 'searchbox' ), |
10 | 9 | content = document.getElementById( 'content' ), |
11 | 10 | footer = document.getElementById( 'footer' ), |
12 | 11 | clearSearch = document.getElementById( 'clearsearch' ), |
13 | 12 | focused = false, |
| 13 | + viewportmeta, originalViewport, |
14 | 14 | u = MobileFrontend.utils; |
15 | 15 | |
16 | 16 | apiUrl = MobileFrontend.setting( 'scriptPath' ) + apiUrl; |
— | — | @@ -17,16 +17,19 @@ |
18 | 18 | function hideResults() { |
19 | 19 | results.style.display = 'none'; |
20 | 20 | } |
| 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 |
21 | 28 | function resetViewPort() { |
22 | | - if ( navigator.userAgent.match( /iPhone/i ) || navigator.userAgent.match( /iPad/i ) ) { |
23 | | - var viewportmeta = u( 'meta[name="viewport"]' ); |
24 | | - if ( viewportmeta ) { |
25 | | - viewportmeta = viewportmeta[0]; |
26 | | - viewportmeta.content = 'width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0'; |
27 | | - u( document.body ).bind( 'gesturestart', function () { |
28 | | - viewportmeta.content = 'width=device-width, initial-scale=1.0'; |
29 | | - } ); |
30 | | - } |
| 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 | + } ); |
31 | 34 | } |
32 | 35 | } |
33 | 36 | |
— | — | @@ -35,7 +38,7 @@ |
36 | 39 | search.onfocus = function() { |
37 | 40 | var rrd, rrdD; |
38 | 41 | sb = document.getElementById( 'searchbox' ); |
39 | | - sq = document.getElementById( 'sq' ); |
| 42 | + header = document.getElementById( 'header' ); |
40 | 43 | content = document.getElementById( 'content' ); |
41 | 44 | footer = document.getElementById( 'footer' ); |
42 | 45 | resetViewPort(); |
— | — | @@ -52,7 +55,7 @@ |
53 | 56 | rrdD = document.createElement( 'div' ); |
54 | 57 | rrdD.setAttribute( 'id', 'left-arrow' ); |
55 | 58 | rrd.appendChild( rrdD ); |
56 | | - sq.insertBefore( rrd, sq.firstChild ); |
| 59 | + header.insertBefore( rrd, header.firstChild ); |
57 | 60 | } |
58 | 61 | focused = true; |
59 | 62 | } |
— | — | @@ -108,14 +111,14 @@ |
109 | 112 | window.onload = function () { |
110 | 113 | u( search ).bind( 'keyup', |
111 | 114 | function() { |
112 | | - clearTimeout( timer ); |
113 | | - term = this.value; |
114 | | - if ( term.length < 1 ) { |
115 | | - results.innerHTML = ''; |
116 | | - } else { |
117 | | - term = encodeURIComponent( term ); |
118 | | - timer = setTimeout( function () { searchApi( term ); }, typingDelay ); |
119 | | - } |
| 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 | + } |
120 | 123 | } ); |
121 | 124 | }; |
122 | 125 | |
— | — | @@ -142,15 +145,6 @@ |
143 | 146 | return sections; |
144 | 147 | } |
145 | 148 | |
146 | | - function sqValUpdate( sqValue ) { |
147 | | - var search = document.getElementById( 'search' ); |
148 | | - if ( search ) { |
149 | | - search.value = sqValue + ' '; |
150 | | - search.focus(); |
151 | | - searchApi( search.value ); |
152 | | - } |
153 | | - } |
154 | | - |
155 | 149 | function htmlEntities( str ) { |
156 | 150 | var text = document.createTextNode( str ), |
157 | 151 | el = document.createElement( 'div' ); |
— | — | @@ -165,7 +159,7 @@ |
166 | 160 | function writeResults( sections ) { |
167 | 161 | var results = document.getElementById( 'results' ), suggestions, i, |
168 | 162 | term = htmlEntities( document.getElementById( 'search' ).value ), |
169 | | - suggestionListener, section, escapedTerm, suggestionsResult, link, label; |
| 163 | + section, escapedTerm, suggestionsResult, link, label; |
170 | 164 | |
171 | 165 | results.style.display = 'block'; |
172 | 166 | if ( search ) { |
— | — | @@ -180,22 +174,12 @@ |
181 | 175 | suggestions = document.createElement( 'ul' ); |
182 | 176 | suggestions.className = 'suggestions-results'; |
183 | 177 | results.appendChild( suggestions ); |
184 | | - suggestionListener = function() { |
185 | | - var title = this.parentNode.getAttribute( 'title' ); |
186 | | - sqValUpdate( title ); |
187 | | - }; |
188 | 178 | |
189 | 179 | for ( i = 0; i < sections.length; i++ ) { |
190 | 180 | section = sections[i]; |
191 | 181 | suggestionsResult = document.createElement( 'li' ); |
192 | | - link = document.createElement( 'a' ); |
193 | 182 | suggestionsResult.setAttribute( 'title', section.label ); |
194 | 183 | suggestionsResult.className = 'suggestions-result'; |
195 | | - label = document.createTextNode( '+' ); |
196 | | - link.appendChild(label); |
197 | | - link.className = 'sq-val-update'; |
198 | | - u( link ).bind( 'click', suggestionListener ); |
199 | | - suggestionsResult.appendChild( link ); |
200 | 184 | |
201 | 185 | link = document.createElement( 'a' ); |
202 | 186 | link.setAttribute( 'href', section.value.replace( /^(?:\/\/|[^\/]+)*\//, '/' ) ); |
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.i18n.php |
— | — | @@ -26,8 +26,7 @@ |
27 | 27 | 'mobile-frontend-hide-button' => 'Hide', |
28 | 28 | 'mobile-frontend-disable-button' => 'Disable', |
29 | 29 | 'mobile-frontend-back-button' => 'Back', |
30 | | - 'mobile-frontend-regular-site' => 'View this page on regular {{SITENAME}}', |
31 | | - 'mobile-frontend-perm-stop-redirect' => 'Permanently disable mobile site', |
| 30 | + 'mobile-frontend-regular-site' => 'Desktop view', |
32 | 31 | 'mobile-frontend-error-page-title' => 'We have a problem!', |
33 | 32 | '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!', |
34 | 33 | 'mobile-frontend-are-you-sure' => 'Are you sure?', |
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/common.css |
— | — | @@ -352,6 +352,10 @@ |
353 | 353 | display: none; |
354 | 354 | } |
355 | 355 | |
| 356 | +.togglingEnabled .openSection { |
| 357 | + display: block; |
| 358 | +} |
| 359 | + |
356 | 360 | .mwm-notice { |
357 | 361 | padding: 5px; |
358 | 362 | background: #dddddd; |
— | — | @@ -582,6 +586,7 @@ |
583 | 587 | #footer { |
584 | 588 | margin: 0 8px; |
585 | 589 | clear: both; |
| 590 | + font-size: 0.8em; |
586 | 591 | } |
587 | 592 | |
588 | 593 | #logo { |
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 |
Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/images/close-button-beta.png |
___________________________________________________________________ |
Added: svn:mime-type |
589 | 594 | + 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 |
Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/images/arrow-left-beta.png |
___________________________________________________________________ |
Added: svn:mime-type |
590 | 595 | + application/octet-stream |
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/beta_common.css |
— | — | @@ -10,7 +10,7 @@ |
11 | 11 | } |
12 | 12 | |
13 | 13 | body { |
14 | | - font-size: 0.8em; |
| 14 | + font-size: 1em; |
15 | 15 | line-height: 1; |
16 | 16 | color: black; |
17 | 17 | background: white; |
— | — | @@ -19,24 +19,21 @@ |
20 | 20 | } |
21 | 21 | |
22 | 22 | .clearlink { |
23 | | - background: url(images/close-button.png?v=1) no-repeat scroll 0 0 transparent; |
24 | | - background-position: center center; |
| 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; |
25 | 32 | cursor: pointer; |
26 | | - zoom: 1; |
27 | 33 | 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; |
37 | 34 | } |
38 | 35 | |
39 | 36 | html[dir="rtl"] .clearlink { |
40 | | - left: 0.25em; |
| 37 | + left: 0; |
41 | 38 | right: auto; |
42 | 39 | } |
43 | 40 | |
— | — | @@ -129,33 +126,8 @@ |
130 | 127 | background-color: #ACD1E9; |
131 | 128 | } |
132 | 129 | |
133 | | -a.sq-val-update { |
134 | | - font-size: 1.3em; |
135 | | - display: block; |
136 | | - font-weight: normal; |
137 | | - text-decoration: none; |
138 | | - color: #666; |
139 | | - position: absolute; |
140 | | - right: 0; |
141 | | - width: 1.5em; |
142 | | - text-align: center; |
143 | | -} |
144 | | - |
145 | | -a.sq-val-update:visited { |
146 | | - text-decoration: none; |
147 | | -} |
148 | | - |
149 | | -a.sq-val-update:hover { |
150 | | - text-decoration: none; |
151 | | -} |
152 | | - |
153 | | -a.sq-val-update:active { |
154 | | - text-decoration: none; |
155 | | -} |
156 | | - |
157 | 130 | a.search-result-item { |
158 | 131 | display: block; |
159 | | - margin-right: 2em; |
160 | 132 | } |
161 | 133 | |
162 | 134 | /* TODO: support browsers which do not support data uris */ |
— | — | @@ -164,18 +136,7 @@ |
165 | 137 | padding-right: 13px; |
166 | 138 | } |
167 | 139 | |
168 | | -#results { |
169 | | - display: none; |
170 | | - background-color: #ffffff; |
171 | | - border-top: none; |
172 | | - z-index: 2; |
173 | | - position: absolute; |
174 | | - left: 53px; |
175 | | - top: 35px; |
176 | | -} |
177 | | - |
178 | 140 | .search_bar .search { |
179 | | - width: 90%; |
180 | 141 | -webkit-appearance: none; |
181 | 142 | border-top-width: 0px; |
182 | 143 | border-right-width: 0px; |
— | — | @@ -185,6 +146,10 @@ |
186 | 147 | outline-width: initial; |
187 | 148 | outline-color: initial; |
188 | 149 | 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 */ |
189 | 154 | } |
190 | 155 | |
191 | 156 | #search::-webkit-search-cancel-button { |
— | — | @@ -318,6 +283,10 @@ |
319 | 284 | margin: 0px; |
320 | 285 | } |
321 | 286 | |
| 287 | +.section_heading { |
| 288 | + cursor: pointer; |
| 289 | +} |
| 290 | + |
322 | 291 | button.show, |
323 | 292 | button.hide { /* for non-js browsers */ |
324 | 293 | display: none; |
— | — | @@ -333,11 +302,35 @@ |
334 | 303 | display: inline-block; |
335 | 304 | } |
336 | 305 | |
337 | | -.togglingEnabled .content_block, |
| 306 | +.openSection button.hide, |
| 307 | +.openSection button.show { |
| 308 | + opacity: 1; |
| 309 | +} |
| 310 | + |
338 | 311 | .togglingEnabled .section_anchors { |
339 | 312 | display: none; |
340 | 313 | } |
341 | 314 | |
| 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 | + |
342 | 335 | .mwm-notice { |
343 | 336 | padding: 5px; |
344 | 337 | background: #dddddd; |
— | — | @@ -542,13 +535,14 @@ |
543 | 536 | } |
544 | 537 | |
545 | 538 | #header { |
546 | | - margin: 8px 8px 0 8px; |
| 539 | + margin: 0; |
547 | 540 | position: relative; |
| 541 | + border-bottom: solid 1px #CCC; |
548 | 542 | } |
549 | 543 | |
550 | 544 | #content_wrapper { |
551 | 545 | clear: both; |
552 | | - margin: 0 8px; |
| 546 | + margin: 22px 22px; |
553 | 547 | } |
554 | 548 | |
555 | 549 | #footer { |
— | — | @@ -558,51 +552,60 @@ |
559 | 553 | |
560 | 554 | #logo { |
561 | 555 | position: absolute; |
562 | | - top: 4px; |
563 | | - left: 5px; |
| 556 | + height: 22px; |
| 557 | + cursor: pointer; |
| 558 | + left: 22px; |
| 559 | + top: 9px; |
| 560 | + width: 35px; |
564 | 561 | } |
565 | 562 | |
| 563 | +html[dir="rtl"] #searchbox { |
| 564 | + padding: 0px 54px 0px 20px; |
| 565 | +} |
| 566 | + |
566 | 567 | #zero-language-search.search_bar, |
567 | 568 | #searchbox { |
568 | 569 | width: auto; |
569 | 570 | position: relative; |
570 | | - padding: 8px 32px 8px 44px; |
571 | | - border: 1px solid #cccccc; |
| 571 | + padding: 0px 40px 0px 73px; /* right = width of #logo (35px) + 22px + 16px |
| 572 | + left = width of close button + 22px */ |
572 | 573 | -webkit-border-radius: 2px; |
573 | 574 | -moz-border-radius: 2px; |
| 575 | + -webkit-tap-highlight-color: rgba(255, 255, 255, 0); |
574 | 576 | } |
575 | 577 | |
| 578 | +.full-screen-search #searchbox { |
| 579 | + padding: 0px 40px 0px 54px; /* right = width of #logo (18px) + 22px + 16px */ |
| 580 | +} |
| 581 | + |
576 | 582 | #zero-language-search.search_bar { |
577 | 583 | padding: 8px 32px 8px 0px; |
578 | 584 | } |
579 | 585 | |
580 | | -#searchbox #form { |
581 | | - padding-right: 34px; |
582 | | - width: 100%; |
583 | | - margin-bottom: 0; |
| 586 | +html[dir="rtl"] #remove-results, |
| 587 | +html[dir="rtl"] #logo { |
| 588 | + right: 18px; |
| 589 | + left: auto; |
584 | 590 | } |
585 | 591 | |
586 | | -html[dir="rtl"] #logo, |
587 | 592 | .goButton { |
588 | 593 | position: absolute; |
589 | | - right: 2px; |
| 594 | + right: -18px; |
590 | 595 | left: auto; |
591 | | -} |
592 | | - |
593 | | -.goButton { |
594 | | - top: 2px; |
| 596 | + top: 0px; |
595 | 597 | border: 0; |
596 | | - background: url(images/s.gif) no-repeat top left; |
| 598 | + background: url(images/s.gif) no-repeat center left; |
597 | 599 | background-size: 27px 25px; |
598 | | - height: 25px; |
| 600 | + height: 40px; |
599 | 601 | width: 27px; |
600 | 602 | padding-bottom: 0; |
601 | 603 | text-indent: -999px; |
| 604 | + cursor: pointer; |
602 | 605 | } |
603 | 606 | |
604 | 607 | html[dir="rtl"] .goButton { |
605 | 608 | right: auto; |
606 | | - left: 2px; |
| 609 | + left: 0; |
607 | 610 | } |
608 | 611 | |
609 | 612 | #searchbox a, |
— | — | @@ -711,44 +714,67 @@ |
712 | 715 | full screen search css |
713 | 716 | */ |
714 | 717 | .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; |
715 | 723 | margin: 0; |
| 724 | + background-color: white; |
716 | 725 | } |
717 | 726 | |
718 | | -.full-screen-search #content, |
| 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 | + |
719 | 748 | .full-screen-search #footer, |
720 | 749 | .full-screen-search #zero-rated-banner-red, |
721 | 750 | .full-screen-search #zero-rated-banner { |
722 | 751 | display: none; |
723 | 752 | } |
724 | 753 | |
725 | | -.full-screen-search #search { |
726 | | - height: 30px; /* height of #sq - 2px border */ |
727 | | - font-size: 1.2em; |
| 754 | +#search::-webkit-search-decoration { |
| 755 | + display: none; |
728 | 756 | } |
729 | 757 | |
730 | | -html[dir="rtl"] .full-screen-search #sq { |
731 | | - padding-left: 0; |
732 | | - padding-right: 44px; |
| 758 | +#header, |
| 759 | +#search, |
| 760 | +#sq, |
| 761 | +form, |
| 762 | +#searchbox { |
| 763 | + position: relative; |
| 764 | + right: 0; |
| 765 | + top: 0; |
| 766 | + left: 0; |
| 767 | + height: 40px; |
733 | 768 | } |
734 | 769 | |
| 770 | +#searchbox { |
| 771 | + margin: 0; |
| 772 | +} |
| 773 | + |
735 | 774 | .full-screen-search #sq { |
736 | | - position: relative; |
737 | | - padding-left: 44px; |
738 | 775 | margin-right: 0; |
739 | 776 | font-size: 16px; |
740 | | - border: none; |
741 | | - background-color: transparent; |
742 | 777 | } |
743 | 778 | |
744 | | -.full-screen-search #searchbox { |
745 | | - position: absolute; |
746 | | - width: 100%; |
747 | | - padding: 0; |
748 | | - top: 0; |
749 | | - left: 0; |
750 | | - border: none; |
751 | | -} |
752 | | - |
753 | 779 | .full-screen-search #logo, |
754 | 780 | .full-screen-search .goButton { |
755 | 781 | display: none; |
— | — | @@ -757,34 +783,32 @@ |
758 | 784 | .full-screen-search #results { |
759 | 785 | left: 0px; |
760 | 786 | width: 100% !important; |
761 | | - min-height: 100%; |
762 | | - border-bottom: none; |
763 | | - border-left: none; |
764 | | - border-right: none; |
765 | | - border-top: 1px solid #A6A6A6; |
| 787 | + max-height: 99999px; |
| 788 | + border: none; |
| 789 | + z-index: 1; |
766 | 790 | background-color: #E6E6E6; |
767 | | - display: block; |
| 791 | + position: relative; |
| 792 | + opacity: 1; |
768 | 793 | } |
769 | 794 | |
770 | 795 | .full-screen-search .suggestions-results { |
771 | | - line-height: 2.6em; |
772 | 796 | padding: 0; |
773 | 797 | position: relative; |
774 | | - border-bottom: solid 1px #999; |
| 798 | + padding-bottom: 20px; |
775 | 799 | font-size: 1.4em; |
776 | 800 | cursor: pointer; |
777 | 801 | margin: 0; |
| 802 | + background-color: white; |
778 | 803 | } |
779 | 804 | |
780 | 805 | .full-screen-search .suggestions-result { |
781 | | - line-height: 2.6em; |
| 806 | + color: #666; |
782 | 807 | border: none; |
783 | | - color: black; |
784 | | - margin: 0; |
785 | | - line-height: 2.6em; |
786 | | - padding: 0.01em 0.25em; |
787 | 808 | position: relative; |
788 | 809 | border-bottom: solid 1px #999999; |
| 810 | + border-bottom: solid 1px #eee; |
| 811 | + padding: 12px 56px; |
| 812 | + font-size: 0.9em; |
789 | 813 | } |
790 | 814 | |
791 | 815 | .full-screen-search .suggestions-result a:visited { |
— | — | @@ -794,16 +818,16 @@ |
795 | 819 | #remove-results { |
796 | 820 | display: none; |
797 | 821 | position: absolute; |
798 | | - width: 40px; |
| 822 | + width: 18px; |
799 | 823 | height: 40px; |
800 | 824 | text-align: center; |
801 | 825 | line-height: 40px; |
802 | | - background: url(images/arrow-left.png) no-repeat scroll 0 0 transparent; |
803 | | - background-position: center center; |
| 826 | + background: url(images/arrow-left-beta.png) no-repeat scroll 0 0 transparent; |
| 827 | + background-position: left center; |
| 828 | + background-size: auto 18px; |
804 | 829 | cursor: pointer; |
805 | | - zoom: 1; |
806 | | - left: -3px; |
807 | | - top: 3px; |
| 830 | + left: 24px; |
| 831 | + top: 6px; /* (#header height - background height) / 2 */ |
808 | 832 | margin: 1px; |
809 | 833 | margin-top: -6px; |
810 | 834 | z-index: 99; |
— | — | @@ -812,27 +836,10 @@ |
813 | 837 | overflow: hidden; |
814 | 838 | } |
815 | 839 | |
816 | | -html[dir="rtl"] #remove-results { |
817 | | - right: 0px; |
818 | | - left: auto; |
819 | | -} |
820 | | - |
821 | | -.full-screen-search #results { |
822 | | - display: block !important; |
823 | | -} |
824 | | - |
825 | 840 | .full-screen-search #remove-results { |
826 | 841 | display: block; |
827 | 842 | } |
828 | 843 | |
829 | | -.full-screen-search .clearlink { |
830 | | - background: url(images/close-button.png?v=1) no-repeat scroll 0 0 transparent; |
831 | | - top: 0px; |
832 | | - right: 0px; |
833 | | - height: 42px; |
834 | | - width: 42px; |
835 | | -} |
836 | | - |
837 | 844 | .full-screen-search #nav { |
838 | 845 | display: none !important; |
839 | 846 | } |
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/stylesheets/operamini.css |
— | — | @@ -31,5 +31,3 @@ |
32 | 32 | span.idx { |
33 | 33 | display: none; |
34 | 34 | } |
35 | | - |
36 | | - |
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.php |
— | — | @@ -103,6 +103,16 @@ |
104 | 104 | $wgMobileUrlTemplate = ''; |
105 | 105 | |
106 | 106 | /** |
| 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 | +/** |
107 | 117 | * URL for script used to disable mobile site |
108 | 118 | * (protocol, host, optional port; path portion) |
109 | 119 | * |
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/FooterTemplate.php |
— | — | @@ -9,14 +9,12 @@ |
10 | 10 | public function getHTML() { |
11 | 11 | |
12 | 12 | $regularSite = $this->data['messages']['mobile-frontend-regular-site']; |
13 | | - $permStopRedirect = $this->data['messages']['mobile-frontend-perm-stop-redirect']; |
14 | 13 | $copyright = $this->data['messages']['mobile-frontend-copyright']; |
15 | 14 | $disableImages = $this->data['messages']['mobile-frontend-disable-images']; |
16 | 15 | $enableImages = $this->data['messages']['mobile-frontend-enable-images']; |
17 | 16 | $leaveFeedback = $this->data['messages']['mobile-frontend-leave-feedback']; |
18 | 17 | |
19 | 18 | $leaveFeedbackURL = $this->data['leaveFeedbackURL']; |
20 | | - $disableMobileSiteURL = $this->data['disableMobileSiteURL']; |
21 | 19 | $viewNormalSiteURL = $this->data['viewNormalSiteURL']; |
22 | 20 | |
23 | 21 | if ( $this->data['disableImages'] == 0 ) { |
— | — | @@ -39,9 +37,6 @@ |
40 | 38 | <div class='nav' id='footmenu'> |
41 | 39 | <div class='mwm-notice'> |
42 | 40 | <a href="{$viewNormalSiteURL}">{$regularSite}</a> | <a href="{$imagesURL}">{$imagesToggle}</a> {$feedbackLink} {$logoutLink} |
43 | | - <div id="perm"> |
44 | | - <a href="{$disableMobileSiteURL}">{$permStopRedirect}</a> |
45 | | - </div> |
46 | 41 | </div> |
47 | 42 | </div> |
48 | 43 | <div id='copyright'>{$copyright}</div> |
Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/SearchTemplate.php |
— | — | @@ -26,10 +26,9 @@ |
27 | 27 | |
28 | 28 | $languageSelection = $this->data['buildLanguageSelection'] . '<br/>'; |
29 | 29 | $languageSelectionText = '<b>' . $this->data['messages']['mobile-frontend-language'] . ':</b><br/>'; |
30 | | - $languageSelectionDiv = '<div id="languageselectionsection">' . $languageSelectionText . $languageSelection . '</div>'; |
| 30 | + $languageSelectionDiv = '<div id="languageselection">' . $languageSelectionText . $languageSelection . '</div>'; |
31 | 31 | |
32 | 32 | $searchWebkitHtml = <<<HTML |
33 | | - {$openSearchResults} |
34 | 33 | <div id='header'> |
35 | 34 | <div id='searchbox' {$logoDisplayNone}> |
36 | 35 | <img width="35" height="22" alt='Logo' id='logo' src='{$this->data['wgMobileFrontendLogo']}' {$logoDisplayNone} /> |
— | — | @@ -48,6 +47,7 @@ |
49 | 48 | <a href="{$randomPageUrl}" id="randomButton" class="button">{$randomButton}</a> |
50 | 49 | </div> |
51 | 50 | </div> |
| 51 | + {$openSearchResults} |
52 | 52 | HTML; |
53 | 53 | return $searchWebkitHtml; |
54 | 54 | } |
Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend |
___________________________________________________________________ |
Modified: svn:mergeinfo |
55 | 55 | Merged /trunk/extensions/MobileFrontend:r113807,113831-113832,113865-113866,113870-113872,113876,113880-113883,113885,113887,113897-113901 |