Remove mediawiki.special.javaScriptTest module
authorTimo Tijhof <krinklemail@gmail.com>
Fri, 18 Dec 2015 22:03:53 +0000 (14:03 -0800)
committerBartosz Dziewoński <matma.rex@gmail.com>
Wed, 23 Dec 2015 19:58:15 +0000 (19:58 +0000)
We're almost ready to drop the non-plain mode of Special:JavaScriptTest
in favour of Special:JavaScript/qunit/plain. There's a few mobile-related
extensions still using the non-karma mode for qunit testing.

However, none of them make use of the Skin selector, which was mainly a debug
thing I added in the initial version. It no longer makes sense since our tests
now enforce an anti-dependency on skin html and other context. Encouraging
testing in multiple skins in the old UI therefore no longer makes sense.

This also fixes one of the most frequent errors in resourceloader logs and gets
rid of an ugly hack in Resources.php that causes a small amount of overhead
in ResourceLoader::__construct().

> MessageBlobStore failed to find skinname-fallback
> MessageBlobStore failed to find skinname-apioutput

Change-Id: Idaacf718703883c6a7e83a17ccd3f41ebdca53d1

includes/specials/SpecialJavaScriptTest.php
resources/Resources.php
resources/src/mediawiki.special/mediawiki.special.javaScriptTest.js [deleted file]

index fbdefea..bb35130 100644 (file)
@@ -106,8 +106,6 @@ class SpecialJavaScriptTest extends SpecialPage {
                        return;
                }
 
-               $out->addModules( 'mediawiki.special.javaScriptTest' );
-
                $method = 'view' . ucfirst( $framework );
                $this->$method();
                $out->setPageTitle( $this->msg(
index c66dcb2..26a5ea5 100644 (file)
@@ -1866,16 +1866,6 @@ return array(
        'mediawiki.special.watchlist' => array(
                'scripts' => 'resources/src/mediawiki.special/mediawiki.special.watchlist.js',
        ),
-       'mediawiki.special.javaScriptTest' => array(
-               'scripts' => 'resources/src/mediawiki.special/mediawiki.special.javaScriptTest.js',
-               'messages' => array_merge( Skin::getSkinNameMessages(), array(
-                       'colon-separator',
-                       'javascripttest-pagetext-skins',
-               ) ),
-               'dependencies' => 'mediawiki.Uri',
-               'position' => 'top',
-               'targets' => array( 'desktop', 'mobile' ),
-       ),
        'mediawiki.special.version' => array(
                'styles' => 'resources/src/mediawiki.special/mediawiki.special.version.css',
        ),
diff --git a/resources/src/mediawiki.special/mediawiki.special.javaScriptTest.js b/resources/src/mediawiki.special/mediawiki.special.javaScriptTest.js
deleted file mode 100644 (file)
index fb74e4e..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*!
- * JavaScript for Special:JavaScriptTest
- */
-( function ( mw, $ ) {
-       $( function () {
-
-               // Create useskin dropdown menu and reload onchange to the selected skin
-               // (only if a framework was found, not on error pages).
-               $( '#mw-javascripttest-summary' ).append( function () {
-
-                       var $html = $( '<p><label for="useskin">'
-                                       + mw.message( 'javascripttest-pagetext-skins' ).escaped()
-                                       + ' '
-                                       + '</label></p>' ),
-                               select = '<select name="useskin" id="useskin">';
-
-                       // Build <select> further
-                       $.each( mw.config.get( 'wgAvailableSkins' ), function ( id ) {
-                               select += '<option value="' + id + '"'
-                                       + ( mw.config.get( 'skin' ) === id ? ' selected="selected"' : '' )
-                                       + '>' + mw.message( 'skinname-' + id ).escaped() + '</option>';
-                       } );
-                       select += '</select>';
-
-                       // Bind onchange event handler and append to form
-                       $html.append(
-                               $( select ).change( function () {
-                                       var url = new mw.Uri();
-                                       location.href = url.extend( { useskin: $( this ).val() } );
-                               } )
-                       );
-
-                       return $html;
-               } );
-       } );
-
-}( mediaWiki, jQuery ) );