diff options
Diffstat (limited to 'resources/src/mediawiki.legacy')
-rw-r--r-- | resources/src/mediawiki.legacy/ajax.js | 194 | ||||
-rw-r--r-- | resources/src/mediawiki.legacy/commonPrint.css | 44 | ||||
-rw-r--r-- | resources/src/mediawiki.legacy/images/checker.png | bin | 81 -> 0 bytes | |||
-rw-r--r-- | resources/src/mediawiki.legacy/images/feed-icon.png | bin | 542 -> 0 bytes | |||
-rw-r--r-- | resources/src/mediawiki.legacy/images/feed-icon.svg | 1 | ||||
-rw-r--r-- | resources/src/mediawiki.legacy/images/question.png | bin | 316 -> 0 bytes | |||
-rw-r--r-- | resources/src/mediawiki.legacy/images/question.svg | 1 | ||||
-rw-r--r-- | resources/src/mediawiki.legacy/oldshared.css | 13 | ||||
-rw-r--r-- | resources/src/mediawiki.legacy/protect.js | 3 | ||||
-rw-r--r-- | resources/src/mediawiki.legacy/shared.css | 278 | ||||
-rw-r--r-- | resources/src/mediawiki.legacy/wikibits.js | 38 |
11 files changed, 45 insertions, 527 deletions
diff --git a/resources/src/mediawiki.legacy/ajax.js b/resources/src/mediawiki.legacy/ajax.js deleted file mode 100644 index 3660c205..00000000 --- a/resources/src/mediawiki.legacy/ajax.js +++ /dev/null @@ -1,194 +0,0 @@ -/** - * Remote Scripting Library - * Copyright 2005 modernmethod, inc - * Under the open source BSD license - * http://www.modernmethod.com/sajax/ - */ - -/*jscs:disable requireCamelCaseOrUpperCaseIdentifiers */ -/*global alert */ -( function ( mw ) { - - /** - * if sajax_debug_mode is true, this function outputs given the message into - * the element with id = sajax_debug; if no such element exists in the document, - * it is injected. - */ - function debug( text ) { - if ( !window.sajax_debug_mode ) { - return false; - } - - var b, m, - e = document.getElementById( 'sajax_debug' ); - - if ( !e ) { - e = document.createElement( 'p' ); - e.className = 'sajax_debug'; - e.id = 'sajax_debug'; - - b = document.getElementsByTagName( 'body' )[0]; - - if ( b.firstChild ) { - b.insertBefore( e, b.firstChild ); - } else { - b.appendChild( e ); - } - } - - m = document.createElement( 'div' ); - m.appendChild( document.createTextNode( text ) ); - - e.appendChild( m ); - - return true; - } - - /** - * Compatibility wrapper for creating a new XMLHttpRequest object. - */ - function createXhr() { - debug( 'sajax_init_object() called..' ); - var a; - try { - // Try the new style before ActiveX so we don't - // unnecessarily trigger warnings in IE 7 when - // set to prompt about ActiveX usage - a = new XMLHttpRequest(); - } catch ( xhrE ) { - try { - a = new window.ActiveXObject( 'Msxml2.XMLHTTP' ); - } catch ( msXmlE ) { - try { - a = new window.ActiveXObject( 'Microsoft.XMLHTTP' ); - } catch ( msXhrE ) { - a = null; - } - } - } - if ( !a ) { - debug( 'Could not create connection object.' ); - } - - return a; - } - - /** - * Perform an AJAX call to MediaWiki. Calls are handled by AjaxDispatcher.php - * func_name - the name of the function to call. Must be registered in $wgAjaxExportList - * args - an array of arguments to that function - * target - the target that will handle the result of the call. If this is a function, - * if will be called with the XMLHttpRequest as a parameter; if it's an input - * element, its value will be set to the resultText; if it's another type of - * element, its innerHTML will be set to the resultText. - * - * Example: - * sajax_do_call( 'doFoo', [1, 2, 3], document.getElementById( 'showFoo' ) ); - * - * This will call the doFoo function via MediaWiki's AjaxDispatcher, with - * (1, 2, 3) as the parameter list, and will show the result in the element - * with id = showFoo - */ - function doAjaxRequest( func_name, args, target ) { - var i, x, uri, post_data; - uri = mw.util.wikiScript() + '?action=ajax'; - if ( window.sajax_request_type === 'GET' ) { - if ( uri.indexOf( '?' ) === -1 ) { - uri = uri + '?rs=' + encodeURIComponent( func_name ); - } else { - uri = uri + '&rs=' + encodeURIComponent( func_name ); - } - for ( i = 0; i < args.length; i++ ) { - uri = uri + '&rsargs[]=' + encodeURIComponent( args[i] ); - } - // uri = uri + '&rsrnd=' + new Date().getTime(); - post_data = null; - } else { - post_data = 'rs=' + encodeURIComponent( func_name ); - for ( i = 0; i < args.length; i++ ) { - post_data = post_data + '&rsargs[]=' + encodeURIComponent( args[i] ); - } - } - x = createXhr(); - if ( !x ) { - alert( 'AJAX not supported' ); - return false; - } - - try { - x.open( window.sajax_request_type, uri, true ); - } catch ( e ) { - if ( location.hostname === 'localhost' ) { - alert( 'Your browser blocks XMLHttpRequest to "localhost", try using a real hostname for development/testing.' ); - } - throw e; - } - if ( window.sajax_request_type === 'POST' ) { - x.setRequestHeader( 'Method', 'POST ' + uri + ' HTTP/1.1' ); - x.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded' ); - } - x.setRequestHeader( 'Pragma', 'cache=yes' ); - x.setRequestHeader( 'Cache-Control', 'no-transform' ); - x.onreadystatechange = function () { - if ( x.readyState !== 4 ) { - return; - } - - debug( 'received (' + x.status + ' ' + x.statusText + ') ' + x.responseText ); - - // if ( x.status != 200 ) - // alert( 'Error: ' + x.status + ' ' + x.statusText + ': ' + x.responseText ); - // else - - if ( typeof target === 'function' ) { - target( x ); - } else if ( typeof target === 'object' ) { - if ( target.tagName === 'INPUT' ) { - if ( x.status === 200 ) { - target.value = x.responseText; - } - // else alert( 'Error: ' + x.status + ' ' + x.statusText + ' (' + x.responseText + ')' ); - } else { - if ( x.status === 200 ) { - target.innerHTML = x.responseText; - } else { - target.innerHTML = '<div class="error">Error: ' + x.status + - ' ' + x.statusText + ' (' + x.responseText + ')</div>'; - } - } - } else { - alert( 'Bad target for sajax_do_call: not a function or object: ' + target ); - } - }; - - debug( func_name + ' uri = ' + uri + ' / post = ' + post_data ); - x.send( post_data ); - debug( func_name + ' waiting..' ); - - return true; - } - - /** - * @return {boolean} Whether the browser supports AJAX - */ - function wfSupportsAjax() { - var request = createXhr(), - supportsAjax = request ? true : false; - - request = undefined; - return supportsAjax; - } - - // Expose + Mark as deprecated - var deprecationNotice = 'Sajax is deprecated, use jQuery.ajax or mediawiki.api instead.'; - - // Variables - mw.log.deprecate( window, 'sajax_debug_mode', false, deprecationNotice ); - mw.log.deprecate( window, 'sajax_request_type', 'GET', deprecationNotice ); - // Methods - mw.log.deprecate( window, 'sajax_debug', debug, deprecationNotice ); - mw.log.deprecate( window, 'sajax_init_object', createXhr, deprecationNotice ); - mw.log.deprecate( window, 'sajax_do_call', doAjaxRequest, deprecationNotice ); - mw.log.deprecate( window, 'wfSupportsAjax', wfSupportsAjax, deprecationNotice ); - -}( mediaWiki ) ); diff --git a/resources/src/mediawiki.legacy/commonPrint.css b/resources/src/mediawiki.legacy/commonPrint.css index 9a8d3918..e1b31982 100644 --- a/resources/src/mediawiki.legacy/commonPrint.css +++ b/resources/src/mediawiki.legacy/commonPrint.css @@ -16,7 +16,6 @@ div#jump-to-nav, .mw-jump, div.top, div#column-one, -#colophon, .mw-editsection, .mw-editsection-like, .toctoggle, @@ -29,9 +28,6 @@ li#mobileview, li#privacy, #footer-places, .mw-hidden-catlinks, -tr.mw-metadata-show-hide-extended, -span.mw-filepage-other-resolutions, -#filetoc, .usermessage, .patrollink, .ns-0 .mw-redirectedfrom, @@ -123,7 +119,6 @@ pre, .mw-code { border: 1px solid #aaaaaa; background-color: #f9f9f9; padding: 5px; - display: -moz-inline-block; display: inline-block; display: table; /* IE7 and earlier */ @@ -286,45 +281,6 @@ img.thumbborder { } /** - * Galleries (see shared.css for more info) - */ -li.gallerybox { - vertical-align: top; - display: inline-block; -} - -ul.gallery, li.gallerybox { - zoom: 1; - *display: inline; -} - -ul.gallery { - margin: 2px; - padding: 2px; - display: block; -} - -li.gallerycaption { - font-weight: bold; - text-align: center; - display: block; - word-wrap: break-word; -} - -li.gallerybox div.thumb { - text-align: center; - border: 1px solid #ccc; - margin: 2px; -} - -div.gallerytext { - overflow: hidden; - font-size: 94%; - padding: 2px 4px; - word-wrap: break-word; -} - -/** * Table rendering * As on shared.css but with white background. */ diff --git a/resources/src/mediawiki.legacy/images/checker.png b/resources/src/mediawiki.legacy/images/checker.png Binary files differdeleted file mode 100644 index 3e9e3d09..00000000 --- a/resources/src/mediawiki.legacy/images/checker.png +++ /dev/null diff --git a/resources/src/mediawiki.legacy/images/feed-icon.png b/resources/src/mediawiki.legacy/images/feed-icon.png Binary files differdeleted file mode 100644 index 00f49f6c..00000000 --- a/resources/src/mediawiki.legacy/images/feed-icon.png +++ /dev/null diff --git a/resources/src/mediawiki.legacy/images/feed-icon.svg b/resources/src/mediawiki.legacy/images/feed-icon.svg deleted file mode 100644 index 6e5f570a..00000000 --- a/resources/src/mediawiki.legacy/images/feed-icon.svg +++ /dev/null @@ -1 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" width="128" height="128" viewBox="0 0 256 256"><defs><linearGradient x1=".085" y1=".085" x2=".915" y2=".915" id="a"><stop offset="0" stop-color="#E3702D"/><stop offset=".107" stop-color="#EA7D31"/><stop offset=".35" stop-color="#F69537"/><stop offset=".5" stop-color="#FB9E3A"/><stop offset=".702" stop-color="#EA7C31"/><stop offset=".887" stop-color="#DE642B"/><stop offset="1" stop-color="#D95B29"/></linearGradient></defs><rect width="256" height="256" rx="55" ry="55" fill="#CC5D15"/><rect width="246" height="246" rx="50" ry="50" x="5" y="5" fill="#F49C52"/><rect width="236" height="236" rx="47" ry="47" x="10" y="10" fill="url(#a)"/><circle cx="68" cy="189" r="24" fill="#FFF"/><path d="M160 213h-34a82 82 0 0 0-82-82v-34a116 116 0 0 1 116 116zM184 213a140 140 0 0 0-140-140v-35a175 175 0 0 1 175 175z" fill="#FFF"/></svg>
\ No newline at end of file diff --git a/resources/src/mediawiki.legacy/images/question.png b/resources/src/mediawiki.legacy/images/question.png Binary files differdeleted file mode 100644 index f7405d26..00000000 --- a/resources/src/mediawiki.legacy/images/question.png +++ /dev/null diff --git a/resources/src/mediawiki.legacy/images/question.svg b/resources/src/mediawiki.legacy/images/question.svg deleted file mode 100644 index 98fbe8dd..00000000 --- a/resources/src/mediawiki.legacy/images/question.svg +++ /dev/null @@ -1 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" width="21.059" height="21.06"><path fill="#575757" d="M10.529 0c-5.814 0-10.529 4.714-10.529 10.529s4.715 10.53 10.529 10.53c5.816 0 10.529-4.715 10.529-10.53s-4.712-10.529-10.529-10.529zm-.002 16.767c-.861 0-1.498-.688-1.498-1.516 0-.862.637-1.534 1.498-1.534.828 0 1.5.672 1.5 1.534 0 .827-.672 1.516-1.5 1.516zm2.137-6.512c-.723.568-1 .931-1 1.739v.5h-2.205v-.603c0-1.517.449-2.136 1.154-2.688.707-.552 1.139-.845 1.139-1.637 0-.672-.414-1.051-1.24-1.051-.707 0-1.328.189-1.982.638l-1.051-1.807c.861-.604 1.93-1.034 3.342-1.034 1.912 0 3.516 1.051 3.516 3.066-.001 1.43-.794 2.188-1.673 2.877z"/></svg>
\ No newline at end of file diff --git a/resources/src/mediawiki.legacy/oldshared.css b/resources/src/mediawiki.legacy/oldshared.css index c2bd5a73..66161ed3 100644 --- a/resources/src/mediawiki.legacy/oldshared.css +++ b/resources/src/mediawiki.legacy/oldshared.css @@ -168,7 +168,6 @@ img { padding: 5px; font-size: 95%; text-align: center; - display: -moz-inline-block; display: inline-block; display: table; @@ -257,14 +256,6 @@ div.htmlform-tip { color: #666; } -fieldset.prefsection { - margin-top: 1em; -} - -fieldset.operaprefsection { - margin-left: 15em; -} - /* emulate center */ .center { width: 100%; @@ -321,10 +312,6 @@ span.comment { font-style: italic; } -span.changedby { - font-size: 95%; -} - .previewnote { text-align: center; color: #cc0000; diff --git a/resources/src/mediawiki.legacy/protect.js b/resources/src/mediawiki.legacy/protect.js index 3f4b263e..6226c90b 100644 --- a/resources/src/mediawiki.legacy/protect.js +++ b/resources/src/mediawiki.legacy/protect.js @@ -146,7 +146,7 @@ var ProtectionForm = window.ProtectionForm = { */ matchAttribute: function ( objects, attrName ) { return $.map( objects, function ( object ) { - return object[attrName]; + return object[ attrName ]; } ).filter( function ( item, index, a ) { return index === a.indexOf( item ); } ).length === 1; @@ -177,6 +177,7 @@ var ProtectionForm = window.ProtectionForm = { /** * Find the highest protection level in any selector + * * @return {number} */ getMaxLevel: function () { diff --git a/resources/src/mediawiki.legacy/shared.css b/resources/src/mediawiki.legacy/shared.css index 3657b127..961c02b2 100644 --- a/resources/src/mediawiki.legacy/shared.css +++ b/resources/src/mediawiki.legacy/shared.css @@ -2,6 +2,11 @@ * CSS in this file is used by *all* skins (that have any CSS at all). Be * careful what you put in here, since what looks good in one skin may not in * another, but don't ignore the poor pre-Monobook users either. + * + * NOTE: The images which are referenced in this file are no longer in use in + * essential interface components. They should NOT be embedded, because that + * optimizes for the uncommon case at the cost of bloating the size of render- + * blocking CSS common to all pages. */ /* GENERAL CLASSES FOR DIRECTIONALITY SUPPORT */ @@ -78,6 +83,14 @@ abbr[title], cursor: help; } +@supports (text-decoration: underline dotted) { + abbr[title], + .explain[title] { + border-bottom: none; + text-decoration: underline dotted; + } +} + /* Colored watchlist and recent changes numbers */ .mw-plusminus-pos { color: #006400; /* dark green */ @@ -113,15 +126,11 @@ abbr[title], font-style: italic; } -/* Comment and username portions of RC entries */ +/* Comment portions of RC entries */ span.comment { font-style: italic; } -span.changedby { - font-size: 95%; -} - /* Math */ .texvc { direction: ltr; @@ -152,49 +161,6 @@ span.texhtml { } /** - * File description page - */ - -div.mw-filepage-resolutioninfo { - font-size: smaller; -} - -/** - * File histories - */ -h2#filehistory { - clear: both; -} - -table.filehistory th, -table.filehistory td { - vertical-align: top; -} - -table.filehistory th { - text-align: left; -} - -table.filehistory td.mw-imagepage-filesize, -table.filehistory th.mw-imagepage-filesize { - white-space: nowrap; -} - -table.filehistory td.filehistory-selected { - font-weight: bold; -} - -/** - * Add a checkered background image on hover for file - * description pages. (bug 26470) - */ -.filehistory a img, -#file img:hover { - /* @embed */ - background: white url(images/checker.png) repeat; -} - -/** * rev_deleted stuff */ li span.deleted, @@ -237,73 +203,13 @@ td.mw-submit { } td.mw-label { - vertical-align: top; -} - -.prefsection td.mw-label { - width: 20%; -} - -.prefsection table { - width: 100%; -} - -.prefsection table.mw-htmlform-matrix { - width: auto; -} - -.mw-icon-question { - /* SVG support using a transparent gradient to guarantee cross-browser - * compatibility (browsers able to understand gradient syntax support also SVG). - * http://pauginer.tumblr.com/post/36614680636/invisible-gradient-technique */ - background-image: url(images/question.png); - /* @embed */ - background-image: -webkit-linear-gradient(transparent, transparent), url(images/question.svg); - /* @embed */ - background-image: linear-gradient(transparent, transparent), url(images/question.svg); - background-repeat: no-repeat; - background-size: 13px 13px; - display: inline-block; - height: 13px; - width: 13px; - margin-left: 4px; -} - -.mw-icon-question:lang(ar), -.mw-icon-question:lang(fa), -.mw-icon-question:lang(ur) { - -webkit-transform: scaleX(-1); - -ms-transform: scaleX(-1); - transform: scaleX(-1); + vertical-align: middle; } td.mw-submit { white-space: nowrap; } -table.mw-htmlform-nolabel td.mw-label { - width: 1px; -} - -tr.mw-htmlform-vertical-label td.mw-label { - text-align: left !important; -} - -.mw-htmlform-invalid-input td.mw-input input { - border-color: red; -} - -.mw-htmlform-flatlist div.mw-htmlform-flatlist-item { - display: inline; - margin-right: 1em; - white-space: nowrap; -} - -.mw-htmlform-matrix td { - padding-left: 0.5em; - padding-right: 0.5em; -} - input#wpSummary { width: 80%; margin-bottom: 1em; @@ -437,11 +343,6 @@ p.mw-upload-editlicenses { font-weight: bold; } -#shared-image-dup, -#shared-image-conflict { - font-style: italic; -} - /** * Recreating deleted page warning * Reupload file warning @@ -481,22 +382,6 @@ a.new { color: #BA0000; } -/* feed links */ -a.feedlink { - /* SVG support using a transparent gradient to guarantee cross-browser - * compatibility (browsers able to understand gradient syntax support also SVG). - * http://pauginer.tumblr.com/post/36614680636/invisible-gradient-technique */ - background-image: url(images/feed-icon.png); - /* @embed */ - background-image: -webkit-linear-gradient(transparent, transparent), url(images/feed-icon.svg); - /* @embed */ - background-image: linear-gradient(transparent, transparent), url(images/feed-icon.svg); - background-position: center left; - background-repeat: no-repeat; - background-size: 12px 12px; - padding-left: 16px; -} - /* Plainlinks - this can be used to switch * off special external link styling */ .plainlinks a.external { @@ -566,7 +451,6 @@ table.wikitable > caption { border: 1px solid; padding: .5em 1em; margin-bottom: 1em; - display: -moz-inline-block; display: inline-block; zoom: 1; *display: inline; @@ -663,24 +547,6 @@ table.wikitable > caption { background-color: #eeeeff; } -/* filetoc */ -ul#filetoc { - text-align: center; - border: 1px solid #aaaaaa; - background-color: #f9f9f9; - padding: 5px; - font-size: 95%; - margin-bottom: 0.5em; - margin-left: 0; - margin-right: 0; -} - -#filetoc li { - display: inline; - list-style-type: none; - padding-right: 2em; -} - /* Classes for Exif data display */ table.mw_metadata { font-size: 0.8em; @@ -773,110 +639,7 @@ table.mw_metadata ul.metadata-langlist { margin-left: 0; } -/* Galleries */ -/* These display attributes look nonsensical, but are needed to support IE and FF2 */ -/* Don't forget to update commonPrint.css */ -li.gallerybox { - vertical-align: top; - display: -moz-inline-box; - display: inline-block; -} - -ul.gallery, -li.gallerybox { - zoom: 1; - *display: inline; -} - -ul.gallery { - margin: 2px; - padding: 2px; - display: block; -} - -li.gallerycaption { - font-weight: bold; - text-align: center; - display: block; - word-wrap: break-word; -} - -li.gallerybox div.thumb { - text-align: center; - border: 1px solid #ccc; - background-color: #f9f9f9; - margin: 2px; -} - -li.gallerybox div.thumb img { - display: block; - margin: 0 auto; -} - -div.gallerytext { - overflow: hidden; - font-size: 94%; - padding: 2px 4px; - word-wrap: break-word; -} - -/* new gallery stuff */ -ul.mw-gallery-nolines li.gallerybox div.thumb { - background-color: transparent; - border: none; -} - -ul.mw-gallery-nolines li.gallerybox div.gallerytext { - text-align: center; -} - -/* height constrained gallery */ - -ul.mw-gallery-packed li.gallerybox div.thumb, -ul.mw-gallery-packed-overlay li.gallerybox div.thumb, -ul.mw-gallery-packed-hover li.gallerybox div.thumb { - background-color: transparent; - border: none; -} - -ul.mw-gallery-packed li.gallerybox div.thumb img, -ul.mw-gallery-packed-overlay li.gallerybox div.thumb img, -ul.mw-gallery-packed-hover li.gallerybox div.thumb img { - margin: 0 auto; -} - -ul.mw-gallery-packed-hover li.gallerybox, -ul.mw-gallery-packed-overlay li.gallerybox { - position: relative; -} - -ul.mw-gallery-packed-hover div.gallerytextwrapper { - overflow: hidden; - height: 0; -} - -ul.mw-gallery-packed-hover li.gallerybox:hover div.gallerytextwrapper, -ul.mw-gallery-packed-overlay li.gallerybox div.gallerytextwrapper, -ul.mw-gallery-packed-hover li.gallerybox.mw-gallery-focused div.gallerytextwrapper { - position: absolute; - background: white; - background: rgba(255, 255, 255, 0.8); - padding: 5px 10px; - bottom: 0; - left: 0; /* Needed for IE */ - height: auto; - font-weight: bold; - margin: 2px; /* correspond to style on div.thumb */ -} - -ul.mw-gallery-packed-hover, -ul.mw-gallery-packed-overlay, -ul.mw-gallery-packed { - text-align: center; -} - .mw-ajax-loader { - /* @embed */ background-image: url(images/ajax-loader.gif); background-position: center center; background-repeat: no-repeat; @@ -888,7 +651,6 @@ ul.mw-gallery-packed { .mw-small-spinner { padding: 10px !important; margin-right: 0.6em; - /* @embed */ background-image: url(images/spinner.gif); background-position: center center; background-repeat: no-repeat; @@ -945,6 +707,7 @@ h2:lang(te), h3:lang(te), h4:lang(te), h5:lang(te), h6:lang(te) { } /* Localised ordered list numbering for some languages */ +ol:lang(azb) li, ol:lang(bcc) li, ol:lang(bgn) li, ol:lang(bqi) li, @@ -952,13 +715,14 @@ ol:lang(fa) li, ol:lang(glk) li, ol:lang(kk-arab) li, ol:lang(lrc) li, -ol:lang(mzn) li, -ol:lang(sdh) li { +ol:lang(luz) li, +ol:lang(mzn) li { list-style-type: -moz-persian; list-style-type: persian; } -ol:lang(ckb) li { +ol:lang(ckb) li, +ol:lang(sdh) li { list-style-type: -moz-arabic-indic; list-style-type: arabic-indic; } @@ -1026,7 +790,6 @@ ol:lang(or) li { margin-left: 2px; margin-bottom: -8px; padding: 0 0 0 15px; - /* @embed */ background-image: url(images/help-question.gif); background-position: left center; background-repeat: no-repeat; @@ -1037,7 +800,6 @@ ol:lang(or) li { } .mw-help-field-hint:hover { - /* @embed */ background-image: url(images/help-question-hover.gif); } diff --git a/resources/src/mediawiki.legacy/wikibits.js b/resources/src/mediawiki.legacy/wikibits.js index 32cd79a5..7d1f6d73 100644 --- a/resources/src/mediawiki.legacy/wikibits.js +++ b/resources/src/mediawiki.legacy/wikibits.js @@ -85,7 +85,7 @@ // Execute the queued functions for ( i = 0; i < functs.length; i++ ) { - functs[i](); + functs[ i ](); } } ); @@ -164,33 +164,26 @@ * See https://www.mediawiki.org/wiki/ResourceLoader/Legacy_JavaScript#wikibits.js */ - function importScript( page ) { - var uri = mw.config.get( 'wgScript' ) + '?title=' + - mw.util.wikiUrlencode( page ) + - '&action=raw&ctype=text/javascript'; - return importScriptURI( uri ); - } - /** * @deprecated since 1.17 Use mw.loader instead. Warnings added in 1.25. */ function importScriptURI( url ) { - if ( loadedScripts[url] ) { + if ( loadedScripts[ url ] ) { return null; } - loadedScripts[url] = true; + loadedScripts[ url ] = true; var s = document.createElement( 'script' ); s.setAttribute( 'src', url ); s.setAttribute( 'type', 'text/javascript' ); - document.getElementsByTagName( 'head' )[0].appendChild( s ); + document.getElementsByTagName( 'head' )[ 0 ].appendChild( s ); return s; } - function importStylesheet( page ) { + function importScript( page ) { var uri = mw.config.get( 'wgScript' ) + '?title=' + mw.util.wikiUrlencode( page ) + - '&action=raw&ctype=text/css'; - return importStylesheetURI( uri ); + '&action=raw&ctype=text/javascript'; + return importScriptURI( uri ); } /** @@ -203,10 +196,17 @@ if ( media ) { l.media = media; } - document.getElementsByTagName( 'head' )[0].appendChild( l ); + document.getElementsByTagName( 'head' )[ 0 ].appendChild( l ); return l; } + function importStylesheet( page ) { + var uri = mw.config.get( 'wgScript' ) + '?title=' + + mw.util.wikiUrlencode( page ) + + '&action=raw&ctype=text/css'; + return importStylesheetURI( uri ); + } + msg = 'Use mw.loader instead.'; mw.log.deprecate( win, 'loadedScripts', loadedScripts, msg ); mw.log.deprecate( win, 'importScriptURI', importScriptURI, msg ); @@ -215,4 +215,12 @@ win.importScript = importScript; win.importStylesheet = importStylesheet; + // Replace document.write/writeln with basic html parsing that appends + // to the <body> to avoid blanking pages. Added JavaScript will not run. + $.each( [ 'write', 'writeln' ], function ( idx, method ) { + mw.log.deprecate( document, method, function () { + $( 'body' ).append( $.parseHTML( Array.prototype.join.call( arguments, '' ) ) ); + }, 'Use jQuery or mw.loader.load instead.' ); + } ); + }( mediaWiki, jQuery ) ); |