From 4ac9fa081a7c045f6a9f1cfc529d82423f485b2e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 8 Dec 2013 09:55:49 +0100 Subject: Update to MediaWiki 1.22.0 --- skins/common/IEFixes.js | 82 +-- skins/common/ajax.js | 121 ++-- skins/common/commonContent.css | 49 +- skins/common/commonElements.css | 26 +- skins/common/commonPrint.css | 7 +- skins/common/config.css | 8 +- skins/common/config.js | 14 +- skins/common/images/Arr_u.png | Bin 207 -> 207 bytes skins/common/images/ar/button_headline.png | Bin 487 -> 484 bytes skins/common/images/ar/button_nowiki.png | Bin 875 -> 874 bytes skins/common/images/arrow_disabled_left_25.png | Bin 301 -> 301 bytes skins/common/images/arrow_disabled_right_25.png | Bin 307 -> 307 bytes skins/common/images/arrow_right_25.png | Bin 341 -> 337 bytes skins/common/images/button_hr.png | Bin 222 -> 200 bytes skins/common/images/button_nowiki.png | Bin 322 -> 322 bytes skins/common/images/button_sig.png | Bin 926 -> 920 bytes skins/common/images/button_template.png | Bin 188 -> 178 bytes skins/common/images/critical-32.png | Bin 1763 -> 1758 bytes skins/common/images/fa/button_nowiki.png | Bin 875 -> 874 bytes skins/common/images/feed-icon.png | Bin 557 -> 542 bytes skins/common/images/icons/fileicon-psd.png | Bin 10376 -> 7756 bytes skins/common/images/magnify-clip-rtl.png | Bin 208 -> 149 bytes skins/common/images/question-small.png | Bin 0 -> 316 bytes skins/common/images/question.svg | 12 + skins/common/images/tick-32.png | Bin 1137 -> 1103 bytes skins/common/images/warning-32.png | Bin 1301 -> 1299 bytes skins/common/oldshared.css | 42 +- skins/common/protect.js | 236 ++++---- skins/common/shared.css | 196 +++++-- skins/common/upload.js | 322 +++++----- skins/common/wikibits.js | 745 ++++++------------------ skins/common/wikiprintable.css | 59 -- 32 files changed, 879 insertions(+), 1040 deletions(-) create mode 100644 skins/common/images/question-small.png create mode 100644 skins/common/images/question.svg delete mode 100644 skins/common/wikiprintable.css (limited to 'skins/common') diff --git a/skins/common/IEFixes.js b/skins/common/IEFixes.js index dd999ed4..e35fcd1a 100644 --- a/skins/common/IEFixes.js +++ b/skins/common/IEFixes.js @@ -1,10 +1,17 @@ -// IE fixes javascript +// IE fixes javascript loaded by wikibits.js for IE <= 6.0 +( function ( mw, $ ) { -window.isMSIE55 = ( window.showModalDialog && window.clipboardData && window.createPopup ); -window.doneIETransform = undefined; -window.doneIEAlphaFix = undefined; +var doneIEAlphaFix, doneIETransform, expandedURLs, fixalpha, isMSIE55, + relativeforfloats, setrelative, hasClass; -window.hookit = function() { +// Also returns true for IE6, 7, 8, 9 and 10. createPopup is removed in IE11. +// Good thing this is only loaded for IE <= 6 by wikibits. +// Might as well set it to true. +isMSIE55 = window.isMSIE55 = ( window.showModalDialog && window.clipboardData && window.createPopup ); +doneIETransform = window.doneIETransform = undefined; +doneIEAlphaFix = window.doneIEAlphaFix = undefined; + +window.hookit = function () { if ( !doneIETransform && document.getElementById && document.getElementById( 'bodyContent' ) ) { doneIETransform = true; relativeforfloats(); @@ -17,26 +24,27 @@ if ( document.attachEvent ) { } // png alpha transparency fixes -window.fixalpha = function( logoId ) { +fixalpha = window.fixalpha = function ( logoId ) { // bg if ( isMSIE55 && !doneIEAlphaFix ) { - var plogo = document.getElementById( logoId || 'p-logo' ); + var bg, imageUrl, linkFix, logoa, logospan, plogo; + plogo = document.getElementById( logoId || 'p-logo' ); if ( !plogo ) { return; } - var logoa = plogo.getElementsByTagName('a')[0]; + logoa = plogo.getElementsByTagName('a')[0]; if ( !logoa ) { return; } - var bg = logoa.currentStyle.backgroundImage; - var imageUrl = bg.substring( 5, bg.length - 2 ); + bg = logoa.currentStyle.backgroundImage; + imageUrl = bg.substring( 5, bg.length - 2 ); doneIEAlphaFix = true; - if ( imageUrl.substr( imageUrl.length - 4 ).toLowerCase() == '.png' ) { - var logospan = logoa.appendChild( document.createElement( 'span' ) ); + if ( imageUrl.substr( imageUrl.length - 4 ).toLowerCase() === '.png' ) { + logospan = logoa.appendChild( document.createElement( 'span' ) ); logoa.style.backgroundImage = 'none'; logospan.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=' + imageUrl + ')'; @@ -45,7 +53,7 @@ window.fixalpha = function( logoId ) { logospan.style.width = logoa.currentStyle.width; logospan.style.cursor = 'hand'; // Center image with hack for IE5.5 - if ( document.documentElement.dir == 'rtl' ) { + if ( document.documentElement.dir === 'rtl' ) { logospan.style.right = '50%'; logospan.style.setExpression( 'marginRight', '"-" + (this.offsetWidth / 2) + "px"' ); } else { @@ -55,7 +63,7 @@ window.fixalpha = function( logoId ) { logospan.style.top = '50%'; logospan.style.setExpression( 'marginTop', '"-" + (this.offsetHeight / 2) + "px"' ); - var linkFix = logoa.appendChild( logoa.cloneNode() ); + linkFix = logoa.appendChild( logoa.cloneNode() ); linkFix.style.position = 'absolute'; linkFix.style.height = '100%'; linkFix.style.width = '100%'; @@ -69,22 +77,23 @@ if ( isMSIE55 ) { } // fix ie6 disappering float bug -window.relativeforfloats = function() { - var bc = document.getElementById( 'bodyContent' ); +relativeforfloats = window.relativeforfloats = function () { + var bc, tables, divs; + bc = document.getElementById( 'bodyContent' ); if ( bc ) { - var tables = bc.getElementsByTagName( 'table' ); - var divs = bc.getElementsByTagName( 'div' ); + tables = bc.getElementsByTagName( 'table' ); + divs = bc.getElementsByTagName( 'div' ); setrelative( tables ); setrelative( divs ); } }; -window.setrelative = function( nodes ) { +setrelative = window.setrelative = function ( nodes ) { var i = 0; while ( i < nodes.length ) { - if( ( ( nodes[i].style.float && nodes[i].style.float != ( 'none' ) || - ( nodes[i].align && nodes[i].align != ( 'none' ) ) ) && - ( !nodes[i].style.position || nodes[i].style.position != 'relative' ) ) ) + if( ( ( nodes[i].style.float && nodes[i].style.float !== ( 'none' ) || + ( nodes[i].align && nodes[i].align !== ( 'none' ) ) ) && + ( !nodes[i].style.position || nodes[i].style.position !== 'relative' ) ) ) { nodes[i].style.position = 'relative'; } @@ -93,30 +102,31 @@ window.setrelative = function( nodes ) { }; // Expand links for printing -String.prototype.hasClass = function( classWanted ) { - var classArr = this.split(/\s/); - for ( var i = 0; i < classArr.length; i++ ) { - if ( classArr[i].toLowerCase() == classWanted.toLowerCase() ) { +hasClass = function ( classText, classWanted ) { + var i = 0, classArr = classText.split(/\s/); + for ( i = 0; i < classArr.length; i++ ) { + if ( classArr[i].toLowerCase() === classWanted.toLowerCase() ) { return true; } } return false; }; -window.expandedURLs = undefined; +expandedURLs = window.expandedURLs = undefined; -window.onbeforeprint = function() { - expandedURLs = []; +window.onbeforeprint = function () { + var allLinks, contentEl, expandedLink, expandedText, i; - var contentEl = document.getElementById( 'content' ); + expandedURLs = []; + contentEl = document.getElementById( 'content' ); if ( contentEl ) { - var allLinks = contentEl.getElementsByTagName( 'a' ); + allLinks = contentEl.getElementsByTagName( 'a' ); - for ( var i = 0; i < allLinks.length; i++ ) { - if ( allLinks[i].className.hasClass( 'external' ) && !allLinks[i].className.hasClass( 'free' ) ) { - var expandedLink = document.createElement( 'span' ); - var expandedText = document.createTextNode( ' (' + allLinks[i].href + ')' ); + for ( i = 0; i < allLinks.length; i++ ) { + if ( hasClass( allLinks[i].className, 'external' ) && !hasClass( allLinks[i].className, 'free' ) ) { + expandedLink = document.createElement( 'span' ); + expandedText = document.createTextNode( ' (' + allLinks[i].href + ')' ); expandedLink.appendChild( expandedText ); allLinks[i].parentNode.insertBefore( expandedLink, allLinks[i].nextSibling ); expandedURLs[i] = expandedLink; @@ -132,3 +142,5 @@ window.onafterprint = function() { } } }; + +}( mediaWiki, jQuery ) ); diff --git a/skins/common/ajax.js b/skins/common/ajax.js index 121f9d12..ca74b384 100644 --- a/skins/common/ajax.js +++ b/skins/common/ajax.js @@ -1,15 +1,23 @@ -// remote scripting library -// (c) copyright 2005 modernmethod, inc -window.sajax_debug_mode = false; -window.sajax_request_type = 'GET'; +/** + * Remote Scripting Library + * Copyright 2005 modernmethod, inc + * Under the open source BSD license + * http://www.modernmethod.com/sajax/ + */ + +/*jshint camelcase:false, onevar:false */ +/*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, + * 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. */ -window.sajax_debug = function(text) { - if (!sajax_debug_mode) return false; +function debug( text ) { + if ( !window.sajax_debug_mode ) { + return false; + } var e = document.getElementById( 'sajax_debug' ); @@ -33,36 +41,36 @@ window.sajax_debug = function(text) { e.appendChild( m ); return true; -}; +} /** * Compatibility wrapper for creating a new XMLHttpRequest object. */ -window.sajax_init_object = function() { - sajax_debug( 'sajax_init_object() called..' ); - var A; +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 ( e ) { + a = new XMLHttpRequest(); + } catch ( xhrE ) { try { - A = new ActiveXObject( 'Msxml2.XMLHTTP' ); - } catch ( e ) { + a = new window.ActiveXObject( 'Msxml2.XMLHTTP' ); + } catch ( msXmlE ) { try { - A = new ActiveXObject( 'Microsoft.XMLHTTP' ); - } catch ( oc ) { - A = null; + a = new window.ActiveXObject( 'Microsoft.XMLHTTP' ); + } catch ( msXhrE ) { + a = null; } } } - if ( !A ) { - sajax_debug( 'Could not create connection object.' ); + if ( !a ) { + debug( 'Could not create connection object.' ); } - return A; -}; + return a; +} /** * Perform an AJAX call to MediaWiki. Calls are handled by AjaxDispatcher.php @@ -80,13 +88,13 @@ window.sajax_init_object = function() { * (1, 2, 3) as the parameter list, and will show the result in the element * with id = showFoo */ -window.sajax_do_call = function(func_name, args, target) { - var i, x, n; +function doAjaxRequest( func_name, args, target ) { + var i, x; var uri; var post_data; uri = mw.util.wikiScript() + '?action=ajax'; - if ( sajax_request_type == 'GET' ) { - if ( uri.indexOf( '?' ) == -1 ) { + if ( window.sajax_request_type === 'GET' ) { + if ( uri.indexOf( '?' ) === -1 ) { uri = uri + '?rs=' + encodeURIComponent( func_name ); } else { uri = uri + '&rs=' + encodeURIComponent( func_name ); @@ -102,47 +110,47 @@ window.sajax_do_call = function(func_name, args, target) { post_data = post_data + '&rsargs[]=' + encodeURIComponent( args[i] ); } } - x = sajax_init_object(); + x = createXhr(); if ( !x ) { alert( 'AJAX not supported' ); return false; } try { - x.open( sajax_request_type, uri, true ); + x.open( window.sajax_request_type, uri, true ); } catch ( e ) { - if ( window.location.hostname == 'localhost' ) { - alert( "Your browser blocks XMLHttpRequest to 'localhost', try using a real hostname for development/testing." ); + if ( location.hostname === 'localhost' ) { + alert( 'Your browser blocks XMLHttpRequest to "localhost", try using a real hostname for development/testing.' ); } throw e; } - if ( sajax_request_type == 'POST' ) { + 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 ) { + x.onreadystatechange = function () { + if ( x.readyState !== 4 ) { return; } - sajax_debug( 'received (' + x.status + ' ' + x.statusText + ') ' + x.responseText ); + 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' ) { + if ( typeof target === 'function' ) { target( x ); - } else if ( typeof( target ) == 'object' ) { - if ( target.tagName == 'INPUT' ) { - if ( x.status == 200 ) { + } 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 ) { + if ( x.status === 200 ) { target.innerHTML = x.responseText; } else { target.innerHTML = '
Error: ' + x.status + @@ -150,24 +158,37 @@ window.sajax_do_call = function(func_name, args, target) { } } } else { - alert( 'bad target for sajax_do_call: not a function or object: ' + target ); + alert( 'Bad target for sajax_do_call: not a function or object: ' + target ); } }; - sajax_debug( func_name + ' uri = ' + uri + ' / post = ' + post_data ); + debug( func_name + ' uri = ' + uri + ' / post = ' + post_data ); x.send( post_data ); - sajax_debug( func_name + ' waiting..' ); - delete x; + debug( func_name + ' waiting..' ); return true; -}; +} /** - * @return boolean whether the browser supports XMLHttpRequest + * @return {boolean} Whether the browser supports AJAX */ -window.wfSupportsAjax = function() { - var request = sajax_init_object(); +function wfSupportsAjax() { + var request = createXhr(); var supportsAjax = request ? true : false; - delete request; + 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/skins/common/commonContent.css b/skins/common/commonContent.css index a550d97a..14d39b92 100644 --- a/skins/common/commonContent.css +++ b/skins/common/commonContent.css @@ -14,6 +14,43 @@ padding: 5px; font-size: 95%; } + +/** + * We want to display the ToC element with intrinsic width in block mode. The fit-content + * value for width is however not supported by large groups of browsers. + * + * We use display:table. Even though it should only contain other table-* display + * elements, there are no known problems with using this. + * + * Because IE < 8, FF 2 and other older browsers don't support display:table, we fallback to + * using inline-block mode, which features at least intrinsic width, but won't clear preceding + * inline elements. In practice inline elements surrounding the TOC are uncommon enough that + * this is an acceptable sacrifice. + */ +#toc, +.toc { + display: -moz-inline-block; + display: inline-block; + display: table; + + /* IE7 and earlier */ + zoom: 1; + *display: inline; + + padding: 7px; +} + +/* CSS for backwards-compatibility with cached page renders and creative uses in wikitext */ +table#toc, +table.toc { + border-collapse: collapse; +} +/* Remove additional paddings inside table-cells that are not present in
s */ +table#toc td, +table.toc td { + padding: 0; +} + #toc h2, .toc h2 { display: inline; @@ -96,6 +133,7 @@ html .thumbcaption { div.magnify { border: none !important; background: none !important; + margin-left: 3px; } div.magnify a, div.magnify img { display: block; @@ -128,6 +166,13 @@ img.thumbborder { #userlogin, #userloginForm { border: solid 1px #cccccc; padding: 1.2em; - margin: .5em; - float: left; + margin: 0.5em; +} + +#loginend { + margin: 0.5em; +} + +#loginend table { + width: 100%; } diff --git a/skins/common/commonElements.css b/skins/common/commonElements.css index 2fa0cbaf..76ec4af7 100644 --- a/skins/common/commonElements.css +++ b/skins/common/commonElements.css @@ -86,15 +86,9 @@ h6 { h1 { font-size: 188%; } -h1 .editsection { - font-size: 53%; -} h2 { font-size: 150%; } -h2 .editsection { - font-size: 67%; -} h3, h4, h5, @@ -105,28 +99,14 @@ h6 { h3 { font-size: 132%; } -h3 .editsection { - font-size: 76%; - font-weight: normal; -} h4 { font-size: 116%; } -h4 .editsection { - font-size: 86%; - font-weight: normal; } h5 { - font-size: 100%; -} -h5 .editsection { - font-weight: normal; + font-size: 108%; } h6 { - font-size: 80%; -} -h6 .editsection { - font-size: 125%; - font-weight: normal; + font-size: 100%; } /* Some space under the headers in the content area */ @@ -198,7 +178,7 @@ code { } pre, .mw-code { padding: 1em; - border: 1px dashed #2f6fab; + border: 1px solid #ddd; color: black; background-color: #f9f9f9; } diff --git a/skins/common/commonPrint.css b/skins/common/commonPrint.css index 6cb213f2..58628772 100644 --- a/skins/common/commonPrint.css +++ b/skins/common/commonPrint.css @@ -111,7 +111,7 @@ div#jump-to-nav, div.top, div#column-one, #colophon, -.editsection, +.mw-editsection, .toctoggle, .tochidden, div#f-poweredbyico, @@ -127,6 +127,7 @@ tr.mw-metadata-show-hide-extended, span.mw-filepage-other-resolutions, #filetoc, .usermessage, +.patrollink, #mw-navigation { /* Hides all the elements irrelevant for printing */ display: none; @@ -191,7 +192,7 @@ a:link, a:visited { #content a.external.text:after, #content a.external.autonumber:after { /* Expand URLs for printing */ - content: " (" attr(href) ") "; + content: " (" attr(href) ")"; } #globalWrapper { @@ -352,7 +353,7 @@ a.sortheader { .wikitable, .thumb, img { page-break-inside: avoid; } -h2, h3, h4, h5, h6, h7 { +h2, h3, h4, h5, h6 { page-break-after: avoid; } p { diff --git a/skins/common/config.css b/skins/common/config.css index 39206c3a..79780da9 100644 --- a/skins/common/config.css +++ b/skins/common/config.css @@ -88,7 +88,13 @@ } .config-input-check { - margin-left: 10em; + margin-left: 3.7em; + margin-right: 2em; + margin-bottom: 0.25em; +} + +.config-input-check input { + margin-left: -1em; } .error { diff --git a/skins/common/config.js b/skins/common/config.js index b1e28aba..fb8edc1f 100644 --- a/skins/common/config.js +++ b/skins/common/config.js @@ -1,5 +1,5 @@ ( function ( $ ) { - $( document ).ready( function () { + $( function () { var $label, labelText; function syncText() { @@ -25,7 +25,7 @@ .find( '.mw-help-field-data' ) .slideToggle( 'fast' ); } ); - + // Show/hide code for DB-specific options // FIXME: Do we want slow, fast, or even non-animated (instantaneous) showing/hiding here? $( '.dbRadio' ).each( function () { @@ -40,12 +40,12 @@ $wrapper.show( 'slow' ); } } ); - + // Scroll to the bottom of upgrade log $( '#config-live-log' ).children( 'textarea' ).each( function () { this.scrollTop = this.scrollHeight; } ); - + // Show/hide Creative Commons thingy $( '.licenseRadio' ).click( function () { var $wrapper = $( '#config-cc-wrapper' ); @@ -55,7 +55,7 @@ $wrapper.hide( 'slow' ); } } ); - + // Show/hide random stuff (email, upload) $( '.showHideRadio' ).click( function () { var $wrapper = $( '#' + $(this).attr( 'rel' ) ); @@ -88,7 +88,7 @@ $textbox.prop( 'readonly', true ).closest( '.config-block' ).slideUp( 'fast' ); } } ); - + // Synchronize radio button label for sitename with textbox $label = $( 'label[for=config__NamespaceType_site-name]' ); labelText = $label.text(); @@ -97,7 +97,7 @@ // Show/Hide memcached servers when needed $( 'input[name$="config_wgMainCacheType"]' ).change( function () { - var $memc = $( "#config-memcachewrapper" ); + var $memc = $( '#config-memcachewrapper' ); if( $( 'input[name$="config_wgMainCacheType"]:checked' ).val() === 'memcached' ) { $memc.show( 'slow' ); } else { diff --git a/skins/common/images/Arr_u.png b/skins/common/images/Arr_u.png index 6132836b..1aa543af 100644 Binary files a/skins/common/images/Arr_u.png and b/skins/common/images/Arr_u.png differ diff --git a/skins/common/images/ar/button_headline.png b/skins/common/images/ar/button_headline.png index 04fb8f11..398e5614 100644 Binary files a/skins/common/images/ar/button_headline.png and b/skins/common/images/ar/button_headline.png differ diff --git a/skins/common/images/ar/button_nowiki.png b/skins/common/images/ar/button_nowiki.png index 12b986b4..743ea61b 100644 Binary files a/skins/common/images/ar/button_nowiki.png and b/skins/common/images/ar/button_nowiki.png differ diff --git a/skins/common/images/arrow_disabled_left_25.png b/skins/common/images/arrow_disabled_left_25.png index 8f979aab..83df0684 100644 Binary files a/skins/common/images/arrow_disabled_left_25.png and b/skins/common/images/arrow_disabled_left_25.png differ diff --git a/skins/common/images/arrow_disabled_right_25.png b/skins/common/images/arrow_disabled_right_25.png index 11022f62..aa4fbf8c 100644 Binary files a/skins/common/images/arrow_disabled_right_25.png and b/skins/common/images/arrow_disabled_right_25.png differ diff --git a/skins/common/images/arrow_right_25.png b/skins/common/images/arrow_right_25.png index 9e1b550c..3f8fee38 100644 Binary files a/skins/common/images/arrow_right_25.png and b/skins/common/images/arrow_right_25.png differ diff --git a/skins/common/images/button_hr.png b/skins/common/images/button_hr.png index 19e4ad45..47e1ca40 100644 Binary files a/skins/common/images/button_hr.png and b/skins/common/images/button_hr.png differ diff --git a/skins/common/images/button_nowiki.png b/skins/common/images/button_nowiki.png index c647de2b..2ba818de 100644 Binary files a/skins/common/images/button_nowiki.png and b/skins/common/images/button_nowiki.png differ diff --git a/skins/common/images/button_sig.png b/skins/common/images/button_sig.png index ff7348a9..fe34b3fb 100644 Binary files a/skins/common/images/button_sig.png and b/skins/common/images/button_sig.png differ diff --git a/skins/common/images/button_template.png b/skins/common/images/button_template.png index 53b6f92f..94d9d0b9 100644 Binary files a/skins/common/images/button_template.png and b/skins/common/images/button_template.png differ diff --git a/skins/common/images/critical-32.png b/skins/common/images/critical-32.png index dce5667a..9b38e6a2 100644 Binary files a/skins/common/images/critical-32.png and b/skins/common/images/critical-32.png differ diff --git a/skins/common/images/fa/button_nowiki.png b/skins/common/images/fa/button_nowiki.png index 12b986b4..743ea61b 100644 Binary files a/skins/common/images/fa/button_nowiki.png and b/skins/common/images/fa/button_nowiki.png differ diff --git a/skins/common/images/feed-icon.png b/skins/common/images/feed-icon.png index 7188fa23..00f49f6c 100644 Binary files a/skins/common/images/feed-icon.png and b/skins/common/images/feed-icon.png differ diff --git a/skins/common/images/icons/fileicon-psd.png b/skins/common/images/icons/fileicon-psd.png index 5bd40cb0..598f190e 100644 Binary files a/skins/common/images/icons/fileicon-psd.png and b/skins/common/images/icons/fileicon-psd.png differ diff --git a/skins/common/images/magnify-clip-rtl.png b/skins/common/images/magnify-clip-rtl.png index cfddc279..ff85c077 100644 Binary files a/skins/common/images/magnify-clip-rtl.png and b/skins/common/images/magnify-clip-rtl.png differ diff --git a/skins/common/images/question-small.png b/skins/common/images/question-small.png new file mode 100644 index 00000000..f7405d26 Binary files /dev/null and b/skins/common/images/question-small.png differ diff --git a/skins/common/images/question.svg b/skins/common/images/question.svg new file mode 100644 index 00000000..27973053 --- /dev/null +++ b/skins/common/images/question.svg @@ -0,0 +1,12 @@ + + + + + + diff --git a/skins/common/images/tick-32.png b/skins/common/images/tick-32.png index dfde1707..34cfa9ce 100644 Binary files a/skins/common/images/tick-32.png and b/skins/common/images/tick-32.png differ diff --git a/skins/common/images/warning-32.png b/skins/common/images/warning-32.png index b14a8315..0400734c 100644 Binary files a/skins/common/images/warning-32.png and b/skins/common/images/warning-32.png differ diff --git a/skins/common/oldshared.css b/skins/common/oldshared.css index 6dcdf6f1..eea8b8ee 100644 --- a/skins/common/oldshared.css +++ b/skins/common/oldshared.css @@ -11,24 +11,15 @@ h1 { font-size: 2em; } h2 { font-size: 1.5em; } h3 { font-size: 1.17em; } -h5 { font-size: .83em; } -h6 { font-size: .75em; } +h4 { font-size: 1.11em; } +h5 { font-size: 1.05em; } +h6 { font-size: 1em; } h1, h2, h3, h4, h5, h6 { font-weight: bolder; } /* Now the custom parts */ -/* Make edit sections (which are inside h# tags) normal-sized */ -.editsection { - font-weight: normal; -} -h1 .editsection { font-size: 50%; } -h2 .editsection { font-size: 66.7%; } -h3 .editsection { font-size: 85.5%; } -h5 .editsection { font-size: 120%; } -h6 .editsection { font-size: 133%; } - #footer { clear: both } /* images */ /* @noflip */ @@ -93,6 +84,7 @@ div.magnify { float: right; border: none !important; background: none !important; + margin-left: 3px; } div.magnify a, div.magnify img { @@ -130,6 +122,25 @@ img { border: none; } padding: 5px; font-size: 95%; text-align: center; + display: -moz-inline-block; + display: inline-block; + display: table; + + /* IE7 and earlier */ + zoom: 1; + *display: inline; + + padding: 7px; +} +/* CSS for backwards-compatibility with cached page renders and creative uses in wikitext */ +table#toc, +table.toc { + border-collapse: collapse; +} +/* Remove additional paddings inside table-cells that are not present in
s */ +table#toc td, +table.toc td { + padding: 0; } #toc h2, .toc h2 { @@ -161,9 +172,6 @@ img { border: none; } } /* preference page with js-genrated toc */ -#mw-pref-clear { - clear: both; -} #preftoc { float: left; margin: 1em 1em 1em 1em; @@ -283,7 +291,7 @@ li span.deleted { font-style: italic; } -/* Classes for EXIF data display */ +/* Classes for Exif data display */ table.mw_metadata { margin-left: 0.5em; } @@ -458,4 +466,4 @@ html > body.rtl div#bodyContent ul#filetoc { display: block; } -/* RTL specific CSS ends here **/ \ No newline at end of file +/* RTL specific CSS ends here **/ diff --git a/skins/common/protect.js b/skins/common/protect.js index a23c0cbd..dc142ca9 100644 --- a/skins/common/protect.js +++ b/skins/common/protect.js @@ -1,6 +1,7 @@ +( function ( mw, $ ) { -window.ProtectionForm = { - 'existingMatch': false, +var ProtectionForm = window.ProtectionForm = { + existingMatch: false, /** * Set up the protection chaining interface (i.e. "unlock move permissions" checkbox) @@ -12,40 +13,47 @@ window.ProtectionForm = { * numTypes The number of protection types * existingMatch True if all the existing expiry times match */ - 'init': function( opts ) { - if( !( document.createTextNode && document.getElementById && document.getElementsByTagName ) ) + init: function ( opts ) { + var box, boxbody, row, cell, check, label; + + if ( !( document.createTextNode && document.getElementById && document.getElementsByTagName ) ) { return false; + } - var box = document.getElementById( opts.tableId ); - if( !box ) + box = document.getElementById( opts.tableId ); + if ( !box ) { return false; - - var boxbody = box.getElementsByTagName('tbody')[0]; - var row = document.createElement( 'tr' ); + } + + boxbody = box.getElementsByTagName( 'tbody' )[0]; + row = document.createElement( 'tr' ); boxbody.insertBefore( row, boxbody.firstChild.nextSibling ); this.existingMatch = opts.existingMatch; - var cell = document.createElement( 'td' ); + cell = document.createElement( 'td' ); row.appendChild( cell ); // If there is only one protection type, there is nothing to chain - if( opts.numTypes > 1 ) { - var check = document.createElement( 'input' ); + if ( opts.numTypes > 1 ) { + check = document.createElement( 'input' ); check.id = 'mwProtectUnchained'; check.type = 'checkbox'; - cell.appendChild( check ); - addClickHandler( check, function() { ProtectionForm.onChainClick(); } ); + $( check ).click( function () { + ProtectionForm.onChainClick(); + } ); - cell.appendChild( document.createTextNode( ' ' ) ); - var label = document.createElement( 'label' ); + label = document.createElement( 'label' ); label.htmlFor = 'mwProtectUnchained'; label.appendChild( document.createTextNode( opts.labelText ) ); + + cell.appendChild( check ); + cell.appendChild( document.createTextNode( ' ' ) ); cell.appendChild( label ); check.checked = !this.areAllTypesMatching(); this.enableUnchainedInputs( check.checked ); } - + $( '#mwProtect-reason' ).byteLimit( 180 ); this.updateCascadeCheckbox(); @@ -56,17 +64,19 @@ window.ProtectionForm = { /** * Sets the disabled attribute on the cascade checkbox depending on the current selected levels */ - 'updateCascadeCheckbox': function() { + updateCascadeCheckbox: function () { + var i, lists, items, selected; + // For non-existent titles, there is no cascade option - if( !document.getElementById( 'mwProtect-cascade' ) ) { + if ( !document.getElementById( 'mwProtect-cascade' ) ) { return; } - var lists = this.getLevelSelectors(); - for( var i = 0; i < lists.length; i++ ) { - if( lists[i].selectedIndex > -1 ) { - var items = lists[i].getElementsByTagName( 'option' ); - var selected = items[ lists[i].selectedIndex ].value; - if( !this.isCascadeableLevel(selected) ) { + lists = this.getLevelSelectors(); + for ( i = 0; i < lists.length; i++ ) { + if ( lists[i].selectedIndex > -1 ) { + items = lists[i].getElementsByTagName( 'option' ); + selected = items[ lists[i].selectedIndex ].value; + if ( !this.isCascadeableLevel( selected ) ) { document.getElementById( 'mwProtect-cascade' ).checked = false; document.getElementById( 'mwProtect-cascade' ).disabled = true; return; @@ -81,7 +91,7 @@ window.ProtectionForm = { * @param level {String} * @return {Boolean} */ - 'isCascadeableLevel': function( level ) { + isCascadeableLevel: function ( level ) { var cascadeLevels, len, i; cascadeLevels = mw.config.get( 'wgCascadeableLevels' ); @@ -102,9 +112,10 @@ window.ProtectionForm = { * * @param source Element Level selector that changed */ - 'updateLevels': function(source) { - if( !this.isUnchained() ) + updateLevels: function ( source ) { + if ( !this.isUnchained() ) { this.setAllSelectors( source.selectedIndex ); + } this.updateCascadeCheckbox(); }, @@ -115,22 +126,24 @@ window.ProtectionForm = { * @param source Element expiry input that changed */ - 'updateExpiry': function(source) { - if( !this.isUnchained() ) { - var expiry = source.value; - this.forEachExpiryInput(function(element) { + updateExpiry: function ( source ) { + var expiry, listId, list; + + if ( !this.isUnchained() ) { + expiry = source.value; + this.forEachExpiryInput( function ( element ) { element.value = expiry; - }); + } ); } - var listId = source.id.replace( /^mwProtect-(\w+)-expires$/, 'mwProtectExpirySelection-$1' ); - var list = document.getElementById( listId ); - if (list && list.value != 'othertime' ) { + listId = source.id.replace( /^mwProtect-(\w+)-expires$/, 'mwProtectExpirySelection-$1' ); + list = document.getElementById( listId ); + if ( list && list.value !== 'othertime' ) { if ( this.isUnchained() ) { list.value = 'othertime'; } else { - this.forEachExpirySelector(function(element) { + this.forEachExpirySelector( function ( element ) { element.value = 'othertime'; - }); + } ); } } }, @@ -141,15 +154,16 @@ window.ProtectionForm = { * * @param source Element expiry selector that changed */ - 'updateExpiryList': function(source) { - if( !this.isUnchained() ) { - var expiry = source.value; - this.forEachExpirySelector(function(element) { + updateExpiryList: function ( source ) { + var expiry; + if ( !this.isUnchained() ) { + expiry = source.value; + this.forEachExpirySelector( function ( element ) { element.value = expiry; - }); - this.forEachExpiryInput(function(element) { + } ); + this.forEachExpiryInput( function ( element ) { element.value = ''; - }); + } ); } }, @@ -157,8 +171,8 @@ window.ProtectionForm = { * Update chain status and enable/disable various bits of the UI * when the user changes the "unlock move permissions" checkbox */ - 'onChainClick': function() { - if( this.isUnchained() ) { + onChainClick: function () { + if ( this.isUnchained() ) { this.enableUnchainedInputs( true ); } else { this.setAllSelectors( this.getMaxLevel() ); @@ -170,16 +184,17 @@ window.ProtectionForm = { /** * Returns true if the named attribute in all objects in the given array are matching */ - 'matchAttribute' : function( objects, attrName ) { - var value = null; + matchAttribute: function ( objects, attrName ) { + var i, element, value; // Check levels - for ( var i = 0; i < objects.length; i++ ) { - var element = objects[i]; - if ( value == null ) { + value = null; + for ( i = 0; i < objects.length; i++ ) { + element = objects[i]; + if ( value === null ) { value = element[attrName]; } else { - if ( value != element[attrName] ) { + if ( value !== element[attrName] ) { return false; } } @@ -192,7 +207,7 @@ window.ProtectionForm = { * * @return boolean */ - 'areAllTypesMatching': function() { + areAllTypesMatching: function () { return this.existingMatch && this.matchAttribute( this.getLevelSelectors(), 'selectedIndex' ) && this.matchAttribute( this.getExpirySelectors(), 'selectedIndex' ) @@ -204,7 +219,7 @@ window.ProtectionForm = { * * @return bool */ - 'isUnchained': function() { + isUnchained: function () { var element = document.getElementById( 'mwProtectUnchained' ); return element ? element.checked @@ -214,13 +229,13 @@ window.ProtectionForm = { /** * Find the highest protection level in any selector */ - 'getMaxLevel': function() { + getMaxLevel: function () { var maxIndex = -1; - this.forEachLevelSelector(function(element) { - if (element.selectedIndex > maxIndex) { + this.forEachLevelSelector( function ( element ) { + if ( element.selectedIndex > maxIndex ) { maxIndex = element.selectedIndex; } - }); + } ); return maxIndex; }, @@ -229,12 +244,12 @@ window.ProtectionForm = { * * @param index int Protection level */ - 'setAllSelectors': function(index) { - this.forEachLevelSelector(function(element) { - if (element.selectedIndex != index) { + setAllSelectors: function ( index ) { + this.forEachLevelSelector( function ( element ) { + if ( element.selectedIndex !== index ) { element.selectedIndex = index; } - }); + } ); }, /** @@ -242,10 +257,12 @@ window.ProtectionForm = { * * @param func callable Callback function */ - 'forEachLevelSelector': function(func) { - var selectors = this.getLevelSelectors(); - for (var i = 0; i < selectors.length; i++) { - func(selectors[i]); + forEachLevelSelector: function ( func ) { + var i, selectors; + + selectors = this.getLevelSelectors(); + for ( i = 0; i < selectors.length; i++ ) { + func( selectors[i] ); } }, @@ -254,12 +271,14 @@ window.ProtectionForm = { * * @return Array */ - 'getLevelSelectors': function() { - var all = document.getElementsByTagName("select"); - var ours = []; - for (var i = 0; i < all.length; i++) { - var element = all[i]; - if (element.id.match(/^mwProtect-level-/)) { + getLevelSelectors: function () { + var i, ours, all, element; + + all = document.getElementsByTagName( 'select' ); + ours = []; + for ( i = 0; i < all.length; i++ ) { + element = all[i]; + if ( element.id.match( /^mwProtect-level-/ ) ) { ours[ours.length] = element; } } @@ -271,10 +290,12 @@ window.ProtectionForm = { * * @param func callable Callback function */ - 'forEachExpiryInput': function(func) { - var inputs = this.getExpiryInputs(); - for (var i = 0; i < inputs.length; i++) { - func(inputs[i]); + forEachExpiryInput: function ( func ) { + var i, inputs; + + inputs = this.getExpiryInputs(); + for ( i = 0; i < inputs.length; i++ ) { + func( inputs[i] ); } }, @@ -283,12 +304,14 @@ window.ProtectionForm = { * * @return Array */ - 'getExpiryInputs': function() { - var all = document.getElementsByTagName("input"); - var ours = []; - for (var i = 0; i < all.length; i++) { - var element = all[i]; - if (element.name.match(/^mwProtect-expiry-/)) { + getExpiryInputs: function () { + var i, all, element, ours; + + all = document.getElementsByTagName( 'input' ); + ours = []; + for ( i = 0; i < all.length; i++ ) { + element = all[i]; + if ( element.name.match( /^mwProtect-expiry-/ ) ) { ours[ours.length] = element; } } @@ -299,10 +322,12 @@ window.ProtectionForm = { * Apply a callback to each expiry selector list * @param func callable Callback function */ - 'forEachExpirySelector': function(func) { - var inputs = this.getExpirySelectors(); - for (var i = 0; i < inputs.length; i++) { - func(inputs[i]); + forEachExpirySelector: function ( func ) { + var i, inputs; + + inputs = this.getExpirySelectors(); + for ( i = 0; i < inputs.length; i++ ) { + func( inputs[i] ); } }, @@ -311,12 +336,14 @@ window.ProtectionForm = { * * @return Array */ - 'getExpirySelectors': function() { - var all = document.getElementsByTagName("select"); - var ours = []; - for (var i = 0; i < all.length; i++) { - var element = all[i]; - if (element.id.match(/^mwProtectExpirySelection-/)) { + getExpirySelectors: function () { + var i, all, ours, element; + + all = document.getElementsByTagName( 'select' ); + ours = []; + for ( i = 0; i < all.length; i++ ) { + element = all[i]; + if ( element.id.match( /^mwProtectExpirySelection-/ ) ) { ours[ours.length] = element; } } @@ -328,30 +355,33 @@ window.ProtectionForm = { * * @param val boolean Enable? */ - 'enableUnchainedInputs': function(val) { + enableUnchainedInputs: function ( val ) { var first = true; - this.forEachLevelSelector(function(element) { - if (first) { + + this.forEachLevelSelector( function ( element ) { + if ( first ) { first = false; } else { element.disabled = !val; } - }); + } ); first = true; - this.forEachExpiryInput(function(element) { - if (first) { + this.forEachExpiryInput( function ( element ) { + if ( first ) { first = false; } else { element.disabled = !val; } - }); + } ); first = true; - this.forEachExpirySelector(function(element) { - if (first) { + this.forEachExpirySelector( function ( element ) { + if ( first ) { first = false; } else { element.disabled = !val; } - }); + } ); } }; + +}( mediaWiki, jQuery ) ); diff --git a/skins/common/shared.css b/skins/common/shared.css index 6e1c94fd..ac7265a8 100644 --- a/skins/common/shared.css +++ b/skins/common/shared.css @@ -59,9 +59,8 @@ input[dir="rtl"] { } /* Default style for semantic tags */ -abbr, -acronym, -.explain { +abbr[title], +.explain[title] { border-bottom: 1px dotted; cursor: help; } @@ -127,21 +126,6 @@ span.texhtml { cursor: pointer; } -/* Edit section links */ -/* Correct directionality when page dir is different from site/user dir */ -/* @noflip */ -.mw-content-ltr .editsection, -.mw-content-rtl .mw-content-ltr .editsection { - float: right; - margin-left: 5px; -} -/* @noflip */ -.mw-content-rtl .editsection, -.mw-content-ltr .mw-content-rtl .editsection { - float: left; - margin-right: 5px; -} - /** * File description page */ @@ -235,6 +219,32 @@ td.mw-label { .prefsection table.mw-htmlform-matrix { width: auto; } + +.mw-icon-question { + /* @embed */ + background: url('images/question-small.png') no-repeat; + /* SVG support using a transparent gradient to guarantee cross-browser + * compatibility (browsers able to understand gradient syntax support also SVG) + * lifted from #pt-login css rule in skins/vector/screen.css */ + /* @embed */ + background: -webkit-linear-gradient(transparent, transparent), url('images/question.svg') no-repeat; + /* @embed */ + background: linear-gradient(transparent, transparent), url('images/question.svg') 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); +} + td.mw-submit { white-space: nowrap; } @@ -525,49 +535,57 @@ table.collapsed tr.collapsable { } /* success and error messages */ +.error, +.warning, .success { - color: green; font-size: larger; } +.error { + color: #cc0000; +} .warning { - color: #FFA500; /* orange */ - font-size: larger; + color: #705000; } -.error { - color: red; - font-size: larger; +.success { + color: #009000; } + .errorbox, .warningbox, .successbox { - font-size: larger; - border: 2px solid; + border: 1px solid; padding: .5em 1em; - float: left; - margin-bottom: 2em; - color: #000; -} -.errorbox { - border-color: red; - background-color: #fff2f2; -} -.warningbox { - border-color: #FF8C00; /* darkorange */ - background-color: #FFFFC0; -} -.successbox { - border-color: green; - background-color: #dfd; + margin-bottom: 1em; + display: -moz-inline-block; + display: inline-block; + zoom: 1; + *display: inline; } .errorbox h2, .warningbox h2, .successbox h2 { font-size: 1em; + color: inherit; font-weight: bold; display: inline; margin: 0 .5em 0 0; border: none; } +.errorbox { + color: #cc0000; + border-color: #fac5c5; + background-color: #fae3e3; +} +.warningbox { + color: #705000; + border-color: #fde29b; + background-color: #fdf1d1; +} +.successbox { + color: #009000; + border-color: #b7fdb5; + background-color: #e1fddf; +} /* general info/warning box for SP */ .mw-infobox { @@ -684,7 +702,7 @@ ul#filetoc { padding-right: 2em; } -/* Classes for EXIF data display */ +/* Classes for Exif data display */ table.mw_metadata { font-size: 0.8em; margin-left: 0.5em; @@ -818,6 +836,69 @@ div.gallerytext { 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; + opacity:.8; + filter:alpha(opacity=80); + zoom: 1; + background-color:white; + 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; +} + +ul.mw-gallery-packed-hover div.gallerytext, +ul.mw-gallery-packed-overlay div.gallerytext { + opacity: 1; + position: relative; /* Resets opacity in old IE */ +} + + .mw-ajax-loader { /* @embed */ background-image: url(images/ajax-loader.gif); @@ -1033,6 +1114,7 @@ ol:lang(or) li { direction: ltr; unicode-bidi: embed; } +.diff-multi, .diff-otitle, .diff-ntitle, .diff-lineno { @@ -1092,9 +1174,37 @@ table.floatleft { z-index: 99; } -.editsection, .toctoggle { +.mw-editsection, +.toctoggle { -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } + +/* Display editsection links smaller and next to headings */ +.mw-editsection { + font-size: small; + font-weight: normal; + margin-left: 1em; + vertical-align: baseline; + /* Reset line-height; headings tend to have it set to larger values */ + line-height: 1em; + /* As .mw-editsection is a (inline element), it is treated as part */ + /* of the heading content when selecting text by multiple clicks and thus */ + /* selected together with heading content, despite the user-select: none; */ + /* rule set above. This enforces non-selection without changing the look. */ + display: inline-block; +} + +/* Correct directionality when page dir is different from site/user dir */ +/* @noflip */ +.mw-content-ltr .mw-editsection, +.mw-content-rtl .mw-content-ltr .mw-editsection { + margin-left: 1em; +} +/* @noflip */ +.mw-content-rtl .mw-editsection, +.mw-content-ltr .mw-content-rtl .mw-editsection { + margin-right: 1em; +} diff --git a/skins/common/upload.js b/skins/common/upload.js index df819e19..d639f63a 100644 --- a/skins/common/upload.js +++ b/skins/common/upload.js @@ -1,12 +1,15 @@ +/*jshint camelcase:false */ ( function ( mw, $ ) { -var ajaxUploadDestCheck = mw.config.get( 'wgAjaxUploadDestCheck' ), - fileExtensions = mw.config.get( 'wgFileExtensions' ); - -window.licenseSelectorCheck = function() { - var selector = document.getElementById( "wpLicense" ); - var selection = selector.options[selector.selectedIndex].value; - if( selector.selectedIndex > 0 ) { - if( selection == "" ) { +var licenseSelectorCheck, wgUploadWarningObj, wgUploadLicenseObj, fillDestFilename, + ajaxUploadDestCheck = mw.config.get( 'wgAjaxUploadDestCheck' ), + fileExtensions = mw.config.get( 'wgFileExtensions' ), + $spinnerDestCheck, $spinnerLicense; + +licenseSelectorCheck = window.licenseSelectorCheck = function () { + var selector = document.getElementById( 'wpLicense' ), + selection = selector.options[selector.selectedIndex].value; + if ( selector.selectedIndex > 0 ) { + if ( !selection ) { // Option disabled, but browser is broken and doesn't respect this selector.selectedIndex = 0; } @@ -17,23 +20,29 @@ window.licenseSelectorCheck = function() { function uploadSetup() { // Disable URL box if the URL copy upload source type is not selected - var e = document.getElementById( 'wpSourceTypeurl' ); - if( e ) { - if( !e.checked ) { - var ein = document.getElementById( 'wpUploadFileURL' ); - if(ein) - ein.setAttribute( 'disabled', 'disabled' ); + var ein, + selector, ua, isMacIe, i, + optionsTable, row, td, + wpLicense, wpLicenseRow, wpLicenseTbody, + uploadSourceIds, len, onchange, + e = document.getElementById( 'wpSourceTypeurl' ); + if ( e ) { + if ( !e.checked ) { + ein = document.getElementById( 'wpUploadFileURL' ); + if ( ein ) { + ein.disabled = true; + } } } // For MSIE/Mac: non-breaking spaces cause the