r19743 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r19742‎ | r19743 | r19744 >
Date:21:53, 3 February 2007
Author:hashar
Status:old
Tags:
Comment:
Kill whitespaces in some javascript files.
Modified paths:
  • /trunk/phase3/skins/common/IEFixes.js (modified) (history)
  • /trunk/phase3/skins/common/ajaxsearch.js (modified) (history)
  • /trunk/phase3/skins/common/metadata.js (modified) (history)
  • /trunk/phase3/skins/common/preview.js (modified) (history)
  • /trunk/phase3/skins/common/protect.js (modified) (history)
  • /trunk/phase3/skins/common/sticky.js (modified) (history)
  • /trunk/phase3/skins/common/wikibits.js (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/sticky.js
@@ -36,7 +36,7 @@
3737 // emulate css 'position: fixed' in IE5+ Win
3838 // code by aclover@1value.com
3939 fix_elements = new Array();
40 -
 40+
4141 function fix_event(){
4242 var i;
4343 for (i=0; i < fix_elements.length; i++){
@@ -95,7 +95,7 @@
9696 else if(document.all){this.css=document.all[eID].style;}
9797 return this
9898 }
99 -
 99+
100100 function checkBrowser(){
101101 this.ver=navigator.appVersion;
102102 this.name=navigator.appName;
@@ -112,13 +112,13 @@
113113 this.standards=document.getElementById?true:false;
114114 this.dhtml=this.standards||this.ie4||this.ns4;
115115 }
116 -
 116+
117117 function showMe(eID){
118118 myFloater=new makeLayerObj(eID)
119119 myFloater.css.visibility="visible";
120120 }
121 -
 121+
122122 function hideMe(eID){
123123 myFloater=new makeLayerObj(eID)
124124 myFloater.css.visibility="hidden";
125 - }
\ No newline at end of file
 125+ }
Index: trunk/phase3/skins/common/ajaxsearch.js
@@ -44,7 +44,7 @@
4545 alert("Error: " + request.status + " " + request.statusText + ": " + request.responseText);
4646 return;
4747 }
48 -
 48+
4949 var result = request.responseText;
5050
5151 //body.innerHTML = result;
@@ -90,7 +90,7 @@
9191 {
9292 return;
9393 }
94 -
 94+
9595 sajax_do_call( "wfSajaxSearch", [ x ], Searching_SetResult );
9696 }
9797 }
Index: trunk/phase3/skins/common/metadata.js
@@ -11,17 +11,17 @@
1212 var box = document.getElementById(tableId);
1313 if (!box)
1414 return false;
15 -
 15+
1616 var tbody = box.getElementsByTagName('tbody')[0];
17 -
 17+
1818 var row = document.createElement('tr');
19 -
 19+
2020 var col = document.createElement('td');
2121 col.colSpan = 2;
22 -
 22+
2323 var link = document.createElement('a');
2424 link.href = '#';
25 -
 25+
2626 link.onclick = function() {
2727 if (box.className == 'mw_metadata collapsed') {
2828 changeText(link, hideText);
@@ -32,17 +32,17 @@
3333 }
3434 return false;
3535 }
36 -
 36+
3737 var text = document.createTextNode(hideText);
38 -
 38+
3939 link.appendChild(text);
4040 col.appendChild(link);
4141 row.appendChild(col);
4242 tbody.appendChild(row);
43 -
 43+
4444 // And collapse!
4545 link.onclick();
46 -
 46+
4747 return true;
4848 }
4949 return false;
Index: trunk/phase3/skins/common/protect.js
@@ -3,29 +3,29 @@
44 var box = document.getElementById(tableId);
55 if (!box)
66 return false;
7 -
 7+
88 var tbody = box.getElementsByTagName('tbody')[0];
99 var row = document.createElement('tr');
1010 tbody.appendChild(row);
11 -
 11+
1212 row.appendChild(document.createElement('td'));
1313 var col2 = document.createElement('td');
1414 row.appendChild(col2);
15 -
 15+
1616 var check = document.createElement('input');
1717 check.id = "mwProtectUnchained";
1818 check.type = "checkbox";
1919 check.onclick = protectChainUpdate;
2020 col2.appendChild(check);
21 -
 21+
2222 var space = document.createTextNode(" ");
2323 col2.appendChild(space);
24 -
 24+
2525 var label = document.createElement('label');
2626 label.setAttribute("for", "mwProtectUnchained");
2727 label.appendChild(document.createTextNode(labelText));
2828 col2.appendChild(label);
29 -
 29+
