summaryrefslogtreecommitdiff
path: root/skins/common
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2011-06-22 11:28:20 +0200
committerPierre Schmitz <pierre@archlinux.de>2011-06-22 11:28:20 +0200
commit9db190c7e736ec8d063187d4241b59feaf7dc2d1 (patch)
tree46d1a0dee7febef5c2d57a9f7b972be16a163b3d /skins/common
parent78677c7bbdcc9739f6c10c75935898a20e1acd9e (diff)
update to MediaWiki 1.17.0
Diffstat (limited to 'skins/common')
-rw-r--r--skins/common/IEFixes.js41
-rw-r--r--skins/common/ajax.js196
-rw-r--r--skins/common/ajaxwatch.js262
-rw-r--r--skins/common/block.js48
-rw-r--r--skins/common/changepassword.js16
-rw-r--r--skins/common/cologneblue.css247
-rw-r--r--skins/common/commonPrint.css316
-rw-r--r--skins/common/common_rtl.css12
-rw-r--r--skins/common/config-cc.css56
-rw-r--r--skins/common/config.css164
-rw-r--r--skins/common/config.js102
-rw-r--r--skins/common/diff.css84
-rw-r--r--skins/common/edit.js44
-rw-r--r--skins/common/enhancedchanges.js4
-rw-r--r--skins/common/history.js25
-rw-r--r--skins/common/htmlform.js4
-rw-r--r--skins/common/images/Arr_d.pngbin215 -> 205 bytes
-rw-r--r--skins/common/images/Arr_l.pngbin263 -> 257 bytes
-rw-r--r--skins/common/images/Arr_r.pngbin210 -> 206 bytes
-rw-r--r--skins/common/images/Arr_u.pngbin425 -> 423 bytes
-rw-r--r--skins/common/images/add.pngbin3329 -> 3222 bytes
-rw-r--r--skins/common/images/ar/button_bold.pngbin741 -> 626 bytes
-rw-r--r--skins/common/images/ar/button_headline.pngbin629 -> 560 bytes
-rw-r--r--skins/common/images/ar/button_italic.pngbin692 -> 605 bytes
-rw-r--r--skins/common/images/ar/button_link.pngbin741 -> 643 bytes
-rw-r--r--skins/common/images/ar/button_nowiki.pngbin1185 -> 963 bytes
-rw-r--r--skins/common/images/arrow_disabled_first_25.pngbin481 -> 369 bytes
-rw-r--r--skins/common/images/arrow_disabled_last_25.pngbin480 -> 374 bytes
-rw-r--r--skins/common/images/arrow_disabled_left_25.pngbin460 -> 352 bytes
-rw-r--r--skins/common/images/arrow_disabled_right_25.pngbin447 -> 358 bytes
-rw-r--r--skins/common/images/arrow_first_25.pngbin482 -> 405 bytes
-rw-r--r--skins/common/images/arrow_last_25.pngbin484 -> 395 bytes
-rw-r--r--skins/common/images/arrow_left_25.pngbin462 -> 383 bytes
-rw-r--r--skins/common/images/arrow_right_25.pngbin449 -> 394 bytes
-rw-r--r--skins/common/images/be-tarask/button_italic.pngbin592 -> 580 bytes
-rw-r--r--skins/common/images/be-tarask/button_link.pngbin466 -> 459 bytes
-rw-r--r--skins/common/images/button_bold.pngbin288 -> 271 bytes
-rw-r--r--skins/common/images/button_extlink.pngbin494 -> 456 bytes
-rw-r--r--skins/common/images/button_headline.pngbin465 -> 461 bytes
-rw-r--r--skins/common/images/button_hr.pngbin251 -> 247 bytes
-rw-r--r--skins/common/images/button_image.pngbin584 -> 504 bytes
-rw-r--r--skins/common/images/button_italic.pngbin292 -> 271 bytes
-rw-r--r--skins/common/images/button_link.pngbin337 -> 301 bytes
-rw-r--r--skins/common/images/button_media.pngbin780 -> 749 bytes
-rw-r--r--skins/common/images/button_nowiki.pngbin352 -> 342 bytes
-rw-r--r--skins/common/images/button_sig.pngbin953 -> 949 bytes
-rw-r--r--skins/common/images/button_template.pngbin233 -> 210 bytes
-rw-r--r--skins/common/images/cc-by-nc-sa.pngbin0 -> 4263 bytes
-rw-r--r--skins/common/images/cc-by-sa.pngbin0 -> 4109 bytes
-rw-r--r--skins/common/images/closewindow.pngbin0 -> 148 bytes
-rw-r--r--skins/common/images/critical-32.pngbin0 -> 2395 bytes
-rw-r--r--skins/common/images/cyrl/button_italic.pngbin460 -> 457 bytes
-rw-r--r--skins/common/images/de/button_bold.pngbin328 -> 308 bytes
-rw-r--r--skins/common/images/de/button_italic.pngbin351 -> 313 bytes
-rw-r--r--skins/common/images/download-32.pngbin0 -> 2057 bytes
-rw-r--r--skins/common/images/fa/button_bold.pngbin500 -> 496 bytes
-rw-r--r--skins/common/images/fa/button_headline.pngbin434 -> 429 bytes
-rw-r--r--skins/common/images/fa/button_italic.pngbin573 -> 563 bytes
-rw-r--r--skins/common/images/fa/button_link.pngbin535 -> 522 bytes
-rw-r--r--skins/common/images/fa/button_nowiki.pngbin1185 -> 963 bytes
-rw-r--r--skins/common/images/gnu-fdl.pngbin1730 -> 1655 bytes
-rw-r--r--skins/common/images/help-question-hover.gifbin0 -> 1246 bytes
-rw-r--r--skins/common/images/help-question.gifbin0 -> 126 bytes
-rw-r--r--skins/common/images/icons/fileicon-c.pngbin2211 -> 1948 bytes
-rw-r--r--skins/common/images/icons/fileicon-cpp.pngbin1882 -> 1577 bytes
-rw-r--r--skins/common/images/icons/fileicon-deb.pngbin4801 -> 4726 bytes
-rw-r--r--skins/common/images/icons/fileicon-djvu.pngbin10752 -> 10615 bytes
-rw-r--r--skins/common/images/icons/fileicon-dvi.pngbin12778 -> 12628 bytes
-rw-r--r--skins/common/images/icons/fileicon-exe.pngbin5680 -> 5627 bytes
-rw-r--r--skins/common/images/icons/fileicon-h.pngbin1191 -> 998 bytes
-rw-r--r--skins/common/images/icons/fileicon-html.pngbin7422 -> 7376 bytes
-rw-r--r--skins/common/images/icons/fileicon-iso.pngbin6450 -> 6304 bytes
-rw-r--r--skins/common/images/icons/fileicon-java.pngbin5989 -> 5901 bytes
-rw-r--r--skins/common/images/icons/fileicon-mid.pngbin6657 -> 6515 bytes
-rw-r--r--skins/common/images/icons/fileicon-o.pngbin2204 -> 1937 bytes
-rw-r--r--skins/common/images/icons/fileicon-ogg.pngbin3750 -> 3346 bytes
-rw-r--r--skins/common/images/icons/fileicon-pdf.pngbin4976 -> 4909 bytes
-rw-r--r--skins/common/images/icons/fileicon-ps.pngbin3012 -> 2985 bytes
-rw-r--r--skins/common/images/icons/fileicon-rm.pngbin2851 -> 2714 bytes
-rw-r--r--skins/common/images/icons/fileicon-rpm.pngbin4103 -> 4000 bytes
-rw-r--r--skins/common/images/icons/fileicon-svg.pngbin5094 -> 4978 bytes
-rw-r--r--skins/common/images/icons/fileicon-tar.pngbin6347 -> 6224 bytes
-rw-r--r--skins/common/images/icons/fileicon-tex.pngbin3997 -> 3937 bytes
-rw-r--r--skins/common/images/icons/fileicon-ttf.pngbin3469 -> 3392 bytes
-rw-r--r--skins/common/images/icons/fileicon-txt.pngbin3638 -> 3582 bytes
-rw-r--r--skins/common/images/icons/fileicon.pngbin1121 -> 884 bytes
-rw-r--r--skins/common/images/info-32.pngbin0 -> 2159 bytes
-rw-r--r--skins/common/images/ksh/button_S_italic.pngbin3206 -> 3201 bytes
-rw-r--r--skins/common/images/mediawiki.pngbin22987 -> 22736 bytes
-rw-r--r--skins/common/images/poweredby_mediawiki_88x31.pngbin1927 -> 3605 bytes
-rw-r--r--skins/common/images/public-domain.pngbin2251 -> 2248 bytes
-rw-r--r--skins/common/images/redirectltr.pngbin381 -> 355 bytes
-rw-r--r--skins/common/images/redirectrtl.pngbin381 -> 359 bytes
-rw-r--r--skins/common/images/remove.pngbin3346 -> 3271 bytes
-rw-r--r--skins/common/images/tick-32.pngbin0 -> 1457 bytes
-rw-r--r--skins/common/images/tipsy-arrow.gifbin0 -> 205 bytes
-rw-r--r--skins/common/images/tooltip_icon.pngbin430 -> 391 bytes
-rw-r--r--skins/common/images/warning-32.pngbin0 -> 1895 bytes
-rw-r--r--skins/common/images/wiki.pngbin24801 -> 24482 bytes
-rw-r--r--skins/common/jquery.js4384
-rw-r--r--skins/common/jquery.min.js433
-rw-r--r--skins/common/metadata.js8
-rw-r--r--skins/common/mwsuggest.js351
-rw-r--r--skins/common/nostalgia.css49
-rw-r--r--skins/common/oldshared.css232
-rw-r--r--skins/common/prefs.js111
-rw-r--r--skins/common/preview.js155
-rw-r--r--skins/common/protect.js26
-rw-r--r--skins/common/quickbar-right.css1
-rw-r--r--skins/common/quickbar.css1
-rw-r--r--skins/common/rightclickedit.js48
-rw-r--r--skins/common/search.css14
-rw-r--r--skins/common/search.js10
-rw-r--r--skins/common/shared.css329
-rw-r--r--skins/common/upload.js50
-rw-r--r--skins/common/wikibits.js414
-rw-r--r--skins/common/wikiprintable.css4
-rw-r--r--skins/common/wikistandard.css212
118 files changed, 2222 insertions, 6231 deletions
diff --git a/skins/common/IEFixes.js b/skins/common/IEFixes.js
index 762d7a78..ba4dc66b 100644
--- a/skins/common/IEFixes.js
+++ b/skins/common/IEFixes.js
@@ -1,23 +1,23 @@
// IE fixes javascript
-var isMSIE55 = ( window.showModalDialog && window.clipboardData && window.createPopup );
-var doneIETransform;
-var doneIEAlphaFix;
+window.isMSIE55 = ( window.showModalDialog && window.clipboardData && window.createPopup );
+window.doneIETransform = undefined;
+window.doneIEAlphaFix = undefined;
-if ( document.attachEvent ) {
- document.attachEvent( 'onreadystatechange', hookit );
-}
-
-function hookit() {
+window.hookit = function() {
if ( !doneIETransform && document.getElementById && document.getElementById( 'bodyContent' ) ) {
doneIETransform = true;
relativeforfloats();
fixalpha();
}
+};
+
+if ( document.attachEvent ) {
+ document.attachEvent( 'onreadystatechange', window.hookit );
}
// png alpha transparency fixes
-function fixalpha( logoId ) {
+window.fixalpha = function( logoId ) {
// bg
if ( isMSIE55 && !doneIEAlphaFix ) {
var plogo = document.getElementById( logoId || 'p-logo' );
@@ -61,10 +61,10 @@ function fixalpha( logoId ) {
linkFix.style.width = '100%';
}
}
-}
+};
// fix ie6 disappering float bug
-function relativeforfloats() {
+window.relativeforfloats = function() {
var bc = document.getElementById( 'bodyContent' );
if ( bc ) {
var tables = bc.getElementsByTagName( 'table' );
@@ -72,8 +72,9 @@ function relativeforfloats() {
}
setrelative( tables );
setrelative( divs );
-}
-function setrelative( nodes ) {
+};
+
+window.setrelative = function( nodes ) {
var i = 0;
while ( i < nodes.length ) {
if( ( ( nodes[i].style.float && nodes[i].style.float != ( 'none' ) ||
@@ -84,7 +85,7 @@ function setrelative( nodes ) {
}
i++;
}
-}
+};
// Expand links for printing
String.prototype.hasClass = function( classWanted ) {
@@ -95,11 +96,11 @@ String.prototype.hasClass = function( classWanted ) {
}
}
return false;
-}
+};
-var expandedURLs;
+window.expandedURLs = undefined;
-onbeforeprint = function() {
+window.onbeforeprint = function() {
expandedURLs = [];
var contentEl = document.getElementById( 'content' );
@@ -117,12 +118,12 @@ onbeforeprint = function() {
}
}
}
-}
+};
-onafterprint = function() {
+window.onafterprint = function() {
for ( var i = 0; i < expandedURLs.length; i++ ) {
if ( expandedURLs[i] ) {
expandedURLs[i].removeNode( true );
}
}
-}
+};
diff --git a/skins/common/ajax.js b/skins/common/ajax.js
index afcfa708..1cad75ed 100644
--- a/skins/common/ajax.js
+++ b/skins/common/ajax.js
@@ -1,167 +1,177 @@
// remote scripting library
// (c) copyright 2005 modernmethod, inc
-var sajax_debug_mode = false;
-var sajax_request_type = "GET";
+window.sajax_debug_mode = false;
+window.sajax_request_type = 'GET';
/**
-* if sajax_debug_mode is true, this function outputs given the message into
-* the element with id = sajax_debug; if no such element exists in the document,
-* it is injected.
-*/
-function sajax_debug(text) {
+ * if sajax_debug_mode is true, this function outputs given the message into
+ * the element with id = sajax_debug; if no such element exists in the document,
+ * it is injected.
+ */
+window.sajax_debug = function(text) {
if (!sajax_debug_mode) return false;
- var e= document.getElementById('sajax_debug');
+ var e = document.getElementById( 'sajax_debug' );
- if (!e) {
- e= document.createElement("p");
- e.className= 'sajax_debug';
- e.id= 'sajax_debug';
+ if ( !e ) {
+ e = document.createElement( 'p' );
+ e.className = 'sajax_debug';
+ e.id = 'sajax_debug';
- var b= document.getElementsByTagName("body")[0];
+ var b = document.getElementsByTagName( 'body' )[0];
- if (b.firstChild) b.insertBefore(e, b.firstChild);
- else b.appendChild(e);
+ if ( b.firstChild ) {
+ b.insertBefore( e, b.firstChild );
+ } else {
+ b.appendChild( e );
+ }
}
- var m= document.createElement("div");
+ var m = document.createElement( 'div' );
m.appendChild( document.createTextNode( text ) );
e.appendChild( m );
return true;
-}
+};
/**
-* compatibility wrapper for creating a new XMLHttpRequest object.
-*/
-function sajax_init_object() {
- sajax_debug("sajax_init_object() called..")
+ * Compatibility wrapper for creating a new XMLHttpRequest object.
+ */
+window.sajax_init_object = function() {
+ sajax_debug( 'sajax_init_object() called..' );
var A;
try {
// Try the new style before ActiveX so we don't
// unnecessarily trigger warnings in IE 7 when
// set to prompt about ActiveX usage
A = new XMLHttpRequest();
- } catch (e) {
+ } catch ( e ) {
try {
- A=new ActiveXObject("Msxml2.XMLHTTP");
- } catch (e) {
+ A = new ActiveXObject( 'Msxml2.XMLHTTP' );
+ } catch ( e ) {
try {
- A=new ActiveXObject("Microsoft.XMLHTTP");
- } catch (oc) {
- A=null;
+ A = new ActiveXObject( 'Microsoft.XMLHTTP' );
+ } catch ( oc ) {
+ A = null;
}
}
}
- if (!A)
- sajax_debug("Could not create connection object.");
+ if ( !A ) {
+ sajax_debug( 'Could not create connection object.' );
+ }
return A;
-}
+};
/**
-* Perform an ajax call to mediawiki. Calls are handeled by AjaxDispatcher.php
-* func_name - the name of the function to call. Must be registered in $wgAjaxExportList
-* args - an array of arguments to that function
-* target - the target that will handle the result of the call. If this is a function,
-* if will be called with the XMLHttpRequest as a parameter; if it's an input
-* element, its value will be set to the resultText; if it's another type of
-* element, its innerHTML will be set to the resultText.
-*
-* Example:
-* sajax_do_call('doFoo', [1, 2, 3], document.getElementById("showFoo"));
-*
-* This will call the doFoo function via MediaWiki's AjaxDispatcher, with
-* (1, 2, 3) as the parameter list, and will show the result in the element
-* with id = showFoo
-*/
-function sajax_do_call(func_name, args, target) {
+ * Perform an AJAX call to MediaWiki. Calls are handled by AjaxDispatcher.php
+ * func_name - the name of the function to call. Must be registered in $wgAjaxExportList
+ * args - an array of arguments to that function
+ * target - the target that will handle the result of the call. If this is a function,
+ * if will be called with the XMLHttpRequest as a parameter; if it's an input
+ * element, its value will be set to the resultText; if it's another type of
+ * element, its innerHTML will be set to the resultText.
+ *
+ * Example:
+ * sajax_do_call( 'doFoo', [1, 2, 3], document.getElementById( 'showFoo' ) );
+ *
+ * This will call the doFoo function via MediaWiki's AjaxDispatcher, with
+ * (1, 2, 3) as the parameter list, and will show the result in the element
+ * with id = showFoo
+ */
+window.sajax_do_call = function(func_name, args, target) {
var i, x, n;
var uri;
var post_data;
uri = wgServer +
- ((wgScript == null) ? (wgScriptPath + "/index.php") : wgScript) +
- "?action=ajax";
- if (sajax_request_type == "GET") {
- if (uri.indexOf("?") == -1)
- uri = uri + "?rs=" + encodeURIComponent(func_name);
- else
- uri = uri + "&rs=" + encodeURIComponent(func_name);
- for (i = 0; i < args.length; i++)
- uri = uri + "&rsargs[]=" + encodeURIComponent(args[i]);
- //uri = uri + "&rsrnd=" + new Date().getTime();
+ ( ( wgScript == null ) ? ( wgScriptPath + '/index.php' ) : wgScript ) +
+ '?action=ajax';
+ if ( sajax_request_type == 'GET' ) {
+ if ( uri.indexOf( '?' ) == -1 ) {
+ uri = uri + '?rs=' + encodeURIComponent( func_name );
+ } else {
+ uri = uri + '&rs=' + encodeURIComponent( func_name );
+ }
+ for ( i = 0; i < args.length; i++ ) {
+ uri = uri + '&rsargs[]=' + encodeURIComponent( args[i] );
+ }
+ //uri = uri + '&rsrnd=' + new Date().getTime();
post_data = null;
} else {
- post_data = "rs=" + encodeURIComponent(func_name);
- for (i = 0; i < args.length; i++)
- post_data = post_data + "&rsargs[]=" + encodeURIComponent(args[i]);
+ post_data = 'rs=' + encodeURIComponent( func_name );
+ for ( i = 0; i < args.length; i++ ) {
+ post_data = post_data + '&rsargs[]=' + encodeURIComponent( args[i] );
+ }
}
x = sajax_init_object();
- if (!x) {
- alert("AJAX not supported");
+ if ( !x ) {
+ alert( 'AJAX not supported' );
return false;
}
try {
- x.open(sajax_request_type, uri, true);
- } catch (e) {
- if (window.location.hostname == "localhost") {
- alert("Your browser blocks XMLHttpRequest to 'localhost', try using a real hostname for development/testing.");
+ x.open( sajax_request_type, uri, true );
+ } catch ( e ) {
+ if ( window.location.hostname == 'localhost' ) {
+ alert( "Your browser blocks XMLHttpRequest to 'localhost', try using a real hostname for development/testing." );
}
throw e;
}
- if (sajax_request_type == "POST") {
- x.setRequestHeader("Method", "POST " + uri + " HTTP/1.1");
- x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
+ if ( sajax_request_type == 'POST' ) {
+ x.setRequestHeader( 'Method', 'POST ' + uri + ' HTTP/1.1' );
+ x.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded' );
}
- x.setRequestHeader("Pragma", "cache=yes");
- x.setRequestHeader("Cache-Control", "no-transform");
+ x.setRequestHeader( 'Pragma', 'cache=yes' );
+ x.setRequestHeader( 'Cache-Control', 'no-transform' );
x.onreadystatechange = function() {
- if (x.readyState != 4)
+ if ( x.readyState != 4 ) {
return;
+ }
- sajax_debug("received (" + x.status + " " + x.statusText + ") " + x.responseText);
+ sajax_debug( 'received (' + x.status + ' ' + x.statusText + ') ' + x.responseText );
- //if (x.status != 200)
- // alert("Error: " + x.status + " " + x.statusText + ": " + x.responseText);
+ //if ( x.status != 200 )
+ // alert( 'Error: ' + x.status + ' ' + x.statusText + ': ' + x.responseText );
//else
if ( typeof( target ) == 'function' ) {
target( x );
- }
- else if ( typeof( target ) == 'object' ) {
+ } else if ( typeof( target ) == 'object' ) {
if ( target.tagName == 'INPUT' ) {
- if (x.status == 200) target.value= x.responseText;
- //else alert("Error: " + x.status + " " + x.statusText + " (" + x.responseText + ")");
- }
- else {
- if (x.status == 200) target.innerHTML = x.responseText;
- else target.innerHTML= "<div class='error'>Error: " + x.status + " " + x.statusText + " (" + x.responseText + ")</div>";
+ if ( x.status == 200 ) {
+ target.value= x.responseText;
+ }
+ //else alert( 'Error: ' + x.status + ' ' + x.statusText + ' (' + x.responseText + ')' );
+ } else {
+ if ( x.status == 200 ) {
+ target.innerHTML = x.responseText;
+ } else {
+ target.innerHTML = '<div class="error">Error: ' + x.status +
+ ' ' + x.statusText + ' (' + x.responseText + ')</div>';
+ }
}
- }
- else {
- alert("bad target for sajax_do_call: not a function or object: " + target);
+ } else {
+ alert( 'bad target for sajax_do_call: not a function or object: ' + target );
}
return;
- }
+ };
- sajax_debug(func_name + " uri = " + uri + " / post = " + post_data);
- x.send(post_data);
- sajax_debug(func_name + " waiting..");
+ sajax_debug( func_name + ' uri = ' + uri + ' / post = ' + post_data );
+ x.send( post_data );
+ sajax_debug( func_name + ' waiting..' );
delete x;
return true;
-}
+};
/**
* @return boolean whether the browser supports XMLHttpRequest
*/
-function wfSupportsAjax() {
+window.wfSupportsAjax = function() {
var request = sajax_init_object();
var supportsAjax = request ? true : false;
delete request;
return supportsAjax;
-}
-
+};
diff --git a/skins/common/ajaxwatch.js b/skins/common/ajaxwatch.js
index 7f546014..aaf6360c 100644
--- a/skins/common/ajaxwatch.js
+++ b/skins/common/ajaxwatch.js
@@ -1,180 +1,120 @@
-// dependencies:
-// * ajax.js:
- /*extern sajax_init_object, sajax_do_call */
-// * wikibits.js:
- /*extern changeText, hookEvent, jsMsg */
+/**
+ * Animate watch/unwatch links to use asynchronous API requests to
+ * watch pages, rather than clicking on links. Requires jQuery.
+ * Uses jsMsg() from wikibits.js.
+ */
-// These should have been initialized in the generated js
-/*extern wgAjaxWatch, wgPageName */
-
-if(typeof wgAjaxWatch === "undefined" || !wgAjaxWatch) {
- var wgAjaxWatch = {
- watchMsg: "Watch",
- unwatchMsg: "Unwatch",
- watchingMsg: "Watching...",
- unwatchingMsg: "Unwatching...",
- 'tooltip-ca-watchMsg': "Add this page to your watchlist",
- 'tooltip-ca-unwatchMsg': "Remove this page from your watchlist"
- };
+if ( typeof wgAjaxWatch === 'undefined' || !wgAjaxWatch ) {
+ window.wgAjaxWatch = { };
}
-wgAjaxWatch.supported = true; // supported on current page and by browser
-wgAjaxWatch.watching = false; // currently watching page
-wgAjaxWatch.inprogress = false; // ajax request in progress
-wgAjaxWatch.timeoutID = null; // see wgAjaxWatch.ajaxCall
-wgAjaxWatch.watchLinks = []; // "watch"/"unwatch" links
-wgAjaxWatch.iconMode = false; // new icon driven functionality
-wgAjaxWatch.imgBasePath = ""; // base img path derived from icons on load
-
-wgAjaxWatch.setLinkText = function( newText ) {
- if( wgAjaxWatch.iconMode ) {
- for ( i = 0; i < wgAjaxWatch.watchLinks.length; i++ ) {
- wgAjaxWatch.watchLinks[i].firstChild.alt = newText;
- if ( newText == wgAjaxWatch.watchingMsg || newText == wgAjaxWatch.unwatchingMsg ) {
- wgAjaxWatch.watchLinks[i].className += ' loading';
- } else if ( newText == wgAjaxWatch.watchMsg || newText == wgAjaxWatch.unwatchMsg ) {
- wgAjaxWatch.watchLinks[i].className =
- wgAjaxWatch.watchLinks[i].className.replace( /loading/i, '' );
- // update the title text on the link
- var keyCommand = wgAjaxWatch.watchLinks[i].title.match( /\[.*?\]$/ ) ?
- wgAjaxWatch.watchLinks[i].title.match( /\[.*?\]$/ )[0] : "";
- wgAjaxWatch.watchLinks[i].title = ( newText == wgAjaxWatch.watchMsg ?
- wgAjaxWatch['tooltip-ca-watchMsg'] : wgAjaxWatch['tooltip-ca-unwatchMsg'] )
- + " " + keyCommand;
- }
+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 {
- for ( i = 0; i < wgAjaxWatch.watchLinks.length; i++ ) {
- changeText( wgAjaxWatch.watchLinks[i], newText );
- }
+ $link.html( mediaWiki.msg( action ) );
}
};
-wgAjaxWatch.setLinkID = function( newId ) {
- // We can only set the first one
- wgAjaxWatch.watchLinks[0].parentNode.setAttribute( 'id', newId );
-};
-
-wgAjaxWatch.setHref = function( string ) {
- for( i = 0; i < wgAjaxWatch.watchLinks.length; i++ ) {
- if( string == 'watch' ) {
- wgAjaxWatch.watchLinks[i].href = wgAjaxWatch.watchLinks[i].href
- .replace( /&action=unwatch/, '&action=watch' );
- } else if( string == 'unwatch' ) {
- wgAjaxWatch.watchLinks[i].href = wgAjaxWatch.watchLinks[i].href
- .replace( /&action=watch/, '&action=unwatch' );
- }
- }
-}
-
-wgAjaxWatch.ajaxCall = function() {
- if(!wgAjaxWatch.supported) {
- return true;
- } else if (wgAjaxWatch.inprogress) {
- return false;
- }
- if(!wfSupportsAjax()) {
- // Lazy initialization so we don't toss up
- // ActiveX warnings on initial page load
- // for IE 6 users with security settings.
- wgAjaxWatch.supported = false;
- return true;
+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;
}
- wgAjaxWatch.inprogress = true;
- wgAjaxWatch.setLinkText( wgAjaxWatch.watching
- ? wgAjaxWatch.unwatchingMsg : wgAjaxWatch.watchingMsg);
- sajax_do_call(
- "wfAjaxWatch",
- [wgPageName, (wgAjaxWatch.watching ? "u" : "w")],
- wgAjaxWatch.processResult
- );
- // if the request isn't done in 10 seconds, allow user to try again
- wgAjaxWatch.timeoutID = window.setTimeout(
- function() { wgAjaxWatch.inprogress = false; },
- 10000
- );
- return false;
-};
+ jsMsg( response.message, 'watch' );
-wgAjaxWatch.processResult = function(request) {
- if(!wgAjaxWatch.supported) {
- return;
- }
- var response = request.responseText;
- if( response.match(/^<w#>/) ) {
- wgAjaxWatch.watching = true;
- wgAjaxWatch.setLinkText(wgAjaxWatch.unwatchMsg);
- wgAjaxWatch.setLinkID("ca-unwatch");
- wgAjaxWatch.setHref( 'unwatch' );
- } else if( response.match(/^<u#>/) ) {
- wgAjaxWatch.watching = false;
- wgAjaxWatch.setLinkText(wgAjaxWatch.watchMsg);
- wgAjaxWatch.setLinkID("ca-watch");
- wgAjaxWatch.setHref( '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 {
- // Either we got a <err#> error code or it just plain broke.
- window.location.href = wgAjaxWatch.watchLinks[0].href;
- return;
+ $( '#wpWatchthis' ).removeAttr( 'checked' );
}
- jsMsg( response.substr(4), 'watch' );
- wgAjaxWatch.inprogress = false;
- if(wgAjaxWatch.timeoutID) {
- window.clearTimeout(wgAjaxWatch.timeoutID);
- }
- // Bug 12395 - avoid some watch link confusion on edit
- var watchthis = document.getElementById("wpWatchthis");
- if( watchthis && response.match(/^<[uw]#>/) ) {
- watchthis.checked = response.match(/^<w#>/) ? "checked" : "";
- }
- return;
};
-wgAjaxWatch.onLoad = function() {
- // This document structure hardcoding sucks. We should make a class and
- // toss all this out the window.
-
- var el1 = document.getElementById("ca-unwatch");
- var el2 = null;
- if ( !el1 ) {
- el1 = document.getElementById("mw-unwatch-link1");
- el2 = document.getElementById("mw-unwatch-link2");
- }
- if( el1 ) {
- wgAjaxWatch.watching = true;
- } else {
- wgAjaxWatch.watching = false;
- el1 = document.getElementById("ca-watch");
- if ( !el1 ) {
- el1 = document.getElementById("mw-watch-link1");
- el2 = document.getElementById("mw-watch-link2");
- }
- if( !el1 ) {
- wgAjaxWatch.supported = false;
- return;
+$( 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;
}
- }
-
- // Detect if the watch/unwatch feature is in icon mode
- if ( el1.className.match( /icon/i ) ) {
- wgAjaxWatch.iconMode = true;
- }
-
- // The id can be either for the parent (Monobook-based) or the element
- // itself (non-Monobook)
- wgAjaxWatch.watchLinks.push( el1.tagName.toLowerCase() == "a"
- ? el1 : el1.firstChild );
- if( el2 ) {
- wgAjaxWatch.watchLinks.push( el2 );
- }
+ 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'
+ );
- // I couldn't get for (watchLink in wgAjaxWatch.watchLinks) to work, if
- // you can be my guest.
- for( i = 0; i < wgAjaxWatch.watchLinks.length; i++ ) {
- wgAjaxWatch.watchLinks[i].onclick = wgAjaxWatch.ajaxCall;
- }
- return;
-};
+ 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;
+ });
-hookEvent("load", wgAjaxWatch.onLoad);
+ wgAjaxWatch.$links = $links;
+});
diff --git a/skins/common/block.js b/skins/common/block.js
index ad04f810..fb86cbd6 100644
--- a/skins/common/block.js
+++ b/skins/common/block.js
@@ -1,6 +1,34 @@
-addOnloadHook( considerChangingExpiryFocus );
+// @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;
+};
-function considerChangingExpiryFocus() {
+window.considerChangingExpiryFocus = function() {
if ( !document.getElementById ) {
return;
}
@@ -18,9 +46,9 @@ function considerChangingExpiryFocus() {
} else {
field.style.display = 'none';
}
-}
+};
-function updateBlockOptions() {
+window.updateBlockOptions = function() {
if ( !document.getElementById ) {
return;
}
@@ -30,9 +58,10 @@ function updateBlockOptions() {
return;
}
- var addy = target.value;
- var isEmpty = addy.match(/^\s*$/);
- var isIp = addy.match(/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|:(:[0-9A-Fa-f]{1,4}){1,7}|[0-9A-Fa-f]{1,4}(:{1,2}[0-9A-Fa-f]{1,4}|::$){1,7})(\/\d+)?$/);
+ 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' );
@@ -54,4 +83,7 @@ function updateBlockOptions() {
if( watchuserRow ) {
watchuserRow.style.display = isIpRange && !isEmpty ? 'none' : '';
}
-}
+};
+
+addOnloadHook( updateBlockOptions );
+addOnloadHook( considerChangingExpiryFocus );
diff --git a/skins/common/changepassword.js b/skins/common/changepassword.js
deleted file mode 100644
index 1e3e2069..00000000
--- a/skins/common/changepassword.js
+++ /dev/null
@@ -1,16 +0,0 @@
-
-function onNameChange() {
- if ( wgUserName != document.getElementById('wpName').value ) {
- document.getElementById('wpPassword').disabled = true;
- document.getElementById('wpComment').disabled = false;
- } else {
- document.getElementById('wpPassword').disabled = false;
- document.getElementById('wpComment').disabled = true;
- }
-}
-
-function onNameChangeHook() {
- document.getElementById( 'wpName' ).onblur = onNameChange;
-}
-
-addOnloadHook( onNameChangeHook );
diff --git a/skins/common/cologneblue.css b/skins/common/cologneblue.css
index 2329d233..c7b6eac1 100644
--- a/skins/common/cologneblue.css
+++ b/skins/common/cologneblue.css
@@ -1,101 +1,210 @@
-body { margin: 0px; padding: 0px; color: black; }
-#specialform { display: inline; }
-#content { top: 0; margin: 0; padding: 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;
+ font-family: Verdana, Arial, sans-serif;
+ color: black;
+ font-size: 8pt;
+}
+
+#topbar {
+ padding: 0px;
}
-#topbar { padding: 0px; }
+
#powersearch {
- background: #DDEEFF; border-style: solid; border-width: 1px; padding: 2px;
+ background: #DDEEFF;
+ border-style: solid;
+ border-width: 1px;
+ padding: 2px;
}
+
#quickbar {
- width: 140px; top: 18ex; padding: 2px; visibility: visible; z-index: 99;
+ 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;
+ 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;
+ 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;
}
-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;
+ 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;
+ 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;
+ 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;
+ font-family: Verdana, Arial, sans-serif;
+ font-size: 10pt;
+ padding: 0;
}
+
#pagestats {
- font-family: Verdana, Arial, sans-serif;
- color: black;
- font-size: 9pt;
+ 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;
+ 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;
+ 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 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;
+ 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;
}
-#quickbar form { padding: 0; margin-top: 0; }
h1 {
- color: #666666;
- font-family: Verdana, Arial, sans-serif;
- font-size: 180%; line-height: 21pt;
+ 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;
}
-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; }
+ 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 0932fcea..56203aa4 100644
--- a/skins/common/commonPrint.css
+++ b/skins/common/commonPrint.css
@@ -8,13 +8,15 @@
/* Thanks to A List Apart (http://alistapart.com/) for useful extras */
a.stub,
-a.new{ color:#ba0000; text-decoration:none; }
+a.new {
+ color: #ba0000;
+ text-decoration: none;
+}
-#toc {
- /*border:1px solid #2f6fab;*/
- border:1px solid #aaaaaa;
- background-color:#f9f9f9;
- padding:5px;
+#toc {
+ border: 1px solid #aaaaaa;
+ background-color: #f9f9f9;
+ padding: 5px;
}
.tocindent {
margin-left: 2em;
@@ -24,54 +26,67 @@ a.new{ color:#ba0000; text-decoration:none; }
}
/* images */
-div.floatright {
- float: right;
- clear: right;
- margin: 0;
- position:relative;
- border: 0.5em solid White;
- border-width: 0.5em 0 0.8em 1.4em;
-}
-div.floatright p { font-style: italic;}
-div.floatleft {
- float: left;
- margin: 0.3em 0.5em 0.5em 0;
- position:relative;
- border: 0.5em solid White;
- border-width: 0.5em 1.4em 0.8em 0;
-}
-div.floatleft p { font-style: italic; }
+div.floatright {
+ float: right;
+ clear: right;
+ position: relative;
+ margin: 0.5em 0 0.8em 1.4em;
+}
+div.floatright p {
+ font-style: italic;
+}
+div.floatleft {
+ float: left;
+ clear: left;
+ position: relative;
+ margin: 0.5em 1.4em 0.8em 0;
+}
+div.floatleft p {
+ font-style: italic;
+}
+div.center {
+ text-align: center;
+}
+
/* thumbnails */
div.thumb {
- margin-bottom: 0.5em;
- border-style: solid; border-color: White;
- width: auto;
- overflow: hidden;
+ border: none;
+ width: auto;
+ margin-top: 0.5em;
+ margin-bottom: 0.8em;
+ background-color: transparent;
}
div.thumbinner {
- border:1px solid #cccccc;
- padding: 3px !important;
- background-color:#f9f9f9;
- font-size: 94%;
- text-align: center;
+ border:1px solid #cccccc;
+ padding: 3px !important;
+ background-color: White;
+ font-size: 94%;
+ text-align: center;
+ overflow: hidden;
}
html .thumbimage {
- border:1px solid #cccccc;
+ border: 1px solid #cccccc;
}
html .thumbcaption {
- border: none;
- padding: 0.3em 0 0.1em 0;
+ border: none;
+ text-align: left;
+ line-height: 1.4em;
+ padding: 3px !important;
+ font-size: 94%;
+}
+
+div.magnify {
+ display: none;
}
-div.magnify { display: none; }
div.tright {
- float: right;
- clear: right;
- border-width: 0.5em 0 0.8em 1.4em;
+ float: right;
+ clear: right;
+ margin: 0.5em 0 0.8em 1.4em;
}
div.tleft {
- float: left;
- margin-right:0.5em;
- border-width: 0.5em 1.4em 0.8em 0;
+ float: left;
+ clear: left;
+ margin: 0.5em 1.4em 0.8em 0;
}
img.thumbborder {
border: 1px solid #dddddd;
@@ -79,20 +94,20 @@ img.thumbborder {
/* table standards */
table.rimage {
- float:right;
- width:1pt;
- position:relative;
- margin-left:1em;
- margin-bottom:1em;
- text-align:center;
+ float: right;
+ width: 1pt;
+ position: relative;
+ margin-left: 1em;
+ margin-bottom: 1em;
+ text-align: center;
}
body {
- background: White;
- /*font-size: 11pt !important;*/
- color: Black;
- margin: 0;
- padding: 0;
+ background: White;
+ /*font-size: 11pt !important;*/
+ color: Black;
+ margin: 0;
+ padding: 0;
}
.noprint,
@@ -109,25 +124,26 @@ li#viewcount,
li#about,
li#disclaimer,
li#privacy,
+#footer-places,
#mw-hidden-catlinks {
- /* Hides all the elements irrelevant for printing */
- display: none;
+ /* Hides all the elements irrelevant for printing */
+ display: none;
}
-ul {
- list-style-type: square;
+ul {
+ list-style-type: square;
}
#content {
- background: none;
- border: none ! important;
- padding: 0 ! important;
- margin: 0 ! important;
+ background: none;
+ border: none ! important;
+ padding: 0 ! important;
+ margin: 0 ! important;
}
#footer {
background : white;
color : black;
- border-top: 1px solid black;
+ border-top: 1px solid black;
}
h1, h2, h3, h4, h5, h6 {
@@ -135,8 +151,8 @@ h1, h2, h3, h4, h5, h6 {
}
p, .documentDescription {
- margin: 1em 0 ! important;
- line-height: 1.2em;
+ margin: 1em 0 ! important;
+ line-height: 1.2em;
}
.tocindent p {
@@ -144,55 +160,55 @@ p, .documentDescription {
}
pre {
- border: 1pt dashed black;
- white-space: pre;
- font-size: 8pt;
- overflow: auto;
- padding: 1em 0;
- background : white;
- color : black;
+ border: 1pt dashed black;
+ white-space: pre;
+ font-size: 8pt;
+ overflow: auto;
+ padding: 1em 0;
+ background: white;
+ color: black;
}
table.listing,
table.listing td {
- border: 1pt solid black;
- border-collapse: collapse;
+ border: 1pt solid black;
+ border-collapse: collapse;
}
a {
- color: Black !important;
- background: none !important;
- padding: 0 !important;
+ color: Black !important;
+ background: none !important;
+ padding: 0 !important;
}
a:link, a:visited {
- color: #520;
- background: transparent;
- text-decoration: underline;
+ color: #520;
+ background: transparent;
+ text-decoration: underline;
}
#content a.external.text:after, #content a.external.autonumber:after {
- /* Expand URLs for printing */
- content: " (" attr(href) ") ";
+ /* Expand URLs for printing */
+ content: " (" attr(href) ") ";
}
#globalWrapper {
- width: 100% !important;
- min-width: 0 !important;
+ width: 100% !important;
+ min-width: 0 !important;
}
#content {
- background : white;
- color : black;
+ background: white;
+ color: black;
}
#column-content {
- margin: 0 !important;
+ margin: 0 !important;
}
#column-content #content {
- padding: 1em;
- margin: 0 !important;
+ padding: 1em;
+ margin: 0 !important;
}
/* MSIE/Win doesn't understand 'inherit' */
a, a.external, a.new, a.stub {
@@ -206,44 +222,122 @@ a, a.external, a.new, a.stub {
text-decoration: inherit ! important;
}
-img { border: none; }
-img.tex { vertical-align: middle; }
+img {
+ border: none;
+ vertical-align: middle;
+}
+
+/* math */
span.texhtml { font-family: serif; }
#siteNotice { display: none; }
-div.gallerybox {
- border: 1px solid #cccccc;
- background-color:#f9f9f9;
- width: 150px;
+/* 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;
}
-div.gallerytext {
- overflow: visible;
-}
+ul.gallery, li.gallerybox {
+ zoom: 1;
+ *display: inline;
+}
+
+ul.gallery {
+ margin: 2px;
+ padding: 2px;
+ display: block;
+}
+li.gallerycaption {
+ font-weight: bold;
+ text-align: center;
+ display: block;
+ word-wrap: break-word;
+}
+
+li.gallerybox div.thumb {
+ text-align: center;
+ border: 1px solid #ccc;
+ margin: 2px;
+}
+
+div.gallerytext {
+ overflow: hidden;
+ font-size: 94%;
+ padding: 2px 4px;
+ word-wrap: break-word;
+}
/*
** Diff rendering
*/
-table.diff { background:white; }
-td.diff-otitle { background:#ffffff; }
-td.diff-ntitle { background:#ffffff; }
+table.diff {
+ background: white;
+}
+td.diff-otitle {
+ background: #ffffff;
+}
+td.diff-ntitle {
+ background: #ffffff;
+}
td.diff-addedline {
- background:#ccffcc;
- font-size: smaller;
- border: solid 2px black;
+ background: #ccffcc;
+ font-size: smaller;
+ border: solid 2px black;
}
td.diff-deletedline {
- background:#ffffaa;
- font-size: smaller;
- border: dotted 2px black;
+ background: #ffffaa;
+ font-size: smaller;
+ border: dotted 2px black;
}
td.diff-context {
- background:#eeeeee;
- font-size: smaller;
+ background: #eeeeee;
+ font-size: smaller;
}
.diffchange {
- color: silver;
- font-weight: bold;
- text-decoration: underline;
+ color: silver;
+ font-weight: bold;
+ text-decoration: underline;
+}
+
+/*
+** Table rendering
+** As on shared.css but with white background.
+*/
+table.wikitable {
+ margin: 1em 1em 1em 0;
+ border: 1px #aaa solid;
+ background: white;
+ border-collapse: collapse;
+}
+.wikitable th, .wikitable td {
+ border: 1px #aaa solid;
+ padding: 0.2em;
+}
+.wikitable th {
+ text-align: center;
+ background: white;
+ font-weight: bold;
+}
+.wikitable caption {
+ font-weight: bold;
+}
+
+a.sortheader {
+ margin: 0px 0.3em;
+}
+
+/* Some pagination options */
+.wikitable, .thumb, img {
+ page-break-inside: avoid;
+}
+h2, h3, h4, h5, h6, h7 {
+ page-break-after: avoid;
+}
+p {
+ widows: 3;
+ orphans: 3;
}
diff --git a/skins/common/common_rtl.css b/skins/common/common_rtl.css
index 2e8bb980..a0c485f0 100644
--- a/skins/common/common_rtl.css
+++ b/skins/common/common_rtl.css
@@ -10,14 +10,14 @@
#preftoc li { list-style: none; }
#prefcontrol { float: right; }
fieldset.prefsection,
-fieldset.operaprefsection {
- margin-left: 0;
- margin-right: 18em;
+fieldset.operaprefsection {
+ margin-left: 0;
+ margin-right: 18em;
}
/* page history */
-#pagehistory .history-user {
- margin-right: 1.4em;
- margin-left: 0.4em;
+#pagehistory .history-user {
+ margin-right: 1.4em;
+ margin-left: 0.4em;
}
.editsection {
float: left;
diff --git a/skins/common/config-cc.css b/skins/common/config-cc.css
new file mode 100644
index 00000000..c629ad3f
--- /dev/null
+++ b/skins/common/config-cc.css
@@ -0,0 +1,56 @@
+/**
+ * Copy of CC standard stylesheet, plus tweaks for iframe usage
+ */
+
+body {
+ margin:0px;
+ background:#eee;
+ font-family:verdana;
+ color:#333;
+}
+
+#main {
+ border:1px solid #D0D0D0;
+ background:#fff;
+ margin: 0.5em;
+}
+
+/* Looks like you have to specify the width of #menu
+or IE5 Mac stretches it all the way across the div, and
+Opera streches it half way. */
+
+#main #menu {
+ border-left:1px dotted #ccc;
+ /* border-bottom:1px solid #000;*/
+ float:right;
+ width:230px;
+ background:white;
+ margin:0px 0px 10px 10px;
+}
+
+td, h3, p,h1,pre {
+ margin:0px 20px 20px 20px;
+ font-size:11px;
+ line-height:140%;
+}
+
+.header {
+ padding-left: 10px;
+ padding-top:10px;
+}
+
+.nav {
+ padding-left:10px;
+ padding-bottom:10px;
+ font-size:11px;
+ margin-bottom:16px;
+}
+
+#menu p {
+ font-size:11px;
+}
+
+.dent {
+ margin-left:64px;
+}
+
diff --git a/skins/common/config.css b/skins/common/config.css
new file mode 100644
index 00000000..341a9038
--- /dev/null
+++ b/skins/common/config.css
@@ -0,0 +1,164 @@
+.env-check {
+ font-size: 90%;
+ margin: 1em 0 1em 2.5em;
+}
+
+.config-section {
+ margin-top: 2em;
+}
+.config-block {
+ margin-top: 2em;
+ display: block;
+
+}
+.config-block-label {
+ display: block;
+ margin-bottom: .2em;
+}
+.config-block-label label, .config-label {
+ font-weight: bold;
+ padding-right: .5em;
+ padding-top: .2em;
+}
+.config-block-elements {
+ margin-left: 2em;
+}
+.config-block-elements li {
+ list-style: none;
+}
+.config-input {
+ clear: left;
+ zoom: 100%; /* IE hack */
+}
+
+.config-page-wrapper {
+ padding: 0.5em;
+}
+
+.config-page-list {
+ float: right;
+ width: 12em;
+ border: 1px solid #aaa;
+ background: #fff;
+ padding: 0.5em;
+ /* 3em left margin to leave space between the list and the page-content */
+ margin: 0.5em 0.5em 0.5em 3.5em;
+}
+
+.config-page {
+ padding: 0.5em 0.5em 0.5em 2em;
+ margin: 0.5em 0.5em 0.5em 0.5em;
+ background: #eee;
+}
+
+.config-submit {
+ clear: left;
+ text-align: center;
+ padding: 1em;
+}
+
+.config-submit input {
+ margin-left: 0.5em;
+ margin-right: 0.5em;
+}
+
+.config-page-disabled {
+ color: #aaa;
+}
+
+.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 {
+ font-weight: bold;
+}
+
+.config-message {
+ display: list-item;
+ line-height: 1.5em;
+ /* @embed */
+ list-style-image: url(images/bullet.gif);
+ list-style-type: square;
+}
+
+.config-input-text {
+ width: 20em;
+ margin-right: 1em;
+}
+
+.config-input-check {
+ margin-left: 10em;
+}
+
+.error {
+ color: red;
+ background-color: #fff;
+ font-weight: bold;
+ left: 1em;
+ font-size: 100%;
+}
+
+.config-settings-block {
+ list-style-type: none;
+ list-style-image: none;
+ float: left;
+ margin: 0;
+ padding: 0;
+}
+
+.btn-install {
+ font-weight: bold;
+ font-size: 110%;
+ padding: .2em .3em;
+}
+
+.success-message {
+ font-weight: bold;
+ font-size: 110%;
+ color: green;
+}
+.success-box {
+ font-size: 130%;
+}
+
+.config-cc-wrapper {
+ clear: left;
+ /* If you change this height, also change it in WebInstaller_Options::submitCC() */
+ height: 54em;
+}
+
+.config-plainlink a {
+ background: none !important;
+ padding: 0 !important;
+}
+
+#config-memcachewrapper {
+ display: none;
+}
+.config-download-link {
+ font-size: 1.8em;
+ margin-left: 2em;
+}
+
+#config-update-log {
+ width: 75%;
+}
diff --git a/skins/common/config.js b/skins/common/config.js
new file mode 100644
index 00000000..511966ad
--- /dev/null
+++ b/skins/common/config.js
@@ -0,0 +1,102 @@
+(function( $ ) {
+ $( document ).ready( function() {
+
+
+ // Set up the help system
+ $( '.mw-help-field-data' )
+ .hide()
+ .closest( '.mw-help-field-container' )
+ .find( '.mw-help-field-hint' )
+ .show()
+ .click( function() {
+ $(this)
+ .closest( '.mw-help-field-container' )
+ .find( '.mw-help-field-data' )
+ .slideToggle( 'fast' );
+ } );
+
+ // Show/hide code for DB-specific options
+ // FIXME: Do we want slow, fast, or even non-animated (instantaneous) showing/hiding here?
+ $( '.dbRadio' ).each( function() { $( '#' + $(this).attr( 'rel' ) ).hide(); } );
+ $( '#' + $( '.dbRadio:checked' ).attr( 'rel' ) ).show();
+ $( '.dbRadio' ).click( function() {
+ var $checked = $( '.dbRadio:checked' );
+ var $wrapper = $( '#' + $checked.attr( 'rel' ) );
+ if ( !$wrapper.is( ':visible' ) ) {
+ $( '.dbWrapper' ).hide( 'slow' );
+ $wrapper.show( 'slow' );
+ }
+ } );
+
+ // Scroll to the bottom of upgrade log
+ $( "#config-update-log" ).each( function() { this.scrollTop = this.scrollHeight; } );
+
+ // Show/hide Creative Commons thingy
+ $( '.licenseRadio' ).click( function() {
+ var $wrapper = $( '#config-cc-wrapper' );
+ if ( $( '#config__LicenseCode_cc-choose' ).is( ':checked' ) ) {
+ $wrapper.show( 'slow' );
+ } else {
+ $wrapper.hide( 'slow' );
+ }
+ } );
+
+ // Show/hide random stuff (email, upload)
+ $( '.showHideRadio' ).click( function() {
+ var $wrapper = $( '#' + $(this).attr( 'rel' ) );
+ if ( $(this).is( ':checked' ) ) {
+ $wrapper.show( 'slow' );
+ } else {
+ $wrapper.hide( 'slow' );
+ }
+ } );
+ $( '.hideShowRadio' ).click( function() {
+ var $wrapper = $( '#' + $(this).attr( 'rel' ) );
+ if ( $(this).is( ':checked' ) ) {
+ $wrapper.hide( 'slow' );
+ } else {
+ $wrapper.show( 'slow' );
+ }
+ } );
+
+ // Hide "other" textboxes by default
+ // Should not be done in CSS for javascript disabled compatibility
+ $( '.enabledByOther' ).closest( '.config-block' ).hide();
+
+ // Enable/disable "other" textboxes
+ $( '.enableForOther' ).click( function() {
+ var $textbox = $( '#' + $(this).attr( 'rel' ) );
+ if ( $(this).val() == 'other' ) { // FIXME: Ugh, this is ugly
+ $textbox.removeAttr( 'readonly' ).closest( '.config-block' ).slideDown( 'fast' );
+ } else {
+ $textbox.attr( 'readonly', 'readonly' ).closest( '.config-block' ).slideUp( 'fast' );
+ }
+ } );
+
+ // Synchronize radio button label for sitename with textbox
+ $label = $( 'label[for=config__NamespaceType_site-name]' );
+ labelText = $label.text();
+ $label.text( labelText.replace( '$1', '' ) );
+ $( '#config_wgSitename' ).bind( 'keyup change', syncText ).each( syncText );
+ function syncText() {
+ var value = $(this).val()
+ .replace( /[\[\]\{\}|#<>%+? ]/g, '_' )
+ .replace( /&/, '&amp;' )
+ .replace( /__+/g, '_' )
+ .replace( /^_+/, '' )
+ .replace( /_+$/, '' );
+ value = value.substr( 0, 1 ).toUpperCase() + value.substr( 1 );
+ $label.text( labelText.replace( '$1', value ) );
+ }
+
+ // Show/Hide memcached servers when needed
+ $("input[name$='config_wgMainCacheType']").change( function() {
+ var $memc = $( "#config-memcachewrapper" );
+ if( $( "input[name$='config_wgMainCacheType']:checked" ).val() == 'memcached' ) {
+ $memc.show( 'slow' );
+ } else {
+ $memc.hide( 'slow' );
+ }
+ } );
+ } );
+})(jQuery);
diff --git a/skins/common/diff.css b/skins/common/diff.css
index 6afa3734..80286d8e 100644
--- a/skins/common/diff.css
+++ b/skins/common/diff.css
@@ -11,9 +11,6 @@ td.diff-ntitle {
td.diff-marker {
text-align: right;
}
-.rtl td.diff-marker {
- text-align: left;
-}
td.diff-lineno {
font-weight: bold;
}
@@ -41,7 +38,7 @@ 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;
@@ -57,87 +54,22 @@ table.diff col.diff-content {
}
table.diff td div {
/* Force-wrap very long lines such as URLs or page-widening char strings.
- CSS 3 draft..., but Gecko doesn't support it yet:
- https://bugzilla.mozilla.org/show_bug.cgi?id=99457 */
+ 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; */
}
-
-/*
- * Styles for the HTML Diff
- */
-div.diff-switchtype{
- text-align: center;
- font-weight: bold;
- font-size: smaller;
-}
-
-span.diff-html-added {
- font-size: 100%;
- background-color: #20ff20
-}
-
-span.diff-html-removed {
- font-size: 100%;
- text-decoration: line-through;
- background-color: #ff2020
-}
-
-span.diff-html-changed {
- background: url(images/diffunderline.gif) bottom repeat-x;
- /* Hack for IE5.5, see http://lists.wikimedia.org/pipermail/wikitech-l/2008-November/040273.html */
- *background-color: #c6c6fd; /* light blue */
-}
-
-span.diff-html-added img{
- border: 5px solid #ccffcc;
-}
-
-span.diff-html-removed img{
- border: 5px solid #fdc6c6;
-}
-
-span.diff-html-changed img{
- border: 5px dotted #000099;
-
-}
-
-span.diff-html-changed {
- position: relative; /* this is key */
- cursor: help;
-}
-
-span.diff-html-changed span.tip {
- display: none; /* so is this */
-}
-
-/* tooltip will display on :hover event */
-
-span.diff-html-changed:hover span.tip {
- display: block;
- z-index: 95;
- position: absolute;
- top: 2.5em;
- left: 0;
- width: auto;
- line-height: 1.2em;
- padding: 3px 7px 4px 6px;
- border: 1px solid #336;
- background-color: #f7f7ee;
- font-size: 10px;
- text-align: left;
-}
-
-
diff --git a/skins/common/edit.js b/skins/common/edit.js
index 423205f8..f986c854 100644
--- a/skins/common/edit.js
+++ b/skins/common/edit.js
@@ -1,8 +1,7 @@
-var currentFocused;
+window.currentFocused = undefined;
-// 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 ) {
+// 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({
@@ -13,11 +12,10 @@ function addButton( imageFile, speedTip, tagOpen, tagClose, sampleText, imageId
'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 ) {
+// 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;
@@ -33,17 +31,19 @@ function mwInsertEditButton( parent, item ) {
image.onclick = function() {
insertTags( item.tagOpen, item.tagClose, item.sampleText );
// click tracking
- if ( ( typeof $j != 'undefined' ) && ( typeof $j.trackAction != 'undefined' ) ) {
- $j.trackAction( 'oldedit.' + item.speedTip.replace(/ /g, "-") );
+ if ( ( typeof $ != 'undefined' ) && ( typeof $.trackAction != 'undefined' ) ) {
+ $.trackAction( 'oldedit.' + item.speedTip.replace(/ /g, "-") );
}
return false;
};
parent.appendChild( image );
return true;
-}
+};
-function mwSetupToolbar() {
+// 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;
@@ -73,14 +73,14 @@ function mwSetupToolbar() {
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 ) {
- if ( typeof $j != 'undefined' && typeof $j.fn.textSelection != 'undefined' &&
+window.insertTags = function( tagOpen, tagClose, sampleText ) {
+ if ( typeof $ != 'undefined' && typeof $.fn.textSelection != 'undefined' && currentFocused &&
( currentFocused.nodeName.toLowerCase() == 'iframe' || currentFocused.id == 'wpTextbox1' ) ) {
- $j( '#wpTextbox1' ).textSelection(
+ $( '#wpTextbox1' ).textSelection(
'encapsulateSelection', { 'pre': tagOpen, 'peri': sampleText, 'post': tagClose }
);
return;
@@ -160,13 +160,13 @@ function insertTags( tagOpen, tagClose, sampleText ) {
}
}
-}
+};
/**
* Restore the edit box scroll state following a preview operation,
* and set up a form submission handler to remember this state
*/
-function scrollEditBox() {
+window.scrollEditBox = function() {
var editBox = document.getElementById( 'wpTextbox1' );
var scrollTop = document.getElementById( 'wpScrolltop' );
var editForm = document.getElementById( 'editform' );
@@ -178,7 +178,7 @@ function scrollEditBox() {
scrollTop.value = editBox.scrollTop;
} );
}
-}
+};
hookEvent( 'load', scrollEditBox );
hookEvent( 'load', mwSetupToolbar );
hookEvent( 'load', function() {
@@ -217,10 +217,10 @@ hookEvent( 'load', function() {
// 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 ( typeof $ != 'undefined' ) {
+ var iframe = $( '.wikiEditor-ui-text iframe' );
if ( iframe.length > 0 ) {
- $j( iframe.get( 0 ).contentWindow.document )
+ $( iframe.get( 0 ).contentWindow.document )
.add( iframe.get( 0 ).contentWindow.document.body ) // for IE
.focus( function() { currentFocused = iframe.get( 0 ); } );
}
diff --git a/skins/common/enhancedchanges.js b/skins/common/enhancedchanges.js
index b1789c9e..bcc2cc88 100644
--- a/skins/common/enhancedchanges.js
+++ b/skins/common/enhancedchanges.js
@@ -24,7 +24,7 @@ appendCSS('.mw-changeslist-hidden {'+
* Switch an RC line between hidden/shown
* @param int idNumber : the id number of the RC group
*/
-function toggleVisibility(idNumber) {
+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);
@@ -37,4 +37,4 @@ function toggleVisibility(idNumber) {
closearrow.className = 'mw-changeslist-hidden';
subentries.className = 'mw-changeslist-hidden';
}
-}
+};
diff --git a/skins/common/history.js b/skins/common/history.js
index 02651225..33845a75 100644
--- a/skins/common/history.js
+++ b/skins/common/history.js
@@ -1,4 +1,4 @@
-function historyRadios(parent) {
+window.historyRadios = function(parent) {
var inputs = parent.getElementsByTagName('input');
var radios = [];
for (var i = 0; i < inputs.length; i++) {
@@ -7,10 +7,10 @@ function historyRadios(parent) {
}
}
return radios;
-}
+};
// check selection and tweak visibility/class onclick
-function diffcheck() {
+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');
@@ -74,21 +74,4 @@ function diffcheck() {
}
}
return true;
-}
-
-// Attach event handlers to the input elements on history page
-function histrowinit() {
- var hf = document.getElementById('pagehistory');
- if (!hf) return;
- var lis = hf.getElementsByTagName('li');
- for (var i = 0; i < lis.length; i++) {
- var inputs = historyRadios(lis[i]);
- if (inputs[0] && inputs[1]) {
- inputs[0].onclick = diffcheck;
- inputs[1].onclick = diffcheck;
- }
- }
- diffcheck();
-}
-
-hookEvent("load", histrowinit);
+};
diff --git a/skins/common/htmlform.js b/skins/common/htmlform.js
index 2045ab48..900b1660 100644
--- a/skins/common/htmlform.js
+++ b/skins/common/htmlform.js
@@ -12,7 +12,7 @@ addOnloadHook( function() {
}
} );
-var htmlforms = {
+window.htmlforms = {
'selectOrOtherSelectChanged' : function( e ) {
var select;
if ( !e ) {
@@ -36,5 +36,5 @@ var htmlforms = {
textbox.disabled = true;
}
}
-}
+};
diff --git a/skins/common/images/Arr_d.png b/skins/common/images/Arr_d.png
index 421dd101..58a9fc66 100644
--- a/skins/common/images/Arr_d.png
+++ b/skins/common/images/Arr_d.png
Binary files differ
diff --git a/skins/common/images/Arr_l.png b/skins/common/images/Arr_l.png
index 9db66232..f49e20a2 100644
--- a/skins/common/images/Arr_l.png
+++ b/skins/common/images/Arr_l.png
Binary files differ
diff --git a/skins/common/images/Arr_r.png b/skins/common/images/Arr_r.png
index d1b161b0..467a555a 100644
--- a/skins/common/images/Arr_r.png
+++ b/skins/common/images/Arr_r.png
Binary files differ
diff --git a/skins/common/images/Arr_u.png b/skins/common/images/Arr_u.png
index 75909865..957f8612 100644
--- a/skins/common/images/Arr_u.png
+++ b/skins/common/images/Arr_u.png
Binary files differ
diff --git a/skins/common/images/add.png b/skins/common/images/add.png
index 5b051f64..3418db2c 100644
--- a/skins/common/images/add.png
+++ b/skins/common/images/add.png
Binary files differ
diff --git a/skins/common/images/ar/button_bold.png b/skins/common/images/ar/button_bold.png
index 93b1783c..619cd21e 100644
--- a/skins/common/images/ar/button_bold.png
+++ b/skins/common/images/ar/button_bold.png
Binary files differ
diff --git a/skins/common/images/ar/button_headline.png b/skins/common/images/ar/button_headline.png
index 3cf2a706..f1480a66 100644
--- a/skins/common/images/ar/button_headline.png
+++ b/skins/common/images/ar/button_headline.png
Binary files differ
diff --git a/skins/common/images/ar/button_italic.png b/skins/common/images/ar/button_italic.png
index 0421846d..21245978 100644
--- a/skins/common/images/ar/button_italic.png
+++ b/skins/common/images/ar/button_italic.png
Binary files differ
diff --git a/skins/common/images/ar/button_link.png b/skins/common/images/ar/button_link.png
index ed66a7f6..a68144f3 100644
--- a/skins/common/images/ar/button_link.png
+++ b/skins/common/images/ar/button_link.png
Binary files differ
diff --git a/skins/common/images/ar/button_nowiki.png b/skins/common/images/ar/button_nowiki.png
index 97d0585a..88ab9a13 100644
--- a/skins/common/images/ar/button_nowiki.png
+++ b/skins/common/images/ar/button_nowiki.png
Binary files differ
diff --git a/skins/common/images/arrow_disabled_first_25.png b/skins/common/images/arrow_disabled_first_25.png
index aaa4bec4..dd55a9c0 100644
--- a/skins/common/images/arrow_disabled_first_25.png
+++ b/skins/common/images/arrow_disabled_first_25.png
Binary files differ
diff --git a/skins/common/images/arrow_disabled_last_25.png b/skins/common/images/arrow_disabled_last_25.png
index 7882fd8c..fd24cd10 100644
--- a/skins/common/images/arrow_disabled_last_25.png
+++ b/skins/common/images/arrow_disabled_last_25.png
Binary files differ
diff --git a/skins/common/images/arrow_disabled_left_25.png b/skins/common/images/arrow_disabled_left_25.png
index e0c30042..a450a5ee 100644
--- a/skins/common/images/arrow_disabled_left_25.png
+++ b/skins/common/images/arrow_disabled_left_25.png
Binary files differ
diff --git a/skins/common/images/arrow_disabled_right_25.png b/skins/common/images/arrow_disabled_right_25.png
index bfec3e24..d110ad8f 100644
--- a/skins/common/images/arrow_disabled_right_25.png
+++ b/skins/common/images/arrow_disabled_right_25.png
Binary files differ
diff --git a/skins/common/images/arrow_first_25.png b/skins/common/images/arrow_first_25.png
index b6351c50..ec47aa9a 100644
--- a/skins/common/images/arrow_first_25.png
+++ b/skins/common/images/arrow_first_25.png
Binary files differ
diff --git a/skins/common/images/arrow_last_25.png b/skins/common/images/arrow_last_25.png
index d416ab39..15e18f95 100644
--- a/skins/common/images/arrow_last_25.png
+++ b/skins/common/images/arrow_last_25.png
Binary files differ
diff --git a/skins/common/images/arrow_left_25.png b/skins/common/images/arrow_left_25.png
index fd05fa6f..ecd33102 100644
--- a/skins/common/images/arrow_left_25.png
+++ b/skins/common/images/arrow_left_25.png
Binary files differ
diff --git a/skins/common/images/arrow_right_25.png b/skins/common/images/arrow_right_25.png
index cf1845c6..64a3c4ee 100644
--- a/skins/common/images/arrow_right_25.png
+++ b/skins/common/images/arrow_right_25.png
Binary files differ
diff --git a/skins/common/images/be-tarask/button_italic.png b/skins/common/images/be-tarask/button_italic.png
index d93e9f87..99972127 100644
--- a/skins/common/images/be-tarask/button_italic.png
+++ b/skins/common/images/be-tarask/button_italic.png
Binary files differ
diff --git a/skins/common/images/be-tarask/button_link.png b/skins/common/images/be-tarask/button_link.png
index 07bc6a19..b87f245b 100644
--- a/skins/common/images/be-tarask/button_link.png
+++ b/skins/common/images/be-tarask/button_link.png
Binary files differ
diff --git a/skins/common/images/button_bold.png b/skins/common/images/button_bold.png
index 2827dba0..eeb91c30 100644
--- a/skins/common/images/button_bold.png
+++ b/skins/common/images/button_bold.png
Binary files differ
diff --git a/skins/common/images/button_extlink.png b/skins/common/images/button_extlink.png
index e551e47e..fdc77acd 100644
--- a/skins/common/images/button_extlink.png
+++ b/skins/common/images/button_extlink.png
Binary files differ
diff --git a/skins/common/images/button_headline.png b/skins/common/images/button_headline.png
index 9867c365..29966703 100644
--- a/skins/common/images/button_headline.png
+++ b/skins/common/images/button_headline.png
Binary files differ
diff --git a/skins/common/images/button_hr.png b/skins/common/images/button_hr.png
index 7f21402a..55f6001a 100644
--- a/skins/common/images/button_hr.png
+++ b/skins/common/images/button_hr.png
Binary files differ
diff --git a/skins/common/images/button_image.png b/skins/common/images/button_image.png
index abd47dde..a3f1ef60 100644
--- a/skins/common/images/button_image.png
+++ b/skins/common/images/button_image.png
Binary files differ
diff --git a/skins/common/images/button_italic.png b/skins/common/images/button_italic.png
index f248fa93..7074050c 100644
--- a/skins/common/images/button_italic.png
+++ b/skins/common/images/button_italic.png
Binary files differ
diff --git a/skins/common/images/button_link.png b/skins/common/images/button_link.png
index cc72b523..486c1e87 100644
--- a/skins/common/images/button_link.png
+++ b/skins/common/images/button_link.png
Binary files differ
diff --git a/skins/common/images/button_media.png b/skins/common/images/button_media.png
index 56b1b239..00d29766 100644
--- a/skins/common/images/button_media.png
+++ b/skins/common/images/button_media.png
Binary files differ
diff --git a/skins/common/images/button_nowiki.png b/skins/common/images/button_nowiki.png
index 321a2cb4..dcad330d 100644
--- a/skins/common/images/button_nowiki.png
+++ b/skins/common/images/button_nowiki.png
Binary files differ
diff --git a/skins/common/images/button_sig.png b/skins/common/images/button_sig.png
index 39de3b67..fa2af657 100644
--- a/skins/common/images/button_sig.png
+++ b/skins/common/images/button_sig.png
Binary files differ
diff --git a/skins/common/images/button_template.png b/skins/common/images/button_template.png
index ebbca3cf..576874ce 100644
--- a/skins/common/images/button_template.png
+++ b/skins/common/images/button_template.png
Binary files differ
diff --git a/skins/common/images/cc-by-nc-sa.png b/skins/common/images/cc-by-nc-sa.png
new file mode 100644
index 00000000..d15370de
--- /dev/null
+++ b/skins/common/images/cc-by-nc-sa.png
Binary files differ
diff --git a/skins/common/images/cc-by-sa.png b/skins/common/images/cc-by-sa.png
new file mode 100644
index 00000000..ee07a661
--- /dev/null
+++ b/skins/common/images/cc-by-sa.png
Binary files differ
diff --git a/skins/common/images/closewindow.png b/skins/common/images/closewindow.png
new file mode 100644
index 00000000..99ae141f
--- /dev/null
+++ b/skins/common/images/closewindow.png
Binary files differ
diff --git a/skins/common/images/critical-32.png b/skins/common/images/critical-32.png
new file mode 100644
index 00000000..8f65041e
--- /dev/null
+++ b/skins/common/images/critical-32.png
Binary files differ
diff --git a/skins/common/images/cyrl/button_italic.png b/skins/common/images/cyrl/button_italic.png
index f79170fd..46e6737a 100644
--- a/skins/common/images/cyrl/button_italic.png
+++ b/skins/common/images/cyrl/button_italic.png
Binary files differ
diff --git a/skins/common/images/de/button_bold.png b/skins/common/images/de/button_bold.png
index 32a22800..3ce6f38e 100644
--- a/skins/common/images/de/button_bold.png
+++ b/skins/common/images/de/button_bold.png
Binary files differ
diff --git a/skins/common/images/de/button_italic.png b/skins/common/images/de/button_italic.png
index 875eb2a1..af7b6d27 100644
--- a/skins/common/images/de/button_italic.png
+++ b/skins/common/images/de/button_italic.png
Binary files differ
diff --git a/skins/common/images/download-32.png b/skins/common/images/download-32.png
new file mode 100644
index 00000000..0087e10d
--- /dev/null
+++ b/skins/common/images/download-32.png
Binary files differ
diff --git a/skins/common/images/fa/button_bold.png b/skins/common/images/fa/button_bold.png
index 49680152..25fca045 100644
--- a/skins/common/images/fa/button_bold.png
+++ b/skins/common/images/fa/button_bold.png
Binary files differ
diff --git a/skins/common/images/fa/button_headline.png b/skins/common/images/fa/button_headline.png
index 9d62767e..831a4bef 100644
--- a/skins/common/images/fa/button_headline.png
+++ b/skins/common/images/fa/button_headline.png
Binary files differ
diff --git a/skins/common/images/fa/button_italic.png b/skins/common/images/fa/button_italic.png
index fc9faf3d..273ab247 100644
--- a/skins/common/images/fa/button_italic.png
+++ b/skins/common/images/fa/button_italic.png
Binary files differ
diff --git a/skins/common/images/fa/button_link.png b/skins/common/images/fa/button_link.png
index de56a5c3..345271aa 100644
--- a/skins/common/images/fa/button_link.png
+++ b/skins/common/images/fa/button_link.png
Binary files differ
diff --git a/skins/common/images/fa/button_nowiki.png b/skins/common/images/fa/button_nowiki.png
index 97d0585a..88ab9a13 100644
--- a/skins/common/images/fa/button_nowiki.png
+++ b/skins/common/images/fa/button_nowiki.png
Binary files differ
diff --git a/skins/common/images/gnu-fdl.png b/skins/common/images/gnu-fdl.png
index 10915329..b599c2fa 100644
--- a/skins/common/images/gnu-fdl.png
+++ b/skins/common/images/gnu-fdl.png
Binary files differ
diff --git a/skins/common/images/help-question-hover.gif b/skins/common/images/help-question-hover.gif
new file mode 100644
index 00000000..515138db
--- /dev/null
+++ b/skins/common/images/help-question-hover.gif
Binary files differ
diff --git a/skins/common/images/help-question.gif b/skins/common/images/help-question.gif
new file mode 100644
index 00000000..b4fc9c5b
--- /dev/null
+++ b/skins/common/images/help-question.gif
Binary files differ
diff --git a/skins/common/images/icons/fileicon-c.png b/skins/common/images/icons/fileicon-c.png
index f7984fa0..fdd06989 100644
--- a/skins/common/images/icons/fileicon-c.png
+++ b/skins/common/images/icons/fileicon-c.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-cpp.png b/skins/common/images/icons/fileicon-cpp.png
index 0a9b4cbc..d11d827e 100644
--- a/skins/common/images/icons/fileicon-cpp.png
+++ b/skins/common/images/icons/fileicon-cpp.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-deb.png b/skins/common/images/icons/fileicon-deb.png
index 605bea17..b52a4eba 100644
--- a/skins/common/images/icons/fileicon-deb.png
+++ b/skins/common/images/icons/fileicon-deb.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-djvu.png b/skins/common/images/icons/fileicon-djvu.png
index 3eaca1f8..b93b3f20 100644
--- a/skins/common/images/icons/fileicon-djvu.png
+++ b/skins/common/images/icons/fileicon-djvu.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-dvi.png b/skins/common/images/icons/fileicon-dvi.png
index 790ec41b..ab6a51f2 100644
--- a/skins/common/images/icons/fileicon-dvi.png
+++ b/skins/common/images/icons/fileicon-dvi.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-exe.png b/skins/common/images/icons/fileicon-exe.png
index f310ad0d..cc1aae51 100644
--- a/skins/common/images/icons/fileicon-exe.png
+++ b/skins/common/images/icons/fileicon-exe.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-h.png b/skins/common/images/icons/fileicon-h.png
index cf158528..73a547e5 100644
--- a/skins/common/images/icons/fileicon-h.png
+++ b/skins/common/images/icons/fileicon-h.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-html.png b/skins/common/images/icons/fileicon-html.png
index 1c3a1588..09e31f1a 100644
--- a/skins/common/images/icons/fileicon-html.png
+++ b/skins/common/images/icons/fileicon-html.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-iso.png b/skins/common/images/icons/fileicon-iso.png
index 74b06615..2cddf489 100644
--- a/skins/common/images/icons/fileicon-iso.png
+++ b/skins/common/images/icons/fileicon-iso.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-java.png b/skins/common/images/icons/fileicon-java.png
index 730ab232..c26b3f2c 100644
--- a/skins/common/images/icons/fileicon-java.png
+++ b/skins/common/images/icons/fileicon-java.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-mid.png b/skins/common/images/icons/fileicon-mid.png
index 5254418e..4143e8bb 100644
--- a/skins/common/images/icons/fileicon-mid.png
+++ b/skins/common/images/icons/fileicon-mid.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-o.png b/skins/common/images/icons/fileicon-o.png
index 24ac2cc5..872a6548 100644
--- a/skins/common/images/icons/fileicon-o.png
+++ b/skins/common/images/icons/fileicon-o.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-ogg.png b/skins/common/images/icons/fileicon-ogg.png
index c50d1ee8..2c935e2a 100644
--- a/skins/common/images/icons/fileicon-ogg.png
+++ b/skins/common/images/icons/fileicon-ogg.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-pdf.png b/skins/common/images/icons/fileicon-pdf.png
index c195c761..a19b16f3 100644
--- a/skins/common/images/icons/fileicon-pdf.png
+++ b/skins/common/images/icons/fileicon-pdf.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-ps.png b/skins/common/images/icons/fileicon-ps.png
index 342a84ee..ec1145be 100644
--- a/skins/common/images/icons/fileicon-ps.png
+++ b/skins/common/images/icons/fileicon-ps.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-rm.png b/skins/common/images/icons/fileicon-rm.png
index 534dbeb2..b803e055 100644
--- a/skins/common/images/icons/fileicon-rm.png
+++ b/skins/common/images/icons/fileicon-rm.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-rpm.png b/skins/common/images/icons/fileicon-rpm.png
index aab3ec39..e1ff985f 100644
--- a/skins/common/images/icons/fileicon-rpm.png
+++ b/skins/common/images/icons/fileicon-rpm.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-svg.png b/skins/common/images/icons/fileicon-svg.png
index 16a666f3..23b675a2 100644
--- a/skins/common/images/icons/fileicon-svg.png
+++ b/skins/common/images/icons/fileicon-svg.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-tar.png b/skins/common/images/icons/fileicon-tar.png
index 7266b5b5..7c7a910b 100644
--- a/skins/common/images/icons/fileicon-tar.png
+++ b/skins/common/images/icons/fileicon-tar.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-tex.png b/skins/common/images/icons/fileicon-tex.png
index 55187918..6f782647 100644
--- a/skins/common/images/icons/fileicon-tex.png
+++ b/skins/common/images/icons/fileicon-tex.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-ttf.png b/skins/common/images/icons/fileicon-ttf.png
index 13bd7ced..f5dc07a1 100644
--- a/skins/common/images/icons/fileicon-ttf.png
+++ b/skins/common/images/icons/fileicon-ttf.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon-txt.png b/skins/common/images/icons/fileicon-txt.png
index bec58b4e..1b611016 100644
--- a/skins/common/images/icons/fileicon-txt.png
+++ b/skins/common/images/icons/fileicon-txt.png
Binary files differ
diff --git a/skins/common/images/icons/fileicon.png b/skins/common/images/icons/fileicon.png
index 5675170b..9d8e3222 100644
--- a/skins/common/images/icons/fileicon.png
+++ b/skins/common/images/icons/fileicon.png
Binary files differ
diff --git a/skins/common/images/info-32.png b/skins/common/images/info-32.png
new file mode 100644
index 00000000..ecefa9a6
--- /dev/null
+++ b/skins/common/images/info-32.png
Binary files differ
diff --git a/skins/common/images/ksh/button_S_italic.png b/skins/common/images/ksh/button_S_italic.png
index 00000a3c..6ef742a7 100644
--- a/skins/common/images/ksh/button_S_italic.png
+++ b/skins/common/images/ksh/button_S_italic.png
Binary files differ
diff --git a/skins/common/images/mediawiki.png b/skins/common/images/mediawiki.png
index 0f35886a..915f847d 100644
--- a/skins/common/images/mediawiki.png
+++ b/skins/common/images/mediawiki.png
Binary files differ
diff --git a/skins/common/images/poweredby_mediawiki_88x31.png b/skins/common/images/poweredby_mediawiki_88x31.png
index 3714414f..835e860b 100644
--- a/skins/common/images/poweredby_mediawiki_88x31.png
+++ b/skins/common/images/poweredby_mediawiki_88x31.png
Binary files differ
diff --git a/skins/common/images/public-domain.png b/skins/common/images/public-domain.png
index f51f5602..296e66c8 100644
--- a/skins/common/images/public-domain.png
+++ b/skins/common/images/public-domain.png
Binary files differ
diff --git a/skins/common/images/redirectltr.png b/skins/common/images/redirectltr.png
index bcf5742c..0c731b6c 100644
--- a/skins/common/images/redirectltr.png
+++ b/skins/common/images/redirectltr.png
Binary files differ
diff --git a/skins/common/images/redirectrtl.png b/skins/common/images/redirectrtl.png
index 8d99841a..ad0a12d1 100644
--- a/skins/common/images/redirectrtl.png
+++ b/skins/common/images/redirectrtl.png
Binary files differ
diff --git a/skins/common/images/remove.png b/skins/common/images/remove.png
index 0cbf7d73..ba2c147d 100644
--- a/skins/common/images/remove.png
+++ b/skins/common/images/remove.png
Binary files differ
diff --git a/skins/common/images/tick-32.png b/skins/common/images/tick-32.png
new file mode 100644
index 00000000..584cef22
--- /dev/null
+++ b/skins/common/images/tick-32.png
Binary files differ
diff --git a/skins/common/images/tipsy-arrow.gif b/skins/common/images/tipsy-arrow.gif
new file mode 100644
index 00000000..9f1a15b6
--- /dev/null
+++ b/skins/common/images/tipsy-arrow.gif
Binary files differ
diff --git a/skins/common/images/tooltip_icon.png b/skins/common/images/tooltip_icon.png
index 6b3160ec..17bc2e14 100644
--- a/skins/common/images/tooltip_icon.png
+++ b/skins/common/images/tooltip_icon.png
Binary files differ
diff --git a/skins/common/images/warning-32.png b/skins/common/images/warning-32.png
new file mode 100644
index 00000000..aa6b298b
--- /dev/null
+++ b/skins/common/images/warning-32.png
Binary files differ
diff --git a/skins/common/images/wiki.png b/skins/common/images/wiki.png
index 4f1dc263..4ca6efd6 100644
--- a/skins/common/images/wiki.png
+++ b/skins/common/images/wiki.png
Binary files differ
diff --git a/skins/common/jquery.js b/skins/common/jquery.js
deleted file mode 100644
index c25ee31c..00000000
--- a/skins/common/jquery.js
+++ /dev/null
@@ -1,4384 +0,0 @@
-/*!
- * 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 + "></" + tag + ">";
- });
-
- // 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("<opt") &&
- [ 1, "<select multiple='multiple'>", "</select>" ] ||
-
- !tags.indexOf("<leg") &&
- [ 1, "<fieldset>", "</fieldset>" ] ||
-
- tags.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
- [ 1, "<table>", "</table>" ] ||
-
- !tags.indexOf("<tr") &&
- [ 2, "<table><tbody>", "</tbody></table>" ] ||
-
- // <thead> matched above
- (!tags.indexOf("<td") || !tags.indexOf("<th")) &&
- [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ] ||
-
- !tags.indexOf("<col") &&
- [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ] ||
-
- // IE can't serialize <link> and <script> tags normally
- !jQuery.support.htmlSerialize &&
- [ 1, "div<div>", "</div>" ] ||
-
- [ 0, "", "" ];
-
- // Go to html and back, then peel off extra wrappers
- div.innerHTML = wrap[1] + elem + wrap[2];
-
- // Move to the right depth
- while ( wrap[0]-- )
- div = div.lastChild;
-
- // Remove IE's autoinserted <tbody> from table fragments
- if ( !jQuery.support.tbody ) {
-
- // String was a <table>, *may* have spurious <tbody>
- var hasBody = /<tbody/i.test(elem),
- tbody = !tags.indexOf("<table") && !hasBody ?
- div.firstChild && div.firstChild.childNodes :
-
- // String was a bare <thead> or <tfoot>
- wrap[1] == "<table>" && !hasBody ?
- div.childNodes :
- [];
-
- for ( var j = tbody.length - 1; j >= 0 ; --j )
- if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length )
- tbody[ j ].parentNode.removeChild( tbody[ j ] );
-
- }
-
- // IE completely kills leading whitespace when innerHTML is used
- if ( !jQuery.support.leadingWhitespace && /^\s/.test( elem ) )
- div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild );
-
- elem = jQuery.makeArray( div.childNodes );
- }
-
- if ( elem.nodeType )
- ret.push( elem );
- else
- ret = jQuery.merge( ret, elem );
-
- });
-
- if ( fragment ) {
- for ( var i = 0; ret[i]; i++ ) {
- if ( jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
- scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
- } else {
- if ( ret[i].nodeType === 1 )
- ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
- fragment.appendChild( ret[i] );
- }
- }
-
- return scripts;
- }
-
- return ret;
- },
-
- attr: function( elem, name, value ) {
- // don't set attributes on text and comment nodes
- if (!elem || elem.nodeType == 3 || elem.nodeType == 8)
- return undefined;
-
- var notxml = !jQuery.isXMLDoc( elem ),
- // Whether we are setting (or getting)
- set = value !== undefined;
-
- // Try to normalize/fix the name
- name = notxml && jQuery.props[ name ] || name;
-
- // Only do all the following if this is a node (faster for style)
- // IE elem.getAttribute passes even for style
- if ( elem.tagName ) {
-
- // These attributes require special treatment
- var special = /href|src|style/.test( name );
-
- // Safari mis-reports the default selected property of a hidden option
- // Accessing the parent's selectedIndex property fixes it
- if ( name == "selected" && elem.parentNode )
- elem.parentNode.selectedIndex;
-
- // If applicable, access the attribute via the DOM 0 way
- if ( name in elem && notxml && !special ) {
- if ( set ){
- // We can't allow the type property to be changed (since it causes problems in IE)
- if ( name == "type" && jQuery.nodeName( elem, "input" ) && elem.parentNode )
- throw "type property can't be changed";
-
- elem[ name ] = value;
- }
-
- // browsers index elements by id/name on forms, give priority to attributes.
- if( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) )
- return elem.getAttributeNode( name ).nodeValue;
-
- // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
- // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
- if ( name == "tabIndex" ) {
- var attributeNode = elem.getAttributeNode( "tabIndex" );
- return attributeNode && attributeNode.specified
- ? attributeNode.value
- : elem.nodeName.match(/(button|input|object|select|textarea)/i)
- ? 0
- : elem.nodeName.match(/^(a|area)$/i) && elem.href
- ? 0
- : undefined;
- }
-
- return elem[ name ];
- }
-
- if ( !jQuery.support.style && notxml && name == "style" )
- return jQuery.attr( elem.style, "cssText", value );
-
- if ( set )
- // convert the value to a string (all browsers do this but IE) see #1070
- elem.setAttribute( name, "" + value );
-
- var attr = !jQuery.support.hrefNormalized && notxml && special
- // Some attributes require a special call on IE
- ? elem.getAttribute( name, 2 )
- : elem.getAttribute( name );
-
- // Non-existent attributes return null, we normalize to undefined
- return attr === null ? undefined : attr;
- }
-
- // elem is actually elem.style ... set the style
-
- // IE uses filters for opacity
- if ( !jQuery.support.opacity && name == "opacity" ) {
- if ( set ) {
- // IE has trouble with opacity if it does not have layout
- // Force it by setting the zoom level
- elem.zoom = 1;
-
- // Set the alpha filter to set the opacity
- elem.filter = (elem.filter || "").replace( /alpha\([^)]*\)/, "" ) +
- (parseInt( value ) + '' == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
- }
-
- return elem.filter && elem.filter.indexOf("opacity=") >= 0 ?
- (parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '':
- "";
- }
-
- name = name.replace(/-([a-z])/ig, function(all, letter){
- return letter.toUpperCase();
- });
-
- if ( set && value != 'NaNpx' && value != 'nullpx' ) // Patched by Trevor, see http://is.gd/5NXiD
- elem[ name ] = value;
-
- return elem[ name ];
- },
-
- trim: function( text ) {
- return (text || "").replace( /^\s+|\s+$/g, "" );
- },
-
- makeArray: function( array ) {
- var ret = [];
-
- if( array != null ){
- var i = array.length;
- // The window, strings (and functions) also have 'length'
- if( i == null || typeof array === "string" || jQuery.isFunction(array) || array.setInterval )
- ret[0] = array;
- else
- while( i )
- ret[--i] = array[i];
- }
-
- return ret;
- },
-
- inArray: function( elem, array ) {
- for ( var i = 0, length = array.length; i < length; i++ )
- // Use === because on IE, window == document
- if ( array[ i ] === elem )
- return i;
-
- return -1;
- },
-
- merge: function( first, second ) {
- // We have to loop this way because IE & Opera overwrite the length
- // expando of getElementsByTagName
- var i = 0, elem, pos = first.length;
- // Also, we need to make sure that the correct elements are being returned
- // (IE returns comment nodes in a '*' query)
- if ( !jQuery.support.getAll ) {
- while ( (elem = second[ i++ ]) != null )
- if ( elem.nodeType != 8 )
- first[ pos++ ] = elem;
-
- } else
- while ( (elem = second[ i++ ]) != null )
- first[ pos++ ] = elem;
-
- return first;
- },
-
- unique: function( array ) {
- var ret = [], done = {};
-
- try {
-
- for ( var i = 0, length = array.length; i < length; i++ ) {
- var id = jQuery.data( array[ i ] );
-
- if ( !done[ id ] ) {
- done[ id ] = true;
- ret.push( array[ i ] );
- }
- }
-
- } catch( e ) {
- ret = array;
- }
-
- return ret;
- },
-
- grep: function( elems, callback, inv ) {
- var ret = [];
-
- // Go through the array, only saving the items
- // that pass the validator function
- for ( var i = 0, length = elems.length; i < length; i++ )
- if ( !inv != !callback( elems[ i ], i ) )
- ret.push( elems[ i ] );
-
- return ret;
- },
-
- map: function( elems, callback ) {
- var ret = [];
-
- // Go through the array, translating each of the items to their
- // new value (or values).
- for ( var i = 0, length = elems.length; i < length; i++ ) {
- var value = callback( elems[ i ], i );
-
- if ( value != null )
- ret[ ret.length ] = value;
- }
-
- return ret.concat.apply( [], ret );
- }
-});
-
-// Use of jQuery.browser is deprecated.
-// It's included for backwards compatibility and plugins,
-// although they should work to migrate away.
-
-var userAgent = navigator.userAgent.toLowerCase();
-
-// Figure out what browser is being used
-jQuery.browser = {
- version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
- safari: /webkit/.test( userAgent ),
- opera: /opera/.test( userAgent ),
- msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
- mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
-};
-
-jQuery.each({
- parent: function(elem){return elem.parentNode;},
- parents: function(elem){return jQuery.dir(elem,"parentNode");},
- next: function(elem){return jQuery.nth(elem,2,"nextSibling");},
- prev: function(elem){return jQuery.nth(elem,2,"previousSibling");},
- nextAll: function(elem){return jQuery.dir(elem,"nextSibling");},
- prevAll: function(elem){return jQuery.dir(elem,"previousSibling");},
- siblings: function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},
- children: function(elem){return jQuery.sibling(elem.firstChild);},
- contents: function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}
-}, function(name, fn){
- jQuery.fn[ name ] = function( selector ) {
- var ret = jQuery.map( this, fn );
-
- if ( selector && typeof selector == "string" )
- ret = jQuery.multiFilter( selector, ret );
-
- return this.pushStack( jQuery.unique( ret ), name, selector );
- };
-});
-
-jQuery.each({
- appendTo: "append",
- prependTo: "prepend",
- insertBefore: "before",
- insertAfter: "after",
- replaceAll: "replaceWith"
-}, function(name, original){
- jQuery.fn[ name ] = function( selector ) {
- var ret = [], insert = jQuery( selector );
-
- for ( var i = 0, l = insert.length; i < l; i++ ) {
- var elems = (i > 0 ? this.clone(true) : this).get();
- jQuery.fn[ original ].apply( jQuery(insert[i]), elems );
- ret = ret.concat( elems );
- }
-
- return this.pushStack( ret, name, selector );
- };
-});
-
-jQuery.each({
- removeAttr: function( name ) {
- jQuery.attr( this, name, "" );
- if (this.nodeType == 1)
- this.removeAttribute( name );
- },
-
- addClass: function( classNames ) {
- jQuery.className.add( this, classNames );
- },
-
- removeClass: function( classNames ) {
- jQuery.className.remove( this, classNames );
- },
-
- toggleClass: function( classNames, state ) {
- if( typeof state !== "boolean" )
- state = !jQuery.className.has( this, classNames );
- jQuery.className[ state ? "add" : "remove" ]( this, classNames );
- },
-
- remove: function( selector ) {
- if ( !selector || jQuery.filter( selector, [ this ] ).length ) {
- // Prevent memory leaks
- jQuery( "*", this ).add([this]).each(function(){
- jQuery.event.remove(this);
- jQuery.removeData(this);
- });
- if (this.parentNode)
- this.parentNode.removeChild( this );
- }
- },
-
- empty: function() {
- // Remove element nodes and prevent memory leaks
- jQuery(this).children().remove();
-
- // Remove any remaining nodes
- while ( this.firstChild )
- this.removeChild( this.firstChild );
- }
-}, function(name, fn){
- jQuery.fn[ name ] = function(){
- return this.each( fn, arguments );
- };
-});
-
-// Helper function used by the dimensions and offset modules
-function num(elem, prop) {
- return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;
-}
-var expando = "jQuery" + now(), uuid = 0, windowData = {};
-
-jQuery.extend({
- cache: {},
-
- data: function( elem, name, data ) {
- elem = elem == window ?
- windowData :
- elem;
-
- var id = elem[ expando ];
-
- // Compute a unique ID for the element
- if ( !id )
- id = elem[ expando ] = ++uuid;
-
- // Only generate the data cache if we're
- // trying to access or manipulate it
- if ( name && !jQuery.cache[ id ] )
- jQuery.cache[ id ] = {};
-
- // Prevent overriding the named cache with undefined values
- if ( data !== undefined )
- jQuery.cache[ id ][ name ] = data;
-
- // Return the named cache data, or the ID for the element
- return name ?
- jQuery.cache[ id ][ name ] :
- id;
- },
-
- removeData: function( elem, name ) {
- elem = elem == window ?
- windowData :
- elem;
-
- var id = elem[ expando ];
-
- // If we want to remove a specific section of the element's data
- if ( name ) {
- if ( jQuery.cache[ id ] ) {
- // Remove the section of cache data
- delete jQuery.cache[ id ][ name ];
-
- // If we've removed all the data, remove the element's cache
- name = "";
-
- for ( name in jQuery.cache[ id ] )
- break;
-
- if ( !name )
- jQuery.removeData( elem );
- }
-
- // Otherwise, we want to remove all of the element's data
- } else {
- // Clean up the element expando
- try {
- delete elem[ expando ];
- } catch(e){
- // IE has trouble directly removing the expando
- // but it's ok with using removeAttribute
- if ( elem.removeAttribute )
- elem.removeAttribute( expando );
- }
-
- // Completely remove the data cache
- delete jQuery.cache[ id ];
- }
- },
- queue: function( elem, type, data ) {
- if ( elem ){
-
- type = (type || "fx") + "queue";
-
- var q = jQuery.data( elem, type );
-
- if ( !q || jQuery.isArray(data) )
- q = jQuery.data( elem, type, jQuery.makeArray(data) );
- else if( data )
- q.push( data );
-
- }
- return q;
- },
-
- dequeue: function( elem, type ){
- var queue = jQuery.queue( elem, type ),
- fn = queue.shift();
-
- if( !type || type === "fx" )
- fn = queue[0];
-
- if( fn !== undefined )
- fn.call(elem);
- }
-});
-
-jQuery.fn.extend({
- data: function( key, value ){
- var parts = key.split(".");
- parts[1] = parts[1] ? "." + parts[1] : "";
-
- if ( value === undefined ) {
- var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
-
- if ( data === undefined && this.length )
- data = jQuery.data( this[0], key );
-
- return data === undefined && parts[1] ?
- this.data( parts[0] ) :
- data;
- } else
- return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){
- jQuery.data( this, key, value );
- });
- },
-
- removeData: function( key ){
- return this.each(function(){
- jQuery.removeData( this, key );
- });
- },
- queue: function(type, data){
- if ( typeof type !== "string" ) {
- data = type;
- type = "fx";
- }
-
- if ( data === undefined )
- return jQuery.queue( this[0], type );
-
- return this.each(function(){
- var queue = jQuery.queue( this, type, data );
-
- if( type == "fx" && queue.length == 1 )
- queue[0].call(this);
- });
- },
- dequeue: function(type){
- return this.each(function(){
- jQuery.dequeue( this, type );
- });
- }
-});/*!
- * Sizzle CSS Selector Engine - v0.9.3
- * Copyright 2009, The Dojo Foundation
- * Released under the MIT, BSD, and GPL Licenses.
- * More information: http://sizzlejs.com/
- */
-(function(){
-
-var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,
- done = 0,
- toString = Object.prototype.toString;
-
-var Sizzle = function(selector, context, results, seed) {
- results = results || [];
- context = context || document;
-
- if ( context.nodeType !== 1 && context.nodeType !== 9 )
- return [];
-
- if ( !selector || typeof selector !== "string" ) {
- return results;
- }
-
- var parts = [], m, set, checkSet, check, mode, extra, prune = true;
-
- // Reset the position of the chunker regexp (start from head)
- chunker.lastIndex = 0;
-
- while ( (m = chunker.exec(selector)) !== null ) {
- parts.push( m[1] );
-
- if ( m[2] ) {
- extra = RegExp.rightContext;
- break;
- }
- }
-
- if ( parts.length > 1 && origPOS.exec( selector ) ) {
- if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
- set = posProcess( parts[0] + parts[1], context );
- } else {
- set = Expr.relative[ parts[0] ] ?
- [ context ] :
- Sizzle( parts.shift(), context );
-
- while ( parts.length ) {
- selector = parts.shift();
-
- if ( Expr.relative[ selector ] )
- selector += parts.shift();
-
- set = posProcess( selector, set );
- }
- }
- } else {
- var ret = seed ?
- { expr: parts.pop(), set: makeArray(seed) } :
- Sizzle.find( parts.pop(), parts.length === 1 && context.parentNode ? context.parentNode : context, isXML(context) );
- set = Sizzle.filter( ret.expr, ret.set );
-
- if ( parts.length > 0 ) {
- checkSet = makeArray(set);
- } else {
- prune = false;
- }
-
- while ( parts.length ) {
- var cur = parts.pop(), pop = cur;
-
- if ( !Expr.relative[ cur ] ) {
- cur = "";
- } else {
- pop = parts.pop();
- }
-
- if ( pop == null ) {
- pop = context;
- }
-
- Expr.relative[ cur ]( checkSet, pop, isXML(context) );
- }
- }
-
- if ( !checkSet ) {
- checkSet = set;
- }
-
- if ( !checkSet ) {
- throw "Syntax error, unrecognized expression: " + (cur || selector);
- }
-
- if ( toString.call(checkSet) === "[object Array]" ) {
- if ( !prune ) {
- results.push.apply( results, checkSet );
- } else if ( context.nodeType === 1 ) {
- for ( var i = 0; checkSet[i] != null; i++ ) {
- if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
- results.push( set[i] );
- }
- }
- } else {
- for ( var i = 0; checkSet[i] != null; i++ ) {
- if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
- results.push( set[i] );
- }
- }
- }
- } else {
- makeArray( checkSet, results );
- }
-
- if ( extra ) {
- Sizzle( extra, context, results, seed );
-
- if ( sortOrder ) {
- hasDuplicate = false;
- results.sort(sortOrder);
-
- if ( hasDuplicate ) {
- for ( var i = 1; i < results.length; i++ ) {
- if ( results[i] === results[i-1] ) {
- results.splice(i--, 1);
- }
- }
- }
- }
- }
-
- return results;
-};
-
-Sizzle.matches = function(expr, set){
- return Sizzle(expr, null, null, set);
-};
-
-Sizzle.find = function(expr, context, isXML){
- var set, match;
-
- if ( !expr ) {
- return [];
- }
-
- for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
- var type = Expr.order[i], match;
-
- if ( (match = Expr.match[ type ].exec( expr )) ) {
- var left = RegExp.leftContext;
-
- if ( left.substr( left.length - 1 ) !== "\\" ) {
- match[1] = (match[1] || "").replace(/\\/g, "");
- set = Expr.find[ type ]( match, context, isXML );
- if ( set != null ) {
- expr = expr.replace( Expr.match[ type ], "" );
- break;
- }
- }
- }
- }
-
- if ( !set ) {
- set = context.getElementsByTagName("*");
- }
-
- return {set: set, expr: expr};
-};
-
-Sizzle.filter = function(expr, set, inplace, not){
- var old = expr, result = [], curLoop = set, match, anyFound,
- isXMLFilter = set && set[0] && isXML(set[0]);
-
- while ( expr && set.length ) {
- for ( var type in Expr.filter ) {
- if ( (match = Expr.match[ type ].exec( expr )) != null ) {
- var filter = Expr.filter[ type ], found, item;
- anyFound = false;
-
- if ( curLoop == result ) {
- result = [];
- }
-
- if ( Expr.preFilter[ type ] ) {
- match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
-
- if ( !match ) {
- anyFound = found = true;
- } else if ( match === true ) {
- continue;
- }
- }
-
- if ( match ) {
- for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
- if ( item ) {
- found = filter( item, match, i, curLoop );
- var pass = not ^ !!found;
-
- if ( inplace && found != null ) {
- if ( pass ) {
- anyFound = true;
- } else {
- curLoop[i] = false;
- }
- } else if ( pass ) {
- result.push( item );
- anyFound = true;
- }
- }
- }
- }
-
- if ( found !== undefined ) {
- if ( !inplace ) {
- curLoop = result;
- }
-
- expr = expr.replace( Expr.match[ type ], "" );
-
- if ( !anyFound ) {
- return [];
- }
-
- break;
- }
- }
- }
-
- // Improper expression
- if ( expr == old ) {
- if ( anyFound == null ) {
- throw "Syntax error, unrecognized expression: " + expr;
- } else {
- break;
- }
- }
-
- old = expr;
- }
-
- return curLoop;
-};
-
-var Expr = Sizzle.selectors = {
- order: [ "ID", "NAME", "TAG" ],
- match: {
- ID: /#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,
- CLASS: /\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,
- NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,
- ATTR: /\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
- TAG: /^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,
- CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
- POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
- PSEUDO: /:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/
- },
- attrMap: {
- "class": "className",
- "for": "htmlFor"
- },
- attrHandle: {
- href: function(elem){
- return elem.getAttribute("href");
- }
- },
- relative: {
- "+": function(checkSet, part, isXML){
- var isPartStr = typeof part === "string",
- isTag = isPartStr && !/\W/.test(part),
- isPartStrNotTag = isPartStr && !isTag;
-
- if ( isTag && !isXML ) {
- part = part.toUpperCase();
- }
-
- for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
- if ( (elem = checkSet[i]) ) {
- while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
-
- checkSet[i] = isPartStrNotTag || elem && elem.nodeName === part ?
- elem || false :
- elem === part;
- }
- }
-
- if ( isPartStrNotTag ) {
- Sizzle.filter( part, checkSet, true );
- }
- },
- ">": function(checkSet, part, isXML){
- var isPartStr = typeof part === "string";
-
- if ( isPartStr && !/\W/.test(part) ) {
- part = isXML ? part : part.toUpperCase();
-
- for ( var i = 0, l = checkSet.length; i < l; i++ ) {
- var elem = checkSet[i];
- if ( elem ) {
- var parent = elem.parentNode;
- checkSet[i] = parent.nodeName === part ? parent : false;
- }
- }
- } else {
- for ( var i = 0, l = checkSet.length; i < l; i++ ) {
- var elem = checkSet[i];
- if ( elem ) {
- checkSet[i] = isPartStr ?
- elem.parentNode :
- elem.parentNode === part;
- }
- }
-
- if ( isPartStr ) {
- Sizzle.filter( part, checkSet, true );
- }
- }
- },
- "": function(checkSet, part, isXML){
- var doneName = done++, checkFn = dirCheck;
-
- if ( !part.match(/\W/) ) {
- var nodeCheck = part = isXML ? part : part.toUpperCase();
- checkFn = dirNodeCheck;
- }
-
- checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
- },
- "~": function(checkSet, part, isXML){
- var doneName = done++, checkFn = dirCheck;
-
- if ( typeof part === "string" && !part.match(/\W/) ) {
- var nodeCheck = part = isXML ? part : part.toUpperCase();
- checkFn = dirNodeCheck;
- }
-
- checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
- }
- },
- find: {
- ID: function(match, context, isXML){
- if ( typeof context.getElementById !== "undefined" && !isXML ) {
- var m = context.getElementById(match[1]);
- return m ? [m] : [];
- }
- },
- NAME: function(match, context, isXML){
- if ( typeof context.getElementsByName !== "undefined" ) {
- var ret = [], results = context.getElementsByName(match[1]);
-
- for ( var i = 0, l = results.length; i < l; i++ ) {
- if ( results[i].getAttribute("name") === match[1] ) {
- ret.push( results[i] );
- }
- }
-
- return ret.length === 0 ? null : ret;
- }
- },
- TAG: function(match, context){
- return context.getElementsByTagName(match[1]);
- }
- },
- preFilter: {
- CLASS: function(match, curLoop, inplace, result, not, isXML){
- match = " " + match[1].replace(/\\/g, "") + " ";
-
- if ( isXML ) {
- return match;
- }
-
- for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
- if ( elem ) {
- if ( not ^ (elem.className && (" " + elem.className + " ").indexOf(match) >= 0) ) {
- if ( !inplace )
- result.push( elem );
- } else if ( inplace ) {
- curLoop[i] = false;
- }
- }
- }
-
- return false;
- },
- ID: function(match){
- return match[1].replace(/\\/g, "");
- },
- TAG: function(match, curLoop){
- for ( var i = 0; curLoop[i] === false; i++ ){}
- return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase();
- },
- CHILD: function(match){
- if ( match[1] == "nth" ) {
- // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
- var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
- match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" ||
- !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
-
- // calculate the numbers (first)n+(last) including if they are negative
- match[2] = (test[1] + (test[2] || 1)) - 0;
- match[3] = test[3] - 0;
- }
-
- // TODO: Move to normal caching system
- match[0] = done++;
-
- return match;
- },
- ATTR: function(match, curLoop, inplace, result, not, isXML){
- var name = match[1].replace(/\\/g, "");
-
- if ( !isXML && Expr.attrMap[name] ) {
- match[1] = Expr.attrMap[name];
- }
-
- if ( match[2] === "~=" ) {
- match[4] = " " + match[4] + " ";
- }
-
- return match;
- },
- PSEUDO: function(match, curLoop, inplace, result, not){
- if ( match[1] === "not" ) {
- // If we're dealing with a complex expression, or a simple one
- if ( match[3].match(chunker).length > 1 || /^\w/.test(match[3]) ) {
- match[3] = Sizzle(match[3], null, null, curLoop);
- } else {
- var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
- if ( !inplace ) {
- result.push.apply( result, ret );
- }
- return false;
- }
- } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
- return true;
- }
-
- return match;
- },
- POS: function(match){
- match.unshift( true );
- return match;
- }
- },
- filters: {
- enabled: function(elem){
- return elem.disabled === false && elem.type !== "hidden";
- },
- disabled: function(elem){
- return elem.disabled === true;
- },
- checked: function(elem){
- return elem.checked === true;
- },
- selected: function(elem){
- // Accessing this property makes selected-by-default
- // options in Safari work properly
- elem.parentNode.selectedIndex;
- return elem.selected === true;
- },
- parent: function(elem){
- return !!elem.firstChild;
- },
- empty: function(elem){
- return !elem.firstChild;
- },
- has: function(elem, i, match){
- return !!Sizzle( match[3], elem ).length;
- },
- header: function(elem){
- return /h\d/i.test( elem.nodeName );
- },
- text: function(elem){
- return "text" === elem.type;
- },
- radio: function(elem){
- return "radio" === elem.type;
- },
- checkbox: function(elem){
- return "checkbox" === elem.type;
- },
- file: function(elem){
- return "file" === elem.type;
- },
- password: function(elem){
- return "password" === elem.type;
- },
- submit: function(elem){
- return "submit" === elem.type;
- },
- image: function(elem){
- return "image" === elem.type;
- },
- reset: function(elem){
- return "reset" === elem.type;
- },
- button: function(elem){
- return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON";
- },
- input: function(elem){
- return /input|select|textarea|button/i.test(elem.nodeName);
- }
- },
- setFilters: {
- first: function(elem, i){
- return i === 0;
- },
- last: function(elem, i, match, array){
- return i === array.length - 1;
- },
- even: function(elem, i){
- return i % 2 === 0;
- },
- odd: function(elem, i){
- return i % 2 === 1;
- },
- lt: function(elem, i, match){
- return i < match[3] - 0;
- },
- gt: function(elem, i, match){
- return i > match[3] - 0;
- },
- nth: function(elem, i, match){
- return match[3] - 0 == i;
- },
- eq: function(elem, i, match){
- return match[3] - 0 == i;
- }
- },
- filter: {
- PSEUDO: function(elem, match, i, array){
- var name = match[1], filter = Expr.filters[ name ];
-
- if ( filter ) {
- return filter( elem, i, match, array );
- } else if ( name === "contains" ) {
- return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0;
- } else if ( name === "not" ) {
- var not = match[3];
-
- for ( var i = 0, l = not.length; i < l; i++ ) {
- if ( not[i] === elem ) {
- return false;
- }
- }
-
- return true;
- }
- },
- CHILD: function(elem, match){
- var type = match[1], node = elem;
- switch (type) {
- case 'only':
- case 'first':
- while (node = node.previousSibling) {
- if ( node.nodeType === 1 ) return false;
- }
- if ( type == 'first') return true;
- node = elem;
- case 'last':
- while (node = node.nextSibling) {
- if ( node.nodeType === 1 ) return false;
- }
- return true;
- case 'nth':
- var first = match[2], last = match[3];
-
- if ( first == 1 && last == 0 ) {
- return true;
- }
-
- var doneName = match[0],
- parent = elem.parentNode;
-
- if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
- var count = 0;
- for ( node = parent.firstChild; node; node = node.nextSibling ) {
- if ( node.nodeType === 1 ) {
- node.nodeIndex = ++count;
- }
- }
- parent.sizcache = doneName;
- }
-
- var diff = elem.nodeIndex - last;
- if ( first == 0 ) {
- return diff == 0;
- } else {
- return ( diff % first == 0 && diff / first >= 0 );
- }
- }
- },
- ID: function(elem, match){
- return elem.nodeType === 1 && elem.getAttribute("id") === match;
- },
- TAG: function(elem, match){
- return (match === "*" && elem.nodeType === 1) || elem.nodeName === match;
- },
- CLASS: function(elem, match){
- return (" " + (elem.className || elem.getAttribute("class")) + " ")
- .indexOf( match ) > -1;
- },
- ATTR: function(elem, match){
- var name = match[1],
- result = Expr.attrHandle[ name ] ?
- Expr.attrHandle[ name ]( elem ) :
- elem[ name ] != null ?
- elem[ name ] :
- elem.getAttribute( name ),
- value = result + "",
- type = match[2],
- check = match[4];
-
- return result == null ?
- type === "!=" :
- type === "=" ?
- value === check :
- type === "*=" ?
- value.indexOf(check) >= 0 :
- type === "~=" ?
- (" " + value + " ").indexOf(check) >= 0 :
- !check ?
- value && result !== false :
- type === "!=" ?
- value != check :
- type === "^=" ?
- value.indexOf(check) === 0 :
- type === "$=" ?
- value.substr(value.length - check.length) === check :
- type === "|=" ?
- value === check || value.substr(0, check.length + 1) === check + "-" :
- false;
- },
- POS: function(elem, match, i, array){
- var name = match[2], filter = Expr.setFilters[ name ];
-
- if ( filter ) {
- return filter( elem, i, match, array );
- }
- }
- }
-};
-
-var origPOS = Expr.match.POS;
-
-for ( var type in Expr.match ) {
- Expr.match[ type ] = RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
-}
-
-var makeArray = function(array, results) {
- array = Array.prototype.slice.call( array );
-
- if ( results ) {
- results.push.apply( results, array );
- return results;
- }
-
- return array;
-};
-
-// Perform a simple check to determine if the browser is capable of
-// converting a NodeList to an array using builtin methods.
-try {
- Array.prototype.slice.call( document.documentElement.childNodes );
-
-// Provide a fallback method if it does not work
-} catch(e){
- makeArray = function(array, results) {
- var ret = results || [];
-
- if ( toString.call(array) === "[object Array]" ) {
- Array.prototype.push.apply( ret, array );
- } else {
- if ( typeof array.length === "number" ) {
- for ( var i = 0, l = array.length; i < l; i++ ) {
- ret.push( array[i] );
- }
- } else {
- for ( var i = 0; array[i]; i++ ) {
- ret.push( array[i] );
- }
- }
- }
-
- return ret;
- };
-}
-
-var sortOrder;
-
-if ( document.documentElement.compareDocumentPosition ) {
- sortOrder = function( a, b ) {
- var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
- if ( ret === 0 ) {
- hasDuplicate = true;
- }
- return ret;
- };
-} else if ( "sourceIndex" in document.documentElement ) {
- sortOrder = function( a, b ) {
- var ret = a.sourceIndex - b.sourceIndex;
- if ( ret === 0 ) {
- hasDuplicate = true;
- }
- return ret;
- };
-} else if ( document.createRange ) {
- sortOrder = function( a, b ) {
- var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
- aRange.selectNode(a);
- aRange.collapse(true);
- bRange.selectNode(b);
- bRange.collapse(true);
- var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
- if ( ret === 0 ) {
- hasDuplicate = true;
- }
- return ret;
- };
-}
-
-// Check to see if the browser returns elements by name when
-// querying by getElementById (and provide a workaround)
-(function(){
- // We're going to inject a fake input element with a specified name
- var form = document.createElement("form"),
- id = "script" + (new Date).getTime();
- form.innerHTML = "<input name='" + id + "'/>";
-
- // Inject it into the root element, check its status, and remove it quickly
- var root = document.documentElement;
- root.insertBefore( form, root.firstChild );
-
- // The workaround has to do additional checks after a getElementById
- // Which slows things down for other browsers (hence the branching)
- if ( !!document.getElementById( id ) ) {
- Expr.find.ID = function(match, context, isXML){
- if ( typeof context.getElementById !== "undefined" && !isXML ) {
- var m = context.getElementById(match[1]);
- return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
- }
- };
-
- Expr.filter.ID = function(elem, match){
- var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
- return elem.nodeType === 1 && node && node.nodeValue === match;
- };
- }
-
- root.removeChild( form );
-})();
-
-(function(){
- // Check to see if the browser returns only elements
- // when doing getElementsByTagName("*")
-
- // Create a fake element
- var div = document.createElement("div");
- div.appendChild( document.createComment("") );
-
- // Make sure no comments are found
- if ( div.getElementsByTagName("*").length > 0 ) {
- Expr.find.TAG = function(match, context){
- var results = context.getElementsByTagName(match[1]);
-
- // Filter out possible comments
- if ( match[1] === "*" ) {
- var tmp = [];
-
- for ( var i = 0; results[i]; i++ ) {
- if ( results[i].nodeType === 1 ) {
- tmp.push( results[i] );
- }
- }
-
- results = tmp;
- }
-
- return results;
- };
- }
-
- // Check to see if an attribute returns normalized href attributes
- div.innerHTML = "<a href='#'></a>";
- if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
- div.firstChild.getAttribute("href") !== "#" ) {
- Expr.attrHandle.href = function(elem){
- return elem.getAttribute("href", 2);
- };
- }
-})();
-
-if ( document.querySelectorAll ) (function(){
- var oldSizzle = Sizzle, div = document.createElement("div");
- div.innerHTML = "<p class='TEST'></p>";
-
- // Safari can't handle uppercase or unicode characters when
- // in quirks mode.
- if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
- return;
- }
-
- Sizzle = function(query, context, extra, seed){
- context = context || document;
-
- // Only use querySelectorAll on non-XML documents
- // (ID selectors don't work in non-HTML documents)
- if ( !seed && context.nodeType === 9 && !isXML(context) ) {
- try {
- return makeArray( context.querySelectorAll(query), extra );
- } catch(e){}
- }
-
- return oldSizzle(query, context, extra, seed);
- };
-
- Sizzle.find = oldSizzle.find;
- Sizzle.filter = oldSizzle.filter;
- Sizzle.selectors = oldSizzle.selectors;
- Sizzle.matches = oldSizzle.matches;
-})();
-
-if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) (function(){
- var div = document.createElement("div");
- div.innerHTML = "<div class='test e'></div><div class='test'></div>";
-
- // Opera can't find a second classname (in 9.6)
- if ( div.getElementsByClassName("e").length === 0 )
- return;
-
- // Safari caches class attributes, doesn't catch changes (in 3.2)
- div.lastChild.className = "e";
-
- if ( div.getElementsByClassName("e").length === 1 )
- return;
-
- Expr.order.splice(1, 0, "CLASS");
- Expr.find.CLASS = function(match, context, isXML) {
- if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
- return context.getElementsByClassName(match[1]);
- }
- };
-})();
-
-function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
- var sibDir = dir == "previousSibling" && !isXML;
- for ( var i = 0, l = checkSet.length; i < l; i++ ) {
- var elem = checkSet[i];
- if ( elem ) {
- if ( sibDir && elem.nodeType === 1 ){
- elem.sizcache = doneName;
- elem.sizset = i;
- }
- elem = elem[dir];
- var match = false;
-
- while ( elem ) {
- if ( elem.sizcache === doneName ) {
- match = checkSet[elem.sizset];
- break;
- }
-
- if ( elem.nodeType === 1 && !isXML ){
- elem.sizcache = doneName;
- elem.sizset = i;
- }
-
- if ( elem.nodeName === cur ) {
- match = elem;
- break;
- }
-
- elem = elem[dir];
- }
-
- checkSet[i] = match;
- }
- }
-}
-
-function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
- var sibDir = dir == "previousSibling" && !isXML;
- for ( var i = 0, l = checkSet.length; i < l; i++ ) {
- var elem = checkSet[i];
- if ( elem ) {
- if ( sibDir && elem.nodeType === 1 ) {
- elem.sizcache = doneName;
- elem.sizset = i;
- }
- elem = elem[dir];
- var match = false;
-
- while ( elem ) {
- if ( elem.sizcache === doneName ) {
- match = checkSet[elem.sizset];
- break;
- }
-
- if ( elem.nodeType === 1 ) {
- if ( !isXML ) {
- elem.sizcache = doneName;
- elem.sizset = i;
- }
- if ( typeof cur !== "string" ) {
- if ( elem === cur ) {
- match = true;
- break;
- }
-
- } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
- match = elem;
- break;
- }
- }
-
- elem = elem[dir];
- }
-
- checkSet[i] = match;
- }
- }
-}
-
-var contains = document.compareDocumentPosition ? function(a, b){
- return a.compareDocumentPosition(b) & 16;
-} : function(a, b){
- return a !== b && (a.contains ? a.contains(b) : true);
-};
-
-var isXML = function(elem){
- return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
- !!elem.ownerDocument && isXML( elem.ownerDocument );
-};
-
-var posProcess = function(selector, context){
- var tmpSet = [], later = "", match,
- root = context.nodeType ? [context] : context;
-
- // Position selectors must be done after the filter
- // And so must :not(positional) so we move all PSEUDOs to the end
- while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
- later += match[0];
- selector = selector.replace( Expr.match.PSEUDO, "" );
- }
-
- selector = Expr.relative[selector] ? selector + "*" : selector;
-
- for ( var i = 0, l = root.length; i < l; i++ ) {
- Sizzle( selector, root[i], tmpSet );
- }
-
- return Sizzle.filter( later, tmpSet );
-};
-
-// EXPOSE
-jQuery.find = Sizzle;
-jQuery.filter = Sizzle.filter;
-jQuery.expr = Sizzle.selectors;
-jQuery.expr[":"] = jQuery.expr.filters;
-
-Sizzle.selectors.filters.hidden = function(elem){
- return elem.offsetWidth === 0 || elem.offsetHeight === 0;
-};
-
-Sizzle.selectors.filters.visible = function(elem){
- return elem.offsetWidth > 0 || elem.offsetHeight > 0;
-};
-
-Sizzle.selectors.filters.animated = function(elem){
- return jQuery.grep(jQuery.timers, function(fn){
- return elem === fn.elem;
- }).length;
-};
-
-jQuery.multiFilter = function( expr, elems, not ) {
- if ( not ) {
- expr = ":not(" + expr + ")";
- }
-
- return Sizzle.matches(expr, elems);
-};
-
-jQuery.dir = function( elem, dir ){
- var matched = [], cur = elem[dir];
- while ( cur && cur != document ) {
- if ( cur.nodeType == 1 )
- matched.push( cur );
- cur = cur[dir];
- }
- return matched;
-};
-
-jQuery.nth = function(cur, result, dir, elem){
- result = result || 1;
- var num = 0;
-
- for ( ; cur; cur = cur[dir] )
- if ( cur.nodeType == 1 && ++num == result )
- break;
-
- return cur;
-};
-
-jQuery.sibling = function(n, elem){
- var r = [];
-
- for ( ; n; n = n.nextSibling ) {
- if ( n.nodeType == 1 && n != elem )
- r.push( n );
- }
-
- return r;
-};
-
-return;
-
-window.Sizzle = Sizzle;
-
-})();
-/*
- * A number of helper functions used for managing events.
- * Many of the ideas behind this code originated from
- * Dean Edwards' addEvent library.
- */
-jQuery.event = {
-
- // Bind an event to an element
- // Original by Dean Edwards
- add: function(elem, types, handler, data) {
- if ( elem.nodeType == 3 || elem.nodeType == 8 )
- return;
-
- // For whatever reason, IE has trouble passing the window object
- // around, causing it to be cloned in the process
- if ( elem.setInterval && elem != window )
- elem = window;
-
- // Make sure that the function being executed has a unique ID
- if ( !handler.guid )
- handler.guid = this.guid++;
-
- // if data is passed, bind to handler
- if ( data !== undefined ) {
- // Create temporary function pointer to original handler
- var fn = handler;
-
- // Create unique handler function, wrapped around original handler
- handler = this.proxy( fn );
-
- // Store data in unique handler
- handler.data = data;
- }
-
- // Init the element's event structure
- var events = jQuery.data(elem, "events") || jQuery.data(elem, "events", {}),
- handle = jQuery.data(elem, "handle") || jQuery.data(elem, "handle", function(){
- // Handle the second event of a trigger and when
- // an event is called after a page has unloaded
- return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
- jQuery.event.handle.apply(arguments.callee.elem, arguments) :
- undefined;
- });
- // Add elem as a property of the handle function
- // This is to prevent a memory leak with non-native
- // event in IE.
- handle.elem = elem;
-
- // Handle multiple events separated by a space
- // jQuery(...).bind("mouseover mouseout", fn);
- jQuery.each(types.split(/\s+/), function(index, type) {
- // Namespaced event handlers
- var namespaces = type.split(".");
- type = namespaces.shift();
- handler.type = namespaces.slice().sort().join(".");
-
- // Get the current list of functions bound to this event
- var handlers = events[type];
-
- if ( jQuery.event.specialAll[type] )
- jQuery.event.specialAll[type].setup.call(elem, data, namespaces);
-
- // Init the event handler queue
- if (!handlers) {
- handlers = events[type] = {};
-
- // Check for a special event handler
- // Only use addEventListener/attachEvent if the special
- // events handler returns false
- if ( !jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem, data, namespaces) === false ) {
- // Bind the global event handler to the element
- if (elem.addEventListener)
- elem.addEventListener(type, handle, false);
- else if (elem.attachEvent)
- elem.attachEvent("on" + type, handle);
- }
- }
-
- // Add the function to the element's handler list
- handlers[handler.guid] = handler;
-
- // Keep track of which events have been used, for global triggering
- jQuery.event.global[type] = true;
- });
-
- // Nullify elem to prevent memory leaks in IE
- elem = null;
- },
-
- guid: 1,
- global: {},
-
- // Detach an event or set of events from an element
- remove: function(elem, types, handler) {
- // don't do events on text and comment nodes
- if ( elem.nodeType == 3 || elem.nodeType == 8 )
- return;
-
- var events = jQuery.data(elem, "events"), ret, index;
-
- if ( events ) {
- // Unbind all events for the element
- if ( types === undefined || (typeof types === "string" && types.charAt(0) == ".") )
- for ( var type in events )
- this.remove( elem, type + (types || "") );
- else {
- // types is actually an event object here
- if ( types.type ) {
- handler = types.handler;
- types = types.type;
- }
-
- // Handle multiple events seperated by a space
- // jQuery(...).unbind("mouseover mouseout", fn);
- jQuery.each(types.split(/\s+/), function(index, type){
- // Namespaced event handlers
- var namespaces = type.split(".");
- type = namespaces.shift();
- var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)");
-
- if ( events[type] ) {
- // remove the given handler for the given type
- if ( handler )
- delete events[type][handler.guid];
-
- // remove all handlers for the given type
- else
- for ( var handle in events[type] )
- // Handle the removal of namespaced events
- if ( namespace.test(events[type][handle].type) )
- delete events[type][handle];
-
- if ( jQuery.event.specialAll[type] )
- jQuery.event.specialAll[type].teardown.call(elem, namespaces);
-
- // remove generic event handler if no more handlers exist
- for ( ret in events[type] ) break;
- if ( !ret ) {
- if ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem, namespaces) === false ) {
- if (elem.removeEventListener)
- elem.removeEventListener(type, jQuery.data(elem, "handle"), false);
- else if (elem.detachEvent)
- elem.detachEvent("on" + type, jQuery.data(elem, "handle"));
- }
- ret = null;
- delete events[type];
- }
- }
- });
- }
-
- // Remove the expando if it's no longer used
- for ( ret in events ) break;
- if ( !ret ) {
- var handle = jQuery.data( elem, "handle" );
- if ( handle ) handle.elem = null;
- jQuery.removeData( elem, "events" );
- jQuery.removeData( elem, "handle" );
- }
- }
- },
-
- // bubbling is internal
- trigger: function( event, data, elem, bubbling ) {
- // Event object or event type
- var type = event.type || event;
-
- if( !bubbling ){
- event = typeof event === "object" ?
- // jQuery.Event object
- event[expando] ? event :
- // Object literal
- jQuery.extend( jQuery.Event(type), event ) :
- // Just the event type (string)
- jQuery.Event(type);
-
- if ( type.indexOf("!") >= 0 ) {
- event.type = type = type.slice(0, -1);
- event.exclusive = true;
- }
-
- // Handle a global trigger
- if ( !elem ) {
- // Don't bubble custom events when global (to avoid too much overhead)
- event.stopPropagation();
- // Only trigger if we've ever bound an event for it
- if ( this.global[type] )
- jQuery.each( jQuery.cache, function(){
- if ( this.events && this.events[type] )
- jQuery.event.trigger( event, data, this.handle.elem );
- });
- }
-
- // Handle triggering a single element
-
- // don't do events on text and comment nodes
- if ( !elem || elem.nodeType == 3 || elem.nodeType == 8 )
- return undefined;
-
- // Clean up in case it is reused
- event.result = undefined;
- event.target = elem;
-
- // Clone the incoming data, if any
- data = jQuery.makeArray(data);
- data.unshift( event );
- }
-
- event.currentTarget = elem;
-
- // Trigger the event, it is assumed that "handle" is a function
- var handle = jQuery.data(elem, "handle");
- if ( handle )
- handle.apply( elem, data );
-
- // Handle triggering native .onfoo handlers (and on links since we don't call .click() for links)
- if ( (!elem[type] || (jQuery.nodeName(elem, 'a') && type == "click")) && elem["on"+type] && elem["on"+type].apply( elem, data ) === false )
- event.result = false;
-
- // Trigger the native events (except for clicks on links)
- if ( !bubbling && elem[type] && !event.isDefaultPrevented() && !(jQuery.nodeName(elem, 'a') && type == "click") ) {
- this.triggered = true;
- try {
- elem[ type ]();
- // prevent IE from throwing an error for some hidden elements
- } catch (e) {}
- }
-
- this.triggered = false;
-
- if ( !event.isPropagationStopped() ) {
- var parent = elem.parentNode || elem.ownerDocument;
- if ( parent )
- jQuery.event.trigger(event, data, parent, true);
- }
- },
-
- handle: function(event) {
- // returned undefined or false
- var all, handlers;
-
- event = arguments[0] = jQuery.event.fix( event || window.event );
- event.currentTarget = this;
-
- // Namespaced event handlers
- var namespaces = event.type.split(".");
- event.type = namespaces.shift();
-
- // Cache this now, all = true means, any handler
- all = !namespaces.length && !event.exclusive;
-
- var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)");
-
- handlers = ( jQuery.data(this, "events") || {} )[event.type];
-
- for ( var j in handlers ) {
- var handler = handlers[j];
-
- // Filter the functions by class
- if ( all || namespace.test(handler.type) ) {
- // Pass in a reference to the handler function itself
- // So that we can later remove it
- event.handler = handler;
- event.data = handler.data;
-
- var ret = handler.apply(this, arguments);
-
- if( ret !== undefined ){
- event.result = ret;
- if ( ret === false ) {
- event.preventDefault();
- event.stopPropagation();
- }
- }
-
- if( event.isImmediatePropagationStopped() )
- break;
-
- }
- }
- },
-
- props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
-
- fix: function(event) {
- if ( event[expando] )
- return event;
-
- // store a copy of the original event object
- // and "clone" to set read-only properties
- var originalEvent = event;
- event = jQuery.Event( originalEvent );
-
- for ( var i = this.props.length, prop; i; ){
- prop = this.props[ --i ];
- event[ prop ] = originalEvent[ prop ];
- }
-
- // Fix target property, if necessary
- if ( !event.target )
- event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
-
- // check if target is a textnode (safari)
- if ( event.target.nodeType == 3 )
- event.target = event.target.parentNode;
-
- // Add relatedTarget, if necessary
- if ( !event.relatedTarget && event.fromElement )
- event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement;
-
- // Calculate pageX/Y if missing and clientX/Y available
- if ( event.pageX == null && event.clientX != null ) {
- var doc = document.documentElement, body = document.body;
- event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc.clientLeft || 0);
- event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc.clientTop || 0);
- }
-
- // Add which for key events
- if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) )
- event.which = event.charCode || event.keyCode;
-
- // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
- if ( !event.metaKey && event.ctrlKey )
- event.metaKey = event.ctrlKey;
-
- // Add which for click: 1 == left; 2 == middle; 3 == right
- // Note: button is not normalized, so don't use it
- if ( !event.which && event.button )
- event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
-
- return event;
- },
-
- proxy: function( fn, proxy ){
- proxy = proxy || function(){ return fn.apply(this, arguments); };
- // Set the guid of unique handler to the same of original handler, so it can be removed
- proxy.guid = fn.guid = fn.guid || proxy.guid || this.guid++;
- // So proxy can be declared as an argument
- return proxy;
- },
-
- special: {
- ready: {
- // Make sure the ready event is setup
- setup: bindReady,
- teardown: function() {}
- }
- },
-
- specialAll: {
- live: {
- setup: function( selector, namespaces ){
- jQuery.event.add( this, namespaces[0], liveHandler );
- },
- teardown: function( namespaces ){
- if ( namespaces.length ) {
- var remove = 0, name = RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)");
-
- jQuery.each( (jQuery.data(this, "events").live || {}), function(){
- if ( name.test(this.type) )
- remove++;
- });
-
- if ( remove < 1 )
- jQuery.event.remove( this, namespaces[0], liveHandler );
- }
- }
- }
- }
-};
-
-jQuery.Event = function( src ){
- // Allow instantiation without the 'new' keyword
- if( !this.preventDefault )
- return new jQuery.Event(src);
-
- // Event object
- if( src && src.type ){
- this.originalEvent = src;
- this.type = src.type;
- // Event type
- }else
- this.type = src;
-
- // timeStamp is buggy for some events on Firefox(#3843)
- // So we won't rely on the native value
- this.timeStamp = now();
-
- // Mark it as fixed
- this[expando] = true;
-};
-
-function returnFalse(){
- return false;
-}
-function returnTrue(){
- return true;
-}
-
-// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
-// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
-jQuery.Event.prototype = {
- preventDefault: function() {
- this.isDefaultPrevented = returnTrue;
-
- var e = this.originalEvent;
- if( !e )
- return;
- // if preventDefault exists run it on the original event
- if (e.preventDefault)
- e.preventDefault();
- // otherwise set the returnValue property of the original event to false (IE)
- e.returnValue = false;
- },
- stopPropagation: function() {
- this.isPropagationStopped = returnTrue;
-
- var e = this.originalEvent;
- if( !e )
- return;
- // if stopPropagation exists run it on the original event
- if (e.stopPropagation)
- e.stopPropagation();
- // otherwise set the cancelBubble property of the original event to true (IE)
- e.cancelBubble = true;
- },
- stopImmediatePropagation:function(){
- this.isImmediatePropagationStopped = returnTrue;
- this.stopPropagation();
- },
- isDefaultPrevented: returnFalse,
- isPropagationStopped: returnFalse,
- isImmediatePropagationStopped: returnFalse
-};
-// Checks if an event happened on an element within another element
-// Used in jQuery.event.special.mouseenter and mouseleave handlers
-var withinElement = function(event) {
- // Check if mouse(over|out) are still within the same parent element
- var parent = event.relatedTarget;
- // Traverse up the tree
- while ( parent && parent != this )
- try { parent = parent.parentNode; }
- catch(e) { parent = this; }
-
- if( parent != this ){
- // set the correct event type
- event.type = event.data;
- // handle event if we actually just moused on to a non sub-element
- jQuery.event.handle.apply( this, arguments );
- }
-};
-
-jQuery.each({
- mouseover: 'mouseenter',
- mouseout: 'mouseleave'
-}, function( orig, fix ){
- jQuery.event.special[ fix ] = {
- setup: function(){
- jQuery.event.add( this, orig, withinElement, fix );
- },
- teardown: function(){
- jQuery.event.remove( this, orig, withinElement );
- }
- };
-});
-
-jQuery.fn.extend({
- bind: function( type, data, fn ) {
- return type == "unload" ? this.one(type, data, fn) : this.each(function(){
- jQuery.event.add( this, type, fn || data, fn && data );
- });
- },
-
- one: function( type, data, fn ) {
- var one = jQuery.event.proxy( fn || data, function(event) {
- jQuery(this).unbind(event, one);
- return (fn || data).apply( this, arguments );
- });
- return this.each(function(){
- jQuery.event.add( this, type, one, fn && data);
- });
- },
-
- unbind: function( type, fn ) {
- return this.each(function(){
- jQuery.event.remove( this, type, fn );
- });
- },
-
- trigger: function( type, data ) {
- return this.each(function(){
- jQuery.event.trigger( type, data, this );
- });
- },
-
- triggerHandler: function( type, data ) {
- if( this[0] ){
- var event = jQuery.Event(type);
- event.preventDefault();
- event.stopPropagation();
- jQuery.event.trigger( event, data, this[0] );
- return event.result;
- }
- },
-
- toggle: function( fn ) {
- // Save reference to arguments for access in closure
- var args = arguments, i = 1;
-
- // link all the functions, so any of them can unbind this click handler
- while( i < args.length )
- jQuery.event.proxy( fn, args[i++] );
-
- return this.click( jQuery.event.proxy( fn, function(event) {
- // Figure out which function to execute
- this.lastToggle = ( this.lastToggle || 0 ) % i;
-
- // Make sure that clicks stop
- event.preventDefault();
-
- // and execute the function
- return args[ this.lastToggle++ ].apply( this, arguments ) || false;
- }));
- },
-
- hover: function(fnOver, fnOut) {
- return this.mouseenter(fnOver).mouseleave(fnOut);
- },
-
- ready: function(fn) {
- // Attach the listeners
- bindReady();
-
- // If the DOM is already ready
- if ( jQuery.isReady )
- // Execute the function immediately
- fn.call( document, jQuery );
-
- // Otherwise, remember the function for later
- else
- // Add the function to the wait list
- jQuery.readyList.push( fn );
-
- return this;
- },
-
- live: function( type, fn ){
- var proxy = jQuery.event.proxy( fn );
- proxy.guid += this.selector + type;
-
- jQuery(document).bind( liveConvert(type, this.selector), this.selector, proxy );
-
- return this;
- },
-
- die: function( type, fn ){
- jQuery(document).unbind( liveConvert(type, this.selector), fn ? { guid: fn.guid + this.selector + type } : null );
- return this;
- }
-});
-
-function liveHandler( event ){
- var check = RegExp("(^|\\.)" + event.type + "(\\.|$)"),
- stop = true,
- elems = [];
-
- jQuery.each(jQuery.data(this, "events").live || [], function(i, fn){
- if ( check.test(fn.type) ) {
- var elem = jQuery(event.target).closest(fn.data)[0];
- if ( elem )
- elems.push({ elem: elem, fn: fn });
- }
- });
-
- elems.sort(function(a,b) {
- return jQuery.data(a.elem, "closest") - jQuery.data(b.elem, "closest");
- });
-
- jQuery.each(elems, function(){
- if ( this.fn.call(this.elem, event, this.fn.data) === false )
- return (stop = false);
- });
-
- return stop;
-}
-
-function liveConvert(type, selector){
- return ["live", type, selector.replace(/\./g, "`").replace(/ /g, "|")].join(".");
-}
-
-jQuery.extend({
- isReady: false,
- readyList: [],
- // Handle when the DOM is ready
- ready: function() {
- // Make sure that the DOM is not already loaded
- if ( !jQuery.isReady ) {
- // Remember that the DOM is ready
- jQuery.isReady = true;
-
- // If there are functions bound, to execute
- if ( jQuery.readyList ) {
- // Execute all of them
- jQuery.each( jQuery.readyList, function(){
- this.call( document, jQuery );
- });
-
- // Reset the list of functions
- jQuery.readyList = null;
- }
-
- // Trigger any bound ready events
- jQuery(document).triggerHandler("ready");
- }
- }
-});
-
-var readyBound = false;
-
-function bindReady(){
- if ( readyBound ) return;
- readyBound = true;
-
- // Mozilla, Opera and webkit nightlies currently support this event
- if ( document.addEventListener ) {
- // Use the handy event callback
- document.addEventListener( "DOMContentLoaded", function(){
- document.removeEventListener( "DOMContentLoaded", arguments.callee, false );
- jQuery.ready();
- }, false );
-
- // If IE event model is used
- } else if ( document.attachEvent ) {
- // ensure firing before onload,
- // maybe late but safe also for iframes
- document.attachEvent("onreadystatechange", function(){
- if ( document.readyState === "complete" ) {
- document.detachEvent( "onreadystatechange", arguments.callee );
- jQuery.ready();
- }
- });
-
- // If IE and not an iframe
- // continually check to see if the document is ready
- if ( document.documentElement.doScroll && window == window.top ) (function(){
- if ( jQuery.isReady ) return;
-
- try {
- // If IE is used, use the trick by Diego Perini
- // http://javascript.nwbox.com/IEContentLoaded/
- document.documentElement.doScroll("left");
- } catch( error ) {
- setTimeout( arguments.callee, 0 );
- return;
- }
-
- // and execute any waiting functions
- jQuery.ready();
- })();
- }
-
- // A fallback to window.onload, that will always work
- jQuery.event.add( window, "load", jQuery.ready );
-}
-
-jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
- "mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave," +
- "change,select,submit,keydown,keypress,keyup,error").split(","), function(i, name){
-
- // Handle event binding
- jQuery.fn[name] = function(fn){
- return fn ? this.bind(name, fn) : this.trigger(name);
- };
-});
-
-// Prevent memory leaks in IE
-// And prevent errors on refresh with events like mouseover in other browsers
-// Window isn't included so as not to unbind existing unload events
-jQuery( window ).bind( 'unload', function(){
- for ( var id in jQuery.cache )
- // Skip the window
- if ( id != 1 && jQuery.cache[ id ].handle )
- jQuery.event.remove( jQuery.cache[ id ].handle.elem );
-});
-(function(){
-
- jQuery.support = {};
-
- var root = document.documentElement,
- script = document.createElement("script"),
- div = document.createElement("div"),
- id = "script" + (new Date).getTime();
-
- div.style.display = "none";
- div.innerHTML = ' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';
-
- var all = div.getElementsByTagName("*"),
- a = div.getElementsByTagName("a")[0];
-
- // Can't get basic test support
- if ( !all || !all.length || !a ) {
- return;
- }
-
- jQuery.support = {
- // IE strips leading whitespace when .innerHTML is used
- leadingWhitespace: div.firstChild.nodeType == 3,
-
- // Make sure that tbody elements aren't automatically inserted
- // IE will insert them into empty tables
- tbody: !div.getElementsByTagName("tbody").length,
-
- // Make sure that you can get all elements in an <object> element
- // IE 7 always returns no results
- objectAll: !!div.getElementsByTagName("object")[0]
- .getElementsByTagName("*").length,
-
- // Make sure that link elements get serialized correctly by innerHTML
- // This requires a wrapper element in IE
- htmlSerialize: !!div.getElementsByTagName("link").length,
-
- // Get the style information from getAttribute
- // (IE uses .cssText insted)
- style: /red/.test( a.getAttribute("style") ),
-
- // Make sure that URLs aren't manipulated
- // (IE normalizes it by default)
- hrefNormalized: a.getAttribute("href") === "/a",
-
- // Make sure that element opacity exists
- // (IE uses filter instead)
- opacity: a.style.opacity === "0.5",
-
- // Verify style float existence
- // (IE uses styleFloat instead of cssFloat)
- cssFloat: !!a.style.cssFloat,
-
- // Will be defined later
- scriptEval: false,
- noCloneEvent: true,
- boxModel: null
- };
-
- script.type = "text/javascript";
- try {
- script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
- } catch(e){}
-
- root.insertBefore( script, root.firstChild );
-
- // Make sure that the execution of code works by injecting a script
- // tag with appendChild/createTextNode
- // (IE doesn't support this, fails, and uses .text instead)
- if ( window[ id ] ) {
- jQuery.support.scriptEval = true;
- delete window[ id ];
- }
-
- root.removeChild( script );
-
- if ( div.attachEvent && div.fireEvent ) {
- div.attachEvent("onclick", function(){
- // Cloning a node shouldn't copy over any
- // bound event handlers (IE does this)
- jQuery.support.noCloneEvent = false;
- div.detachEvent("onclick", arguments.callee);
- });
- div.cloneNode(true).fireEvent("onclick");
- }
-
- // Figure out if the W3C box model works as expected
- // document.body must exist before we can do this
- jQuery(function(){
- var div = document.createElement("div");
- div.style.width = div.style.paddingLeft = "1px";
-
- document.body.appendChild( div );
- jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
- document.body.removeChild( div ).style.display = 'none';
- });
-})();
-
-var styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat";
-
-jQuery.props = {
- "for": "htmlFor",
- "class": "className",
- "float": styleFloat,
- cssFloat: styleFloat,
- styleFloat: styleFloat,
- readonly: "readOnly",
- maxlength: "maxLength",
- cellspacing: "cellSpacing",
- rowspan: "rowSpan",
- tabindex: "tabIndex"
-};
-jQuery.fn.extend({
- // Keep a copy of the old load
- _load: jQuery.fn.load,
-
- load: function( url, params, callback ) {
- if ( typeof url !== "string" )
- return this._load( url );
-
- var off = url.indexOf(" ");
- if ( off >= 0 ) {
- var selector = url.slice(off, url.length);
- url = url.slice(0, off);
- }
-
- // Default to a GET request
- var type = "GET";
-
- // If the second parameter was provided
- if ( params )
- // If it's a function
- if ( jQuery.isFunction( params ) ) {
- // We assume that it's the callback
- callback = params;
- params = null;
-
- // Otherwise, build a param string
- } else if( typeof params === "object" ) {
- params = jQuery.param( params );
- type = "POST";
- }
-
- var self = this;
-
- // Request the remote document
- jQuery.ajax({
- url: url,
- type: type,
- dataType: "html",
- data: params,
- complete: function(res, status){
- // If successful, inject the HTML into all the matched elements
- if ( status == "success" || status == "notmodified" )
- // See if a selector was specified
- self.html( selector ?
- // Create a dummy div to hold the results
- jQuery("<div/>")
- // inject the contents of the document in, removing the scripts
- // to avoid any 'Permission Denied' errors in IE
- .append(res.responseText.replace(/<script(.|\s)*?\/script>/g, ""))
-
- // Locate the specified elements
- .find(selector) :
-
- // If not, just inject the full result
- res.responseText );
-
- if( callback )
- self.each( callback, [res.responseText, status, res] );
- }
- });
- return this;
- },
-
- serialize: function() {
- return jQuery.param(this.serializeArray());
- },
- serializeArray: function() {
- return this.map(function(){
- return this.elements ? jQuery.makeArray(this.elements) : this;
- })
- .filter(function(){
- return this.name && !this.disabled &&
- (this.checked || /select|textarea/i.test(this.nodeName) ||
- /text|hidden|password|search/i.test(this.type));
- })
- .map(function(i, elem){
- var val = jQuery(this).val();
- return val == null ? null :
- jQuery.isArray(val) ?
- jQuery.map( val, function(val, i){
- return {name: elem.name, value: val};
- }) :
- {name: elem.name, value: val};
- }).get();
- }
-});
-
-// Attach a bunch of functions for handling common AJAX events
-jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){
- jQuery.fn[o] = function(f){
- return this.bind(o, f);
- };
-});
-
-var jsc = now();
-
-jQuery.extend({
-
- get: function( url, data, callback, type ) {
- // shift arguments if data argument was ommited
- if ( jQuery.isFunction( data ) ) {
- callback = data;
- data = null;
- }
-
- return jQuery.ajax({
- type: "GET",
- url: url,
- data: data,
- success: callback,
- dataType: type
- });
- },
-
- getScript: function( url, callback ) {
- return jQuery.get(url, null, callback, "script");
- },
-
- getJSON: function( url, data, callback ) {
- return jQuery.get(url, data, callback, "json");
- },
-
- post: function( url, data, callback, type ) {
- if ( jQuery.isFunction( data ) ) {
- callback = data;
- data = {};
- }
-
- return jQuery.ajax({
- type: "POST",
- url: url,
- data: data,
- success: callback,
- dataType: type
- });
- },
-
- ajaxSetup: function( settings ) {
- jQuery.extend( jQuery.ajaxSettings, settings );
- },
-
- ajaxSettings: {
- url: location.href,
- global: true,
- type: "GET",
- contentType: "application/x-www-form-urlencoded",
- processData: true,
- async: true,
- /*
- timeout: 0,
- data: null,
- username: null,
- password: null,
- */
- // Create the request object; Microsoft failed to properly
- // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
- // This function can be overriden by calling jQuery.ajaxSetup
- xhr:function(){
- return window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
- },
- accepts: {
- xml: "application/xml, text/xml",
- html: "text/html",
- script: "text/javascript, application/javascript",
- json: "application/json, text/javascript",
- text: "text/plain",
- _default: "*/*"
- }
- },
-
- // Last-Modified header cache for next request
- lastModified: {},
-
- ajax: function( s ) {
- // Extend the settings, but re-extend 's' so that it can be
- // checked again later (in the test suite, specifically)
- s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s));
-
- var jsonp, jsre = /=\?(&|$)/g, status, data,
- type = s.type.toUpperCase();
-
- // convert data if not already a string
- if ( s.data && s.processData && typeof s.data !== "string" )
- s.data = jQuery.param(s.data);
-
- // Handle JSONP Parameter Callbacks
- if ( s.dataType == "jsonp" ) {
- if ( type == "GET" ) {
- if ( !s.url.match(jsre) )
- s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?";
- } else if ( !s.data || !s.data.match(jsre) )
- s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
- s.dataType = "json";
- }
-
- // Build temporary JSONP function
- if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) {
- jsonp = "jsonp" + jsc++;
-
- // Replace the =? sequence both in the query string and the data
- if ( s.data )
- s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
- s.url = s.url.replace(jsre, "=" + jsonp + "$1");
-
- // We need to make sure
- // that a JSONP style response is executed properly
- s.dataType = "script";
-
- // Handle JSONP-style loading
- window[ jsonp ] = function(tmp){
- data = tmp;
- success();
- complete();
- // Garbage collect
- window[ jsonp ] = undefined;
- try{ delete window[ jsonp ]; } catch(e){}
- if ( head )
- head.removeChild( script );
- };
- }
-
- if ( s.dataType == "script" && s.cache == null )
- s.cache = false;
-
- if ( s.cache === false && type == "GET" ) {
- var ts = now();
- // try replacing _= if it is there
- var ret = s.url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + ts + "$2");
- // if nothing was replaced, add timestamp to the end
- s.url = ret + ((ret == s.url) ? (s.url.match(/\?/) ? "&" : "?") + "_=" + ts : "");
- }
-
- // If data is available, append data to url for get requests
- if ( s.data && type == "GET" ) {
- s.url += (s.url.match(/\?/) ? "&" : "?") + s.data;
-
- // IE likes to send both get and post data, prevent this
- s.data = null;
- }
-
- // Watch for a new set of requests
- if ( s.global && ! jQuery.active++ )
- jQuery.event.trigger( "ajaxStart" );
-
- // Matches an absolute URL, and saves the domain
- var parts = /^(\w+:)?\/\/([^\/?#]+)/.exec( s.url );
-
- // If we're requesting a remote document
- // and trying to load JSON or Script with a GET
- if ( s.dataType == "script" && type == "GET" && parts
- && ( parts[1] && parts[1] != location.protocol || parts[2] != location.host )){
-
- var head = document.getElementsByTagName("head")[0];
- var script = document.createElement("script");
- script.src = s.url;
- if (s.scriptCharset)
- script.charset = s.scriptCharset;
-
- // Handle Script loading
- if ( !jsonp ) {
- var done = false;
-
- // Attach handlers for all browsers
- script.onload = script.onreadystatechange = function(){
- if ( !done && (!this.readyState ||
- this.readyState == "loaded" || this.readyState == "complete") ) {
- done = true;
- success();
- complete();
-
- // Handle memory leak in IE
- script.onload = script.onreadystatechange = null;
- head.removeChild( script );
- }
- };
- }
-
- head.appendChild(script);
-
- // We handle everything using the script element injection
- return undefined;
- }
-
- var requestDone = false;
-
- // Create the request object
- var xhr = s.xhr();
-
- // Open the socket
- // Passing null username, generates a login popup on Opera (#2865)
- if( s.username )
- xhr.open(type, s.url, s.async, s.username, s.password);
- else
- xhr.open(type, s.url, s.async);
-
- // Need an extra try/catch for cross domain requests in Firefox 3
- try {
- // Set the correct header, if data is being sent
- if ( s.data )
- xhr.setRequestHeader("Content-Type", s.contentType);
-
- // Set the If-Modified-Since header, if ifModified mode.
- if ( s.ifModified )
- xhr.setRequestHeader("If-Modified-Since",
- jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" );
-
- // Set header so the called script knows that it's an XMLHttpRequest
- xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
-
- // Set the Accepts header for the server, depending on the dataType
- xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
- s.accepts[ s.dataType ] + ", */*" :
- s.accepts._default );
- } catch(e){}
-
- // Allow custom headers/mimetypes and early abort
- if ( s.beforeSend && s.beforeSend(xhr, s) === false ) {
- // Handle the global AJAX counter
- if ( s.global && ! --jQuery.active )
- jQuery.event.trigger( "ajaxStop" );
- // close opended socket
- xhr.abort();
- return false;
- }
-
- if ( s.global )
- jQuery.event.trigger("ajaxSend", [xhr, s]);
-
- // Wait for a response to come back
- var onreadystatechange = function(isTimeout){
- // The request was aborted, clear the interval and decrement jQuery.active
- if (xhr.readyState == 0) {
- if (ival) {
- // clear poll interval
- clearInterval(ival);
- ival = null;
- // Handle the global AJAX counter
- if ( s.global && ! --jQuery.active )
- jQuery.event.trigger( "ajaxStop" );
- }
- // The transfer is complete and the data is available, or the request timed out
- } else if ( !requestDone && xhr && (xhr.readyState == 4 || isTimeout == "timeout") ) {
- requestDone = true;
-
- // clear poll interval
- if (ival) {
- clearInterval(ival);
- ival = null;
- }
-
- status = isTimeout == "timeout" ? "timeout" :
- !jQuery.httpSuccess( xhr ) ? "error" :
- s.ifModified && jQuery.httpNotModified( xhr, s.url ) ? "notmodified" :
- "success";
-
- if ( status == "success" ) {
- // Watch for, and catch, XML document parse errors
- try {
- // process the data (runs the xml through httpData regardless of callback)
- data = jQuery.httpData( xhr, s.dataType, s );
- } catch(e) {
- status = "parsererror";
- }
- }
-
- // Make sure that the request was successful or notmodified
- if ( status == "success" ) {
- // Cache Last-Modified header, if ifModified mode.
- var modRes;
- try {
- modRes = xhr.getResponseHeader("Last-Modified");
- } catch(e) {} // swallow exception thrown by FF if header is not available
-
- if ( s.ifModified && modRes )
- jQuery.lastModified[s.url] = modRes;
-
- // JSONP handles its own success callback
- if ( !jsonp )
- success();
- } else
- jQuery.handleError(s, xhr, status);
-
- // Fire the complete handlers
- complete();
-
- if ( isTimeout )
- xhr.abort();
-
- // Stop memory leaks
- if ( s.async )
- xhr = null;
- }
- };
-
- if ( s.async ) {
- // don't attach the handler to the request, just poll it instead
- var ival = setInterval(onreadystatechange, 13);
-
- // Timeout checker
- if ( s.timeout > 0 )
- setTimeout(function(){
- // Check to see if the request is still happening
- if ( xhr && !requestDone )
- onreadystatechange( "timeout" );
- }, s.timeout);
- }
-
- // Send the data
- try {
- xhr.send(s.data);
- } catch(e) {
- jQuery.handleError(s, xhr, null, e);
- }
-
- // firefox 1.5 doesn't fire statechange for sync requests
- if ( !s.async )
- onreadystatechange();
-
- function success(){
- // If a local callback was specified, fire it and pass it the data
- if ( s.success )
- s.success( data, status );
-
- // Fire the global callback
- if ( s.global )
- jQuery.event.trigger( "ajaxSuccess", [xhr, s] );
- }
-
- function complete(){
- // Process result
- if ( s.complete )
- s.complete(xhr, status);
-
- // The request was completed
- if ( s.global )
- jQuery.event.trigger( "ajaxComplete", [xhr, s] );
-
- // Handle the global AJAX counter
- if ( s.global && ! --jQuery.active )
- jQuery.event.trigger( "ajaxStop" );
- }
-
- // return XMLHttpRequest to allow aborting the request etc.
- return xhr;
- },
-
- handleError: function( s, xhr, status, e ) {
- // If a local callback was specified, fire it
- if ( s.error ) s.error( xhr, status, e );
-
- // Fire the global callback
- if ( s.global )
- jQuery.event.trigger( "ajaxError", [xhr, s, e] );
- },
-
- // Counter for holding the number of active queries
- active: 0,
-
- // Determines if an XMLHttpRequest was successful or not
- httpSuccess: function( xhr ) {
- try {
- // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
- return !xhr.status && location.protocol == "file:" ||
- ( xhr.status >= 200 && xhr.status < 300 ) || xhr.status == 304 || xhr.status == 1223;
- } catch(e){}
- return false;
- },
-
- // Determines if an XMLHttpRequest returns NotModified
- httpNotModified: function( xhr, url ) {
- try {
- var xhrRes = xhr.getResponseHeader("Last-Modified");
-
- // Firefox always returns 200. check Last-Modified date
- return xhr.status == 304 || xhrRes == jQuery.lastModified[url];
- } catch(e){}
- return false;
- },
-
- httpData: function( xhr, type, s ) {
- var ct = xhr.getResponseHeader("content-type"),
- xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0,
- data = xml ? xhr.responseXML : xhr.responseText;
-
- if ( xml && data.documentElement.tagName == "parsererror" )
- throw "parsererror";
-
- // Allow a pre-filtering function to sanitize the response
- // s != null is checked to keep backwards compatibility
- if( s && s.dataFilter )
- data = s.dataFilter( data, type );
-
- // The filter can actually parse the response
- if( typeof data === "string" ){
-
- // If the type is "script", eval it in global context
- if ( type == "script" )
- jQuery.globalEval( data );
-
- // Get the JavaScript object, if JSON is used.
- if ( type == "json" )
- data = window["eval"]("(" + data + ")");
- }
-
- return data;
- },
-
- // Serialize an array of form elements or a set of
- // key/values into a query string
- param: function( a ) {
- var s = [ ];
-
- function add( key, value ){
- s[ s.length ] = encodeURIComponent(key) + '=' + encodeURIComponent(value);
- };
-
- // If an array was passed in, assume that it is an array
- // of form elements
- if ( jQuery.isArray(a) || a.jquery )
- // Serialize the form elements
- jQuery.each( a, function(){
- add( this.name, this.value );
- });
-
- // Otherwise, assume that it's an object of key/value pairs
- else
- // Serialize the key/values
- for ( var j in a )
- // If the value is an array then the key names need to be repeated
- if ( jQuery.isArray(a[j]) )
- jQuery.each( a[j], function(){
- add( j, this );
- });
- else
- add( j, jQuery.isFunction(a[j]) ? a[j]() : a[j] );
-
- // Return the resulting serialization
- return s.join("&").replace(/%20/g, "+");
- }
-
-});
-var elemdisplay = {},
- timerId,
- fxAttrs = [
- // height animations
- [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
- // width animations
- [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
- // opacity animations
- [ "opacity" ]
- ];
-
-function genFx( type, num ){
- var obj = {};
- jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function(){
- obj[ this ] = type;
- });
- return obj;
-}
-
-jQuery.fn.extend({
- show: function(speed,callback){
- if ( speed ) {
- return this.animate( genFx("show", 3), speed, callback);
- } else {
- for ( var i = 0, l = this.length; i < l; i++ ){
- var old = jQuery.data(this[i], "olddisplay");
-
- this[i].style.display = old || "";
-
- if ( jQuery.css(this[i], "display") === "none" ) {
- var tagName = this[i].tagName, display;
-
- if ( elemdisplay[ tagName ] ) {
- display = elemdisplay[ tagName ];
- } else {
- var elem = jQuery("<" + tagName + " />").appendTo("body");
-
- display = elem.css("display");
- if ( display === "none" )
- display = "block";
-
- elem.remove();
-
- elemdisplay[ tagName ] = display;
- }
-
- jQuery.data(this[i], "olddisplay", display);
- }
- }
-
- // Set the display of the elements in a second loop
- // to avoid the constant reflow
- for ( var i = 0, l = this.length; i < l; i++ ){
- this[i].style.display = jQuery.data(this[i], "olddisplay") || "";
- }
-
- return this;
- }
- },
-
- hide: function(speed,callback){
- if ( speed ) {
- return this.animate( genFx("hide", 3), speed, callback);
- } else {
- for ( var i = 0, l = this.length; i < l; i++ ){
- var old = jQuery.data(this[i], "olddisplay");
- if ( !old && old !== "none" )
- jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display"));
- }
-
- // Set the display of the elements in a second loop
- // to avoid the constant reflow
- for ( var i = 0, l = this.length; i < l; i++ ){
- this[i].style.display = "none";
- }
-
- return this;
- }
- },
-
- // Save the old toggle function
- _toggle: jQuery.fn.toggle,
-
- toggle: function( fn, fn2 ){
- var bool = typeof fn === "boolean";
-
- return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?
- this._toggle.apply( this, arguments ) :
- fn == null || bool ?
- this.each(function(){
- var state = bool ? fn : jQuery(this).is(":hidden");
- jQuery(this)[ state ? "show" : "hide" ]();
- }) :
- this.animate(genFx("toggle", 3), fn, fn2);
- },
-
- fadeTo: function(speed,to,callback){
- return this.animate({opacity: to}, speed, callback);
- },
-
- animate: function( prop, speed, easing, callback ) {
- var optall = jQuery.speed(speed, easing, callback);
-
- return this[ optall.queue === false ? "each" : "queue" ](function(){
-
- var opt = jQuery.extend({}, optall), p,
- hidden = this.nodeType == 1 && jQuery(this).is(":hidden"),
- self = this;
-
- for ( p in prop ) {
- if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
- return opt.complete.call(this);
-
- if ( ( p == "height" || p == "width" ) && this.style ) {
- // Store display property
- opt.display = jQuery.css(this, "display");
-
- // Make sure that nothing sneaks out
- opt.overflow = this.style.overflow;
- }
- }
-
- if ( opt.overflow != null )
- this.style.overflow = "hidden";
-
- opt.curAnim = jQuery.extend({}, prop);
-
- jQuery.each( prop, function(name, val){
- var e = new jQuery.fx( self, opt, name );
-
- if ( /toggle|show|hide/.test(val) )
- e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
- else {
- var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),
- start = e.cur(true) || 0;
-
- if ( parts ) {
- var end = parseFloat(parts[2]),
- unit = parts[3] || "px";
-
- // We need to compute starting value
- if ( unit != "px" ) {
- self.style[ name ] = (end || 1) + unit;
- start = ((end || 1) / e.cur(true)) * start;
- self.style[ name ] = start + unit;
- }
-
- // If a +=/-= token was provided, we're doing a relative animation
- if ( parts[1] )
- end = ((parts[1] == "-=" ? -1 : 1) * end) + start;
-
- e.custom( start, end, unit );
- } else
- e.custom( start, val, "" );
- }
- });
-
- // For JS strict compliance
- return true;
- });
- },
-
- stop: function(clearQueue, gotoEnd){
- var timers = jQuery.timers;
-
- if (clearQueue)
- this.queue([]);
-
- this.each(function(){
- // go in reverse order so anything added to the queue during the loop is ignored
- for ( var i = timers.length - 1; i >= 0; i-- )
- if ( timers[i].elem == this ) {
- if (gotoEnd)
- // force the next step to be the last
- timers[i](true);
- timers.splice(i, 1);
- }
- });
-
- // start the next in the queue if the last step wasn't forced
- if (!gotoEnd)
- this.dequeue();
-
- return this;
- }
-
-});
-
-// Generate shortcuts for custom animations
-jQuery.each({
- slideDown: genFx("show", 1),
- slideUp: genFx("hide", 1),
- slideToggle: genFx("toggle", 1),
- fadeIn: { opacity: "show" },
- fadeOut: { opacity: "hide" }
-}, function( name, props ){
- jQuery.fn[ name ] = function( speed, callback ){
- return this.animate( props, speed, callback );
- };
-});
-
-jQuery.extend({
-
- speed: function(speed, easing, fn) {
- var opt = typeof speed === "object" ? speed : {
- complete: fn || !fn && easing ||
- jQuery.isFunction( speed ) && speed,
- duration: speed,
- easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
- };
-
- opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
- jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default;
-
- // Queueing
- opt.old = opt.complete;
- opt.complete = function(){
- if ( opt.queue !== false )
- jQuery(this).dequeue();
- if ( jQuery.isFunction( opt.old ) )
- opt.old.call( this );
- };
-
- return opt;
- },
-
- easing: {
- linear: function( p, n, firstNum, diff ) {
- return firstNum + diff * p;
- },
- swing: function( p, n, firstNum, diff ) {
- return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
- }
- },
-
- timers: [],
-
- fx: function( elem, options, prop ){
- this.options = options;
- this.elem = elem;
- this.prop = prop;
-
- if ( !options.orig )
- options.orig = {};
- }
-
-});
-
-jQuery.fx.prototype = {
-
- // Simple function for setting a style value
- update: function(){
- if ( this.options.step )
- this.options.step.call( this.elem, this.now, this );
-
- (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
-
- // Set display property to block for height/width animations
- if ( ( this.prop == "height" || this.prop == "width" ) && this.elem.style )
- this.elem.style.display = "block";
- },
-
- // Get the current size
- cur: function(force){
- if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) )
- return this.elem[ this.prop ];
-
- var r = parseFloat(jQuery.css(this.elem, this.prop, force));
- return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
- },
-
- // Start an animation from one number to another
- custom: function(from, to, unit){
- this.startTime = now();
- this.start = from;
- this.end = to;
- this.unit = unit || this.unit || "px";
- this.now = this.start;
- this.pos = this.state = 0;
-
- var self = this;
- function t(gotoEnd){
- return self.step(gotoEnd);
- }
-
- t.elem = this.elem;
-
- if ( t() && jQuery.timers.push(t) && !timerId ) {
- timerId = setInterval(function(){
- var timers = jQuery.timers;
-
- for ( var i = 0; i < timers.length; i++ )
- if ( !timers[i]() )
- timers.splice(i--, 1);
-
- if ( !timers.length ) {
- clearInterval( timerId );
- timerId = undefined;
- }
- }, 13);
- }
- },
-
- // Simple 'show' function
- show: function(){
- // Remember where we started, so that we can go back to it later
- this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
- this.options.show = true;
-
- // Begin the animation
- // Make sure that we start at a small width/height to avoid any
- // flash of content
- this.custom(this.prop == "width" || this.prop == "height" ? 1 : 0, this.cur());
-
- // Start by showing the element
- jQuery(this.elem).show();
- },
-
- // Simple 'hide' function
- hide: function(){
- // Remember where we started, so that we can go back to it later
- this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
- this.options.hide = true;
-
- // Begin the animation
- this.custom(this.cur(), 0);
- },
-
- // Each step of an animation
- step: function(gotoEnd){
- var t = now();
-
- if ( gotoEnd || t >= this.options.duration + this.startTime ) {
- this.now = this.end;
- this.pos = this.state = 1;
- this.update();
-
- this.options.curAnim[ this.prop ] = true;
-
- var done = true;
- for ( var i in this.options.curAnim )
- if ( this.options.curAnim[i] !== true )
- done = false;
-
- if ( done ) {
- if ( this.options.display != null ) {
- // Reset the overflow
- this.elem.style.overflow = this.options.overflow;
-
- // Reset the display
- this.elem.style.display = this.options.display;
- if ( jQuery.css(this.elem, "display") == "none" )
- this.elem.style.display = "block";
- }
-
- // Hide the element if the "hide" operation was done
- if ( this.options.hide )
- jQuery(this.elem).hide();
-
- // Reset the properties, if the item has been hidden or shown
- if ( this.options.hide || this.options.show )
- for ( var p in this.options.curAnim )
- jQuery.attr(this.elem.style, p, this.options.orig[p]);
-
- // Execute the complete function
- this.options.complete.call( this.elem );
- }
-
- return false;
- } else {
- var n = t - this.startTime;
- this.state = n / this.options.duration;
-
- // Perform the easing function, defaults to swing
- this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration);
- this.now = this.start + ((this.end - this.start) * this.pos);
-
- // Perform the next step of the animation
- this.update();
- }
-
- return true;
- }
-
-};
-
-jQuery.extend( jQuery.fx, {
- speeds:{
- slow: 600,
- fast: 200,
- // Default speed
- _default: 400
- },
- step: {
-
- opacity: function(fx){
- jQuery.attr(fx.elem.style, "opacity", fx.now);
- },
-
- _default: function(fx){
- if ( fx.elem.style && fx.elem.style[ fx.prop ] != null )
- fx.elem.style[ fx.prop ] = fx.now + fx.unit;
- else
- fx.elem[ fx.prop ] = fx.now;
- }
- }
-});
-if ( document.documentElement["getBoundingClientRect"] )
- jQuery.fn.offset = function() {
- if ( !this[0] ) return { top: 0, left: 0 };
- if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] );
- var box = this[0].getBoundingClientRect(), doc = this[0].ownerDocument, body = doc.body, docElem = doc.documentElement,
- clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
- top = box.top + (self.pageYOffset || jQuery.boxModel && docElem.scrollTop || body.scrollTop ) - clientTop,
- left = box.left + (self.pageXOffset || jQuery.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft;
- return { top: top, left: left };
- };
-else
- jQuery.fn.offset = function() {
- if ( !this[0] ) return { top: 0, left: 0 };
- if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] );
- jQuery.offset.initialized || jQuery.offset.initialize();
-
- var elem = this[0], offsetParent = elem.offsetParent, prevOffsetParent = elem,
- doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,
- body = doc.body, defaultView = doc.defaultView,
- prevComputedStyle = defaultView.getComputedStyle(elem, null),
- top = elem.offsetTop, left = elem.offsetLeft;
-
- while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
- computedStyle = defaultView.getComputedStyle(elem, null);
- top -= elem.scrollTop, left -= elem.scrollLeft;
- if ( elem === offsetParent ) {
- top += elem.offsetTop, left += elem.offsetLeft;
- if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.tagName)) )
- top += parseInt( computedStyle.borderTopWidth, 10) || 0,
- left += parseInt( computedStyle.borderLeftWidth, 10) || 0;
- prevOffsetParent = offsetParent, offsetParent = elem.offsetParent;
- }
- if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" )
- top += parseInt( computedStyle.borderTopWidth, 10) || 0,
- left += parseInt( computedStyle.borderLeftWidth, 10) || 0;
- prevComputedStyle = computedStyle;
- }
-
- if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" )
- top += body.offsetTop,
- left += body.offsetLeft;
-
- if ( prevComputedStyle.position === "fixed" )
- top += Math.max(docElem.scrollTop, body.scrollTop),
- left += Math.max(docElem.scrollLeft, body.scrollLeft);
-
- return { top: top, left: left };
- };
-
-jQuery.offset = {
- initialize: function() {
- if ( this.initialized ) return;
- var body = document.body, container = document.createElement('div'), innerDiv, checkDiv, table, td, rules, prop, bodyMarginTop = body.style.marginTop,
- html = '<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';
-
- rules = { position: 'absolute', top: 0, left: 0, margin: 0, border: 0, width: '1px', height: '1px', visibility: 'hidden' };
- for ( prop in rules ) container.style[prop] = rules[prop];
-
- container.innerHTML = html;
- body.insertBefore(container, body.firstChild);
- innerDiv = container.firstChild, checkDiv = innerDiv.firstChild, td = innerDiv.nextSibling.firstChild.firstChild;
-
- this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
- this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
-
- innerDiv.style.overflow = 'hidden', innerDiv.style.position = 'relative';
- this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
-
- body.style.marginTop = '1px';
- this.doesNotIncludeMarginInBodyOffset = (body.offsetTop === 0);
- body.style.marginTop = bodyMarginTop;
-
- body.removeChild(container);
- this.initialized = true;
- },
-
- bodyOffset: function(body) {
- jQuery.offset.initialized || jQuery.offset.initialize();
- var top = body.offsetTop, left = body.offsetLeft;
- if ( jQuery.offset.doesNotIncludeMarginInBodyOffset )
- top += parseInt( jQuery.curCSS(body, 'marginTop', true), 10 ) || 0,
- left += parseInt( jQuery.curCSS(body, 'marginLeft', true), 10 ) || 0;
- return { top: top, left: left };
- }
-};
-
-
-jQuery.fn.extend({
- position: function() {
- var left = 0, top = 0, results;
-
- if ( this[0] ) {
- // Get *real* offsetParent
- var offsetParent = this.offsetParent(),
-
- // Get correct offsets
- offset = this.offset(),
- parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { top: 0, left: 0 } : offsetParent.offset();
-
- // Subtract element margins
- // note: when an element has margin: auto the offsetLeft and marginLeft
- // are the same in Safari causing offset.left to incorrectly be 0
- offset.top -= num( this, 'marginTop' );
- offset.left -= num( this, 'marginLeft' );
-
- // Add offsetParent borders
- parentOffset.top += num( offsetParent, 'borderTopWidth' );
- parentOffset.left += num( offsetParent, 'borderLeftWidth' );
-
- // Subtract the two offsets
- results = {
- top: offset.top - parentOffset.top,
- left: offset.left - parentOffset.left
- };
- }
-
- return results;
- },
-
- offsetParent: function() {
- var offsetParent = this[0].offsetParent || document.body;
- while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static') )
- offsetParent = offsetParent.offsetParent;
- return jQuery(offsetParent);
- }
-});
-
-
-// Create scrollLeft and scrollTop methods
-jQuery.each( ['Left', 'Top'], function(i, name) {
- var method = 'scroll' + name;
-
- jQuery.fn[ method ] = function(val) {
- if (!this[0]) return null;
-
- return val !== undefined ?
-
- // Set the scroll offset
- this.each(function() {
- this == window || this == document ?
- window.scrollTo(
- !i ? val : jQuery(window).scrollLeft(),
- i ? val : jQuery(window).scrollTop()
- ) :
- this[ method ] = val;
- }) :
-
- // Return the scroll offset
- this[0] == window || this[0] == document ?
- self[ i ? 'pageYOffset' : 'pageXOffset' ] ||
- jQuery.boxModel && document.documentElement[ method ] ||
- document.body[ method ] :
- this[0][ method ];
- };
-});
-// Create innerHeight, innerWidth, outerHeight and outerWidth methods
-jQuery.each([ "Height", "Width" ], function(i, name){
-
- var tl = i ? "Left" : "Top", // top or left
- br = i ? "Right" : "Bottom", // bottom or right
- lower = name.toLowerCase();
-
- // innerHeight and innerWidth
- jQuery.fn["inner" + name] = function(){
- return this[0] ?
- jQuery.css( this[0], lower, false, "padding" ) :
- null;
- };
-
- // outerHeight and outerWidth
- jQuery.fn["outer" + name] = function(margin) {
- return this[0] ?
- jQuery.css( this[0], lower, false, margin ? "margin" : "border" ) :
- null;
- };
-
- var type = name.toLowerCase();
-
- jQuery.fn[ type ] = function( size ) {
- // Get window width or height
- return this[0] == window ?
- // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
- document.compatMode == "CSS1Compat" && document.documentElement[ "client" + name ] ||
- document.body[ "client" + name ] :
-
- // Get document width or height
- this[0] == document ?
- // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
- Math.max(
- document.documentElement["client" + name],
- document.body["scroll" + name], document.documentElement["scroll" + name],
- document.body["offset" + name], document.documentElement["offset" + name]
- ) :
-
- // Get or set width or height on the element
- size === undefined ?
- // Get width or height on the element
- (this.length ? jQuery.css( this[0], type ) : null) :
-
- // Set the width or height on the element (default to pixels if value is unitless)
- this.css( type, typeof size === "string" ? size : size + "px" );
- };
-
-});
-})();
-
-/**
- * Add a suitable MW-specific alias
- */
-$j = jQuery.noConflict();
-
diff --git a/skins/common/jquery.min.js b/skins/common/jquery.min.js
deleted file mode 100644
index d872c9f0..00000000
--- a/skins/common/jquery.min.js
+++ /dev/null
@@ -1,433 +0,0 @@
-
-(function(){var
-window=this,undefined,_jQuery=window.jQuery,_$=window.$,jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);},quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,isSimple=/^.[^:#\[\.,]*$/;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;this.context=selector;return this;}
-if(typeof selector==="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])
-selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem&&elem.id!=match[3])
-return jQuery().find(selector);var ret=jQuery(elem||[]);ret.context=document;ret.selector=selector;return ret;}}else
-return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))
-return jQuery(document).ready(selector);if(selector.selector&&selector.context){this.selector=selector.selector;this.context=selector.context;}
-return this.setArray(jQuery.isArray(selector)?selector:jQuery.makeArray(selector));},selector:"",jquery:"1.3.2",size:function(){return this.length;},get:function(num){return num===undefined?Array.prototype.slice.call(this):this[num];},pushStack:function(elems,name,selector){var ret=jQuery(elems);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 ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(typeof name==="string")
-if(value===undefined)
-return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}
-return this.each(function(i){for(name in options)
-jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){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]){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([]);},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){var ret=this.map(function(){if(!jQuery.support.noCloneEvent&&!jQuery.isXMLDoc(this)){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);});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 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")
-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;if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)
-return null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery(option).val();if(one)
-return value;values.push(value);}}
-return values;}
-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;}}};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(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(typeof target==="boolean"){deep=target;target=arguments[1]||{};i=2;}
-if(typeof target!=="object"&&!jQuery.isFunction(target))
-target={};if(length==i){target=this;--i;}
-for(;i<length;i++)
-if((options=arguments[i])!=null)
-for(var name in options){var src=target[name],copy=options[name];if(target===copy)
-continue;if(deep&&copy&&typeof copy==="object"&&!copy.nodeType)
-target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy);else if(copy!==undefined)
-target[name]=copy;}
-return target;};var exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{},toString=Object.prototype.toString;jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)
-window.jQuery=_jQuery;return jQuery;},isFunction:function(obj){return toString.call(obj)==="[object Function]";},isArray:function(obj){return toString.call(obj)==="[object Array]";},isXMLDoc:function(elem){return elem.nodeType===9&&elem.documentElement.nodeName!=="HTML"||!!elem.ownerDocument&&jQuery.isXMLDoc(elem.ownerDocument);},globalEval:function(data){if(data&&/\S/.test(data)){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;head.insertBefore(script,head.firstChild);head.removeChild(script);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},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;}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){if(jQuery.isFunction(value))
-value=value.call(elem,i);return typeof value==="number"&&type=="curCSS"&&!exclude.test(name)?value+"px":value;},className:{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;});},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(" "):"";},has:function(elem,className){return elem&&jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}
-callback.call(elem);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;if(name=="opacity"&&!jQuery.support.opacity){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}
-if(name.match(/float/i))
-name=styleFloat;if(!force&&style&&style[name])
-ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))
-name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();try{var computedStyle=defaultView.getComputedStyle(elem,null);}catch(e){}
-if(computedStyle)
-ret=computedStyle.getPropertyValue(name);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];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=ret||0;ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft;}}
-return ret;},clean:function(elems,context,fragment){context=context||document;if(typeof context.createElement==="undefined")
-context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;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;if(typeof elem==="string"){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+"></"+tag+">";});var tags=elem.replace(/^\s+/,"").substring(0,10).toLowerCase();var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!jQuery.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)
-div=div.lastChild;if(!jQuery.support.tbody){var hasBody=/<tbody/i.test(elem),tbody=!tags.indexOf("<table")&&!hasBody?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&!hasBody?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j)
-if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)
-tbody[j].parentNode.removeChild(tbody[j]);}
-if(!jQuery.support.leadingWhitespace&&/^\s/.test(elem))
-div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);elem=jQuery.makeArray(div.childNodes);}
-if(elem.nodeType)
-ret.push(elem);else
-ret=jQuery.merge(ret,elem);});if(fragment){for(var i=0;ret[i];i++){if(jQuery.nodeName(ret[i],"script")&&(!ret[i].type||ret[i].type.toLowerCase()==="text/javascript")){scripts.push(ret[i].parentNode?ret[i].parentNode.removeChild(ret[i]):ret[i]);}else{if(ret[i].nodeType===1)
-ret.splice.apply(ret,[i+1,0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))));fragment.appendChild(ret[i]);}}
-return scripts;}
-return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)
-return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&elem.parentNode)
-elem.parentNode.selectedIndex;if(name in elem&&notxml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)
-throw"type property can't be changed";elem[name]=value;}
-if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))
-return elem.getAttributeNode(name).nodeValue;if(name=="tabIndex"){var attributeNode=elem.getAttributeNode("tabIndex");return attributeNode&&attributeNode.specified?attributeNode.value:elem.nodeName.match(/(button|input|object|select|textarea)/i)?0:elem.nodeName.match(/^(a|area)$/i)&&elem.href?0:undefined;}
-return elem[name];}
-if(!jQuery.support.style&&notxml&&name=="style")
-return jQuery.attr(elem.style,"cssText",value);if(set)
-elem.setAttribute(name,""+value);var attr=!jQuery.support.hrefNormalized&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}
-if(!jQuery.support.opacity&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+
-(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}
-return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}
-name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set&&value!='NaNpx'&&value!='nullpx')
-elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||typeof array==="string"||jQuery.isFunction(array)||array.setInterval)
-ret[0]=array;else
-while(i)
-ret[--i]=array[i];}
-return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i<length;i++)
-if(array[i]===elem)
-return i;return-1;},merge:function(first,second){var i=0,elem,pos=first.length;if(!jQuery.support.getAll){while((elem=second[i++])!=null)
-if(elem.nodeType!=8)
-first[pos++]=elem;}else
-while((elem=second[i++])!=null)
-first[pos++]=elem;return first;},unique:function(array){var ret=[],done={};try{for(var i=0,length=array.length;i<length;i++){var id=jQuery.data(array[i]);if(!done[id]){done[id]=true;ret.push(array[i]);}}}catch(e){ret=array;}
-return ret;},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++)
-if(!inv!=!callback(elems[i],i))
-ret.push(elems[i]);return ret;},map:function(elems,callback){var ret=[];for(var i=0,length=elems.length;i<length;i++){var value=callback(elems[i],i);if(value!=null)
-ret[ret.length]=value;}
-return ret.concat.apply([],ret);}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,'0'])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};jQuery.each({parent:function(elem){return elem.parentNode;},parents:function(elem){return jQuery.dir(elem,"parentNode");},next:function(elem){return jQuery.nth(elem,2,"nextSibling");},prev:function(elem){return jQuery.nth(elem,2,"previousSibling");},nextAll:function(elem){return jQuery.dir(elem,"nextSibling");},prevAll:function(elem){return jQuery.dir(elem,"previousSibling");},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},children:function(elem){return jQuery.sibling(elem.firstChild);},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);if(selector&&typeof selector=="string")
-ret=jQuery.multiFilter(selector,ret);return this.pushStack(jQuery.unique(ret),name,selector);};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(selector){var ret=[],insert=jQuery(selector);for(var i=0,l=insert.length;i<l;i++){var elems=(i>0?this.clone(true):this).get();jQuery.fn[original].apply(jQuery(insert[i]),elems);ret=ret.concat(elems);}
-return this.pushStack(ret,name,selector);};});jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");if(this.nodeType==1)
-this.removeAttribute(name);},addClass:function(classNames){jQuery.className.add(this,classNames);},removeClass:function(classNames){jQuery.className.remove(this,classNames);},toggleClass:function(classNames,state){if(typeof state!=="boolean")
-state=!jQuery.className.has(this,classNames);jQuery.className[state?"add":"remove"](this,classNames);},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).length){jQuery("*",this).add([this]).each(function(){jQuery.event.remove(this);jQuery.removeData(this);});if(this.parentNode)
-this.parentNode.removeChild(this);}},empty:function(){jQuery(this).children().remove();while(this.firstChild)
-this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}
-var expando="jQuery"+now(),uuid=0,windowData={};jQuery.extend({cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;var id=elem[expando];if(!id)
-id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])
-jQuery.cache[id]={};if(data!==undefined)
-jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?windowData:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])
-break;if(!name)
-jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)
-elem.removeAttribute(expando);}
-delete jQuery.cache[id];}},queue:function(elem,type,data){if(elem){type=(type||"fx")+"queue";var q=jQuery.data(elem,type);if(!q||jQuery.isArray(data))
-q=jQuery.data(elem,type,jQuery.makeArray(data));else if(data)
-q.push(data);}
-return q;},dequeue:function(elem,type){var queue=jQuery.queue(elem,type),fn=queue.shift();if(!type||type==="fx")
-fn=queue[0];if(fn!==undefined)
-fn.call(elem);}});jQuery.fn.extend({data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)
-data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else
-return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},queue:function(type,data){if(typeof type!=="string"){data=type;type="fx";}
-if(data===undefined)
-return jQuery.queue(this[0],type);return this.each(function(){var queue=jQuery.queue(this,type,data);if(type=="fx"&&queue.length==1)
-queue[0].call(this);});},dequeue:function(type){return this.each(function(){jQuery.dequeue(this,type);});}});(function(){var chunker=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,done=0,toString=Object.prototype.toString;var Sizzle=function(selector,context,results,seed){results=results||[];context=context||document;if(context.nodeType!==1&&context.nodeType!==9)
-return[];if(!selector||typeof selector!=="string"){return results;}
-var parts=[],m,set,checkSet,check,mode,extra,prune=true;chunker.lastIndex=0;while((m=chunker.exec(selector))!==null){parts.push(m[1]);if(m[2]){extra=RegExp.rightContext;break;}}
-if(parts.length>1&&origPOS.exec(selector)){if(parts.length===2&&Expr.relative[parts[0]]){set=posProcess(parts[0]+parts[1],context);}else{set=Expr.relative[parts[0]]?[context]:Sizzle(parts.shift(),context);while(parts.length){selector=parts.shift();if(Expr.relative[selector])
-selector+=parts.shift();set=posProcess(selector,set);}}}else{var ret=seed?{expr:parts.pop(),set:makeArray(seed)}:Sizzle.find(parts.pop(),parts.length===1&&context.parentNode?context.parentNode:context,isXML(context));set=Sizzle.filter(ret.expr,ret.set);if(parts.length>0){checkSet=makeArray(set);}else{prune=false;}
-while(parts.length){var cur=parts.pop(),pop=cur;if(!Expr.relative[cur]){cur="";}else{pop=parts.pop();}
-if(pop==null){pop=context;}
-Expr.relative[cur](checkSet,pop,isXML(context));}}
-if(!checkSet){checkSet=set;}
-if(!checkSet){throw"Syntax error, unrecognized expression: "+(cur||selector);}
-if(toString.call(checkSet)==="[object Array]"){if(!prune){results.push.apply(results,checkSet);}else if(context.nodeType===1){for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&(checkSet[i]===true||checkSet[i].nodeType===1&&contains(context,checkSet[i]))){results.push(set[i]);}}}else{for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&checkSet[i].nodeType===1){results.push(set[i]);}}}}else{makeArray(checkSet,results);}
-if(extra){Sizzle(extra,context,results,seed);if(sortOrder){hasDuplicate=false;results.sort(sortOrder);if(hasDuplicate){for(var i=1;i<results.length;i++){if(results[i]===results[i-1]){results.splice(i--,1);}}}}}
-return results;};Sizzle.matches=function(expr,set){return Sizzle(expr,null,null,set);};Sizzle.find=function(expr,context,isXML){var set,match;if(!expr){return[];}
-for(var i=0,l=Expr.order.length;i<l;i++){var type=Expr.order[i],match;if((match=Expr.match[type].exec(expr))){var left=RegExp.leftContext;if(left.substr(left.length-1)!=="\\"){match[1]=(match[1]||"").replace(/\\/g,"");set=Expr.find[type](match,context,isXML);if(set!=null){expr=expr.replace(Expr.match[type],"");break;}}}}
-if(!set){set=context.getElementsByTagName("*");}
-return{set:set,expr:expr};};Sizzle.filter=function(expr,set,inplace,not){var old=expr,result=[],curLoop=set,match,anyFound,isXMLFilter=set&&set[0]&&isXML(set[0]);while(expr&&set.length){for(var type in Expr.filter){if((match=Expr.match[type].exec(expr))!=null){var filter=Expr.filter[type],found,item;anyFound=false;if(curLoop==result){result=[];}
-if(Expr.preFilter[type]){match=Expr.preFilter[type](match,curLoop,inplace,result,not,isXMLFilter);if(!match){anyFound=found=true;}else if(match===true){continue;}}
-if(match){for(var i=0;(item=curLoop[i])!=null;i++){if(item){found=filter(item,match,i,curLoop);var pass=not^!!found;if(inplace&&found!=null){if(pass){anyFound=true;}else{curLoop[i]=false;}}else if(pass){result.push(item);anyFound=true;}}}}
-if(found!==undefined){if(!inplace){curLoop=result;}
-expr=expr.replace(Expr.match[type],"");if(!anyFound){return[];}
-break;}}}
-if(expr==old){if(anyFound==null){throw"Syntax error, unrecognized expression: "+expr;}else{break;}}
-old=expr;}
-return curLoop;};var Expr=Sizzle.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(elem){return elem.getAttribute("href");}},relative:{"+":function(checkSet,part,isXML){var isPartStr=typeof part==="string",isTag=isPartStr&&!/\W/.test(part),isPartStrNotTag=isPartStr&&!isTag;if(isTag&&!isXML){part=part.toUpperCase();}
-for(var i=0,l=checkSet.length,elem;i<l;i++){if((elem=checkSet[i])){while((elem=elem.previousSibling)&&elem.nodeType!==1){}
-checkSet[i]=isPartStrNotTag||elem&&elem.nodeName===part?elem||false:elem===part;}}
-if(isPartStrNotTag){Sizzle.filter(part,checkSet,true);}},">":function(checkSet,part,isXML){var isPartStr=typeof part==="string";if(isPartStr&&!/\W/.test(part)){part=isXML?part:part.toUpperCase();for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){var parent=elem.parentNode;checkSet[i]=parent.nodeName===part?parent:false;}}}else{for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){checkSet[i]=isPartStr?elem.parentNode:elem.parentNode===part;}}
-if(isPartStr){Sizzle.filter(part,checkSet,true);}}},"":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(!part.match(/\W/)){var nodeCheck=part=isXML?part:part.toUpperCase();checkFn=dirNodeCheck;}
-checkFn("parentNode",part,doneName,checkSet,nodeCheck,isXML);},"~":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(typeof part==="string"&&!part.match(/\W/)){var nodeCheck=part=isXML?part:part.toUpperCase();checkFn=dirNodeCheck;}
-checkFn("previousSibling",part,doneName,checkSet,nodeCheck,isXML);}},find:{ID:function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?[m]:[];}},NAME:function(match,context,isXML){if(typeof context.getElementsByName!=="undefined"){var ret=[],results=context.getElementsByName(match[1]);for(var i=0,l=results.length;i<l;i++){if(results[i].getAttribute("name")===match[1]){ret.push(results[i]);}}
-return ret.length===0?null:ret;}},TAG:function(match,context){return context.getElementsByTagName(match[1]);}},preFilter:{CLASS:function(match,curLoop,inplace,result,not,isXML){match=" "+match[1].replace(/\\/g,"")+" ";if(isXML){return match;}
-for(var i=0,elem;(elem=curLoop[i])!=null;i++){if(elem){if(not^(elem.className&&(" "+elem.className+" ").indexOf(match)>=0)){if(!inplace)
-result.push(elem);}else if(inplace){curLoop[i]=false;}}}
-return false;},ID:function(match){return match[1].replace(/\\/g,"");},TAG:function(match,curLoop){for(var i=0;curLoop[i]===false;i++){}
-return curLoop[i]&&isXML(curLoop[i])?match[1]:match[1].toUpperCase();},CHILD:function(match){if(match[1]=="nth"){var test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(match[2]=="even"&&"2n"||match[2]=="odd"&&"2n+1"||!/\D/.test(match[2])&&"0n+"+match[2]||match[2]);match[2]=(test[1]+(test[2]||1))-0;match[3]=test[3]-0;}
-match[0]=done++;return match;},ATTR:function(match,curLoop,inplace,result,not,isXML){var name=match[1].replace(/\\/g,"");if(!isXML&&Expr.attrMap[name]){match[1]=Expr.attrMap[name];}
-if(match[2]==="~="){match[4]=" "+match[4]+" ";}
-return match;},PSEUDO:function(match,curLoop,inplace,result,not){if(match[1]==="not"){if(match[3].match(chunker).length>1||/^\w/.test(match[3])){match[3]=Sizzle(match[3],null,null,curLoop);}else{var ret=Sizzle.filter(match[3],curLoop,inplace,true^not);if(!inplace){result.push.apply(result,ret);}
-return false;}}else if(Expr.match.POS.test(match[0])||Expr.match.CHILD.test(match[0])){return true;}
-return match;},POS:function(match){match.unshift(true);return match;}},filters:{enabled:function(elem){return elem.disabled===false&&elem.type!=="hidden";},disabled:function(elem){return elem.disabled===true;},checked:function(elem){return elem.checked===true;},selected:function(elem){elem.parentNode.selectedIndex;return elem.selected===true;},parent:function(elem){return!!elem.firstChild;},empty:function(elem){return!elem.firstChild;},has:function(elem,i,match){return!!Sizzle(match[3],elem).length;},header:function(elem){return/h\d/i.test(elem.nodeName);},text:function(elem){return"text"===elem.type;},radio:function(elem){return"radio"===elem.type;},checkbox:function(elem){return"checkbox"===elem.type;},file:function(elem){return"file"===elem.type;},password:function(elem){return"password"===elem.type;},submit:function(elem){return"submit"===elem.type;},image:function(elem){return"image"===elem.type;},reset:function(elem){return"reset"===elem.type;},button:function(elem){return"button"===elem.type||elem.nodeName.toUpperCase()==="BUTTON";},input:function(elem){return/input|select|textarea|button/i.test(elem.nodeName);}},setFilters:{first:function(elem,i){return i===0;},last:function(elem,i,match,array){return i===array.length-1;},even:function(elem,i){return i%2===0;},odd:function(elem,i){return i%2===1;},lt:function(elem,i,match){return i<match[3]-0;},gt:function(elem,i,match){return i>match[3]-0;},nth:function(elem,i,match){return match[3]-0==i;},eq:function(elem,i,match){return match[3]-0==i;}},filter:{PSEUDO:function(elem,match,i,array){var name=match[1],filter=Expr.filters[name];if(filter){return filter(elem,i,match,array);}else if(name==="contains"){return(elem.textContent||elem.innerText||"").indexOf(match[3])>=0;}else if(name==="not"){var not=match[3];for(var i=0,l=not.length;i<l;i++){if(not[i]===elem){return false;}}
-return true;}},CHILD:function(elem,match){var type=match[1],node=elem;switch(type){case'only':case'first':while(node=node.previousSibling){if(node.nodeType===1)return false;}
-if(type=='first')return true;node=elem;case'last':while(node=node.nextSibling){if(node.nodeType===1)return false;}
-return true;case'nth':var first=match[2],last=match[3];if(first==1&&last==0){return true;}
-var doneName=match[0],parent=elem.parentNode;if(parent&&(parent.sizcache!==doneName||!elem.nodeIndex)){var count=0;for(node=parent.firstChild;node;node=node.nextSibling){if(node.nodeType===1){node.nodeIndex=++count;}}
-parent.sizcache=doneName;}
-var diff=elem.nodeIndex-last;if(first==0){return diff==0;}else{return(diff%first==0&&diff/first>=0);}}},ID:function(elem,match){return elem.nodeType===1&&elem.getAttribute("id")===match;},TAG:function(elem,match){return(match==="*"&&elem.nodeType===1)||elem.nodeName===match;},CLASS:function(elem,match){return(" "+(elem.className||elem.getAttribute("class"))+" ").indexOf(match)>-1;},ATTR:function(elem,match){var name=match[1],result=Expr.attrHandle[name]?Expr.attrHandle[name](elem):elem[name]!=null?elem[name]:elem.getAttribute(name),value=result+"",type=match[2],check=match[4];return result==null?type==="!=":type==="="?value===check:type==="*="?value.indexOf(check)>=0:type==="~="?(" "+value+" ").indexOf(check)>=0:!check?value&&result!==false:type==="!="?value!=check:type==="^="?value.indexOf(check)===0:type==="$="?value.substr(value.length-check.length)===check:type==="|="?value===check||value.substr(0,check.length+1)===check+"-":false;},POS:function(elem,match,i,array){var name=match[2],filter=Expr.setFilters[name];if(filter){return filter(elem,i,match,array);}}}};var origPOS=Expr.match.POS;for(var type in Expr.match){Expr.match[type]=RegExp(Expr.match[type].source+/(?![^\[]*\])(?![^\(]*\))/.source);}
-var makeArray=function(array,results){array=Array.prototype.slice.call(array);if(results){results.push.apply(results,array);return results;}
-return array;};try{Array.prototype.slice.call(document.documentElement.childNodes);}catch(e){makeArray=function(array,results){var ret=results||[];if(toString.call(array)==="[object Array]"){Array.prototype.push.apply(ret,array);}else{if(typeof array.length==="number"){for(var i=0,l=array.length;i<l;i++){ret.push(array[i]);}}else{for(var i=0;array[i];i++){ret.push(array[i]);}}}
-return ret;};}
-var sortOrder;if(document.documentElement.compareDocumentPosition){sortOrder=function(a,b){var ret=a.compareDocumentPosition(b)&4?-1:a===b?0:1;if(ret===0){hasDuplicate=true;}
-return ret;};}else if("sourceIndex"in document.documentElement){sortOrder=function(a,b){var ret=a.sourceIndex-b.sourceIndex;if(ret===0){hasDuplicate=true;}
-return ret;};}else if(document.createRange){sortOrder=function(a,b){var aRange=a.ownerDocument.createRange(),bRange=b.ownerDocument.createRange();aRange.selectNode(a);aRange.collapse(true);bRange.selectNode(b);bRange.collapse(true);var ret=aRange.compareBoundaryPoints(Range.START_TO_END,bRange);if(ret===0){hasDuplicate=true;}
-return ret;};}
-(function(){var form=document.createElement("form"),id="script"+(new Date).getTime();form.innerHTML="<input name='"+id+"'/>";var root=document.documentElement;root.insertBefore(form,root.firstChild);if(!!document.getElementById(id)){Expr.find.ID=function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?m.id===match[1]||typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id").nodeValue===match[1]?[m]:undefined:[];}};Expr.filter.ID=function(elem,match){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");return elem.nodeType===1&&node&&node.nodeValue===match;};}
-root.removeChild(form);})();(function(){var div=document.createElement("div");div.appendChild(document.createComment(""));if(div.getElementsByTagName("*").length>0){Expr.find.TAG=function(match,context){var results=context.getElementsByTagName(match[1]);if(match[1]==="*"){var tmp=[];for(var i=0;results[i];i++){if(results[i].nodeType===1){tmp.push(results[i]);}}
-results=tmp;}
-return results;};}
-div.innerHTML="<a href='#'></a>";if(div.firstChild&&typeof div.firstChild.getAttribute!=="undefined"&&div.firstChild.getAttribute("href")!=="#"){Expr.attrHandle.href=function(elem){return elem.getAttribute("href",2);};}})();if(document.querySelectorAll)(function(){var oldSizzle=Sizzle,div=document.createElement("div");div.innerHTML="<p class='TEST'></p>";if(div.querySelectorAll&&div.querySelectorAll(".TEST").length===0){return;}
-Sizzle=function(query,context,extra,seed){context=context||document;if(!seed&&context.nodeType===9&&!isXML(context)){try{return makeArray(context.querySelectorAll(query),extra);}catch(e){}}
-return oldSizzle(query,context,extra,seed);};Sizzle.find=oldSizzle.find;Sizzle.filter=oldSizzle.filter;Sizzle.selectors=oldSizzle.selectors;Sizzle.matches=oldSizzle.matches;})();if(document.getElementsByClassName&&document.documentElement.getElementsByClassName)(function(){var div=document.createElement("div");div.innerHTML="<div class='test e'></div><div class='test'></div>";if(div.getElementsByClassName("e").length===0)
-return;div.lastChild.className="e";if(div.getElementsByClassName("e").length===1)
-return;Expr.order.splice(1,0,"CLASS");Expr.find.CLASS=function(match,context,isXML){if(typeof context.getElementsByClassName!=="undefined"&&!isXML){return context.getElementsByClassName(match[1]);}};})();function dirNodeCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){var sibDir=dir=="previousSibling"&&!isXML;for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){if(sibDir&&elem.nodeType===1){elem.sizcache=doneName;elem.sizset=i;}
-elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break;}
-if(elem.nodeType===1&&!isXML){elem.sizcache=doneName;elem.sizset=i;}
-if(elem.nodeName===cur){match=elem;break;}
-elem=elem[dir];}
-checkSet[i]=match;}}}
-function dirCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){var sibDir=dir=="previousSibling"&&!isXML;for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){if(sibDir&&elem.nodeType===1){elem.sizcache=doneName;elem.sizset=i;}
-elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break;}
-if(elem.nodeType===1){if(!isXML){elem.sizcache=doneName;elem.sizset=i;}
-if(typeof cur!=="string"){if(elem===cur){match=true;break;}}else if(Sizzle.filter(cur,[elem]).length>0){match=elem;break;}}
-elem=elem[dir];}
-checkSet[i]=match;}}}
-var contains=document.compareDocumentPosition?function(a,b){return a.compareDocumentPosition(b)&16;}:function(a,b){return a!==b&&(a.contains?a.contains(b):true);};var isXML=function(elem){return elem.nodeType===9&&elem.documentElement.nodeName!=="HTML"||!!elem.ownerDocument&&isXML(elem.ownerDocument);};var posProcess=function(selector,context){var tmpSet=[],later="",match,root=context.nodeType?[context]:context;while((match=Expr.match.PSEUDO.exec(selector))){later+=match[0];selector=selector.replace(Expr.match.PSEUDO,"");}
-selector=Expr.relative[selector]?selector+"*":selector;for(var i=0,l=root.length;i<l;i++){Sizzle(selector,root[i],tmpSet);}
-return Sizzle.filter(later,tmpSet);};jQuery.find=Sizzle;jQuery.filter=Sizzle.filter;jQuery.expr=Sizzle.selectors;jQuery.expr[":"]=jQuery.expr.filters;Sizzle.selectors.filters.hidden=function(elem){return elem.offsetWidth===0||elem.offsetHeight===0;};Sizzle.selectors.filters.visible=function(elem){return elem.offsetWidth>0||elem.offsetHeight>0;};Sizzle.selectors.filters.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){return elem===fn.elem;}).length;};jQuery.multiFilter=function(expr,elems,not){if(not){expr=":not("+expr+")";}
-return Sizzle.matches(expr,elems);};jQuery.dir=function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)
-matched.push(cur);cur=cur[dir];}
-return matched;};jQuery.nth=function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])
-if(cur.nodeType==1&&++num==result)
-break;return cur;};jQuery.sibling=function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)
-r.push(n);}
-return r;};return;window.Sizzle=Sizzle;})();jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)
-return;if(elem.setInterval&&elem!=window)
-elem=window;if(!handler.guid)
-handler.guid=this.guid++;if(data!==undefined){var fn=handler;handler=this.proxy(fn);handler.data=data;}
-var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){return typeof jQuery!=="undefined"&&!jQuery.event.triggered?jQuery.event.handle.apply(arguments.callee.elem,arguments):undefined;});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var namespaces=type.split(".");type=namespaces.shift();handler.type=namespaces.slice().sort().join(".");var handlers=events[type];if(jQuery.event.specialAll[type])
-jQuery.event.specialAll[type].setup.call(elem,data,namespaces);if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem,data,namespaces)===false){if(elem.addEventListener)
-elem.addEventListener(type,handle,false);else if(elem.attachEvent)
-elem.attachEvent("on"+type,handle);}}
-handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)
-return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types===undefined||(typeof types==="string"&&types.charAt(0)=="."))
-for(var type in events)
-this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}
-jQuery.each(types.split(/\s+/),function(index,type){var namespaces=type.split(".");type=namespaces.shift();var namespace=RegExp("(^|\\.)"+namespaces.slice().sort().join(".*\\.")+"(\\.|$)");if(events[type]){if(handler)
-delete events[type][handler.guid];else
-for(var handle in events[type])
-if(namespace.test(events[type][handle].type))
-delete events[type][handle];if(jQuery.event.specialAll[type])
-jQuery.event.specialAll[type].teardown.call(elem,namespaces);for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem,namespaces)===false){if(elem.removeEventListener)
-elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)
-elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}
-ret=null;delete events[type];}}});}
-for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(event,data,elem,bubbling){var type=event.type||event;if(!bubbling){event=typeof event==="object"?event[expando]?event:jQuery.extend(jQuery.Event(type),event):jQuery.Event(type);if(type.indexOf("!")>=0){event.type=type=type.slice(0,-1);event.exclusive=true;}
-if(!elem){event.stopPropagation();if(this.global[type])
-jQuery.each(jQuery.cache,function(){if(this.events&&this.events[type])
-jQuery.event.trigger(event,data,this.handle.elem);});}
-if(!elem||elem.nodeType==3||elem.nodeType==8)
-return undefined;event.result=undefined;event.target=elem;data=jQuery.makeArray(data);data.unshift(event);}
-event.currentTarget=elem;var handle=jQuery.data(elem,"handle");if(handle)
-handle.apply(elem,data);if((!elem[type]||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)
-event.result=false;if(!bubbling&&elem[type]&&!event.isDefaultPrevented()&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}
-this.triggered=false;if(!event.isPropagationStopped()){var parent=elem.parentNode||elem.ownerDocument;if(parent)
-jQuery.event.trigger(event,data,parent,true);}},handle:function(event){var all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);event.currentTarget=this;var namespaces=event.type.split(".");event.type=namespaces.shift();all=!namespaces.length&&!event.exclusive;var namespace=RegExp("(^|\\.)"+namespaces.slice().sort().join(".*\\.")+"(\\.|$)");handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||namespace.test(handler.type)){event.handler=handler;event.data=handler.data;var ret=handler.apply(this,arguments);if(ret!==undefined){event.result=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}
-if(event.isImmediatePropagationStopped())
-break;}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(event){if(event[expando])
-return event;var originalEvent=event;event=jQuery.Event(originalEvent);for(var i=this.props.length,prop;i;){prop=this.props[--i];event[prop]=originalEvent[prop];}
-if(!event.target)
-event.target=event.srcElement||document;if(event.target.nodeType==3)
-event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)
-event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}
-if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))
-event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)
-event.metaKey=event.ctrlKey;if(!event.which&&event.button)
-event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy=proxy||function(){return fn.apply(this,arguments);};proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:bindReady,teardown:function(){}}},specialAll:{live:{setup:function(selector,namespaces){jQuery.event.add(this,namespaces[0],liveHandler);},teardown:function(namespaces){if(namespaces.length){var remove=0,name=RegExp("(^|\\.)"+namespaces[0]+"(\\.|$)");jQuery.each((jQuery.data(this,"events").live||{}),function(){if(name.test(this.type))
-remove++;});if(remove<1)
-jQuery.event.remove(this,namespaces[0],liveHandler);}}}}};jQuery.Event=function(src){if(!this.preventDefault)
-return new jQuery.Event(src);if(src&&src.type){this.originalEvent=src;this.type=src.type;}else
-this.type=src;this.timeStamp=now();this[expando]=true;};function returnFalse(){return false;}
-function returnTrue(){return true;}
-jQuery.Event.prototype={preventDefault:function(){this.isDefaultPrevented=returnTrue;var e=this.originalEvent;if(!e)
-return;if(e.preventDefault)
-e.preventDefault();e.returnValue=false;},stopPropagation:function(){this.isPropagationStopped=returnTrue;var e=this.originalEvent;if(!e)
-return;if(e.stopPropagation)
-e.stopPropagation();e.cancelBubble=true;},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=returnTrue;this.stopPropagation();},isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse};var withinElement=function(event){var parent=event.relatedTarget;while(parent&&parent!=this)
-try{parent=parent.parentNode;}
-catch(e){parent=this;}
-if(parent!=this){event.type=event.data;jQuery.event.handle.apply(this,arguments);}};jQuery.each({mouseover:'mouseenter',mouseout:'mouseleave'},function(orig,fix){jQuery.event.special[fix]={setup:function(){jQuery.event.add(this,orig,withinElement,fix);},teardown:function(){jQuery.event.remove(this,orig,withinElement);}};});jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data){return this.each(function(){jQuery.event.trigger(type,data,this);});},triggerHandler:function(type,data){if(this[0]){var event=jQuery.Event(type);event.preventDefault();event.stopPropagation();jQuery.event.trigger(event,data,this[0]);return event.result;}},toggle:function(fn){var args=arguments,i=1;while(i<args.length)
-jQuery.event.proxy(fn,args[i++]);return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;event.preventDefault();return args[this.lastToggle++].apply(this,arguments)||false;}));},hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut);},ready:function(fn){bindReady();if(jQuery.isReady)
-fn.call(document,jQuery);else
-jQuery.readyList.push(fn);return this;},live:function(type,fn){var proxy=jQuery.event.proxy(fn);proxy.guid+=this.selector+type;jQuery(document).bind(liveConvert(type,this.selector),this.selector,proxy);return this;},die:function(type,fn){jQuery(document).unbind(liveConvert(type,this.selector),fn?{guid:fn.guid+this.selector+type}:null);return this;}});function liveHandler(event){var check=RegExp("(^|\\.)"+event.type+"(\\.|$)"),stop=true,elems=[];jQuery.each(jQuery.data(this,"events").live||[],function(i,fn){if(check.test(fn.type)){var elem=jQuery(event.target).closest(fn.data)[0];if(elem)
-elems.push({elem:elem,fn:fn});}});elems.sort(function(a,b){return jQuery.data(a.elem,"closest")-jQuery.data(b.elem,"closest");});jQuery.each(elems,function(){if(this.fn.call(this.elem,event,this.fn.data)===false)
-return(stop=false);});return stop;}
-function liveConvert(type,selector){return["live",type,selector.replace(/\./g,"`").replace(/ /g,"|")].join(".");}
-jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document,jQuery);});jQuery.readyList=null;}
-jQuery(document).triggerHandler("ready");}}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);jQuery.ready();},false);}else if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);jQuery.ready();}});if(document.documentElement.doScroll&&window==window.top)(function(){if(jQuery.isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}
-jQuery.ready();})();}
-jQuery.event.add(window,"load",jQuery.ready);}
-jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,"+"change,select,submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name);};});jQuery(window).bind('unload',function(){for(var id in jQuery.cache)
-if(id!=1&&jQuery.cache[id].handle)
-jQuery.event.remove(jQuery.cache[id].handle.elem);});(function(){jQuery.support={};var root=document.documentElement,script=document.createElement("script"),div=document.createElement("div"),id="script"+(new Date).getTime();div.style.display="none";div.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var all=div.getElementsByTagName("*"),a=div.getElementsByTagName("a")[0];if(!all||!all.length||!a){return;}
-jQuery.support={leadingWhitespace:div.firstChild.nodeType==3,tbody:!div.getElementsByTagName("tbody").length,objectAll:!!div.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!div.getElementsByTagName("link").length,style:/red/.test(a.getAttribute("style")),hrefNormalized:a.getAttribute("href")==="/a",opacity:a.style.opacity==="0.5",cssFloat:!!a.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};script.type="text/javascript";try{script.appendChild(document.createTextNode("window."+id+"=1;"));}catch(e){}
-root.insertBefore(script,root.firstChild);if(window[id]){jQuery.support.scriptEval=true;delete window[id];}
-root.removeChild(script);if(div.attachEvent&&div.fireEvent){div.attachEvent("onclick",function(){jQuery.support.noCloneEvent=false;div.detachEvent("onclick",arguments.callee);});div.cloneNode(true).fireEvent("onclick");}
-jQuery(function(){var div=document.createElement("div");div.style.width=div.style.paddingLeft="1px";document.body.appendChild(div);jQuery.boxModel=jQuery.support.boxModel=div.offsetWidth===2;document.body.removeChild(div).style.display='none';});})();var styleFloat=jQuery.support.cssFloat?"cssFloat":"styleFloat";jQuery.props={"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!=="string")
-return this._load(url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}
-var type="GET";if(params)
-if(jQuery.isFunction(params)){callback=params;params=null;}else if(typeof params==="object"){params=jQuery.param(params);type="POST";}
-var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")
-self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);if(callback)
-self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return this.elements?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:jQuery.isArray(val)?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}
-return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}
-return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!=="string")
-s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))
-s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))
-s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}
-if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)
-s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}
-if(head)
-head.removeChild(script);};}
-if(s.dataType=="script"&&s.cache==null)
-s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}
-if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}
-if(s.global&&!jQuery.active++)
-jQuery.event.trigger("ajaxStart");var parts=/^(\w+:)?\/\/([^\/?#]+)/.exec(s.url);if(s.dataType=="script"&&type=="GET"&&parts&&(parts[1]&&parts[1]!=location.protocol||parts[2]!=location.host)){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)
-script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();script.onload=script.onreadystatechange=null;head.removeChild(script);}};}
-head.appendChild(script);return undefined;}
-var requestDone=false;var xhr=s.xhr();if(s.username)
-xhr.open(type,s.url,s.async,s.username,s.password);else
-xhr.open(type,s.url,s.async);try{if(s.data)
-xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)
-xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}
-if(s.beforeSend&&s.beforeSend(xhr,s)===false){if(s.global&&!--jQuery.active)
-jQuery.event.trigger("ajaxStop");xhr.abort();return false;}
-if(s.global)
-jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(xhr.readyState==0){if(ival){clearInterval(ival);ival=null;if(s.global&&!--jQuery.active)
-jQuery.event.trigger("ajaxStop");}}else if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}
-status=isTimeout=="timeout"?"timeout":!jQuery.httpSuccess(xhr)?"error":s.ifModified&&jQuery.httpNotModified(xhr,s.url)?"notmodified":"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s);}catch(e){status="parsererror";}}
-if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}
-if(s.ifModified&&modRes)
-jQuery.lastModified[s.url]=modRes;if(!jsonp)
-success();}else
-jQuery.handleError(s,xhr,status);complete();if(isTimeout)
-xhr.abort();if(s.async)
-xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)
-setTimeout(function(){if(xhr&&!requestDone)
-onreadystatechange("timeout");},s.timeout);}
-try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}
-if(!s.async)
-onreadystatechange();function success(){if(s.success)
-s.success(data,status);if(s.global)
-jQuery.event.trigger("ajaxSuccess",[xhr,s]);}
-function complete(){if(s.complete)
-s.complete(xhr,status);if(s.global)
-jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)
-jQuery.event.trigger("ajaxStop");}
-return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)
-jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223;}catch(e){}
-return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url];}catch(e){}
-return false;},httpData:function(xhr,type,s){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")
-throw"parsererror";if(s&&s.dataFilter)
-data=s.dataFilter(data,type);if(typeof data==="string"){if(type=="script")
-jQuery.globalEval(data);if(type=="json")
-data=window["eval"]("("+data+")");}
-return data;},param:function(a){var s=[];function add(key,value){s[s.length]=encodeURIComponent(key)+'='+encodeURIComponent(value);};if(jQuery.isArray(a)||a.jquery)
-jQuery.each(a,function(){add(this.name,this.value);});else
-for(var j in a)
-if(jQuery.isArray(a[j]))
-jQuery.each(a[j],function(){add(j,this);});else
-add(j,jQuery.isFunction(a[j])?a[j]():a[j]);return s.join("&").replace(/%20/g,"+");}});var elemdisplay={},timerId,fxAttrs=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function genFx(type,num){var obj={};jQuery.each(fxAttrs.concat.apply([],fxAttrs.slice(0,num)),function(){obj[this]=type;});return obj;}
-jQuery.fn.extend({show:function(speed,callback){if(speed){return this.animate(genFx("show",3),speed,callback);}else{for(var i=0,l=this.length;i<l;i++){var old=jQuery.data(this[i],"olddisplay");this[i].style.display=old||"";if(jQuery.css(this[i],"display")==="none"){var tagName=this[i].tagName,display;if(elemdisplay[tagName]){display=elemdisplay[tagName];}else{var elem=jQuery("<"+tagName+" />").appendTo("body");display=elem.css("display");if(display==="none")
-display="block";elem.remove();elemdisplay[tagName]=display;}
-jQuery.data(this[i],"olddisplay",display);}}
-for(var i=0,l=this.length;i<l;i++){this[i].style.display=jQuery.data(this[i],"olddisplay")||"";}
-return this;}},hide:function(speed,callback){if(speed){return this.animate(genFx("hide",3),speed,callback);}else{for(var i=0,l=this.length;i<l;i++){var old=jQuery.data(this[i],"olddisplay");if(!old&&old!=="none")
-jQuery.data(this[i],"olddisplay",jQuery.css(this[i],"display"));}
-for(var i=0,l=this.length;i<l;i++){this[i].style.display="none";}
-return this;}},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){var bool=typeof fn==="boolean";return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn==null||bool?this.each(function(){var state=bool?fn:jQuery(this).is(":hidden");jQuery(this)[state?"show":"hide"]();}):this.animate(genFx("toggle",3),fn,fn2);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){var opt=jQuery.extend({},optall),p,hidden=this.nodeType==1&&jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)
-return opt.complete.call(this);if((p=="height"||p=="width")&&this.style){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}
-if(opt.overflow!=null)
-this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))
-e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}
-if(parts[1])
-end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else
-e.custom(start,val,"");}});return true;});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)
-this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)
-if(timers[i].elem==this){if(gotoEnd)
-timers[i](true);timers.splice(i,1);}});if(!gotoEnd)
-this.dequeue();return this;}});jQuery.each({slideDown:genFx("show",1),slideUp:genFx("hide",1),slideToggle:genFx("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(name,props){jQuery.fn[name]=function(speed,callback){return this.animate(props,speed,callback);};});jQuery.extend({speed:function(speed,easing,fn){var opt=typeof speed==="object"?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!jQuery.isFunction(easing)&&easing};opt.duration=jQuery.fx.off?0:typeof opt.duration==="number"?opt.duration:jQuery.fx.speeds[opt.duration]||jQuery.fx.speeds._default;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)
-jQuery(this).dequeue();if(jQuery.isFunction(opt.old))
-opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)
-options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)
-this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style)
-this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))
-return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;var self=this;function t(gotoEnd){return self.step(gotoEnd);}
-t.elem=this.elem;if(t()&&jQuery.timers.push(t)&&!timerId){timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++)
-if(!timers[i]())
-timers.splice(i--,1);if(!timers.length){clearInterval(timerId);timerId=undefined;}},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(gotoEnd){var t=now();if(gotoEnd||t>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)
-if(this.options.curAnim[i]!==true)
-done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")
-this.elem.style.display="block";}
-if(this.options.hide)
-jQuery(this.elem).hide();if(this.options.hide||this.options.show)
-for(var p in this.options.curAnim)
-jQuery.attr(this.elem.style,p,this.options.orig[p]);this.options.complete.call(this.elem);}
-return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}
-return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){if(fx.elem.style&&fx.elem.style[fx.prop]!=null)
-fx.elem.style[fx.prop]=fx.now+fx.unit;else
-fx.elem[fx.prop]=fx.now;}}});if(document.documentElement["getBoundingClientRect"])
-jQuery.fn.offset=function(){if(!this[0])return{top:0,left:0};if(this[0]===this[0].ownerDocument.body)return jQuery.offset.bodyOffset(this[0]);var box=this[0].getBoundingClientRect(),doc=this[0].ownerDocument,body=doc.body,docElem=doc.documentElement,clientTop=docElem.clientTop||body.clientTop||0,clientLeft=docElem.clientLeft||body.clientLeft||0,top=box.top+(self.pageYOffset||jQuery.boxModel&&docElem.scrollTop||body.scrollTop)-clientTop,left=box.left+(self.pageXOffset||jQuery.boxModel&&docElem.scrollLeft||body.scrollLeft)-clientLeft;return{top:top,left:left};};else
-jQuery.fn.offset=function(){if(!this[0])return{top:0,left:0};if(this[0]===this[0].ownerDocument.body)return jQuery.offset.bodyOffset(this[0]);jQuery.offset.initialized||jQuery.offset.initialize();var elem=this[0],offsetParent=elem.offsetParent,prevOffsetParent=elem,doc=elem.ownerDocument,computedStyle,docElem=doc.documentElement,body=doc.body,defaultView=doc.defaultView,prevComputedStyle=defaultView.getComputedStyle(elem,null),top=elem.offsetTop,left=elem.offsetLeft;while((elem=elem.parentNode)&&elem!==body&&elem!==docElem){computedStyle=defaultView.getComputedStyle(elem,null);top-=elem.scrollTop,left-=elem.scrollLeft;if(elem===offsetParent){top+=elem.offsetTop,left+=elem.offsetLeft;if(jQuery.offset.doesNotAddBorder&&!(jQuery.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(elem.tagName)))
-top+=parseInt(computedStyle.borderTopWidth,10)||0,left+=parseInt(computedStyle.borderLeftWidth,10)||0;prevOffsetParent=offsetParent,offsetParent=elem.offsetParent;}
-if(jQuery.offset.subtractsBorderForOverflowNotVisible&&computedStyle.overflow!=="visible")
-top+=parseInt(computedStyle.borderTopWidth,10)||0,left+=parseInt(computedStyle.borderLeftWidth,10)||0;prevComputedStyle=computedStyle;}
-if(prevComputedStyle.position==="relative"||prevComputedStyle.position==="static")
-top+=body.offsetTop,left+=body.offsetLeft;if(prevComputedStyle.position==="fixed")
-top+=Math.max(docElem.scrollTop,body.scrollTop),left+=Math.max(docElem.scrollLeft,body.scrollLeft);return{top:top,left:left};};jQuery.offset={initialize:function(){if(this.initialized)return;var body=document.body,container=document.createElement('div'),innerDiv,checkDiv,table,td,rules,prop,bodyMarginTop=body.style.marginTop,html='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';rules={position:'absolute',top:0,left:0,margin:0,border:0,width:'1px',height:'1px',visibility:'hidden'};for(prop in rules)container.style[prop]=rules[prop];container.innerHTML=html;body.insertBefore(container,body.firstChild);innerDiv=container.firstChild,checkDiv=innerDiv.firstChild,td=innerDiv.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(checkDiv.offsetTop!==5);this.doesAddBorderForTableAndCells=(td.offsetTop===5);innerDiv.style.overflow='hidden',innerDiv.style.position='relative';this.subtractsBorderForOverflowNotVisible=(checkDiv.offsetTop===-5);body.style.marginTop='1px';this.doesNotIncludeMarginInBodyOffset=(body.offsetTop===0);body.style.marginTop=bodyMarginTop;body.removeChild(container);this.initialized=true;},bodyOffset:function(body){jQuery.offset.initialized||jQuery.offset.initialize();var top=body.offsetTop,left=body.offsetLeft;if(jQuery.offset.doesNotIncludeMarginInBodyOffset)
-top+=parseInt(jQuery.curCSS(body,'marginTop',true),10)||0,left+=parseInt(jQuery.curCSS(body,'marginLeft',true),10)||0;return{top:top,left:left};}};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}
-return results;},offsetParent:function(){var offsetParent=this[0].offsetParent||document.body;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))
-offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return null;return val!==undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom",lower=name.toLowerCase();jQuery.fn["inner"+name]=function(){return this[0]?jQuery.css(this[0],lower,false,"padding"):null;};jQuery.fn["outer"+name]=function(margin){return this[0]?jQuery.css(this[0],lower,false,margin?"margin":"border"):null;};var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(document.documentElement["client"+name],document.body["scroll"+name],document.documentElement["scroll"+name],document.body["offset"+name],document.documentElement["offset"+name]):size===undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,typeof size==="string"?size:size+"px");};});})();$j=jQuery.noConflict(); \ No newline at end of file
diff --git a/skins/common/metadata.js b/skins/common/metadata.js
index 86fc6bd4..8fafc955 100644
--- a/skins/common/metadata.js
+++ b/skins/common/metadata.js
@@ -5,7 +5,7 @@
//
// attachMetadataToggle('mw_metadata', 'More...', 'Fewer...');
-function attachMetadataToggle( tableId, showText, hideText ) {
+window.attachMetadataToggle = function( tableId, showText, hideText ) {
if ( document.createTextNode ) {
var box = document.getElementById( tableId );
if ( !box ) {
@@ -46,4 +46,8 @@ function attachMetadataToggle( tableId, showText, hideText ) {
return true;
}
return false;
-}
+};
+
+$( document ).ready( function() {
+ attachMetadataToggle( 'mw_metadata', mediaWiki.msg( 'metadata-expand' ), mediaWiki.msg( 'metadata-collapse' ) );
+} );
diff --git a/skins/common/mwsuggest.js b/skins/common/mwsuggest.js
index 8f638c47..d7dd5ad8 100644
--- a/skins/common/mwsuggest.js
+++ b/skins/common/mwsuggest.js
@@ -7,39 +7,48 @@
* by Robert Stojnic (April 2008)
*/
+// Make sure wgMWSuggestTemplate is defined
+if ( !mw.config.exists( 'wgMWSuggestTemplate' ) ) {
+ mw.config.set( 'wgMWSuggestTemplate', mw.config.get( 'wgServer' ) + mw.config.get( 'wgScriptPath' )
+ + "/api.php?action=opensearch\x26search={searchTerms}\x26namespace={namespaces}\x26suggest" );
+}
+
// search_box_id -> Results object
-var os_map = {};
+window.os_map = {};
// cached data, url -> json_text
-var os_cache = {};
+window.os_cache = {};
// global variables for suggest_keypress
-var os_cur_keypressed = 0;
-var os_keypressed_count = 0;
+window.os_cur_keypressed = 0;
+window.os_keypressed_count = 0;
// type: Timer
-var os_timer = null;
+window.os_timer = null;
// tie mousedown/up events
-var os_mouse_pressed = false;
-var os_mouse_num = -1;
+window.os_mouse_pressed = false;
+window.os_mouse_num = -1;
// if true, the last change was made by mouse (and not keyboard)
-var os_mouse_moved = false;
+window.os_mouse_moved = false;
// delay between keypress and suggestion (in ms)
-var os_search_timeout = 250;
+window.os_search_timeout = 250;
// these pairs of inputs/forms will be autoloaded at startup
-var os_autoload_inputs = new Array('searchInput', 'searchInput2', 'powerSearchText', 'searchText');
-var os_autoload_forms = new Array('searchform', 'searchform2', 'powersearch', 'search' );
+window.os_autoload_inputs = new Array('searchInput', 'searchInput2', 'powerSearchText', 'searchText');
+window.os_autoload_forms = new Array('searchform', 'searchform2', 'powersearch', 'search' );
// if we stopped the service
-var os_is_stopped = false;
+window.os_is_stopped = false;
// max lines to show in suggest table
-var os_max_lines_per_suggest = 7;
+window.os_max_lines_per_suggest = 7;
// number of steps to animate expansion/contraction of container width
-var os_animation_steps = 6;
+window.os_animation_steps = 6;
// num of pixels of smallest step
-var os_animation_min_step = 2;
+window.os_animation_min_step = 2;
// delay between steps (in ms)
-var os_animation_delay = 30;
+window.os_animation_delay = 30;
// max width of container in percent of normal size (1 == 100%)
-var os_container_max_width = 2;
+window.os_container_max_width = 2;
// currently active animation timer
-var os_animation_timer = null;
+window.os_animation_timer = null;
+// whether MWSuggest is enabled. Set to false when os_MWSuggestDisable() is called
+window.os_enabled = true;
+
/**
* <datalist> is a new HTML5 element that allows you to manually supply
* suggestion lists and have them rendered according to the right platform
@@ -50,17 +59,17 @@ var os_animation_timer = null;
* (maybe with a UA check) when some browser has a better implementation.
*/
// var os_use_datalist = 'list' in document.createElement( 'input' );
-var os_use_datalist = false;
+window.os_use_datalist = false;
/** Timeout timer class that will fetch the results */
-function os_Timer( id, r, query ) {
+window.os_Timer = function( id, r, query ) {
this.id = id;
this.r = r;
this.query = query;
-}
+};
/** Property class for single search box */
-function os_Results( name, formname ) {
+window.os_Results = function( name, formname ) {
this.searchform = formname; // id of the searchform
this.searchbox = name; // id of the searchbox
this.container = name + 'Suggest'; // div that holds results
@@ -77,10 +86,10 @@ function os_Results( name, formname ) {
this.containerTotal = 0; // total height of the container will all results
this.visible = false; // if container is visible
this.stayHidden = false; // don't try to show if lost focus
-}
+};
/** Timer user to animate expansion/contraction of container width */
-function os_AnimationTimer( r, target ) {
+window.os_AnimationTimer = function( r, target ) {
this.r = r;
var current = document.getElementById(r.container).offsetWidth;
this.inc = Math.round( ( target - current ) / os_animation_steps );
@@ -91,15 +100,19 @@ function os_AnimationTimer( r, target ) {
this.inc = -os_animation_min_step;
}
this.target = target;
-}
+};
/******************
* Initialization
******************/
/** Initialization, call upon page onload */
-function os_MWSuggestInit() {
- for( i = 0; i < os_autoload_inputs.length; i++ ) {
+window.os_MWSuggestInit = function() {
+ if ( !window.os_enabled ) {
+ return;
+ }
+
+ for( var i = 0; i < os_autoload_inputs.length; i++ ) {
var id = os_autoload_inputs[i];
var form = os_autoload_forms[i];
element = document.getElementById( id );
@@ -107,26 +120,50 @@ function os_MWSuggestInit() {
os_initHandlers( id, form, element );
}
}
+};
+
+/* Teardown, called when things like SimpleSearch need to disable MWSuggest */
+window.os_MWSuggestTeardown = function() {
+ for( var i = 0; i < os_autoload_inputs.length; i++ ) {
+ var id = os_autoload_inputs[i];
+ var form = os_autoload_forms[i];
+ element = document.getElementById( id );
+ if( element != null ) {
+ os_teardownHandlers( id, form, element );
+ }
+ }
+};
+
+/* Call this to disable MWSuggest. Works regardless of whether MWSuggest has been initialized already. */
+window.os_MWSuggestDisable = function() {
+ window.os_MWSuggestTeardown();
+ window.os_enabled = false;
}
+
/** Init Result objects and event handlers */
-function os_initHandlers( name, formname, element ) {
+window.os_initHandlers = function( name, formname, element ) {
var r = new os_Results( name, formname );
+ var formElement = document.getElementById( formname );
+ if( !formElement ) {
+ // Older browsers (Opera 8) cannot get form elements
+ return;
+ }
// event handler
- os_hookEvent( element, 'keyup', function( event ) { os_eventKeyup( event ); } );
- os_hookEvent( element, 'keydown', function( event ) { os_eventKeydown( event ); } );
- os_hookEvent( element, 'keypress', function( event ) { os_eventKeypress( event ); } );
+ os_hookEvent( element, 'keyup', os_eventKeyup );
+ os_hookEvent( element, 'keydown', os_eventKeydown );
+ os_hookEvent( element, 'keypress', os_eventKeypress );
if ( !os_use_datalist ) {
// These are needed for the div hack to hide it if the user blurs.
- os_hookEvent( element, 'blur', function( event ) { os_eventBlur( event ); } );
- os_hookEvent( element, 'focus', function( event ) { os_eventFocus( event ); } );
+ os_hookEvent( element, 'blur', os_eventBlur );
+ os_hookEvent( element, 'focus', os_eventFocus );
// We don't want browser auto-suggestions interfering with our div, but
// autocomplete must be on for datalist to work (at least in Opera
// 10.10).
element.setAttribute( 'autocomplete', 'off' );
}
// stopping handler
- os_hookEvent( document.getElementById( formname ), 'submit', function( event ) { return os_eventOnsubmit( event ); } );
+ os_hookEvent( formElement, 'submit', os_eventOnsubmit );
os_map[name] = r;
// toggle link
if( document.getElementById( r.toggle ) == null ) {
@@ -152,14 +189,46 @@ function os_initHandlers( name, formname, element ) {
} */
}
-}
+};
-function os_hookEvent( element, hookName, hookFunct ) {
+window.os_teardownHandlers = function( name, formname, element ) {
+ var formElement = document.getElementById( formname );
+ if( !formElement ) {
+ // Older browsers (Opera 8) cannot get form elements
+ return;
+ }
+
+ os_unhookEvent( element, 'keyup', os_eventKeyup );
+ os_unhookEvent( element, 'keydown', os_eventKeydown );
+ os_unhookEvent( element, 'keypress', os_eventKeypress );
+ if ( !os_use_datalist ) {
+ // These are needed for the div hack to hide it if the user blurs.
+ os_unhookEvent( element, 'blur', os_eventBlur );
+ os_unhookEvent( element, 'focus', os_eventFocus );
+ // We don't want browser auto-suggestions interfering with our div, but
+ // autocomplete must be on for datalist to work (at least in Opera
+ // 10.10).
+ element.removeAttribute( 'autocomplete' );
+ }
+ // stopping handler
+ os_unhookEvent( formElement, 'submit', os_eventOnsubmit );
+};
+
+
+window.os_hookEvent = function( element, hookName, hookFunct ) {
if ( element.addEventListener ) {
element.addEventListener( hookName, hookFunct, false );
} else if ( window.attachEvent ) {
element.attachEvent( 'on' + hookName, hookFunct );
}
+};
+
+window.os_unhookEvent = function( element, hookName, hookFunct ) {
+ if ( element.removeEventListener ) {
+ element.removeEventListener( hookName, hookFunct, false );
+ } else if ( element.detachEvent ) {
+ element.detachEvent( 'on' + hookName, hookFunct );
+ }
}
/********************
@@ -167,7 +236,7 @@ function os_hookEvent( element, hookName, hookFunct ) {
********************/
/** Event handler that will fetch results on keyup */
-function os_eventKeyup( e ) {
+window.os_eventKeyup = function( e ) {
var targ = os_getTarget( e );
var r = os_map[targ.id];
if( r == null ) {
@@ -180,10 +249,10 @@ function os_eventKeyup( e ) {
}
var query = targ.value;
os_fetchResults( r, query, os_search_timeout );
-}
+};
/** catch arrows up/down and escape to hide the suggestions */
-function os_processKey( r, keypressed, targ ) {
+window.os_processKey = function( r, keypressed, targ ) {
if ( keypressed == 40 && !r.visible && os_timer == null ) {
// If the user hits the down arrow, fetch results immediately if none
// are already displayed.
@@ -210,10 +279,10 @@ function os_processKey( r, keypressed, targ ) {
} else if( r.query != document.getElementById( r.searchbox ).value ) {
// os_hideResults( r ); // don't show old suggestions
}
-}
+};
/** When keys is held down use a timer to output regular events */
-function os_eventKeypress( e ) {
+window.os_eventKeypress = function( e ) {
var targ = os_getTarget( e );
var r = os_map[targ.id];
if( r == null ) {
@@ -224,10 +293,10 @@ function os_eventKeypress( e ) {
os_keypressed_count++;
os_processKey( r, keypressed, targ );
-}
+};
/** Catch the key code (Firefox bug) */
-function os_eventKeydown( e ) {
+window.os_eventKeydown = function( e ) {
if ( !e ) {
e = window.event;
}
@@ -241,11 +310,11 @@ function os_eventKeydown( e ) {
os_cur_keypressed = ( e.keyCode == undefined ) ? e.which : e.keyCode;
os_keypressed_count = 0;
-}
+};
/** When the form is submitted hide everything, cancel updates... */
-function os_eventOnsubmit( e ) {
+window.os_eventOnsubmit = function( e ) {
var targ = os_getTarget( e );
os_is_stopped = true;
@@ -267,13 +336,13 @@ function os_eventOnsubmit( e ) {
}
}
return true;
-}
+};
/** Hide results from the user, either making the div visibility=hidden or
* detaching the datalist from the input. */
-function os_hideResults( r ) {
+window.os_hideResults = function( r ) {
if ( os_use_datalist ) {
document.getElementById( r.searchbox ).setAttribute( 'list', '' );
} else {
@@ -284,9 +353,9 @@ function os_hideResults( r ) {
}
r.visible = false;
r.selected = -1;
-}
+};
-function os_decodeValue( value ) {
+window.os_decodeValue = function( value ) {
if ( decodeURIComponent ) {
return decodeURIComponent( value );
}
@@ -294,9 +363,9 @@ function os_decodeValue( value ) {
return unescape( value );
}
return null;
-}
+};
-function os_encodeQuery( value ) {
+window.os_encodeQuery = function( value ) {
if ( encodeURIComponent ) {
return encodeURIComponent( value );
}
@@ -304,10 +373,10 @@ function os_encodeQuery( value ) {
return escape( value );
}
return null;
-}
+};
/** Handles data from XMLHttpRequest, and updates the suggest results */
-function os_updateResults( r, query, text, cacheKey ) {
+window.os_updateResults = function( r, query, text, cacheKey ) {
os_cache[cacheKey] = text;
r.query = query;
r.original = query;
@@ -335,7 +404,7 @@ function os_updateResults( r, query, text, cacheKey ) {
os_cache[cacheKey] = null;
}
}
-}
+};
/**
* Create and populate a <datalist>.
@@ -343,7 +412,7 @@ function os_updateResults( r, query, text, cacheKey ) {
* @param r os_Result object
* @param results Array of the new results to replace existing ones
*/
-function os_setupDatalist( r, results ) {
+window.os_setupDatalist = function( r, results ) {
var s = document.getElementById( r.searchbox );
var c = document.getElementById( r.container );
if ( c == null ) {
@@ -365,11 +434,11 @@ function os_setupDatalist( r, results ) {
r.results[i] = title;
c.appendChild( opt );
}
-}
+};
/** Fetch namespaces from checkboxes or hidden fields in the search form,
if none defined use wgSearchNamespaces global */
-function os_getNamespaces( r ) {
+window.os_getNamespaces = function( r ) {
var namespaces = '';
var elements = document.forms[r.searchform].elements;
for( i = 0; i < elements.length; i++ ) {
@@ -390,26 +459,26 @@ function os_getNamespaces( r ) {
namespaces = wgSearchNamespaces.join('|');
}
return namespaces;
-}
+};
/** Update results if user hasn't already typed something else */
-function os_updateIfRelevant( r, query, text, cacheKey ) {
+window.os_updateIfRelevant = function( r, query, text, cacheKey ) {
var t = document.getElementById( r.searchbox );
if( t != null && t.value == query ) { // check if response is still relevant
os_updateResults( r, query, text, cacheKey );
}
r.query = query;
-}
+};
/** Fetch results after some timeout */
-function os_delayedFetch() {
+window.os_delayedFetch = function() {
if( os_timer == null ) {
return;
}
var r = os_timer.r;
var query = os_timer.query;
os_timer = null;
- var path = wgMWSuggestTemplate.replace( "{namespaces}", os_getNamespaces( r ) )
+ var path = mw.config.get( 'wgMWSuggestTemplate' ).replace( "{namespaces}", os_getNamespaces( r ) )
.replace( "{dbname}", wgDBname )
.replace( "{searchTerms}", os_encodeQuery( query ) );
@@ -436,10 +505,10 @@ function os_delayedFetch() {
}
}
}
-}
+};
/** Init timed update via os_delayedUpdate() */
-function os_fetchResults( r, query, timeout ) {
+window.os_fetchResults = function( r, query, timeout ) {
if( query == '' ) {
r.query = '';
os_hideResults( r );
@@ -461,10 +530,10 @@ function os_fetchResults( r, query, timeout ) {
os_timer = new os_Timer( null, r, query );
os_delayedFetch(); // do it now!
}
-}
+};
/** Find event target */
-function os_getTarget( e ) {
+window.os_getTarget = function( e ) {
if ( !e ) {
e = window.event;
}
@@ -475,10 +544,10 @@ function os_getTarget( e ) {
} else {
return null;
}
-}
+};
/** Check if x is a valid integer */
-function os_isNumber( x ) {
+window.os_isNumber = function( x ) {
if( x == '' || isNaN( x ) ) {
return false;
}
@@ -489,15 +558,15 @@ function os_isNumber( x ) {
}
}
return true;
-}
+};
/** Call this to enable suggestions on input (id=inputId), on a form (name=formName) */
-function os_enableSuggestionsOn( inputId, formName ) {
+window.os_enableSuggestionsOn = function( inputId, formName ) {
os_initHandlers( inputId, formName, document.getElementById( inputId ) );
-}
+};
/** Call this to disable suggestios on input box (id=inputId) */
-function os_disableSuggestionsOn( inputId ) {
+window.os_disableSuggestionsOn = function( inputId ) {
r = os_map[inputId];
if( r != null ) {
// cancel/hide results
@@ -514,14 +583,14 @@ function os_disableSuggestionsOn( inputId ) {
if ( index >= 0 ) {
os_autoload_inputs[index] = os_autoload_forms[index] = '';
}
-}
+};
/************************************************
* Div-only functions (irrelevant for datalist)
************************************************/
/** Event: loss of focus of input box */
-function os_eventBlur( e ) {
+window.os_eventBlur = function( e ) {
var targ = os_getTarget( e );
var r = os_map[targ.id];
if( r == null ) {
@@ -537,17 +606,17 @@ function os_eventBlur( e ) {
}
os_timer = null;
}
-}
+};
/** Event: focus (catch only when stopped) */
-function os_eventFocus( e ) {
+window.os_eventFocus = function( e ) {
var targ = os_getTarget( e );
var r = os_map[targ.id];
if( r == null ) {
return; // not our event
}
r.stayHidden = false;
-}
+};
/**
* Create and populate a <div>, for non-<datalist>-supporting browsers.
@@ -555,7 +624,7 @@ function os_eventFocus( e ) {
* @param r os_Result object
* @param results Array of the new results to replace existing ones
*/
-function os_setupDiv( r, results ) {
+window.os_setupDiv = function( r, results ) {
var c = document.getElementById( r.container );
if ( c == null ) {
c = os_createContainer( r );
@@ -568,10 +637,10 @@ function os_setupDiv( r, results ) {
os_fitContainer( r );
os_trimResultText( r );
os_showResults( r );
-}
+};
/** Create the result table to be placed in the container div */
-function os_createResultTable( r, results ) {
+window.os_createResultTable = function( r, results ) {
var c = document.getElementById( r.container );
var width = c.offsetWidth - os_operaWidthFix( c.offsetWidth );
var html = '<table class="os-suggest-results" id="' + r.resultTable + '" style="width: ' + width + 'px;">';
@@ -584,10 +653,10 @@ function os_createResultTable( r, results ) {
}
html += '</table>';
return html;
-}
+};
/** Show results div */
-function os_showResults( r ) {
+window.os_showResults = function( r ) {
if( os_is_stopped ) {
return;
}
@@ -602,69 +671,69 @@ function os_showResults( r ) {
c.style.visibility = 'visible';
r.visible = true;
}
-}
+};
-function os_operaWidthFix( x ) {
+window.os_operaWidthFix = function( x ) {
// For browsers that don't understand overflow-x, estimate scrollbar width
if( typeof document.body.style.overflowX != 'string' ) {
return 30;
}
return 0;
-}
+};
/** Brower-dependent functions to find window inner size, and scroll status */
-function f_clientWidth() {
+window.f_clientWidth = function() {
return f_filterResults(
window.innerWidth ? window.innerWidth : 0,
document.documentElement ? document.documentElement.clientWidth : 0,
document.body ? document.body.clientWidth : 0
);
-}
+};
-function f_clientHeight() {
+window.f_clientHeight = function() {
return f_filterResults(
window.innerHeight ? window.innerHeight : 0,
document.documentElement ? document.documentElement.clientHeight : 0,
document.body ? document.body.clientHeight : 0
);
-}
+};
-function f_scrollLeft() {
+window.f_scrollLeft = function() {
return f_filterResults(
window.pageXOffset ? window.pageXOffset : 0,
document.documentElement ? document.documentElement.scrollLeft : 0,
document.body ? document.body.scrollLeft : 0
);
-}
+};
-function f_scrollTop() {
+window.f_scrollTop = function() {
return f_filterResults(
window.pageYOffset ? window.pageYOffset : 0,
document.documentElement ? document.documentElement.scrollTop : 0,
document.body ? document.body.scrollTop : 0
);
-}
+};
-function f_filterResults( n_win, n_docel, n_body ) {
+window.f_filterResults = function( n_win, n_docel, n_body ) {
var n_result = n_win ? n_win : 0;
if ( n_docel && ( !n_result || ( n_result > n_docel ) ) ) {
n_result = n_docel;
}
return n_body && ( !n_result || ( n_result > n_body ) ) ? n_body : n_result;
-}
+};
/** Get the height available for the results container */
-function os_availableHeight( r ) {
+window.os_availableHeight = function( r ) {
var absTop = document.getElementById( r.container ).style.top;
var px = absTop.lastIndexOf( 'px' );
if( px > 0 ) {
absTop = absTop.substring( 0, px );
}
return f_clientHeight() - ( absTop - f_scrollTop() );
-}
+};
/** Get element absolute position {left,top} */
-function os_getElementPosition( elemID ) {
+window.os_getElementPosition = function( elemID ) {
var offsetTrail = document.getElementById( elemID );
var offsetLeft = 0;
var offsetTop = 0;
@@ -678,36 +747,44 @@ function os_getElementPosition( elemID ) {
offsetTop += document.body.topMargin;
}
return { left:offsetLeft, top:offsetTop };
-}
+};
/** Create the container div that will hold the suggested titles */
-function os_createContainer( 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;
-}
+};
/** change container height to fit to screen */
-function os_fitContainer( r ) {
+window.os_fitContainer = function( r ) {
var c = document.getElementById( r.container );
var h = os_availableHeight( r ) - 20;
var inc = r.containerRow;
@@ -725,10 +802,10 @@ function os_fitContainer( r ) {
c.style.height = r.containerTotal + 'px';
r.containerCount = r.resultCount;
}
-}
+};
/** If some entries are longer than the box, replace text with "..." */
-function os_trimResultText( r ) {
+window.os_trimResultText = function( r ) {
// find max width, first see if we could expand the container to fit it
var maxW = 0;
for( var i = 0; i < r.resultCount; i++ ) {
@@ -791,10 +868,10 @@ function os_trimResultText( r ) {
document.getElementById( r.resultTable + i ).setAttribute( 'title', r.results[i] );
}
}
-}
+};
/** Invoked on timer to animate change in container width */
-function os_animateChangeWidth() {
+window.os_animateChangeWidth = function() {
var r = os_animation_timer.r;
var c = document.getElementById( r.container );
var w = c.offsetWidth;
@@ -815,10 +892,10 @@ function os_animateChangeWidth() {
c.style.left = ( normL + normW + ( target - nw ) - os_animation_timer.target - 1 ) + 'px';
}
}
-}
+};
/** Change the highlighted row (i.e. suggestion), from position cur to next */
-function os_changeHighlight( r, cur, next, updateSearchBox ) {
+window.os_changeHighlight = function( r, cur, next, updateSearchBox ) {
if ( next >= r.resultCount ) {
next = r.resultCount - 1;
}
@@ -863,9 +940,9 @@ function os_changeHighlight( r, cur, next, updateSearchBox ) {
if( updateSearchBox ) {
os_updateSearchQuery( r, newText );
}
-}
+};
-function os_HighlightClass() {
+window.os_HighlightClass = function() {
var match = navigator.userAgent.match(/AppleWebKit\/(\d+)/);
if ( match ) {
var webKitVersion = parseInt( match[1] );
@@ -877,12 +954,12 @@ function os_HighlightClass() {
}
}
return 'os-suggest-result-hl';
-}
+};
-function os_updateSearchQuery( r, newText ) {
+window.os_updateSearchQuery = function( r, newText ) {
document.getElementById( r.searchbox ).value = newText;
r.query = newText;
-}
+};
/********************
@@ -890,7 +967,7 @@ function os_updateSearchQuery( r, newText ) {
********************/
/** Mouse over the container */
-function os_eventMouseover( srcId, e ) {
+window.os_eventMouseover = function( srcId, e ) {
var targ = os_getTarget( e );
var r = os_map[srcId];
if( r == null || !os_mouse_moved ) {
@@ -900,10 +977,10 @@ function os_eventMouseover( srcId, e ) {
if( num >= 0 ) {
os_changeHighlight( r, r.selected, num, false );
}
-}
+};
/* Get row where the event occured (from its id) */
-function os_getNumberSuffix( id ) {
+window.os_getNumberSuffix = function( id ) {
var num = id.substring( id.length - 2 );
if( !( num.charAt( 0 ) >= '0' && num.charAt( 0 ) <= '9' ) ) {
num = num.substring( 1 );
@@ -913,15 +990,15 @@ function os_getNumberSuffix( id ) {
} else {
return -1;
}
-}
+};
/** Save mouse move as last action */
-function os_eventMousemove( srcId, e ) {
+window.os_eventMousemove = function( srcId, e ) {
os_mouse_moved = true;
-}
+};
/** Mouse button held down, register possible click */
-function os_eventMousedown( srcId, e ) {
+window.os_eventMousedown = function( srcId, e ) {
var targ = os_getTarget( e );
var r = os_map[srcId];
if( r == null ) {
@@ -938,10 +1015,10 @@ function os_eventMousedown( srcId, e ) {
document.getElementById( r.searchbox ).focus();
return false; // prevents selection
-}
+};
/** Mouse button released, check for click on some row */
-function os_eventMouseup( srcId, e ) {
+window.os_eventMouseup = function( srcId, e ) {
var targ = os_getTarget( e );
var r = os_map[srcId];
if( r == null ) {
@@ -957,12 +1034,12 @@ function os_eventMouseup( srcId, e ) {
os_mouse_pressed = false;
// keep the focus on the search field
document.getElementById( r.searchbox ).focus();
-}
+};
/** Toggle stuff seems to be dead code? */
/** Return the span element that contains the toggle link */
-function os_createToggle( r, className ) {
+window.os_createToggle = function( r, className ) {
var t = document.createElement( 'span' );
t.className = className;
t.setAttribute( 'id', r.toggle );
@@ -973,10 +1050,10 @@ function os_createToggle( r, className ) {
link.appendChild( msg );
t.appendChild( link );
return t;
-}
+};
/** Call when user clicks on some of the toggle links */
-function os_toggle( inputId, formName ) {
+window.os_toggle = function( inputId, formName ) {
r = os_map[inputId];
var msg = '';
if( r == null ) {
@@ -990,6 +1067,6 @@ function os_toggle( inputId, formName ) {
// change message
var link = document.getElementById( r.toggle ).firstChild;
link.replaceChild( document.createTextNode( msg ), link.firstChild );
-}
+};
hookEvent( 'load', os_MWSuggestInit );
diff --git a/skins/common/nostalgia.css b/skins/common/nostalgia.css
index c9b36a70..e1b774df 100644
--- a/skins/common/nostalgia.css
+++ b/skins/common/nostalgia.css
@@ -2,16 +2,47 @@ body {
/* Background color is set separately on page type */
color: black;
}
-#specialform { display: inline; }
+
+#specialform {
+ display: inline;
+}
+
#powersearch {
- background: #DDEEFF; border-style: solid; border-width: 1px; padding: 2px;
+ background: #DDEEFF;
+ border-style: solid;
+ border-width: 1px;
+ padding: 2px;
+}
+
+a.interwiki, a.external {
+ color: #3366BB;
+}
+
+a.printable {
+ text-decoration: underline;
}
-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; }
+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 1bd1544e..33047ec9 100644
--- a/skins/common/oldshared.css
+++ b/skins/common/oldshared.css
@@ -12,7 +12,9 @@ h2 { font-size: 1.5em; }
h3 { font-size: 1.17em; }
h5 { font-size: .83em; }
h6 { font-size: .75em; }
-h1, h2, h3, h4, h5, h6 { font-weight: bolder }
+h1, h2, h3, h4, h5, h6 {
+ font-weight: bolder;
+}
/* Now the custom parts */
@@ -20,32 +22,47 @@ h1, h2, h3, h4, h5, h6 { font-weight: bolder }
.editsection {
font-weight: normal;
}
-h1 .editsection { font-size: 50% }
-h2 .editsection { font-size: 66.7% }
-h3 .editsection { font-size: 85.5% }
-h5 .editsection { font-size: 120% }
-h6 .editsection { font-size: 133% }
+h1 .editsection { font-size: 50%; }
+h2 .editsection { font-size: 66.7%; }
+h3 .editsection { font-size: 85.5%; }
+h5 .editsection { font-size: 120%; }
+h6 .editsection { font-size: 133%; }
#footer { clear: both }
/* images */
-div.floatright { float: right; clear: right; margin: 0 0 1em 1em; }
-div.floatright p { font-style: italic; }
-div.floatleft { float: left; clear: left; margin: 0.3em 0.5em 0.5em 0; }
-div.floatleft p { font-style: italic; }
+div.floatright {
+ float: right;
+ clear: right;
+ margin: 0 0 1em 1em;
+}
+
+div.floatright p {
+ font-style: italic;
+}
+
+div.floatleft {
+ float: left;
+ clear: left;
+ margin: 0.3em 0.5em 0.5em 0;
+}
+
+div.floatleft p {
+ font-style: italic;
+}
/* Print-specific things to hide */
.printfooter {
- display: none;
+ display: none;
}
/* table standards */
table.rimage {
- float:right;
- margin-left:1em;
- margin-bottom:1em;
- text-align:center;
- font-size:smaller;
+ float: right;
+ margin-left: 1em;
+ margin-bottom: 1em;
+ text-align: center;
+ font-size: smaller;
}
/* thumbnails */
@@ -137,7 +154,6 @@ img { border: none; }
font-size: 94%;
}
-
.error {
color: red;
font-size: larger;
@@ -148,77 +164,88 @@ img { border: none; }
clear: both;
}
#preftoc {
- float: left;
- margin: 1em 1em 1em 1em;
- width: 13em;
+ float: left;
+ margin: 1em 1em 1em 1em;
+ width: 13em;
+}
+#preftoc li {
+ border: 1px solid White;
}
-#preftoc li { border: 1px solid White; }
#preftoc li.selected {
- background-color:#f9f9f9;
- border:1px dashed #aaaaaa;
+ background-color:#f9f9f9;
+ border:1px dashed #aaaaaa;
}
#preftoc a,
#preftoc a:active {
- display: block;
- color: #005189;
+ display: block;
+ color: #005189;
}
.mw-prefs-buttons {
- clear: left;
- float: left;
- margin-top: 1em;
+ clear: left;
+ float: left;
+ margin-top: 1em;
}
div.htmlform-tip {
- font-size: 94%;
- margin-top: 0.4em;
- color: #666;
+ font-size: 94%;
+ margin-top: 0.4em;
+ color: #666;
+}
+fieldset.prefsection {
+ margin-top: 1em;
+}
+fieldset.operaprefsection {
+ margin-left: 15em;
}
-fieldset.prefsection { margin-top: 1em }
-fieldset.operaprefsection { margin-left: 15em }
/* emulate center */
.center {
- width: 100%;
- text-align: center;
+ width: 100%;
+ text-align: center;
}
*.center * {
- margin-left: auto;
- margin-right: auto;
+ margin-left: auto;
+ margin-right: auto;
}
+
/* small for tables and similar */
-.small, .small * { font-size: 94%; }
-table.small { font-size: 100% }
+.small, .small * {
+ font-size: 94%;
+}
+table.small {
+ font-size: 100%;
+}
/* use this instead of #toc for page content */
.toccolours {
- border:1px solid #aaaaaa;
- background-color:#f9f9f9;
- padding:5px;
- font-size: 95%;
+ border: 1px solid #aaaaaa;
+ background-color: #f9f9f9;
+ padding: 5px;
+ font-size: 95%;
}
#siteNotice {
- border:1px solid #aaaaaa;
- padding-left: 0.5em;
- padding-right: 0.5em;
+ border: 1px solid #aaaaaa;
+ padding-left: 0.5em;
+ padding-right: 0.5em;
}
.redirectText {
- font-size:150%;
- margin:5px;
+ font-size: 150%;
+ margin: 5px;
}
.sharedUploadNotice {
font-style: italic;
}
span.unpatrolled {
- font-weight:bold;
- color:red;
+ font-weight: bold;
+ color: red;
}
span.updatedmarker {
- color:black;
- background-color:#00FF00;
+ color: black;
+ background-color: #00FF00;
}
div.gallerybox {
- width: 150px;
+ width: 150px;
}
span.comment {
@@ -234,19 +261,19 @@ span.changedby {
color: #cc0000;
}
.editExternally {
- border-style:solid;
- border-width:1px;
- border-color:gray;
- background: #ffffff;
- padding:3px;
- margin-top:0.5em;
- float:left;
- font-size:small;
- text-align:center;
+ border-style: solid;
+ border-width: 1px;
+ border-color: gray;
+ background: #ffffff;
+ padding: 3px;
+ margin-top: 0.5em;
+ float: left;
+ font-size: small;
+ text-align: center;
}
.editExternallyHelp {
- font-style:italic;
- color:gray;
+ font-style: italic;
+ color: gray;
}
li span.deleted {
@@ -260,9 +287,15 @@ table.mw_metadata {
margin-left: 0.5em;
}
-table.mw_metadata caption { font-weight: bold; }
-table.mw_metadata th { font-weight: normal; }
-table.mw_metadata td { padding: 0.1em; }
+table.mw_metadata caption {
+ font-weight: bold;
+}
+table.mw_metadata th {
+ font-weight: normal;
+}
+table.mw_metadata td {
+ padding: 0.1em;
+}
table.mw_metadata {
border: none;
@@ -289,11 +322,10 @@ table.collapsed tr.collapsable {
}
.visualClear {
- clear: both;
+ clear: both;
}
/* Allmessages table */
-
#allmessagestable th {
background-color: #b2b2ff;
}
@@ -311,28 +343,28 @@ table.collapsed tr.collapsable {
}
#jump-to-nav {
- display: none;
+ display: none;
}
div.multipageimagenavbox {
- border: solid 1px silver;
- padding: 4px;
- margin: 1em;
- background: #f0f0f0;
+ border: solid 1px silver;
+ padding: 4px;
+ margin: 1em;
+ background: #f0f0f0;
}
div.multipageimagenavbox div.thumb {
- border: none;
- margin-left: 2em;
- margin-right: 2em;
+ border: none;
+ margin-left: 2em;
+ margin-right: 2em;
}
div.multipageimagenavbox hr {
- margin: 6px;
+ margin: 6px;
}
table.multipageimage td {
- text-align: center;
+ text-align: center;
}
/*
@@ -343,22 +375,42 @@ table.multipageimage td {
- remove line wrapping for all td and th, set background color
- restore line wrapping for the last two table cells (description and size)
*/
-.TablePager_nav a { text-decoration: none; }
-.TablePager { border-collapse: collapse; }
-.TablePager, .TablePager td, .TablePager th {
+.TablePager_nav a {
+ text-decoration: none;
+}
+.TablePager {
+ border-collapse: collapse;
+}
+.TablePager, .TablePager td, .TablePager th {
border: 0.15em solid #777777;
padding: 0 0.15em 0 0.15em;
}
-.TablePager th { background-color: #eeeeff }
-.TablePager td { background-color: #ffffff }
-.TablePager tr:hover td { background-color: #eeeeff }
+.TablePager th {
+ background-color: #eeeeff;
+}
+.TablePager td {
+ background-color: #ffffff;
+}
+.TablePager tr:hover td {
+ background-color: #eeeeff;
+}
-.imagelist td, .imagelist th { white-space: nowrap }
-.imagelist .TablePager_col_links { background-color: #eeeeff }
-.imagelist .TablePager_col_img_description { white-space: normal }
-.imagelist th.TablePager_sort { background-color: #ccccff }
+.imagelist td, .imagelist th {
+ white-space: nowrap;
+}
+.imagelist .TablePager_col_links {
+ background-color: #eeeeff;
+}
+.imagelist .TablePager_col_img_description {
+ white-space: normal;
+}
+.imagelist th.TablePager_sort {
+ background-color: #ccccff;
+}
-.templatesUsed { margin-top: 1em; }
+.templatesUsed {
+ margin-top: 1em;
+}
.MediaTransformError {
border: thin solid #777;
diff --git a/skins/common/prefs.js b/skins/common/prefs.js
index ca55632c..1eb8e5bf 100644
--- a/skins/common/prefs.js
+++ b/skins/common/prefs.js
@@ -1,84 +1,6 @@
-// generate toc from prefs form, fold sections
-// XXX: needs testing on IE/Mac and safari
-// more comments to follow
-function tabbedprefs() {
- var prefform = document.getElementById( 'preferences' );
- if ( !prefform || !document.createElement ) {
- return;
- }
- if ( prefform.nodeName.toLowerCase() == 'a' ) {
- return; // Occasional IE problem
- }
- prefform.className = prefform.className + 'jsprefs';
- var sections = [];
- var children = prefform.childNodes;
- var seci = 0;
- for ( var i = 0; i < children.length; i++ ) {
- if ( children[i].nodeName.toLowerCase() == 'fieldset' ) {
- children[i].id = 'prefsection-' + seci;
- children[i].className = 'prefsection';
- if ( is_opera ) {
- children[i].className = 'prefsection operaprefsection';
- }
- var legends = children[i].getElementsByTagName('legend');
- sections[seci] = {};
- if ( legends[0] ) {
- legends[0].className = 'mainLegend';
- }
- if ( legends[0] && legends[0].firstChild.nodeValue ) {
- sections[seci].text = legends[0].firstChild.nodeValue;
- } else {
- sections[seci].text = '# ' + seci;
- }
- sections[seci].secid = children[i].id;
- seci++;
- if ( sections.length != 1 ) {
- children[i].style.display = 'none';
- } else {
- var selectedid = children[i].id;
- }
- }
- }
- var toc = document.createElement( 'ul' );
- toc.id = 'preftoc';
- toc.selectedid = selectedid;
- for ( i = 0; i < sections.length; i++ ) {
- var li = document.createElement( 'li' );
- if ( i === 0 ) {
- li.className = 'selected';
- }
- var a = document.createElement( 'a' );
- a.href = '#' + sections[i].secid;
- a.onmousedown = a.onclick = uncoversection;
- a.appendChild( document.createTextNode( sections[i].text ) );
- a.secid = sections[i].secid;
- li.appendChild( a );
- toc.appendChild( li );
- }
- prefform.parentNode.insertBefore( toc, prefform.parentNode.childNodes[0] );
- document.getElementById( 'prefsubmit' ).id = 'prefcontrol';
-}
-
-function uncoversection() {
- var oldsecid = this.parentNode.parentNode.selectedid;
- var newsec = document.getElementById( this.secid );
- if ( oldsecid != this.secid ) {
- var ul = document.getElementById( 'preftoc' );
- document.getElementById( oldsecid ).style.display = 'none';
- newsec.style.display = 'block';
- ul.selectedid = this.secid;
- var lis = ul.getElementsByTagName( 'li' );
- for ( var i = 0; i< lis.length; i++ ) {
- lis[i].className = '';
- }
- this.parentNode.className = 'selected';
- }
- return false;
-}
-
// Timezone stuff
// tz in format [+-]HHMM
-function checkTimezone( tz, msg ) {
+window.checkTimezone = function( tz, msg ) {
var localclock = new Date();
// returns negative offset from GMT in minutes
var tzRaw = localclock.getTimezoneOffset();
@@ -89,11 +11,11 @@ function checkTimezone( tz, msg ) {
var junk = msg.split('$1');
document.write( junk[0] + 'UTC' + tzString + junk[1] );
}
-}
+};
-function timezoneSetup() {
- var tzSelect = document.getElementById( 'mw-input-timecorrection' );
- var tzTextbox = document.getElementById( 'mw-input-timecorrection-other' );
+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 ); } );
@@ -101,11 +23,11 @@ function timezoneSetup() {
}
updateTimezoneSelection( false );
-}
+};
// in [-]HH:MM format...
// won't yet work with non-even tzs
-function fetchTimezone() {
+window.fetchTimezone = function() {
// FIXME: work around Safari bug
var localclock = new Date();
// returns negative offset from GMT in minutes
@@ -115,26 +37,26 @@ function fetchTimezone() {
var tzString = ( ( tzRaw >= 0 ) ? '-' : '' ) + ( ( tzHour < 10 ) ? '0' : '' ) + tzHour +
':' + ( ( tzMin < 10 ) ? '0' : '' ) + tzMin;
return tzString;
-}
+};
-function guessTimezone() {
- var textbox = document.getElementById( 'mw-input-timecorrection-other' );
- var selector = document.getElementById( 'mw-input-timecorrection' );
+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 );
-}
+};
-function updateTimezoneSelection( force_offset ) {
- var selector = document.getElementById( 'mw-input-timecorrection' );
+window.updateTimezoneSelection = function( force_offset ) {
+ var selector = document.getElementById( 'mw-input-wptimecorrection' );
if ( selector.value == 'guess' ) {
return guessTimezone();
}
- var textbox = document.getElementById( 'mw-input-timecorrection-other' );
+ var textbox = document.getElementById( 'mw-input-wptimecorrection-other' );
var localtimeHolder = document.getElementById( 'wpLocalTime' );
var servertime = document.getElementsByName( 'wpServerTime' )[0].value;
var minDiff = 0;
@@ -211,7 +133,6 @@ function updateTimezoneSelection( force_offset ) {
}
textbox.value = hour + ':' + min;
}
-}
+};
addOnloadHook( timezoneSetup );
-addOnloadHook( tabbedprefs );
diff --git a/skins/common/preview.js b/skins/common/preview.js
index db5633d0..234dd545 100644
--- a/skins/common/preview.js
+++ b/skins/common/preview.js
@@ -1,53 +1,128 @@
/**
* Live preview script for MediaWiki
*/
+(function( $ ) {
+ window.doLivePreview = function( e ) {
+ e.preventDefault();
-function doLivePreview( e ) {
- e.preventDefault();
- var previewText = $j('#wpTextbox1').val();
+ $( mw ).trigger( 'LivePreviewPrepare' );
- var editToken = $j( '[name="wpEditToken"]' ).attr( 'value' );
- var editTime = $j( '[name="wpEdittime"]' ).attr( 'value' );
- var startTime = $j( '[name="wpStarttime"]' ).attr( 'value' );
-
- var postData = { 'action' : 'submit', 'wpTextbox1' : previewText, 'wpPreview' : true,
- 'wpEditToken' : editToken, 'wpEdittime': editTime, 'wpStarttime': startTime, 'title' : wgPageName };
+ 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(',');
- // 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'); } );
- $j.each( copyElements, function(k,v) { $j(v).fadeOut('fast'); } );
+ // Display a loading graphic
+ var loadSpinner = $('<div class="mw-ajax-loader"/>');
+ $('#wikiPreview').before( loadSpinner );
+
+ var page = $('<div/>');
+ var target = $('#editform').attr('action');
- // Display a loading graphic
- var loadSpinner = $j('<div class="mw-ajax-loader"/>');
- $j('#wikiPreview').before( loadSpinner );
+ if ( !target ) {
+ target = window.location.href;
+ }
- var page = $j('<div/>');
- page.load( wgScript+'?action=submit '+copySelector,
- postData,
- function() {
+ page.load( target + ' ' + copySelector, postData,
+ function() {
+
+ for( var i=0; i<copyElements.length; ++i) {
+ // For all the specified elements, find the elements in the loaded page
+ // and the real page, empty the element in the real page, and fill it
+ // with the content of the loaded page
+ var copyContent = page.find( copyElements[i] ).contents();
+ $(copyElements[i]).empty().append( copyContent );
+ var newClasses = page.find( copyElements[i] ).attr('class');
+ $(copyElements[i]).attr( 'class', newClasses );
+ }
- for( var i=0; i<copyElements.length; ++i) {
- // For all the specified elements, find the elements in the loaded page
- // and the real page, empty the element in the real page, and fill it
- // with the content of the loaded page
- var copyContent = page.find( copyElements[i] ).contents();
- $j(copyElements[i]).empty().append( copyContent );
- var newClasses = page.find( copyElements[i] ).attr('class');
- $j(copyElements[i]).attr( 'class', newClasses );
- }
+ $.each( copyElements, function(k,v) {
+ // Don't belligerently show elements that are supposed to be hidden
+ $(v).fadeIn( 'fast', function() { $(this).css('display', ''); } );
+ } );
- $j.each( copyElements, function(k,v) {
- // Don't belligerently show elements that are supposed to be hidden
- $j(v).fadeIn( 'fast', function() { $j(this).css('display', ''); } );
+ loadSpinner.remove();
+
+ $( mw ).trigger( 'LivePreviewDone', [copyElements] );
} );
-
- loadSpinner.remove();
- } );
-}
+ };
+
+ // Shamelessly stolen from the jQuery form plugin, which is licensed under the GPL.
+ // http://jquery.malsup.com/form/#download
+ $.fn.formToArray = function() {
+ var a = [];
+ if (this.length == 0) return a;
+
+ var form = this[0];
+ var els = form.elements;
+ if (!els) return a;
+ for(var i=0, max=els.length; i < max; i++) {
+ var el = els[i];
+ var n = el.name;
+ if (!n) continue;
+
+ var v = $.fieldValue(el, true);
+ if (v && v.constructor == Array) {
+ for(var j=0, jmax=v.length; j < jmax; j++)
+ a.push({name: n, value: v[j]});
+ }
+ else if (v !== null && typeof v != 'undefined')
+ a.push({name: n, value: v});
+ }
+
+ if (form.clk) {
+ // input type=='image' are not found in elements array! handle it here
+ var $input = $(form.clk), input = $input[0], n = input.name;
+ if (n && !input.disabled && input.type == 'image') {
+ a.push({name: n, value: $input.val()});
+ a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
+ }
+ }
+ return a;
+ };
+
+ /**
+ * Returns the value of the field element.
+ */
+ $.fieldValue = function(el, successful) {
+ var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
+ if (typeof successful == 'undefined') successful = true;
+
+ if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
+ (t == 'checkbox' || t == 'radio') && !el.checked ||
+ (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
+ tag == 'select' && el.selectedIndex == -1))
+ return null;
+
+ if (tag == 'select') {
+ var index = el.selectedIndex;
+ if (index < 0) return null;
+ var a = [], ops = el.options;
+ var one = (t == 'select-one');
+ var max = (one ? index+1 : ops.length);
+ for(var i=(one ? index : 0); i < max; i++) {
+ var op = ops[i];
+ if (op.selected) {
+ var v = op.value;
+ if (!v) // extra pain for IE...
+ v = (op.attributes && op.attributes['value'] &&
+ !(op.attributes['value'].specified))
+ ? op.text : op.value;
+ if (one) return v;
+ a.push(v);
+ }
+ }
+ return a;
+ }
+ return el.value;
+ };
-$j(document).ready( function() {
- $j('#wpPreview').click( doLivePreview );
-} );
+ $(document).ready( function() {
+ $('#wpPreview').click( doLivePreview );
+ } );
+}) ( jQuery );
diff --git a/skins/common/protect.js b/skins/common/protect.js
index e037f08a..a284c3f8 100644
--- a/skins/common/protect.js
+++ b/skins/common/protect.js
@@ -1,12 +1,12 @@
-var ProtectionForm = {
+window.ProtectionForm = {
'existingMatch': false,
/**
* Set up the protection chaining interface (i.e. "unlock move permissions" checkbox)
* on the protection form
*
- * @param Object opts : parameters with members:
+ * @param opts Object : parameters with members:
* tableId Identifier of the table containing UI bits
* labelText Text to use for the checkbox label
* numTypes The number of protection types
@@ -20,7 +20,7 @@ var ProtectionForm = {
if( !box )
return false;
- var boxbody = box.getElementsByTagName('tbody')[0]
+ var boxbody = box.getElementsByTagName('tbody')[0];
var row = document.createElement( 'tr' );
boxbody.insertBefore( row, boxbody.firstChild.nextSibling );
@@ -76,7 +76,7 @@ var ProtectionForm = {
/**
* Is this protection level cascadeable?
- * @param String level
+ * @param level String
*
* @return boolean
*
@@ -94,7 +94,7 @@ var ProtectionForm = {
* When protection levels are locked together, update the rest
* when one action's level changes
*
- * @param Element source Level selector that changed
+ * @param source Element Level selector that changed
*/
'updateLevels': function(source) {
if( !this.isUnchained() )
@@ -106,7 +106,7 @@ var ProtectionForm = {
* When protection levels are locked together, update the
* expiries when one changes
*
- * @param Element source expiry input that changed
+ * @param source Element expiry input that changed
*/
'updateExpiry': function(source) {
@@ -133,7 +133,7 @@ var ProtectionForm = {
* When protection levels are locked together, update the
* expiry lists when one changes and clear the custom inputs
*
- * @param Element source expiry selector that changed
+ * @param source Element expiry selector that changed
*/
'updateExpiryList': function(source) {
if( !this.isUnchained() ) {
@@ -221,7 +221,7 @@ var ProtectionForm = {
/**
* Protect all actions at the specified level
*
- * @param int index Protection level
+ * @param index int Protection level
*/
'setAllSelectors': function(index) {
this.forEachLevelSelector(function(element) {
@@ -234,7 +234,7 @@ var ProtectionForm = {
/**
* Apply a callback to each protection selector
*
- * @param callable func Callback function
+ * @param func callable Callback function
*/
'forEachLevelSelector': function(func) {
var selectors = this.getLevelSelectors();
@@ -263,7 +263,7 @@ var ProtectionForm = {
/**
* Apply a callback to each expiry input
*
- * @param callable func Callback function
+ * @param func callable Callback function
*/
'forEachExpiryInput': function(func) {
var inputs = this.getExpiryInputs();
@@ -291,7 +291,7 @@ var ProtectionForm = {
/**
* Apply a callback to each expiry selector list
- * @param callable func Callback function
+ * @param func callable Callback function
*/
'forEachExpirySelector': function(func) {
var inputs = this.getExpirySelectors();
@@ -320,7 +320,7 @@ var ProtectionForm = {
/**
* Enable/disable protection selectors and expiry inputs
*
- * @param boolean val Enable?
+ * @param val boolean Enable?
*/
'enableUnchainedInputs': function(val) {
var first = true;
@@ -348,4 +348,4 @@ var ProtectionForm = {
}
});
}
-}
+};
diff --git a/skins/common/quickbar-right.css b/skins/common/quickbar-right.css
deleted file mode 100644
index 43bd427a..00000000
--- a/skins/common/quickbar-right.css
+++ /dev/null
@@ -1 +0,0 @@
-#quickbar { position: fixed; right: 0px; top: 0px; padding: 4px;}
diff --git a/skins/common/quickbar.css b/skins/common/quickbar.css
deleted file mode 100644
index d7930c2a..00000000
--- a/skins/common/quickbar.css
+++ /dev/null
@@ -1 +0,0 @@
-#quickbar { position: fixed; padding: 4px; }
diff --git a/skins/common/rightclickedit.js b/skins/common/rightclickedit.js
deleted file mode 100644
index 83d552a2..00000000
--- a/skins/common/rightclickedit.js
+++ /dev/null
@@ -1,48 +0,0 @@
-function setupRightClickEdit() {
- if (document.getElementsByTagName) {
- var spans = document.getElementsByTagName('span');
- for (var i = 0; i < spans.length; i++) {
- var el = spans[i];
- if(el.className == 'editsection') {
- addRightClickEditHandler(el);
- }
- }
- }
-}
-
-function addRightClickEditHandler(el) {
- for (var i = 0; i < el.childNodes.length; i++) {
- var link = el.childNodes[i];
- if (link.nodeType == 1 && link.nodeName.toLowerCase() == 'a') {
- var editHref = link.getAttribute('href');
- // find the enclosing (parent) header
- var prev = el.parentNode;
- if (prev && prev.nodeType == 1 &&
- prev.nodeName.match(/^[Hh][1-6]$/)) {
- prev.oncontextmenu = function(e) {
- if (!e) { e = window.event; }
- // e is now the event in all browsers
- var targ;
- if (e.target) { targ = e.target; }
- else if (e.srcElement) { targ = e.srcElement; }
- if (targ.nodeType == 3) { // defeat Safari bug
- targ = targ.parentNode;
- }
- // targ is now the target element
-
- // We don't want to deprive the noble reader of a context menu
- // for the section edit link, do we? (Might want to extend this
- // to all <a>'s?)
- if (targ.nodeName.toLowerCase() != 'a'
- || targ.parentNode.className != 'editsection') {
- document.location = editHref;
- return false;
- }
- return true;
- };
- }
- }
- }
-}
-
-hookEvent("load", setupRightClickEdit);
diff --git a/skins/common/search.css b/skins/common/search.css
new file mode 100644
index 00000000..22c3ca4a
--- /dev/null
+++ b/skins/common/search.css
@@ -0,0 +1,14 @@
+/**
+ * Fixes sister projects box moving down the extract
+ * of the first result (bug #16886).
+ * It only happens when the window is small and
+ * This changes slightly the layout for big screens
+ * where there was space for the extracts and the
+ * sister projects and thus it showed like in any
+ * other browser.
+ *
+ * This will only affect IE 7 and lower
+ */
+html > body .searchresult {
+ display: inline;
+}
diff --git a/skins/common/search.js b/skins/common/search.js
index ff114291..26d807db 100644
--- a/skins/common/search.js
+++ b/skins/common/search.js
@@ -1,7 +1,7 @@
// JS specific to Special:Search
// change the search link to what user entered
-function mwSearchHeaderClick( obj ) {
+window.mwSearchHeaderClick = function( obj ) {
var searchbox = document.getElementById( 'searchText' );
if( searchbox === null ) {
searchbox = document.getElementById( 'powerSearchText' );
@@ -11,7 +11,7 @@ function mwSearchHeaderClick( obj ) {
}
var searchterm = searchbox.value;
- var parts = obj.href.split( 'search=' );
+ var parts = obj.getAttribute( 'href', 2).split( 'search=' );
var lastpart = '';
var prefix = 'search=';
if( parts.length > 1 && parts[1].indexOf('&') >= 0 ) {
@@ -20,9 +20,9 @@ function mwSearchHeaderClick( obj ) {
prefix = '&search=';
}
obj.href = parts[0] + prefix + encodeURIComponent( searchterm ) + lastpart;
-}
+};
-function mwToggleSearchCheckboxes( btn ) {
+window.mwToggleSearchCheckboxes = function( btn ) {
if( !document.getElementById ) {
return;
}
@@ -47,4 +47,4 @@ function mwToggleSearchCheckboxes( btn ) {
}
}
}
-}
+};
diff --git a/skins/common/shared.css b/skins/common/shared.css
index 674d3626..00032b3f 100644
--- a/skins/common/shared.css
+++ b/skins/common/shared.css
@@ -4,11 +4,21 @@
* another, but don't ignore the poor non-Monobook users either.
*/
+/* Default style for semantic tags */
+abbr, acronym, .explain {
+ border-bottom: 1px dotted black;
+ cursor: help;
+}
+
/* Colored watchlist and recent changes numbers */
.mw-plusminus-pos { color: #006400; } /* dark green */
.mw-plusminus-neg { color: #8b0000; } /* dark red */
.mw-plusminus-null { color: #aaa; } /* gray */
+/* Links to redirects appear italicized on [[Special:AllPages]], [[Special:PrefixIndex]],
+ [[Special:Watchlist/edit]] and in category listings */
+.allpagesredirect, .redirect-in-category, .watchlistredir { font-style: italic; }
+
/* Comment and username portions of RC entries */
span.comment {
font-style: italic;
@@ -19,7 +29,10 @@ span.changedby {
}
/* Math */
-.texvc { direction: ltr; unicode-bidi: embed; }
+.texvc {
+ direction: ltr;
+ unicode-bidi: embed;
+}
img.tex { vertical-align: middle; }
span.texhtml { font-family: serif; }
@@ -28,7 +41,9 @@ span.texhtml { font-family: serif; }
#wikiPreview.ontop { margin-bottom: 1em; }
/* Stop floats from intruding into edit area in previews */
-#editform, #toolbar, #wpTextbox1 { clear: both; }
+#editform, #toolbar, #wpTextbox1 {
+ clear: both;
+}
div#mw-js-message {
margin: 1em 5%;
@@ -52,14 +67,14 @@ h2#filehistory {
table.filehistory th,
table.filehistory td {
- vertical-align:top;
+ vertical-align: top;
}
table.filehistory th {
text-align: left;
}
table.filehistory td.mw-imagepage-filesize,
table.filehistory th.mw-imagepage-filesize {
- white-space:nowrap;
+ white-space: nowrap;
}
table.filehistory td.filehistory-selected {
@@ -95,28 +110,32 @@ div.patrollink {
/**
* Forms
*/
-body.ltr td.mw-label { text-align: right; }
-body.ltr td.mw-input { text-align: left; }
-body.ltr td.mw-submit { text-align: left; }
-body.rtl td.mw-label { text-align: left; }
-body.rtl td.mw-input { text-align: right; }
-body.rtl td.mw-submit { text-align: right; }
+td.mw-label { text-align: right; }
+td.mw-input { text-align: left; }
+td.mw-submit { text-align: left; }
td.mw-label { vertical-align: top; }
.prefsection td.mw-label { width: 20%; }
.prefsection table { width: 100%; }
td.mw-submit { white-space: nowrap; }
-table.mw-htmlform-nolabel td.mw-label { width: 0 !important; }
+table.mw-htmlform-nolabel td.mw-label {
+ width: 0 !important;
+}
+
+tr.mw-htmlform-vertical-label td.mw-label {
+ text-align: left !important;
+}
+
+input#wpSummary {
+ width: 80%;
+}
/**
* Image captions
*/
-body.rtl .thumbcaption { text-align:right; }
-body.rtl .magnify { float:left; }
-
-body.ltr .thumbcaption { text-align:left; }
-body.ltr .magnify { float:right; }
+.thumbcaption { text-align: left; }
+.magnify { float: right; }
/**
* Hidden categories
@@ -144,7 +163,7 @@ p.mw-revdel-editreasons {
div.searchresult {
font-size: 95%;
- width:38em;
+ width: 38em;
}
.mw-search-results {
@@ -153,8 +172,8 @@ div.searchresult {
.mw-search-results li {
padding-bottom: 1em;
- list-style:none;
- list-style-image:none;
+ list-style: none;
+ list-style-image: none;
}
.mw-search-results li a {
font-size: 108%;
@@ -171,12 +190,9 @@ div.searchresult {
border: 1px solid silver;
}
.mw-search-formheader div.search-types {
- float:left;
+ float: left;
padding-left: 0.25em;
}
-.rtl .mw-search-formheader div.search-types {
- float: right;
-}
.mw-search-formheader div.search-types ul {
margin: 0 !important;
padding: 0 !important;
@@ -232,15 +248,9 @@ fieldset#mw-searchoptions h4 {
margin: 0;
float: left;
}
-.rtl fieldset#mw-searchoptions h4 {
- float: right;
-}
fieldset#mw-searchoptions div#mw-search-togglebox {
float: right;
}
-.rtl fieldset#mw-searchoptions div#mw-search-togglebox {
- float: left;
-}
fieldset#mw-searchoptions div#mw-search-togglebox label {
margin-right: 0.25em;
@@ -255,15 +265,6 @@ fieldset#mw-searchoptions table {
fieldset#mw-searchoptions table td {
padding-right: 1em;
}
-.rtl fieldset#mw-searchoptions table td {
- padding-left: 1em;
- padding-right: 0;
-}
-body.rtl fieldset#mw-searchoptions table {
- margin-right: 0;
- margin-left: 3em;
- float: right;
-}
fieldset#mw-searchoptions div.divider {
clear: both;
border-bottom: 1px solid #DDDDDD;
@@ -285,10 +286,6 @@ div#mw-search-interwiki {
margin-top: 2ex;
}
-.rtl div#mw-search-interwiki {
- float: left;
-}
-
div#mw-search-interwiki li {
font-size: 95%;
}
@@ -298,10 +295,6 @@ div#mw-search-interwiki li {
font-size: 90%;
}
-.rtl .mw-search-interwiki-more {
- float: left;
-}
-
div#mw-search-interwiki-caption {
text-align: center;
font-weight: bold;
@@ -315,12 +308,8 @@ div#mw-search-interwiki-caption {
padding-right: 0.15em;
padding-bottom: 0.2em;
padding-top: 0.15em;
- background-color:#ececec;
- border-top:1px solid #BBBBBB;
-}
-
-.rtl .mw-search-interwiki-project {
- text-align: right;
+ background-color: #ececec;
+ border-top: 1px solid #BBBBBB;
}
span.searchalttitle {
@@ -342,28 +331,22 @@ div.searchdidyoumean em {
font-weight: bold;
}
-table#mw-search-top-table {
- background-color: transparent;
-}
-
/*
* Advanced PowerSearch box
*/
-
td#mw-search-togglebox {
- text-align: right;
+ text-align: right;
}
table#mw-search-powertable {
- width:100%;
+ width: 100%;
}
form#powersearch {
clear: both;
}
-
/*
* UserRights stuff
*/
@@ -439,14 +422,18 @@ table.os-suggest-results {
/* the auto-generated edit comments */
.autocomment { color: gray; }
#pagehistory .history-user {
- margin-left: 0.4em;
- margin-right: 0.2em;
+ margin-left: 0.4em;
+ margin-right: 0.2em;
+}
+#pagehistory span.minor {
+ font-weight: bold;
+}
+#pagehistory li {
+ border: 1px solid white;
}
-#pagehistory span.minor { font-weight: bold; }
-#pagehistory li { border: 1px solid white; }
#pagehistory li.selected {
- background-color: #f9f9f9;
- border: 1px dashed #aaa;
+ background-color: #f9f9f9;
+ border: 1px dashed #aaa;
}
/** Generic minor/bot/newpage styling */
@@ -460,10 +447,12 @@ table.os-suggest-results {
}
/* Special:ListGroupRights styling */
-table.mw-listgrouprights-table tr {
+table.mw-listgrouprights-table tr {
vertical-align: top;
}
-.listgrouprights-revoked { text-decoration: line-through; }
+.listgrouprights-revoked {
+ text-decoration: line-through;
+}
/* Special:Statistics styling */
td.mw-statistics-numbers {
@@ -493,11 +482,7 @@ td#mw-emailuser-sender, td#mw-emailuser-recipient {
}
/* Special:Allpages styling */
-table.allpageslist {
- background-color: transparent;
-}
table.mw-allpages-table-form, table.mw-allpages-table-chunk {
- background-color: transparent;
width: 100%;
}
td.mw-allpages-alphaindexline {
@@ -508,7 +493,7 @@ td.mw-allpages-nav, p.mw-allpages-nav {
font-size: smaller;
margin-bottom: 1em;
}
-table.mw-allpages-table-form tr {
+table.mw-allpages-table-form tr {
vertical-align: top;
}
@@ -516,9 +501,8 @@ table.mw-allpages-table-form tr {
table#mw-prefixindex-list-table,
table#mw-prefixindex-nav-table {
width: 98%;
- background-color: transparent;
}
-td#mw-prefixindex-nav-form {
+td#mw-prefixindex-nav-form {
font-size: smaller;
margin-bottom: 1em;
text-align: right;
@@ -558,34 +542,38 @@ td.mw-revdel-checkbox, th.mw-revdel-checkbox {
/* feed links */
a.feedlink {
+ /* @embed */
background: url("images/feed-icon.png") center left no-repeat;
padding-left: 16px;
}
-/* Plainlinks - this can be used to switch
+/* Plainlinks - this can be used to switch
* off special external link styling */
.plainlinks a {
- background: none !important;
- padding: 0 !important;
+ background: none !important;
+ padding: 0 !important;
}
-/* wikitable class for skinning normal tables */
+/* wikitable class for skinning normal tables
+ * keep on sync with commonPrint.css
+ */
table.wikitable {
- margin: 1em 1em 1em 0;
- background: #f9f9f9;
- border: 1px #aaa solid;
- border-collapse: collapse;
+ margin: 1em 1em 1em 0;
+ background: #f9f9f9;
+ border: 1px #aaa solid;
+ border-collapse: collapse;
+ color: black;
}
.wikitable th, .wikitable td {
- border: 1px #aaa solid;
- padding: 0.2em;
+ border: 1px #aaa solid;
+ padding: 0.2em;
}
.wikitable th {
- background: #f2f2f2;
- text-align: center;
+ background: #f2f2f2;
+ text-align: center;
}
.wikitable caption {
- font-weight: bold;
+ font-weight: bold;
}
/* hide initially collapsed collapsable tables */
@@ -626,6 +614,17 @@ table.collapsed tr.collapsable {
border: none;
}
+/* Note on preview page */
+.previewnote {
+ color: #c00;
+ margin-bottom: 1em;
+}
+
+.previewnote p {
+ text-indent: 3em;
+ margin: 0.8em 0;
+}
+
.visualClear {
clear: both;
}
@@ -637,28 +636,46 @@ table.collapsed tr.collapsable {
}
/*
- Table pager (e.g. Special:Imagelist)
- - remove underlines from the navigation link
- - collapse borders
- - set the borders to outsets (similar to Special:Allmessages)
- - remove line wrapping for all td and th, set background color
- - restore line wrapping for the last two table cells (description and size)
+ Table pager (e.g. Special:ListFiles)
+ - remove underlines from the navigation link
+ - collapse borders
+ - set the borders to outsets (similar to Special:AllMessages)
+ - remove line wrapping for all td and th, set background color
+ - restore line wrapping for the last two table cells (description and size)
*/
-.TablePager { min-width: 80%; }
-.TablePager_nav a { text-decoration: none; }
-.TablePager { border-collapse: collapse; }
-.TablePager, .TablePager td, .TablePager th {
+.TablePager {
+ min-width: 80%;
+ border-collapse: collapse;
+}
+.TablePager_nav a {
+ text-decoration: none;
+}
+.TablePager, .TablePager td, .TablePager th {
border: 1px solid #aaaaaa;
padding: 0 0.15em 0 0.15em;
}
-.TablePager th { background-color: #eeeeff }
-.TablePager td { background-color: #ffffff }
-.TablePager tr:hover td { background-color: #eeeeff }
+.TablePager th {
+ background-color: #eeeeff;
+}
+.TablePager td {
+ background-color: #ffffff;
+}
+.TablePager tr:hover td {
+ background-color: #eeeeff;
+}
-.imagelist td, .imagelist th { white-space: nowrap }
-.imagelist .TablePager_col_links { background-color: #eeeeff }
-.imagelist .TablePager_col_img_description { white-space: normal }
-.imagelist th.TablePager_sort { background-color: #ccccff }
+.imagelist td, .imagelist th {
+ white-space: nowrap;
+}
+.imagelist .TablePager_col_links {
+ background-color: #eeeeff;
+}
+.imagelist .TablePager_col_img_description {
+ white-space: normal;
+}
+.imagelist th.TablePager_sort {
+ background-color: #ccccff;
+}
/* Allmessages table */
#mw-allmessagestable .allmessages-customised td.am_default {
@@ -736,31 +753,35 @@ table.mw_metadata td {
}
/* Galleries */
-table.gallery {
- border: 1px solid #ccc;
- margin: 2px;
- padding: 2px;
- background-color: white;
-}
-
-table.gallery tr {
- vertical-align: top;
-}
-
-table.gallery td {
+/* These display attributes look nonsensical, but are needed to support IE and FF2 */
+/* Don't forget to update commonPrint.css */
+li.gallerybox {
vertical-align: top;
background-color: #f9f9f9;
border: solid 2px white;
+ display: -moz-inline-box;
}
-table.gallery caption {
- font-weight: bold;
+
+ul.gallery, li.gallerybox {
+ display: inline-block;
+ zoom: 1;
+ *display: inline;
}
-div.gallerybox {
+ul.gallery {
margin: 2px;
+ padding: 2px;
+ display: block;
}
-div.gallerybox div.thumb {
+li.gallerycaption {
+ font-weight: bold;
+ text-align: center;
+ display: block;
+ word-wrap: break-word;
+}
+
+li.gallerybox div.thumb {
text-align: center;
border: 1px solid #ccc;
margin: 2px;
@@ -770,6 +791,7 @@ div.gallerytext {
overflow: hidden;
font-size: 94%;
padding: 2px 4px;
+ word-wrap: break-word;
}
table.mw-enhanced-rc {
@@ -788,27 +810,30 @@ td.mw-enhanced-rc {
display: inline;
margin-left: 1em;
}
-
+
#mw-addcategory-prompt input {
margin-left: 0.5em;
margin-right: 0.5em;
}
-
+
.mw-remove-category {
padding: 8px;
+ /* @embed */
background-image: url(images/remove.png);
background-position: center center;
background-repeat: no-repeat;
}
-
+
.mw-ajax-addcategory {
padding-left: 20px;
+ /* @embed */
background-image: url(images/add.png);
background-position: left center;
background-repeat: no-repeat;
}
.mw-ajax-loader {
+ /* @embed */
background-image: url(images/ajax-loader.gif);
background-position: center center;
background-repeat: no-repeat;
@@ -820,6 +845,7 @@ td.mw-enhanced-rc {
.mw-small-spinner {
padding: 10px !important;
margin-right: 0.6em;
+ /* @embed */
background-image: url(images/spinner.gif);
background-position: center center;
background-repeat: no-repeat;
@@ -829,3 +855,58 @@ td.mw-enhanced-rc {
a.sortheader {
margin: 0 0.3em;
}
+
+/* Localised ordered list numbering for some languages */
+ol:lang(bcc) li,
+ol:lang(bqi) li,
+ol:lang(fa) li,
+ol:lang(glk) li,
+ol:lang(kk-arab) li,
+ol:lang(mzn) li {
+ list-style-type: -moz-persian;
+ list-style-type: persian;
+}
+
+ol:lang(ckb) li {
+ list-style-type: -moz-arabic-indic;
+ list-style-type: arabic-indic;
+}
+
+ol:lang(bn) li {
+ list-style-type: -moz-bengali;
+ list-style-type: bengali;
+}
+
+/* tooltip styles */
+.mw-help-field-hint {
+ display: none;
+ padding: 0px;
+ padding-left: 15px;
+ margin-left: 2px;
+ margin-bottom: -8px;
+ /* @embed */
+ background-image: url('images/help-question.gif');
+ background-position: left center;
+ background-repeat: no-repeat;
+ color: #0645ad;
+ text-decoration: underline;
+ cursor: pointer;
+ font-size: .8em;
+}
+.mw-help-field-hint:hover {
+ /* @embed */
+ background-image: url('images/help-question-hover.gif');
+}
+.mw-help-field-data {
+ display: block;
+ background-color: #d6f3ff;
+ padding:5px 8px 4px 8px;
+ border: 1px solid #5dc9f4;
+ margin-left: 20px;
+}
+.tipsy { padding: 5px 5px 10px; font-size: 12px; position: absolute; z-index: 100000; overflow: visible; }
+.tipsy-inner { padding: 5px 8px 4px 8px; background-color: #d6f3ff; color: black; border: 1px solid #5dc9f4; max-width: 300px; text-align: left; }
+.tipsy-arrow { position: absolute; /* @embed */ background: url( 'images/tipsy-arrow.gif' ) no-repeat top left; width: 13px; height: 13px; }
+.tipsy-se .tipsy-arrow { bottom: -2px; right: 10px; background-position: 0% 100%; }
+
+
diff --git a/skins/common/upload.js b/skins/common/upload.js
index f40f62e6..c877620b 100644
--- a/skins/common/upload.js
+++ b/skins/common/upload.js
@@ -1,4 +1,4 @@
-function licenseSelectorCheck() {
+window.licenseSelectorCheck = function() {
var selector = document.getElementById( "wpLicense" );
var selection = selector.options[selector.selectedIndex].value;
if( selector.selectedIndex > 0 ) {
@@ -9,11 +9,11 @@ function licenseSelectorCheck() {
}
// We might show a preview
wgUploadLicenseObj.fetchPreview( selection );
-}
+};
-function wgUploadSetup() {
+window.wgUploadSetup = function() {
// Disable URL box if the URL copy upload source type is not selected
- var e = document.getElementById( 'wpSourceTypeURL' );
+ var e = document.getElementById( 'wpSourceTypeurl' );
if( e ) {
if( !e.checked ) {
var ein = document.getElementById( 'wpUploadFileURL' );
@@ -59,12 +59,12 @@ function wgUploadSetup() {
row.appendChild( td );
}
- if ( wgAjaxLicensePreview ) {
+ var wpLicense = document.getElementById( 'wpLicense' );
+ if ( wgAjaxLicensePreview && wpLicense ) {
// License selector check
- document.getElementById( 'wpLicense' ).onchange = licenseSelectorCheck;
+ wpLicense.onchange = licenseSelectorCheck;
// License selector table row
- var wpLicense = document.getElementById( 'wpLicense' );
var wpLicenseRow = wpLicense.parentNode.parentNode;
var wpLicenseTbody = wpLicenseRow.parentNode;
@@ -84,15 +84,14 @@ function wgUploadSetup() {
document.getElementById( wgUploadSourceIds[i] ).onchange = function (e) {
fillDestFilename( this.id );
};
-}
+};
/**
* Iterate over all upload source fields and disable all except the selected one.
*
- * @param enabledId The id of the selected radio button
* @return emptiness
*/
-function toggleUploadInputs() {
+window.toggleUploadInputs = function() {
// Iterate over all rows with UploadSourceField
var rows;
if ( document.getElementsByClassName ) {
@@ -124,9 +123,9 @@ function toggleUploadInputs() {
inputs[j].disabled = !isChecked;
}
}
-}
+};
-var wgUploadWarningObj = {
+window.wgUploadWarningObj = {
'responseCache' : { '' : '&nbsp;' },
'nameToCheck' : '',
'typing': false,
@@ -210,9 +209,9 @@ var wgUploadWarningObj = {
element.innerHTML = text;
}
}
-}
+};
-function fillDestFilename(id) {
+window.fillDestFilename = function(id) {
if (!wgUploadAutoFill) {
return;
}
@@ -242,7 +241,7 @@ function fillDestFilename(id) {
// Clear the filename if it does not have a valid extension.
// URLs are less likely to have a useful extension, so don't include them in the
// extension check.
- if( wgFileExtensions && id != 'wpUploadFileURL' ) {
+ if( wgStrictFileExtensions && wgFileExtensions && id != 'wpUploadFileURL' ) {
var found = false;
if( fname.lastIndexOf( '.' ) != -1 ) {
var ext = fname.substr( fname.lastIndexOf( '.' ) + 1 );
@@ -264,16 +263,19 @@ function fillDestFilename(id) {
if( e ) e.className = 'error';
// Clear wpDestFile as well
- var e = document.getElementById( 'wpDestFile' )
+ var e = document.getElementById( 'wpDestFile' );
if( e ) e.value = '';
return false;
}
}
- // Capitalise first letter and replace spaces by underscores
- // FIXME: $wgCapitalizedNamespaces
- fname = fname.charAt(0).toUpperCase().concat(fname.substring(1,10000)).replace(/ /g, '_');
+ // Replace spaces by underscores
+ fname = fname.replace( / /g, '_' );
+ // Capitalise first letter if needed
+ if ( wgCapitalizeUploads ) {
+ fname = fname.charAt( 0 ).toUpperCase().concat( fname.substring( 1, 10000 ) );
+ }
// Output result
var destFile = document.getElementById('wpDestFile');
@@ -281,9 +283,9 @@ function fillDestFilename(id) {
destFile.value = fname;
wgUploadWarningObj.checkNow(fname) ;
}
-}
+};
-function toggleFilenameFiller() {
+window.toggleFilenameFiller = function() {
if(!document.getElementById) return;
var upfield = document.getElementById('wpUploadFile');
var destName = document.getElementById('wpDestFile').value;
@@ -292,9 +294,9 @@ function toggleFilenameFiller() {
} else {
wgUploadAutoFill = false;
}
-}
+};
-var wgUploadLicenseObj = {
+window.wgUploadLicenseObj = {
'responseCache' : { '' : '' },
@@ -338,6 +340,6 @@ var wgUploadLicenseObj = {
previewPanel.innerHTML = preview;
}
-}
+};
addOnloadHook( wgUploadSetup );
diff --git a/skins/common/wikibits.js b/skins/common/wikibits.js
index 94f23a9c..fcf2713e 100644
--- a/skins/common/wikibits.js
+++ b/skins/common/wikibits.js
@@ -1,34 +1,46 @@
// MediaWiki JavaScript support functions
-var clientPC = navigator.userAgent.toLowerCase(); // Get client info
-var is_gecko = /gecko/.test( clientPC ) &&
+window.clientPC = navigator.userAgent.toLowerCase(); // Get client info
+window.is_gecko = /gecko/.test( clientPC ) &&
!/khtml|spoofer|netscape\/7\.0/.test(clientPC);
-var webkit_match = clientPC.match(/applewebkit\/(\d+)/);
+
+window.is_safari = window.is_safari_win = window.webkit_version =
+ window.is_chrome = window.is_chrome_mac = false;
+window.webkit_match = clientPC.match(/applewebkit\/(\d+)/);
if (webkit_match) {
- var is_safari = clientPC.indexOf('applewebkit') != -1 &&
+ window.is_safari = clientPC.indexOf('applewebkit') != -1 &&
clientPC.indexOf('spoofer') == -1;
- var is_safari_win = is_safari && clientPC.indexOf('windows') != -1;
- var webkit_version = parseInt(webkit_match[1]);
+ window.is_safari_win = is_safari && clientPC.indexOf('windows') != -1;
+ window.webkit_version = parseInt(webkit_match[1]);
+ // Tests for chrome here, to avoid breaking old scripts safari left alone
+ // This is here for accesskeys
+ window.is_chrome = clientPC.indexOf('chrome') !== -1 &&
+ clientPC.indexOf('spoofer') === -1;
+ window.is_chrome_mac = is_chrome && clientPC.indexOf('mac') !== -1
}
+
// For accesskeys; note that FF3+ is included here!
-var is_ff2 = /firefox\/[2-9]|minefield\/3/.test( clientPC );
-var ff2_bugs = /firefox\/2/.test( clientPC );
+window.is_ff2 = /firefox\/[2-9]|minefield\/3/.test( clientPC );
+window.ff2_bugs = /firefox\/2/.test( clientPC );
// These aren't used here, but some custom scripts rely on them
-var is_ff2_win = is_ff2 && clientPC.indexOf('windows') != -1;
-var is_ff2_x11 = is_ff2 && clientPC.indexOf('x11') != -1;
+window.is_ff2_win = is_ff2 && clientPC.indexOf('windows') != -1;
+window.is_ff2_x11 = is_ff2 && clientPC.indexOf('x11') != -1;
+
+window.is_opera = window.is_opera_preseven = window.is_opera_95 =
+ window.opera6_bugs = window.opera7_bugs = window.opera95_bugs = false;
if (clientPC.indexOf('opera') != -1) {
- var is_opera = true;
- var is_opera_preseven = window.opera && !document.childNodes;
- var is_opera_seven = window.opera && document.childNodes;
- var is_opera_95 = /opera\/(9\.[5-9]|[1-9][0-9])/.test( clientPC );
- var opera6_bugs = is_opera_preseven;
- var opera7_bugs = is_opera_seven && !is_opera_95;
- var opera95_bugs = /opera\/(9\.5)/.test( clientPC );
+ window.is_opera = true;
+ window.is_opera_preseven = window.opera && !document.childNodes;
+ window.is_opera_seven = window.opera && document.childNodes;
+ window.is_opera_95 = /opera\/(9\.[5-9]|[1-9][0-9])/.test( clientPC );
+ window.opera6_bugs = is_opera_preseven;
+ window.opera7_bugs = is_opera_seven && !is_opera_95;
+ window.opera95_bugs = /opera\/(9\.5)/.test( clientPC );
}
// As recommended by <http://msdn.microsoft.com/en-us/library/ms537509.aspx>,
// avoiding false positives from moronic extensions that append to the IE UA
// string (bug 23171)
-var ie6_bugs = false;
+window.ie6_bugs = false;
if ( /msie ([0-9]{1,}[\.0-9]{0,})/.exec( clientPC ) != null
&& parseFloat( RegExp.$1 ) <= 6.0 ) {
ie6_bugs = true;
@@ -38,35 +50,31 @@ if ( /msie ([0-9]{1,}[\.0-9]{0,})/.exec( clientPC ) != null
/*extern ta, stylepath, skin */
// add any onload functions in this hook (please don't hard-code any events in the xhtml source)
-var doneOnloadHook;
+window.doneOnloadHook = undefined;
if (!window.onloadFuncts) {
- var onloadFuncts = [];
+ window.onloadFuncts = [];
}
-function addOnloadHook( hookFunct ) {
+window.addOnloadHook = function( hookFunct ) {
// Allows add-on scripts to add onload functions
if( !doneOnloadHook ) {
onloadFuncts[onloadFuncts.length] = hookFunct;
} else {
hookFunct(); // bug in MSIE script loading
}
-}
+};
-function hookEvent( hookName, hookFunct ) {
- addHandler( window, hookName, hookFunct );
-}
-
-function importScript( page ) {
+window.importScript = function( page ) {
// TODO: might want to introduce a utility function to match wfUrlencode() in PHP
var uri = wgScript + '?title=' +
encodeURIComponent(page.replace(/ /g,'_')).replace(/%2F/ig,'/').replace(/%3A/ig,':') +
'&action=raw&ctype=text/javascript';
return importScriptURI( uri );
-}
+};
-var loadedScripts = {}; // included-scripts tracker
-function importScriptURI( url ) {
+window.loadedScripts = {}; // included-scripts tracker
+window.importScriptURI = function( url ) {
if ( loadedScripts[url] ) {
return null;
}
@@ -76,13 +84,13 @@ function importScriptURI( url ) {
s.setAttribute( 'type', 'text/javascript' );
document.getElementsByTagName('head')[0].appendChild( s );
return s;
-}
+};
-function importStylesheet( page ) {
+window.importStylesheet = function( page ) {
return importStylesheetURI( wgScript + '?action=raw&ctype=text/css&title=' + encodeURIComponent( page.replace(/ /g,'_') ) );
-}
+};
-function importStylesheetURI( url, media ) {
+window.importStylesheetURI = function( url, media ) {
var l = document.createElement( 'link' );
l.type = 'text/css';
l.rel = 'stylesheet';
@@ -92,9 +100,9 @@ function importStylesheetURI( url, media ) {
}
document.getElementsByTagName('head')[0].appendChild( l );
return l;
-}
+};
-function appendCSS( text ) {
+window.appendCSS = function( text ) {
var s = document.createElement( 'style' );
s.type = 'text/css';
s.rel = 'stylesheet';
@@ -105,7 +113,7 @@ function appendCSS( text ) {
}
document.getElementsByTagName('head')[0].appendChild( s );
return s;
-}
+};
// Special stylesheet links for Monobook only (see bug 14717)
if ( typeof stylepath != 'undefined' && skin == 'monobook' ) {
@@ -121,14 +129,14 @@ if ( typeof stylepath != 'undefined' && skin == 'monobook' ) {
}
-if ( wgBreakFrames ) {
+if ( 'wgBreakFrames' in window && window.wgBreakFrames ) {
// Un-trap us from framesets
if ( window.top != window ) {
window.top.location = window.location;
}
}
-function showTocToggle() {
+window.showTocToggle = function() {
if ( document.createTextNode ) {
// Uses DOM calls to avoid document.write + XHTML issues
@@ -145,8 +153,10 @@ function showTocToggle() {
var toggleLink = document.createElement( 'a' );
toggleLink.id = 'togglelink';
toggleLink.className = 'internal';
- toggleLink.href = 'javascript:toggleToc()';
- toggleLink.appendChild( document.createTextNode( tocHideText ) );
+ toggleLink.href = '#';
+ addClickHandler( toggleLink, function( evt ) { toggleToc(); return killEvt( evt ); } );
+
+ toggleLink.appendChild( document.createTextNode( mediaWiki.msg( 'hidetoc' ) ) );
outerSpan.appendChild( document.createTextNode( '[' ) );
outerSpan.appendChild( toggleLink );
@@ -160,47 +170,59 @@ function showTocToggle() {
toggleToc();
}
}
-}
+};
-function changeText( el, newText ) {
+window.changeText = function( el, newText ) {
// Safari work around
if ( el.innerText ) {
el.innerText = newText;
} else if ( el.firstChild && el.firstChild.nodeValue ) {
el.firstChild.nodeValue = newText;
}
-}
+};
-function toggleToc() {
+window.killEvt = function( evt ) {
+ evt = evt || window.event || window.Event; // W3C, IE, Netscape
+ if ( typeof ( evt.preventDefault ) != 'undefined' ) {
+ evt.preventDefault(); // Don't follow the link
+ evt.stopPropagation();
+ } else {
+ evt.cancelBubble = true; // IE
+ }
+ return false; // Don't follow the link (IE)
+};
+
+window.toggleToc = function() {
var tocmain = document.getElementById( 'toc' );
var toc = document.getElementById('toc').getElementsByTagName('ul')[0];
var toggleLink = document.getElementById( 'togglelink' );
if ( toc && toggleLink && toc.style.display == 'none' ) {
- changeText( toggleLink, tocHideText );
+ changeText( toggleLink, mediaWiki.msg( 'hidetoc' ) );
toc.style.display = 'block';
document.cookie = "hidetoc=0";
tocmain.className = 'toc';
} else {
- changeText( toggleLink, tocShowText );
+ changeText( toggleLink, mediaWiki.msg( 'showtoc' ) );
toc.style.display = 'none';
document.cookie = "hidetoc=1";
tocmain.className = 'toc tochidden';
}
-}
+ return false;
+};
-var mwEditButtons = [];
-var mwCustomEditButtons = []; // eg to add in MediaWiki:Common.js
+window.mwEditButtons = [];
+window.mwCustomEditButtons = []; // eg to add in MediaWiki:Common.js
-function escapeQuotes( text ) {
+window.escapeQuotes = function( text ) {
var re = new RegExp( "'", "g" );
text = text.replace( re, "\\'" );
re = new RegExp( "\\n", "g" );
text = text.replace( re, "\\n" );
return escapeQuotesHTML( text );
-}
+};
-function escapeQuotesHTML( text ) {
+window.escapeQuotesHTML = function( text ) {
var re = new RegExp( '&', "g" );
text = text.replace( re, "&amp;" );
re = new RegExp( '"', "g" );
@@ -210,14 +232,16 @@ function escapeQuotesHTML( text ) {
re = new RegExp( '>', "g" );
text = text.replace( re, "&gt;" );
return text;
-}
+};
/**
* Set the accesskey prefix based on browser detection.
*/
-var tooltipAccessKeyPrefix = 'alt-';
+window.tooltipAccessKeyPrefix = 'alt-';
if ( is_opera ) {
tooltipAccessKeyPrefix = 'shift-esc-';
+} else if ( is_chrome ) {
+ tooltipAccessKeyPrefix = is_chrome_mac ? 'ctrl-option-' : 'alt-';
} else if ( !is_safari_win && is_safari && webkit_version > 526 ) {
tooltipAccessKeyPrefix = 'ctrl-alt-';
} else if ( !is_safari_win && ( is_safari
@@ -227,7 +251,7 @@ if ( is_opera ) {
} else if ( is_ff2 ) {
tooltipAccessKeyPrefix = 'alt-shift-';
}
-var tooltipAccessKeyRegexp = /\[(ctrl-)?(alt-)?(shift-)?(esc-)?(.)\]$/;
+window.tooltipAccessKeyRegexp = /\[(ctrl-)?(alt-)?(shift-)?(esc-)?(.)\]$/;
/**
* Add the appropriate prefix to the accesskey shown in the tooltip.
@@ -235,9 +259,9 @@ var tooltipAccessKeyRegexp = /\[(ctrl-)?(alt-)?(shift-)?(esc-)?(.)\]$/;
* otherwise, all the nodes that will probably have accesskeys by
* default are updated.
*
- * @param Array nodeList -- list of elements to update
+ * @param nodeList Array list of elements to update
*/
-function updateTooltipAccessKeys( nodeList ) {
+window.updateTooltipAccessKeys = function( nodeList ) {
if ( !nodeList ) {
// Rather than scan all links on the whole page, we can just scan these
// containers which contain the relevant links. This is really just an
@@ -267,7 +291,7 @@ function updateTooltipAccessKeys( nodeList ) {
element.setAttribute( 'title', tip );
}
}
-}
+};
/**
* Add a link to one of the portlet menus on the page, including:
@@ -287,22 +311,40 @@ function updateTooltipAccessKeys( nodeList ) {
* nextnode parameter; to add the link _after_ an existing item, pass
* the node's nextSibling instead.
*
- * @param String portlet -- id of the target portlet ("p-cactions", "p-personal", "p-navigation" or "p-tb")
- * @param String href -- link URL
- * @param String text -- link text (will be automatically lowercased by CSS for p-cactions in Monobook)
- * @param String id -- id of the new item, should be unique and preferably have the appropriate prefix ("ca-", "pt-", "n-" or "t-")
- * @param String tooltip -- text to show when hovering over the link, without accesskey suffix
- * @param String accesskey -- accesskey to activate this link (one character, try to avoid conflicts)
- * @param Node nextnode -- the DOM node before which the new item should be added, should be another item in the same list
+ * @param portlet String id of the target portlet ("p-cactions", "p-personal", "p-navigation" or "p-tb")
+ * @param href String link URL
+ * @param text String link text (will be automatically lowercased by CSS for p-cactions in Monobook)
+ * @param id String id of the new item, should be unique and preferably have the appropriate prefix ("ca-", "pt-", "n-" or "t-")
+ * @param tooltip String text to show when hovering over the link, without accesskey suffix
+ * @param accesskey String accesskey to activate this link (one character, try to avoid conflicts)
+ * @param nextnode Node the DOM node before which the new item should be added, should be another item in the same list
*
* @return Node -- the DOM node of the new item (an LI element) or null
*/
-function addPortletLink( portlet, href, text, id, tooltip, accesskey, nextnode ) {
+window.addPortletLink = function( portlet, href, text, id, tooltip, accesskey, nextnode ) {
var root = document.getElementById( portlet );
if ( !root ) {
return null;
}
- var node = root.getElementsByTagName( 'ul' )[0];
+ var uls = root.getElementsByTagName( 'ul' );
+ var node;
+ if ( uls.length > 0 ) {
+ node = uls[0];
+ } else {
+ node = document.createElement( 'ul' );
+ var lastElementChild = null;
+ for ( var i = 0; i < root.childNodes.length; ++i ) { /* get root.lastElementChild */
+ if ( root.childNodes[i].nodeType == 1 ) {
+ lastElementChild = root.childNodes[i];
+ }
+ }
+ if ( lastElementChild && lastElementChild.nodeName.match( /div/i ) ) {
+ /* Insert into the menu divs */
+ lastElementChild.appendChild( node );
+ } else {
+ root.appendChild( node );
+ }
+ }
if ( !node ) {
return null;
}
@@ -310,15 +352,16 @@ function addPortletLink( portlet, href, text, id, tooltip, accesskey, nextnode )
// unhide portlet if it was hidden before
root.className = root.className.replace( /(^| )emptyPortlet( |$)/, "$2" );
- var span = document.createElement( 'span' );
- span.appendChild( document.createTextNode( text ) );
-
var link = document.createElement( 'a' );
- link.appendChild( span );
+ link.appendChild( document.createTextNode( text ) );
link.href = href;
+ // Wrap in a span - make it work with vector tabs and has no effect on any other portlets
+ var span = document.createElement( 'span' );
+ span.appendChild( link );
+
var item = document.createElement( 'li' );
- item.appendChild( link );
+ item.appendChild( span );
if ( id ) {
item.id = id;
}
@@ -341,15 +384,21 @@ function addPortletLink( portlet, href, text, id, tooltip, accesskey, nextnode )
}
return item;
-}
+};
-function getInnerText( el ) {
+window.getInnerText = function( el ) {
if ( typeof el == 'string' ) {
return el;
}
if ( typeof el == 'undefined' ) {
return el;
}
+ // Custom sort value through 'data-sort-value' attribute
+ // (no need to prepend hidden text to change sort value)
+ if ( el.nodeType && el.getAttribute( 'data-sort-value' ) !== null ) {
+ // Make sure it's a valid DOM element (.nodeType) and that the attribute is set (!null)
+ return el.getAttribute( 'data-sort-value' );
+ }
if ( el.textContent ) {
return el.textContent; // not needed but it is faster
}
@@ -371,24 +420,24 @@ function getInnerText( el ) {
}
}
return str;
-}
+};
/* Dummy for deprecated function */
window.ta = [];
-function akeytt( doId ) {
-}
+window.akeytt = function( doId ) {
+};
-var checkboxes;
-var lastCheckbox;
+window.checkboxes = undefined;
+window.lastCheckbox = undefined;
-function setupCheckboxShiftClick() {
+window.setupCheckboxShiftClick = function() {
checkboxes = [];
lastCheckbox = null;
var inputs = document.getElementsByTagName( 'input' );
addCheckboxClickHandlers( inputs );
-}
+};
-function addCheckboxClickHandlers( inputs, start ) {
+window.addCheckboxClickHandlers = function( inputs, start ) {
if ( !start ) {
start = 0;
}
@@ -400,13 +449,13 @@ function addCheckboxClickHandlers( inputs, start ) {
for ( var i = start; i < finish; i++ ) {
var cb = inputs[i];
- if ( !cb.type || cb.type.toLowerCase() != 'checkbox' ) {
+ if ( !cb.type || cb.type.toLowerCase() != 'checkbox' || ( ' ' + cb.className + ' ' ).indexOf( ' noshiftselect ' ) != -1 ) {
continue;
}
var end = checkboxes.length;
checkboxes[end] = cb;
cb.index = end;
- cb.onclick = checkboxClickHandler;
+ addClickHandler( cb, checkboxClickHandler );
}
if ( finish < inputs.length ) {
@@ -414,9 +463,9 @@ function addCheckboxClickHandlers( inputs, start ) {
addCheckboxClickHandlers( inputs, finish );
}, 200 );
}
-}
+};
-function checkboxClickHandler( e ) {
+window.checkboxClickHandler = function( e ) {
if ( typeof e == 'undefined' ) {
e = window.event;
}
@@ -441,7 +490,7 @@ function checkboxClickHandler( e ) {
}
lastCheckbox = this.index;
return true;
-}
+};
/*
@@ -450,7 +499,7 @@ function checkboxClickHandler( e ) {
Author says "The credit comment is all it takes, no license. Go crazy with it!:-)"
From http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/
*/
-function getElementsByClassName( oElm, strTagName, oClassNames ) {
+window.getElementsByClassName = function( oElm, strTagName, oClassNames ) {
var arrReturnElements = new Array();
if ( typeof( oElm.getElementsByClassName ) == 'function' ) {
/* Use a native implementation where possible FF3, Saf3.2, Opera 9.5 */
@@ -492,9 +541,9 @@ function getElementsByClassName( oElm, strTagName, oClassNames ) {
}
}
return ( arrReturnElements );
-}
+};
-function redirectToFragment( fragment ) {
+window.redirectToFragment = function( fragment ) {
var match = navigator.userAgent.match(/AppleWebKit\/(\d+)/);
if ( match ) {
var webKitVersion = parseInt( match[1] );
@@ -504,19 +553,24 @@ function redirectToFragment( fragment ) {
return;
}
}
- if ( is_gecko ) {
- // Mozilla needs to wait until after load, otherwise the window doesn't scroll
- addOnloadHook(function() {
- if ( window.location.hash == '' ) {
- window.location.hash = fragment;
- }
- });
- } else {
- if ( window.location.hash == '' ) {
- window.location.hash = fragment;
+ if ( window.location.hash == '' ) {
+ window.location.hash = fragment;
+
+ // Mozilla needs to wait until after load, otherwise the window doesn't
+ // scroll. See <https://bugzilla.mozilla.org/show_bug.cgi?id=516293>.
+ // There's no obvious way to detect this programmatically, so we use
+ // version-testing. If Firefox fixes the bug, they'll jump twice, but
+ // better twice than not at all, so make the fix hit future versions as
+ // well.
+ if ( is_gecko ) {
+ addOnloadHook(function() {
+ if ( window.location.hash == fragment ) {
+ window.location.hash = fragment;
+ }
+ });
}
}
-}
+};
/*
* Table sorting script based on one (c) 1997-2006 Stuart Langridge and Joost
@@ -529,16 +583,16 @@ function redirectToFragment( fragment ) {
* @todo support all accepted date formats (bug 8226)
*/
-var ts_image_path = stylepath + '/common/images/';
-var ts_image_up = 'sort_up.gif';
-var ts_image_down = 'sort_down.gif';
-var ts_image_none = 'sort_none.gif';
-var ts_europeandate = wgContentLanguage != 'en'; // The non-American-inclined can change to "true"
-var ts_alternate_row_colors = false;
-var ts_number_transform_table = null;
-var ts_number_regex = null;
+window.ts_image_path = stylepath + '/common/images/';
+window.ts_image_up = 'sort_up.gif';
+window.ts_image_down = 'sort_down.gif';
+window.ts_image_none = 'sort_none.gif';
+window.ts_europeandate = wgContentLanguage != 'en'; // The non-American-inclined can change to "true"
+window.ts_alternate_row_colors = false;
+window.ts_number_transform_table = null;
+window.ts_number_regex = null;
-function sortables_init() {
+window.sortables_init = function() {
var idnum = 0;
// Find all tables with class sortable and make them sortable
var tables = getElementsByClassName( document, 'table', 'sortable' );
@@ -549,9 +603,9 @@ function sortables_init() {
}
ts_makeSortable( tables[ti] );
}
-}
+};
-function ts_makeSortable( table ) {
+window.ts_makeSortable = function( table ) {
var firstRow;
if ( table.rows && table.rows.length > 0 ) {
if ( table.tHead && table.tHead.rows.length > 0 ) {
@@ -568,25 +622,25 @@ function ts_makeSortable( table ) {
for ( var i = 0; i < firstRow.cells.length; i++ ) {
var cell = firstRow.cells[i];
if ( (' ' + cell.className + ' ').indexOf(' unsortable ') == -1 ) {
- cell.innerHTML += '<a href="#" class="sortheader" '
+ $(cell).append ( '<a href="#" class="sortheader" '
+ 'onclick="ts_resortTable(this);return false;">'
+ '<span class="sortarrow">'
+ '<img src="'
+ ts_image_path
+ ts_image_none
- + '" alt="&darr;"/></span></a>';
+ + '" alt="&darr;"/></span></a>');
}
}
if ( ts_alternate_row_colors ) {
ts_alternate( table );
}
-}
+};
-function ts_getInnerText( el ) {
+window.ts_getInnerText = function( el ) {
return getInnerText( el );
-}
+};
-function ts_resortTable( lnk ) {
+window.ts_resortTable = function( lnk ) {
// get the span
var span = lnk.getElementsByTagName('span')[0];
@@ -614,7 +668,15 @@ function ts_resortTable( lnk ) {
// Work out a type for the column
// Skip the first row if that's where the headings are
var rowStart = ( table.tHead && table.tHead.rows.length > 0 ? 0 : 1 );
-
+ var bodyRows = 0;
+ if (rowStart == 0 && table.tBodies) {
+ for (var i=0; i < table.tBodies.length; i++ ) {
+ bodyRows += table.tBodies[i].rows.length;
+ }
+ if (bodyRows < table.rows.length)
+ rowStart = 1;
+ }
+
var itm = '';
for ( var i = rowStart; i < table.rows.length; i++ ) {
if ( table.rows[i].cells.length > column ) {
@@ -703,20 +765,20 @@ function ts_resortTable( lnk ) {
if ( ts_alternate_row_colors ) {
ts_alternate( table );
}
-}
+};
-function ts_initTransformTable() {
+window.ts_initTransformTable = function() {
if ( typeof wgSeparatorTransformTable == 'undefined'
|| ( wgSeparatorTransformTable[0] == '' && wgDigitTransformTable[2] == '' ) )
{
- digitClass = "[0-9,.]";
+ var digitClass = "[0-9,.]";
ts_number_transform_table = false;
} else {
ts_number_transform_table = {};
// Unpack the transform table
// Separators
- ascii = wgSeparatorTransformTable[0].split("\t");
- localised = wgSeparatorTransformTable[1].split("\t");
+ var ascii = wgSeparatorTransformTable[0].split("\t");
+ var localised = wgSeparatorTransformTable[1].split("\t");
for ( var i = 0; i < ascii.length; i++ ) {
ts_number_transform_table[localised[i]] = ascii[i];
}
@@ -728,8 +790,8 @@ function ts_initTransformTable() {
}
// Construct regex for number identification
- digits = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ',', '\\.'];
- maxDigitLength = 1;
+ var digits = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ',', '\\.'];
+ var maxDigitLength = 1;
for ( var digit in ts_number_transform_table ) {
// Escape regex metacharacters
digits.push(
@@ -741,9 +803,9 @@ function ts_initTransformTable() {
}
}
if ( maxDigitLength > 1 ) {
- digitClass = '[' + digits.join( '', digits ) + ']';
+ var digitClass = '[' + digits.join( '', digits ) + ']';
} else {
- digitClass = '(' + digits.join( '|', digits ) + ')';
+ var digitClass = '(' + digits.join( '|', digits ) + ')';
}
}
@@ -756,13 +818,13 @@ function ts_initTransformTable() {
"[-+\u2212]?" + digitClass + "+%?" + // Generic localised
")$", "i"
);
-}
+};
-function ts_toLowerCase( s ) {
+window.ts_toLowerCase = function( s ) {
return s.toLowerCase();
-}
+};
-function ts_dateToSortKey( date ) {
+window.ts_dateToSortKey = function( date ) {
// y2k notes: two digit years less than 50 are treated as 20XX, greater than 50 are treated as 19XX
if ( date.length == 11 ) {
switch ( date.substr( 3, 3 ).toLowerCase() ) {
@@ -812,7 +874,7 @@ function ts_dateToSortKey( date ) {
return date.substr( 6, 4 ) + date.substr( 3, 2 ) + date.substr( 0, 2 );
}
} else if ( date.length == 8 ) {
- yr = date.substr( 6, 2 );
+ var yr = date.substr( 6, 2 );
if ( parseInt( yr ) < 50 ) {
yr = '20' + yr;
} else {
@@ -825,9 +887,9 @@ function ts_dateToSortKey( date ) {
}
}
return '00000000';
-}
+};
-function ts_parseFloat( s ) {
+window.ts_parseFloat = function( s ) {
if ( !s ) {
return 0;
}
@@ -844,19 +906,19 @@ function ts_parseFloat( s ) {
}
s = newNum;
}
- num = parseFloat( s.replace(/[, ]/g, '').replace("\u2212", '-') );
+ var num = parseFloat( s.replace(/[, ]/g, '').replace("\u2212", '-') );
return ( isNaN( num ) ? -Infinity : num );
-}
+};
-function ts_currencyToSortKey( s ) {
+window.ts_currencyToSortKey = function( s ) {
return ts_parseFloat(s.replace(/[^-\u22120-9.,]/g,''));
-}
+};
-function ts_sort_generic( a, b ) {
+window.ts_sort_generic = function( a, b ) {
return a[1] < b[1] ? -1 : a[1] > b[1] ? 1 : a[2] - b[2];
-}
+};
-function ts_alternate( table ) {
+window.ts_alternate = function( table ) {
// Take object table and get all it's tbodies.
var tableBodies = table.getElementsByTagName( 'tbody' );
// Loop through these tbodies
@@ -877,7 +939,7 @@ function ts_alternate( table ) {
tableRows[j].className = newClassName + ( j % 2 == 0 ? 'even' : 'odd' );
}
}
-}
+};
/*
* End of table sorting code
@@ -888,12 +950,12 @@ function ts_alternate( table ) {
* Add a cute little box at the top of the screen to inform the user of
* something, replacing any preexisting message.
*
- * @param String -or- Dom Object message HTML to be put inside the right div
- * @param String className Used in adding a class; should be different for each
+ * @param message String -or- Dom Object HTML to be put inside the right div
+ * @param className String Used in adding a class; should be different for each
* call to allow CSS/JS to hide different boxes. null = no class used.
* @return Boolean True on success, false on failure
*/
-function jsMsg( message, className ) {
+window.jsMsg = function( message, className ) {
if ( !document.getElementById ) {
return false;
}
@@ -937,7 +999,7 @@ function jsMsg( message, className ) {
messageDiv.innerHTML = message;
}
return true;
-}
+};
/**
* Inject a cute little progress spinner after the specified element
@@ -945,7 +1007,7 @@ function jsMsg( message, className ) {
* @param element Element to inject after
* @param id Identifier string (for use with removeSpinner(), below)
*/
-function injectSpinner( element, id ) {
+window.injectSpinner = function( element, id ) {
var spinner = document.createElement( 'img' );
spinner.id = 'mw-spinner-' + id;
spinner.src = stylepath + '/common/images/spinner.gif';
@@ -955,21 +1017,21 @@ function injectSpinner( element, id ) {
} else {
element.parentNode.appendChild( spinner );
}
-}
+};
/**
* Remove a progress spinner added with injectSpinner()
*
* @param id Identifier string
*/
-function removeSpinner( id ) {
+window.removeSpinner = function( id ) {
var spinner = document.getElementById( 'mw-spinner-' + id );
if( spinner ) {
spinner.parentNode.removeChild( spinner );
}
-}
+};
-function runOnloadHook() {
+window.runOnloadHook = function() {
// don't run anything below this for non-dom browsers
if ( doneOnloadHook || !( document.getElementById && document.getElementsByTagName ) ) {
return;
@@ -981,53 +1043,58 @@ function runOnloadHook() {
updateTooltipAccessKeys( null );
setupCheckboxShiftClick();
- sortables_init();
+
+ jQuery( document ).ready( sortables_init );
// Run any added-on functions
for ( var i = 0; i < onloadFuncts.length; i++ ) {
onloadFuncts[i]();
}
-}
+};
/**
* Add an event handler to an element
*
- * @param Element element Element to add handler to
- * @param String attach Event to attach to
- * @param callable handler Event handler callback
+ * @param element Element to add handler to
+ * @param attach String Event to attach to
+ * @param handler callable Event handler callback
*/
-function addHandler( element, attach, handler ) {
- if( window.addEventListener ) {
+window.addHandler = function( element, attach, handler ) {
+ if( element.addEventListener ) {
element.addEventListener( attach, handler, false );
- } else if( window.attachEvent ) {
+ } else if( element.attachEvent ) {
element.attachEvent( 'on' + attach, handler );
}
-}
+};
+
+window.hookEvent = function( hookName, hookFunct ) {
+ addHandler( window, hookName, hookFunct );
+};
/**
* Add a click event handler to an element
*
- * @param Element element Element to add handler to
- * @param callable handler Event handler callback
+ * @param element Element to add handler to
+ * @param handler callable Event handler callback
*/
-function addClickHandler( element, handler ) {
+window.addClickHandler = function( element, handler ) {
addHandler( element, 'click', handler );
-}
+};
/**
* Removes an event handler from an element
*
- * @param Element element Element to remove handler from
- * @param String remove Event to remove
- * @param callable handler Event handler callback to remove
+ * @param element Element to remove handler from
+ * @param remove String Event to remove
+ * @param handler callable Event handler callback to remove
*/
-function removeHandler( element, remove, handler ) {
+window.removeHandler = function( element, remove, handler ) {
if( window.removeEventListener ) {
element.removeEventListener( remove, handler, false );
} else if( window.detachEvent ) {
element.detachEvent( 'on' + remove, handler );
}
-}
+};
// note: all skins should call runOnloadHook() at the end of html output,
// so the below should be redundant. It's there just in case.
hookEvent( 'load', runOnloadHook );
@@ -1036,7 +1103,4 @@ if ( ie6_bugs ) {
importScriptURI( stylepath + '/common/IEFixes.js' );
}
-// For future use.
-mw = {};
-
-
+showTocToggle();
diff --git a/skins/common/wikiprintable.css b/skins/common/wikiprintable.css
index 8b099bb2..a80c8307 100644
--- a/skins/common/wikiprintable.css
+++ b/skins/common/wikiprintable.css
@@ -1,10 +1,10 @@
/* MediaWiki print stylesheet */
body {
- color: #000000; background: #ffffff;
+ color: #000000;
+ background: #ffffff;
}
-
/* MSIE/Win doesn't understand 'inherit' */
a, a.external, a.new, a.stub {
color: black ! important;
diff --git a/skins/common/wikistandard.css b/skins/common/wikistandard.css
index 5bf59246..62050922 100644
--- a/skins/common/wikistandard.css
+++ b/skins/common/wikistandard.css
@@ -1,48 +1,178 @@
-#article { padding: 4px; }
-#content { margin: 0; padding: 0; }
-#footer { padding: 4px;font-size:95%;clear: both; }
-#pagestats { font-size: 9pt; }
+#article {
+ padding: 4px;
+}
+
+#content {
+ margin: 0;
+ padding: 0;
+}
+
+#footer {
+ padding: 4px;
+ font-size: 95%;
+ clear: both;
+}
+
+#pagestats {
+ font-size: 9pt;
+}
+
#powersearch {
- background: #DDEEFF; border-style: solid; border-width: 1px; padding: 2px;
+ background: #DDEEFF;
+ border-style: solid;
+ border-width: 1px;
+ padding: 2px;
+}
+
+#quickbar {
+ width: 140px;
+ height: 100%;
+ padding: 4px;
+ visibility: visible;
+ z-index: 99;
+ font-size: 95%;
}
-#quickbar { width: 140px; height:100%; padding: 4px; visibility: visible; z-index:99;font-size:95%;}
-#topbar { padding: 4px;font-size:95%; }
+#topbar {
+ padding: 4px;
+ font-size: 95%;
+}
/* Table of contents */
-.toctoggle, .editsection { font-size: smaller; }
+.toctoggle, .editsection {
+ font-size: smaller;
+}
/* ... */
-#toolbar { padding:0px; }
-#infobox { background:#eeeeff;color:black;}
-#editform { margin-top:1px; }
-a.interwiki, a.external { color: #3366BB; }
-a.printable { text-decoration: underline; }
-a.stub { color:#772233; text-decoration:none; }
-a:visited { color: #5A3696; }
-body { margin: 0px; padding: 4px; color: black; }
-form.inline { display: inline; }
-textarea { overflow: auto; }
-
-
-h1.pagetitle { padding-top: 0; margin-top: 0; padding-bottom: 0; margin-bottom: 0;
-font-size:150%; }
-h1.pagetitle .editsection { font-size: 66.7%; }
-h2 { font-size: 120%; }
-h2 .editsection { font-size: 83.3%; }
-h2, h3, h4, h5, h6 { margin-bottom: 0;}
-h3 { font-size: 106.25%; }
-h3 .editsection { font-size: 94.1%; }
-h4 { font-size: 103.125%; }
-h4 .editsection { font-size: 97.0%; }
-h5 { font-size: 100%; }
-h5 .editsection { font-size: 100%; }
-h6 { font-size: 95%; }
-h6 .editsection { font-size: 105.3%; }
-hr.sep { color:gray;height:1px;background-color:gray;}
-p.subpages { font-size:small;}
-p.subtitle { padding-top: 0; margin-top: 0;}
-.catlinks { font-size:small; margin-top:0; text-align:right;}
-td { empty-cells:show; }
-td.bottom { border-top: 1px solid gray; }
-td.top { border-bottom: 1px solid gray; }
+#toolbar {
+ padding: 0px;
+}
+
+#infobox {
+ background: #eeeeff;
+ color: black;
+}
+
+#editform {
+ margin-top: 1px;
+}
+
+a.interwiki, a.external {
+ color: #3366BB;
+}
+
+a.printable {
+ text-decoration: underline;
+}
+
+a.stub {
+ color: #772233;
+ text-decoration: none;
+}
+
+a:visited {
+ color: #5A3696;
+}
+
+body {
+ margin: 0px;
+ padding: 4px;
+ color: black;
+}
+
+form.inline {
+ display: inline;
+}
+
+textarea {
+ overflow: auto;
+}
+
+h1.pagetitle {
+ padding-top: 0;
+ margin-top: 0;
+ padding-bottom: 0;
+ margin-bottom: 0;
+ font-size: 150%;
+}
+
+h1.pagetitle .editsection {
+ font-size: 66.7%;
+}
+
+h2 {
+ font-size: 120%;
+}
+
+h2 .editsection {
+ font-size: 83.3%;
+}
+
+h2, h3, h4, h5, h6 {
+ margin-bottom: 0;
+}
+
+h3 {
+ font-size: 106.25%;
+}
+
+h3 .editsection {
+ font-size: 94.1%;
+}
+
+h4 {
+ font-size: 103.125%;
+}
+
+h4 .editsection {
+ font-size: 97.0%;
+}
+
+h5 {
+ font-size: 100%;
+}
+
+h5 .editsection {
+ font-size: 100%;
+}
+
+h6 {
+ font-size: 95%;
+}
+
+h6 .editsection {
+ font-size: 105.3%;
+}
+
+hr.sep {
+ color: gray;
+ height: 1px;
+ background-color: gray;
+}
+
+p.subpages {
+ font-size: small;
+}
+
+p.subtitle {
+ padding-top: 0;
+ margin-top: 0;
+}
+
+.catlinks {
+ font-size: small;
+ margin-top: 0;
+ text-align:right;
+}
+
+td {
+ empty-cells: show;
+}
+
+td.bottom {
+ border-top: 1px solid gray;
+}
+
+td.top {
+ border-bottom: 1px solid gray;
+}