summaryrefslogtreecommitdiff
path: root/skins/common
diff options
context:
space:
mode:
Diffstat (limited to 'skins/common')
-rw-r--r--skins/common/ajaxsearch.js1
-rw-r--r--skins/common/block.js29
-rw-r--r--skins/common/cologneblue.css4
-rw-r--r--skins/common/commonPrint.css3
-rw-r--r--skins/common/oldshared.css3
-rw-r--r--skins/common/preview.js109
-rw-r--r--skins/common/protect.js68
-rw-r--r--skins/common/shared.css31
-rw-r--r--skins/common/upload.js2
-rw-r--r--skins/common/wikibits.js4
10 files changed, 183 insertions, 71 deletions
diff --git a/skins/common/ajaxsearch.js b/skins/common/ajaxsearch.js
index 1e972236..b9fb56f3 100644
--- a/skins/common/ajaxsearch.js
+++ b/skins/common/ajaxsearch.js
@@ -23,7 +23,6 @@ function Searching_Go()
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?
diff --git a/skins/common/block.js b/skins/common/block.js
index 430c1d54..78ae3bf2 100644
--- a/skins/common/block.js
+++ b/skins/common/block.js
@@ -1,4 +1,3 @@
-
function considerChangingExpiryFocus() {
if (!document.getElementById) {
return;
@@ -31,23 +30,23 @@ function updateBlockOptions() {
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 anonymousCheck = document.getElementById('wpAnonOnly');
- anonymousCheck.disabled = !isIp && !isEmpty;
-
- var autoblockCheck = document.getElementById('wpEnableAutoblock');
- autoblockCheck.disabled = isIp && !isEmpty;
-
- var emailblockCheck = document.getElementById('wpEmailBan');
- emailblockCheck.disabled = isIp && !isEmpty;
- */
-
var anonymousRow = document.getElementById('wpAnonOnlyRow');
- anonymousRow.style.display = (!isIp && !isEmpty) ? 'none' : '';
+ if( anonymousRow ) {
+ anonymousRow.style.display = (!isIp && !isEmpty) ? 'none' : '';
+ }
var autoblockRow = document.getElementById('wpEnableAutoblockRow');
- autoblockRow.style.display = isIp && !isEmpty ? 'none' : '';
+ if( autoblockRow ) {
+ autoblockRow.style.display = isIp && !isEmpty ? 'none' : '';
+ }
var emailblockRow = document.getElementById('wpEnableEmailBan');
- emailblockRow.style.display = isIp && !isEmpty ? 'none' : '';
+ if( emailblockRow ) {
+ emailblockRow.style.display = isIp && !isEmpty ? 'none' : '';
+ }
+
+ var hideuserRow = document.getElementById('wpEnableHideUser');
+ if( hideuserRow ) {
+ hideuserRow.style.display = isIp && !isEmpty ? 'none' : '';
+ }
}
diff --git a/skins/common/cologneblue.css b/skins/common/cologneblue.css
index 547585ef..670996ea 100644
--- a/skins/common/cologneblue.css
+++ b/skins/common/cologneblue.css
@@ -95,13 +95,15 @@ h2, h3, h4, h5, h6 { margin-bottom: 0; }
small { font-size: 75%; }
input.mw-searchInput { width: 106px; }
-/* Recreating-deleted-page warning and log entries */
+/* Recreating-deleted-page/reupload file warning and log entries */
+div#mw-upload-deleted-warn,
div#mw-recreate-deleted-warn {
padding: 3px;
margin-top: 3px;
margin-bottom: 3px;
border: 1px solid #6688AA;
}
+div#mw-upload-deleted-warn ul li,
div#mw-recreate-deleted-warn ul li {
font-size: 90%;
} \ No newline at end of file
diff --git a/skins/common/commonPrint.css b/skins/common/commonPrint.css
index a7d49e36..b0aad3d1 100644
--- a/skins/common/commonPrint.css
+++ b/skins/common/commonPrint.css
@@ -129,8 +129,7 @@ ul {
border-top: 1px solid black;
}
-h1, h2, h3, h4, h5, h6
-{
+h1, h2, h3, h4, h5, h6 {
font-weight: bold;
}
diff --git a/skins/common/oldshared.css b/skins/common/oldshared.css
index 27d93a03..ead422dc 100644
--- a/skins/common/oldshared.css
+++ b/skins/common/oldshared.css
@@ -447,7 +447,8 @@ p.mw-ipb-conveniencelinks {
float: right;
}
-/* Recreating-deleted-page warning and log entries */
+/* Recreating-deleted-page/reupload file warning and log entries */
+div#mw-upload-deleted-warn ul li,
div#mw-recreate-deleted-warn ul li {
font-size: 95%;
}
diff --git a/skins/common/preview.js b/skins/common/preview.js
index ec612963..ad096e2c 100644
--- a/skins/common/preview.js
+++ b/skins/common/preview.js
@@ -1,5 +1,19 @@
-// Live preview
+/**
+ * Live preview script for MediaWiki
+ *
+ * 2007-04-25 – Nikerabbit:
+ * Worked around text cutoff in mozilla-based browsers
+ * Support for categories
+ */
+
+
+lpIdPreview = 'wikiPreview';
+lpIdCategories = 'catlinks';
+lpIdDiff = 'wikiDiff';
+/*
+ * Returns XMLHttpRequest based on browser support or null
+ */
function openXMLHttpRequest() {
if( window.XMLHttpRequest ) {
return new XMLHttpRequest();
@@ -15,55 +29,94 @@ function openXMLHttpRequest() {
* Returns true if could open the request,
* false otherwise (eg no browser support).
*/
-function livePreview(target, text, postUrl) {
- prevTarget = target;
- if( !target ) {
- window.alert(i18n(wgLivepreviewMessageFailed));
- showFallback();
- }
- prevReq = openXMLHttpRequest();
- if( !prevReq ) return false;
+function lpDoPreview(text, postUrl) {
+ lpRequest = openXMLHttpRequest();
+ if( !lpRequest ) return false;
- prevReq.onreadystatechange = updatePreviewText;
- prevReq.open("POST", postUrl, true);
+ lpRequest.onreadystatechange = lpStatusUpdate;
+ lpRequest.open("POST", postUrl, true);
var postData = 'wpTextbox1=' + encodeURIComponent(text);
- prevReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
- prevReq.send(postData);
+ lpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
+ lpRequest.send(postData);
return true;
}
-function updatePreviewText() {
+function lpStatusUpdate() {
- if (prevReq.readyState > 0 && prevReq.readyState < 4) {
+ /* We are at some stage of loading */
+ if (lpRequest.readyState > 0 && lpRequest.readyState < 4) {
notify(i18n(wgLivepreviewMessageLoading));
}
- if(prevReq.readyState != 4) {
+ /* Not loaded yet */
+ if(lpRequest.readyState != 4) {
return;
}
- dismissNotify(i18n(wgLivepreviewMessageReady), 750);
-
- if( prevReq.status != 200 ) {
+ /* We got response, bug it not what we wanted */
+ if( lpRequest.status != 200 ) {
var keys = new Array();
- keys[0] = prevReq.status;
- keys[1] = prevReq.statusText;
+ keys[0] = lpRequest.status;
+ keys[1] = lpRequest.statusText;
window.alert(i18n(wgLivepreviewMessageError, keys));
- showFallback();
+ lpShowNormalPreview();
return;
}
- var xmlObject = prevReq.responseXML.documentElement;
- var previewElement = xmlObject.getElementsByTagName('preview')[0];
- prevTarget.innerHTML = previewElement.firstChild.data;
+ /* All good */
+ dismissNotify(i18n(wgLivepreviewMessageReady), 750);
+
+
+ var XMLObject = lpRequest.responseXML.documentElement;
+
+
+ /* Work around Firefox (Gecko?) limitation where it shows only the first 4096
+ * bytes of data. Ref: http://www.thescripts.com/forum/thread482760.html
+ */
+ XMLObject.normalize();
+
+ var previewElement = XMLObject.getElementsByTagName('preview')[0];
+ var categoryElement = XMLObject.getElementsByTagName('category')[0];
/* Hide the active diff if it exists */
- var diff = document.getElementById('wikiDiff');
+ var diff = document.getElementById(lpIdDiff);
if ( diff ) { diff.style.display = 'none'; }
+
+ /* Inject preview */
+ var previewContainer = document.getElementById( lpIdPreview );
+ if ( previewContainer && previewElement ) {
+ previewContainer.innerHTML = previewElement.firstChild.data;
+ } else {
+ /* Should never happen */
+ window.alert(i18n(wgLivepreviewMessageFailed));
+ lpShowNormalPreview();
+ return;
+ }
+
+
+ /* Inject categories */
+ var categoryContainer = document.getElementById( lpIdCategories );
+ if ( categoryElement && categoryElement.firstChild ) {
+ if ( categoryContainer ) {
+ categoryContainer.innerHTML = categoryElement.firstChild.data;
+ /* May be hidden */
+ categoryContainer.style.display = 'block';
+ } else {
+ /* Just dump them somewhere */
+ /* previewContainer.innerHTML += '<div id="catlinks">' +
+ categoryElement.firstChild.data + '</div>';*/
+ }
+ } else {
+ /* Nothing to show, hide old data */
+ if ( categoryContainer ) {
+ categoryContainer.style.display = 'none';
+ }
+ }
+
}
-function showFallback() {
+function lpShowNormalPreview() {
var fallback = document.getElementById('wpPreview');
if ( fallback ) { fallback.style.display = 'inline'; }
}
@@ -71,7 +124,7 @@ function showFallback() {
// TODO: move elsewhere
/* Small non-intrusive popup which can be used for example to notify the user
- * about completed AJAX action
+ * about completed AJAX action. Supports only one notify at a time.
*/
function notify(message) {
var notifyElement = document.getElementById('mw-js-notify');
diff --git a/skins/common/protect.js b/skins/common/protect.js
index b3eec3bd..863b95bd 100644
--- a/skins/common/protect.js
+++ b/skins/common/protect.js
@@ -5,7 +5,7 @@
* @param String tableId Identifier of the table containing UI bits
* @param String labelText Text to use for the checkbox label
*/
-function protectInitialize( tableId, labelText ) {
+function protectInitialize( tableId, labelText, types ) {
if( !( document.createTextNode && document.getElementById && document.getElementsByTagName ) )
return false;
@@ -20,34 +20,48 @@ function protectInitialize( tableId, labelText ) {
row.appendChild( document.createElement( 'td' ) );
var col = document.createElement( 'td' );
row.appendChild( col );
-
- var check = document.createElement( 'input' );
- check.id = 'mwProtectUnchained';
- check.type = 'checkbox';
- col.appendChild( check );
- addClickHandler( check, protectChainUpdate );
+ // If there is only one protection type, there is nothing to chain
+ if( types > 1 ) {
+ var check = document.createElement( 'input' );
+ check.id = 'mwProtectUnchained';
+ check.type = 'checkbox';
+ col.appendChild( check );
+ addClickHandler( check, protectChainUpdate );
- col.appendChild( document.createTextNode( ' ' ) );
- var label = document.createElement( 'label' );
- label.setAttribute( 'for', 'mwProtectUnchained' );
- label.appendChild( document.createTextNode( labelText ) );
- col.appendChild( label );
+ col.appendChild( document.createTextNode( ' ' ) );
+ var label = document.createElement( 'label' );
+ label.htmlFor = 'mwProtectUnchained';
+ label.appendChild( document.createTextNode( labelText ) );
+ col.appendChild( label );
- check.checked = !protectAllMatch();
- protectEnable( check.checked );
+ check.checked = !protectAllMatch();
+ protectEnable( check.checked );
+ }
- allowCascade();
+ setCascadeCheckbox();
return true;
}
-function allowCascade() {
+/**
+* Determine if, given the cascadeable protection levels
+* and what is currently selected, if the cascade box
+* can be checked
+*
+* @return boolean
+*
+*/
+function setCascadeCheckbox() {
+ // For non-existent titles, there is no cascade option
+ if( !document.getElementById( 'mwProtect-cascade' ) ) {
+ return false;
+ }
var lists = protectSelectors();
for( var i = 0; i < lists.length; i++ ) {
if( lists[i].selectedIndex > -1 ) {
var items = lists[i].getElementsByTagName( 'option' );
var selected = items[ lists[i].selectedIndex ].value;
- if( wgCascadeableLevels.indexOf( selected ) == -1 ) {
+ if( !isCascadeableLevel(selected) ) {
document.getElementById( 'mwProtect-cascade' ).checked = false;
document.getElementById( 'mwProtect-cascade' ).disabled = true;
return false;
@@ -59,6 +73,22 @@ function allowCascade() {
}
/**
+* Is this protection level cascadeable?
+* @param String level
+*
+* @return boolean
+*
+*/
+function isCascadeableLevel( level ) {
+ for (var k = 0; k < wgCascadeableLevels.length; k++) {
+ if ( wgCascadeableLevels[k] == level ) {
+ return true;
+ }
+ }
+ return false;
+}
+
+/**
* When protection levels are locked together, update the rest
* when one action's level changes
*
@@ -67,7 +97,7 @@ function allowCascade() {
function protectLevelsUpdate(source) {
if( !protectUnchained() )
protectUpdateAll( source.selectedIndex );
- allowCascade();
+ setCascadeCheckbox();
}
/**
@@ -81,7 +111,7 @@ function protectChainUpdate() {
protectChain();
protectEnable( false );
}
- allowCascade();
+ setCascadeCheckbox();
}
/**
diff --git a/skins/common/shared.css b/skins/common/shared.css
index f6d63ab8..de02a10f 100644
--- a/skins/common/shared.css
+++ b/skins/common/shared.css
@@ -46,3 +46,34 @@ table.filehistory td.mw-imagepage-filesize,
table.filehistory th.mw-imagepage-filesize {
white-space:nowrap;
}
+
+/*
+ * rev_deleted stuff
+ */
+li span.deleted, span.history-deleted {
+ text-decoration: line-through;
+ color: #888;
+ font-style: italic;
+}
+
+/**
+ * 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 { vertical-align: top; }
+td.mw-submit { white-space: nowrap; }
+
+/**
+ * Image captions
+ */
+body.rtl .thumbcaption { text-align:right; }
+body.rtl .magnify { float:left; }
+
+body.ltr .thumbcaption { text-align:left; }
+body.ltr .magnify { float:right; }
diff --git a/skins/common/upload.js b/skins/common/upload.js
index 7cbfc9aa..f00c4db8 100644
--- a/skins/common/upload.js
+++ b/skins/common/upload.js
@@ -96,7 +96,7 @@ var wgUploadWarningObj = {
// Set a value in the form indicating that the warning is acknowledged and
// doesn't need to be redisplayed post-upload
- if ( warning == '' || warning == '&nbsp' ) {
+ if ( warning == '' || warning == '&nbsp;' ) {
ackElt.value = '';
} else {
ackElt.value = '1';
diff --git a/skins/common/wikibits.js b/skins/common/wikibits.js
index 11ede270..cdb5c9de 100644
--- a/skins/common/wikibits.js
+++ b/skins/common/wikibits.js
@@ -44,8 +44,6 @@ if (typeof stylepath != 'undefined' && typeof skin != 'undefined') {
document.write('<link rel="stylesheet" type="text/css" href="'+stylepath+'/'+skin+'/Opera6Fixes.css">');
} else if (is_opera_seven && !is_opera_95) {
document.write('<link rel="stylesheet" type="text/css" href="'+stylepath+'/'+skin+'/Opera7Fixes.css">');
- } else if (is_opera_95) {
- document.write('<link rel="stylesheet" type="text/css" href="'+stylepath+'/'+skin+'/Opera95Fixes.css">');
} else if (is_khtml) {
document.write('<link rel="stylesheet" type="text/css" href="'+stylepath+'/'+skin+'/KHTMLFixes.css">');
}
@@ -1146,7 +1144,7 @@ function ts_dateToSortKey(date) {
function ts_parseFloat(num) {
if (!num) return 0;
- num = parseFloat(num.replace(/,/, ""));
+ num = parseFloat(num.replace(/,/g, ""));
return (isNaN(num) ? 0 : num);
}