3030 if (protectAllMatch()) {
3131 check.checked = false;
3232 protectEnable(false);
@@ -33,7 +33,7 @@
3434 check.checked = true;
3535 protectEnable(true);
3636 }
37 -
 37+
3838 return true;
3939 }
4040 return false;
Index: trunk/phase3/skins/common/preview.js
@@ -24,10 +24,10 @@
2525 }
2626 prevReq = openXMLHttpRequest();
2727 if( !prevReq ) return false;
28 -
 28+
2929 prevReq.onreadystatechange = updatePreviewText;
3030 prevReq.open("POST", postUrl, true);
31 -
 31+
3232 var postData = 'wpTextbox1=' + encodeURIComponent(text);
3333 prevReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
3434 prevReq.send(postData);
Index: trunk/phase3/skins/common/wikibits.js
@@ -356,7 +356,7 @@
357357 insertTags(item.tagOpen, item.tagClose, item.sampleText);
358358 return false;
359359 };
360 -
 360+
361361 parent.appendChild(image);
362362 return true;
363363 }
@@ -367,13 +367,13 @@
368368
369369 var textbox = document.getElementById('wpTextbox1');
370370 if (!textbox) { return false; }
371 -
 371+
372372 // Don't generate buttons for browsers which don't fully
373373 // support it.
374374 if (!document.selection && textbox.selectionStart === null) {
375375 return false;
376376 }
377 -
 377+
378378 for (var i in mwEditButtons) {
379379 mwInsertEditButton(toolbar, mwEditButtons[i]);
380380 }
@@ -1030,7 +1030,7 @@
10311031 if (typeof el == "undefined") { return el };
10321032 if (el.innerText) return el.innerText; // Not needed but it is faster
10331033 var str = "";
1034 -
 1034+
10351035 var cs = el.childNodes;
10361036 var l = cs.length;
10371037 for (var i = 0; i < l; i++) {
@@ -1107,8 +1107,8 @@
11081108 } else {
11091109 arrowHTML = '<img src="'+ ts_image_path + ts_image_up + '" alt="&uarr;"/>';
11101110 span.setAttribute('sortdir','down');
1111 - }
1112 -
 1111+ }
 1112+
11131113 // We appendChild rows that already exist to the tbody, so it moves them rather than creating new ones
11141114 // don't do sortbottom rows
11151115 for (var i = 0; i < newRows.length; i++) {
@@ -1189,13 +1189,13 @@
11901190 var bb = ts_parseFloat(b[1].replace(/[^0-9.]/g,''));
11911191 return (aa != bb ? aa - bb : a[2] - b[2]);
11921192 }
1193 -
 1193+
11941194 function ts_sort_numeric(a,b) {
11951195 var aa = ts_parseFloat(a[1]);
11961196 var bb = ts_parseFloat(b[1]);
11971197 return (aa != bb ? aa - bb : a[2] - b[2]);
11981198 }
1199 -
 1199+
12001200 function ts_sort_caseinsensitive(a,b) {
12011201 var aa = a[1].toLowerCase();
12021202 var bb = b[1].toLowerCase();
Index: trunk/phase3/skins/common/IEFixes.js
@@ -33,7 +33,7 @@
3434
3535 if (imageUrl.substr(imageUrl.length-4).toLowerCase() == '.png') {
3636 var logospan = logoa.appendChild(document.createElement('span'));
37 -
 37+
3838 logoa.style.backgroundImage = 'none';
3939 logospan.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=' + imageUrl + ')';
4040 logospan.style.height = '100%';
@@ -41,7 +41,7 @@
4242 logospan.style.width = logoa.currentStyle.width;
4343 logospan.style.cursor = 'hand';
4444 // Center image with hack for IE5.5
45 - if (document.documentElement.dir == "rtl")
 45+ if (document.documentElement.dir == "rtl")
4646 {
4747 logospan.style.right = '50%';
4848 logospan.style.setExpression('marginRight', '"-" + (this.offsetWidth / 2) + "px"');
@@ -53,7 +53,7 @@
5454 }
5555 logospan.style.top = '50%';
5656 logospan.style.setExpression('marginTop', '"-" + (this.offsetHeight / 2) + "px"');
57 -
 57+
5858 var linkFix = logoa.appendChild(logoa.cloneNode());
5959 linkFix.style.position = 'absolute';
6060 linkFix.style.height = '100%';
@@ -124,4 +124,4 @@
125125 for (var i=0; i < expandedURLs.length; i++)
126126 if (expandedURLs[i])
127127 expandedURLs[i].removeNode(true);
128 -}
\ No newline at end of file
 128+}