From ca32f08966f1b51fcb19460f0996bb0c4048e6fe Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 3 Dec 2011 13:29:22 +0100 Subject: Update to MediaWiki 1.18.0 * also update ArchLinux skin to chagnes in MonoBook * Use only css to hide our menu bar when printing --- skins/common/IEFixes.js | 4 +- skins/common/Makefile | 2 - skins/common/ajax.js | 2 - skins/common/ajaxwatch.js | 120 ------ skins/common/block.js | 89 ----- skins/common/cologneblue.css | 210 ---------- skins/common/commonPrint.css | 36 +- skins/common/common_rtl.css | 59 --- skins/common/config.css | 22 +- skins/common/config.js | 2 +- skins/common/diff.css | 75 ---- skins/common/diff.js | 20 - skins/common/edit.js | 231 ----------- skins/common/enhancedchanges.js | 40 -- skins/common/history.js | 77 ---- skins/common/htmlform.js | 40 -- skins/common/images/cc-by.png | Bin 0 -> 4739 bytes skins/common/images/critical-32.png | Bin 2395 -> 1914 bytes skins/common/images/download-32.png | Bin 2057 -> 1846 bytes skins/common/images/info-32.png | Bin 2159 -> 1940 bytes skins/common/images/magnify-clip-rtl.png | Bin 0 -> 252 bytes skins/common/images/sort_down.gif | Bin 464 -> 0 bytes skins/common/images/sort_none.gif | Bin 462 -> 0 bytes skins/common/images/sort_up.gif | Bin 466 -> 0 bytes skins/common/images/tick-32.png | Bin 1457 -> 1137 bytes skins/common/images/warning-32.png | Bin 1895 -> 1349 bytes skins/common/metadata.js | 53 --- skins/common/mwsuggest.js | 46 +-- skins/common/nostalgia.css | 48 --- skins/common/oldshared.css | 32 +- skins/common/prefs.js | 138 ------- skins/common/preview.js | 16 +- skins/common/protect.js | 2 + skins/common/search.css | 14 - skins/common/search.js | 50 --- skins/common/shared.css | 645 ++++++++++++++----------------- skins/common/upload.js | 49 +-- skins/common/wikibits.js | 440 +-------------------- 38 files changed, 397 insertions(+), 2165 deletions(-) delete mode 100644 skins/common/Makefile delete mode 100644 skins/common/ajaxwatch.js delete mode 100644 skins/common/block.js delete mode 100644 skins/common/cologneblue.css delete mode 100644 skins/common/common_rtl.css delete mode 100644 skins/common/diff.css delete mode 100644 skins/common/diff.js delete mode 100644 skins/common/edit.js delete mode 100644 skins/common/enhancedchanges.js delete mode 100644 skins/common/history.js delete mode 100644 skins/common/htmlform.js create mode 100644 skins/common/images/cc-by.png create mode 100644 skins/common/images/magnify-clip-rtl.png delete mode 100644 skins/common/images/sort_down.gif delete mode 100644 skins/common/images/sort_none.gif delete mode 100644 skins/common/images/sort_up.gif delete mode 100644 skins/common/metadata.js delete mode 100644 skins/common/nostalgia.css delete mode 100644 skins/common/prefs.js delete mode 100644 skins/common/search.css delete mode 100644 skins/common/search.js (limited to 'skins/common') 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 -
s in 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 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 = $('
'); $('#wikiPreview').before( loadSpinner ); - + var page = $('
'); var target = $('#editform').attr('action'); - + if ( !target ) { target = window.location.href; } - + page.load( target + ' ' + copySelector, postData, function() { - + for( var i=0; i