Index: trunk/phase3/skins/common/wikibits.js |
— | — | @@ -65,8 +65,8 @@ |
66 | 66 | } |
67 | 67 | loadedScripts[url] = true; |
68 | 68 | var s = document.createElement('script'); |
69 | | - s.setAttribute('src',url); |
70 | | - s.setAttribute('type','text/javascript'); |
| 69 | + s.setAttribute('src', url); |
| 70 | + s.setAttribute('type', 'text/javascript'); |
71 | 71 | document.getElementsByTagName('head')[0].appendChild(s); |
72 | 72 | return s; |
73 | 73 | } |
— | — | @@ -75,12 +75,14 @@ |
76 | 76 | return importStylesheetURI(wgScript + '?action=raw&ctype=text/css&title=' + encodeURIComponent(page.replace(/ /g,'_'))); |
77 | 77 | } |
78 | 78 | |
79 | | -function importStylesheetURI(url,media) { |
| 79 | +function importStylesheetURI(url, media) { |
80 | 80 | var l = document.createElement('link'); |
81 | 81 | l.type = 'text/css'; |
82 | 82 | l.rel = 'stylesheet'; |
83 | 83 | l.href = url; |
84 | | - if(media) l.media = media |
| 84 | + if( media ) { |
| 85 | + l.media = media; |
| 86 | + } |
85 | 87 | document.getElementsByTagName('head')[0].appendChild(l); |
86 | 88 | return l; |
87 | 89 | } |
— | — | @@ -89,8 +91,11 @@ |
90 | 92 | var s = document.createElement('style'); |
91 | 93 | s.type = 'text/css'; |
92 | 94 | s.rel = 'stylesheet'; |
93 | | - if (s.styleSheet) s.styleSheet.cssText = text //IE |
94 | | - else s.appendChild(document.createTextNode(text + '')) //Safari sometimes borks on null |
| 95 | + if ( s.styleSheet ) { |
| 96 | + s.styleSheet.cssText = text; //IE |
| 97 | + } else { |
| 98 | + s.appendChild(document.createTextNode(text + '')); //Safari sometimes borks on null |
| 99 | + } |
95 | 100 | document.getElementsByTagName('head')[0].appendChild(s); |
96 | 101 | return s; |
97 | 102 | } |
— | — | @@ -290,58 +295,73 @@ |
291 | 296 | */ |
292 | 297 | function addPortletLink(portlet, href, text, id, tooltip, accesskey, nextnode) { |
293 | 298 | var root = document.getElementById(portlet); |
294 | | - if ( !root ) return null; |
295 | | - var node = root.getElementsByTagName( "ul" )[0]; |
296 | | - if ( !node ) return null; |
| 299 | + if ( !root ) { |
| 300 | + return null; |
| 301 | + } |
| 302 | + var node = root.getElementsByTagName( 'ul' )[0]; |
| 303 | + if ( !node ) { |
| 304 | + return null; |
| 305 | + } |
297 | 306 | |
298 | 307 | // unhide portlet if it was hidden before |
299 | 308 | root.className = root.className.replace( /(^| )emptyPortlet( |$)/, "$2" ); |
300 | 309 | |
301 | | - var span = document.createElement( "span" ); |
| 310 | + var span = document.createElement( 'span' ); |
302 | 311 | span.appendChild( document.createTextNode( text ) ); |
303 | 312 | |
304 | | - var link = document.createElement( "a" ); |
| 313 | + var link = document.createElement( 'a' ); |
305 | 314 | link.appendChild( span ); |
306 | 315 | link.href = href; |
307 | 316 | |
308 | | - var item = document.createElement( "li" ); |
| 317 | + var item = document.createElement( 'li' ); |
309 | 318 | item.appendChild( link ); |
310 | | - if ( id ) item.id = id; |
| 319 | + if ( id ) { |
| 320 | + item.id = id; |
| 321 | + } |
311 | 322 | |
312 | 323 | if ( accesskey ) { |
313 | | - link.setAttribute( "accesskey", accesskey ); |
314 | | - tooltip += " ["+accesskey+"]"; |
| 324 | + link.setAttribute( 'accesskey', accesskey ); |
| 325 | + tooltip += ' [' + accesskey + ']'; |
315 | 326 | } |
316 | 327 | if ( tooltip ) { |
317 | | - link.setAttribute( "title", tooltip ); |
| 328 | + link.setAttribute( 'title', tooltip ); |
318 | 329 | } |
319 | 330 | if ( accesskey && tooltip ) { |
320 | 331 | updateTooltipAccessKeys( new Array( link ) ); |
321 | 332 | } |
322 | 333 | |
323 | | - if ( nextnode && nextnode.parentNode == node ) |
| 334 | + if ( nextnode && nextnode.parentNode == node ) { |
324 | 335 | node.insertBefore( item, nextnode ); |
325 | | - else |
| 336 | + } else { |
326 | 337 | node.appendChild( item ); // IE compatibility (?) |
| 338 | + } |
327 | 339 | |
328 | 340 | return item; |
329 | 341 | } |
330 | 342 | |
331 | 343 | function getInnerText(el) { |
332 | | - if (typeof el == "string") return el; |
333 | | - if (typeof el == "undefined") { return el }; |
334 | | - if (el.textContent) return el.textContent; // not needed but it is faster |
335 | | - if (el.innerText) return el.innerText; // IE doesn't have textContent |
336 | | - var str = ""; |
| 344 | + if ( typeof el == 'string' ) { |
| 345 | + return el; |
| 346 | + } |
| 347 | + if ( typeof el == 'undefined' ) { |
| 348 | + return el; |
| 349 | + } |
| 350 | + if ( el.textContent ) { |
| 351 | + return el.textContent; // not needed but it is faster |
| 352 | + } |
| 353 | + if ( el.innerText ) { |
| 354 | + return el.innerText; // IE doesn't have textContent |
| 355 | + } |
| 356 | + var str = ''; |
337 | 357 | |
338 | 358 | var cs = el.childNodes; |
339 | 359 | var l = cs.length; |
340 | 360 | for (var i = 0; i < l; i++) { |
341 | 361 | switch (cs[i].nodeType) { |
342 | | - case 1: //ELEMENT_NODE |
| 362 | + case 1: // ELEMENT_NODE |
343 | 363 | str += ts_getInnerText(cs[i]); |
344 | 364 | break; |
345 | | - case 3: //TEXT_NODE |
| 365 | + case 3: // TEXT_NODE |
346 | 366 | str += cs[i].nodeValue; |
347 | 367 | break; |
348 | 368 | } |
— | — | @@ -364,16 +384,20 @@ |
365 | 385 | } |
366 | 386 | |
367 | 387 | function addCheckboxClickHandlers(inputs, start) { |
368 | | - if ( !start) start = 0; |
| 388 | + if ( !start ) { |
| 389 | + start = 0; |
| 390 | + } |
369 | 391 | |
370 | 392 | var finish = start + 250; |
371 | | - if ( finish > inputs.length ) |
| 393 | + if ( finish > inputs.length ) { |
372 | 394 | finish = inputs.length; |
| 395 | + } |
373 | 396 | |
374 | 397 | for ( var i = start; i < finish; i++ ) { |
375 | 398 | var cb = inputs[i]; |
376 | | - if ( !cb.type || cb.type.toLowerCase() != 'checkbox' ) |
| 399 | + if ( !cb.type || cb.type.toLowerCase() != 'checkbox' ) { |
377 | 400 | continue; |
| 401 | + } |
378 | 402 | var end = checkboxes.length; |
379 | 403 | checkboxes[end] = cb; |
380 | 404 | cb.index = end; |
— | — | @@ -406,8 +430,9 @@ |
407 | 431 | } |
408 | 432 | for (var i = start; i <= finish; ++i ) { |
409 | 433 | checkboxes[i].checked = endState; |
410 | | - if( i > start && typeof checkboxes[i].onchange == 'function' ) |
| 434 | + if( i > start && typeof checkboxes[i].onchange == 'function' ) { |
411 | 435 | checkboxes[i].onchange(); // fire triggers |
| 436 | + } |
412 | 437 | } |
413 | 438 | lastCheckbox = this.index; |
414 | 439 | return true; |
— | — | @@ -425,11 +450,13 @@ |
426 | 451 | if ( typeof( oElm.getElementsByClassName ) == "function" ) { |
427 | 452 | /* Use a native implementation where possible FF3, Saf3.2, Opera 9.5 */ |
428 | 453 | var arrNativeReturn = oElm.getElementsByClassName( oClassNames ); |
429 | | - if ( strTagName == "*" ) |
| 454 | + if ( strTagName == "*" ) { |
430 | 455 | return arrNativeReturn; |
| 456 | + } |
431 | 457 | for ( var h=0; h < arrNativeReturn.length; h++ ) { |
432 | | - if( arrNativeReturn[h].tagName.toLowerCase() == strTagName.toLowerCase() ) |
| 458 | + if( arrNativeReturn[h].tagName.toLowerCase() == strTagName.toLowerCase() ) { |
433 | 459 | arrReturnElements[arrReturnElements.length] = arrNativeReturn[h]; |
| 460 | + } |
434 | 461 | } |
435 | 462 | return arrReturnElements; |
436 | 463 | } |
— | — | @@ -440,8 +467,7 @@ |
441 | 468 | arrRegExpClassNames[arrRegExpClassNames.length] = |
442 | 469 | new RegExp("(^|\\s)" + oClassNames[i].replace(/\-/g, "\\-") + "(\\s|$)"); |
443 | 470 | } |
444 | | - } |
445 | | - else{ |
| 471 | + } else { |
446 | 472 | arrRegExpClassNames[arrRegExpClassNames.length] = |
447 | 473 | new RegExp("(^|\\s)" + oClassNames.replace(/\-/g, "\\-") + "(\\s|$)"); |
448 | 474 | } |
— | — | @@ -460,7 +486,7 @@ |
461 | 487 | arrReturnElements[arrReturnElements.length] = oElement; |
462 | 488 | } |
463 | 489 | } |
464 | | - return (arrReturnElements) |
| 490 | + return (arrReturnElements); |
465 | 491 | } |
466 | 492 | |
467 | 493 | function redirectToFragment(fragment) { |
— | — | @@ -476,12 +502,14 @@ |
477 | 503 | if (is_gecko) { |
478 | 504 | // Mozilla needs to wait until after load, otherwise the window doesn't scroll |
479 | 505 | addOnloadHook(function () { |
480 | | - if (window.location.hash == "") |
| 506 | + if (window.location.hash == '') { |
481 | 507 | window.location.hash = fragment; |
| 508 | + } |
482 | 509 | }); |
483 | 510 | } else { |
484 | | - if (window.location.hash == "") |
| 511 | + if (window.location.hash == '') { |
485 | 512 | window.location.hash = fragment; |
| 513 | + } |
486 | 514 | } |
487 | 515 | } |
488 | 516 | |
— | — | @@ -496,11 +524,11 @@ |
497 | 525 | * @todo support all accepted date formats (bug 8226) |
498 | 526 | */ |
499 | 527 | |
500 | | -var ts_image_path = stylepath+"/common/images/"; |
501 | | -var ts_image_up = "sort_up.gif"; |
502 | | -var ts_image_down = "sort_down.gif"; |
503 | | -var ts_image_none = "sort_none.gif"; |
504 | | -var ts_europeandate = wgContentLanguage != "en"; // The non-American-inclined can change to "true" |
| 528 | +var ts_image_path = stylepath + '/common/images/'; |
| 529 | +var ts_image_up = 'sort_up.gif'; |
| 530 | +var ts_image_down = 'sort_down.gif'; |
| 531 | +var ts_image_none = 'sort_none.gif'; |
| 532 | +var ts_europeandate = wgContentLanguage != 'en'; // The non-American-inclined can change to "true" |
505 | 533 | var ts_alternate_row_colors = false; |
506 | 534 | var ts_number_transform_table = null; |
507 | 535 | var ts_number_regex = null; |
— | — | @@ -527,7 +555,9 @@ |
528 | 556 | firstRow = table.rows[0]; |
529 | 557 | } |
530 | 558 | } |
531 | | - if (!firstRow) return; |
| 559 | + if ( !firstRow ) { |
| 560 | + return; |
| 561 | + } |
532 | 562 | |
533 | 563 | // We have a first row: assume it's the header, and make its contents clickable links |
534 | 564 | for (var i = 0; i < firstRow.cells.length; i++) { |
— | — | @@ -560,14 +590,19 @@ |
561 | 591 | var column = td.cellIndex; |
562 | 592 | |
563 | 593 | var table = tr.parentNode; |
564 | | - while (table && !(table.tagName && table.tagName.toLowerCase() == 'table')) |
| 594 | + while (table && !(table.tagName && table.tagName.toLowerCase() == 'table')) { |
565 | 595 | table = table.parentNode; |
566 | | - if (!table) return; |
| 596 | + } |
| 597 | + if ( !table ) { |
| 598 | + return; |
| 599 | + } |
567 | 600 | |
568 | | - if (table.rows.length <= 1) return; |
| 601 | + if ( table.rows.length <= 1 ) { |
| 602 | + return; |
| 603 | + } |
569 | 604 | |
570 | 605 | // Generate the number transform table if it's not done already |
571 | | - if (ts_number_transform_table == null) { |
| 606 | + if (ts_number_transform_table === null) { |
572 | 607 | ts_initTransformTable(); |
573 | 608 | } |
574 | 609 | |
— | — | @@ -575,12 +610,14 @@ |
576 | 611 | // Skip the first row if that's where the headings are |
577 | 612 | var rowStart = (table.tHead && table.tHead.rows.length > 0 ? 0 : 1); |
578 | 613 | |
579 | | - var itm = ""; |
| 614 | + var itm = ''; |
580 | 615 | for (var i = rowStart; i < table.rows.length; i++) { |
581 | 616 | if (table.rows[i].cells.length > column) { |
582 | 617 | itm = ts_getInnerText(table.rows[i].cells[column]); |
583 | 618 | itm = itm.replace(/^[\s\xa0]+/, "").replace(/[\s\xa0]+$/, ""); |
584 | | - if (itm != "") break; |
| 619 | + if ( itm != '' ) { |
| 620 | + break; |
| 621 | + } |
585 | 622 | } |
586 | 623 | } |
587 | 624 | |
— | — | @@ -608,14 +645,16 @@ |
609 | 646 | var row = table.rows[j]; |
610 | 647 | if((" "+row.className+" ").indexOf(" unsortable ") < 0) { |
611 | 648 | var keyText = ts_getInnerText(row.cells[column]); |
612 | | - if(keyText == undefined) { |
613 | | - keyText = ""; |
| 649 | + if(keyText === undefined) { |
| 650 | + keyText = ''; |
614 | 651 | } |
615 | 652 | var oldIndex = (reverse ? -j : j); |
616 | 653 | var preprocessed = preprocessor( keyText.replace(/^[\s\xa0]+/, "").replace(/[\s\xa0]+$/, "") ); |
617 | 654 | |
618 | 655 | newRows[newRows.length] = new Array(row, preprocessed, oldIndex); |
619 | | - } else staticRows[staticRows.length] = new Array(row, false, j-rowStart); |
| 656 | + } else { |
| 657 | + staticRows[staticRows.length] = new Array(row, false, j-rowStart); |
| 658 | + } |
620 | 659 | } |
621 | 660 | |
622 | 661 | newRows.sort(sortfn); |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -1664,7 +1664,7 @@ |
1665 | 1665 | * to ensure that client-side caches do not keep obsolete copies of global |
1666 | 1666 | * styles. |
1667 | 1667 | */ |
1668 | | -$wgStyleVersion = '259'; |
| 1668 | +$wgStyleVersion = '260'; |
1669 | 1669 | |
1670 | 1670 | |
1671 | 1671 | # Server-side caching: |