MaxSem has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/55385


Change subject: Kill supportsJavaScript()
......................................................................

Kill supportsJavaScript()

It's irrelevant now, we need to know whether jQuery is supported.

Change-Id: If0062e0e8864374ce70da430baf7c6d7e125037a
---
M includes/DeviceDetection.php
M includes/skins/SkinMobile.php
M tests/DeviceDetectionTest.php
3 files changed, 8 insertions(+), 45 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/85/55385/1

diff --git a/includes/DeviceDetection.php b/includes/DeviceDetection.php
index f3da712..434fe7a 100644
--- a/includes/DeviceDetection.php
+++ b/includes/DeviceDetection.php
@@ -35,11 +35,6 @@
        /**
         * @return bool
         */
-       function supportsJavaScript();
-
-       /**
-        * @return bool
-        */
        function supportsJQuery();
 
        /**
@@ -98,13 +93,6 @@
         */
        public function format() {
                return $this->device['view_format'];
-       }
-
-       /**
-        * @return bool
-        */
-       public function supportsJavaScript() {
-               return $this->device['supports_javascript'];
        }
 
        /**
@@ -226,154 +214,132 @@
                        'html' => array (
                                'view_format' => 'html',
                                'css_file_name' => '',
-                               'supports_javascript' => false,
                                'supports_jquery' => false,
                                'disable_zoom' => true,
                        ),
                        'capable' => array (
                                'view_format' => 'html',
                                'css_file_name' => '',
-                               'supports_javascript' => true,
                                'supports_jquery' => true,
                                'disable_zoom' => true,
                        ),
                        'webkit' => array (
                                'view_format' => 'html',
                                'css_file_name' => '',
-                               'supports_javascript' => true,
                                'supports_jquery' => true,
                                'disable_zoom' => false,
                        ),
                        'ie' => array (
                                'view_format' => 'html',
                                'css_file_name' => 'ie',
-                               'supports_javascript' => true,
                                'supports_jquery' => true,
                                'disable_zoom' => false,
                        ),
                        'android' => array (
                                'view_format' => 'html',
                                'css_file_name' => '',
-                               'supports_javascript' => true,
                                'supports_jquery' => true,
                                'disable_zoom' => false,
                        ),
                        'iphone' => array (
                                'view_format' => 'html',
                                'css_file_name' => 'iphone',
-                               'supports_javascript' => true,
                                'supports_jquery' => true,
                                'disable_zoom' => false,
                        ),
                        'iphone2' => array (
                                'view_format' => 'html',
                                'css_file_name' => '',
-                               'supports_javascript' => true,
                                'supports_jquery' => true,
                                'disable_zoom' => true,
                        ),
                        'native_iphone' => array (
                                'view_format' => 'html',
                                'css_file_name' => '',
-                               'supports_javascript' => true,
                                'supports_jquery' => true,
                                'disable_zoom' => false,
                        ),
                        'palm_pre' => array (
                                'view_format' => 'html',
                                'css_file_name' => '',
-                               'supports_javascript' => true,
                                'supports_jquery' => false,
                                'disable_zoom' => true,
                        ),
                        'kindle' => array (
                                'view_format' => 'html',
                                'css_file_name' => 'kindle',
-                               'supports_javascript' => false,
                                'supports_jquery' => false,
                                'disable_zoom' => true,
                        ),
                        'kindle2' => array (
                                'view_format' => 'html',
                                'css_file_name' => 'kindle',
-                               'supports_javascript' => false,
                                'supports_jquery' => false,
                                'disable_zoom' => true,
                        ),
                        'blackberry' => array (
                                'view_format' => 'html',
                                'css_file_name' => 'blackberry',
-                               'supports_javascript' => true,
                                'supports_jquery' => false,
                                'disable_zoom' => true,
                        ),
                        'blackberry-lt5' => array (
                                'view_format' => 'html',
                                'css_file_name' => 'blackberry',
-                               'supports_javascript' => false,
                                'supports_jquery' => false,
                                'disable_zoom' => true,
                        ),
                        'netfront' => array (
                                'view_format' => 'html',
                                'css_file_name' => 'simple',
-                               'supports_javascript' => false,
                                'supports_jquery' => false,
                                'disable_zoom' => true,
                        ),
                        'wap2' => array (
                                'view_format' => 'html',
                                'css_file_name' => 'simple',
-                               'supports_javascript' => false,
                                'supports_jquery' => false,
                                'disable_zoom' => true,
                        ),
                        'psp' => array (
                                'view_format' => 'html',
                                'css_file_name' => 'psp',
-                               'supports_javascript' => false,
                                'supports_jquery' => false,
                                'disable_zoom' => true,
                        ),
                        'ps3' => array (
                                'view_format' => 'html',
                                'css_file_name' => 'simple',
-                               'supports_javascript' => false,
                                'supports_jquery' => false,
                                'disable_zoom' => true,
                        ),
                        'wii' => array (
                                'view_format' => 'html',
                                'css_file_name' => 'wii',
-                               'supports_javascript' => true,
                                'supports_jquery' => true,
                                'disable_zoom' => true,
                        ),
                        'operamini' => array (
                                'view_format' => 'html',
                                'css_file_name' => 'operamini',
-                               'supports_javascript' => false,
                                'supports_jquery' => false,
                                'disable_zoom' => true,
                        ),
                        'operamobile' => array (
                                'view_format' => 'html',
                                'css_file_name' => 'operamobile',
-                               'supports_javascript' => true,
                                'supports_jquery' => true,
                                'disable_zoom' => true,
                        ),
                        'nokia' => array (
                                'view_format' => 'html',
                                'css_file_name' => 'nokia',
-                               'supports_javascript' => true,
                                'supports_jquery' => false,
                                'disable_zoom' => true,
                        ),
                        'wml' => array (
                                'view_format' => 'wml',
                                'css_file_name' => '',
-                               'supports_javascript' => false,
                                'supports_jquery' => false,
                                'disable_zoom' => true,
                        ),
@@ -416,7 +382,6 @@
                        return new DeviceProperties( array(
                                'view_format' => 'html',
                                'css_file_name' => '',
-                               'supports_javascript' => true,
                                'supports_jquery' => true,
                                'disable_zoom' => true,
                        ), $userAgent );
diff --git a/includes/skins/SkinMobile.php b/includes/skins/SkinMobile.php
index f0cb96d..6686848 100644
--- a/includes/skins/SkinMobile.php
+++ b/includes/skins/SkinMobile.php
@@ -229,7 +229,6 @@
        protected function attachResources( Title $title, QuickTemplate $tpl, 
IDeviceProperties $device ) {
                global $wgResourceModules;
 
-               // TODO: deprecate supportsjQuery usage in favour of 
supportsJavascript
                $rlSupport = $device->supportsJQuery();
                $out = $this->getOutput();
                $context = MobileContext::singleton();
diff --git a/tests/DeviceDetectionTest.php b/tests/DeviceDetectionTest.php
index ebd504d..a6191cf 100644
--- a/tests/DeviceDetectionTest.php
+++ b/tests/DeviceDetectionTest.php
@@ -56,22 +56,21 @@
        /**
         * @dataProvider provideTestDeviceCapabilities
         */
-       public function testDeviceCapabilities( $format, $js, $jquery ) {
+       public function testDeviceCapabilities( $format, $jquery ) {
                $detector = new DeviceDetection();
                $device = $detector->getDeviceProperties( $format, '' );
-               $this->assertEquals( $device->supportsJavaScript(), $js );
                $this->assertEquals( $device->supportsJQuery(), $jquery );
        }
 
        public function provideTestDeviceCapabilities() {
                return array(
-                       array( 'webkit', true, true ),
-                       array( 'capable', true, true ),
-                       array( 'ie', true, true ),
-                       array( 'nokia', true, false ),
-                       array( 'blackberry', true, false ),
-                       array( 'blackberry-lt5', false, false ),
-                       array( 'html', false, false ),
+                       array( 'webkit', true ),
+                       array( 'capable', true ),
+                       array( 'ie', true ),
+                       array( 'nokia', false ),
+                       array( 'blackberry', false ),
+                       array( 'blackberry-lt5', false ),
+                       array( 'html', false ),
                );
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/55385
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If0062e0e8864374ce70da430baf7c6d7e125037a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to