diff options
Diffstat (limited to 'skins/common')
38 files changed, 397 insertions, 2165 deletions
diff --git a/skins/common/IEFixes.js b/skins/common/IEFixes.js index ba4dc66b..7f3b9c0f 100644 --- a/skins/common/IEFixes.js +++ b/skins/common/IEFixes.js @@ -69,9 +69,9 @@ window.relativeforfloats = function() { if ( bc ) { var tables = bc.getElementsByTagName( 'table' ); var divs = bc.getElementsByTagName( 'div' ); + setrelative( tables ); + setrelative( divs ); } - setrelative( tables ); - setrelative( divs ); }; window.setrelative = function( nodes ) { diff --git a/skins/common/Makefile b/skins/common/Makefile deleted file mode 100644 index 56e60bd4..00000000 --- a/skins/common/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -jquery.min.js: jquery.js - php ../../maintenance/minify.php $< --outfile $@ diff --git a/skins/common/ajax.js b/skins/common/ajax.js index 1cad75ed..2a93373f 100644 --- a/skins/common/ajax.js +++ b/skins/common/ajax.js @@ -154,8 +154,6 @@ window.sajax_do_call = function(func_name, args, target) { } else { alert( 'bad target for sajax_do_call: not a function or object: ' + target ); } - - return; }; sajax_debug( func_name + ' uri = ' + uri + ' / post = ' + post_data ); diff --git a/skins/common/ajaxwatch.js b/skins/common/ajaxwatch.js deleted file mode 100644 index aaf6360c..00000000 --- a/skins/common/ajaxwatch.js +++ /dev/null @@ -1,120 +0,0 @@ -/** - * Animate watch/unwatch links to use asynchronous API requests to - * watch pages, rather than clicking on links. Requires jQuery. - * Uses jsMsg() from wikibits.js. - */ - -if ( typeof wgAjaxWatch === 'undefined' || !wgAjaxWatch ) { - window.wgAjaxWatch = { }; -} - -wgAjaxWatch.setLinkText = function( $link, action ) { - if ( action == 'watch' || action == 'unwatch' ) { - // save the accesskey from the title - var keyCommand = $link.attr( 'title' ).match( /\[.*?\]$/ ) ? $link.attr( 'title' ).match( /\[.*?\]$/ )[0] : ''; - $link.attr( 'title', mediaWiki.msg( 'tooltip-ca-' + action ) + ' ' + keyCommand ); - } - if ( $link.data( 'icon' ) ) { - $link.attr( 'alt', mediaWiki.msg( action ) ); - if ( action == 'watching' || action == 'unwatching' ) { - $link.addClass( 'loading' ); - } else { - $link.removeClass( 'loading' ); - } - } else { - $link.html( mediaWiki.msg( action ) ); - } -}; - -wgAjaxWatch.processResult = function( response ) { - response = response.watch; - var $link = $( this ); - // To ensure we set the same status for all watch links with the - // same target we trigger a custom event on *all* watch links. - if( response.watched !== undefined ) { - wgAjaxWatch.$links.trigger( 'mw-ajaxwatch', [response.title, 'watch'] ); - } else if ( response.unwatched !== undefined ) { - wgAjaxWatch.$links.trigger( 'mw-ajaxwatch', [response.title, 'unwatch'] ); - } else { - // Either we got an error code or it just plain broke. - window.location.href = $link.attr( 'href' ); - return; - } - - jsMsg( response.message, 'watch' ); - - // Bug 12395 - update the watch checkbox on edit pages when the - // page is watched or unwatched via the tab. - if( response.watched !== undefined ) { - $( '#wpWatchthis' ).attr( 'checked', '1' ); - } else { - $( '#wpWatchthis' ).removeAttr( 'checked' ); - } -}; - -$( document ).ready( function() { - var $links = $( '.mw-watchlink a, a.mw-watchlink' ); - // BC with older skins - $links = $links - .add( $( '#ca-watch a, #ca-unwatch a, a#mw-unwatch-link1' ) ) - .add( $( 'a#mw-unwatch-link2, a#mw-watch-link2, a#mw-watch-link1' ) ); - // allowing people to add inline animated links is a little scary - $links = $links.filter( ':not( #bodyContent *, #content * )' ); - - $links.each( function() { - var $link = $( this ); - $link - .data( 'icon', $link.parents( 'li' ).hasClass( 'icon' ) ) - .data( 'action', $link.attr( 'href' ).match( /[\?&]action=unwatch/i ) ? 'unwatch' : 'watch' ); - var title = $link.attr( 'href' ).match( /[\?&]title=(.*?)&/i )[1]; - $link.data( 'target', decodeURIComponent( title ).replace( /_/g, ' ' ) ); - }); - - $links.click( function( event ) { - var $link = $( this ); - - if( wgAjaxWatch.supported === false || !wgEnableWriteAPI || !wfSupportsAjax() ) { - // Lazy initialization so we don't toss up - // ActiveX warnings on initial page load - // for IE 6 users with security settings. - wgAjaxWatch.$links.unbind( 'click' ); - return true; - } - - wgAjaxWatch.setLinkText( $link, $link.data( 'action' ) + 'ing' ); - $.get( wgScriptPath - + '/api' + wgScriptExtension + '?action=watch&format=json&title=' - + encodeURIComponent( $link.data( 'target' ) ) - + ( $link.data( 'action' ) == 'unwatch' ? '&unwatch' : '' ), - {}, - wgAjaxWatch.processResult, - 'json' - ); - - return false; - }); - - // When a request returns, a custom event 'mw-ajaxwatch' is triggered - // on *all* watch links, so they can be updated if necessary - $links.bind( 'mw-ajaxwatch', function( event, target, action ) { - var $link = $( this ); - var foo = $link.data( 'target' ); - if( $link.data( 'target' ) == target ) { - var otheraction = action == 'watch' - ? 'unwatch' - : 'watch'; - - $link.data( 'action', otheraction ); - wgAjaxWatch.setLinkText( $link, otheraction ); - $link.attr( 'href', $link.attr( 'href' ).replace( '/&action=' + action + '/', '&action=' + otheraction ) ); - if( $link.parents( 'li' ).attr( 'id' ) == 'ca-' + action ) { - $link.parents( 'li' ).attr( 'id', 'ca-' + otheraction ); - // update the link text with the new message - $link.text( mediaWiki.msg( otheraction ) ); - } - }; - return false; - }); - - wgAjaxWatch.$links = $links; -}); diff --git a/skins/common/block.js b/skins/common/block.js deleted file mode 100644 index fb86cbd6..00000000 --- a/skins/common/block.js +++ /dev/null @@ -1,89 +0,0 @@ -// @TODO: find some better JS file for this -// Note: borrows from IP.php -window.isIPv4Address = function( address, allowBlock ) { - var block = allowBlock ? '(?:\\/(?:3[0-2]|[12]?\\d))?' : ''; - var RE_IP_BYTE = '(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|0?[0-9]?[0-9])'; - var RE_IP_ADD = '(?:' + RE_IP_BYTE + '\\.){3}' + RE_IP_BYTE; - return address.search( new RegExp( '^' + RE_IP_ADD + block + '$' ) ) != -1; -}; - -// @TODO: find some better JS file for this -// Note: borrows from IP.php -window.isIPv6Address = function( address, allowBlock ) { - var block = allowBlock ? '(?:\\/(?:12[0-8]|1[01][0-9]|[1-9]?\\d))?' : ''; - var RE_IPV6_ADD = - '(?:' + // starts with "::" (including "::") - ':(?::|(?::' + '[0-9A-Fa-f]{1,4}' + '){1,7})' + - '|' + // ends with "::" (except "::") - '[0-9A-Fa-f]{1,4}' + '(?::' + '[0-9A-Fa-f]{1,4}' + '){0,6}::' + - '|' + // contains no "::" - '[0-9A-Fa-f]{1,4}' + '(?::' + '[0-9A-Fa-f]{1,4}' + '){7}' + - ')'; - if ( address.search( new RegExp( '^' + RE_IPV6_ADD + block + '$' ) ) != -1 ) { - return true; - } - var RE_IPV6_ADD = // contains one "::" in the middle (single '::' check below) - '[0-9A-Fa-f]{1,4}' + '(?:::?' + '[0-9A-Fa-f]{1,4}' + '){1,6}'; - return address.search( new RegExp( '^' + RE_IPV6_ADD + block + '$' ) ) != -1 - && address.search( /::/ ) != -1 && address.search( /::.*::/ ) == -1; -}; - -window.considerChangingExpiryFocus = function() { - if ( !document.getElementById ) { - return; - } - var drop = document.getElementById( 'wpBlockExpiry' ); - if ( !drop ) { - return; - } - var field = document.getElementById( 'wpBlockOther' ); - if ( !field ) { - return; - } - var opt = drop.value; - if ( opt == 'other' ) { - field.style.display = ''; - } else { - field.style.display = 'none'; - } -}; - -window.updateBlockOptions = function() { - if ( !document.getElementById ) { - return; - } - - var target = document.getElementById( 'mw-bi-target' ); - if ( !target ) { - return; - } - - var addy = target.value.replace( /(^\s*|\s*$)/, '' ); // trim - var isEmpty = (addy == ""); - - var isIp = isIPv4Address( addy, true ) || isIPv6Address( addy, true ); - var isIpRange = isIp && addy.match(/\/\d+$/); - - var anonymousRow = document.getElementById( 'wpAnonOnlyRow' ); - if( anonymousRow ) { - anonymousRow.style.display = ( !isIp && !isEmpty ) ? 'none' : ''; - } - - var autoblockRow = document.getElementById( 'wpEnableAutoblockRow' ); - if( autoblockRow ) { - autoblockRow.style.display = isIp && !isEmpty ? 'none' : ''; - } - - var hideuserRow = document.getElementById( 'wpEnableHideUser' ); - if( hideuserRow ) { - hideuserRow.style.display = isIp && !isEmpty ? 'none' : ''; - } - - var watchuserRow = document.getElementById( 'wpEnableWatchUser' ); - if( watchuserRow ) { - watchuserRow.style.display = isIpRange && !isEmpty ? 'none' : ''; - } -}; - -addOnloadHook( updateBlockOptions ); -addOnloadHook( considerChangingExpiryFocus ); diff --git a/skins/common/cologneblue.css b/skins/common/cologneblue.css deleted file mode 100644 index c7b6eac1..00000000 --- a/skins/common/cologneblue.css +++ /dev/null @@ -1,210 +0,0 @@ -body { - margin: 0px; - padding: 0px; - color: black; -} - -#specialform { - display: inline; -} - -#content { - top: 0; - margin: 0; - padding: 0; -} - -#mw-data-after-content { - font-family: Verdana, Arial, sans-serif; - color: black; - font-size: 8pt; -} - -#topbar { - padding: 0px; -} - -#powersearch { - background: #DDEEFF; - border-style: solid; - border-width: 1px; - padding: 2px; -} - -#quickbar { - width: 140px; - top: 18ex; - padding: 2px; - visibility: visible; - z-index: 99; -} - -#article, #article td, #article th, #article p { - font-family: Verdana, Arial, sans-serif; - font-size: 10pt; - color: black; -} - -#article p { - padding-top: 0; - padding-bottom: 0; - margin-top: 1ex; - margin-bottom: 0; -} - -p, pre, td, th, li, dd, dt { - line-height: 12pt; -} - -textarea { - overflow: auto; -} - -#footer { - padding: 4px; -} - -#footer form { - display: inline; -} - -#sitetitle { - font-family: Times, serif; - color: white; - font-weight: normal; - font-size: 32pt; - line-height: 32pt; -} - -td.top { - background-color: #6688AA; - color: white; - margin-top: 4px; - margin-bottom: 4px; - padding-top: 0; - padding-bottom: 0; - text-transform: uppercase; - font-family: Verdana, Arial, sans-serif; - font-size: 8pt; -} - -td.top a { - font-family: Verdana, Arial, sans-serif; - background-color: #6688AA; - color: white; - text-decoration: none; - font-size: 10pt; -} - -td.bottom { - font-family: Verdana, Arial, sans-serif; - font-size: 10pt; - padding: 0; -} - -#pagestats { - font-family: Verdana, Arial, sans-serif; - color: black; - font-size: 9pt; -} - -#sitesub { - font-family: Verdana, Arial, sans-serif; - font-size: 9pt; font-weight: bold; - color: black; - padding-top: 0; -} - -#quickbar { - font-family: Verdana, Arial, sans-serif; - font-size: 8pt; - font-weight: bold; - line-height: 9.5pt; - text-decoration: none; - color: black; - padding: 0; - margin-top: 0; -} - -#quickbar a { - color: #446688; -} - -#quickbar h6 { - font-family: Verdana, Arial, sans-serif; - font-size: 10pt; - font-weight: bold; - line-height: 12pt; - text-decoration: none; - color: #666666; - padding: 0; - margin-bottom: 2px; - margin-top: 6px; -} - -#quickbar form { - padding: 0; - margin-top: 0; -} - -h1 { - color: #666666; - font-family: Verdana, Arial, sans-serif; - font-size: 180%; - line-height: 21pt; -} - -h1 .editsection { - font-size: 55.6%; -} - -h1.pagetitle { - padding-bottom: 0; - margin-bottom: 0; -} - -#article p.subtitle { - color: #666666; - font-size: 11pt; - font-weight: bold; - padding-top: 0; - margin-top: 0; - padding-bottom: 1ex; -} - -a { - color: #223366; -} - -a.external { - color: #336644; -} - -a:visited { - color: #8D0749; -} - -a.printable { - text-decoration: underline; -} - -a.stub, #quickbar a.stub { - color: #772233; - text-decoration: none; -} - -a.new, #quickbar a.new { - color: #CC2200; -} - -h2, h3, h4, h5, h6 { - margin-bottom: 0; -} - -small { - font-size: 75%; -} - -input.mw-searchInput { - width: 106px; -}
\ No newline at end of file diff --git a/skins/common/commonPrint.css b/skins/common/commonPrint.css index 56203aa4..58703a33 100644 --- a/skins/common/commonPrint.css +++ b/skins/common/commonPrint.css @@ -78,11 +78,13 @@ html .thumbcaption { div.magnify { display: none; } +/* @noflip */ div.tright { float: right; clear: right; margin: 0.5em 0 0.8em 1.4em; } +/* @noflip */ div.tleft { float: left; clear: left; @@ -139,11 +141,14 @@ ul { border: none ! important; padding: 0 ! important; margin: 0 ! important; + direction: ltr; } #footer { background : white; color : black; - border-top: 1px solid black; + margin-top: 1em; + border-top: 1px solid #AAA; + direction: ltr; } h1, h2, h3, h4, h5, h6 { @@ -235,7 +240,6 @@ span.texhtml { font-family: serif; } /* Galleries (see shared.css for more info) */ li.gallerybox { vertical-align: top; - background-color: #f9f9f9; border: solid 2px white; display: -moz-inline-box; display: inline-block; @@ -341,3 +345,31 @@ p { widows: 3; orphans: 3; } + +/** + * Categories + */ +.catlinks ul { + display: inline; + margin: 0px; + list-style: none; + list-style-type: none; + list-style-image: none; + vertical-align: middle !ie; +} + +.catlinks li { + display: inline-block; + line-height: 1.15em; + padding: 0 .4em; + border-left: 1px solid #AAA; + margin: 0.1em 0; + zoom: 1; + display: inline !ie; +} + +.catlinks li:first-child { + padding-left: .2em; + border-left: none; +} + diff --git a/skins/common/common_rtl.css b/skins/common/common_rtl.css deleted file mode 100644 index a0c485f0..00000000 --- a/skins/common/common_rtl.css +++ /dev/null @@ -1,59 +0,0 @@ -/* - * This file contains CSS settings common to RTL wikis use the old - * pre-Monobook skins Wikistandard, Nostalgia and CologneBlue - * NOTE: This file is not used in Monobook! - */ - -/* js pref toc */ -#preftoc { float: right; } -/* workaround for moz bug, displayed bullets on left side */ -#preftoc li { list-style: none; } -#prefcontrol { float: right; } -fieldset.prefsection, -fieldset.operaprefsection { - margin-left: 0; - margin-right: 18em; -} -/* page history */ -#pagehistory .history-user { - margin-right: 1.4em; - margin-left: 0.4em; -} -.editsection { - float: left; - margin-right: 5px; -} -div.tright, div.floatright { - clear: none; -} -div.tleft, div.floatleft { - clear: left; -} -/* Convenience links to edit block, delete and protect reasons */ -p.mw-ipb-conveniencelinks, p.mw-protect-editreasons, -p.mw-filedelete-editreasons, p.mw-delete-editreasons, -p.mw-revdel-editreasons { - float: left; -} -table.filehistory th { - text-align: right; -} - -/** - * Lists: - * The following lines don't have a visible effect on non-Gecko browsers - * They fix a problem ith Gecko browsers rendering lists to the right of - * left-floated objects in an RTL layout. - */ -html > body div#article ul { - display: table; -} -html > body div#bodyContent ul#filetoc { - display: block; -} - -/* feed links */ -a.feedlink { - background: none !important; - padding-left: 0 !important; -} diff --git a/skins/common/config.css b/skins/common/config.css index 341a9038..434f27d5 100644 --- a/skins/common/config.css +++ b/skins/common/config.css @@ -68,24 +68,6 @@ .config-error-box { border: 2px solid #f00; - margin: 0.4em; - clear: left; -} - -.config-warning-box { - border: 2px solid #ff7f00; - margin: 0.4em; - clear: left; -} - -.config-info-left { - margin: 7px; - float: left; - width: 35px; -} - -.config-info-right { - margin: 0.5em 0.5em 0.5em 49px; } .config-page-current { @@ -159,6 +141,6 @@ margin-left: 2em; } -#config-update-log { - width: 75%; +#config-live-log { + margin-right: 18em; } diff --git a/skins/common/config.js b/skins/common/config.js index 511966ad..e5af7d14 100644 --- a/skins/common/config.js +++ b/skins/common/config.js @@ -29,7 +29,7 @@ } ); // Scroll to the bottom of upgrade log - $( "#config-update-log" ).each( function() { this.scrollTop = this.scrollHeight; } ); + $( '#config-live-log' ).find( '> textarea' ).each( function() { this.scrollTop = this.scrollHeight; } ); // Show/hide Creative Commons thingy $( '.licenseRadio' ).click( function() { diff --git a/skins/common/diff.css b/skins/common/diff.css deleted file mode 100644 index 80286d8e..00000000 --- a/skins/common/diff.css +++ /dev/null @@ -1,75 +0,0 @@ -/* -** Diff rendering -*/ -table.diff, td.diff-otitle, td.diff-ntitle { - background-color: white; -} -td.diff-otitle, -td.diff-ntitle { - text-align: center; -} -td.diff-marker { - text-align: right; -} -td.diff-lineno { - font-weight: bold; -} -td.diff-addedline { - background: #cfc; - font-size: smaller; -} -td.diff-deletedline { - background: #ffa; - font-size: smaller; -} -td.diff-context { - background: #eee; - font-size: smaller; -} -.diffchange { - color: red; - font-weight: bold; - text-decoration: none; - white-space: pre-wrap; - white-space: -moz-pre-wrap; -} - -table.diff { - border: none; - width: 98%; - border-spacing: 4px; - - /* Fixed layout is required to ensure that cells containing long URLs - don't widen in Safari, Internet Explorer, or iCab */ - table-layout: fixed; -} -table.diff td { - padding: 0; -} -table.diff col.diff-marker { - width: 2%; -} -table.diff col.diff-content { - width: 48%; -} -table.diff td div { - /* Force-wrap very long lines such as URLs or page-widening char strings. - CSS 3 only (In Gecko 1.9.1 / Firefox 3.5): - https://bugzilla.mozilla.org/show_bug.cgi?id=99457 - https://developer.mozilla.org/web-tech/2008/08/20/word-wrap-break-word/ - https://developer.mozilla.org/En/CSS/Word-wrap */ - word-wrap: break-word; - - /* As fallback, scrollbars will be added for very wide cells - instead of text overflowing or widening */ - overflow: auto; - - /* The above rule breaks on very old versions of Mozilla due - to a bug which collapses the table cells to a single line. - - In Mozilla 1.1 and below with JavaScript enabled, the rule - will be overridden with this by diff.js; wide cell contents - then spill horizontally without widening the rest of the - table: */ - /* overflow: visible; */ -} diff --git a/skins/common/diff.js b/skins/common/diff.js deleted file mode 100644 index 5fd151fc..00000000 --- a/skins/common/diff.js +++ /dev/null @@ -1,20 +0,0 @@ -/* -Workaround for overflow bug in Mozilla 1.1 and earlier, where scrolling -<div>s in <td> cells collapse their height to a single line. - -Known to be fixed in 1.2.1 (Gecko 20021130), but the CSS hacks I've tried -with overflow-x disable the scrolling all the way until Mozilla 1.8 / FF 1.5 -and break Opera as well. - -So... we check for reaaaally old Gecko and hack in an alternate rule to let -the wide cells spill instead of scrolling them. Not ideal as it won't work -if JS is disabled, of course. -*/ - -if (navigator && navigator.product == "Gecko" && navigator.productSub < "20021130") { - var sheets = document.styleSheets; - var lastSheet = sheets[sheets.length-1]; - lastSheet.insertRule( - "table.diff td div { overflow: visible; }", - lastSheet.cssRules.length); -} diff --git a/skins/common/edit.js b/skins/common/edit.js deleted file mode 100644 index f986c854..00000000 --- a/skins/common/edit.js +++ /dev/null @@ -1,231 +0,0 @@ -window.currentFocused = undefined; - -// this function adds a toolbar button to the mwEditButtons list -window.addButton = function( imageFile, speedTip, tagOpen, tagClose, sampleText, imageId ) { - // Don't generate buttons for browsers which don't fully - // support it. - mwEditButtons.push({ - 'imageId': imageId, - 'imageFile': imageFile, - 'speedTip': speedTip, - 'tagOpen': tagOpen, - 'tagClose': tagClose, - 'sampleText': sampleText - }); -}; - -// this function adds one toolbar button from a mwEditButtons/mwCustomEditButtons item -window.mwInsertEditButton = function( parent, item ) { - var image = document.createElement( 'img' ); - image.width = 23; - image.height = 22; - image.className = 'mw-toolbar-editbutton'; - if ( item.imageId ) { - image.id = item.imageId; - } - image.src = item.imageFile; - image.border = 0; - image.alt = item.speedTip; - image.title = item.speedTip; - image.style.cursor = 'pointer'; - image.onclick = function() { - insertTags( item.tagOpen, item.tagClose, item.sampleText ); - // click tracking - if ( ( typeof $ != 'undefined' ) && ( typeof $.trackAction != 'undefined' ) ) { - $.trackAction( 'oldedit.' + item.speedTip.replace(/ /g, "-") ); - } - return false; - }; - - parent.appendChild( image ); - return true; -}; - -// this function generates the actual toolbar buttons with localized text -// we use it to avoid creating the toolbar where javascript is not enabled -window.mwSetupToolbar = function() { - var toolbar = document.getElementById( 'toolbar' ); - if ( !toolbar ) { - return false; - } - - // Don't generate buttons for browsers which don't fully - // support it. - // but don't assume wpTextbox1 is always here - var textboxes = document.getElementsByTagName( 'textarea' ); - if ( !textboxes.length ) { - // No toolbar if we can't find any textarea - return false; - } - // Only check for selection capability if the textarea is visible - errors will occur otherwise - just because - // the textarea is not visible, doesn't mean we shouldn't build out the toolbar though - it might have been replaced - // with some other kind of control - if ( textboxes[0].style.display != 'none' ) { - if ( !( document.selection && document.selection.createRange ) - && textboxes[0].selectionStart === null ) { - return false; - } - } - for ( var i = 0; i < mwEditButtons.length; i++ ) { - mwInsertEditButton( toolbar, mwEditButtons[i] ); - } - for ( var i = 0; i < mwCustomEditButtons.length; i++ ) { - mwInsertEditButton( toolbar, mwCustomEditButtons[i] ); - } - return true; -}; - -// apply tagOpen/tagClose to selection in textarea, -// use sampleText instead of selection if there is none -window.insertTags = function( tagOpen, tagClose, sampleText ) { - if ( typeof $ != 'undefined' && typeof $.fn.textSelection != 'undefined' && currentFocused && - ( currentFocused.nodeName.toLowerCase() == 'iframe' || currentFocused.id == 'wpTextbox1' ) ) { - $( '#wpTextbox1' ).textSelection( - 'encapsulateSelection', { 'pre': tagOpen, 'peri': sampleText, 'post': tagClose } - ); - return; - } - var txtarea; - if ( document.editform ) { - txtarea = currentFocused; - } else { - // some alternate form? take the first one we can find - var areas = document.getElementsByTagName( 'textarea' ); - txtarea = areas[0]; - } - var selText, isSample = false; - - if ( document.selection && document.selection.createRange ) { // IE/Opera - // save window scroll position - if ( document.documentElement && document.documentElement.scrollTop ) { - var winScroll = document.documentElement.scrollTop - } else if ( document.body ) { - var winScroll = document.body.scrollTop; - } - // get current selection - txtarea.focus(); - var range = document.selection.createRange(); - selText = range.text; - // insert tags - checkSelectedText(); - range.text = tagOpen + selText + tagClose; - // mark sample text as selected - if ( isSample && range.moveStart ) { - if ( window.opera ) { - tagClose = tagClose.replace(/\n/g,''); - } - range.moveStart('character', - tagClose.length - selText.length); - range.moveEnd('character', - tagClose.length); - } - range.select(); - // restore window scroll position - if ( document.documentElement && document.documentElement.scrollTop ) { - document.documentElement.scrollTop = winScroll; - } else if ( document.body ) { - document.body.scrollTop = winScroll; - } - - } else if ( txtarea.selectionStart || txtarea.selectionStart == '0' ) { // Mozilla - // save textarea scroll position - var textScroll = txtarea.scrollTop; - // get current selection - txtarea.focus(); - var startPos = txtarea.selectionStart; - var endPos = txtarea.selectionEnd; - selText = txtarea.value.substring( startPos, endPos ); - // insert tags - checkSelectedText(); - txtarea.value = txtarea.value.substring(0, startPos) - + tagOpen + selText + tagClose - + txtarea.value.substring(endPos, txtarea.value.length); - // set new selection - if ( isSample ) { - txtarea.selectionStart = startPos + tagOpen.length; - txtarea.selectionEnd = startPos + tagOpen.length + selText.length; - } else { - txtarea.selectionStart = startPos + tagOpen.length + selText.length + tagClose.length; - txtarea.selectionEnd = txtarea.selectionStart; - } - // restore textarea scroll position - txtarea.scrollTop = textScroll; - } - - function checkSelectedText() { - if ( !selText ) { - selText = sampleText; - isSample = true; - } else if ( selText.charAt(selText.length - 1) == ' ' ) { // exclude ending space char - selText = selText.substring(0, selText.length - 1); - tagClose += ' '; - } - } - -}; - -/** - * Restore the edit box scroll state following a preview operation, - * and set up a form submission handler to remember this state - */ -window.scrollEditBox = function() { - var editBox = document.getElementById( 'wpTextbox1' ); - var scrollTop = document.getElementById( 'wpScrolltop' ); - var editForm = document.getElementById( 'editform' ); - if( editForm && editBox && scrollTop ) { - if( scrollTop.value ) { - editBox.scrollTop = scrollTop.value; - } - addHandler( editForm, 'submit', function() { - scrollTop.value = editBox.scrollTop; - } ); - } -}; -hookEvent( 'load', scrollEditBox ); -hookEvent( 'load', mwSetupToolbar ); -hookEvent( 'load', function() { - currentFocused = document.getElementById( 'wpTextbox1' ); - // http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html - // focus does not bubble normally, but using a trick we can do event delegation - // on the focus event on all text inputs to make the toolbox usable on all of them - var editForm = document.getElementById( 'editform' ); - if ( !editForm ) { - return; - } - function onfocus( e ) { - var elm = e.target || e.srcElement; - if ( !elm ) { - return; - } - var tagName = elm.tagName.toLowerCase(); - var type = elm.type || ''; - if ( tagName !== 'textarea' && tagName !== 'input' ) { - return; - } - if ( tagName === 'input' && type.toLowerCase() !== 'text' ) { - return; - } - - currentFocused = elm; - } - - if ( editForm.addEventListener ) { - // Gecko, WebKit, Opera, etc... (all standards compliant browsers) - editForm.addEventListener( 'focus', onfocus, true ); // This MUST be true to work - } else if ( editForm.attachEvent ) { - // IE needs a specific trick here since it doesn't support the standard - editForm.attachEvent( 'onfocusin', function() { onfocus( event ); } ); - } - - // HACK: make currentFocused work with the usability iframe - // With proper focus detection support (HTML 5!) this'll be much cleaner - if ( typeof $ != 'undefined' ) { - var iframe = $( '.wikiEditor-ui-text iframe' ); - if ( iframe.length > 0 ) { - $( iframe.get( 0 ).contentWindow.document ) - .add( iframe.get( 0 ).contentWindow.document.body ) // for IE - .focus( function() { currentFocused = iframe.get( 0 ); } ); - } - } - - editForm -} ); - diff --git a/skins/common/enhancedchanges.js b/skins/common/enhancedchanges.js deleted file mode 100644 index bcc2cc88..00000000 --- a/skins/common/enhancedchanges.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - JavaScript file for enhanced recentchanges - */ - -/* - * Add the CSS to hide parts that should be collapsed - * - * We do this with JS so everything will be expanded by default - * if JS is disabled - */ -appendCSS('.mw-changeslist-hidden {'+ - ' display:none;'+ - '}'+ - 'div.mw-changeslist-expanded {'+ - ' display:block;'+ - '}'+ - 'span.mw-changeslist-expanded {'+ - ' display:inline !important;'+ - ' visibility:visible !important;'+ - '}' -); - -/* - * Switch an RC line between hidden/shown - * @param int idNumber : the id number of the RC group -*/ -window.toggleVisibility = function(idNumber) { - var openarrow = document.getElementById("mw-rc-openarrow-"+idNumber); - var closearrow = document.getElementById("mw-rc-closearrow-"+idNumber); - var subentries = document.getElementById("mw-rc-subentries-"+idNumber); - if (openarrow.className == 'mw-changeslist-expanded') { - openarrow.className = 'mw-changeslist-hidden'; - closearrow.className = 'mw-changeslist-expanded'; - subentries.className = 'mw-changeslist-expanded'; - } else { - openarrow.className = 'mw-changeslist-expanded'; - closearrow.className = 'mw-changeslist-hidden'; - subentries.className = 'mw-changeslist-hidden'; - } -}; diff --git a/skins/common/history.js b/skins/common/history.js deleted file mode 100644 index 33845a75..00000000 --- a/skins/common/history.js +++ /dev/null @@ -1,77 +0,0 @@ -window.historyRadios = function(parent) { - var inputs = parent.getElementsByTagName('input'); - var radios = []; - for (var i = 0; i < inputs.length; i++) { - if (inputs[i].name == "diff" || inputs[i].name == "oldid") { - radios[radios.length] = inputs[i]; - } - } - return radios; -}; - -// check selection and tweak visibility/class onclick -window.diffcheck = function() { - var dli = false; // the li where the diff radio is checked - var oli = false; // the li where the oldid radio is checked - var hf = document.getElementById('pagehistory'); - if (!hf) { - return true; - } - var lis = hf.getElementsByTagName('li'); - for (var i=0;i<lis.length;i++) { - var inputs = historyRadios(lis[i]); - if (inputs[1] && inputs[0]) { - if (inputs[1].checked || inputs[0].checked) { // this row has a checked radio button - if (inputs[1].checked && inputs[0].checked && inputs[0].value == inputs[1].value) { - return false; - } - if (oli) { // it's the second checked radio - if (inputs[1].checked) { - if ( (typeof oli.className) != 'undefined') { - oli.classNameOriginal = oli.className.replace( 'selected', '' ); - } else { - oli.classNameOriginal = ''; - } - - oli.className = "selected "+oli.classNameOriginal; - return false; - } - } else if (inputs[0].checked) { - return false; - } - if (inputs[0].checked) { - dli = lis[i]; - } - if (!oli) { - inputs[0].style.visibility = 'hidden'; - } - if (dli) { - inputs[1].style.visibility = 'hidden'; - } - if ( (typeof lis[i].className) != 'undefined') { - lis[i].classNameOriginal = lis[i].className.replace( 'selected', '' ); - } else { - lis[i].classNameOriginal = ''; - } - - lis[i].className = "selected "+lis[i].classNameOriginal; - oli = lis[i]; - } else { // no radio is checked in this row - if (!oli) { - inputs[0].style.visibility = 'hidden'; - } else { - inputs[0].style.visibility = 'visible'; - } - if (dli) { - inputs[1].style.visibility = 'hidden'; - } else { - inputs[1].style.visibility = 'visible'; - } - if ( typeof lis[i].classNameOriginal != 'undefined' ) { - lis[i].className = lis[i].classNameOriginal; - } - } - } - } - return true; -}; diff --git a/skins/common/htmlform.js b/skins/common/htmlform.js deleted file mode 100644 index 900b1660..00000000 --- a/skins/common/htmlform.js +++ /dev/null @@ -1,40 +0,0 @@ -// Find select-or-other fields. -addOnloadHook( function() { - var fields = getElementsByClassName( document, 'select', 'mw-htmlform-select-or-other' ); - - for( var i = 0; i < fields.length; i++ ) { - var select = fields[i]; - - addHandler( select, 'change', htmlforms.selectOrOtherSelectChanged ); - - // Use a fake 'e' to update it. - htmlforms.selectOrOtherSelectChanged( { 'target': select } ); - } -} ); - -window.htmlforms = { - 'selectOrOtherSelectChanged' : function( e ) { - var select; - if ( !e ) { - e = window.event; - } - if ( e.target ) { - select = e.target; - } else if ( e.srcElement ) { - select = e.srcElement; - } - if ( select.nodeType == 3 ) { // defeat Safari bug - select = select.parentNode; - } - - var id = select.id; - var textbox = document.getElementById( id + '-other' ); - - if ( select.value == 'other' ) { - textbox.disabled = false; - } else { - textbox.disabled = true; - } - } -}; - diff --git a/skins/common/images/cc-by.png b/skins/common/images/cc-by.png Binary files differnew file mode 100644 index 00000000..822491ed --- /dev/null +++ b/skins/common/images/cc-by.png diff --git a/skins/common/images/critical-32.png b/skins/common/images/critical-32.png Binary files differindex 8f65041e..2bff7511 100644 --- a/skins/common/images/critical-32.png +++ b/skins/common/images/critical-32.png diff --git a/skins/common/images/download-32.png b/skins/common/images/download-32.png Binary files differindex 0087e10d..c571ea30 100644 --- a/skins/common/images/download-32.png +++ b/skins/common/images/download-32.png diff --git a/skins/common/images/info-32.png b/skins/common/images/info-32.png Binary files differindex ecefa9a6..70d7f20a 100644 --- a/skins/common/images/info-32.png +++ b/skins/common/images/info-32.png diff --git a/skins/common/images/magnify-clip-rtl.png b/skins/common/images/magnify-clip-rtl.png Binary files differnew file mode 100644 index 00000000..8398a82c --- /dev/null +++ b/skins/common/images/magnify-clip-rtl.png diff --git a/skins/common/images/sort_down.gif b/skins/common/images/sort_down.gif Binary files differdeleted file mode 100644 index d97e8285..00000000 --- a/skins/common/images/sort_down.gif +++ /dev/null diff --git a/skins/common/images/sort_none.gif b/skins/common/images/sort_none.gif Binary files differdeleted file mode 100644 index edd07e58..00000000 --- a/skins/common/images/sort_none.gif +++ /dev/null diff --git a/skins/common/images/sort_up.gif b/skins/common/images/sort_up.gif Binary files differdeleted file mode 100644 index 488cf279..00000000 --- a/skins/common/images/sort_up.gif +++ /dev/null diff --git a/skins/common/images/tick-32.png b/skins/common/images/tick-32.png Binary files differindex 584cef22..dfde1707 100644 --- a/skins/common/images/tick-32.png +++ b/skins/common/images/tick-32.png diff --git a/skins/common/images/warning-32.png b/skins/common/images/warning-32.png Binary files differindex aa6b298b..6267cbc9 100644 --- a/skins/common/images/warning-32.png +++ b/skins/common/images/warning-32.png diff --git a/skins/common/metadata.js b/skins/common/metadata.js deleted file mode 100644 index 8fafc955..00000000 --- a/skins/common/metadata.js +++ /dev/null @@ -1,53 +0,0 @@ -// Exif metadata display for MediaWiki file uploads -// -// Add an expand/collapse link and collapse by default if set to -// (with JS disabled, user will see all items) -// -// attachMetadataToggle('mw_metadata', 'More...', 'Fewer...'); - -window.attachMetadataToggle = function( tableId, showText, hideText ) { - if ( document.createTextNode ) { - var box = document.getElementById( tableId ); - if ( !box ) { - return false; - } - - var tbody = box.getElementsByTagName('tbody')[0]; - - var row = document.createElement( 'tr' ); - - var col = document.createElement( 'td' ); - col.colSpan = 2; - - var link = document.createElement( 'a' ); - link.href = '#'; - - link.onclick = function() { - if ( box.className == 'mw_metadata collapsed' ) { - changeText( link, hideText ); - box.className = 'mw_metadata expanded'; - } else { - changeText( link, showText ); - box.className = 'mw_metadata collapsed'; - } - return false; - }; - - var text = document.createTextNode( hideText ); - - link.appendChild( text ); - col.appendChild( link ); - row.appendChild( col ); - tbody.appendChild( row ); - - // And collapse! - link.onclick(); - - return true; - } - return false; -}; - -$( document ).ready( function() { - attachMetadataToggle( 'mw_metadata', mediaWiki.msg( 'metadata-expand' ), mediaWiki.msg( 'metadata-collapse' ) ); -} ); diff --git a/skins/common/mwsuggest.js b/skins/common/mwsuggest.js index d7dd5ad8..6971d30d 100644 --- a/skins/common/mwsuggest.js +++ b/skins/common/mwsuggest.js @@ -52,14 +52,16 @@ window.os_enabled = true; /** * <datalist> is a new HTML5 element that allows you to manually supply * suggestion lists and have them rendered according to the right platform - * conventions. However, the only shipping browser as of early 2010 is Opera, - * and that has a fatal problem: the suggestion lags behind what the user types - * by one keypress. (Reported as DSK-276870 to Opera's secret bug tracker.) - * The code here otherwise seems to work, though, so this can be flipped on - * (maybe with a UA check) when some browser has a better implementation. + * conventions. Opera as of version 11 has a fatal problem: the suggestion + * lags behind what the user types by one keypress. (Reported as DSK-276870 to + * Opera's secret bug tracker.) However, Firefox 4 supports it without + * problems, so Opera is just blacklisted here. Ideally we wouldn't blacklist + * future versions, in case they fix it, but the fallback isn't bad at all and + * the failure if they don't fix it is very annoying, so in this case we'll + * blacklist future versions too. */ -// var os_use_datalist = 'list' in document.createElement( 'input' ); -window.os_use_datalist = false; +window.os_use_datalist = 'list' in document.createElement( 'input' ) + && $.client.profile().name != 'opera'; /** Timeout timer class that will fetch the results */ window.os_Timer = function( id, r, query ) { @@ -750,36 +752,28 @@ window.os_getElementPosition = function( elemID ) { }; /** Create the container div that will hold the suggested titles */ -window.os_createContainer = function(r) { - var c = document.createElement('div'); - var s = document.getElementById(r.searchbox); - var pos = os_getElementPosition(r.searchbox); +window.os_createContainer = function( r ) { + var c = document.createElement( 'div' ); + var s = document.getElementById( r.searchbox ); + var pos = os_getElementPosition( r.searchbox ); var left = pos.left; var top = pos.top + s.offsetHeight; c.className = 'os-suggest'; - c.setAttribute('id', r.container); - document.body.appendChild(c); + c.setAttribute( 'id', r.container ); + document.body.appendChild( c ); // dynamically generated style params // IE workaround, cannot explicitely set "style" attribute - c = document.getElementById(r.container); + c = document.getElementById( r.container ); c.style.top = top + 'px'; c.style.left = left + 'px'; c.style.width = s.offsetWidth + 'px'; // mouse event handlers - c.onmouseover = function(event) { - os_eventMouseover(r.searchbox, event); - }; - c.onmousemove = function(event) { - os_eventMousemove(r.searchbox, event); - }; - c.onmousedown = function(event) { - return os_eventMousedown(r.searchbox, event); - }; - c.onmouseup = function(event) { - os_eventMouseup(r.searchbox, event); - }; + c.onmouseover = function( event ) { os_eventMouseover( r.searchbox, event ); }; + c.onmousemove = function( event ) { os_eventMousemove( r.searchbox, event ); }; + c.onmousedown = function( event ) { return os_eventMousedown( r.searchbox, event ); }; + c.onmouseup = function( event ) { os_eventMouseup( r.searchbox, event ); }; return c; }; diff --git a/skins/common/nostalgia.css b/skins/common/nostalgia.css deleted file mode 100644 index e1b774df..00000000 --- a/skins/common/nostalgia.css +++ /dev/null @@ -1,48 +0,0 @@ -body { - /* Background color is set separately on page type */ - color: black; -} - -#specialform { - display: inline; -} - -#powersearch { - background: #DDEEFF; - border-style: solid; - border-width: 1px; - padding: 2px; -} - -a.interwiki, a.external { - color: #3366BB; -} - -a.printable { - text-decoration: underline; -} - -a.stub { - color: #772233; - text-decoration: none; -} - -h1.pagetitle { - padding-top: 0; - margin-top: 0; - padding-bottom: 0; - margin-bottom: 0; -} - -h2, h3, h4, h5, h6 { - margin-bottom: 0; -} - -textarea { - overflow: auto; -} - -p.subtitle { - padding-top: 0; - margin-top: 0; -} diff --git a/skins/common/oldshared.css b/skins/common/oldshared.css index 33047ec9..4be14f37 100644 --- a/skins/common/oldshared.css +++ b/skins/common/oldshared.css @@ -30,22 +30,26 @@ h6 .editsection { font-size: 133%; } #footer { clear: both } /* images */ +/* @noflip */ div.floatright { float: right; clear: right; margin: 0 0 1em 1em; } +/* @noflip */ div.floatright p { font-style: italic; } +/* @noflip */ div.floatleft { float: left; clear: left; margin: 0.3em 0.5em 0.5em 0; } +/* @noflip */ div.floatleft p { font-style: italic; } @@ -100,11 +104,13 @@ div.magnify a, div.magnify img { border: none !important; background: none !important; } +/* @noflip */ div.tright { clear: right; float: right; border-width: .5em 0 .8em 1.4em; } +/* @noflip */ div.tleft { float: left; clear: left; @@ -141,8 +147,7 @@ img { border: none; } .toc ul { list-style-type: none; list-style-image: none; - margin-left: 0; - padding-left: 0; + padding: 0; text-align: left; } #toc ul ul, @@ -208,7 +213,7 @@ fieldset.operaprefsection { } /* small for tables and similar */ -.small, .small * { +.small { font-size: 94%; } table.small { @@ -428,8 +433,29 @@ form#specialpages { } body { + direction: ltr; + unicode-bidi: embed; background-color: #ffffec; } body.ns-0 { background-color: white; } + +/** RTL specific CSS starts here **/ + +/** + * Lists: + * The following lines don't have a visible effect on non-Gecko browsers + * They fix a problem with Gecko browsers rendering lists to the right of + * left-floated objects in an RTL layout. + */ +/* @noflip */ +html > body.rtl div#article ul { + display: table; +} +/* @noflip */ +html > body.rtl div#bodyContent ul#filetoc { + display: block; +} + +/* RTL specific CSS ends here **/
\ No newline at end of file diff --git a/skins/common/prefs.js b/skins/common/prefs.js deleted file mode 100644 index 1eb8e5bf..00000000 --- a/skins/common/prefs.js +++ /dev/null @@ -1,138 +0,0 @@ -// Timezone stuff -// tz in format [+-]HHMM -window.checkTimezone = function( tz, msg ) { - var localclock = new Date(); - // returns negative offset from GMT in minutes - var tzRaw = localclock.getTimezoneOffset(); - var tzHour = Math.floor( Math.abs( tzRaw ) / 60 ); - var tzMin = Math.abs( tzRaw ) % 60; - var tzString = ( ( tzRaw >= 0 ) ? '-' : '+' ) + ( ( tzHour < 10 ) ? '0' : '' ) + tzHour + ( ( tzMin < 10 ) ? '0' : '' ) + tzMin; - if ( tz != tzString ) { - var junk = msg.split('$1'); - document.write( junk[0] + 'UTC' + tzString + junk[1] ); - } -}; - -window.timezoneSetup = function() { - var tzSelect = document.getElementById( 'mw-input-wptimecorrection' ); - var tzTextbox = document.getElementById( 'mw-input-wptimecorrection-other' ); - - if ( tzSelect && tzTextbox ) { - addHandler( tzSelect, 'change', function( e ) { updateTimezoneSelection( false ); } ); - addHandler( tzTextbox, 'blur', function( e ) { updateTimezoneSelection( true ); } ); - } - - updateTimezoneSelection( false ); -}; - -// in [-]HH:MM format... -// won't yet work with non-even tzs -window.fetchTimezone = function() { - // FIXME: work around Safari bug - var localclock = new Date(); - // returns negative offset from GMT in minutes - var tzRaw = localclock.getTimezoneOffset(); - var tzHour = Math.floor( Math.abs( tzRaw ) / 60 ); - var tzMin = Math.abs( tzRaw ) % 60; - var tzString = ( ( tzRaw >= 0 ) ? '-' : '' ) + ( ( tzHour < 10 ) ? '0' : '' ) + tzHour + - ':' + ( ( tzMin < 10 ) ? '0' : '' ) + tzMin; - return tzString; -}; - -window.guessTimezone = function() { - var textbox = document.getElementById( 'mw-input-wptimecorrection-other' ); - var selector = document.getElementById( 'mw-input-wptimecorrection' ); - - selector.value = 'other'; - textbox.value = fetchTimezone(); - textbox.disabled = false; // The changed handler doesn't trip, obviously. - updateTimezoneSelection( true ); -}; - -window.updateTimezoneSelection = function( force_offset ) { - var selector = document.getElementById( 'mw-input-wptimecorrection' ); - - if ( selector.value == 'guess' ) { - return guessTimezone(); - } - - var textbox = document.getElementById( 'mw-input-wptimecorrection-other' ); - var localtimeHolder = document.getElementById( 'wpLocalTime' ); - var servertime = document.getElementsByName( 'wpServerTime' )[0].value; - var minDiff = 0; - - // Compatibility code. - if ( !selector.value ) { - selector.value = selector.options[selector.selectedIndex].value; - } - - // Handle force_offset - if ( force_offset ) { - selector.value = 'other'; - } - - // Get min_diff - if ( selector.value == 'other' ) { - // Grab data from the textbox, parse it. - var diffArr = textbox.value.split(':'); - if ( diffArr.length == 1 ) { - // Specification is of the form [-]XX - minDiff = parseInt( diffArr[0], 10 ) * 60; - } else { - // Specification is of the form [-]XX:XX - minDiff = Math.abs( parseInt( diffArr[0], 10 ) ) * 60 + parseInt( diffArr[1], 10 ); - if ( parseInt( diffArr[0], 10 ) < 0 ) { - minDiff = -minDiff; - } - } - } else { - // Grab data from the selector value - var diffArr = selector.value.split('|'); - minDiff = parseInt( diffArr[1], 10 ); - } - - // Gracefully handle non-numbers. - if ( isNaN( minDiff ) ) { - minDiff = 0; - } - - // Determine local time from server time and minutes difference, for display. - var localTime = parseInt( servertime, 10 ) + minDiff; - - // Bring time within the [0,1440) range. - while ( localTime < 0 ) { - localTime += 1440; - } - while ( localTime >= 1440 ) { - localTime -= 1440; - } - - // Split to hour and minute - var hour = String( Math.floor( localTime / 60 ) ); - if ( hour.length < 2 ) { - hour = '0' + hour; - } - var min = String(localTime%60); - if ( min.length < 2 ) { - min = '0' + min; - } - changeText( localtimeHolder, hour + ':' + min ); - - // If the user selected from the drop-down, fill the offset field. - if ( selector.value != 'other' ) { - hour = String( Math.abs( Math.floor( minDiff / 60 ) ) ); - if ( hour.length < 2 ) { - hour = '0' + hour; - } - if ( minDiff < 0 ) { - hour = '-' + hour; - } - min = String(minDiff%60); - if ( min.length < 2 ) { - min = '0' + min; - } - textbox.value = hour + ':' + min; - } -}; - -addOnloadHook( timezoneSetup ); diff --git a/skins/common/preview.js b/skins/common/preview.js index 234dd545..82b27bc1 100644 --- a/skins/common/preview.js +++ b/skins/common/preview.js @@ -9,28 +9,28 @@ var postData = $('#editform').formToArray(); postData.push( { 'name' : 'wpPreview', 'value' : '1' } ); - + // Hide active diff, used templates, old preview if shown var copyElements = ['#wikiPreview', '.templatesUsed', '.hiddencats', '#catlinks']; var copySelector = copyElements.join(','); - + $.each( copyElements, function(k,v) { $(v).fadeOut('fast'); } ); // Display a loading graphic var loadSpinner = $('<div class="mw-ajax-loader"/>'); $('#wikiPreview').before( loadSpinner ); - + var page = $('<div/>'); var target = $('#editform').attr('action'); - + if ( !target ) { target = window.location.href; } - + page.load( target + ' ' + copySelector, postData, function() { - + for( var i=0; i<copyElements.length; ++i) { // For all the specified elements, find the elements in the loaded page // and the real page, empty the element in the real page, and fill it @@ -40,12 +40,12 @@ var newClasses = page.find( copyElements[i] ).attr('class'); $(copyElements[i]).attr( 'class', newClasses ); } - + $.each( copyElements, function(k,v) { // Don't belligerently show elements that are supposed to be hidden $(v).fadeIn( 'fast', function() { $(this).css('display', ''); } ); } ); - + loadSpinner.remove(); $( mw ).trigger( 'LivePreviewDone', [copyElements] ); diff --git a/skins/common/protect.js b/skins/common/protect.js index a284c3f8..b77c2e06 100644 --- a/skins/common/protect.js +++ b/skins/common/protect.js @@ -45,6 +45,8 @@ window.ProtectionForm = { check.checked = !this.areAllTypesMatching(); this.enableUnchainedInputs( check.checked ); } + + $( '#mwProtect-reason' ).byteLimit( 180 ); this.updateCascadeCheckbox(); diff --git a/skins/common/search.css b/skins/common/search.css deleted file mode 100644 index 22c3ca4a..00000000 --- a/skins/common/search.css +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Fixes sister projects box moving down the extract - * of the first result (bug #16886). - * It only happens when the window is small and - * This changes slightly the layout for big screens - * where there was space for the extracts and the - * sister projects and thus it showed like in any - * other browser. - * - * This will only affect IE 7 and lower - */ -html > body .searchresult { - display: inline; -} diff --git a/skins/common/search.js b/skins/common/search.js deleted file mode 100644 index 26d807db..00000000 --- a/skins/common/search.js +++ /dev/null @@ -1,50 +0,0 @@ -// JS specific to Special:Search - -// change the search link to what user entered -window.mwSearchHeaderClick = function( obj ) { - var searchbox = document.getElementById( 'searchText' ); - if( searchbox === null ) { - searchbox = document.getElementById( 'powerSearchText' ); - } - if( searchbox === null ) { - return; // should always have either normal or advanced search - } - - var searchterm = searchbox.value; - var parts = obj.getAttribute( 'href', 2).split( 'search=' ); - var lastpart = ''; - var prefix = 'search='; - if( parts.length > 1 && parts[1].indexOf('&') >= 0 ) { - lastpart = parts[1].substring( parts[1].indexOf('&') ); - } else { - prefix = '&search='; - } - obj.href = parts[0] + prefix + encodeURIComponent( searchterm ) + lastpart; -}; - -window.mwToggleSearchCheckboxes = function( btn ) { - if( !document.getElementById ) { - return; - } - - var nsInputs = document.getElementById( 'powersearch' ).getElementsByTagName( 'input' ); - var isChecked = false; - - for ( var i = 0; i < nsInputs.length; i++ ) { - var pattern = /^ns/; - if ( ( nsInputs[i].type == 'checkbox' ) && ( pattern.test( nsInputs[i].name ) ) ) { - switch ( btn ) { - case 'none': - if ( nsInputs[i].checked ) { - nsInputs[i].checked = false; - } - break; - case 'all': - if ( !nsInputs[i].checked ) { - nsInputs[i].checked = true; - } - break; - } - } - } -}; diff --git a/skins/common/shared.css b/skins/common/shared.css index 00032b3f..3612ee0f 100644 --- a/skins/common/shared.css +++ b/skins/common/shared.css @@ -1,9 +1,23 @@ /** * 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 non-Monobook users either. + * another, but don't ignore the poor pre-Monobook users either. */ +/* GENERAL CLASSES FOR DIRECTIONALITY SUPPORT */ +/* These classes should be used for text depending on the content direction. +Content stuff like editsection, ul/ol and TOC depend on this. */ + /* @noflip */.mw-content-ltr { direction: ltr; } +/* @noflip */.mw-content-rtl { direction: rtl; } +/* Most input fields should be in site direction */ +/* @noflip */.sitedir-ltr textarea, .sitedir-ltr input { direction: ltr; } +/* @noflip */.sitedir-rtl textarea, .sitedir-rtl input { direction: rtl; } +/* Input types that should follow user direction, like buttons */ +input[type="submit"], input[type="button"], input[type="reset"], input[type="file"] { direction: ltr; } +/* Override default values */ +/* @noflip */textarea[dir="ltr"], input[dir="ltr"] { direction: ltr; } +/* @noflip */textarea[dir="rtl"], input[dir="rtl"] { direction: rtl; } + /* Default style for semantic tags */ abbr, acronym, .explain { border-bottom: 1px dotted black; @@ -17,7 +31,10 @@ abbr, acronym, .explain { /* Links to redirects appear italicized on [[Special:AllPages]], [[Special:PrefixIndex]], [[Special:Watchlist/edit]] and in category listings */ -.allpagesredirect, .redirect-in-category, .watchlistredir { font-style: italic; } +.allpagesredirect, .redirect-in-category, .watchlistredir { + font-style: italic; +} + /* Comment and username portions of RC entries */ span.comment { @@ -44,7 +61,9 @@ span.texhtml { font-family: serif; } #editform, #toolbar, #wpTextbox1 { clear: both; } - +#toolbar img { + cursor: pointer; +} div#mw-js-message { margin: 1em 5%; padding: 0.5em 2.5%; @@ -57,7 +76,9 @@ div#mw-js-message { float: right; margin-left: 5px; } - +/* 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; } +/* @noflip */.mw-content-rtl .editsection, .mw-content-ltr .mw-content-rtl .editsection { float: left; } /** * File histories */ @@ -127,6 +148,15 @@ 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-multiselect-flatlist div.mw-htmlform-multiselect-item { + display: inline; + margin-right: 1em; + white-space: nowrap; +} + input#wpSummary { width: 80%; } @@ -138,226 +168,53 @@ input#wpSummary { .magnify { float: right; } /** - * Hidden categories + * Categories */ -.mw-hidden-cats-hidden { display: none; } -.catlinks-allhidden { display: none; } - -/* Convenience links to edit block, delete and protect reasons */ -p.mw-ipb-conveniencelinks, p.mw-protect-editreasons, -p.mw-filedelete-editreasons, p.mw-delete-editreasons, -p.mw-revdel-editreasons { - font-size: 90%; - float: right; -} - -/* Search results */ -.searchresults { -} - -.searchresults p { - margin-left: 0.4em; - margin-top: 1em; - margin-bottom: 1.2em; -} - -div.searchresult { - font-size: 95%; - width: 38em; -} - -.mw-search-results { - margin-left: 0.4em; +#catlinks { + /** + * Overrides text justification (user preference) + * See bug 31990 + */ + text-align: left; } - -.mw-search-results li { - padding-bottom: 1em; +#catlinks ul { + display:inline; + margin: 0px; + padding: 0px; list-style: none; + list-style-type: none; list-style-image: none; -} -.mw-search-results li a { - font-size: 108%; -} - -.mw-search-result-data { - color: green; - font-size: 97%; -} - -.mw-search-formheader { - background-color: #f3f3f3; - margin-top: 1em; - border: 1px solid silver; -} -.mw-search-formheader div.search-types { - float: left; - padding-left: 0.25em; -} -.mw-search-formheader div.search-types ul { - margin: 0 !important; - padding: 0 !important; - list-style: none !important; -} -.mw-search-formheader div.search-types ul li { - float: left; - margin: 0; - padding: 0; -} -.mw-search-formheader div.search-types ul li a { - display: block; - padding: 0.5em; -} -.mw-search-formheader div.search-types ul li.current a { - color: #333333; - cursor: default; -} -.mw-search-formheader div.search-types ul li.current a:hover { - text-decoration: none; -} -.mw-search-formheader div.results-info { - float: right; - padding: 0.5em; - padding-right: 0.75em; -} -.mw-search-formheader div.results-info ul { - margin: 0 !important; - padding: 0 !important; - list-style: none !important; -} -.mw-search-formheader div.results-info ul li { - float: right; - margin: 0; - padding: 0; -} -fieldset#mw-searchoptions { - margin: 0; - padding-left: 0.75em !important; - padding-right: 0.75em !important; - padding-bottom: 0.5em !important; - padding-top: 0.5em !important; - border: none; - background-color: #f9f9f9; - border: 1px solid silver !important; - border-top-width: 0 !important; -} -fieldset#mw-searchoptions legend { - display: none; -} -fieldset#mw-searchoptions h4 { - padding: 0; - margin: 0; - float: left; -} -fieldset#mw-searchoptions div#mw-search-togglebox { - float: right; -} - -fieldset#mw-searchoptions div#mw-search-togglebox label { - margin-right: 0.25em; -} -fieldset#mw-searchoptions div#mw-search-togglebox input { - margin-left: 0.25em; -} -fieldset#mw-searchoptions table { - float: left; - margin-right: 3em; -} -fieldset#mw-searchoptions table td { - padding-right: 1em; -} -fieldset#mw-searchoptions div.divider { - clear: both; - border-bottom: 1px solid #DDDDDD; - padding-top: 0.5em; - margin-bottom: 0.5em; -} - -td#mw-search-menu { - padding-left:6em; - font-size:85%; + vertical-align: middle !ie; } -div#mw-search-interwiki { - float: right; - width: 18em; - border-style: solid; - border-color: #AAAAAA; - border-width: 1px; - margin-top: 2ex; +#catlinks li { + display:inline-block; + line-height: 1.35em; + padding: 0 .7em; + border-left: 1px solid #AAA; + margin: 0.3em 0; + zoom: 1; + display:inline !ie; } -div#mw-search-interwiki li { - font-size: 95%; +#catlinks li:first-child { + padding-left: .4em; + border-left: none; } +/** + * Hidden categories + */ +.mw-hidden-cats-hidden { display: none; } +.catlinks-allhidden { display: none; } -.mw-search-interwiki-more { - float: right; +/* Convenience links to edit block, delete and protect reasons */ +p.mw-ipb-conveniencelinks, p.mw-protect-editreasons, +p.mw-filedelete-editreasons, p.mw-delete-editreasons, +p.mw-revdel-editreasons { font-size: 90%; -} - -div#mw-search-interwiki-caption { - text-align: center; - font-weight: bold; - font-size: 95%; -} - -.mw-search-interwiki-project { - font-size: 97%; - text-align: left; - padding-left: 0.2em; - padding-right: 0.15em; - padding-bottom: 0.2em; - padding-top: 0.15em; - background-color: #ececec; - border-top: 1px solid #BBBBBB; -} - -span.searchalttitle { - font-size: 95%; -} - -div.searchdidyoumean { - font-size: 127%; - margin-top: 0.8em; - /* Note that this color won't affect the link, as desired. */ - color: #c00; -} - -div.searchdidyoumean em { - font-weight: bold; -} - -.searchmatch { - font-weight: bold; -} - - -/* - * Advanced PowerSearch box - */ -td#mw-search-togglebox { text-align: right; } -table#mw-search-powertable { - width: 100%; -} - -form#powersearch { - clear: both; -} - -/* - * UserRights stuff - */ -.mw-userrights-disabled { - color: #888; -} - -table.mw-userrights-groups * td,table.mw-userrights-groups * th { - padding-right: 1.5em; -} - /* * OpenSearch ajax suggestions */ @@ -436,36 +293,12 @@ table.os-suggest-results { border: 1px dashed #aaa; } -/** Generic minor/bot/newpage styling */ -.newpage, .minor, .bot { - font-weight: bold; -} - -/* Special:Contributions styling */ -.mw-uctop { - font-weight: bold; -} - -/* Special:ListGroupRights styling */ -table.mw-listgrouprights-table tr { - vertical-align: top; -} -.listgrouprights-revoked { - text-decoration: line-through; -} - -/* Special:Statistics styling */ -td.mw-statistics-numbers { - text-align: right; +.mw-history-revisiondelete-button, #mw-fileduplicatesearch-icon { + float: right; } -/* Special:SpecialPages styling */ -h4.mw-specialpagesgroup { - background-color: #dcdcdc; - padding: 2px; - margin: .3em 0em 0em 0em; -} -.mw-specialpagerestricted { +/** Generic minor/bot/newpage styling */ +.newpage, .minor, .bot { font-weight: bold; } @@ -473,42 +306,6 @@ h4.mw-specialpagesgroup { font-style: italic; } -/* Special:EmailUser styling */ -table.mw-emailuser-table { - width: 98%; -} -td#mw-emailuser-sender, td#mw-emailuser-recipient { - font-weight: bold; -} - -/* Special:Allpages styling */ -table.mw-allpages-table-form, table.mw-allpages-table-chunk { - width: 100%; -} -td.mw-allpages-alphaindexline { - text-align: right; -} -td.mw-allpages-nav, p.mw-allpages-nav { - text-align: right; - font-size: smaller; - margin-bottom: 1em; -} -table.mw-allpages-table-form tr { - vertical-align: top; -} - -/* Special:Prefixindex styling */ -table#mw-prefixindex-list-table, -table#mw-prefixindex-nav-table { - width: 98%; -} -td#mw-prefixindex-nav-form { - font-size: smaller; - margin-bottom: 1em; - text-align: right; - vertical-align: top; -} - /* * Recreating deleted page warning * Reupload file warning @@ -553,6 +350,11 @@ a.feedlink { background: none !important; padding: 0 !important; } +/* External URLs should always be treated as LTR (bug 4330) */ +/* @noflip */ .rtl a.external.free, .rtl a.external.autonumber { + direction: ltr; + unicode-bidi: embed; +} /* wikitable class for skinning normal tables * keep on sync with commonPrint.css @@ -586,11 +388,15 @@ table.collapsed tr.collapsable { color: green; font-size: larger; } +.warning { + color: #FFA500; /* orange */ + font-size: larger; +} .error { color: red; font-size: larger; } -.errorbox, .successbox { +.errorbox, .warningbox, .successbox { font-size: larger; border: 2px solid; padding: .5em 1em; @@ -602,11 +408,15 @@ table.collapsed tr.collapsable { border-color: red; background-color: #fff2f2; } +.warningbox { + border-color: #FF8C00; /* darkorange */ + background-color: #FFFFC0; +} .successbox { border-color: green; background-color: #dfd; } -.errorbox h2, .successbox h2 { +.errorbox h2, .warningbox h2, .successbox h2 { font-size: 1em; font-weight: bold; display: inline; @@ -614,6 +424,24 @@ table.collapsed tr.collapsable { border: none; } +/* general info/warning box for SP */ +.mw-infobox { + border: 2px solid #ff7f00; + margin: 0.5em; + clear: left; + overflow: hidden; +} + +.mw-infobox-left { + margin: 7px; + float: left; + width: 35px; +} + +.mw-infobox-right { + margin: 0.5em 0.5em 0.5em 49px; +} + /* Note on preview page */ .previewnote { color: #c00; @@ -647,6 +475,13 @@ table.collapsed tr.collapsable { min-width: 80%; border-collapse: collapse; } +.TablePager_nav { + margin: 0 auto; +} +.TablePager_nav td { + padding: 3px; + text-align: center; +} .TablePager_nav a { text-decoration: none; } @@ -677,23 +512,6 @@ table.collapsed tr.collapsable { background-color: #ccccff; } - /* Allmessages table */ -#mw-allmessagestable .allmessages-customised td.am_default { - background-color: #fcffc4; -} - -#mw-allmessagestable tr.allmessages-customised:hover td.am_default { - background-color: #faff90; -} - -#mw-allmessagestable td.am_actual { - background-color: #e2ffe2; -} - -#mw-allmessagestable tr.allmessages-customised:hover + tr.allmessages-customised td.am_actual { - background-color: #b1ffb1; -} - /* filetoc */ ul#filetoc { text-align: center; @@ -717,7 +535,7 @@ table.mw_metadata { font-size: 0.8em; margin-left: 0.5em; margin-bottom: 0.5em; - width: 300px; + width: 400px; } table.mw_metadata caption { @@ -740,8 +558,8 @@ table.mw_metadata { table.mw_metadata td, table.mw_metadata th { text-align: center; border: 1px solid #aaaaaa; - padding-left: 0.1em; - padding-right: 0.1em; + padding-left: 5px; + padding-right: 5px; } table.mw_metadata th { @@ -752,18 +570,65 @@ table.mw_metadata td { background-color: #fcfcfc; } +table.mw_metadata ul.metadata-langlist { + list-style-type: none; + list-style-image: none; + padding-right: 5px; + padding-left: 5px; + margin: 0; +} + +/* Correct directionality when page dir is different from site/user dir */ +.mw-content-ltr ul, +.mw-content-rtl .mw-content-ltr ul { + /* @noflip */ + margin: 0.3em 0 0 1.5em; + padding: 0; +} +.mw-content-rtl ul, +.mw-content-ltr .mw-content-rtl ul { + /* @noflip */ + margin: 0.3em 1.5em 0 0; + padding: 0; +} +.mw-content-ltr ol, +.mw-content-rtl .mw-content-ltr ol { + /* @noflip */ + margin: 0.3em 0 0 3.2em; + padding: 0; +} +.mw-content-rtl ol, +.mw-content-ltr .mw-content-rtl ol { + /* @noflip */ + margin: 0.3em 3.2em 0 0; + padding: 0; +} + +/* Correct directionality when page dir is different from site/user dir */ +/* @noflip */.mw-content-ltr ul, .mw-content-rtl .mw-content-ltr ul { + margin: .3em 0 0 1.5em; +} +/* @noflip */.mw-content-rtl ul, .mw-content-ltr .mw-content-rtl ul { + margin: .3em 1.5em 0 0; +} +/* @noflip */.mw-content-ltr ol, .mw-content-rtl .mw-content-ltr ol { + margin: .3em 0 0 3.2em; +} +/* @noflip */.mw-content-rtl ol, .mw-content-ltr .mw-content-rtl ol { + margin: .3em 3.2em 0 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; - background-color: #f9f9f9; border: solid 2px white; display: -moz-inline-box; + display: inline-block; } ul.gallery, li.gallerybox { - display: inline-block; zoom: 1; *display: inline; } @@ -784,9 +649,15 @@ li.gallerycaption { 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%; @@ -794,44 +665,6 @@ div.gallerytext { word-wrap: break-word; } -table.mw-enhanced-rc { - background: none; - border:0; - border-spacing:0; -} -td.mw-enhanced-rc { - white-space:nowrap; - padding:0; - vertical-align:top; - font-family:monospace -} - -#mw-addcategory-prompt { - display: inline; - margin-left: 1em; -} - -#mw-addcategory-prompt input { - margin-left: 0.5em; - margin-right: 0.5em; -} - -.mw-remove-category { - padding: 8px; - /* @embed */ - background-image: url(images/remove.png); - background-position: center center; - background-repeat: no-repeat; -} - -.mw-ajax-addcategory { - padding-left: 20px; - /* @embed */ - background-image: url(images/add.png); - background-position: left center; - background-repeat: no-repeat; -} - .mw-ajax-loader { /* @embed */ background-image: url(images/ajax-loader.gif); @@ -851,11 +684,6 @@ td.mw-enhanced-rc { background-repeat: no-repeat; } -/* Sort arrows added by SortableTables */ -a.sortheader { - margin: 0 0.3em; -} - /* Localised ordered list numbering for some languages */ ol:lang(bcc) li, ol:lang(bqi) li, @@ -872,26 +700,60 @@ ol:lang(ckb) li { list-style-type: arabic-indic; } +ol:lang(as) li, ol:lang(bn) li { list-style-type: -moz-bengali; list-style-type: bengali; } +ol:lang(or) li { + list-style-type: -moz-oriya; + list-style-type: oriya; +} + +#toc ul, .toc ul { + margin: .3em 0; +} + +/* Correct directionality when page dir is different from site/user dir */ +/* @noflip */.mw-content-ltr .toc ul, .mw-content-ltr #toc ul, +.mw-content-rtl .mw-content-ltr .toc ul, .mw-content-rtl .mw-content-ltr #toc ul { + text-align: left; +} +/* @noflip */.mw-content-rtl .toc ul, .mw-content-rtl #toc ul, +.mw-content-ltr .mw-content-rtl .toc ul, .mw-content-ltr .mw-content-rtl #toc ul { + text-align: right; +} +/* @noflip */.mw-content-ltr .toc ul ul, .mw-content-ltr #toc ul ul, +.mw-content-rtl .mw-content-ltr .toc ul ul, .mw-content-rtl .mw-content-ltr #toc ul ul { + margin: 0 0 0 2em; +} +/* @noflip */.mw-content-rtl .toc ul ul, .mw-content-rtl #toc ul ul, +.mw-content-ltr .mw-content-rtl .toc ul ul, .mw-content-ltr .mw-content-rtl #toc ul ul { + margin: 0 2em 0 0; +} + +#toc #toctitle, +.toc #toctitle, +#toc .toctitle, +.toc .toctitle { + direction: ltr; +} + /* tooltip styles */ .mw-help-field-hint { display: none; - padding: 0px; - padding-left: 15px; margin-left: 2px; margin-bottom: -8px; + padding: 0px 0px 0px 15px; /* @embed */ background-image: url('images/help-question.gif'); background-position: left center; background-repeat: no-repeat; - color: #0645ad; - text-decoration: underline; cursor: pointer; font-size: .8em; + text-decoration: underline; + color: #0645ad; } .mw-help-field-hint:hover { /* @embed */ @@ -904,9 +766,94 @@ ol:lang(bn) li { border: 1px solid #5dc9f4; margin-left: 20px; } -.tipsy { padding: 5px 5px 10px; font-size: 12px; position: absolute; z-index: 100000; overflow: visible; } -.tipsy-inner { padding: 5px 8px 4px 8px; background-color: #d6f3ff; color: black; border: 1px solid #5dc9f4; max-width: 300px; text-align: left; } -.tipsy-arrow { position: absolute; /* @embed */ background: url( 'images/tipsy-arrow.gif' ) no-repeat top left; width: 13px; height: 13px; } -.tipsy-se .tipsy-arrow { bottom: -2px; right: 10px; background-position: 0% 100%; } +.tipsy { + padding: 5px 5px 10px; + font-size: 12px; + position: absolute; + z-index: 100000; + overflow: visible; +} +.tipsy-inner { + padding: 5px 8px 4px 8px; + background-color: #d6f3ff; + color: black; + border: 1px solid #5dc9f4; + max-width: 300px; + text-align: left; +} +.tipsy-arrow { + position: absolute; + /* @embed */ + background: url(images/tipsy-arrow.gif) no-repeat top left; + width: 13px; + height: 13px; +} +.tipsy-se .tipsy-arrow { + bottom: -2px; + right: 10px; + background-position: 0% 100%; +} +/* Table Sorting */ +table.sortable th.headerSort { + background-image: url(images/sort_both.gif); + cursor: pointer; + background-repeat: no-repeat; + background-position: center right; + padding-right: 21px; +} +table.sortable th.headerSortUp { + background-image: url(images/sort_up.gif); +} +table.sortable th.headerSortDown { + background-image: url(images/sort_down.gif); +} + +/* LTR content in RTL layout */ +.ltr { + /* @noflip */ + direction: ltr; + unicode-bidi: embed; +} +#mw-clearyourcache, #mw-sitecsspreview, #mw-sitejspreview, #mw-usercsspreview, #mw-userjspreview { + direction: ltr; + unicode-bidi: embed; +} + +/* Correct user & content directionality when viewing a diff */ +.diff-currentversion-title, .diff { + direction: ltr; + unicode-bidi: embed; +} +/* @noflip */ .diff-contentalign-right td { + direction: rtl; + unicode-bidi: embed; +} +/* @noflip */ .diff-contentalign-left td { + direction: ltr; + unicode-bidi: embed; +} +.diff-otitle, .diff-ntitle, .diff-lineno { + direction: ltr !important; + unicode-bidi: embed; +} + +#mw-revision-info, #mw-revision-nav { + direction: ltr; +} + +/* Images */ +/* @noflip */div.tright, div.floatright, table.floatright { + clear: right; + float: right; +} +/* @noflip */div.tleft, div.floatleft, table.floatleft { + float: left; + clear: left; +} +div.floatright, table.floatright, div.floatleft, table.floatleft { + position: relative; +} +/* bug 12205 */ +#mw-credits a { unicode-bidi: embed; } diff --git a/skins/common/upload.js b/skins/common/upload.js index c877620b..99917c75 100644 --- a/skins/common/upload.js +++ b/skins/common/upload.js @@ -35,11 +35,6 @@ window.wgUploadSetup = function() { } } - // Toggle source type - var sourceTypeCheckboxes = document.getElementsByName( 'wpSourceType' ); - for ( var i = 0; i < sourceTypeCheckboxes.length; i++ ) { - sourceTypeCheckboxes[i].onchange = toggleUploadInputs; - } // AJAX wpDestFile warnings if ( wgAjaxUploadDestCheck ) { @@ -86,44 +81,6 @@ window.wgUploadSetup = function() { }; }; -/** - * Iterate over all upload source fields and disable all except the selected one. - * - * @return emptiness - */ -window.toggleUploadInputs = function() { - // Iterate over all rows with UploadSourceField - var rows; - if ( document.getElementsByClassName ) { - rows = document.getElementsByClassName( 'mw-htmlform-field-UploadSourceField' ); - } else { - // Older browsers don't support getElementsByClassName - rows = new Array(); - - var allRows = document.getElementsByTagName( 'tr' ); - for ( var i = 0; i < allRows.length; i++ ) { - if ( allRows[i].className == 'mw-htmlform-field-UploadSourceField' ) - rows.push( allRows[i] ); - } - } - - for ( var i = 0; i < rows.length; i++ ) { - var inputs = rows[i].getElementsByTagName( 'input' ); - - // Check if this row is selected - var isChecked = true; // Default true in case wpSourceType is not found - for ( var j = 0; j < inputs.length; j++ ) { - if ( inputs[j].name == 'wpSourceType' ) - isChecked = inputs[j].checked; - } - - // Disable all unselected rows - for ( var j = 0; j < inputs.length; j++ ) { - if ( inputs[j].type != 'radio') - inputs[j].disabled = !isChecked; - } - } -}; window.wgUploadWarningObj = { 'responseCache' : { '' : ' ' }, @@ -289,11 +246,7 @@ window.toggleFilenameFiller = function() { if(!document.getElementById) return; var upfield = document.getElementById('wpUploadFile'); var destName = document.getElementById('wpDestFile').value; - if (destName=='' || destName==' ') { - wgUploadAutoFill = true; - } else { - wgUploadAutoFill = false; - } + wgUploadAutoFill = ( destName == '' || destName == ' ' ); }; window.wgUploadLicenseObj = { diff --git a/skins/common/wikibits.js b/skins/common/wikibits.js index fcf2713e..5cb037be 100644 --- a/skins/common/wikibits.js +++ b/skins/common/wikibits.js @@ -136,42 +136,6 @@ if ( 'wgBreakFrames' in window && window.wgBreakFrames ) { } } -window.showTocToggle = function() { - if ( document.createTextNode ) { - // Uses DOM calls to avoid document.write + XHTML issues - - var linkHolder = document.getElementById( 'toctitle' ); - var existingLink = document.getElementById( 'togglelink' ); - if ( !linkHolder || existingLink ) { - // Don't add the toggle link twice - return; - } - - var outerSpan = document.createElement( 'span' ); - outerSpan.className = 'toctoggle'; - - var toggleLink = document.createElement( 'a' ); - toggleLink.id = 'togglelink'; - toggleLink.className = 'internal'; - toggleLink.href = '#'; - addClickHandler( toggleLink, function( evt ) { toggleToc(); return killEvt( evt ); } ); - - toggleLink.appendChild( document.createTextNode( mediaWiki.msg( 'hidetoc' ) ) ); - - outerSpan.appendChild( document.createTextNode( '[' ) ); - outerSpan.appendChild( toggleLink ); - outerSpan.appendChild( document.createTextNode( ']' ) ); - - linkHolder.appendChild( document.createTextNode( ' ' ) ); - linkHolder.appendChild( outerSpan ); - - var cookiePos = document.cookie.indexOf( "hidetoc=" ); - if ( cookiePos > -1 && document.cookie.charAt( cookiePos + 8 ) == 1 ) { - toggleToc(); - } - } -}; - window.changeText = function( el, newText ) { // Safari work around if ( el.innerText ) { @@ -192,25 +156,6 @@ window.killEvt = function( evt ) { return false; // Don't follow the link (IE) }; -window.toggleToc = function() { - var tocmain = document.getElementById( 'toc' ); - var toc = document.getElementById('toc').getElementsByTagName('ul')[0]; - var toggleLink = document.getElementById( 'togglelink' ); - - if ( toc && toggleLink && toc.style.display == 'none' ) { - changeText( toggleLink, mediaWiki.msg( 'hidetoc' ) ); - toc.style.display = 'block'; - document.cookie = "hidetoc=0"; - tocmain.className = 'toc'; - } else { - changeText( toggleLink, mediaWiki.msg( 'showtoc' ) ); - toc.style.display = 'none'; - document.cookie = "hidetoc=1"; - tocmain.className = 'toc tochidden'; - } - return false; -}; - window.mwEditButtons = []; window.mwCustomEditButtons = []; // eg to add in MediaWiki:Common.js @@ -412,7 +357,7 @@ window.getInnerText = function( el ) { for ( var i = 0; i < l; i++ ) { switch ( cs[i].nodeType ) { case 1: // ELEMENT_NODE - str += ts_getInnerText( cs[i] ); + str += getInnerText( cs[i] ); break; case 3: // TEXT_NODE str += cs[i].nodeValue; @@ -572,380 +517,6 @@ window.redirectToFragment = function( fragment ) { } }; -/* - * Table sorting script based on one (c) 1997-2006 Stuart Langridge and Joost - * de Valk: - * http://www.joostdevalk.nl/code/sortable-table/ - * http://www.kryogenix.org/code/browser/sorttable/ - * - * @todo don't break on colspans/rowspans (bug 8028) - * @todo language-specific digit grouping/decimals (bug 8063) - * @todo support all accepted date formats (bug 8226) - */ - -window.ts_image_path = stylepath + '/common/images/'; -window.ts_image_up = 'sort_up.gif'; -window.ts_image_down = 'sort_down.gif'; -window.ts_image_none = 'sort_none.gif'; -window.ts_europeandate = wgContentLanguage != 'en'; // The non-American-inclined can change to "true" -window.ts_alternate_row_colors = false; -window.ts_number_transform_table = null; -window.ts_number_regex = null; - -window.sortables_init = function() { - var idnum = 0; - // Find all tables with class sortable and make them sortable - var tables = getElementsByClassName( document, 'table', 'sortable' ); - for ( var ti = 0; ti < tables.length ; ti++ ) { - if ( !tables[ti].id ) { - tables[ti].setAttribute( 'id', 'sortable_table_id_' + idnum ); - ++idnum; - } - ts_makeSortable( tables[ti] ); - } -}; - -window.ts_makeSortable = function( table ) { - var firstRow; - if ( table.rows && table.rows.length > 0 ) { - if ( table.tHead && table.tHead.rows.length > 0 ) { - firstRow = table.tHead.rows[table.tHead.rows.length-1]; - } else { - firstRow = table.rows[0]; - } - } - if ( !firstRow ) { - return; - } - - // We have a first row: assume it's the header, and make its contents clickable links - for ( var i = 0; i < firstRow.cells.length; i++ ) { - var cell = firstRow.cells[i]; - if ( (' ' + cell.className + ' ').indexOf(' unsortable ') == -1 ) { - $(cell).append ( '<a href="#" class="sortheader" ' - + 'onclick="ts_resortTable(this);return false;">' - + '<span class="sortarrow">' - + '<img src="' - + ts_image_path - + ts_image_none - + '" alt="↓"/></span></a>'); - } - } - if ( ts_alternate_row_colors ) { - ts_alternate( table ); - } -}; - -window.ts_getInnerText = function( el ) { - return getInnerText( el ); -}; - -window.ts_resortTable = function( lnk ) { - // get the span - var span = lnk.getElementsByTagName('span')[0]; - - var td = lnk.parentNode; - var tr = td.parentNode; - var column = td.cellIndex; - - var table = tr.parentNode; - while ( table && !( table.tagName && table.tagName.toLowerCase() == 'table' ) ) { - table = table.parentNode; - } - if ( !table ) { - return; - } - - if ( table.rows.length <= 1 ) { - return; - } - - // Generate the number transform table if it's not done already - if ( ts_number_transform_table === null ) { - ts_initTransformTable(); - } - - // Work out a type for the column - // Skip the first row if that's where the headings are - var rowStart = ( table.tHead && table.tHead.rows.length > 0 ? 0 : 1 ); - var bodyRows = 0; - if (rowStart == 0 && table.tBodies) { - for (var i=0; i < table.tBodies.length; i++ ) { - bodyRows += table.tBodies[i].rows.length; - } - if (bodyRows < table.rows.length) - rowStart = 1; - } - - var itm = ''; - for ( var i = rowStart; i < table.rows.length; i++ ) { - if ( table.rows[i].cells.length > column ) { - itm = ts_getInnerText(table.rows[i].cells[column]); - itm = itm.replace(/^[\s\xa0]+/, '').replace(/[\s\xa0]+$/, ''); - if ( itm != '' ) { - break; - } - } - } - - // TODO: bug 8226, localised date formats - var sortfn = ts_sort_generic; - var preprocessor = ts_toLowerCase; - if ( /^\d\d[\/. -][a-zA-Z]{3}[\/. -]\d\d\d\d$/.test( itm ) ) { - preprocessor = ts_dateToSortKey; - } else if ( /^\d\d[\/.-]\d\d[\/.-]\d\d\d\d$/.test( itm ) ) { - preprocessor = ts_dateToSortKey; - } else if ( /^\d\d[\/.-]\d\d[\/.-]\d\d$/.test( itm ) ) { - preprocessor = ts_dateToSortKey; - // (minus sign)([pound dollar euro yen currency]|cents) - } else if ( /(^([-\u2212] *)?[\u00a3$\u20ac\u00a4\u00a5]|\u00a2$)/.test( itm ) ) { - preprocessor = ts_currencyToSortKey; - } else if ( ts_number_regex.test( itm ) ) { - preprocessor = ts_parseFloat; - } - - var reverse = ( span.getAttribute( 'sortdir' ) == 'down' ); - - var newRows = new Array(); - var staticRows = new Array(); - for ( var j = rowStart; j < table.rows.length; j++ ) { - var row = table.rows[j]; - if( (' ' + row.className + ' ').indexOf(' unsortable ') < 0 ) { - var keyText = ts_getInnerText( row.cells[column] ); - if( keyText === undefined ) { - keyText = ''; - } - var oldIndex = ( reverse ? -j : j ); - var preprocessed = preprocessor( keyText.replace(/^[\s\xa0]+/, '').replace(/[\s\xa0]+$/, '') ); - - newRows[newRows.length] = new Array( row, preprocessed, oldIndex ); - } else { - staticRows[staticRows.length] = new Array( row, false, j-rowStart ); - } - } - - newRows.sort( sortfn ); - - var arrowHTML; - if ( reverse ) { - arrowHTML = '<img src="' + ts_image_path + ts_image_down + '" alt="↓"/>'; - newRows.reverse(); - span.setAttribute( 'sortdir', 'up' ); - } else { - arrowHTML = '<img src="' + ts_image_path + ts_image_up + '" alt="↑"/>'; - span.setAttribute( 'sortdir', 'down' ); - } - - for ( var i = 0; i < staticRows.length; i++ ) { - var row = staticRows[i]; - newRows.splice( row[2], 0, row ); - } - - // We appendChild rows that already exist to the tbody, so it moves them rather than creating new ones - // don't do sortbottom rows - for ( var i = 0; i < newRows.length; i++ ) { - if ( ( ' ' + newRows[i][0].className + ' ').indexOf(' sortbottom ') == -1 ) { - table.tBodies[0].appendChild( newRows[i][0] ); - } - } - // do sortbottom rows only - for ( var i = 0; i < newRows.length; i++ ) { - if ( ( ' ' + newRows[i][0].className + ' ').indexOf(' sortbottom ') != -1 ) { - table.tBodies[0].appendChild( newRows[i][0] ); - } - } - - // Delete any other arrows there may be showing - var spans = getElementsByClassName( tr, 'span', 'sortarrow' ); - for ( var i = 0; i < spans.length; i++ ) { - spans[i].innerHTML = '<img src="' + ts_image_path + ts_image_none + '" alt="↓"/>'; - } - span.innerHTML = arrowHTML; - - if ( ts_alternate_row_colors ) { - ts_alternate( table ); - } -}; - -window.ts_initTransformTable = function() { - if ( typeof wgSeparatorTransformTable == 'undefined' - || ( wgSeparatorTransformTable[0] == '' && wgDigitTransformTable[2] == '' ) ) - { - var digitClass = "[0-9,.]"; - ts_number_transform_table = false; - } else { - ts_number_transform_table = {}; - // Unpack the transform table - // Separators - var ascii = wgSeparatorTransformTable[0].split("\t"); - var localised = wgSeparatorTransformTable[1].split("\t"); - for ( var i = 0; i < ascii.length; i++ ) { - ts_number_transform_table[localised[i]] = ascii[i]; - } - // Digits - ascii = wgDigitTransformTable[0].split("\t"); - localised = wgDigitTransformTable[1].split("\t"); - for ( var i = 0; i < ascii.length; i++ ) { - ts_number_transform_table[localised[i]] = ascii[i]; - } - - // Construct regex for number identification - var digits = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ',', '\\.']; - var maxDigitLength = 1; - for ( var digit in ts_number_transform_table ) { - // Escape regex metacharacters - digits.push( - digit.replace( /[\\\\$\*\+\?\.\(\)\|\{\}\[\]\-]/, - function( s ) { return '\\' + s; } ) - ); - if ( digit.length > maxDigitLength ) { - maxDigitLength = digit.length; - } - } - if ( maxDigitLength > 1 ) { - var digitClass = '[' + digits.join( '', digits ) + ']'; - } else { - var digitClass = '(' + digits.join( '|', digits ) + ')'; - } - } - - // We allow a trailing percent sign, which we just strip. This works fine - // if percents and regular numbers aren't being mixed. - ts_number_regex = new RegExp( - "^(" + - "[-+\u2212]?[0-9][0-9,]*(\\.[0-9,]*)?(E[-+\u2212]?[0-9][0-9,]*)?" + // Fortran-style scientific - "|" + - "[-+\u2212]?" + digitClass + "+%?" + // Generic localised - ")$", "i" - ); -}; - -window.ts_toLowerCase = function( s ) { - return s.toLowerCase(); -}; - -window.ts_dateToSortKey = function( date ) { - // y2k notes: two digit years less than 50 are treated as 20XX, greater than 50 are treated as 19XX - if ( date.length == 11 ) { - switch ( date.substr( 3, 3 ).toLowerCase() ) { - case 'jan': - var month = '01'; - break; - case 'feb': - var month = '02'; - break; - case 'mar': - var month = '03'; - break; - case 'apr': - var month = '04'; - break; - case 'may': - var month = '05'; - break; - case 'jun': - var month = '06'; - break; - case 'jul': - var month = '07'; - break; - case 'aug': - var month = '08'; - break; - case 'sep': - var month = '09'; - break; - case 'oct': - var month = '10'; - break; - case 'nov': - var month = '11'; - break; - case 'dec': - var month = '12'; - break; - // default: var month = '00'; - } - return date.substr( 7, 4 ) + month + date.substr( 0, 2 ); - } else if ( date.length == 10 ) { - if ( ts_europeandate == false ) { - return date.substr( 6, 4 ) + date.substr( 0, 2 ) + date.substr( 3, 2 ); - } else { - return date.substr( 6, 4 ) + date.substr( 3, 2 ) + date.substr( 0, 2 ); - } - } else if ( date.length == 8 ) { - var yr = date.substr( 6, 2 ); - if ( parseInt( yr ) < 50 ) { - yr = '20' + yr; - } else { - yr = '19' + yr; - } - if ( ts_europeandate == true ) { - return yr + date.substr( 3, 2 ) + date.substr( 0, 2 ); - } else { - return yr + date.substr( 0, 2 ) + date.substr( 3, 2 ); - } - } - return '00000000'; -}; - -window.ts_parseFloat = function( s ) { - if ( !s ) { - return 0; - } - if ( ts_number_transform_table != false ) { - var newNum = '', c; - - for ( var p = 0; p < s.length; p++ ) { - c = s.charAt( p ); - if ( c in ts_number_transform_table ) { - newNum += ts_number_transform_table[c]; - } else { - newNum += c; - } - } - s = newNum; - } - var num = parseFloat( s.replace(/[, ]/g, '').replace("\u2212", '-') ); - return ( isNaN( num ) ? -Infinity : num ); -}; - -window.ts_currencyToSortKey = function( s ) { - return ts_parseFloat(s.replace(/[^-\u22120-9.,]/g,'')); -}; - -window.ts_sort_generic = function( a, b ) { - return a[1] < b[1] ? -1 : a[1] > b[1] ? 1 : a[2] - b[2]; -}; - -window.ts_alternate = function( table ) { - // Take object table and get all it's tbodies. - var tableBodies = table.getElementsByTagName( 'tbody' ); - // Loop through these tbodies - for ( var i = 0; i < tableBodies.length; i++ ) { - // Take the tbody, and get all it's rows - var tableRows = tableBodies[i].getElementsByTagName( 'tr' ); - // Loop through these rows - // Start at 1 because we want to leave the heading row untouched - for ( var j = 0; j < tableRows.length; j++ ) { - // Check if j is even, and apply classes for both possible results - var oldClasses = tableRows[j].className.split(' '); - var newClassName = ''; - for ( var k = 0; k < oldClasses.length; k++ ) { - if ( oldClasses[k] != '' && oldClasses[k] != 'even' && oldClasses[k] != 'odd' ) { - newClassName += oldClasses[k] + ' '; - } - } - tableRows[j].className = newClassName + ( j % 2 == 0 ? 'even' : 'odd' ); - } - } -}; - -/* - * End of table sorting code - */ - - /** * Add a cute little box at the top of the screen to inform the user of * something, replacing any preexisting message. @@ -1041,11 +612,6 @@ window.runOnloadHook = function() { // might cause the function to terminate prematurely doneOnloadHook = true; - updateTooltipAccessKeys( null ); - setupCheckboxShiftClick(); - - jQuery( document ).ready( sortables_init ); - // Run any added-on functions for ( var i = 0; i < onloadFuncts.length; i++ ) { onloadFuncts[i](); @@ -1101,6 +667,4 @@ hookEvent( 'load', runOnloadHook ); if ( ie6_bugs ) { importScriptURI( stylepath + '/common/IEFixes.js' ); -} - -showTocToggle(); +}
\ No newline at end of file |