Merge "jquery.tipsy: Unbreak the 'live' option for now"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sat, 20 Dec 2014 02:04:17 +0000 (02:04 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 20 Dec 2014 02:04:17 +0000 (02:04 +0000)
RELEASE-NOTES-1.25
includes/EditPage.php
includes/actions/InfoAction.php
includes/libs/MultiHttpClient.php
includes/libs/virtualrest/VirtualRESTServiceClient.php
resources/Resources.php
resources/lib/jquery/jquery.js
resources/src/mediawiki.action/mediawiki.action.edit.js

index e8b1162..1956eb6 100644 (file)
@@ -70,6 +70,7 @@ production.
   this allows for pagination of prefix results. Extensions using this hook
   should implement supporting behavior. Not doing so can result in undefined
   behavior from API clients trying to continue through prefix results.
+* Update jQuery from v1.11.1 to v1.11.2.
 
 ==== External libraries ====
 * MediaWiki now requires certain external libraries to be installed. In the past
@@ -112,6 +113,8 @@ production.
 ** Title::moveTo() was deprecated. Use the MovePage class instead.
 ** Title::isValidMoveOperation() broken down into MovePage::isValidMove()
    and MovePage::checkPermissions().
+* The Special:WhatLinksHere page linked from 'Number of redirects to this page'
+  on action=info about a file page does not list file links anymore.
 
 === Action API changes in 1.25 ===
 * (T67403) XML tag highlighting is now only performed for formats
index c737920..7f5a9c0 100644 (file)
@@ -2118,11 +2118,19 @@ class EditPage {
                $wgOut->addModules( 'mediawiki.action.edit' );
                $wgOut->addModuleStyles( 'mediawiki.action.edit.styles' );
 
-               if ( $wgUser->getOption( 'uselivepreview', false ) ) {
+               if ( $wgUser->getOption( 'showtoolbar' ) ) {
+                       // The addition of default buttons is handled by getEditToolbar() which
+                       // has its own dependency on this module. The call here ensures the module
+                       // is loaded in time (it has position "top") for other modules to register
+                       // buttons (e.g. extensions, gadgets, user scripts).
+                       $wgOut->addModules( 'mediawiki.toolbar' );
+               }
+
+               if ( $wgUser->getOption( 'uselivepreview' ) ) {
                        $wgOut->addModules( 'mediawiki.action.edit.preview' );
                }
 
-               if ( $wgUser->getOption( 'useeditwarning', false ) ) {
+               if ( $wgUser->getOption( 'useeditwarning' ) ) {
                        $wgOut->addModules( 'mediawiki.action.edit.editWarning' );
                }
 
index de51843..686f63d 100644 (file)
@@ -338,7 +338,11 @@ class InfoAction extends FormlessAction {
                                $whatLinksHere,
                                $this->msg( 'pageinfo-redirects-name' )->escaped(),
                                array(),
-                               array( 'hidelinks' => 1, 'hidetrans' => 1 )
+                               array(
+                                       'hidelinks' => 1,
+                                       'hidetrans' => 1,
+                                       'hideimages' => $title->getNamespace() == NS_FILE
+                               )
                        ),
                        $this->msg( 'pageinfo-redirects-value' )
                                ->numParams( count( $title->getRedirectsHere() ) )
index 8c982c4..8ed9ee4 100644 (file)
@@ -83,7 +83,7 @@ class MultiHttpClient {
         *   - reason  : HTTP response reason (empty if there was a serious cURL error)
         *   - headers : <header name/value associative array>
         *   - body    : HTTP response body or resource (if "stream" was set)
-        *   - err     : Any cURL error string
+        *   - error     : Any cURL error string
         * The map also stores integer-indexed copies of these values. This lets callers do:
         *      <code>
         *              list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $http->run( $req );
@@ -107,7 +107,7 @@ class MultiHttpClient {
         *   - reason  : HTTP response reason (empty if there was a serious cURL error)
         *   - headers : <header name/value associative array>
         *   - body    : HTTP response body or resource (if "stream" was set)
-        *   - err     : Any cURL error string
+        *   - error   : Any cURL error string
         * The map also stores integer-indexed copies of these values. This lets callers do:
         *      <code>
         *              list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $req['response'];
index 2275831..6f416f1 100644 (file)
@@ -125,7 +125,7 @@ class VirtualRESTServiceClient {
         *   - reason  : HTTP response reason (empty if there was a serious cURL error)
         *   - headers : <header name/value associative array>
         *   - body    : HTTP response body or resource (if "stream" was set)
-        *   - err     : Any cURL error string
+        *   - error   : Any cURL error string
         * The map also stores integer-indexed copies of these values. This lets callers do:
         *      <code>
         *              list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $client->run( $req );
@@ -146,7 +146,7 @@ class VirtualRESTServiceClient {
         *   - reason  : HTTP response reason (empty if there was a serious cURL error)
         *   - headers : <header name/value associative array>
         *   - body    : HTTP response body or resource (if "stream" was set)
-        *   - err     : Any cURL error string
+        *   - error   : Any cURL error string
         * The map also stores integer-indexed copies of these values. This lets callers do:
         *      <code>
         *              list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $responses[0];
index e5332df..ccb842d 100644 (file)
@@ -1011,6 +1011,7 @@ return array(
                'class' => 'ResourceLoaderEditToolbarModule',
                'scripts' => 'resources/src/mediawiki.toolbar/toolbar.js',
                'styles' => 'resources/src/mediawiki.toolbar/toolbar.less',
+               'position' => 'top',
        ),
 
        /* MediaWiki Action */
@@ -1020,7 +1021,6 @@ return array(
                'styles' => 'resources/src/mediawiki.action/mediawiki.action.edit.css',
                'dependencies' => array(
                        'mediawiki.action.edit.styles',
-                       'mediawiki.toolbar',
                        'jquery.textSelection',
                        'jquery.byteLimit',
                ),
index d4b67f7..1c3aa82 100644 (file)
@@ -1,5 +1,5 @@
 /*!
- * jQuery JavaScript Library v1.11.1
+ * jQuery JavaScript Library v1.11.2
  * http://jquery.com/
  *
  * Includes Sizzle.js
@@ -9,7 +9,7 @@
  * Released under the MIT license
  * http://jquery.org/license
  *
- * Date: 2014-05-01T17:42Z
+ * Date: 2014-12-17T15:27Z
  */
 
 (function( global, factory ) {
@@ -64,7 +64,7 @@ var support = {};
 
 
 var
-       version = "1.11.1",
+       version = "1.11.2",
 
        // Define a local copy of jQuery
        jQuery = function( selector, context ) {
@@ -269,7 +269,8 @@ jQuery.extend({
                // parseFloat NaNs numeric-cast false positives (null|true|false|"")
                // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
                // subtraction forces infinities to NaN
-               return !jQuery.isArray( obj ) && obj - parseFloat( obj ) >= 0;
+               // adding 1 corrects loss of precision from parseFloat (#15100)
+               return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0;
        },
 
        isEmptyObject: function( obj ) {
@@ -584,14 +585,14 @@ function isArraylike( obj ) {
 }
 var Sizzle =
 /*!
- * Sizzle CSS Selector Engine v1.10.19
+ * Sizzle CSS Selector Engine v2.2.0-pre
  * http://sizzlejs.com/
  *
- * Copyright 2013 jQuery Foundation, Inc. and other contributors
+ * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors
  * Released under the MIT license
  * http://jquery.org/license
  *
- * Date: 2014-04-18
+ * Date: 2014-12-16
  */
 (function( window ) {
 
@@ -618,7 +619,7 @@ var i,
        contains,
 
        // Instance-specific data
-       expando = "sizzle" + -(new Date()),
+       expando = "sizzle" + 1 * new Date(),
        preferredDoc = window.document,
        dirruns = 0,
        done = 0,
@@ -633,7 +634,6 @@ var i,
        },
 
        // General-purpose constants
-       strundefined = typeof undefined,
        MAX_NEGATIVE = 1 << 31,
 
        // Instance methods
@@ -643,12 +643,13 @@ var i,
        push_native = arr.push,
        push = arr.push,
        slice = arr.slice,
-       // Use a stripped-down indexOf if we can't use a native one
-       indexOf = arr.indexOf || function( elem ) {
+       // Use a stripped-down indexOf as it's faster than native
+       // http://jsperf.com/thor-indexof-vs-for/5
+       indexOf = function( list, elem ) {
                var i = 0,
-                       len = this.length;
+                       len = list.length;
                for ( ; i < len; i++ ) {
-                       if ( this[i] === elem ) {
+                       if ( list[i] === elem ) {
                                return i;
                        }
                }
@@ -688,6 +689,7 @@ var i,
                ")\\)|)",
 
        // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
+       rwhitespace = new RegExp( whitespace + "+", "g" ),
        rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
 
        rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
@@ -739,6 +741,14 @@ var i,
                                String.fromCharCode( high + 0x10000 ) :
                                // Supplemental Plane codepoint (surrogate pair)
                                String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
+       },
+
+       // Used for iframes
+       // See setDocument()
+       // Removing the function wrapper causes a "Permission Denied"
+       // error in IE
+       unloadHandler = function() {
+               setDocument();
        };
 
 // Optimize for push.apply( _, NodeList )
@@ -781,19 +791,18 @@ function Sizzle( selector, context, results, seed ) {
 
        context = context || document;
        results = results || [];
+       nodeType = context.nodeType;
 
-       if ( !selector || typeof selector !== "string" ) {
-               return results;
-       }
+       if ( typeof selector !== "string" || !selector ||
+               nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
 
-       if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
-               return [];
+               return results;
        }
 
-       if ( documentIsHTML && !seed ) {
+       if ( !seed && documentIsHTML ) {
 
-               // Shortcuts
-               if ( (match = rquickExpr.exec( selector )) ) {
+               // Try to shortcut find operations when possible (e.g., not under DocumentFragment)
+               if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
                        // Speed-up: Sizzle("#ID")
                        if ( (m = match[1]) ) {
                                if ( nodeType === 9 ) {
@@ -825,7 +834,7 @@ function Sizzle( selector, context, results, seed ) {
                                return results;
 
                        // Speed-up: Sizzle(".CLASS")
-                       } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) {
+                       } else if ( (m = match[3]) && support.getElementsByClassName ) {
                                push.apply( results, context.getElementsByClassName( m ) );
                                return results;
                        }
@@ -835,7 +844,7 @@ function Sizzle( selector, context, results, seed ) {
                if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
                        nid = old = expando;
                        newContext = context;
-                       newSelector = nodeType === 9 && selector;
+                       newSelector = nodeType !== 1 && selector;
 
                        // qSA works strangely on Element-rooted queries
                        // We can work around this by specifying an extra ID on the root
@@ -1022,7 +1031,7 @@ function createPositionalPseudo( fn ) {
  * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
  */
 function testContext( context ) {
-       return context && typeof context.getElementsByTagName !== strundefined && context;
+       return context && typeof context.getElementsByTagName !== "undefined" && context;
 }
 
 // Expose support vars for convenience
@@ -1046,9 +1055,8 @@ isXML = Sizzle.isXML = function( elem ) {
  * @returns {Object} Returns the current document
  */
 setDocument = Sizzle.setDocument = function( node ) {
-       var hasCompare,
-               doc = node ? node.ownerDocument || node : preferredDoc,
-               parent = doc.defaultView;
+       var hasCompare, parent,
+               doc = node ? node.ownerDocument || node : preferredDoc;
 
        // If no document and documentElement is available, return
        if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
@@ -1058,9 +1066,7 @@ setDocument = Sizzle.setDocument = function( node ) {
        // Set our document
        document = doc;
        docElem = doc.documentElement;
-
-       // Support tests
-       documentIsHTML = !isXML( doc );
+       parent = doc.defaultView;
 
        // Support: IE>8
        // If iframe document is assigned to "document" variable and if iframe has been reloaded,
@@ -1069,21 +1075,22 @@ setDocument = Sizzle.setDocument = function( node ) {
        if ( parent && parent !== parent.top ) {
                // IE11 does not have attachEvent, so all must suffer
                if ( parent.addEventListener ) {
-                       parent.addEventListener( "unload", function() {
-                               setDocument();
-                       }, false );
+                       parent.addEventListener( "unload", unloadHandler, false );
                } else if ( parent.attachEvent ) {
-                       parent.attachEvent( "onunload", function() {
-                               setDocument();
-                       });
+                       parent.attachEvent( "onunload", unloadHandler );
                }
        }
 
+       /* Support tests
+       ---------------------------------------------------------------------- */
+       documentIsHTML = !isXML( doc );
+
        /* Attributes
        ---------------------------------------------------------------------- */
 
        // Support: IE<8
-       // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans)
+       // Verify that getAttribute really returns attributes and not properties
+       // (excepting IE8 booleans)
        support.attributes = assert(function( div ) {
                div.className = "i";
                return !div.getAttribute("className");
@@ -1098,17 +1105,8 @@ setDocument = Sizzle.setDocument = function( node ) {
                return !div.getElementsByTagName("*").length;
        });
 
-       // Check if getElementsByClassName can be trusted
-       support.getElementsByClassName = rnative.test( doc.getElementsByClassName ) && assert(function( div ) {
-               div.innerHTML = "<div class='a'></div><div class='a i'></div>";
-
-               // Support: Safari<4
-               // Catch class over-caching
-               div.firstChild.className = "i";
-               // Support: Opera<10
-               // Catch gEBCN failure to find non-leading classes
-               return div.getElementsByClassName("i").length === 2;
-       });
+       // Support: IE<9
+       support.getElementsByClassName = rnative.test( doc.getElementsByClassName );
 
        // Support: IE<10
        // Check if getElementById returns elements by name
@@ -1122,7 +1120,7 @@ setDocument = Sizzle.setDocument = function( node ) {
        // ID find and filter
        if ( support.getById ) {
                Expr.find["ID"] = function( id, context ) {
-                       if ( typeof context.getElementById !== strundefined && documentIsHTML ) {
+                       if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
                                var m = context.getElementById( id );
                                // Check parentNode to catch when Blackberry 4.6 returns
                                // nodes that are no longer in the document #6963
@@ -1143,7 +1141,7 @@ setDocument = Sizzle.setDocument = function( node ) {
                Expr.filter["ID"] =  function( id ) {
                        var attrId = id.replace( runescape, funescape );
                        return function( elem ) {
-                               var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
+                               var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
                                return node && node.value === attrId;
                        };
                };
@@ -1152,14 +1150,20 @@ setDocument = Sizzle.setDocument = function( node ) {
        // Tag
        Expr.find["TAG"] = support.getElementsByTagName ?
                function( tag, context ) {
-                       if ( typeof context.getElementsByTagName !== strundefined ) {
+                       if ( typeof context.getElementsByTagName !== "undefined" ) {
                                return context.getElementsByTagName( tag );
+
+                       // DocumentFragment nodes don't have gEBTN
+                       } else if ( support.qsa ) {
+                               return context.querySelectorAll( tag );
                        }
                } :
+
                function( tag, context ) {
                        var elem,
                                tmp = [],
                                i = 0,
+                               // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
                                results = context.getElementsByTagName( tag );
 
                        // Filter out possible comments
@@ -1177,7 +1181,7 @@ setDocument = Sizzle.setDocument = function( node ) {
 
        // Class
        Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
-               if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) {
+               if ( documentIsHTML ) {
                        return context.getElementsByClassName( className );
                }
        };
@@ -1206,13 +1210,15 @@ setDocument = Sizzle.setDocument = function( node ) {
                        // setting a boolean content attribute,
                        // since its presence should be enough
                        // http://bugs.jquery.com/ticket/12359
-                       div.innerHTML = "<select msallowclip=''><option selected=''></option></select>";
+                       docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" +
+                               "<select id='" + expando + "-\f]' msallowcapture=''>" +
+                               "<option selected=''></option></select>";
 
                        // Support: IE8, Opera 11-12.16
                        // Nothing should be selected when empty strings follow ^= or $= or *=
                        // The test attribute must be unknown in Opera but "safe" for WinRT
                        // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
-                       if ( div.querySelectorAll("[msallowclip^='']").length ) {
+                       if ( div.querySelectorAll("[msallowcapture^='']").length ) {
                                rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
                        }
 
@@ -1222,12 +1228,24 @@ setDocument = Sizzle.setDocument = function( node ) {
                                rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
                        }
 
+                       // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+
+                       if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
+                               rbuggyQSA.push("~=");
+                       }
+
                        // Webkit/Opera - :checked should return selected option elements
                        // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
                        // IE8 throws error here and will not see later tests
                        if ( !div.querySelectorAll(":checked").length ) {
                                rbuggyQSA.push(":checked");
                        }
+
+                       // Support: Safari 8+, iOS 8+
+                       // https://bugs.webkit.org/show_bug.cgi?id=136851
+                       // In-page `selector#id sibing-combinator selector` fails
+                       if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) {
+                               rbuggyQSA.push(".#.+[+~]");
+                       }
                });
 
                assert(function( div ) {
@@ -1344,7 +1362,7 @@ setDocument = Sizzle.setDocument = function( node ) {
 
                        // Maintain original order
                        return sortInput ?
-                               ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
+                               ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
                                0;
                }
 
@@ -1371,7 +1389,7 @@ setDocument = Sizzle.setDocument = function( node ) {
                                aup ? -1 :
                                bup ? 1 :
                                sortInput ?
-                               ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
+                               ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
                                0;
 
                // If the nodes are siblings, we can do a quick check
@@ -1434,7 +1452,7 @@ Sizzle.matchesSelector = function( elem, expr ) {
                                        elem.document && elem.document.nodeType !== 11 ) {
                                return ret;
                        }
-               } catch(e) {}
+               } catch (e) {}
        }
 
        return Sizzle( expr, document, null, [ elem ] ).length > 0;
@@ -1653,7 +1671,7 @@ Expr = Sizzle.selectors = {
                        return pattern ||
                                (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
                                classCache( className, function( elem ) {
-                                       return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" );
+                                       return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
                                });
                },
 
@@ -1675,7 +1693,7 @@ Expr = Sizzle.selectors = {
                                        operator === "^=" ? check && result.indexOf( check ) === 0 :
                                        operator === "*=" ? check && result.indexOf( check ) > -1 :
                                        operator === "$=" ? check && result.slice( -check.length ) === check :
-                                       operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
+                                       operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
                                        operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
                                        false;
                        };
@@ -1795,7 +1813,7 @@ Expr = Sizzle.selectors = {
                                                        matched = fn( seed, argument ),
                                                        i = matched.length;
                                                while ( i-- ) {
-                                                       idx = indexOf.call( seed, matched[i] );
+                                                       idx = indexOf( seed, matched[i] );
                                                        seed[ idx ] = !( matches[ idx ] = matched[i] );
                                                }
                                        }) :
@@ -1834,6 +1852,8 @@ Expr = Sizzle.selectors = {
                                function( elem, context, xml ) {
                                        input[0] = elem;
                                        matcher( input, null, xml, results );
+                                       // Don't keep the element (issue #299)
+                                       input[0] = null;
                                        return !results.pop();
                                };
                }),
@@ -1845,6 +1865,7 @@ Expr = Sizzle.selectors = {
                }),
 
                "contains": markFunction(function( text ) {
+                       text = text.replace( runescape, funescape );
                        return function( elem ) {
                                return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
                        };
@@ -2266,7 +2287,7 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS
                                i = matcherOut.length;
                                while ( i-- ) {
                                        if ( (elem = matcherOut[i]) &&
-                                               (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
+                                               (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
 
                                                seed[temp] = !(results[temp] = elem);
                                        }
@@ -2301,13 +2322,16 @@ function matcherFromTokens( tokens ) {
                        return elem === checkContext;
                }, implicitRelative, true ),
                matchAnyContext = addCombinator( function( elem ) {
-                       return indexOf.call( checkContext, elem ) > -1;
+                       return indexOf( checkContext, elem ) > -1;
                }, implicitRelative, true ),
                matchers = [ function( elem, context, xml ) {
-                       return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
+                       var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
                                (checkContext = context).nodeType ?
                                        matchContext( elem, context, xml ) :
                                        matchAnyContext( elem, context, xml ) );
+                       // Avoid hanging onto element (issue #299)
+                       checkContext = null;
+                       return ret;
                } ];
 
        for ( ; i < len; i++ ) {
@@ -2557,7 +2581,7 @@ select = Sizzle.select = function( selector, context, results, seed ) {
 // Sort stability
 support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
 
-// Support: Chrome<14
+// Support: Chrome 14-35+
 // Always assume duplicates if they aren't passed to the comparison function
 support.detectDuplicates = !!hasDuplicate;
 
@@ -6115,7 +6139,14 @@ var getStyles, curCSS,
 
 if ( window.getComputedStyle ) {
        getStyles = function( elem ) {
-               return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
+               // Support: IE<=11+, Firefox<=30+ (#15098, #14150)
+               // IE throws on elements created in popups
+               // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
+               if ( elem.ownerDocument.defaultView.opener ) {
+                       return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
+               }
+
+               return window.getComputedStyle( elem, null );
        };
 
        curCSS = function( elem, name, computed ) {
@@ -6363,6 +6394,8 @@ function addGetHookIf( conditionFn, hookFn ) {
 
                        reliableMarginRightVal =
                                !parseFloat( ( window.getComputedStyle( contents, null ) || {} ).marginRight );
+
+                       div.removeChild( contents );
                }
 
                // Support: IE8
@@ -9070,7 +9103,8 @@ jQuery.extend({
                }
 
                // We can fire global events as of now if asked to
-               fireGlobals = s.global;
+               // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
+               fireGlobals = jQuery.event && s.global;
 
                // Watch for a new set of requests
                if ( fireGlobals && jQuery.active++ === 0 ) {
@@ -9329,13 +9363,6 @@ jQuery.each( [ "get", "post" ], function( i, method ) {
        };
 });
 
-// Attach a bunch of functions for handling common AJAX events
-jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
-       jQuery.fn[ type ] = function( fn ) {
-               return this.on( type, fn );
-       };
-});
-
 
 jQuery._evalUrl = function( url ) {
        return jQuery.ajax({
@@ -9561,8 +9588,9 @@ var xhrId = 0,
 
 // Support: IE<10
 // Open requests must be manually aborted on unload (#5280)
-if ( window.ActiveXObject ) {
-       jQuery( window ).on( "unload", function() {
+// See https://support.microsoft.com/kb/2856746 for more info
+if ( window.attachEvent ) {
+       window.attachEvent( "onunload", function() {
                for ( var key in xhrCallbacks ) {
                        xhrCallbacks[ key ]( undefined, true );
                }
@@ -9996,6 +10024,16 @@ jQuery.fn.load = function( url, params, callback ) {
 
 
 
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
+       jQuery.fn[ type ] = function( fn ) {
+               return this.on( type, fn );
+       };
+});
+
+
+
+
 jQuery.expr.filters.animated = function( elem ) {
        return jQuery.grep(jQuery.timers, function( fn ) {
                return elem === fn.elem;
index f88b836..01a25f3 100644 (file)
@@ -1,27 +1,23 @@
 /*!
- * Scripts for action=edit
+ * Scripts for action=edit at domready
  */
-( function ( mw, $ ) {
+jQuery( function ( $ ) {
+       var editBox, scrollTop, $editForm;
 
-       $( function () {
-               var editBox, scrollTop, $editForm;
+       // Make sure edit summary does not exceed byte limit
+       $( '#wpSummary' ).byteLimit( 255 );
 
-               // Make sure edit summary does not exceed byte limit
-               $( '#wpSummary' ).byteLimit( 255 );
-
-               // Restore the edit box scroll state following a preview operation,
-               // and set up a form submission handler to remember this state.
-               editBox = document.getElementById( 'wpTextbox1' );
-               scrollTop = document.getElementById( 'wpScrolltop' );
-               $editForm = $( '#editform' );
-               if ( $editForm.length && editBox && scrollTop ) {
-                       if ( scrollTop.value ) {
-                               editBox.scrollTop = scrollTop.value;
-                       }
-                       $editForm.submit( function () {
-                               scrollTop.value = editBox.scrollTop;
-                       } );
+       // Restore the edit box scroll state following a preview operation,
+       // and set up a form submission handler to remember this state.
+       editBox = document.getElementById( 'wpTextbox1' );
+       scrollTop = document.getElementById( 'wpScrolltop' );
+       $editForm = $( '#editform' );
+       if ( $editForm.length && editBox && scrollTop ) {
+               if ( scrollTop.value ) {
+                       editBox.scrollTop = scrollTop.value;
                }
-       } );
-
-}( mediaWiki, jQuery ) );
+               $editForm.submit( function () {
+                       scrollTop.value = editBox.scrollTop;
+               } );
+       }
+} );