diff options
Diffstat (limited to 'skins/common')
75 files changed, 2460 insertions, 0 deletions
diff --git a/skins/common/IEFixes.js b/skins/common/IEFixes.js new file mode 100644 index 00000000..9c25adf0 --- /dev/null +++ b/skins/common/IEFixes.js @@ -0,0 +1,127 @@ +// IE fixes javascript + +var isMSIE55 = (window.showModalDialog && window.clipboardData && window.createPopup); +var doneIETransform; +var doneIEAlphaFix; + +if (document.attachEvent) + document.attachEvent('onreadystatechange', hookit); + +function hookit() { + if (!doneIETransform && document.getElementById && document.getElementById('bodyContent')) { + doneIETransform = true; + relativeforfloats(); + fixalpha(); + } +} + +// png alpha transparency fixes +function fixalpha() { + // bg + if (isMSIE55 && !doneIEAlphaFix) + { + var plogo = document.getElementById('p-logo'); + if (!plogo) return; + + var logoa = plogo.getElementsByTagName('a')[0]; + if (!logoa) return; + + var bg = logoa.currentStyle.backgroundImage; + var imageUrl = bg.substring(5, bg.length-2); + + doneIEAlphaFix = true; + + if (imageUrl.substr(imageUrl.length-4).toLowerCase() == '.png') { + var logospan = logoa.appendChild(document.createElement('span')); + + logoa.style.backgroundImage = 'none'; + logospan.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=' + imageUrl + ')'; + logospan.style.height = '100%'; + logospan.style.position = 'absolute'; + logospan.style.width = logoa.currentStyle.width; + logospan.style.cursor = 'hand'; + // Center image with hack for IE5.5 + if (document.documentElement.dir == "rtl") + { + logospan.style.right = '50%'; + logospan.style.setExpression('marginRight', '"-" + (this.offsetWidth / 2) + "px"'); + } + else + { + logospan.style.left = '50%'; + logospan.style.setExpression('marginLeft', '"-" + (this.offsetWidth / 2) + "px"'); + } + logospan.style.top = '50%'; + logospan.style.setExpression('marginTop', '"-" + (this.offsetHeight / 2) + "px"'); + + var linkFix = logoa.appendChild(logoa.cloneNode()); + linkFix.style.position = 'absolute'; + linkFix.style.height = '100%'; + linkFix.style.width = '100%'; + } + } +} + +// fix ie6 disappering float bug +function relativeforfloats() { + var bc = document.getElementById('bodyContent'); + if (bc) { + var tables = bc.getElementsByTagName('table'); + var divs = bc.getElementsByTagName('div'); + } + setrelative(tables); + setrelative(divs); +} +function setrelative (nodes) { + var i = 0; + while (i < nodes.length) { + if(((nodes[i].style.float && nodes[i].style.float != ('none') || + (nodes[i].align && nodes[i].align != ('none'))) && + (!nodes[i].style.position || nodes[i].style.position != 'relative'))) + { + nodes[i].style.position = 'relative'; + } + i++; + } +} + + +// Expand links for printing + +String.prototype.hasClass = function(classWanted) +{ + var classArr = this.split(/\s/); + for (var i=0; i<classArr.length; i++) + if (classArr[i].toLowerCase() == classWanted.toLowerCase()) return true; + return false; +} + +var expandedURLs; + +onbeforeprint = function() { + expandedURLs = []; + + var contentEl = document.getElementById("content"); + + if (contentEl) + { + var allLinks = contentEl.getElementsByTagName("a"); + + for (var i=0; i < allLinks.length; i++) { + if (allLinks[i].className.hasClass("external") && !allLinks[i].className.hasClass("free")) { + var expandedLink = document.createElement("span"); + var expandedText = document.createTextNode(" (" + allLinks[i].href + ")"); + expandedLink.appendChild(expandedText); + allLinks[i].parentNode.insertBefore(expandedLink, allLinks[i].nextSibling); + expandedURLs[i] = expandedLink; + } + } + } +} + +onafterprint = function() +{ + for (var i=0; i < expandedURLs.length; i++) + if (expandedURLs[i]) + expandedURLs[i].removeNode(true); +}
\ No newline at end of file diff --git a/skins/common/ajax.js b/skins/common/ajax.js new file mode 100644 index 00000000..90676548 --- /dev/null +++ b/skins/common/ajax.js @@ -0,0 +1,177 @@ +// remote scripting library +// (c) copyright 2005 modernmethod, inc +var sajax_debug_mode = false; +var sajax_request_type = "GET"; + +var started; +var typing; +var memory=null; +var body=null; +var oldbody=null; + +function sajax_debug(text) { + if (sajax_debug_mode) + alert("RSD: " + text) +} + + +function sajax_init_object() { + sajax_debug("sajax_init_object() called..") + var A; + try { + A=new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + A=new ActiveXObject("Microsoft.XMLHTTP"); + } catch (oc) { + A=null; + } + } + if(!A && typeof XMLHttpRequest != "undefined") + A = new XMLHttpRequest(); + if (!A) + sajax_debug("Could not create connection object."); + return A; +} + + +function sajax_do_call(func_name, args) { + var i, x, n; + var uri; + var post_data; + uri = wgServer + "/" + wgScriptPath + "/index.php?action=ajax"; + if (sajax_request_type == "GET") { + if (uri.indexOf("?") == -1) + uri = uri + "?rs=" + escape(func_name); + else + uri = uri + "&rs=" + escape(func_name); + for (i = 0; i < args.length-1; i++) + uri = uri + "&rsargs[]=" + escape(args[i]); + //uri = uri + "&rsrnd=" + new Date().getTime(); + post_data = null; + } else { + post_data = "rs=" + escape(func_name); + for (i = 0; i < args.length-1; i++) + post_data = post_data + "&rsargs[]=" + escape(args[i]); + } + x = sajax_init_object(); + x.open(sajax_request_type, uri, true); + 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.onreadystatechange = function() { + if (x.readyState != 4) + return; + sajax_debug("received " + x.responseText); + var status; + var data; + status = x.responseText.charAt(0); + data = x.responseText.substring(2); + if (status == "-") + alert("Error: " + data); + else + args[args.length-1](data); + } + x.send(post_data); + sajax_debug(func_name + " uri = " + uri + "/post = " + post_data); + sajax_debug(func_name + " waiting.."); + delete x; +} + +// Remove the typing barrier to allow call() to complete +function Search_doneTyping() +{ + typing=false; +} + +// Wait 500ms to run call() +function Searching_Go() +{ + setTimeout("Searching_Call()", 500); +} + +// If the user is typing wait until they are done. +function Search_Typing() { + started=true; + typing=true; + window.status = "Waiting until you're done typing..."; + setTimeout("Search_doneTyping()", 500); + + // I believe these are needed by IE for when the users press return? + if (window.event) + { + if (event.keyCode == 13) + { + event.cancelBubble = true; + event.returnValue = false; + } + } +} + +// Set the body div to the results +function Searching_SetResult(result) +{ + //body.innerHTML = result; + t = document.getElementById("searchTarget"); + if ( t == null ) { + oldbody=body.innerHTML; + body.innerHTML= '<div id="searchTargetContainer"><div id="searchTarget" ></div></div>' ; + t = document.getElementById("searchTarget"); + } + t.innerHTML = result; + t.style.display='block'; +} + +function Searching_Hide_Results() +{ + t = document.getElementById("searchTarget"); + t.style.display='none'; + body.innerHTML = oldbody; +} + + +// This will call the php function that will eventually +// return a results table +function Searching_Call() +{ + var x; + Searching_Go(); + + //Don't proceed if user is typing + if (typing) + return; + + x = document.getElementById("searchInput").value; + + // Don't search again if the query is the same + if (x==memory) + return; + + memory=x; + if (started) { + // Don't search for blank or < 3 chars. + if ((x=="") || (x.length < 3)) + { + return; + } + x_wfSajaxSearch(x, Searching_SetResult); + } +} + +function x_wfSajaxSearch() { + sajax_do_call( "wfSajaxSearch", x_wfSajaxSearch.arguments ); +} + + +//Initialize +function sajax_onload() { + x = document.getElementById( 'searchInput' ); + x.onkeypress= function() { Search_Typing(); }; + Searching_Go(); + body = document.getElementById("content"); +} + +hookEvent("load", sajax_onload); diff --git a/skins/common/cologneblue.css b/skins/common/cologneblue.css new file mode 100644 index 00000000..33c12abb --- /dev/null +++ b/skins/common/cologneblue.css @@ -0,0 +1,96 @@ +@import url("common.css?2"); + +body { margin: 0px; padding: 0px; color: black; } +#specialform { display: inline; } +#content { top: 0; margin: 0; padding: 0; } +#topbar { padding: 0px; } +#powersearch { + background: #DDEEFF; border-style: solid; border-width: 1px; padding: 2px; +} +#quickbar { + width: 140px; top: 18ex; padding: 2px; visibility: visible; z-index: 99; +} +#article, #article td, #article th, #article p { + font-family: Verdana, Arial, sans-serif; + font-size: 10pt; color: black; +} +#article p { + padding-top: 0; padding-bottom: 0; + margin-top: 1ex; margin-bottom: 0; +} +p, pre, td, th, li, dd, dt { line-height: 12pt; } +textarea { overflow: auto; } + +#footer { padding: 4px; } +#footer form { display: inline; } +#sitetitle { + font-family: Times, serif; + color: white; + font-weight: normal; font-size: 32pt; + line-height: 32pt; +} +td.top { + background-color: #6688AA; color: white; + margin-top: 4px; margin-bottom: 4px; + padding-top: 0; padding-bottom: 0; + text-transform: uppercase; + font-family: Verdana, Arial, sans-serif; font-size: 8pt; +} +td.top a { + font-family: Verdana, Arial, sans-serif; + background-color: #6688AA; color: white; + text-decoration: none; font-size: 10pt; +} +td.bottom { + font-family: Verdana, Arial, sans-serif; + font-size: 10pt; + padding: 0; +} +#pagestats { + font-family: Verdana, Arial, sans-serif; + color: black; + font-size: 9pt; +} +#sitesub { + font-family: Verdana, Arial, sans-serif; + font-size: 9pt; font-weight: bold; + color: black; + padding-top: 0; +} +#quickbar { + font-family: Verdana, Arial, sans-serif; + font-size: 8pt; font-weight: bold; line-height: 9.5pt; + text-decoration: none; + color: black; + padding: 0; margin-top: 0; +} +#quickbar a { color: #446688; } + +#quickbar h6 { + font-family: Verdana, Arial, sans-serif; + font-size: 10pt; font-weight: bold; line-height: 12pt; + text-decoration: none; + color: #666666; + padding: 0; margin-bottom: 2px; margin-top: 6px; +} +#quickbar form { padding: 0; margin-top: 0; } + +h1 { + color: #666666; + font-family: Verdana, Arial, sans-serif; + font-size: 18pt; font-weight: bold; line-height: 21pt; +} +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%; }
\ No newline at end of file diff --git a/skins/common/common.css b/skins/common/common.css new file mode 100644 index 00000000..09409fd6 --- /dev/null +++ b/skins/common/common.css @@ -0,0 +1,386 @@ +/* + * common.css + * This file contains CSS settings common to Wikistandard, Nostalgia and CologneBlue + */ +#footer { clear: both } +/* images */ +div.floatright { float: right; margin: 0 0 1em 1em; } +div.floatright p { font-style: italic; } +div.floatleft { float: left; margin: 0.3em 0.5em 0.5em 0; } +div.floatleft p { font-style: italic; } + + +/* Print-specific things to hide */ +.printfooter { + display: none; +} + +/* table standards */ +table.rimage { + float:right; + margin-left:1em; + margin-bottom:1em; + text-align:center; + font-size:smaller; +} + +/* thumbnails */ +div.thumb { + margin: 10px; + text-align: center; + width: auto; +} +div.thumb div { + border: 1px solid #8888aa; + background-color: #f7f8ff; + padding: 2px; + font-size: 94%; + text-align: center; + overflow: hidden; +} +div.thumb div * { + border: none; + background: none; +} +div.thumb img { + border:1px solid #8888AA; + margin-bottom:3px; + background:#FFFFFF; +} +div.thumbcaption, +div.thumbcaption * { + border: none !important; + background: none !important; +} +div.thumbcaption { + padding: 0.2em 0 0.2em 0 !important; + text-align: left !important; +} +div.tright { + float: right; + margin-left:0.5em; +} +div.tleft { + float: left; + margin-right:0.5em; +} + +/* Page history styling */ +/* the auto-generated edit comments */ +.autocomment { color: #4b4b4b; } +#pagehistory span.user { + margin-left: 1.4em; + margin-right: 0.4em; +} +#pagehistory span.minor { font-weight: bold; } +#pagehistory li { border: 1px solid White; } +#pagehistory li.selected { + background-color:#f9f9f9; + border:1px dashed #aaaaaa; +} + +table.diff { background:white; } +td.diff-otitle { background:#cccccc; } +td.diff-ntitle { background:#cccccc; } +td.diff-addedline { + background:#ccffcc; + font-size: 94%; +} +td.diff-deletedline { + background:#ffffaa; + font-size: 94%; +} +td.diff-context { + background:#eeeeee; + font-size: 94%; +} +span.diffchange { color: red; font-weight: bold; } + +img { border: none; } +img.tex { vertical-align: middle; } +span.texhtml { font-family: serif; } + + +#toc, +.toc { + border: 1px solid #bba; + background-color: #f7f8ff; + padding: 5px; + font-size: 95%; + text-align: center; +} +#toc h2, +.toc h2 { + display: inline; + border: none; + padding: 0; + font-size: 100%; + font-weight: bold; +} +#toc ul, +.toc ul { + list-style-type: none; + list-style-image: none; + margin-left: 0; + padding-left: 0; + text-align: left; +} +#toc ul ul, +.toc ul ul { + margin: 0 0 0 2em; +} +#toc .toctoggle, +.toc .toctoggle { + font-size: 94%; +} + + +.error { + color: red; + font-size: larger; +} + +/* preference page with js-genrated toc */ +#preftoc { + float: left; + margin: 1em 1em 1em 1em; + width: 13em; +} +#preftoc li { border: 1px solid White; } +#preftoc li.selected { + background-color:#f9f9f9; + border:1px dashed #aaaaaa; +} +#preftoc a, +#preftoc a:active { + display: block; + color: #005189; +} +#prefcontrol { + clear: left; + float: left; + margin-top: 1em; +} +div.prefsectiontip { + font-size: 94%; + margin-top: 1em; +} +fieldset.prefsection { margin-top: 1em } +fieldset.operaprefsection { margin-left: 15em } + +/* emulate center */ +.center { + width: 100%; + text-align: center; +} +*.center * { + margin-left: auto; + margin-right: auto; +} +/* small for tables and similar */ +.small, .small * { font-size: 94%; } +table.small { font-size: 100% } + +div.townBox { + position:relative; + float:right; + background:White; + margin-left:1em; + border: 1px solid gray; + padding:0.3em; + width: 200px; + overflow: hidden; + clear: right; +} +div.townBox dl { + padding: 0; + margin: 0 0 0.3em 0; + font-size: 96%; +} +div.townBox dl dt { + background: none; + margin: 0.4em 0 0 0; +} +div.townBox dl dd { + margin: 0.1em 0 0 1.1em; + background-color: #f3f3f3; +} +/* use this instead of #toc for page content */ +.toccolours { + 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; +} +.redirectText { + font-size:150%; + margin:5px; +} +.searchmatch { + color: red; + font-weight: bold; +} +.sharedUploadNotice { + font-style: italic; +} +span.unpatrolled { + font-weight:bold; + color:red; +} + +span.updatedmarker { + color:black; + background-color:#00FF00; +} +span.newpageletter { + font-weight:bold; + color:black; + background-color:yellow; +} +span.minoreditletter { + color:black; + background-color:#C5FFE6; +} + +table.gallery { + border: 1px solid #cccccc; + margin: 2px; + padding: 2px; + background-color:#ffffff; +} + +table.gallery tr { + vertical-align:top; +} + +table.gallery td { + vertical-align:top; + background-color:#f9f9f9; + border: solid 2px white; +} + +div.gallerybox { + margin: 2px; + width: 150px; +} + +div.gallerybox div.thumb { + text-align: center; + border: 1px solid #cccccc; + margin: 2px; +} + +div.gallerytext { + font-size: 94%; + padding: 2px 4px; +} + +span.comment { + font-style: italic; +} + +span.changedby { + font-size: 95%; +} + +.previewnote { + text-align: center; + 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; +} +.editExternallyHelp { + font-style:italic; + color:gray; +} + +li span.deleted { + text-decoration: line-through; + color: #888; + font-style: italic; +} + + +/* Classes for EXIF data display */ +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 { + border: none; + border-collapse: collapse; +} +table.mw_metadata td, table.mw_metadata th { + border: 1px solid #aaaaaa; + padding-left: 4px; + padding-right: 4px; +} +table.mw_metadata th { + background-color: #f9f9f9; +} +table.mw_metadata td { + background-color: #fcfcfc; +} +table.mw_metadata td.spacer { + background: inherit; + border-top: none; + border-bottom: none; +} +table.collapsed tr.collapsable { + display: none; +} + +.visualClear { + clear: both; +} + +#mw_trackbacks { + border: solid 1px #bbbbff; + background-color: #eeeeff; + padding: 0.2em; +} + +/* Allmessages table */ + +#allmessagestable th { + background-color: #b2b2ff; +} + +#allmessagestable tr.orig { + background-color: #ffe2e2; +} + +#allmessagestable tr.new { + background-color: #e2ffe2; +} + +#allmessagestable tr.def { + background-color: #f0f0ff; +} + +#jump-to-nav { + display: none; +} + +table.gallery td.galleryheader { + text-align: center; + font-weight: bold; +}
\ No newline at end of file diff --git a/skins/common/commonPrint.css b/skins/common/commonPrint.css new file mode 100644 index 00000000..7dcb5700 --- /dev/null +++ b/skins/common/commonPrint.css @@ -0,0 +1,288 @@ +/* +** MediaWiki Print style sheet for CSS2-capable browsers. +** Copyright Gabriel Wicke, http://www.aulinx.de/ +** +** Derived from the plone (http://plone.org/) styles +** Copyright Alexander Limi +*/ + +/* Thanks to A List Apart (http://alistapart.com/) for useful extras */ +a.stub, +a.new{ color:#ba0000; text-decoration:none; } + +#toc { + /*border:1px solid #2f6fab;*/ + border:1px solid #aaaaaa; + background-color:#f9f9f9; + padding:5px; +} +.tocindent { + margin-left: 2em; +} +.tocline { + margin-bottom: 0px; +} +.toctoggle, .editsection { + font-size: smaller; +} + +/* images */ +div.floatright { + float: 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; } +/* thumbnails */ +div.thumb { + margin-bottom: 0.5em; + border-style: solid; border-color: White; + width: auto; + overflow: hidden; +} +div.thumb div { + border:1px solid #cccccc; + padding: 3px !important; + background-color:#f9f9f9; + font-size: 94%; + text-align: center; +} +div.thumb div a img { + border:1px solid #cccccc; +} +div.thumb div div.thumbcaption { + border: none; + padding: 0.3em 0 0.1em 0; +} +div.magnify { display: none; } +div.tright { + float: right; + border-width: 0.5em 0 0.8em 1.4em; +} +div.tleft { + float: left; + margin-right:0.5em; + border-width: 0.5em 1.4em 0.8em 0; +} + +/* table standards */ +table.rimage { + 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; +} + +.noprint, +div#jump-to-nav, +div.top, +div#column-one, +#colophon, +.editsection, +.toctoggle, +.tochidden, +div#f-poweredbyico, +div#f-copyrightico, +li#f-viewcount, +li#f-about, +li#f-disclaimer, +li#f-privacy { + /* Hides all the elements irrelevant for printing */ + display: none; +} + +ul { + list-style-type: square; +} + +#content { + background: none; + border: none ! important; + font-size: 11pt; + padding: 0 ! important; + margin: 0 ! important; +} +#footer { + background : white; + color : black; + border-top: 1px solid black; +} + +h1, h2, h3, h4, h5, h6 +{ + font-weight: bold; +} + +p, .documentDescription { + margin: 1em 0 ! important; + line-height: 1.2em; +} + +.tocindent p { + margin: 0 0 0 0 ! important; +} + +pre { + 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; +} + +a { + color: Black !important; + padding: 0 !important +} + +a:link, a:visited { + color: #520; + background: transparent; + text-decoration: underline; +} + +#content a.external.text:after, #content a.external.autonumber:after { + /* Expand URLs for printing */ + content: " (" attr(href) ") "; +} + +#globalWrapper { + width: 100% !important; + min-width: 0 !important; +} + +#content { + background : white; + color : black; +} + +#column-content { + margin: 0 !important; +} + +#column-content #content { + padding: 1em; + margin: 0 !important; +} +/* MSIE/Win doesn't understand 'inherit' */ +a, a.external, a.new, a.stub { + color: black ! important; + text-decoration: none ! important; +} + +/* Continue ... */ +a, a.external, a.new, a.stub { + color: inherit ! important; + text-decoration: inherit ! important; +} + +img { border: none; } +img.tex { vertical-align: middle; } +span.texhtml { font-family: serif; } + +div.townBox { + position:relative; + float:right; + background:White; + margin-left:1em; + border: 1px solid gray; + padding:0.3em; + width: 200px; + overflow: hidden; + clear: right; +} +div.townBox dl { + padding: 0; + margin: 0 0 0.3em 0; + font-size: 96%; +} +div.townBox dl dt { + background: none; + margin: 0.4em 0 0 0; +} +div.townBox dl dd { + margin: 0.1em 0 0 1.1em; + background-color: #f3f3f3; +} + +#siteNotice { display: none; } + +table.gallery { + border: 1px solid #cccccc; + margin: 2px; + padding: 2px; + background-color:#ffffff; +} + +table.gallery tr { + vertical-align:top; +} + +div.gallerybox { + border: 1px solid #cccccc; + margin: 2px; + background-color:#f9f9f9; + width: 150px; +} + +div.gallerybox div.thumb { + text-align: center; + border: 1px solid #cccccc; + margin: 2px; +} + +div.gallerytext { + font-size: 94%; + padding: 2px 4px; +} + +/* +** Diff rendering +*/ +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; +} +td.diff-deletedline { + background:#ffffaa; + font-size: smaller; + border: dotted 2px black; +} +td.diff-context { + background:#eeeeee; + font-size: smaller; +} +span.diffchange { color: silver; font-weight: bold; text-decoration: underline; } + diff --git a/skins/common/common_rtl.css b/skins/common/common_rtl.css new file mode 100644 index 00000000..8f50b2ab --- /dev/null +++ b/skins/common/common_rtl.css @@ -0,0 +1,15 @@ +/* js pref toc */ +#preftoc { float: right; } +/* workaround for moz bug, displayed bullets on left side */ +#preftoc li { list-style: none; } +#prefcontrol { float: right; } +fieldset.prefsection, +fieldset.operaprefsection { + margin-left: 0; + margin-right: 18em; +} +/* page history */ +#pagehistory span.user { + margin-right: 1.4em; + margin-left: 0.4em; +} diff --git a/skins/common/feed.css b/skins/common/feed.css new file mode 100644 index 00000000..94396639 --- /dev/null +++ b/skins/common/feed.css @@ -0,0 +1,95 @@ +/* +Make RSS and Atom feeds at least semi-legible to folk who accidentally +load them in a browser... + +Compatibility: +* Mozilla is fine. +* Safari 1.2: the RSS <link> text isn't shown +* Opera 7.5 uses the style sheet instead of its native RSS mode. +* IE/Mac 5.2: none of the :before content works; doesn't get the charset right and displays garbage for non-ASCII. +* IE/Win 6.0: No background color, borders, font size, font weight, or :before content. + +*/ + +/* RSS: */ rss, channel, title, link, description, language, generator, lastBuildDate, item, pubDate, author, comments, creator, +/* Atom: */ feed, id, modified, tagline, entry, issued, created, updated, summary, comment { + display: block; +} + +rss, feed { + background: white; + color: black; + margin: 1em; + font-family: "Verdana", "Tahoma", "Arial", "Helvetica", sans-serif; + line-height: 1.5em; + font-size: 76%; +} + +rss:before { + content: "This RSS feed is meant to be read in a syndicated news reader, and isn't ideal for a web browser."; +} + +feed:before { + content: "This Atom feed is meant to be read in a syndicated news reader, and isn't ideal for a web browser."; +} +rss:before, feed:before { + color: red; + text-align: center; + line-height: 2em; +} + +channel>title, +item>title, +feed>title, +entry>title { + font-weight: bold; + border-bottom: solid 1px #aaa; + margin-left: -0.5em; +} +channel>title, feed>title { + font-size: larger; +} +item>title, entry>title { + font-size: large; +} +item, entry { + margin-top: 1em; + margin-left: 2em; +} + +item>description, entry>summary { + white-space: pre; + overflow: auto; + background: #f8f8ff; +} + +pubDate:before { content: "Date: " } +link:before { content: "Link: " } +author:before, creator:before { content: "Author: " } +description:before { content: "Description: " } +id:before { content: "Id: " } + +generator:before { content: "Generator: " } +language:before { content: "Language: " } +lastBuildDate:before { content: "Updated: " } +comments:before { content: "Comments page: " } + +tagline:before { content: "Tagline: " } +issued:before { content: "Issued: " } +created:before { content: "Created: " } +modified:before { content: "Modified: " } +updated:before { content: "Updated: " } +summary:before { content: "Summary: " } +comment:before { content: "Comment: " } + +pubDate:before, link:before, author:before, description:before, +language:before, generator:before, lastBuildDate:before, comments:before, +tagline:before, issued:before, created:before, modified:before, +summary:before, comment:before, creator:before, id:before, updated:before { + color: #224; + font-weight: bold; +} + +feed link:after { + content: attr(href); +} diff --git a/skins/common/images/Arr_.png b/skins/common/images/Arr_.png Binary files differnew file mode 100644 index 00000000..83fafc74 --- /dev/null +++ b/skins/common/images/Arr_.png diff --git a/skins/common/images/Arr_d.png b/skins/common/images/Arr_d.png Binary files differnew file mode 100644 index 00000000..421dd101 --- /dev/null +++ b/skins/common/images/Arr_d.png diff --git a/skins/common/images/Arr_l.png b/skins/common/images/Arr_l.png Binary files differnew file mode 100644 index 00000000..9db66232 --- /dev/null +++ b/skins/common/images/Arr_l.png diff --git a/skins/common/images/Arr_r.png b/skins/common/images/Arr_r.png Binary files differnew file mode 100644 index 00000000..d1b161b0 --- /dev/null +++ b/skins/common/images/Arr_r.png diff --git a/skins/common/images/Arr_r.xcf b/skins/common/images/Arr_r.xcf Binary files differnew file mode 100644 index 00000000..83b7b2a8 --- /dev/null +++ b/skins/common/images/Arr_r.xcf diff --git a/skins/common/images/Zoom_sans.gif b/skins/common/images/Zoom_sans.gif Binary files differnew file mode 100644 index 00000000..6ba0adca --- /dev/null +++ b/skins/common/images/Zoom_sans.gif diff --git a/skins/common/images/bullet.gif b/skins/common/images/bullet.gif Binary files differnew file mode 100644 index 00000000..b43de48a --- /dev/null +++ b/skins/common/images/bullet.gif diff --git a/skins/common/images/button_bold.png b/skins/common/images/button_bold.png Binary files differnew file mode 100644 index 00000000..5e52deed --- /dev/null +++ b/skins/common/images/button_bold.png diff --git a/skins/common/images/button_extlink.png b/skins/common/images/button_extlink.png Binary files differnew file mode 100644 index 00000000..12ec5f2e --- /dev/null +++ b/skins/common/images/button_extlink.png diff --git a/skins/common/images/button_headline.png b/skins/common/images/button_headline.png Binary files differnew file mode 100644 index 00000000..aa0ca540 --- /dev/null +++ b/skins/common/images/button_headline.png diff --git a/skins/common/images/button_hr.png b/skins/common/images/button_hr.png Binary files differnew file mode 100644 index 00000000..19cfc480 --- /dev/null +++ b/skins/common/images/button_hr.png diff --git a/skins/common/images/button_image.png b/skins/common/images/button_image.png Binary files differnew file mode 100644 index 00000000..6c3c3308 --- /dev/null +++ b/skins/common/images/button_image.png diff --git a/skins/common/images/button_italic.png b/skins/common/images/button_italic.png Binary files differnew file mode 100644 index 00000000..96b1fb9f --- /dev/null +++ b/skins/common/images/button_italic.png diff --git a/skins/common/images/button_link.png b/skins/common/images/button_link.png Binary files differnew file mode 100644 index 00000000..e9507b97 --- /dev/null +++ b/skins/common/images/button_link.png diff --git a/skins/common/images/button_math.png b/skins/common/images/button_math.png Binary files differnew file mode 100644 index 00000000..e91fb613 --- /dev/null +++ b/skins/common/images/button_math.png diff --git a/skins/common/images/button_media.png b/skins/common/images/button_media.png Binary files differnew file mode 100644 index 00000000..02070790 --- /dev/null +++ b/skins/common/images/button_media.png diff --git a/skins/common/images/button_nowiki.png b/skins/common/images/button_nowiki.png Binary files differnew file mode 100644 index 00000000..7b2d5392 --- /dev/null +++ b/skins/common/images/button_nowiki.png diff --git a/skins/common/images/button_sig.png b/skins/common/images/button_sig.png Binary files differnew file mode 100644 index 00000000..ef3a46d2 --- /dev/null +++ b/skins/common/images/button_sig.png diff --git a/skins/common/images/button_template.png b/skins/common/images/button_template.png Binary files differnew file mode 100644 index 00000000..8e9cc267 --- /dev/null +++ b/skins/common/images/button_template.png diff --git a/skins/common/images/fileicon.xcf b/skins/common/images/fileicon.xcf Binary files differnew file mode 100644 index 00000000..85a0a610 --- /dev/null +++ b/skins/common/images/fileicon.xcf diff --git a/skins/common/images/gnu-fdl.png b/skins/common/images/gnu-fdl.png Binary files differnew file mode 100644 index 00000000..1371aba8 --- /dev/null +++ b/skins/common/images/gnu-fdl.png diff --git a/skins/common/images/gnu-fdl.xcf b/skins/common/images/gnu-fdl.xcf Binary files differnew file mode 100644 index 00000000..364440dd --- /dev/null +++ b/skins/common/images/gnu-fdl.xcf diff --git a/skins/common/images/icons/COPYING b/skins/common/images/icons/COPYING new file mode 100644 index 00000000..136530a9 --- /dev/null +++ b/skins/common/images/icons/COPYING @@ -0,0 +1,43 @@ +The icons used here are derived from the crystalsvg icons in the the +pics/crystalsvg/ directory of kdelibs-3.4.0 they were modified on 2005-05-15 +by Ævar Arnfjörð Bjarmason for use in MediaWiki. + +What follows is the contents of the LICENSE.crystalsvg file found in the pics/ +subdirectory of kdelibs-3.4.0: + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +This copyright and license notice covers all CrystalSVG images. +Note the license notice contains an add-on. +******************************************************************************** +KDE Crystal theme icons. +Copyright (C) 2002 and following years KDE Artists +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation, +version 2.1 of the License. +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + **** NOTE THIS ADD-ON **** +The GNU Lesser General Public License or LGPL is written for software libraries +in the first place. We expressly want the LGPL to be valid for this artwork +library too. +KDE Crystal theme icons is a special kind of software library, it is an +artwork library, it's elements can be used in a Graphical User Interface, or +GUI. +Source code, for this library means: + - for vectors svg; + - for pixels, if applicable, the multi-layered formats xcf or psd, or +otherwise png. +The LGPL in some sections obliges you to make the files carry +notices. With images this is in some cases impossible or hardly useful. +With this library a notice is placed at a prominent place in the directory +containing the elements. You may follow this practice. +The exception in section 6 of the GNU Lesser General Public License covers +the use of elements of this art library in a GUI. +kde-artists [at] kde.org +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/skins/common/images/icons/fileicon-c.png b/skins/common/images/icons/fileicon-c.png Binary files differnew file mode 100644 index 00000000..6da6916e --- /dev/null +++ b/skins/common/images/icons/fileicon-c.png diff --git a/skins/common/images/icons/fileicon-cpp.png b/skins/common/images/icons/fileicon-cpp.png Binary files differnew file mode 100644 index 00000000..ba54e77f --- /dev/null +++ b/skins/common/images/icons/fileicon-cpp.png diff --git a/skins/common/images/icons/fileicon-deb.png b/skins/common/images/icons/fileicon-deb.png Binary files differnew file mode 100644 index 00000000..ac1e2cf9 --- /dev/null +++ b/skins/common/images/icons/fileicon-deb.png diff --git a/skins/common/images/icons/fileicon-djvu.png b/skins/common/images/icons/fileicon-djvu.png Binary files differnew file mode 100644 index 00000000..2e1e2c9b --- /dev/null +++ b/skins/common/images/icons/fileicon-djvu.png diff --git a/skins/common/images/icons/fileicon-djvu.xcf b/skins/common/images/icons/fileicon-djvu.xcf Binary files differnew file mode 100644 index 00000000..8043dcdb --- /dev/null +++ b/skins/common/images/icons/fileicon-djvu.xcf diff --git a/skins/common/images/icons/fileicon-dvi.png b/skins/common/images/icons/fileicon-dvi.png Binary files differnew file mode 100644 index 00000000..6c7aa1a1 --- /dev/null +++ b/skins/common/images/icons/fileicon-dvi.png diff --git a/skins/common/images/icons/fileicon-exe.png b/skins/common/images/icons/fileicon-exe.png Binary files differnew file mode 100644 index 00000000..6ccf1821 --- /dev/null +++ b/skins/common/images/icons/fileicon-exe.png diff --git a/skins/common/images/icons/fileicon-h.png b/skins/common/images/icons/fileicon-h.png Binary files differnew file mode 100644 index 00000000..d091afff --- /dev/null +++ b/skins/common/images/icons/fileicon-h.png diff --git a/skins/common/images/icons/fileicon-html.png b/skins/common/images/icons/fileicon-html.png Binary files differnew file mode 100644 index 00000000..7c479525 --- /dev/null +++ b/skins/common/images/icons/fileicon-html.png diff --git a/skins/common/images/icons/fileicon-iso.png b/skins/common/images/icons/fileicon-iso.png Binary files differnew file mode 100644 index 00000000..b4192e9e --- /dev/null +++ b/skins/common/images/icons/fileicon-iso.png diff --git a/skins/common/images/icons/fileicon-java.png b/skins/common/images/icons/fileicon-java.png Binary files differnew file mode 100644 index 00000000..757c6aec --- /dev/null +++ b/skins/common/images/icons/fileicon-java.png diff --git a/skins/common/images/icons/fileicon-mid.png b/skins/common/images/icons/fileicon-mid.png Binary files differnew file mode 100644 index 00000000..aa826070 --- /dev/null +++ b/skins/common/images/icons/fileicon-mid.png diff --git a/skins/common/images/icons/fileicon-mov.png b/skins/common/images/icons/fileicon-mov.png Binary files differnew file mode 100644 index 00000000..2c0da0d8 --- /dev/null +++ b/skins/common/images/icons/fileicon-mov.png diff --git a/skins/common/images/icons/fileicon-o.png b/skins/common/images/icons/fileicon-o.png Binary files differnew file mode 100644 index 00000000..bf051cb8 --- /dev/null +++ b/skins/common/images/icons/fileicon-o.png diff --git a/skins/common/images/icons/fileicon-ogg.png b/skins/common/images/icons/fileicon-ogg.png Binary files differnew file mode 100644 index 00000000..b8ba7714 --- /dev/null +++ b/skins/common/images/icons/fileicon-ogg.png diff --git a/skins/common/images/icons/fileicon-ogg.xcf b/skins/common/images/icons/fileicon-ogg.xcf Binary files differnew file mode 100644 index 00000000..a91024bf --- /dev/null +++ b/skins/common/images/icons/fileicon-ogg.xcf diff --git a/skins/common/images/icons/fileicon-pdf.png b/skins/common/images/icons/fileicon-pdf.png Binary files differnew file mode 100644 index 00000000..ee39b6c3 --- /dev/null +++ b/skins/common/images/icons/fileicon-pdf.png diff --git a/skins/common/images/icons/fileicon-ps.png b/skins/common/images/icons/fileicon-ps.png Binary files differnew file mode 100644 index 00000000..f1f504d7 --- /dev/null +++ b/skins/common/images/icons/fileicon-ps.png diff --git a/skins/common/images/icons/fileicon-rm.png b/skins/common/images/icons/fileicon-rm.png Binary files differnew file mode 100644 index 00000000..5ba04e5a --- /dev/null +++ b/skins/common/images/icons/fileicon-rm.png diff --git a/skins/common/images/icons/fileicon-rpm.png b/skins/common/images/icons/fileicon-rpm.png Binary files differnew file mode 100644 index 00000000..0f1c3b87 --- /dev/null +++ b/skins/common/images/icons/fileicon-rpm.png diff --git a/skins/common/images/icons/fileicon-svg.png b/skins/common/images/icons/fileicon-svg.png Binary files differnew file mode 100644 index 00000000..8dc6d30f --- /dev/null +++ b/skins/common/images/icons/fileicon-svg.png diff --git a/skins/common/images/icons/fileicon-tar.png b/skins/common/images/icons/fileicon-tar.png Binary files differnew file mode 100644 index 00000000..a4b15d7f --- /dev/null +++ b/skins/common/images/icons/fileicon-tar.png diff --git a/skins/common/images/icons/fileicon-tex.png b/skins/common/images/icons/fileicon-tex.png Binary files differnew file mode 100644 index 00000000..ee8c0226 --- /dev/null +++ b/skins/common/images/icons/fileicon-tex.png diff --git a/skins/common/images/icons/fileicon-ttf.png b/skins/common/images/icons/fileicon-ttf.png Binary files differnew file mode 100644 index 00000000..1b53066e --- /dev/null +++ b/skins/common/images/icons/fileicon-ttf.png diff --git a/skins/common/images/icons/fileicon-txt.png b/skins/common/images/icons/fileicon-txt.png Binary files differnew file mode 100644 index 00000000..76e98909 --- /dev/null +++ b/skins/common/images/icons/fileicon-txt.png diff --git a/skins/common/images/icons/fileicon.png b/skins/common/images/icons/fileicon.png Binary files differnew file mode 100644 index 00000000..5675170b --- /dev/null +++ b/skins/common/images/icons/fileicon.png diff --git a/skins/common/images/link_icon.gif b/skins/common/images/link_icon.gif Binary files differnew file mode 100644 index 00000000..815ccb1b --- /dev/null +++ b/skins/common/images/link_icon.gif diff --git a/skins/common/images/magnify-clip.png b/skins/common/images/magnify-clip.png Binary files differnew file mode 100644 index 00000000..50abcb68 --- /dev/null +++ b/skins/common/images/magnify-clip.png diff --git a/skins/common/images/mediawiki-small.xcf b/skins/common/images/mediawiki-small.xcf Binary files differnew file mode 100644 index 00000000..75355171 --- /dev/null +++ b/skins/common/images/mediawiki-small.xcf diff --git a/skins/common/images/mediawiki.png b/skins/common/images/mediawiki.png Binary files differnew file mode 100644 index 00000000..69fce988 --- /dev/null +++ b/skins/common/images/mediawiki.png diff --git a/skins/common/images/poweredby_mediawiki_88x31.png b/skins/common/images/poweredby_mediawiki_88x31.png Binary files differnew file mode 100644 index 00000000..ce1765d1 --- /dev/null +++ b/skins/common/images/poweredby_mediawiki_88x31.png diff --git a/skins/common/images/redirectltr.png b/skins/common/images/redirectltr.png Binary files differnew file mode 100644 index 00000000..9110ca13 --- /dev/null +++ b/skins/common/images/redirectltr.png diff --git a/skins/common/images/redirectrtl.png b/skins/common/images/redirectrtl.png Binary files differnew file mode 100644 index 00000000..60fd59d3 --- /dev/null +++ b/skins/common/images/redirectrtl.png diff --git a/skins/common/images/wiki.png b/skins/common/images/wiki.png Binary files differnew file mode 100644 index 00000000..49913f6a --- /dev/null +++ b/skins/common/images/wiki.png diff --git a/skins/common/metadata.js b/skins/common/metadata.js new file mode 100644 index 00000000..9f7a8e01 --- /dev/null +++ b/skins/common/metadata.js @@ -0,0 +1,49 @@ +// Exif metadata display for MediaWiki file uploads +// +// Add an expand/collapse link and collapse by default if set to +// (with JS disabled, user will see all items) +// +// attachMetadataToggle("mw_metadata", "More...", "Fewer..."); + + +function attachMetadataToggle(tableId, showText, hideText) { + if (document.createTextNode) { + var box = document.getElementById(tableId); + if (!box) + return false; + + var tbody = box.getElementsByTagName('tbody')[0]; + + var row = document.createElement('tr'); + + var col = document.createElement('td'); + col.colSpan = 2; + + var link = document.createElement('a'); + link.href = '#'; + + link.onclick = function() { + if (box.className == 'mw_metadata collapsed') { + changeText(link, hideText); + box.className = 'mw_metadata expanded'; + } else { + changeText(link, showText); + box.className = 'mw_metadata collapsed'; + } + return false; + } + + var text = document.createTextNode(hideText); + + link.appendChild(text); + col.appendChild(link); + row.appendChild(col); + tbody.appendChild(row); + + // And collapse! + link.onclick(); + + return true; + } + return false; +} diff --git a/skins/common/nostalgia.css b/skins/common/nostalgia.css new file mode 100644 index 00000000..cc427bc9 --- /dev/null +++ b/skins/common/nostalgia.css @@ -0,0 +1,18 @@ +@import url("common.css?1"); +body { + /* Background color is set separately on page type */ + color: black; +} +#specialform { display: inline; } +#powersearch { + background: #DDEEFF; border-style: solid; border-width: 1px; padding: 2px; +} +a.interwiki, a.external { color: #3366BB; } +a.printable { text-decoration: underline; } +a.stub { color:#772233; text-decoration:none; } +h1.pagetitle { padding-top: 0; margin-top: 0; padding-bottom: 0; margin-bottom: 0; } +h2, h3, h4, h5, h6 { margin-bottom: 0; } +textarea { overflow: auto; } +p.subtitle { padding-top: 0; margin-top: 0; } + + diff --git a/skins/common/preview.js b/skins/common/preview.js new file mode 100644 index 00000000..b117e85b --- /dev/null +++ b/skins/common/preview.js @@ -0,0 +1,53 @@ +// Live preview + +function openXMLHttpRequest() { + if( window.XMLHttpRequest ) { + return new XMLHttpRequest(); + } else if( window.ActiveXObject && navigator.platform != 'MacPPC' ) { + // IE/Mac has an ActiveXObject but it doesn't work. + return new ActiveXObject("Microsoft.XMLHTTP"); + } else { + return null; + } +} + +/** + * Returns true if could open the request, + * false otherwise (eg no browser support). + */ +function livePreview(target, text, postUrl) { + prevTarget = target; + if( !target ) { + window.alert('Live preview failed!\nTry normal preview.'); + var fallback = document.getElementById('wpPreview'); + if ( fallback ) { fallback.style.display = 'inline'; } + } + prevReq = openXMLHttpRequest(); + if( !prevReq ) return false; + + prevReq.onreadystatechange = updatePreviewText; + prevReq.open("POST", postUrl, true); + + var postData = 'wpTextbox1=' + encodeURIComponent(text); + prevReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); + prevReq.send(postData); + return true; +} + +function updatePreviewText() { + if( prevReq.readyState != 4 ) { + return; + } + if( prevReq.status != 200 ) { + window.alert('Failed to connect: ' + prevReq.status + + ' "' + prevReq.statusText + '"'); + var fallback = document.getElementById('wpPreview'); + if ( fallback ) { fallback.style.display = 'inline'; } + return; + } + prevTarget.innerHTML = prevReq.responseText; + + /* Hide the active diff if it exists */ + var diff = document.getElementById('wikiDiff'); + if ( diff ) { diff.style.display = 'none'; } +} diff --git a/skins/common/protect.js b/skins/common/protect.js new file mode 100644 index 00000000..a144e5eb --- /dev/null +++ b/skins/common/protect.js @@ -0,0 +1,126 @@ +function protectInitialize(tableId, labelText) { + if (document.createTextNode) { + var box = document.getElementById(tableId); + if (!box) + return false; + + var tbody = box.getElementsByTagName('tbody')[0]; + var row = document.createElement('tr'); + tbody.appendChild(row); + + row.appendChild(document.createElement('td')); + var col2 = document.createElement('td'); + row.appendChild(col2); + + var check = document.createElement('input'); + check.id = "mwProtectUnchained"; + check.type = "checkbox"; + check.onclick = protectChainUpdate; + col2.appendChild(check); + + var label = document.createElement('label'); + label.setAttribute("for", "mwProtectUnchained"); + label.appendChild(document.createTextNode(labelText)); + col2.appendChild(label); + + if (protectAllMatch()) { + check.checked = false; + protectEnable(false); + } else { + check.checked = true; + protectEnable(true); + } + + return true; + } + return false; +} + +function protectLevelsUpdate(source) { + if (!protectUnchained()) { + protectUpdateAll(source.selectedIndex); + } +} + +function protectChainUpdate() { + if (protectUnchained()) { + protectEnable(true); + } else { + protectChain(); + protectEnable(false); + } +} + + +function protectAllMatch() { + var values = new Array(); + protectForSelectors(function(set) { + values[values.length] = set.selectedIndex; + }); + for (var i = 1; i < values.length; i++) { + if (values[i] != values[0]) { + return false; + } + } + return true; +} + +function protectUnchained() { + var unchain = document.getElementById("mwProtectUnchained"); + if (!unchain) { + alert("This shouldn't happen"); + return false; + } + return unchain.checked; +} + +function protectChain() { + // Find the highest-protected action and bump them all to this level + var maxIndex = -1; + protectForSelectors(function(set) { + if (set.selectedIndex > maxIndex) { + maxIndex = set.selectedIndex; + } + }); + protectUpdateAll(maxIndex); +} + +function protectUpdateAll(index) { + protectForSelectors(function(set) { + if (set.selectedIndex != index) { + set.selectedIndex = index; + } + }); +} + +function protectForSelectors(func) { + var selectors = protectSelectors(); + for (var i = 0; i < selectors.length; i++) { + func(selectors[i]); + } +} + +function protectSelectors() { + var all = document.getElementsByTagName("select"); + var ours = new Array(); + for (var i = 0; i < all.length; i++) { + var set = all[i]; + if (set.id.match(/^mwProtect-level-/)) { + ours[ours.length] = set; + } + } + return ours; +} + +function protectEnable(val) { + // fixme + var first = true; + protectForSelectors(function(set) { + if (first) { + first = false; + } else { + set.disabled = !val; + set.style.visible = val ? "visible" : "hidden"; + } + }); +} diff --git a/skins/common/quickbar-right.css b/skins/common/quickbar-right.css new file mode 100644 index 00000000..43bd427a --- /dev/null +++ b/skins/common/quickbar-right.css @@ -0,0 +1 @@ +#quickbar { position: fixed; right: 0px; top: 0px; padding: 4px;} diff --git a/skins/common/quickbar.css b/skins/common/quickbar.css new file mode 100644 index 00000000..d7930c2a --- /dev/null +++ b/skins/common/quickbar.css @@ -0,0 +1 @@ +#quickbar { position: fixed; padding: 4px; } diff --git a/skins/common/sticky.js b/skins/common/sticky.js new file mode 100644 index 00000000..cf248c3e --- /dev/null +++ b/skins/common/sticky.js @@ -0,0 +1,124 @@ +// Make a layer that stays in the same place on screen when scrolling the browser window. +// Version 1.2 +// See http://www.mark.ac/help for browser support. + +var mySticky; +var theLayer; + +// Setup variables for sliding. +// lastY and staticYOffset should match your CSS top definition. + +lastY=10;YOffset=0;staticYOffset=10;refreshMS=25; + + +// Setup function that runs when the page loads. + function setup(eID){ + bw=new checkBrowser; + if(bw.ns4||bw.opera){MM_reloadPage(true);} + var noFix=bw.ie4||bw.ns4||(bw.macie50)?true:false; + if (window.attachEvent){fix_bind()} + else if(noFix){ + if(bw.ns6){document.getElementById(eID).style.position="absolute";} + if(bw.macie50){document.getElementById(eID).style.position="absolute";document.getElementById(eID).style.backgroundColor="#ccffcc";} + if(bw.ns6&&YOffset==0){YOffset=-15} + mySticky=new makeLayerObj(eID); + layerSlide(eID)} + else{ + mySticky=new makeLayerObj(eID); + mySticky.css.position="fixed";} + + if(!mySticky){mySticky=new makeLayerObj(eID);} + //mySticky.css.visibility="visible"; + } + + +// ------------------------- +// emulate css 'position: fixed' in IE5+ Win +// code by aclover@1value.com + fix_elements = new Array(); + + function fix_event(){ + var i; + for (i=0; i < fix_elements.length; i++){ + fix_elements[i].style.left = parseInt(fix_elements[i].fix_left)+document.getElementsByTagName('html')[0].scrollLeft+document.getElementsByTagName('body')[0].scrollLeft+'px'; + fix_elements[i].style.top = parseInt(fix_elements[i].fix_top)+document.getElementsByTagName('html')[0].scrollTop+document.getElementsByTagName('body')[0].scrollTop+'px'; + } + } + + function fix_bind(){ + var i; + for (i=0; i < document.all.length; i++){ + if (document.all[i].currentStyle.position=='fixed'){ + document.all[i].fix_left = document.all[i].currentStyle.left; + document.all[i].fix_top = document.all[i].currentStyle.top; + document.all[i].style.position = 'absolute'; + fix_elements[fix_elements.length] = document.all[i]; + window.attachEvent('onscroll', fix_event); + window.attachEvent('onresize', fix_event); + } + } + } +// ------------------------- + + +// ------------------------- +// DHTML menu sliding. Requires checkBrowser() +// Based on source at http://www.simplythebest.net/ + function layerSlide(layerID) { + if(bw.dhtml){ + if(!mySticky){mySticky=new makeLayerObj(layerID);} + if (bw.ns) {winY = window.pageYOffset;} + else if (bw.ie) {winY = document.body.scrollTop;} + if (bw.ie||bw.ns) { + if (winY!=lastY&&winY>YOffset-staticYOffset){smooth = .3 * (winY - lastY - YOffset + staticYOffset);} + else if (YOffset-staticYOffset+lastY>YOffset-staticYOffset){smooth = .3 * (winY - lastY - (YOffset-(YOffset-winY)));} + else{smooth=0} + if(smooth > 0) {smooth = Math.ceil(smooth);} + else{smooth = Math.floor(smooth);} + if (bw.ie){mySticky.css.pixelTop+=smooth;} + else if (bw.ns){mySticky.css.top=parseInt(mySticky.css.top)+smooth;} + lastY = lastY+smooth; + top.window.status=new Date() + setTimeout('layerSlide("'+layerID+'")', refreshMS)}}} +// ------------------------- + +// Netscape 4.x browser resize fix + function MM_reloadPage(init) { + if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { + document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; top.onresize=MM_reloadPage; }} + else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) {location.reload();}} + +// Create browser-independent layer and browser objects + function makeLayerObj(eID){ + if(document.getElementById){this.css=document.getElementById(eID).style} + else if(document.layers){this.css=document.layers[eID];} + else if(document.all){this.css=document.all[eID].style;} + return this + } + + function checkBrowser(){ + this.ver=navigator.appVersion; + this.name=navigator.appName; + this.mac=(navigator.platform.toLowerCase().indexOf('mac')>-1)?true:false; + this.opera=(navigator.userAgent.toLowerCase().indexOf('opera')>-1)?true:false; + this.dom=document.getElementById?true:false; + this.ns=(this.name=='Netscape'); + this.ie4=(document.all && !this.dom)?true:false; + this.ie=(this.name =='Microsoft Internet Explorer'&&!this.opera)?true:false; + this.ie5=(this.ie && (navigator.userAgent.indexOf("MSIE 5")!=-1))?true:false; + this.macie50=(this.mac&&this.ie5&&(navigator.userAgent.indexOf("MSIE 5.0")!=-1))?true:false + this.ns4=(this.ns && parseInt(this.ver) == 4)?true:false; + this.ns6=((this.name=="Netscape")&&(parseInt(this.ver)==5))?true:false + this.standards=document.getElementById?true:false; + this.dhtml=this.standards||this.ie4||this.ns4; + } + + function showMe(eID){ + myFloater=new makeLayerObj(eID) + myFloater.css.visibility="visible"; + } + + function hideMe(eID){ + myFloater=new makeLayerObj(eID) + myFloater.css.visibility="hidden"; + }
\ No newline at end of file diff --git a/skins/common/upload.js b/skins/common/upload.js new file mode 100644 index 00000000..160fbf27 --- /dev/null +++ b/skins/common/upload.js @@ -0,0 +1,23 @@ +function licenseSelectorCheck() { + var selector = document.getElementById("wpLicense"); + if (selector.selectedIndex > 0 && + selector.options[selector.selectedIndex].value == "" ) { + // Browser is broken, doesn't respect disabled attribute on <option> + selector.selectedIndex = 0; + } +} + +function licenseSelectorFixup() { + // for MSIE/Mac; non-breaking spaces cause the <option> not to render + // but, for some reason, setting the text to itself works + var selector = document.getElementById("wpLicense"); + var ua = navigator.userAgent; + var isMacIe = (ua.indexOf("MSIE") != -1) && (ua.indexOf("Mac") != -1); + if (isMacIe) { + for (var i = 0; i < selector.options.length; i++) { + selector.options[i].text = selector.options[i].text; + } + } +} + +addOnloadHook(licenseSelectorFixup); diff --git a/skins/common/wikibits.js b/skins/common/wikibits.js new file mode 100644 index 00000000..d95c4dcc --- /dev/null +++ b/skins/common/wikibits.js @@ -0,0 +1,748 @@ +// MediaWiki JavaScript support functions + +var clientPC = navigator.userAgent.toLowerCase(); // Get client info +var is_gecko = ((clientPC.indexOf('gecko')!=-1) && (clientPC.indexOf('spoofer')==-1) + && (clientPC.indexOf('khtml') == -1) && (clientPC.indexOf('netscape/7.0')==-1)); +var is_safari = ((clientPC.indexOf('applewebkit')!=-1) && (clientPC.indexOf('spoofer')==-1)); +var is_khtml = (navigator.vendor == 'KDE' || ( document.childNodes && !document.all && !navigator.taintEnabled )); +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); +} + +// add any onload functions in this hook (please don't hard-code any events in the xhtml source) + +var doneOnloadHook; + +if (!window.onloadFuncts) + var onloadFuncts = []; + +function addOnloadHook(hookFunct) { + // Allows add-on scripts to add onload functions + onloadFuncts[onloadFuncts.length] = hookFunct; +} + +function runOnloadHook() { + // don't run anything below this for non-dom browsers + if (doneOnloadHook || !(document.getElementById && document.getElementsByTagName)) + return; + + histrowinit(); + unhidetzbutton(); + tabbedprefs(); + akeytt(); + scrollEditBox(); + setupCheckboxShiftClick(); + + // Run any added-on functions + for (var i = 0; i < onloadFuncts.length; i++) + onloadFuncts[i](); + + doneOnloadHook = true; +} + +function hookEvent(hookName, hookFunct) { + if (window.addEventListener) + addEventListener(hookName, hookFunct, false); + else if (window.attachEvent) + attachEvent("on" + hookName, hookFunct); +} + +hookEvent("load", runOnloadHook); + +// document.write special stylesheet links +if (typeof stylepath != 'undefined' && typeof skin != 'undefined') { + if (is_opera_preseven) { + document.write('<link rel="stylesheet" type="text/css" href="'+stylepath+'/'+skin+'/Opera6Fixes.css">'); + } else if (is_opera_seven) { + document.write('<link rel="stylesheet" type="text/css" href="'+stylepath+'/'+skin+'/Opera7Fixes.css">'); + } else if (is_khtml) { + document.write('<link rel="stylesheet" type="text/css" href="'+stylepath+'/'+skin+'/KHTMLFixes.css">'); + } +} +// Un-trap us from framesets +if (window.top != window) + window.top.location = window.location; + +// for enhanced RecentChanges +function toggleVisibility(_levelId, _otherId, _linkId) { + var thisLevel = document.getElementById(_levelId); + var otherLevel = document.getElementById(_otherId); + var linkLevel = document.getElementById(_linkId); + if (thisLevel.style.display == 'none') { + thisLevel.style.display = 'block'; + otherLevel.style.display = 'none'; + linkLevel.style.display = 'inline'; + } else { + thisLevel.style.display = 'none'; + otherLevel.style.display = 'inline'; + linkLevel.style.display = 'none'; + } +} + +// page history stuff +// 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(); +} + +function historyRadios(parent) { + var inputs = parent.getElementsByTagName('input'); + var radios = []; + for (var i = 0; i < inputs.length; i++) { + if (inputs[i].name == "diff" || inputs[i].name == "oldid") + radios[radios.length] = inputs[i]; + } + return radios; +} + +// check selection and tweak visibility/class onclick +function diffcheck() { + var dli = false; // the li where the diff radio is checked + var oli = false; // the li where the oldid radio is checked + var hf = document.getElementById('pagehistory'); + if (!hf) + return true; + var lis = hf.getElementsByTagName('li'); + for (i=0;i<lis.length;i++) { + var inputs = historyRadios(lis[i]); + if (inputs[1] && inputs[0]) { + if (inputs[1].checked || inputs[0].checked) { // this row has a checked radio button + if (inputs[1].checked && inputs[0].checked && inputs[0].value == inputs[1].value) + return false; + if (oli) { // it's the second checked radio + if (inputs[1].checked) { + oli.className = "selected"; + return false; + } + } else if (inputs[0].checked) { + return false; + } + if (inputs[0].checked) + dli = lis[i]; + if (!oli) + inputs[0].style.visibility = 'hidden'; + if (dli) + inputs[1].style.visibility = 'hidden'; + lis[i].className = "selected"; + oli = lis[i]; + } else { // no radio is checked in this row + if (!oli) + inputs[0].style.visibility = 'hidden'; + else + inputs[0].style.visibility = 'visible'; + if (dli) + inputs[1].style.visibility = 'hidden'; + else + inputs[1].style.visibility = 'visible'; + lis[i].className = ""; + } + } + } + return true; +} + +// 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 = new Array(); + 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 || is_khtml) + children[i].className = 'prefsection operaprefsection'; + var legends = children[i].getElementsByTagName('legend'); + sections[seci] = new Object(); + 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) { + var localclock = new Date(); + // returns negative offset from GMT in minutes + var tzRaw = localclock.getTimezoneOffset(); + var tzHour = Math.floor( Math.abs(tzRaw) / 60); + var tzMin = Math.abs(tzRaw) % 60; + var tzString = ((tzRaw >= 0) ? "-" : "+") + ((tzHour < 10) ? "0" : "") + tzHour + ((tzMin < 10) ? "0" : "") + tzMin; + if (tz != tzString) { + var junk = msg.split('$1'); + document.write(junk[0] + "UTC" + tzString + junk[1]); + } +} + +function unhidetzbutton() { + var tzb = document.getElementById('guesstimezonebutton'); + if (tzb) + tzb.style.display = 'inline'; +} + +// in [-]HH:MM format... +// won't yet work with non-even tzs +function fetchTimezone() { + // FIXME: work around Safari bug + var localclock = new Date(); + // returns negative offset from GMT in minutes + var tzRaw = localclock.getTimezoneOffset(); + var tzHour = Math.floor( Math.abs(tzRaw) / 60); + var tzMin = Math.abs(tzRaw) % 60; + var tzString = ((tzRaw >= 0) ? "-" : "") + ((tzHour < 10) ? "0" : "") + tzHour + + ":" + ((tzMin < 10) ? "0" : "") + tzMin; + return tzString; +} + +function guessTimezone(box) { + document.getElementsByName("wpHourDiff")[0].value = fetchTimezone(); +} + +function showTocToggle() { + if (document.createTextNode) { + // Uses DOM calls to avoid document.write + XHTML issues + + var linkHolder = document.getElementById('toctitle') + if (!linkHolder) + return; + + var outerSpan = document.createElement('span'); + outerSpan.className = 'toctoggle'; + + var toggleLink = document.createElement('a'); + toggleLink.id = 'togglelink'; + toggleLink.className = 'internal'; + toggleLink.href = 'javascript:toggleToc()'; + toggleLink.appendChild(document.createTextNode(tocHideText)); + + outerSpan.appendChild(document.createTextNode('[')); + outerSpan.appendChild(toggleLink); + outerSpan.appendChild(document.createTextNode(']')); + + linkHolder.appendChild(document.createTextNode(' ')); + linkHolder.appendChild(outerSpan); + + var cookiePos = document.cookie.indexOf("hidetoc="); + if (cookiePos > -1 && document.cookie.charAt(cookiePos + 8) == 1) + toggleToc(); + } +} + +function changeText(el, newText) { + // Safari work around + if (el.innerText) + el.innerText = newText; + else if (el.firstChild && el.firstChild.nodeValue) + el.firstChild.nodeValue = newText; +} + +function toggleToc() { + var toc = document.getElementById('toc').getElementsByTagName('ul')[0]; + var toggleLink = document.getElementById('togglelink') + + if (toc && toggleLink && toc.style.display == 'none') { + changeText(toggleLink, tocHideText); + toc.style.display = 'block'; + document.cookie = "hidetoc=0"; + } else { + changeText(toggleLink, tocShowText); + toc.style.display = 'none'; + document.cookie = "hidetoc=1"; + } +} + +var mwEditButtons = []; +var mwCustomEditButtons = []; // eg to add in MediaWiki:Common.js + +// 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) { + // Don't generate buttons for browsers which don't fully + // support it. + mwEditButtons[mwEditButtons.length] = + {"imageFile": imageFile, + "speedTip": speedTip, + "tagOpen": tagOpen, + "tagClose": tagClose, + "sampleText": sampleText}; +} + +// this function generates the actual toolbar buttons with localized text +// we use it to avoid creating the toolbar where javascript is not enabled +function mwInsertEditButton(parent, item) { + var image = document.createElement("img"); + image.width = 23; + image.height = 22; + image.src = item.imageFile; + image.border = 0; + image.alt = item.speedTip; + image.title = item.speedTip; + image.style.cursor = "pointer"; + image.onclick = function() { + insertTags(item.tagOpen, item.tagClose, item.sampleText); + return false; + } + + parent.appendChild(image); + return true; +} + +function mwSetupToolbar() { + var toolbar = document.getElementById('toolbar'); + if (!toolbar) return false; + + var textbox = document.getElementById('wpTextbox1'); + if (!textbox) return false; + + // Don't generate buttons for browsers which don't fully + // support it. + if (!document.selection && textbox.selectionStart == null) + return false; + + for (var i in mwEditButtons) { + mwInsertEditButton(toolbar, mwEditButtons[i]); + } + for (var i in mwCustomEditButtons) { + mwInsertEditButton(toolbar, mwCustomEditButtons[i]); + } + return true; +} + +function escapeQuotes(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) { + var re = new RegExp('&',"g"); + text = text.replace(re,"&"); + var re = new RegExp('"',"g"); + text = text.replace(re,"""); + var re = new RegExp('<',"g"); + text = text.replace(re,"<"); + var re = new RegExp('>',"g"); + text = text.replace(re,">"); + return text; +} + +// apply tagOpen/tagClose to selection in textarea, +// use sampleText instead of selection if there is none +// copied and adapted from phpBB +function insertTags(tagOpen, tagClose, sampleText) { + if (document.editform) + var txtarea = document.editform.wpTextbox1; + else { + // some alternate form? take the first one we can find + var areas = document.getElementsByTagName('textarea'); + var txtarea = areas[0]; + } + + // IE + if (document.selection && !is_gecko) { + var theSelection = document.selection.createRange().text; + if (!theSelection) + theSelection=sampleText; + txtarea.focus(); + if (theSelection.charAt(theSelection.length - 1) == " ") { // exclude ending space char, if any + theSelection = theSelection.substring(0, theSelection.length - 1); + document.selection.createRange().text = tagOpen + theSelection + tagClose + " "; + } else { + document.selection.createRange().text = tagOpen + theSelection + tagClose; + } + + // Mozilla + } else if(txtarea.selectionStart || txtarea.selectionStart == '0') { + var replaced = false; + var startPos = txtarea.selectionStart; + var endPos = txtarea.selectionEnd; + if (endPos-startPos) + replaced = true; + var scrollTop = txtarea.scrollTop; + var myText = (txtarea.value).substring(startPos, endPos); + if (!myText) + myText=sampleText; + if (myText.charAt(myText.length - 1) == " ") { // exclude ending space char, if any + subst = tagOpen + myText.substring(0, (myText.length - 1)) + tagClose + " "; + } else { + subst = tagOpen + myText + tagClose; + } + txtarea.value = txtarea.value.substring(0, startPos) + subst + + txtarea.value.substring(endPos, txtarea.value.length); + txtarea.focus(); + //set new selection + if (replaced) { + var cPos = startPos+(tagOpen.length+myText.length+tagClose.length); + txtarea.selectionStart = cPos; + txtarea.selectionEnd = cPos; + } else { + txtarea.selectionStart = startPos+tagOpen.length; + txtarea.selectionEnd = startPos+tagOpen.length+myText.length; + } + txtarea.scrollTop = scrollTop; + + // All other browsers get no toolbar. + // There was previously support for a crippled "help" + // bar, but that caused more problems than it solved. + } + // reposition cursor if possible + if (txtarea.createTextRange) + txtarea.caretPos = document.selection.createRange().duplicate(); +} + +function akeytt() { + if (typeof ta == "undefined" || !ta) + return; + var pref = 'alt-'; + if (is_safari || navigator.userAgent.toLowerCase().indexOf('mac') + 1 + || navigator.userAgent.toLowerCase().indexOf('konqueror') + 1 ) + pref = 'control-'; + if (is_opera) + pref = 'shift-esc-'; + + for (var id in ta) { + var n = document.getElementById(id); + if (n) { + var a = null; + var ak = ''; + // Are we putting accesskey in it + if (ta[id][0].length > 0) { + // Is this object a object? If not assume it's the next child. + + if (n.nodeName.toLowerCase() == "a") { + a = n; + } else { + a = n.childNodes[0]; + } + + if (a) { + a.accessKey = ta[id][0]; + ak = ' ['+pref+ta[id][0]+']'; + } + } else { + // We don't care what type the object is when assigning tooltip + a = n; + ak = ''; + } + + if (a) { + a.title = ta[id][1]+ak; + } + } + } +} + +function setupRightClickEdit() { + if (document.getElementsByTagName) { + var divs = document.getElementsByTagName('div'); + for (var i = 0; i < divs.length; i++) { + var el = divs[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 following a + var next = el.nextSibling; + while (next.nodeType != 1) + next = next.nextSibling; + + // find the following header + next = next.nextSibling; + while (next.nodeType != 1) + next = next.nextSibling; + + if (next && next.nodeType == 1 && + next.nodeName.match(/^[Hh][1-6]$/)) { + next.oncontextmenu = function() { + document.location = editHref; + return false; + } + } + } + } +} + +function setupCheckboxShiftClick() { + if (document.getElementsByTagName) { + var uls = document.getElementsByTagName('ul'); + var len = uls.length; + for (var i = 0; i < len; ++i) { + addCheckboxClickHandlers(uls[i]); + } + } +} + +function addCheckboxClickHandlers(ul, start, finish) { + if (ul.checkboxHandlersTimer) { + clearInterval(ul.checkboxHandlersTimer); + } + if ( !ul.childNodes ) { + return; + } + var len = ul.childNodes.length; + if (len < 2) { + return; + } + start = start || 0; + finish = finish || start + 250; + if ( finish > len ) { finish = len; } + ul.checkboxes = ul.checkboxes || []; + ul.lastCheckbox = ul.lastCheckbox || null; + for (var i = start; i<finish; ++i) { + var child = ul.childNodes[i]; + if ( child && child.childNodes && child.childNodes[0] ) { + var cb = child.childNodes[0]; + if ( !cb.nodeName || cb.nodeName.toLowerCase() != 'input' || + !cb.type || cb.type.toLowerCase() != 'checkbox' ) { + return; + } + cb.index = ul.checkboxes.push(cb) - 1; + cb.container = ul; + cb.onmouseup = checkboxMouseupHandler; + } + } + if (finish < len) { + var f=function(){ addCheckboxClickHandlers(ul, finish, finish+250); }; + ul.checkboxHandlersTimer=setInterval(f, 200); + } +} + +function checkboxMouseupHandler(e) { + if (typeof e == 'undefined') { + e = window.event; + } + if ( !e.shiftKey || this.container.lastCheckbox === null ) { + this.container.lastCheckbox = this.index; + return true; + } + var endState = !this.checked; + if ( is_opera ) { // opera has already toggled the checkbox by this point + endState = !endState; + } + var start, finish; + if ( this.index < this.container.lastCheckbox ) { + start = this.index + 1; + finish = this.container.lastCheckbox; + } else { + start = this.container.lastCheckbox; + finish = this.index - 1; + } + for (var i = start; i <= finish; ++i ) { + this.container.checkboxes[i].checked = endState; + } + this.container.lastCheckbox = this.index; + return true; +} + +function fillDestFilename() { + if (!document.getElementById) + return; + var path = document.getElementById('wpUploadFile').value; + // Find trailing part + var slash = path.lastIndexOf('/'); + var backslash = path.lastIndexOf('\\'); + var fname; + if (slash == -1 && backslash == -1) { + fname = path; + } else if (slash > backslash) { + fname = path.substring(slash+1, 10000); + } else { + fname = path.substring(backslash+1, 10000); + } + + // Capitalise first letter and replace spaces by underscores + fname = fname.charAt(0).toUpperCase().concat(fname.substring(1,10000)).replace(/ /g, '_'); + + // Output result + var destFile = document.getElementById('wpDestFile'); + if (destFile) + destFile.value = fname; +} + + +function considerChangingExpiryFocus() { + if (!document.getElementById) + return; + var drop = document.getElementById('wpBlockExpiry'); + if (!drop) + return; + var field = document.getElementById('wpBlockOther'); + if (!field) + return; + var opt = drop.value; + if (opt == 'other') + field.style.display = ''; + else + field.style.display = 'none'; +} + +function scrollEditBox() { + var editBoxEl = document.getElementById("wpTextbox1"); + var scrollTopEl = document.getElementById("wpScrolltop"); + var editFormEl = document.getElementById("editform"); + + if (editBoxEl && scrollTopEl) { + if (scrollTopEl.value) editBoxEl.scrollTop = scrollTopEl.value; + editFormEl.onsubmit = function() { + document.getElementById("wpScrolltop").value = document.getElementById("wpTextbox1").scrollTop; + } + } +} + +hookEvent("load", scrollEditBox); + +function allmessagesfilter() { + text = document.getElementById('allmessagesinput').value; + k = document.getElementById('allmessagestable'); + if (!k) { return;} + + var items = k.getElementsByTagName('span'); + + if ( text.length > allmessages_prev.length ) { + for (var i = items.length-1, j = 0; i >= 0; i--) { + j = allmessagesforeach(items, i, j); + } + } else { + for (var i = 0, j = 0; i < items.length; i++) { + j = allmessagesforeach(items, i, j); + } + } + allmessages_prev = text; +} + +function allmessagesforeach(items, i, j) { + var hItem = items[i].getAttribute('id'); + if (hItem.substring(0,17) == 'sp-allmessages-i-') { + if (items[i].firstChild && items[i].firstChild.nodeName == '#text' && items[i].firstChild.nodeValue.indexOf(text) != -1) { + var itemA = document.getElementById( hItem.replace('i', 'r1') ); + var itemB = document.getElementById( hItem.replace('i', 'r2') ); + if ( itemA.style.display != '' ) { + var s = "allmessageshider(\"" + hItem.replace('i', 'r1') + "\", \"" + hItem.replace('i', 'r2') + "\", '')"; + var k = window.setTimeout(s,j++*5); + } + } else { + var itemA = document.getElementById( hItem.replace('i', 'r1') ); + var itemB = document.getElementById( hItem.replace('i', 'r2') ); + if ( itemA.style.display != 'none' ) { + var s = "allmessageshider(\"" + hItem.replace('i', 'r1') + "\", \"" + hItem.replace('i', 'r2') + "\", 'none')"; + var k = window.setTimeout(s,j++*5); + } + } + } + return j; +} + + +function allmessageshider(idA, idB, cstyle) { + var itemA = document.getElementById( idA ); + var itemB = document.getElementById( idB ); + if (itemA) { itemA.style.display = cstyle; } + if (itemB) { itemB.style.display = cstyle; } +} + +function allmessagesmodified() { + allmessages_modified = !allmessages_modified; + k = document.getElementById('allmessagestable'); + if (!k) { return;} + var items = k.getElementsByTagName('tr'); + for (var i = 0, j = 0; i< items.length; i++) { + if (!allmessages_modified ) { + if ( items[i].style.display != '' ) { + var s = "allmessageshider(\"" + items[i].getAttribute('id') + "\", null, '')"; + var k = window.setTimeout(s,j++*5); + } + } else if (items[i].getAttribute('class') == 'def' && allmessages_modified) { + if ( items[i].style.display != 'none' ) { + var s = "allmessageshider(\"" + items[i].getAttribute('id') + "\", null, 'none')"; + var k = window.setTimeout(s,j++*5); + } + } + } +} + +function allmessagesshow() { + k = document.getElementById('allmessagesfilter'); + if (k) { k.style.display = ''; } + + allmessages_prev = ''; + allmessages_modified = false; +} + +hookEvent("load", allmessagesshow); +hookEvent("load", mwSetupToolbar); diff --git a/skins/common/wikiprintable.css b/skins/common/wikiprintable.css new file mode 100644 index 00000000..58e132d6 --- /dev/null +++ b/skins/common/wikiprintable.css @@ -0,0 +1,46 @@ +/* MediaWiki print stylesheet */ + +body { + color: #000000; background: #ffffff; +} + + +/* MSIE/Win doesn't understand 'inherit' */ +a, a.external, a.new, a.stub { + color: black ! important; + text-decoration: none ! important; +} +#article { + margin: 0 ! important; +} + +/* Continue ... */ +a, a.external, a.new, a.stub { + color: inherit ! important; + text-decoration: inherit ! important; +} + +/* Hide ugly UI stuff */ +#quickbar, #topbar, #footer, #siteNotice, +.editsection, .toctoggle { + display: none; +} + +/* */ +#article { + position: relative; + margin: inherit ! important; +} + +.printfooter { + border-top: solid 1px black; + display: block ! important; +} + +/* Old stuff, fixme: +a.CBlink { color: #0000AA; text-decoration: none; font-size: 12pt; } +a.interwiki, a.external { color: #3333BB; text-decoration: none; } +h1.pagetitle { padding-bottom: 0; margin-bottom: 0; } +i.link, u.link { color: #000066; } +p.subtitle { padding-top: 0; margin-top: 0; } +*/ diff --git a/skins/common/wikistandard.css b/skins/common/wikistandard.css new file mode 100644 index 00000000..3985f1d9 --- /dev/null +++ b/skins/common/wikistandard.css @@ -0,0 +1,44 @@ +@import url("common.css?1"); + +#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; +} +#quickbar { width: 140px; padding: 4px; visibility: visible; z-index:99;font-size:95%;} +#topbar { padding: 4px;font-size:95%; } + + +/* Table of contents */ +.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%; } +h2 { font-size: 120%; } +h2, h3, h4, h5, h6 { margin-bottom: 0;} +h3 { font-size: 106.25%; } +h4 { font-size: 103.125%; } +h5 { font-size: 100%; } +h6 { font-size: 95%; } +hr.sep { color:gray;height:1px;background-color:gray;} +p.subpages { font-size:small;} +p.subtitle { padding-top: 0; margin-top: 0;} +p.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; } |