From c1f9b1f7b1b77776192048005dcc66dcf3df2bfb Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 27 Dec 2014 15:41:37 +0100 Subject: Update to MediaWiki 1.24.1 --- resources/mediawiki/images/arrow-collapsed-ltr.png | Bin 133 -> 0 bytes resources/mediawiki/images/arrow-collapsed-rtl.png | Bin 136 -> 0 bytes resources/mediawiki/images/arrow-expanded.png | Bin 134 -> 0 bytes resources/mediawiki/mediawiki.Title.js | 587 ------ resources/mediawiki/mediawiki.Uri.js | 334 ---- resources/mediawiki/mediawiki.debug.css | 183 -- resources/mediawiki/mediawiki.debug.init.js | 3 - resources/mediawiki/mediawiki.debug.js | 365 ---- resources/mediawiki/mediawiki.feedback.css | 9 - resources/mediawiki/mediawiki.feedback.js | 279 --- resources/mediawiki/mediawiki.feedback.spinner.gif | Bin 1108 -> 0 bytes resources/mediawiki/mediawiki.hidpi.js | 5 - resources/mediawiki/mediawiki.htmlform.js | 128 -- resources/mediawiki/mediawiki.icon.css | 15 - resources/mediawiki/mediawiki.inspect.js | 204 --- resources/mediawiki/mediawiki.jqueryMsg.js | 1148 ------------ resources/mediawiki/mediawiki.jqueryMsg.peg | 81 - resources/mediawiki/mediawiki.js | 1938 -------------------- resources/mediawiki/mediawiki.log.js | 126 -- resources/mediawiki/mediawiki.notification.css | 36 - resources/mediawiki/mediawiki.notification.js | 504 ----- resources/mediawiki/mediawiki.notify.js | 28 - resources/mediawiki/mediawiki.searchSuggest.css | 16 - resources/mediawiki/mediawiki.searchSuggest.js | 218 --- resources/mediawiki/mediawiki.user.js | 255 --- resources/mediawiki/mediawiki.util.js | 624 ------- 26 files changed, 7086 deletions(-) delete mode 100644 resources/mediawiki/images/arrow-collapsed-ltr.png delete mode 100644 resources/mediawiki/images/arrow-collapsed-rtl.png delete mode 100644 resources/mediawiki/images/arrow-expanded.png delete mode 100644 resources/mediawiki/mediawiki.Title.js delete mode 100644 resources/mediawiki/mediawiki.Uri.js delete mode 100644 resources/mediawiki/mediawiki.debug.css delete mode 100644 resources/mediawiki/mediawiki.debug.init.js delete mode 100644 resources/mediawiki/mediawiki.debug.js delete mode 100644 resources/mediawiki/mediawiki.feedback.css delete mode 100644 resources/mediawiki/mediawiki.feedback.js delete mode 100644 resources/mediawiki/mediawiki.feedback.spinner.gif delete mode 100644 resources/mediawiki/mediawiki.hidpi.js delete mode 100644 resources/mediawiki/mediawiki.htmlform.js delete mode 100644 resources/mediawiki/mediawiki.icon.css delete mode 100644 resources/mediawiki/mediawiki.inspect.js delete mode 100644 resources/mediawiki/mediawiki.jqueryMsg.js delete mode 100644 resources/mediawiki/mediawiki.jqueryMsg.peg delete mode 100644 resources/mediawiki/mediawiki.js delete mode 100644 resources/mediawiki/mediawiki.log.js delete mode 100644 resources/mediawiki/mediawiki.notification.css delete mode 100644 resources/mediawiki/mediawiki.notification.js delete mode 100644 resources/mediawiki/mediawiki.notify.js delete mode 100644 resources/mediawiki/mediawiki.searchSuggest.css delete mode 100644 resources/mediawiki/mediawiki.searchSuggest.js delete mode 100644 resources/mediawiki/mediawiki.user.js delete mode 100644 resources/mediawiki/mediawiki.util.js (limited to 'resources/mediawiki') diff --git a/resources/mediawiki/images/arrow-collapsed-ltr.png b/resources/mediawiki/images/arrow-collapsed-ltr.png deleted file mode 100644 index b17e578b..00000000 Binary files a/resources/mediawiki/images/arrow-collapsed-ltr.png and /dev/null differ diff --git a/resources/mediawiki/images/arrow-collapsed-rtl.png b/resources/mediawiki/images/arrow-collapsed-rtl.png deleted file mode 100644 index a834548e..00000000 Binary files a/resources/mediawiki/images/arrow-collapsed-rtl.png and /dev/null differ diff --git a/resources/mediawiki/images/arrow-expanded.png b/resources/mediawiki/images/arrow-expanded.png deleted file mode 100644 index 2bec798e..00000000 Binary files a/resources/mediawiki/images/arrow-expanded.png and /dev/null differ diff --git a/resources/mediawiki/mediawiki.Title.js b/resources/mediawiki/mediawiki.Title.js deleted file mode 100644 index 5038c515..00000000 --- a/resources/mediawiki/mediawiki.Title.js +++ /dev/null @@ -1,587 +0,0 @@ -/*! - * @author Neil Kandalgaonkar, 2010 - * @author Timo Tijhof, 2011-2013 - * @since 1.18 - */ -( function ( mw, $ ) { - - /** - * @class mw.Title - * - * Parse titles into an object struture. Note that when using the constructor - * directly, passing invalid titles will result in an exception. Use #newFromText to use the - * logic directly and get null for invalid titles which is easier to work with. - * - * @constructor - * @param {string} title Title of the page. If no second argument given, - * this will be searched for a namespace - * @param {number} [namespace=NS_MAIN] If given, will used as default namespace for the given title - * @throws {Error} When the title is invalid - */ - function Title( title, namespace ) { - var parsed = parse( title, namespace ); - if ( !parsed ) { - throw new Error( 'Unable to parse title' ); - } - - this.namespace = parsed.namespace; - this.title = parsed.title; - this.ext = parsed.ext; - this.fragment = parsed.fragment; - - return this; - } - - /* Private members */ - - var - - /** - * @private - * @static - * @property NS_MAIN - */ - NS_MAIN = 0, - - /** - * @private - * @static - * @property NS_TALK - */ - NS_TALK = 1, - - /** - * @private - * @static - * @property NS_SPECIAL - */ - NS_SPECIAL = -1, - - /** - * Get the namespace id from a namespace name (either from the localized, canonical or alias - * name). - * - * Example: On a German wiki this would return 6 for any of 'File', 'Datei', 'Image' or - * even 'Bild'. - * - * @private - * @static - * @method getNsIdByName - * @param {string} ns Namespace name (case insensitive, leading/trailing space ignored) - * @return {number|boolean} Namespace id or boolean false - */ - getNsIdByName = function ( ns ) { - var id; - - // Don't cast non-strings to strings, because null or undefined should not result in - // returning the id of a potential namespace called "Null:" (e.g. on null.example.org/wiki) - // Also, toLowerCase throws exception on null/undefined, because it is a String method. - if ( typeof ns !== 'string' ) { - return false; - } - ns = ns.toLowerCase(); - id = mw.config.get( 'wgNamespaceIds' )[ns]; - if ( id === undefined ) { - return false; - } - return id; - }, - - rUnderscoreTrim = /^_+|_+$/g, - - rSplit = /^(.+?)_*:_*(.*)$/, - - // See Title.php#getTitleInvalidRegex - rInvalid = new RegExp( - '[^' + mw.config.get( 'wgLegalTitleChars' ) + ']' + - // URL percent encoding sequences interfere with the ability - // to round-trip titles -- you can't link to them consistently. - '|%[0-9A-Fa-f]{2}' + - // XML/HTML character references produce similar issues. - '|&[A-Za-z0-9\u0080-\uFFFF]+;' + - '|&#[0-9]+;' + - '|&#x[0-9A-Fa-f]+;' - ), - - /** - * Internal helper for #constructor and #newFromtext. - * - * Based on Title.php#secureAndSplit - * - * @private - * @static - * @method parse - * @param {string} title - * @param {number} [defaultNamespace=NS_MAIN] - * @return {Object|boolean} - */ - parse = function ( title, defaultNamespace ) { - var namespace, m, id, i, fragment, ext; - - namespace = defaultNamespace === undefined ? NS_MAIN : defaultNamespace; - - title = title - // Normalise whitespace to underscores and remove duplicates - .replace( /[ _\s]+/g, '_' ) - // Trim underscores - .replace( rUnderscoreTrim, '' ); - - if ( title === '' ) { - return false; - } - - // Process initial colon - if ( title.charAt( 0 ) === ':' ) { - // Initial colon means main namespace instead of specified default - namespace = NS_MAIN; - title = title - // Strip colon - .substr( 1 ) - // Trim underscores - .replace( rUnderscoreTrim, '' ); - } - - // Process namespace prefix (if any) - m = title.match( rSplit ); - if ( m ) { - id = getNsIdByName( m[1] ); - if ( id !== false ) { - // Ordinary namespace - namespace = id; - title = m[2]; - - // For Talk:X pages, make sure X has no "namespace" prefix - if ( namespace === NS_TALK && ( m = title.match( rSplit ) ) ) { - // Disallow titles like Talk:File:x (subject should roundtrip: talk:file:x -> file:x -> file_talk:x) - if ( getNsIdByName( m[1] ) !== false ) { - return false; - } - } - } - } - - // Process fragment - i = title.indexOf( '#' ); - if ( i === -1 ) { - fragment = null; - } else { - fragment = title - // Get segment starting after the hash - .substr( i + 1 ) - // Convert to text - // NB: Must not be trimmed ("Example#_foo" is not the same as "Example#foo") - .replace( /_/g, ' ' ); - - title = title - // Strip hash - .substr( 0, i ) - // Trim underscores, again (strips "_" from "bar" in "Foo_bar_#quux") - .replace( rUnderscoreTrim, '' ); - } - - - // Reject illegal characters - if ( title.match( rInvalid ) ) { - return false; - } - - // Disallow titles that browsers or servers might resolve as directory navigation - if ( - title.indexOf( '.' ) !== -1 && ( - title === '.' || title === '..' || - title.indexOf( './' ) === 0 || - title.indexOf( '../' ) === 0 || - title.indexOf( '/./' ) !== -1 || - title.indexOf( '/../' ) !== -1 || - title.substr( -2 ) === '/.' || - title.substr( -3 ) === '/..' - ) - ) { - return false; - } - - // Disallow magic tilde sequence - if ( title.indexOf( '~~~' ) !== -1 ) { - return false; - } - - // Disallow titles exceeding the 255 byte size limit (size of underlying database field) - // Except for special pages, e.g. [[Special:Block/Long name]] - // Note: The PHP implementation also asserts that even in NS_SPECIAL, the title should - // be less than 512 bytes. - if ( namespace !== NS_SPECIAL && $.byteLength( title ) > 255 ) { - return false; - } - - // Can't make a link to a namespace alone. - if ( title === '' && namespace !== NS_MAIN ) { - return false; - } - - // Any remaining initial :s are illegal. - if ( title.charAt( 0 ) === ':' ) { - return false; - } - - // For backwards-compatibility with old mw.Title, we separate the extension from the - // rest of the title. - i = title.lastIndexOf( '.' ); - if ( i === -1 || title.length <= i + 1 ) { - // Extensions are the non-empty segment after the last dot - ext = null; - } else { - ext = title.substr( i + 1 ); - title = title.substr( 0, i ); - } - - return { - namespace: namespace, - title: title, - ext: ext, - fragment: fragment - }; - }, - - /** - * Convert db-key to readable text. - * - * @private - * @static - * @method text - * @param {string} s - * @return {string} - */ - text = function ( s ) { - if ( s !== null && s !== undefined ) { - return s.replace( /_/g, ' ' ); - } else { - return ''; - } - }, - - // Polyfill for ES5 Object.create - createObject = Object.create || ( function () { - return function ( o ) { - function Title() {} - if ( o !== Object( o ) ) { - throw new Error( 'Cannot inherit from a non-object' ); - } - Title.prototype = o; - return new Title(); - }; - }() ); - - - /* Static members */ - - /** - * Constructor for Title objects with a null return instead of an exception for invalid titles. - * - * @static - * @method - * @param {string} title - * @param {number} [namespace=NS_MAIN] Default namespace - * @return {mw.Title|null} A valid Title object or null if the title is invalid - */ - Title.newFromText = function ( title, namespace ) { - var t, parsed = parse( title, namespace ); - if ( !parsed ) { - return null; - } - - t = createObject( Title.prototype ); - t.namespace = parsed.namespace; - t.title = parsed.title; - t.ext = parsed.ext; - t.fragment = parsed.fragment; - - return t; - }; - - /** - * Get the file title from an image element - * - * var title = mw.Title.newFromImg( $( 'img:first' ) ); - * - * @static - * @param {HTMLElement|jQuery} img The image to use as a base - * @return {mw.Title|null} The file title or null if unsuccessful - */ - Title.newFromImg = function ( img ) { - var matches, i, regex, src, decodedSrc, - - // thumb.php-generated thumbnails - thumbPhpRegex = /thumb\.php/, - - regexes = [ - // Thumbnails - /\/[a-f0-9]\/[a-f0-9]{2}\/([^\s\/]+)\/[0-9]+px-\1[^\s\/]*$/, - - // Thumbnails in non-hashed upload directories - /\/([^\s\/]+)\/[0-9]+px-\1[^\s\/]*$/, - - // Full size images - /\/[a-f0-9]\/[a-f0-9]{2}\/([^\s\/]+)$/, - - // Full-size images in non-hashed upload directories - /\/([^\s\/]+)$/ - ], - - recount = regexes.length; - - src = img.jquery ? img[0].src : img.src; - - matches = src.match( thumbPhpRegex ); - - if ( matches ) { - return mw.Title.newFromText( 'File:' + mw.util.getParamValue( 'f', src ) ); - } - - decodedSrc = decodeURIComponent( src ); - - for ( i = 0; i < recount; i++ ) { - regex = regexes[i]; - matches = decodedSrc.match( regex ); - - if ( matches && matches[1] ) { - return mw.Title.newFromText( 'File:' + matches[1] ); - } - } - - return null; - }; - - /** - * Whether this title exists on the wiki. - * - * @static - * @param {string|mw.Title} title prefixed db-key name (string) or instance of Title - * @return {boolean|null} Boolean if the information is available, otherwise null - */ - Title.exists = function ( title ) { - var match, - type = $.type( title ), - obj = Title.exist.pages; - - if ( type === 'string' ) { - match = obj[title]; - } else if ( type === 'object' && title instanceof Title ) { - match = obj[title.toString()]; - } else { - throw new Error( 'mw.Title.exists: title must be a string or an instance of Title' ); - } - - if ( typeof match === 'boolean' ) { - return match; - } - - return null; - }; - - Title.exist = { - /** - * Boolean true value indicates page does exist. - * - * @static - * @property {Object} exist.pages Keyed by PrefixedDb title. - */ - pages: {}, - - /** - * Example to declare existing titles: - * Title.exist.set(['User:John_Doe', ...]); - * Eample to declare titles nonexistent: - * Title.exist.set(['File:Foo_bar.jpg', ...], false); - * - * @static - * @property exist.set - * @param {string|Array} titles Title(s) in strict prefixedDb title form - * @param {boolean} [state=true] State of the given titles - * @return {boolean} - */ - set: function ( titles, state ) { - titles = $.isArray( titles ) ? titles : [titles]; - state = state === undefined ? true : !!state; - var pages = this.pages, i, len = titles.length; - for ( i = 0; i < len; i++ ) { - pages[ titles[i] ] = state; - } - return true; - } - }; - - /* Public members */ - - Title.prototype = { - constructor: Title, - - /** - * Get the namespace number - * - * Example: 6 for "File:Example_image.svg". - * - * @return {number} - */ - getNamespaceId: function () { - return this.namespace; - }, - - /** - * Get the namespace prefix (in the content language) - * - * Example: "File:" for "File:Example_image.svg". - * In #NS_MAIN this is '', otherwise namespace name plus ':' - * - * @return {string} - */ - getNamespacePrefix: function () { - return this.namespace === NS_MAIN ? - '' : - ( mw.config.get( 'wgFormattedNamespaces' )[ this.namespace ].replace( / /g, '_' ) + ':' ); - }, - - /** - * Get the page name without extension or namespace prefix - * - * Example: "Example_image" for "File:Example_image.svg". - * - * For the page title (full page name without namespace prefix), see #getMain. - * - * @return {string} - */ - getName: function () { - if ( $.inArray( this.namespace, mw.config.get( 'wgCaseSensitiveNamespaces' ) ) !== -1 ) { - return this.title; - } else { - return $.ucFirst( this.title ); - } - }, - - /** - * Get the page name (transformed by #text) - * - * Example: "Example image" for "File:Example_image.svg". - * - * For the page title (full page name without namespace prefix), see #getMainText. - * - * @return {string} - */ - getNameText: function () { - return text( this.getName() ); - }, - - /** - * Get the extension of the page name (if any) - * - * @return {string|null} Name extension or null if there is none - */ - getExtension: function () { - return this.ext; - }, - - /** - * Shortcut for appendable string to form the main page name. - * - * Returns a string like ".json", or "" if no extension. - * - * @return {string} - */ - getDotExtension: function () { - return this.ext === null ? '' : '.' + this.ext; - }, - - /** - * Get the main page name (transformed by #text) - * - * Example: "Example_image.svg" for "File:Example_image.svg". - * - * @return {string} - */ - getMain: function () { - return this.getName() + this.getDotExtension(); - }, - - /** - * Get the main page name (transformed by #text) - * - * Example: "Example image.svg" for "File:Example_image.svg". - * - * @return {string} - */ - getMainText: function () { - return text( this.getMain() ); - }, - - /** - * Get the full page name - * - * Eaxample: "File:Example_image.svg". - * Most useful for API calls, anything that must identify the "title". - * - * @return {string} - */ - getPrefixedDb: function () { - return this.getNamespacePrefix() + this.getMain(); - }, - - /** - * Get the full page name (transformed by #text) - * - * Example: "File:Example image.svg" for "File:Example_image.svg". - * - * @return {string} - */ - getPrefixedText: function () { - return text( this.getPrefixedDb() ); - }, - - /** - * Get the fragment (if any). - * - * Note that this method (by design) does not include the hash character and - * the value is not url encoded. - * - * @return {string|null} - */ - getFragment: function () { - return this.fragment; - }, - - /** - * Get the URL to this title - * - * @see mw.util#getUrl - * @return {string} - */ - getUrl: function () { - return mw.util.getUrl( this.toString() ); - }, - - /** - * Whether this title exists on the wiki. - * - * @see #static-method-exists - * @return {boolean|null} Boolean if the information is available, otherwise null - */ - exists: function () { - return Title.exists( this ); - } - }; - - /** - * @alias #getPrefixedDb - * @method - */ - Title.prototype.toString = Title.prototype.getPrefixedDb; - - - /** - * @alias #getPrefixedText - * @method - */ - Title.prototype.toText = Title.prototype.getPrefixedText; - - // Expose - mw.Title = Title; - -}( mediaWiki, jQuery ) ); diff --git a/resources/mediawiki/mediawiki.Uri.js b/resources/mediawiki/mediawiki.Uri.js deleted file mode 100644 index a2d4d6cb..00000000 --- a/resources/mediawiki/mediawiki.Uri.js +++ /dev/null @@ -1,334 +0,0 @@ -/** - * Library for simple URI parsing and manipulation. Requires jQuery. - * - * Do not expect full RFC 3986 compliance. Intended to be minimal, but featureful. - * The use cases we have in mind are constructing 'next page' or 'previous page' URLs, - * detecting whether we need to use cross-domain proxies for an API, constructing - * simple URL-based API calls, etc. - * - * Intended to compress very well if you use a JS-parsing minifier. - * - * Dependencies: mw, jQuery - * - * Example: - * - * var uri = new mw.Uri( 'http://foo.com/mysite/mypage.php?quux=2' ); - * - * if ( uri.host == 'foo.com' ) { - * uri.host = 'www.foo.com'; - * uri.extend( { bar: 1 } ); - * - * $( 'a#id1' ).attr( 'href', uri ); - * // anchor with id 'id1' now links to http://foo.com/mysite/mypage.php?bar=1&quux=2 - * - * $( 'a#id2' ).attr( 'href', uri.clone().extend( { bar: 3, pif: 'paf' } ) ); - * // anchor with id 'id2' now links to http://foo.com/mysite/mypage.php?bar=3&quux=2&pif=paf - * } - * - * Parsing here is regex based, so may not work on all URIs, but is good enough for most. - * - * Given a URI like - * 'http://usr:pwd@www.test.com:81/dir/dir.2/index.htm?q1=0&&test1&test2=&test3=value+%28escaped%29&r=1&r=2#top': - * The returned object will have the following properties: - * - * protocol 'http' - * user 'usr' - * password 'pwd' - * host 'www.test.com' - * port '81' - * path '/dir/dir.2/index.htm' - * query { - * q1: 0, - * test1: null, - * test2: '', - * test3: 'value (escaped)' - * r: [1, 2] - * } - * fragment 'top' - * - * n.b. 'password' is not technically allowed for HTTP URIs, but it is possible with other - * sorts of URIs. - * You can modify the properties directly. Then use the toString() method to extract the - * full URI string again. - * - * Parsing based on parseUri 1.2.2 (c) Steven Levithan MIT License - * http://stevenlevithan.com/demo/parseuri/js/ - * - */ - -( function ( mw, $ ) { - - /** - * Function that's useful when constructing the URI string -- we frequently encounter the pattern of - * having to add something to the URI as we go, but only if it's present, and to include a character before or after if so. - * @param {string|undefined} pre To prepend. - * @param {string} val To include. - * @param {string} post To append. - * @param {boolean} raw If true, val will not be encoded. - * @return {string} Result. - */ - function cat( pre, val, post, raw ) { - if ( val === undefined || val === null || val === '' ) { - return ''; - } - return pre + ( raw ? val : mw.Uri.encode( val ) ) + post; - } - - // Regular expressions to parse many common URIs. - var parser = { - strict: /^(?:([^:\/?#]+):)?(?:\/\/(?:(?:([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?([^:\/?#]*)(?::(\d*))?)?((?:[^?#\/]*\/)*[^?#]*)(?:\?([^#]*))?(?:#(.*))?/, - loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?(?:(?:([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?([^:\/?#]*)(?::(\d*))?((?:\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?[^?#\/]*)(?:\?([^#]*))?(?:#(.*))?/ - }, - - // The order here matches the order of captured matches in the above parser regexes. - properties = [ - 'protocol', // http - 'user', // usr - 'password', // pwd - 'host', // www.test.com - 'port', // 81 - 'path', // /dir/dir.2/index.htm - 'query', // q1=0&&test1&test2=value (will become { q1: '0', test1: '', test2: 'value' } ) - 'fragment' // top - ]; - - - /** - * We use a factory to inject a document location, for relative URLs, including protocol-relative URLs. - * so the library is still testable & purely functional. - */ - mw.UriRelative = function ( documentLocation ) { - var defaultUri; - - /** - * Constructs URI object. Throws error if arguments are illegal/impossible, or otherwise don't parse. - * @constructor - * @param {Object|string} uri URI string, or an Object with appropriate properties (especially another URI object to clone). - * Object must have non-blank 'protocol', 'host', and 'path' properties. - * This parameter is optional. If omitted (or set to undefined, null or empty string), then an object will be created - * for the default uri of this constructor (e.g. document.location for mw.Uri in MediaWiki core). - * @param {Object|boolean} Object with options, or (backwards compatibility) a boolean for strictMode - * - {boolean} strictMode Trigger strict mode parsing of the url. Default: false - * - {boolean} overrideKeys Wether to let duplicate query parameters override eachother (true) or automagically - * convert to an array (false, default). - */ - function Uri( uri, options ) { - options = typeof options === 'object' ? options : { strictMode: !!options }; - options = $.extend( { - strictMode: false, - overrideKeys: false - }, options ); - - if ( uri !== undefined && uri !== null && uri !== '' ) { - if ( typeof uri === 'string' ) { - this.parse( uri, options ); - } else if ( typeof uri === 'object' ) { - // Copy data over from existing URI object - for ( var prop in uri ) { - // Only copy direct properties, not inherited ones - if ( uri.hasOwnProperty( prop ) ) { - // Deep copy object properties - if ( $.isArray( uri[prop] ) || $.isPlainObject( uri[prop] ) ) { - this[prop] = $.extend( true, {}, uri[prop] ); - } else { - this[prop] = uri[prop]; - } - } - } - if ( !this.query ) { - this.query = {}; - } - } - } else { - // If we didn't get a URI in the constructor, use the default one. - return defaultUri.clone(); - } - - // protocol-relative URLs - if ( !this.protocol ) { - this.protocol = defaultUri.protocol; - } - // No host given: - if ( !this.host ) { - this.host = defaultUri.host; - // port ? - if ( !this.port ) { - this.port = defaultUri.port; - } - } - if ( this.path && this.path.charAt( 0 ) !== '/' ) { - // A real relative URL, relative to defaultUri.path. We can't really handle that since we cannot - // figure out whether the last path component of defaultUri.path is a directory or a file. - throw new Error( 'Bad constructor arguments' ); - } - if ( !( this.protocol && this.host && this.path ) ) { - throw new Error( 'Bad constructor arguments' ); - } - } - - /** - * Standard encodeURIComponent, with extra stuff to make all browsers work similarly and more compliant with RFC 3986 - * Similar to rawurlencode from PHP and our JS library mw.util.rawurlencode, but we also replace space with a + - * @param {string} s String to encode. - * @return {string} Encoded string for URI. - */ - Uri.encode = function ( s ) { - return encodeURIComponent( s ) - .replace( /!/g, '%21').replace( /'/g, '%27').replace( /\(/g, '%28') - .replace( /\)/g, '%29').replace( /\*/g, '%2A') - .replace( /%20/g, '+' ); - }; - - /** - * Standard decodeURIComponent, with '+' to space. - * @param {string} s String encoded for URI. - * @return {string} Decoded string. - */ - Uri.decode = function ( s ) { - return decodeURIComponent( s.replace( /\+/g, '%20' ) ); - }; - - Uri.prototype = { - - /** - * Parse a string and set our properties accordingly. - * @param {string} str URI - * @param {Object} options - * @return {boolean} Success. - */ - parse: function ( str, options ) { - var q, - uri = this, - matches = parser[ options.strictMode ? 'strict' : 'loose' ].exec( str ); - $.each( properties, function ( i, property ) { - uri[ property ] = matches[ i + 1 ]; - } ); - - // uri.query starts out as the query string; we will parse it into key-val pairs then make - // that object the "query" property. - // we overwrite query in uri way to make cloning easier, it can use the same list of properties. - q = {}; - // using replace to iterate over a string - if ( uri.query ) { - uri.query.replace( /(?:^|&)([^&=]*)(?:(=)([^&]*))?/g, function ( $0, $1, $2, $3 ) { - var k, v; - if ( $1 ) { - k = Uri.decode( $1 ); - v = ( $2 === '' || $2 === undefined ) ? null : Uri.decode( $3 ); - - // If overrideKeys, always (re)set top level value. - // If not overrideKeys but this key wasn't set before, then we set it as well. - if ( options.overrideKeys || q[ k ] === undefined ) { - q[ k ] = v; - - // Use arrays if overrideKeys is false and key was already seen before - } else { - // Once before, still a string, turn into an array - if ( typeof q[ k ] === 'string' ) { - q[ k ] = [ q[ k ] ]; - } - // Add to the array - if ( $.isArray( q[ k ] ) ) { - q[ k ].push( v ); - } - } - } - } ); - } - this.query = q; - }, - - /** - * Returns user and password portion of a URI. - * @return {string} - */ - getUserInfo: function () { - return cat( '', this.user, cat( ':', this.password, '' ) ); - }, - - /** - * Gets host and port portion of a URI. - * @return {string} - */ - getHostPort: function () { - return this.host + cat( ':', this.port, '' ); - }, - - /** - * Returns the userInfo and host and port portion of the URI. - * In most real-world URLs, this is simply the hostname, but it is more general. - * @return {string} - */ - getAuthority: function () { - return cat( '', this.getUserInfo(), '@' ) + this.getHostPort(); - }, - - /** - * Returns the query arguments of the URL, encoded into a string - * Does not preserve the order of arguments passed into the URI. Does handle escaping. - * @return {string} - */ - getQueryString: function () { - var args = []; - $.each( this.query, function ( key, val ) { - var k = Uri.encode( key ), - vals = $.isArray( val ) ? val : [ val ]; - $.each( vals, function ( i, v ) { - if ( v === null ) { - args.push( k ); - } else if ( k === 'title' ) { - args.push( k + '=' + mw.util.wikiUrlencode( v ) ); - } else { - args.push( k + '=' + Uri.encode( v ) ); - } - } ); - } ); - return args.join( '&' ); - }, - - /** - * Returns everything after the authority section of the URI - * @return {string} - */ - getRelativePath: function () { - return this.path + cat( '?', this.getQueryString(), '', true ) + cat( '#', this.fragment, '' ); - }, - - /** - * Gets the entire URI string. May not be precisely the same as input due to order of query arguments. - * @return {string} The URI string. - */ - toString: function () { - return this.protocol + '://' + this.getAuthority() + this.getRelativePath(); - }, - - /** - * Clone this URI - * @return {Object} new URI object with same properties - */ - clone: function () { - return new Uri( this ); - }, - - /** - * Extend the query -- supply query parameters to override or add to ours - * @param {Object} query parameters in key-val form to override or add - * @return {Object} this URI object - */ - extend: function ( parameters ) { - $.extend( this.query, parameters ); - return this; - } - }; - - defaultUri = new Uri( documentLocation ); - - return Uri; - }; - - // if we are running in a browser, inject the current document location, for relative URLs - if ( document && document.location && document.location.href ) { - mw.Uri = mw.UriRelative( document.location.href ); - } - -}( mediaWiki, jQuery ) ); diff --git a/resources/mediawiki/mediawiki.debug.css b/resources/mediawiki/mediawiki.debug.css deleted file mode 100644 index 513cb847..00000000 --- a/resources/mediawiki/mediawiki.debug.css +++ /dev/null @@ -1,183 +0,0 @@ -.mw-debug { - width: 100%; - background-color: #eee; - border-top: 1px solid #aaa; -} - -.mw-debug pre { - font-size: 11px; - padding: 0; - margin: 0; - background: none; - border: none; -} - -.mw-debug table { - border-spacing: 0; - width: 100%; - table-layout: fixed; -} - -.mw-debug table tr { - background-color: #fff; -} - -.mw-debug table tr:nth-child(even) { - background-color: #f9f9f9; -} - -.mw-debug table td, .mw-debug table th { - padding: 4px 10px; -} - -.mw-debug table td { - border-bottom: 1px solid #eee; - word-wrap: break-word; -} - -.mw-debug table td.nr { - text-align: right; -} - -.mw-debug table td span.stats { - color: #808080; -} - -.mw-debug ul { - margin: 0; - list-style: none; -} - -.mw-debug li { - padding: 4px 0; - width: 100%; -} - -.mw-debug-bits { - text-align: center; - border-bottom: 1px solid #aaa; -} - -.mw-debug-bit { - display: inline-block; - padding: 10px 5px; - font-size: 13px; - /* IE-hack for display: inline-block */ - zoom: 1; - *display:inline; -} - -.mw-debug-panelink { - background-color: #eee; - border-right: 1px solid #ccc; -} - -.mw-debug-panelink:first-child { - border-left: 1px solid #ccc; -} - -.mw-debug-panelink:hover { - background-color: #fefefe; - cursor: pointer; -} -.mw-debug-panelink.current { - background-color: #dedede; - -} -a.mw-debug-panelabel, -a.mw-debug-panelabel:visited { - color: #000; -} - -.mw-debug-pane { - height: 300px; - overflow: scroll; - display: none; - font-size: 11px; - background-color: #e1eff2; - box-sizing: border-box; -} - -#mw-debug-pane-debuglog, -#mw-debug-pane-request { - padding: 20px; -} - -#mw-debug-pane-request table { - width: 100%; - margin: 10px 0 30px; -} - -#mw-debug-pane-request tr, -#mw-debug-pane-request th, -#mw-debug-pane-request td, -#mw-debug-pane-request table { - border: 1px solid #D0DBB3; - border-collapse: collapse; - margin: 0; -} - -#mw-debug-pane-request th, -#mw-debug-pane-request td { - font-size: 12px; - padding: 8px 10px; -} - -#mw-debug-pane-request th { - background-color: #F1F7E2; - font-weight: bold; -} - -#mw-debug-pane-request td { - background-color: white; -} - -#mw-debug-console tr td:first-child { - font-weight: bold; - vertical-align: top; -} - -#mw-debug-console tr td:last-child { - vertical-align: top; -} - -.mw-debug-console-log { - background-color: #add8e6; -} - -.mw-debug-console-warn { - background-color: #ffa07a; -} - -.mw-debug-console-deprecated { - background-color: #ffb6c1; -} - -.mw-debug-backtrace { - padding: 5px 10px; - margin: 5px; - background-color: #dedede; -} - -.mw-debug-backtrace span { - font-weight: bold; - color: #111; -} - -.mw-debug-backtrace ul { - padding-left: 10px; -} - -.mw-debug-backtrace li { - width: auto; - padding: 0; - color: #333; - font-size: 10px; - margin-bottom: 0; - line-height: 1em; -} - -/* Cheapo hack to hide the first 3 lines of the backtrace */ -.mw-debug-backtrace li:nth-child(-n+3) { - display: none; -} diff --git a/resources/mediawiki/mediawiki.debug.init.js b/resources/mediawiki/mediawiki.debug.init.js deleted file mode 100644 index 0f85e80d..00000000 --- a/resources/mediawiki/mediawiki.debug.init.js +++ /dev/null @@ -1,3 +0,0 @@ -jQuery( function () { - mediaWiki.Debug.init(); -} ); diff --git a/resources/mediawiki/mediawiki.debug.js b/resources/mediawiki/mediawiki.debug.js deleted file mode 100644 index 986917a1..00000000 --- a/resources/mediawiki/mediawiki.debug.js +++ /dev/null @@ -1,365 +0,0 @@ -/** - * JavaScript for the new debug toolbar, enabled through $wgDebugToolbar. - * - * @author John Du Hart - * @since 1.19 - */ - -( function ( mw, $ ) { - 'use strict'; - - var debug, - hovzer = $.getFootHovzer(); - - debug = mw.Debug = { - /** - * Toolbar container element - * - * @var {jQuery} - */ - $container: null, - - /** - * Object containing data for the debug toolbar - * - * @var {Object} - */ - data: {}, - - /** - * Initializes the debugging pane. - * Shouldn't be called before the document is ready - * (since it binds to elements on the page). - * - * @param {Object} data, defaults to 'debugInfo' from mw.config - */ - init: function ( data ) { - - this.data = data || mw.config.get( 'debugInfo' ); - this.buildHtml(); - - // Insert the container into the DOM - hovzer.$.append( this.$container ); - hovzer.update(); - - $( '.mw-debug-panelink' ).click( this.switchPane ); - }, - - /** - * Switches between panes - * - * @todo Store cookie for last pane open - * @context {Element} - * @param {jQuery.Event} e - */ - switchPane: function ( e ) { - var currentPaneId = debug.$container.data( 'currentPane' ), - requestedPaneId = $(this).prop( 'id' ).substr( 9 ), - $currentPane = $( '#mw-debug-pane-' + currentPaneId ), - $requestedPane = $( '#mw-debug-pane-' + requestedPaneId ), - hovDone = false; - - function updateHov() { - if ( !hovDone ) { - hovzer.update(); - hovDone = true; - } - } - - // Skip hash fragment handling. Prevents screen from jumping. - e.preventDefault(); - - $( this ).addClass( 'current '); - $( '.mw-debug-panelink' ).not( this ).removeClass( 'current '); - - // Hide the current pane - if ( requestedPaneId === currentPaneId ) { - $currentPane.slideUp( updateHov ); - debug.$container.data( 'currentPane', null ); - return; - } - - debug.$container.data( 'currentPane', requestedPaneId ); - - if ( currentPaneId === undefined || currentPaneId === null ) { - $requestedPane.slideDown( updateHov ); - } else { - $currentPane.hide(); - $requestedPane.show(); - updateHov(); - } - }, - - /** - * Constructs the HTML for the debugging toolbar - */ - buildHtml: function () { - var $container, $bits, panes, id, gitInfo; - - $container = $( '
' ); - - $bits = $( '
' ); - - /** - * Returns a jQuery element for a debug-bit div - * - * @param id - * @return {jQuery} - */ - function bitDiv( id ) { - return $( '
' ).prop({ - id: 'mw-debug-' + id, - className: 'mw-debug-bit' - }) - .appendTo( $bits ); - } - - /** - * Returns a jQuery element for a pane link - * - * @param id - * @param text - * @return {jQuery} - */ - function paneLabel( id, text ) { - return $( '' ) - .prop({ - className: 'mw-debug-panelabel', - href: '#mw-debug-pane-' + id - }) - .text( text ); - } - - /** - * Returns a jQuery element for a debug-bit div with a for a pane link - * - * @param id CSS id snippet. Will be prefixed with 'mw-debug-' - * @param text Text to show - * @param count Optional count to show - * @return {jQuery} - */ - function paneTriggerBitDiv( id, text, count ) { - if ( count ) { - text = text + ' (' + count + ')'; - } - return $( '
' ).prop({ - id: 'mw-debug-' + id, - className: 'mw-debug-bit mw-debug-panelink' - }) - .append( paneLabel( id, text ) ) - .appendTo( $bits ); - } - - paneTriggerBitDiv( 'console', 'Console', this.data.log.length ); - - paneTriggerBitDiv( 'querylist', 'Queries', this.data.queries.length ); - - paneTriggerBitDiv( 'debuglog', 'Debug log', this.data.debugLog.length ); - - paneTriggerBitDiv( 'request', 'Request' ); - - paneTriggerBitDiv( 'includes', 'PHP includes', this.data.includes.length ); - - gitInfo = ''; - if ( this.data.gitRevision !== false ) { - gitInfo = '(' + this.data.gitRevision.substring( 0, 7 ) + ')'; - if ( this.data.gitViewUrl !== false ) { - gitInfo = $( '' ) - .attr( 'href', this.data.gitViewUrl ) - .text( gitInfo ); - } - } - - bitDiv( 'mwversion' ) - .append( $( 'MediaWiki' ) ) - .append( document.createTextNode( ': ' + this.data.mwVersion + ' ' ) ) - .append( gitInfo ); - - if ( this.data.gitBranch !== false ) { - bitDiv( 'gitbranch' ).text( 'Git branch: ' + this.data.gitBranch ); - } - - bitDiv( 'phpversion' ) - .append( $( '' ).text( 'PHP' ) ) - .append( ': ' + this.data.phpVersion ); - - bitDiv( 'time' ) - .text( 'Time: ' + this.data.time.toFixed( 5 ) ); - - bitDiv( 'memory' ) - .text( 'Memory: ' + this.data.memory + ' (Peak: ' + this.data.memoryPeak + ')' ); - - $bits.appendTo( $container ); - - panes = { - console: this.buildConsoleTable(), - querylist: this.buildQueryTable(), - debuglog: this.buildDebugLogTable(), - request: this.buildRequestPane(), - includes: this.buildIncludesPane() - }; - - for ( id in panes ) { - if ( !panes.hasOwnProperty( id ) ) { - continue; - } - - $( '
' ) - .prop({ - className: 'mw-debug-pane', - id: 'mw-debug-pane-' + id - }) - .append( panes[id] ) - .appendTo( $container ); - } - - this.$container = $container; - }, - - /** - * Builds the console panel - */ - buildConsoleTable: function () { - var $table, entryTypeText, i, length, entry; - - $table = $( '' ); - - $( '' ).css( 'width', /* padding = */ 20 + ( 10 * /* fontSize = */ 11 ) ).appendTo( $table ); - $( '' ).appendTo( $table ); - $( '' ).css( 'width', 350 ).appendTo( $table ); - - - entryTypeText = function ( entryType ) { - switch ( entryType ) { - case 'log': - return 'Log'; - case 'warn': - return 'Warning'; - case 'deprecated': - return 'Deprecated'; - default: - return 'Unknown'; - } - }; - - for ( i = 0, length = this.data.log.length; i < length; i += 1 ) { - entry = this.data.log[i]; - entry.typeText = entryTypeText( entry.type ); - - $( '' ) - .append( $( '' ) - .append( $( '' ).css( 'width', '4em' ) ) - .append( $( '' ) ) - .append( $( '' ).css( 'width', '8em' ) ) - .append( $( '' ).css( 'width', '18em' ) ) - .appendTo( $table ); - - for ( i = 0, length = this.data.queries.length; i < length; i += 1 ) { - query = this.data.queries[i]; - - $( '' ) - .append( $( '
' ) - .text( entry.typeText ) - .addClass( 'mw-debug-console-' + entry.type ) - ) - .append( $( '' ).html( entry.msg ) ) - .append( $( '' ).text( entry.caller ) ) - .appendTo( $table ); - } - - return $table; - }, - - /** - * Query list pane - */ - buildQueryTable: function () { - var $table, i, length, query; - - $table = $( '
' ); - - $( '
#SQLTimeCall
' ).text( i + 1 ) ) - .append( $( '' ).text( query.sql ) ) - .append( $( '' ).text( ( query.time * 1000 ).toFixed( 4 ) + 'ms' ) ) - .append( $( '' ).text( query['function'] ) ) - .appendTo( $table ); - } - - - return $table; - }, - - /** - * Legacy debug log pane - */ - buildDebugLogTable: function () { - var $list, i, length, line; - $list = $( '