From 222b01f5169f1c7e69762e0e8904c24f78f71882 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 28 Jul 2010 11:52:48 +0200 Subject: update to MediaWiki 1.16.0 --- skins/common/IE80Fixes.css | 15 + skins/common/IEFixes.js | 205 +- skins/common/Makefile | 2 + skins/common/ajaxwatch.js | 53 +- skins/common/allmessages.js | 83 - skins/common/block.js | 37 +- skins/common/commonPrint.css | 36 +- skins/common/common_rtl.css | 7 +- skins/common/edit.js | 209 +- skins/common/history.js | 11 +- skins/common/htmlform.js | 40 + skins/common/images/Arr_.png | Bin 918 -> 246 bytes skins/common/images/Arr_r.xcf | Bin 1437 -> 0 bytes skins/common/images/Arr_u.png | Bin 1044 -> 425 bytes skins/common/images/Zoom_sans.gif | Bin 901 -> 901 bytes skins/common/images/add.png | Bin 0 -> 3329 bytes skins/common/images/ajax-loader.gif | Bin 0 -> 3208 bytes skins/common/images/arrow_first.svg | 85 - skins/common/images/arrow_left.svg | 78 - skins/common/images/be-tarask/button_bold.png | Bin 575 -> 554 bytes skins/common/images/be-tarask/button_italic.png | Bin 638 -> 592 bytes skins/common/images/be-tarask/button_link.png | Bin 550 -> 466 bytes skins/common/images/button_bold.png | Bin 978 -> 288 bytes skins/common/images/button_extlink.png | Bin 1093 -> 494 bytes skins/common/images/button_headline.png | Bin 497 -> 465 bytes skins/common/images/button_hr.png | Bin 372 -> 251 bytes skins/common/images/button_image.png | Bin 1110 -> 584 bytes skins/common/images/button_italic.png | Bin 975 -> 292 bytes skins/common/images/button_link.png | Bin 434 -> 337 bytes skins/common/images/button_math.png | Bin 730 -> 617 bytes skins/common/images/button_media.png | Bin 1155 -> 780 bytes skins/common/images/button_nowiki.png | Bin 375 -> 352 bytes skins/common/images/button_sig.png | Bin 1217 -> 953 bytes skins/common/images/button_template.png | Bin 362 -> 233 bytes skins/common/images/cyrl/button_italic.png | Bin 461 -> 460 bytes skins/common/images/cyrl/button_link.png | Bin 353 -> 347 bytes skins/common/images/de/button_bold.png | Bin 1013 -> 328 bytes skins/common/images/de/button_italic.png | Bin 1021 -> 351 bytes skins/common/images/fa/button_bold.png | Bin 504 -> 500 bytes skins/common/images/fa/button_headline.png | Bin 438 -> 434 bytes skins/common/images/fa/button_italic.png | Bin 577 -> 573 bytes skins/common/images/fa/button_link.png | Bin 538 -> 535 bytes skins/common/images/fileicon.xcf | Bin 26160 -> 0 bytes skins/common/images/gnu-fdl.png | Bin 1748 -> 1730 bytes skins/common/images/gnu-fdl.xcf | Bin 5578 -> 0 bytes skins/common/images/icons/fileicon-c.png | Bin 2995 -> 2211 bytes skins/common/images/icons/fileicon-cpp.png | Bin 2250 -> 1882 bytes skins/common/images/icons/fileicon-deb.png | Bin 5528 -> 4801 bytes skins/common/images/icons/fileicon-djvu.png | Bin 11137 -> 10752 bytes skins/common/images/icons/fileicon-dvi.png | Bin 13042 -> 12778 bytes skins/common/images/icons/fileicon-exe.png | Bin 5864 -> 5680 bytes skins/common/images/icons/fileicon-h.png | Bin 1195 -> 1191 bytes skins/common/images/icons/fileicon-html.png | Bin 7601 -> 7422 bytes skins/common/images/icons/fileicon-iso.png | Bin 6673 -> 6450 bytes skins/common/images/icons/fileicon-java.png | Bin 6825 -> 5989 bytes skins/common/images/icons/fileicon-mid.png | Bin 7191 -> 6657 bytes skins/common/images/icons/fileicon-mov.png | Bin 7946 -> 7716 bytes skins/common/images/icons/fileicon-o.png | Bin 2893 -> 2204 bytes skins/common/images/icons/fileicon-ogg.png | Bin 6143 -> 3750 bytes skins/common/images/icons/fileicon-pdf.png | Bin 5138 -> 4976 bytes skins/common/images/icons/fileicon-ps.png | Bin 3293 -> 3012 bytes skins/common/images/icons/fileicon-rm.png | Bin 4977 -> 2851 bytes skins/common/images/icons/fileicon-rpm.png | Bin 4753 -> 4103 bytes skins/common/images/icons/fileicon-svg.png | Bin 5193 -> 5094 bytes skins/common/images/icons/fileicon-tar.png | Bin 6544 -> 6347 bytes skins/common/images/icons/fileicon-tex.png | Bin 4203 -> 3997 bytes skins/common/images/icons/fileicon-ttf.png | Bin 3625 -> 3469 bytes skins/common/images/icons/fileicon-txt.png | Bin 6801 -> 3638 bytes skins/common/images/ksh/button_S_italic.png | Bin 3812 -> 3206 bytes skins/common/images/link_icon.gif | Bin 942 -> 342 bytes skins/common/images/magnify-clip.png | Bin 267 -> 204 bytes skins/common/images/mediawiki-small.xcf | Bin 36011 -> 0 bytes skins/common/images/mediawiki.png | Bin 23064 -> 22987 bytes skins/common/images/poweredby_mediawiki_88x31.png | Bin 1933 -> 1927 bytes skins/common/images/public-domain.png | Bin 2892 -> 2251 bytes skins/common/images/redirectltr.png | Bin 1024 -> 381 bytes skins/common/images/redirectrtl.png | Bin 1017 -> 381 bytes skins/common/images/remove.png | Bin 0 -> 3346 bytes skins/common/images/sort_down.gif | Bin 879 -> 464 bytes skins/common/images/sort_none.gif | Bin 877 -> 462 bytes skins/common/images/sort_up.gif | Bin 881 -> 466 bytes skins/common/images/spinner.gif | Bin 586 -> 4648 bytes skins/common/images/wiki.png | Bin 24954 -> 24801 bytes skins/common/jquery.js | 4384 +++++++++++++++++++++ skins/common/jquery.min.js | 433 ++ skins/common/metadata.js | 36 +- skins/common/mwsuggest.js | 1312 +++--- skins/common/oldshared.css | 61 +- skins/common/prefs.js | 205 +- skins/common/preview.js | 208 +- skins/common/protect.js | 2 +- skins/common/search.js | 50 + skins/common/shared.css | 587 ++- skins/common/sticky.js | 124 - skins/common/upload.js | 203 +- skins/common/wikibits.js | 782 ++-- 96 files changed, 7308 insertions(+), 1940 deletions(-) create mode 100644 skins/common/IE80Fixes.css create mode 100644 skins/common/Makefile delete mode 100644 skins/common/allmessages.js create mode 100644 skins/common/htmlform.js delete mode 100644 skins/common/images/Arr_r.xcf create mode 100644 skins/common/images/add.png create mode 100644 skins/common/images/ajax-loader.gif delete mode 100644 skins/common/images/arrow_first.svg delete mode 100644 skins/common/images/arrow_left.svg delete mode 100644 skins/common/images/fileicon.xcf delete mode 100644 skins/common/images/gnu-fdl.xcf delete mode 100644 skins/common/images/mediawiki-small.xcf create mode 100644 skins/common/images/remove.png create mode 100644 skins/common/jquery.js create mode 100644 skins/common/jquery.min.js create mode 100644 skins/common/search.js delete mode 100644 skins/common/sticky.js (limited to 'skins/common') diff --git a/skins/common/IE80Fixes.css b/skins/common/IE80Fixes.css new file mode 100644 index 00000000..b6360f60 --- /dev/null +++ b/skins/common/IE80Fixes.css @@ -0,0 +1,15 @@ +/** + * Fixes textarea scrolling bug (bug #19334). The bug only occurs when a + * percentage width is given, so instead of width: 100%, use min-width: 100%; + * max-width: 100%. We also need to give a fixed width for the actual width + * property for the hack to work, although the actual value (500px here) ends + * up being ignored; min/max-width take precedence. + * + * More info: http://grantovich.net/posts/2009/06/that-weird-ie8-textarea-bug/ + */ +#wpTextbox1 { + height: 390px; + width: 500px; + min-width: 100%; + max-width: 100%; +} diff --git a/skins/common/IEFixes.js b/skins/common/IEFixes.js index f85f506c..762d7a78 100644 --- a/skins/common/IEFixes.js +++ b/skins/common/IEFixes.js @@ -1,127 +1,128 @@ // IE fixes javascript -var isMSIE55 = (window.showModalDialog && window.clipboardData && window.createPopup); +var isMSIE55 = ( window.showModalDialog && window.clipboardData && window.createPopup ); var doneIETransform; var doneIEAlphaFix; -if (document.attachEvent) - document.attachEvent('onreadystatechange', hookit); +if ( document.attachEvent ) { + document.attachEvent( 'onreadystatechange', hookit ); +} function hookit() { - if (!doneIETransform && document.getElementById && document.getElementById('bodyContent')) { - doneIETransform = true; - relativeforfloats(); - fixalpha(); - } + if ( !doneIETransform && document.getElementById && document.getElementById( 'bodyContent' ) ) { + doneIETransform = true; + relativeforfloats(); + fixalpha(); + } } // png alpha transparency fixes -function fixalpha() { - // bg - if (isMSIE55 && !doneIEAlphaFix) - { - var plogo = document.getElementById('p-logo'); - if (!plogo) return; - - var logoa = plogo.getElementsByTagName('a')[0]; - if (!logoa) return; - - var bg = logoa.currentStyle.backgroundImage; - var imageUrl = bg.substring(5, bg.length-2); - - doneIEAlphaFix = true; - - if (imageUrl.substr(imageUrl.length-4).toLowerCase() == '.png') { - var logospan = logoa.appendChild(document.createElement('span')); - - logoa.style.backgroundImage = 'none'; - logospan.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=' + imageUrl + ')'; - logospan.style.height = '100%'; - logospan.style.position = 'absolute'; - logospan.style.width = logoa.currentStyle.width; - logospan.style.cursor = 'hand'; - // Center image with hack for IE5.5 - if (document.documentElement.dir == "rtl") - { - logospan.style.right = '50%'; - logospan.style.setExpression('marginRight', '"-" + (this.offsetWidth / 2) + "px"'); - } - else - { - logospan.style.left = '50%'; - logospan.style.setExpression('marginLeft', '"-" + (this.offsetWidth / 2) + "px"'); - } - logospan.style.top = '50%'; - logospan.style.setExpression('marginTop', '"-" + (this.offsetHeight / 2) + "px"'); - - var linkFix = logoa.appendChild(logoa.cloneNode()); - linkFix.style.position = 'absolute'; - linkFix.style.height = '100%'; - linkFix.style.width = '100%'; - } - } +function fixalpha( logoId ) { + // bg + if ( isMSIE55 && !doneIEAlphaFix ) { + var plogo = document.getElementById( logoId || 'p-logo' ); + if ( !plogo ) { + return; + } + + var logoa = plogo.getElementsByTagName('a')[0]; + if ( !logoa ) { + return; + } + + var bg = logoa.currentStyle.backgroundImage; + var imageUrl = bg.substring( 5, bg.length - 2 ); + + doneIEAlphaFix = true; + + if ( imageUrl.substr( imageUrl.length - 4 ).toLowerCase() == '.png' ) { + var logospan = logoa.appendChild( document.createElement( 'span' ) ); + + logoa.style.backgroundImage = 'none'; + logospan.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=' + imageUrl + ')'; + logospan.style.height = '100%'; + logospan.style.position = 'absolute'; + logospan.style.width = logoa.currentStyle.width; + logospan.style.cursor = 'hand'; + // Center image with hack for IE5.5 + if ( document.documentElement.dir == 'rtl' ) { + logospan.style.right = '50%'; + logospan.style.setExpression( 'marginRight', '"-" + (this.offsetWidth / 2) + "px"' ); + } else { + logospan.style.left = '50%'; + logospan.style.setExpression( 'marginLeft', '"-" + (this.offsetWidth / 2) + "px"' ); + } + logospan.style.top = '50%'; + logospan.style.setExpression( 'marginTop', '"-" + (this.offsetHeight / 2) + "px"' ); + + var linkFix = logoa.appendChild( logoa.cloneNode() ); + linkFix.style.position = 'absolute'; + linkFix.style.height = '100%'; + linkFix.style.width = '100%'; + } + } } // fix ie6 disappering float bug function relativeforfloats() { - var bc = document.getElementById('bodyContent'); - if (bc) { - var tables = bc.getElementsByTagName('table'); - var divs = bc.getElementsByTagName('div'); - } - setrelative(tables); - setrelative(divs); + var bc = document.getElementById( 'bodyContent' ); + if ( bc ) { + var tables = bc.getElementsByTagName( 'table' ); + var divs = bc.getElementsByTagName( 'div' ); + } + setrelative( tables ); + setrelative( divs ); } -function setrelative (nodes) { - var i = 0; - while (i < nodes.length) { - if(((nodes[i].style.float && nodes[i].style.float != ('none') || - (nodes[i].align && nodes[i].align != ('none'))) && - (!nodes[i].style.position || nodes[i].style.position != 'relative'))) - { - nodes[i].style.position = 'relative'; - } - i++; - } +function setrelative( nodes ) { + var i = 0; + while ( i < nodes.length ) { + if( ( ( nodes[i].style.float && nodes[i].style.float != ( 'none' ) || + ( nodes[i].align && nodes[i].align != ( 'none' ) ) ) && + ( !nodes[i].style.position || nodes[i].style.position != 'relative' ) ) ) + { + nodes[i].style.position = 'relative'; + } + i++; + } } - // Expand links for printing - -String.prototype.hasClass = function(classWanted) -{ - var classArr = this.split(/\s/); - for (var i=0; i body div#article ul { display: table; } +html > body div#bodyContent ul#filetoc { + display: block; +} /* feed links */ a.feedlink { diff --git a/skins/common/edit.js b/skins/common/edit.js index 945059e0..423205f8 100644 --- a/skins/common/edit.js +++ b/skins/common/edit.js @@ -1,137 +1,163 @@ +var currentFocused; + // this function generates the actual toolbar buttons with localized text // we use it to avoid creating the toolbar where javascript is not enabled -function addButton(imageFile, speedTip, tagOpen, tagClose, sampleText, imageId) { +function addButton( imageFile, speedTip, tagOpen, tagClose, sampleText, imageId ) { // Don't generate buttons for browsers which don't fully // support it. - mwEditButtons[mwEditButtons.length] = - {"imageId": imageId, - "imageFile": imageFile, - "speedTip": speedTip, - "tagOpen": tagOpen, - "tagClose": tagClose, - "sampleText": sampleText}; + mwEditButtons.push({ + 'imageId': imageId, + 'imageFile': imageFile, + 'speedTip': speedTip, + 'tagOpen': tagOpen, + 'tagClose': tagClose, + 'sampleText': sampleText + }); } // this function generates the actual toolbar buttons with localized text -// we use it to avoid creating the toolbar where javascript is not enabled -function mwInsertEditButton(parent, item) { - var image = document.createElement("img"); +// we use it to avoid creating the toolbar where JavaScript is not enabled +function mwInsertEditButton( 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.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.style.cursor = 'pointer'; image.onclick = function() { - insertTags(item.tagOpen, item.tagClose, item.sampleText); + insertTags( item.tagOpen, item.tagClose, item.sampleText ); + // click tracking + if ( ( typeof $j != 'undefined' ) && ( typeof $j.trackAction != 'undefined' ) ) { + $j.trackAction( 'oldedit.' + item.speedTip.replace(/ /g, "-") ); + } return false; }; - parent.appendChild(image); + parent.appendChild( image ); return true; } function mwSetupToolbar() { - var toolbar = document.getElementById('toolbar'); - if (!toolbar) { return false; } - - var textbox = document.getElementById('wpTextbox1'); - if (!textbox) { return false; } + var toolbar = document.getElementById( 'toolbar' ); + if ( !toolbar ) { + return false; + } // Don't generate buttons for browsers which don't fully // support it. - if (!(document.selection && document.selection.createRange) - && textbox.selectionStart === null) { + // 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; } - - for (var i = 0; i < mwEditButtons.length; i++) { - mwInsertEditButton(toolbar, mwEditButtons[i]); + // 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]); + 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 -function insertTags(tagOpen, tagClose, sampleText) { +function insertTags( tagOpen, tagClose, sampleText ) { + if ( typeof $j != 'undefined' && typeof $j.fn.textSelection != 'undefined' && + ( currentFocused.nodeName.toLowerCase() == 'iframe' || currentFocused.id == 'wpTextbox1' ) ) { + $j( '#wpTextbox1' ).textSelection( + 'encapsulateSelection', { 'pre': tagOpen, 'peri': sampleText, 'post': tagClose } + ); + return; + } var txtarea; - if (document.editform) { - txtarea = document.editform.wpTextbox1; + if ( document.editform ) { + txtarea = currentFocused; } else { // some alternate form? take the first one we can find - var areas = document.getElementsByTagName('textarea'); + 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) + 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) + } else if ( document.body ) { var winScroll = document.body.scrollTop; - //get current selection + } + // get current selection txtarea.focus(); var range = document.selection.createRange(); selText = range.text; - //insert tags + // insert tags checkSelectedText(); range.text = tagOpen + selText + tagClose; - //mark sample text as selected - if (isSample && range.moveStart) { - if (window.opera) + // 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.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) + 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 + } else if ( txtarea.selectionStart || txtarea.selectionStart == '0' ) { // Mozilla + // save textarea scroll position var textScroll = txtarea.scrollTop; - //get current selection + // get current selection txtarea.focus(); var startPos = txtarea.selectionStart; var endPos = txtarea.selectionEnd; - selText = txtarea.value.substring(startPos, endPos); - //insert tags + 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) { + // 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 + // restore textarea scroll position txtarea.scrollTop = textScroll; - } + } - function checkSelectedText(){ - if (!selText) { + function checkSelectedText() { + if ( !selText ) { selText = sampleText; isSample = true; - } else if (selText.charAt(selText.length - 1) == ' ') { //exclude ending space char + } else if ( selText.charAt(selText.length - 1) == ' ' ) { // exclude ending space char selText = selText.substring(0, selText.length - 1); - tagClose += ' ' - } + tagClose += ' '; + } } } @@ -144,13 +170,62 @@ function scrollEditBox() { var editBox = document.getElementById( 'wpTextbox1' ); var scrollTop = document.getElementById( 'wpScrolltop' ); var editForm = document.getElementById( 'editform' ); - if( editBox && scrollTop ) { - if( scrollTop.value ) + if( editForm && editBox && scrollTop ) { + if( scrollTop.value ) { editBox.scrollTop = scrollTop.value; + } addHandler( editForm, 'submit', function() { - document.getElementById( 'wpScrolltop' ).value = document.getElementById( 'wpTextbox1' ).scrollTop; + 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 $j != 'undefined' ) { + var iframe = $j( '.wikiEditor-ui-text iframe' ); + if ( iframe.length > 0 ) { + $j( 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/history.js b/skins/common/history.js index 6a84b997..02651225 100644 --- a/skins/common/history.js +++ b/skins/common/history.js @@ -67,20 +67,19 @@ function diffcheck() { } else { inputs[1].style.visibility = 'visible'; } - lis[i].className = lis[i].classNameOriginal; + if ( typeof lis[i].classNameOriginal != 'undefined' ) { + lis[i].className = lis[i].classNameOriginal; + } } } } return true; } -// page history stuff -// attach event handlers to the input elements on history page +// Attach event handlers to the input elements on history page function histrowinit() { var hf = document.getElementById('pagehistory'); - if (!hf) { - return; - } + if (!hf) return; var lis = hf.getElementsByTagName('li'); for (var i = 0; i < lis.length; i++) { var inputs = historyRadios(lis[i]); diff --git a/skins/common/htmlform.js b/skins/common/htmlform.js new file mode 100644 index 00000000..2045ab48 --- /dev/null +++ b/skins/common/htmlform.js @@ -0,0 +1,40 @@ +// 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 } ); + } +} ); + +var 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/Arr_.png b/skins/common/images/Arr_.png index 83fafc74..8d8d5d9c 100644 Binary files a/skins/common/images/Arr_.png and b/skins/common/images/Arr_.png differ diff --git a/skins/common/images/Arr_r.xcf b/skins/common/images/Arr_r.xcf deleted file mode 100644 index 83b7b2a8..00000000 Binary files a/skins/common/images/Arr_r.xcf and /dev/null differ diff --git a/skins/common/images/Arr_u.png b/skins/common/images/Arr_u.png index b8e3b6c6..75909865 100644 Binary files a/skins/common/images/Arr_u.png and b/skins/common/images/Arr_u.png differ diff --git a/skins/common/images/Zoom_sans.gif b/skins/common/images/Zoom_sans.gif index 6ba0adca..56a49de8 100644 Binary files a/skins/common/images/Zoom_sans.gif and b/skins/common/images/Zoom_sans.gif differ diff --git a/skins/common/images/add.png b/skins/common/images/add.png new file mode 100644 index 00000000..5b051f64 Binary files /dev/null and b/skins/common/images/add.png differ diff --git a/skins/common/images/ajax-loader.gif b/skins/common/images/ajax-loader.gif new file mode 100644 index 00000000..3288d103 Binary files /dev/null and b/skins/common/images/ajax-loader.gif differ diff --git a/skins/common/images/arrow_first.svg b/skins/common/images/arrow_first.svg deleted file mode 100644 index c1d8e364..00000000 --- a/skins/common/images/arrow_first.svg +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - image/svg+xml - - - - - - - - - diff --git a/skins/common/images/arrow_left.svg b/skins/common/images/arrow_left.svg deleted file mode 100644 index bd4bbc74..00000000 --- a/skins/common/images/arrow_left.svg +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - image/svg+xml - - - - - - - - diff --git a/skins/common/images/be-tarask/button_bold.png b/skins/common/images/be-tarask/button_bold.png index f662c76c..d02aeeeb 100644 Binary files a/skins/common/images/be-tarask/button_bold.png and b/skins/common/images/be-tarask/button_bold.png differ diff --git a/skins/common/images/be-tarask/button_italic.png b/skins/common/images/be-tarask/button_italic.png index 88e1b3bb..d93e9f87 100644 Binary files a/skins/common/images/be-tarask/button_italic.png and b/skins/common/images/be-tarask/button_italic.png differ diff --git a/skins/common/images/be-tarask/button_link.png b/skins/common/images/be-tarask/button_link.png index f68d5d56..07bc6a19 100644 Binary files a/skins/common/images/be-tarask/button_link.png and b/skins/common/images/be-tarask/button_link.png differ diff --git a/skins/common/images/button_bold.png b/skins/common/images/button_bold.png index 5e52deed..2827dba0 100644 Binary files a/skins/common/images/button_bold.png and b/skins/common/images/button_bold.png differ diff --git a/skins/common/images/button_extlink.png b/skins/common/images/button_extlink.png index 12ec5f2e..e551e47e 100644 Binary files a/skins/common/images/button_extlink.png and b/skins/common/images/button_extlink.png differ diff --git a/skins/common/images/button_headline.png b/skins/common/images/button_headline.png index aa0ca540..9867c365 100644 Binary files a/skins/common/images/button_headline.png and b/skins/common/images/button_headline.png differ diff --git a/skins/common/images/button_hr.png b/skins/common/images/button_hr.png index 19cfc480..7f21402a 100644 Binary files a/skins/common/images/button_hr.png and b/skins/common/images/button_hr.png differ diff --git a/skins/common/images/button_image.png b/skins/common/images/button_image.png index 6c3c3308..abd47dde 100644 Binary files a/skins/common/images/button_image.png and b/skins/common/images/button_image.png differ diff --git a/skins/common/images/button_italic.png b/skins/common/images/button_italic.png index 96b1fb9f..f248fa93 100644 Binary files a/skins/common/images/button_italic.png and b/skins/common/images/button_italic.png differ diff --git a/skins/common/images/button_link.png b/skins/common/images/button_link.png index e9507b97..cc72b523 100644 Binary files a/skins/common/images/button_link.png and b/skins/common/images/button_link.png differ diff --git a/skins/common/images/button_math.png b/skins/common/images/button_math.png index e91fb613..507e4b51 100644 Binary files a/skins/common/images/button_math.png and b/skins/common/images/button_math.png differ diff --git a/skins/common/images/button_media.png b/skins/common/images/button_media.png index 02070790..56b1b239 100644 Binary files a/skins/common/images/button_media.png and b/skins/common/images/button_media.png differ diff --git a/skins/common/images/button_nowiki.png b/skins/common/images/button_nowiki.png index 7b2d5392..321a2cb4 100644 Binary files a/skins/common/images/button_nowiki.png and b/skins/common/images/button_nowiki.png differ diff --git a/skins/common/images/button_sig.png b/skins/common/images/button_sig.png index ef3a46d2..39de3b67 100644 Binary files a/skins/common/images/button_sig.png and b/skins/common/images/button_sig.png differ diff --git a/skins/common/images/button_template.png b/skins/common/images/button_template.png index 8e9cc267..ebbca3cf 100644 Binary files a/skins/common/images/button_template.png and b/skins/common/images/button_template.png differ diff --git a/skins/common/images/cyrl/button_italic.png b/skins/common/images/cyrl/button_italic.png index f5e588ec..f79170fd 100644 Binary files a/skins/common/images/cyrl/button_italic.png and b/skins/common/images/cyrl/button_italic.png differ diff --git a/skins/common/images/cyrl/button_link.png b/skins/common/images/cyrl/button_link.png index a690cb35..aa28e85a 100644 Binary files a/skins/common/images/cyrl/button_link.png and b/skins/common/images/cyrl/button_link.png differ diff --git a/skins/common/images/de/button_bold.png b/skins/common/images/de/button_bold.png index 8386828d..32a22800 100644 Binary files a/skins/common/images/de/button_bold.png and b/skins/common/images/de/button_bold.png differ diff --git a/skins/common/images/de/button_italic.png b/skins/common/images/de/button_italic.png index ec719998..875eb2a1 100644 Binary files a/skins/common/images/de/button_italic.png and b/skins/common/images/de/button_italic.png differ diff --git a/skins/common/images/fa/button_bold.png b/skins/common/images/fa/button_bold.png index 2f269a8d..49680152 100644 Binary files a/skins/common/images/fa/button_bold.png and b/skins/common/images/fa/button_bold.png differ diff --git a/skins/common/images/fa/button_headline.png b/skins/common/images/fa/button_headline.png index ef9d109f..9d62767e 100644 Binary files a/skins/common/images/fa/button_headline.png and b/skins/common/images/fa/button_headline.png differ diff --git a/skins/common/images/fa/button_italic.png b/skins/common/images/fa/button_italic.png index 84985848..fc9faf3d 100644 Binary files a/skins/common/images/fa/button_italic.png and b/skins/common/images/fa/button_italic.png differ diff --git a/skins/common/images/fa/button_link.png b/skins/common/images/fa/button_link.png index 4ad5ef56..de56a5c3 100644 Binary files a/skins/common/images/fa/button_link.png and b/skins/common/images/fa/button_link.png differ diff --git a/skins/common/images/fileicon.xcf b/skins/common/images/fileicon.xcf deleted file mode 100644 index 85a0a610..00000000 Binary files a/skins/common/images/fileicon.xcf and /dev/null differ diff --git a/skins/common/images/gnu-fdl.png b/skins/common/images/gnu-fdl.png index 1371aba8..10915329 100644 Binary files a/skins/common/images/gnu-fdl.png and b/skins/common/images/gnu-fdl.png differ diff --git a/skins/common/images/gnu-fdl.xcf b/skins/common/images/gnu-fdl.xcf deleted file mode 100644 index 364440dd..00000000 Binary files a/skins/common/images/gnu-fdl.xcf and /dev/null differ diff --git a/skins/common/images/icons/fileicon-c.png b/skins/common/images/icons/fileicon-c.png index 6da6916e..f7984fa0 100644 Binary files a/skins/common/images/icons/fileicon-c.png and b/skins/common/images/icons/fileicon-c.png differ diff --git a/skins/common/images/icons/fileicon-cpp.png b/skins/common/images/icons/fileicon-cpp.png index ba54e77f..0a9b4cbc 100644 Binary files a/skins/common/images/icons/fileicon-cpp.png and b/skins/common/images/icons/fileicon-cpp.png differ diff --git a/skins/common/images/icons/fileicon-deb.png b/skins/common/images/icons/fileicon-deb.png index ac1e2cf9..605bea17 100644 Binary files a/skins/common/images/icons/fileicon-deb.png and b/skins/common/images/icons/fileicon-deb.png differ diff --git a/skins/common/images/icons/fileicon-djvu.png b/skins/common/images/icons/fileicon-djvu.png index 2e1e2c9b..3eaca1f8 100644 Binary files a/skins/common/images/icons/fileicon-djvu.png and b/skins/common/images/icons/fileicon-djvu.png differ diff --git a/skins/common/images/icons/fileicon-dvi.png b/skins/common/images/icons/fileicon-dvi.png index 6c7aa1a1..790ec41b 100644 Binary files a/skins/common/images/icons/fileicon-dvi.png and b/skins/common/images/icons/fileicon-dvi.png differ diff --git a/skins/common/images/icons/fileicon-exe.png b/skins/common/images/icons/fileicon-exe.png index 6ccf1821..f310ad0d 100644 Binary files a/skins/common/images/icons/fileicon-exe.png and b/skins/common/images/icons/fileicon-exe.png differ diff --git a/skins/common/images/icons/fileicon-h.png b/skins/common/images/icons/fileicon-h.png index d091afff..cf158528 100644 Binary files a/skins/common/images/icons/fileicon-h.png and b/skins/common/images/icons/fileicon-h.png differ diff --git a/skins/common/images/icons/fileicon-html.png b/skins/common/images/icons/fileicon-html.png index 7c479525..1c3a1588 100644 Binary files a/skins/common/images/icons/fileicon-html.png and b/skins/common/images/icons/fileicon-html.png differ diff --git a/skins/common/images/icons/fileicon-iso.png b/skins/common/images/icons/fileicon-iso.png index b4192e9e..74b06615 100644 Binary files a/skins/common/images/icons/fileicon-iso.png and b/skins/common/images/icons/fileicon-iso.png differ diff --git a/skins/common/images/icons/fileicon-java.png b/skins/common/images/icons/fileicon-java.png index 757c6aec..730ab232 100644 Binary files a/skins/common/images/icons/fileicon-java.png and b/skins/common/images/icons/fileicon-java.png differ diff --git a/skins/common/images/icons/fileicon-mid.png b/skins/common/images/icons/fileicon-mid.png index aa826070..5254418e 100644 Binary files a/skins/common/images/icons/fileicon-mid.png and b/skins/common/images/icons/fileicon-mid.png differ diff --git a/skins/common/images/icons/fileicon-mov.png b/skins/common/images/icons/fileicon-mov.png index 2c0da0d8..37e479aa 100644 Binary files a/skins/common/images/icons/fileicon-mov.png and b/skins/common/images/icons/fileicon-mov.png differ diff --git a/skins/common/images/icons/fileicon-o.png b/skins/common/images/icons/fileicon-o.png index bf051cb8..24ac2cc5 100644 Binary files a/skins/common/images/icons/fileicon-o.png and b/skins/common/images/icons/fileicon-o.png differ diff --git a/skins/common/images/icons/fileicon-ogg.png b/skins/common/images/icons/fileicon-ogg.png index b8ba7714..c50d1ee8 100644 Binary files a/skins/common/images/icons/fileicon-ogg.png and b/skins/common/images/icons/fileicon-ogg.png differ diff --git a/skins/common/images/icons/fileicon-pdf.png b/skins/common/images/icons/fileicon-pdf.png index ee39b6c3..c195c761 100644 Binary files a/skins/common/images/icons/fileicon-pdf.png and b/skins/common/images/icons/fileicon-pdf.png differ diff --git a/skins/common/images/icons/fileicon-ps.png b/skins/common/images/icons/fileicon-ps.png index f1f504d7..342a84ee 100644 Binary files a/skins/common/images/icons/fileicon-ps.png and b/skins/common/images/icons/fileicon-ps.png differ diff --git a/skins/common/images/icons/fileicon-rm.png b/skins/common/images/icons/fileicon-rm.png index 5ba04e5a..534dbeb2 100644 Binary files a/skins/common/images/icons/fileicon-rm.png and b/skins/common/images/icons/fileicon-rm.png differ diff --git a/skins/common/images/icons/fileicon-rpm.png b/skins/common/images/icons/fileicon-rpm.png index 0f1c3b87..aab3ec39 100644 Binary files a/skins/common/images/icons/fileicon-rpm.png and b/skins/common/images/icons/fileicon-rpm.png differ diff --git a/skins/common/images/icons/fileicon-svg.png b/skins/common/images/icons/fileicon-svg.png index 8dc6d30f..16a666f3 100644 Binary files a/skins/common/images/icons/fileicon-svg.png and b/skins/common/images/icons/fileicon-svg.png differ diff --git a/skins/common/images/icons/fileicon-tar.png b/skins/common/images/icons/fileicon-tar.png index a4b15d7f..7266b5b5 100644 Binary files a/skins/common/images/icons/fileicon-tar.png and b/skins/common/images/icons/fileicon-tar.png differ diff --git a/skins/common/images/icons/fileicon-tex.png b/skins/common/images/icons/fileicon-tex.png index ee8c0226..55187918 100644 Binary files a/skins/common/images/icons/fileicon-tex.png and b/skins/common/images/icons/fileicon-tex.png differ diff --git a/skins/common/images/icons/fileicon-ttf.png b/skins/common/images/icons/fileicon-ttf.png index 1b53066e..13bd7ced 100644 Binary files a/skins/common/images/icons/fileicon-ttf.png and b/skins/common/images/icons/fileicon-ttf.png differ diff --git a/skins/common/images/icons/fileicon-txt.png b/skins/common/images/icons/fileicon-txt.png index 76e98909..bec58b4e 100644 Binary files a/skins/common/images/icons/fileicon-txt.png and b/skins/common/images/icons/fileicon-txt.png differ diff --git a/skins/common/images/ksh/button_S_italic.png b/skins/common/images/ksh/button_S_italic.png index 0761a1e1..00000a3c 100644 Binary files a/skins/common/images/ksh/button_S_italic.png and b/skins/common/images/ksh/button_S_italic.png differ diff --git a/skins/common/images/link_icon.gif b/skins/common/images/link_icon.gif index 815ccb1b..168c1a2f 100644 Binary files a/skins/common/images/link_icon.gif and b/skins/common/images/link_icon.gif differ diff --git a/skins/common/images/magnify-clip.png b/skins/common/images/magnify-clip.png index 50abcb68..00a9cee1 100644 Binary files a/skins/common/images/magnify-clip.png and b/skins/common/images/magnify-clip.png differ diff --git a/skins/common/images/mediawiki-small.xcf b/skins/common/images/mediawiki-small.xcf deleted file mode 100644 index 75355171..00000000 Binary files a/skins/common/images/mediawiki-small.xcf and /dev/null differ diff --git a/skins/common/images/mediawiki.png b/skins/common/images/mediawiki.png index 69fce988..0f35886a 100644 Binary files a/skins/common/images/mediawiki.png and b/skins/common/images/mediawiki.png differ diff --git a/skins/common/images/poweredby_mediawiki_88x31.png b/skins/common/images/poweredby_mediawiki_88x31.png index ce1765d1..3714414f 100644 Binary files a/skins/common/images/poweredby_mediawiki_88x31.png and b/skins/common/images/poweredby_mediawiki_88x31.png differ diff --git a/skins/common/images/public-domain.png b/skins/common/images/public-domain.png index e5fb33ce..f51f5602 100644 Binary files a/skins/common/images/public-domain.png and b/skins/common/images/public-domain.png differ diff --git a/skins/common/images/redirectltr.png b/skins/common/images/redirectltr.png index 9110ca13..bcf5742c 100644 Binary files a/skins/common/images/redirectltr.png and b/skins/common/images/redirectltr.png differ diff --git a/skins/common/images/redirectrtl.png b/skins/common/images/redirectrtl.png index 60fd59d3..8d99841a 100644 Binary files a/skins/common/images/redirectrtl.png and b/skins/common/images/redirectrtl.png differ diff --git a/skins/common/images/remove.png b/skins/common/images/remove.png new file mode 100644 index 00000000..0cbf7d73 Binary files /dev/null and b/skins/common/images/remove.png differ diff --git a/skins/common/images/sort_down.gif b/skins/common/images/sort_down.gif index 5ff08160..d97e8285 100644 Binary files a/skins/common/images/sort_down.gif and b/skins/common/images/sort_down.gif differ diff --git a/skins/common/images/sort_none.gif b/skins/common/images/sort_none.gif index 6bb02824..edd07e58 100644 Binary files a/skins/common/images/sort_none.gif and b/skins/common/images/sort_none.gif differ diff --git a/skins/common/images/sort_up.gif b/skins/common/images/sort_up.gif index 53002968..488cf279 100644 Binary files a/skins/common/images/sort_up.gif and b/skins/common/images/sort_up.gif differ diff --git a/skins/common/images/spinner.gif b/skins/common/images/spinner.gif index bdd59d52..37d3a43d 100644 Binary files a/skins/common/images/spinner.gif and b/skins/common/images/spinner.gif differ diff --git a/skins/common/images/wiki.png b/skins/common/images/wiki.png index 49913f6a..4f1dc263 100644 Binary files a/skins/common/images/wiki.png and b/skins/common/images/wiki.png differ diff --git a/skins/common/jquery.js b/skins/common/jquery.js new file mode 100644 index 00000000..c25ee31c --- /dev/null +++ b/skins/common/jquery.js @@ -0,0 +1,4384 @@ +/*! + * jQuery JavaScript Library v1.3.2 + * http://jquery.com/ + * + * Copyright (c) 2009 John Resig + * Dual licensed under the MIT and GPL licenses. + * http://docs.jquery.com/License + * + * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) + * Revision: 6246 + */ +(function(){ + +var + // Will speed up references to window, and allows munging its name. + window = this, + // Will speed up references to undefined, and allows munging its name. + undefined, + // Map over jQuery in case of overwrite + _jQuery = window.jQuery, + // Map over the $ in case of overwrite + _$ = window.$, + + jQuery = window.jQuery = window.$ = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init( selector, context ); + }, + + // A simple way to check for HTML strings or ID strings + // (both of which we optimize for) + quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/, + // Is it a simple selector + isSimple = /^.[^:#\[\.,]*$/; + +jQuery.fn = jQuery.prototype = { + init: function( selector, context ) { + // Make sure that a selection was provided + selector = selector || document; + + // Handle $(DOMElement) + if ( selector.nodeType ) { + this[0] = selector; + this.length = 1; + this.context = selector; + return this; + } + // Handle HTML strings + if ( typeof selector === "string" ) { + // Are we dealing with HTML string or an ID? + var match = quickExpr.exec( selector ); + + // Verify a match, and that no context was specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) + selector = jQuery.clean( [ match[1] ], context ); + + // HANDLE: $("#id") + else { + var elem = document.getElementById( match[3] ); + + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem && elem.id != match[3] ) + return jQuery().find( selector ); + + // Otherwise, we inject the element directly into the jQuery object + var ret = jQuery( elem || [] ); + ret.context = document; + ret.selector = selector; + return ret; + } + + // HANDLE: $(expr, [context]) + // (which is just equivalent to: $(content).find(expr) + } else + return jQuery( context ).find( selector ); + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) + return jQuery( document ).ready( selector ); + + // Make sure that old selector state is passed along + if ( selector.selector && selector.context ) { + this.selector = selector.selector; + this.context = selector.context; + } + + return this.setArray(jQuery.isArray( selector ) ? + selector : + jQuery.makeArray(selector)); + }, + + // Start with an empty selector + selector: "", + + // The current version of jQuery being used + jquery: "1.3.2", + + // The number of elements contained in the matched element set + size: function() { + return this.length; + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num === undefined ? + + // Return a 'clean' array + Array.prototype.slice.call( this ) : + + // Return just the object + this[ num ]; + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems, name, selector ) { + // Build a new jQuery matched element set + var ret = jQuery( elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + ret.context = this.context; + + if ( name === "find" ) + ret.selector = this.selector + (this.selector ? " " : "") + selector; + else if ( name ) + ret.selector = this.selector + "." + name + "(" + selector + ")"; + + // Return the newly-formed element set + return ret; + }, + + // Force the current matched set of elements to become + // the specified array of elements (destroying the stack in the process) + // You should use pushStack() in order to do this, but maintain the stack + setArray: function( elems ) { + // Resetting the length to 0, then using the native Array push + // is a super-fast way to populate an object with array-like properties + this.length = 0; + Array.prototype.push.apply( this, elems ); + + return this; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + // Locate the position of the desired element + return jQuery.inArray( + // If it receives a jQuery object, the first element is used + elem && elem.jquery ? elem[0] : elem + , this ); + }, + + attr: function( name, value, type ) { + var options = name; + + // Look for the case where we're accessing a style value + if ( typeof name === "string" ) + if ( value === undefined ) + return this[0] && jQuery[ type || "attr" ]( this[0], name ); + + else { + options = {}; + options[ name ] = value; + } + + // Check to see if we're setting style values + return this.each(function(i){ + // Set all the styles + for ( name in options ) + jQuery.attr( + type ? + this.style : + this, + name, jQuery.prop( this, options[ name ], type, i, name ) + ); + }); + }, + + css: function( key, value ) { + // ignore negative width and height values + if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 ) + value = undefined; + return this.attr( key, value, "curCSS" ); + }, + + text: function( text ) { + if ( typeof text !== "object" && text != null ) + return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) ); + + var ret = ""; + + jQuery.each( text || this, function(){ + jQuery.each( this.childNodes, function(){ + if ( this.nodeType != 8 ) + ret += this.nodeType != 1 ? + this.nodeValue : + jQuery.fn.text( [ this ] ); + }); + }); + + return ret; + }, + + wrapAll: function( html ) { + if ( this[0] ) { + // The elements to wrap the target around + var wrap = jQuery( html, this[0].ownerDocument ).clone(); + + if ( this[0].parentNode ) + wrap.insertBefore( this[0] ); + + wrap.map(function(){ + var elem = this; + + while ( elem.firstChild ) + elem = elem.firstChild; + + return elem; + }).append(this); + } + + return this; + }, + + wrapInner: function( html ) { + return this.each(function(){ + jQuery( this ).contents().wrapAll( html ); + }); + }, + + wrap: function( html ) { + return this.each(function(){ + jQuery( this ).wrapAll( html ); + }); + }, + + append: function() { + return this.domManip(arguments, true, function(elem){ + if (this.nodeType == 1) + this.appendChild( elem ); + }); + }, + + prepend: function() { + return this.domManip(arguments, true, function(elem){ + if (this.nodeType == 1) + this.insertBefore( elem, this.firstChild ); + }); + }, + + before: function() { + return this.domManip(arguments, false, function(elem){ + this.parentNode.insertBefore( elem, this ); + }); + }, + + after: function() { + return this.domManip(arguments, false, function(elem){ + this.parentNode.insertBefore( elem, this.nextSibling ); + }); + }, + + end: function() { + return this.prevObject || jQuery( [] ); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: [].push, + sort: [].sort, + splice: [].splice, + + find: function( selector ) { + if ( this.length === 1 ) { + var ret = this.pushStack( [], "find", selector ); + ret.length = 0; + jQuery.find( selector, this[0], ret ); + return ret; + } else { + return this.pushStack( jQuery.unique(jQuery.map(this, function(elem){ + return jQuery.find( selector, elem ); + })), "find", selector ); + } + }, + + clone: function( events ) { + // Do the clone + var ret = this.map(function(){ + if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) { + // IE copies events bound via attachEvent when + // using cloneNode. Calling detachEvent on the + // clone will also remove the events from the orignal + // In order to get around this, we use innerHTML. + // Unfortunately, this means some modifications to + // attributes in IE that are actually only stored + // as properties will not be copied (such as the + // the name attribute on an input). + var html = this.outerHTML; + if ( !html ) { + var div = this.ownerDocument.createElement("div"); + div.appendChild( this.cloneNode(true) ); + html = div.innerHTML; + } + + return jQuery.clean([html.replace(/ jQuery\d+="(?:\d+|null)"/g, "").replace(/^\s*/, "")])[0]; + } else + return this.cloneNode(true); + }); + + // Copy the events from the original to the clone + if ( events === true ) { + var orig = this.find("*").andSelf(), i = 0; + + ret.find("*").andSelf().each(function(){ + if ( this.nodeName !== orig[i].nodeName ) + return; + + var events = jQuery.data( orig[i], "events" ); + + for ( var type in events ) { + for ( var handler in events[ type ] ) { + jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data ); + } + } + + i++; + }); + } + + // Return the cloned set + return ret; + }, + + filter: function( selector ) { + return this.pushStack( + jQuery.isFunction( selector ) && + jQuery.grep(this, function(elem, i){ + return selector.call( elem, i ); + }) || + + jQuery.multiFilter( selector, jQuery.grep(this, function(elem){ + return elem.nodeType === 1; + }) ), "filter", selector ); + }, + + closest: function( selector ) { + var pos = jQuery.expr.match.POS.test( selector ) ? jQuery(selector) : null, + closer = 0; + + return this.map(function(){ + var cur = this; + while ( cur && cur.ownerDocument ) { + if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selector) ) { + jQuery.data(cur, "closest", closer); + return cur; + } + cur = cur.parentNode; + closer++; + } + }); + }, + + not: function( selector ) { + if ( typeof selector === "string" ) + // test special case where just one selector is passed in + if ( isSimple.test( selector ) ) + return this.pushStack( jQuery.multiFilter( selector, this, true ), "not", selector ); + else + selector = jQuery.multiFilter( selector, this ); + + var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType; + return this.filter(function() { + return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector; + }); + }, + + add: function( selector ) { + return this.pushStack( jQuery.unique( jQuery.merge( + this.get(), + typeof selector === "string" ? + jQuery( selector ) : + jQuery.makeArray( selector ) + ))); + }, + + is: function( selector ) { + return !!selector && jQuery.multiFilter( selector, this ).length > 0; + }, + + hasClass: function( selector ) { + return !!selector && this.is( "." + selector ); + }, + + val: function( value ) { + if ( value === undefined ) { + var elem = this[0]; + + if ( elem ) { + if( jQuery.nodeName( elem, 'option' ) ) + return (elem.attributes.value || {}).specified ? elem.value : elem.text; + + // We need to handle select boxes special + if ( jQuery.nodeName( elem, "select" ) ) { + var index = elem.selectedIndex, + values = [], + options = elem.options, + one = elem.type == "select-one"; + + // Nothing was selected + if ( index < 0 ) + return null; + + // Loop through all the selected options + for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { + var option = options[ i ]; + + if ( option.selected ) { + // Get the specifc value for the option + value = jQuery(option).val(); + + // We don't need an array for one selects + if ( one ) + return value; + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + } + + // Everything else, we just grab the value + return (elem.value || "").replace(/\r/g, ""); + + } + + return undefined; + } + + if ( typeof value === "number" ) + value += ''; + + return this.each(function(){ + if ( this.nodeType != 1 ) + return; + + if ( jQuery.isArray(value) && /radio|checkbox/.test( this.type ) ) + this.checked = (jQuery.inArray(this.value, value) >= 0 || + jQuery.inArray(this.name, value) >= 0); + + else if ( jQuery.nodeName( this, "select" ) ) { + var values = jQuery.makeArray(value); + + jQuery( "option", this ).each(function(){ + this.selected = (jQuery.inArray( this.value, values ) >= 0 || + jQuery.inArray( this.text, values ) >= 0); + }); + + if ( !values.length ) + this.selectedIndex = -1; + + } else + this.value = value; + }); + }, + + html: function( value ) { + return value === undefined ? + (this[0] ? + this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g, "") : + null) : + this.empty().append( value ); + }, + + replaceWith: function( value ) { + return this.after( value ).remove(); + }, + + eq: function( i ) { + return this.slice( i, +i + 1 ); + }, + + slice: function() { + return this.pushStack( Array.prototype.slice.apply( this, arguments ), + "slice", Array.prototype.slice.call(arguments).join(",") ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function(elem, i){ + return callback.call( elem, i, elem ); + })); + }, + + andSelf: function() { + return this.add( this.prevObject ); + }, + + domManip: function( args, table, callback ) { + if ( this[0] ) { + var fragment = (this[0].ownerDocument || this[0]).createDocumentFragment(), + scripts = jQuery.clean( args, (this[0].ownerDocument || this[0]), fragment ), + first = fragment.firstChild; + + if ( first ) + for ( var i = 0, l = this.length; i < l; i++ ) + callback.call( root(this[i], first), this.length > 1 || i > 0 ? + fragment.cloneNode(true) : fragment ); + + if ( scripts ) + jQuery.each( scripts, evalScript ); + } + + return this; + + function root( elem, cur ) { + return table && jQuery.nodeName(elem, "table") && jQuery.nodeName(cur, "tr") ? + (elem.getElementsByTagName("tbody")[0] || + elem.appendChild(elem.ownerDocument.createElement("tbody"))) : + elem; + } + } +}; + +// Give the init function the jQuery prototype for later instantiation +jQuery.fn.init.prototype = jQuery.fn; + +function evalScript( i, elem ) { + if ( elem.src ) + jQuery.ajax({ + url: elem.src, + async: false, + dataType: "script" + }); + + else + jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); + + if ( elem.parentNode ) + elem.parentNode.removeChild( elem ); +} + +function now(){ + return +new Date; +} + +jQuery.extend = jQuery.fn.extend = function() { + // copy reference to target object + var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction(target) ) + target = {}; + + // extend jQuery itself if only one argument is passed + if ( length == i ) { + target = this; + --i; + } + + for ( ; i < length; i++ ) + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) + // Extend the base object + for ( var name in options ) { + var src = target[ name ], copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) + continue; + + // Recurse if we're merging object values + if ( deep && copy && typeof copy === "object" && !copy.nodeType ) + target[ name ] = jQuery.extend( deep, + // Never move original objects, clone them + src || ( copy.length != null ? [ ] : { } ) + , copy ); + + // Don't bring in undefined values + else if ( copy !== undefined ) + target[ name ] = copy; + + } + + // Return the modified object + return target; +}; + +// exclude the following css properties to add px +var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i, + // cache defaultView + defaultView = document.defaultView || {}, + toString = Object.prototype.toString; + +jQuery.extend({ + noConflict: function( deep ) { + window.$ = _$; + + if ( deep ) + window.jQuery = _jQuery; + + return jQuery; + }, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + return toString.call(obj) === "[object Function]"; + }, + + isArray: function( obj ) { + return toString.call(obj) === "[object Array]"; + }, + + // check if an element is in a (or is an) XML document + isXMLDoc: function( elem ) { + return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" || + !!elem.ownerDocument && jQuery.isXMLDoc( elem.ownerDocument ); + }, + + // Evalulates a script in a global context + globalEval: function( data ) { + if ( data && /\S/.test(data) ) { + // Inspired by code by Andrea Giammarchi + // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html + var head = document.getElementsByTagName("head")[0] || document.documentElement, + script = document.createElement("script"); + + script.type = "text/javascript"; + if ( jQuery.support.scriptEval ) + script.appendChild( document.createTextNode( data ) ); + else + script.text = data; + + // Use insertBefore instead of appendChild to circumvent an IE6 bug. + // This arises when a base node is used (#2709). + head.insertBefore( script, head.firstChild ); + head.removeChild( script ); + } + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase(); + }, + + // args is for internal usage only + each: function( object, callback, args ) { + var name, i = 0, length = object.length; + + if ( args ) { + if ( length === undefined ) { + for ( name in object ) + if ( callback.apply( object[ name ], args ) === false ) + break; + } else + for ( ; i < length; ) + if ( callback.apply( object[ i++ ], args ) === false ) + break; + + // A special, fast, case for the most common use of each + } else { + if ( length === undefined ) { + for ( name in object ) + if ( callback.call( object[ name ], name, object[ name ] ) === false ) + break; + } else + for ( var value = object[0]; + i < length && callback.call( value, i, value ) !== false; value = object[++i] ){} + } + + return object; + }, + + prop: function( elem, value, type, i, name ) { + // Handle executable functions + if ( jQuery.isFunction( value ) ) + value = value.call( elem, i ); + + // Handle passing in a number to a CSS property + return typeof value === "number" && type == "curCSS" && !exclude.test( name ) ? + value + "px" : + value; + }, + + className: { + // internal only, use addClass("class") + add: function( elem, classNames ) { + jQuery.each((classNames || "").split(/\s+/), function(i, className){ + if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) ) + elem.className += (elem.className ? " " : "") + className; + }); + }, + + // internal only, use removeClass("class") + remove: function( elem, classNames ) { + if (elem.nodeType == 1) + elem.className = classNames !== undefined ? + jQuery.grep(elem.className.split(/\s+/), function(className){ + return !jQuery.className.has( classNames, className ); + }).join(" ") : + ""; + }, + + // internal only, use hasClass("class") + has: function( elem, className ) { + return elem && jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1; + } + }, + + // A method for quickly swapping in/out CSS properties to get correct calculations + swap: function( elem, options, callback ) { + var old = {}; + // Remember the old values, and insert the new ones + for ( var name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } + + callback.call( elem ); + + // Revert the old values + for ( var name in options ) + elem.style[ name ] = old[ name ]; + }, + + css: function( elem, name, force, extra ) { + if ( name == "width" || name == "height" ) { + var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ]; + + function getWH() { + val = name == "width" ? elem.offsetWidth : elem.offsetHeight; + + if ( extra === "border" ) + return; + + jQuery.each( which, function() { + if ( !extra ) + val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0; + if ( extra === "margin" ) + val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0; + else + val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0; + }); + } + + if ( elem.offsetWidth !== 0 ) + getWH(); + else + jQuery.swap( elem, props, getWH ); + + return Math.max(0, Math.round(val)); + } + + return jQuery.curCSS( elem, name, force ); + }, + + curCSS: function( elem, name, force ) { + var ret, style = elem.style; + + // We need to handle opacity special in IE + if ( name == "opacity" && !jQuery.support.opacity ) { + ret = jQuery.attr( style, "opacity" ); + + return ret == "" ? + "1" : + ret; + } + + // Make sure we're using the right name for getting the float value + if ( name.match( /float/i ) ) + name = styleFloat; + + if ( !force && style && style[ name ] ) + ret = style[ name ]; + + else if ( defaultView.getComputedStyle ) { + + // Only "float" is needed here + if ( name.match( /float/i ) ) + name = "float"; + + name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase(); + try{ + var computedStyle = defaultView.getComputedStyle( elem, null ); + }catch(e){ + // Error in getting computedStyle + } + if ( computedStyle ) + ret = computedStyle.getPropertyValue( name ); + + // We should always get a number back from opacity + if ( name == "opacity" && ret == "" ) + ret = "1"; + + } else if ( elem.currentStyle ) { + var camelCase = name.replace(/\-(\w)/g, function(all, letter){ + return letter.toUpperCase(); + }); + + ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ]; + + // From the awesome hack by Dean Edwards + // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 + + // If we're not dealing with a regular pixel number + // but a number that has a weird ending, we need to convert it to pixels + if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) { + // Remember the original values + var left = style.left, rsLeft = elem.runtimeStyle.left; + + // Put in the new values to get a computed value out + elem.runtimeStyle.left = elem.currentStyle.left; + style.left = ret || 0; + ret = style.pixelLeft + "px"; + + // Revert the changed values + style.left = left; + elem.runtimeStyle.left = rsLeft; + } + } + + return ret; + }, + + clean: function( elems, context, fragment ) { + context = context || document; + + // !context.createElement fails in IE with an error but returns typeof 'object' + if ( typeof context.createElement === "undefined" ) + context = context.ownerDocument || context[0] && context[0].ownerDocument || document; + + // If a single string is passed in and it's a single tag + // just do a createElement and skip the rest + if ( !fragment && elems.length === 1 && typeof elems[0] === "string" ) { + var match = /^<(\w+)\s*\/?>$/.exec(elems[0]); + if ( match ) + return [ context.createElement( match[1] ) ]; + } + + var ret = [], scripts = [], div = context.createElement("div"); + + jQuery.each(elems, function(i, elem){ + if ( typeof elem === "number" ) + elem += ''; + + if ( !elem ) + return; + + // Convert html string into DOM nodes + if ( typeof elem === "string" ) { + // Fix "XHTML"-style tags in all browsers + elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){ + return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? + all : + front + ">"; + }); + + // Trim whitespace, otherwise indexOf won't work as expected + var tags = elem.replace(/^\s+/, "").substring(0, 10).toLowerCase(); + + var wrap = + // option or optgroup + !tags.indexOf("", "" ] || + + !tags.indexOf("", "" ] || + + tags.match(/^<(thead|tbody|tfoot|colg|cap)/) && + [ 1, "", "
" ] || + + !tags.indexOf("", "" ] || + + // matched above + (!tags.indexOf("", "" ] || + + !tags.indexOf("", "" ] || + + // IE can't serialize and