1 // Wikipedia JavaScript support functions
3 var clientPC
= navigator
.userAgent
.toLowerCase(); // Get client info
4 var is_gecko
= ((clientPC
.indexOf('gecko')!=-1) && (clientPC
.indexOf('spoofer')==-1)
5 && (clientPC
.indexOf('khtml') == -1) && (clientPC
.indexOf('netscape/7.0')==-1));
6 var is_safari
= ((clientPC
.indexOf('applewebkit')!=-1) && (clientPC
.indexOf('spoofer')==-1));
7 var is_khtml
= (navigator
.vendor
== 'KDE' || ( document
.childNodes
&& !document
.all
&& !navigator
.taintEnabled
));
8 if (clientPC
.indexOf('opera') != -1) {
10 var is_opera_preseven
= (window
.opera
&& !document
.childNodes
);
11 var is_opera_seven
= (window
.opera
&& document
.childNodes
);
14 // add any onload functions in this hook (please don't hard-code any events in the xhtml source)
18 if (!window
.onloadFuncts
)
19 var onloadFuncts
= [];
21 function addOnloadHook(hookFunct
) {
22 // Allows add-on scripts to add onload functions
23 onloadFuncts
[onloadFuncts
.length
] = hookFunct
;
26 function runOnloadHook() {
27 // don't run anything below this for non-dom browsers
28 if (doneOnloadHook
|| !(document
.getElementById
&& document
.getElementsByTagName
))
36 setupCheckboxShiftClick();
38 // Run any added-on functions
39 for (var i
= 0; i
< onloadFuncts
.length
; i
++)
42 doneOnloadHook
= true;
45 function hookEvent(hookName
, hookFunct
) {
46 if (window
.addEventListener
)
47 addEventListener(hookName
, hookFunct
, false);
48 else if (window
.attachEvent
)
49 attachEvent("on" + hookName
, hookFunct
);
52 hookEvent("load", runOnloadHook
);
54 // document.write special stylesheet links
55 if (typeof stylepath
!= 'undefined' && typeof skin
!= 'undefined') {
56 if (is_opera_preseven
) {
57 document
.write('<link rel="stylesheet" type="text/css" href="'+stylepath
+'/'+skin
+'/Opera6Fixes.css">');
58 } else if (is_opera_seven
) {
59 document
.write('<link rel="stylesheet" type="text/css" href="'+stylepath
+'/'+skin
+'/Opera7Fixes.css">');
60 } else if (is_khtml
) {
61 document
.write('<link rel="stylesheet" type="text/css" href="'+stylepath
+'/'+skin
+'/KHTMLFixes.css">');
64 // Un-trap us from framesets
65 if (window
.top
!= window
)
66 window
.top
.location
= window
.location
;
68 // for enhanced RecentChanges
69 function toggleVisibility(_levelId
, _otherId
, _linkId
) {
70 var thisLevel
= document
.getElementById(_levelId
);
71 var otherLevel
= document
.getElementById(_otherId
);
72 var linkLevel
= document
.getElementById(_linkId
);
73 if (thisLevel
.style
.display
== 'none') {
74 thisLevel
.style
.display
= 'block';
75 otherLevel
.style
.display
= 'none';
76 linkLevel
.style
.display
= 'inline';
78 thisLevel
.style
.display
= 'none';
79 otherLevel
.style
.display
= 'inline';
80 linkLevel
.style
.display
= 'none';
85 // attach event handlers to the input elements on history page
86 function histrowinit() {
87 var hf
= document
.getElementById('pagehistory');
90 var lis
= hf
.getElementsByTagName('li');
91 for (i
= 0; i
< lis
.length
; i
++) {
92 var inputs
= historyRadios(lis
[i
]);
93 if (inputs
[0] && inputs
[1]) {
94 inputs
[0].onclick
= diffcheck
;
95 inputs
[1].onclick
= diffcheck
;
101 function historyRadios(parent
) {
102 var inputs
= parent
.getElementsByTagName('input');
104 for (var i
= 0; i
< inputs
.length
; i
++) {
105 if (inputs
[i
].name
== "diff" || inputs
[i
].name
== "oldid")
106 radios
[radios
.length
] = inputs
[i
];
111 // check selection and tweak visibility/class onclick
112 function diffcheck() {
113 var dli
= false; // the li where the diff radio is checked
114 var oli
= false; // the li where the oldid radio is checked
115 var hf
= document
.getElementById('pagehistory');
118 var lis
= hf
.getElementsByTagName('li');
119 for (i
=0;i
<lis
.length
;i
++) {
120 var inputs
= historyRadios(lis
[i
]);
121 if (inputs
[1] && inputs
[0]) {
122 if (inputs
[1].checked
|| inputs
[0].checked
) { // this row has a checked radio button
123 if (inputs
[1].checked
&& inputs
[0].checked
&& inputs
[0].value
== inputs
[1].value
)
125 if (oli
) { // it's the second checked radio
126 if (inputs
[1].checked
) {
127 oli
.className
= "selected";
130 } else if (inputs
[0].checked
) {
133 if (inputs
[0].checked
)
136 inputs
[0].style
.visibility
= 'hidden';
138 inputs
[1].style
.visibility
= 'hidden';
139 lis
[i
].className
= "selected";
141 } else { // no radio is checked in this row
143 inputs
[0].style
.visibility
= 'hidden';
145 inputs
[0].style
.visibility
= 'visible';
147 inputs
[1].style
.visibility
= 'hidden';
149 inputs
[1].style
.visibility
= 'visible';
150 lis
[i
].className
= "";
157 // generate toc from prefs form, fold sections
158 // XXX: needs testing on IE/Mac and safari
159 // more comments to follow
160 function tabbedprefs() {
161 var prefform
= document
.getElementById('preferences');
162 if (!prefform
|| !document
.createElement
)
164 if (prefform
.nodeName
.toLowerCase() == 'a')
165 return; // Occasional IE problem
166 prefform
.className
= prefform
.className
+ 'jsprefs';
167 var sections
= new Array();
168 var children
= prefform
.childNodes
;
170 for (var i
= 0; i
< children
.length
; i
++) {
171 if (children
[i
].nodeName
.toLowerCase() == 'fieldset') {
172 children
[i
].id
= 'prefsection-' + seci
;
173 children
[i
].className
= 'prefsection';
174 if (is_opera
|| is_khtml
)
175 children
[i
].className
= 'prefsection operaprefsection';
176 var legends
= children
[i
].getElementsByTagName('legend');
177 sections
[seci
] = new Object();
178 legends
[0].className
= 'mainLegend';
179 if (legends
[0] && legends
[0].firstChild
.nodeValue
)
180 sections
[seci
].text
= legends
[0].firstChild
.nodeValue
;
182 sections
[seci
].text
= '# ' + seci
;
183 sections
[seci
].secid
= children
[i
].id
;
185 if (sections
.length
!= 1)
186 children
[i
].style
.display
= 'none';
188 var selectedid
= children
[i
].id
;
191 var toc
= document
.createElement('ul');
193 toc
.selectedid
= selectedid
;
194 for (i
= 0; i
< sections
.length
; i
++) {
195 var li
= document
.createElement('li');
197 li
.className
= 'selected';
198 var a
= document
.createElement('a');
199 a
.href
= '#' + sections
[i
].secid
;
200 a
.onmousedown
= a
.onclick
= uncoversection
;
201 a
.appendChild(document
.createTextNode(sections
[i
].text
));
202 a
.secid
= sections
[i
].secid
;
206 prefform
.parentNode
.insertBefore(toc
, prefform
.parentNode
.childNodes
[0]);
207 document
.getElementById('prefsubmit').id
= 'prefcontrol';
210 function uncoversection() {
211 var oldsecid
= this.parentNode
.parentNode
.selectedid
;
212 var newsec
= document
.getElementById(this.secid
);
213 if (oldsecid
!= this.secid
) {
214 var ul
= document
.getElementById('preftoc');
215 document
.getElementById(oldsecid
).style
.display
= 'none';
216 newsec
.style
.display
= 'block';
217 ul
.selectedid
= this.secid
;
218 var lis
= ul
.getElementsByTagName('li');
219 for (var i
= 0; i
< lis
.length
; i
++) {
220 lis
[i
].className
= '';
222 this.parentNode
.className
= 'selected';
228 // tz in format [+-]HHMM
229 function checkTimezone(tz
, msg
) {
230 var localclock
= new Date();
231 // returns negative offset from GMT in minutes
232 var tzRaw
= localclock
.getTimezoneOffset();
233 var tzHour
= Math
.floor( Math
.abs(tzRaw
) / 60);
234 var tzMin
= Math
.abs(tzRaw
) % 60;
235 var tzString
= ((tzRaw
>= 0) ? "-" : "+") + ((tzHour
< 10) ? "0" : "") + tzHour
+ ((tzMin
< 10) ? "0" : "") + tzMin
;
236 if (tz
!= tzString
) {
237 var junk
= msg
.split('$1');
238 document
.write(junk
[0] + "UTC" + tzString
+ junk
[1]);
242 function unhidetzbutton() {
243 var tzb
= document
.getElementById('guesstimezonebutton');
245 tzb
.style
.display
= 'inline';
248 // in [-]HH:MM format...
249 // won't yet work with non-even tzs
250 function fetchTimezone() {
251 // FIXME: work around Safari bug
252 var localclock
= new Date();
253 // returns negative offset from GMT in minutes
254 var tzRaw
= localclock
.getTimezoneOffset();
255 var tzHour
= Math
.floor( Math
.abs(tzRaw
) / 60);
256 var tzMin
= Math
.abs(tzRaw
) % 60;
257 var tzString
= ((tzRaw
>= 0) ? "-" : "") + ((tzHour
< 10) ? "0" : "") + tzHour
+
258 ":" + ((tzMin
< 10) ? "0" : "") + tzMin
;
262 function guessTimezone(box
) {
263 document
.getElementsByName("wpHourDiff")[0].value
= fetchTimezone();
266 function showTocToggle() {
267 if (document
.createTextNode
) {
268 // Uses DOM calls to avoid document.write + XHTML issues
270 var linkHolder
= document
.getElementById('toctitle')
274 var outerSpan
= document
.createElement('span');
275 outerSpan
.className
= 'toctoggle';
277 var toggleLink
= document
.createElement('a');
278 toggleLink
.id
= 'togglelink';
279 toggleLink
.className
= 'internal';
280 toggleLink
.href
= 'javascript:toggleToc()';
281 toggleLink
.appendChild(document
.createTextNode(tocHideText
));
283 outerSpan
.appendChild(document
.createTextNode('['));
284 outerSpan
.appendChild(toggleLink
);
285 outerSpan
.appendChild(document
.createTextNode(']'));
287 linkHolder
.appendChild(document
.createTextNode(' '));
288 linkHolder
.appendChild(outerSpan
);
290 var cookiePos
= document
.cookie
.indexOf("hidetoc=");
291 if (cookiePos
> -1 && document
.cookie
.charAt(cookiePos
+ 8) == 1)
296 function changeText(el
, newText
) {
297 // Safari work around
299 el
.innerText
= newText
;
300 else if (el
.firstChild
&& el
.firstChild
.nodeValue
)
301 el
.firstChild
.nodeValue
= newText
;
304 function toggleToc() {
305 var toc
= document
.getElementById('toc').getElementsByTagName('ul')[0];
306 var toggleLink
= document
.getElementById('togglelink')
308 if (toc
&& toggleLink
&& toc
.style
.display
== 'none') {
309 changeText(toggleLink
, tocHideText
);
310 toc
.style
.display
= 'block';
311 document
.cookie
= "hidetoc=0";
313 changeText(toggleLink
, tocShowText
);
314 toc
.style
.display
= 'none';
315 document
.cookie
= "hidetoc=1";
320 mwCustomEditButtons
= []; // eg to add in MediaWiki:Common.js
322 // this function generates the actual toolbar buttons with localized text
323 // we use it to avoid creating the toolbar where javascript is not enabled
324 function addButton(imageFile
, speedTip
, tagOpen
, tagClose
, sampleText
) {
325 // Don't generate buttons for browsers which don't fully
327 mwEditButtons
[mwEditButtons
.length
] =
328 {"imageFile": imageFile
,
329 "speedTip": speedTip
,
331 "tagClose": tagClose
,
332 "sampleText": sampleText
};
335 // this function generates the actual toolbar buttons with localized text
336 // we use it to avoid creating the toolbar where javascript is not enabled
337 function mwInsertEditButton(parent
, item
) {
338 var image
= document
.createElement("img");
341 image
.src
= item
.imageFile
;
343 image
.alt
= item
.speedTip
;
344 image
.title
= item
.speedTip
;
345 image
.style
.cursor
= "pointer";
346 image
.onclick = function() {
347 insertTags(item
.tagOpen
, item
.tagClose
, item
.sampleText
);
351 parent
.appendChild(image
);
355 function mwSetupToolbar() {
356 var toolbar
= document
.getElementById('toolbar');
357 if (!toolbar
) return false;
359 var textbox
= document
.getElementById('wpTextbox1');
360 if (!textbox
) return false;
362 // Don't generate buttons for browsers which don't fully
364 if (!document
.selection
&& textbox
.selectionStart
== null)
367 for (var i
in mwEditButtons
) {
368 mwInsertEditButton(toolbar
, mwEditButtons
[i
]);
370 for (var i
in mwCustomEditButtons
) {
371 mwInsertEditButton(toolbar
, mwCustomEditButtons
[i
]);
376 function escapeQuotes(text
) {
377 var re
= new RegExp("'","g");
378 text
= text
.replace(re
,"\\'");
379 re
= new RegExp("\\n","g");
380 text
= text
.replace(re
,"\\n");
381 return escapeQuotesHTML(text
);
384 function escapeQuotesHTML(text
) {
385 var re
= new RegExp('&',"g");
386 text
= text
.replace(re
,"&");
387 var re
= new RegExp('"',"g");
388 text
= text
.replace(re
,""");
389 var re
= new RegExp('<',"g");
390 text
= text
.replace(re
,"<");
391 var re
= new RegExp('>',"g");
392 text
= text
.replace(re
,">");
396 // apply tagOpen/tagClose to selection in textarea,
397 // use sampleText instead of selection if there is none
398 // copied and adapted from phpBB
399 function insertTags(tagOpen
, tagClose
, sampleText
) {
400 if (document
.editform
)
401 var txtarea
= document
.editform
.wpTextbox1
;
403 // some alternate form? take the first one we can find
404 var areas
= document
.getElementsByTagName('textarea');
405 var txtarea
= areas
[0];
409 if (document
.selection
&& !is_gecko
) {
410 var theSelection
= document
.selection
.createRange().text
;
412 theSelection
=sampleText
;
414 if (theSelection
.charAt(theSelection
.length
- 1) == " ") { // exclude ending space char, if any
415 theSelection
= theSelection
.substring(0, theSelection
.length
- 1);
416 document
.selection
.createRange().text
= tagOpen
+ theSelection
+ tagClose
+ " ";
418 document
.selection
.createRange().text
= tagOpen
+ theSelection
+ tagClose
;
422 } else if(txtarea
.selectionStart
|| txtarea
.selectionStart
== '0') {
423 var replaced
= false;
424 var startPos
= txtarea
.selectionStart
;
425 var endPos
= txtarea
.selectionEnd
;
428 var scrollTop
= txtarea
.scrollTop
;
429 var myText
= (txtarea
.value
).substring(startPos
, endPos
);
432 if (myText
.charAt(myText
.length
- 1) == " ") { // exclude ending space char, if any
433 subst
= tagOpen
+ myText
.substring(0, (myText
.length
- 1)) + tagClose
+ " ";
435 subst
= tagOpen
+ myText
+ tagClose
;
437 txtarea
.value
= txtarea
.value
.substring(0, startPos
) + subst
+
438 txtarea
.value
.substring(endPos
, txtarea
.value
.length
);
442 var cPos
= startPos
+(tagOpen
.length
+myText
.length
+tagClose
.length
);
443 txtarea
.selectionStart
= cPos
;
444 txtarea
.selectionEnd
= cPos
;
446 txtarea
.selectionStart
= startPos
+tagOpen
.length
;
447 txtarea
.selectionEnd
= startPos
+tagOpen
.length
+myText
.length
;
449 txtarea
.scrollTop
= scrollTop
;
451 // All other browsers get no toolbar.
452 // There was previously support for a crippled "help"
453 // bar, but that caused more problems than it solved.
455 // reposition cursor if possible
456 if (txtarea
.createTextRange
)
457 txtarea
.caretPos
= document
.selection
.createRange().duplicate();
461 if (typeof ta
== "undefined" || !ta
)
464 if (is_safari
|| navigator
.userAgent
.toLowerCase().indexOf('mac') + 1
465 || navigator
.userAgent
.toLowerCase().indexOf('konqueror') + 1 )
471 var n
= document
.getElementById(id
);
475 // Are we putting accesskey in it
476 if (ta
[id
][0].length
> 0) {
477 // Is this object a object? If not assume it's the next child.
479 if (n
.nodeName
.toLowerCase() == "a") {
486 a
.accessKey
= ta
[id
][0];
487 ak
= ' ['+pref
+ta
[id
][0]+']';
490 // We don't care what type the object is when assigning tooltip
496 a
.title
= ta
[id
][1]+ak
;
502 function setupRightClickEdit() {
503 if (document
.getElementsByTagName
) {
504 var divs
= document
.getElementsByTagName('div');
505 for (var i
= 0; i
< divs
.length
; i
++) {
507 if(el
.className
== 'editsection') {
508 addRightClickEditHandler(el
);
514 function addRightClickEditHandler(el
) {
515 for (var i
= 0; i
< el
.childNodes
.length
; i
++) {
516 var link
= el
.childNodes
[i
];
517 if (link
.nodeType
== 1 && link
.nodeName
.toLowerCase() == 'a') {
518 var editHref
= link
.getAttribute('href');
520 // find the following a
521 var next
= el
.nextSibling
;
522 while (next
.nodeType
!= 1)
523 next
= next
.nextSibling
;
525 // find the following header
526 next
= next
.nextSibling
;
527 while (next
.nodeType
!= 1)
528 next
= next
.nextSibling
;
530 if (next
&& next
.nodeType
== 1 &&
531 next
.nodeName
.match(/^[Hh][1-6]$/)) {
532 next
.oncontextmenu = function() {
533 document
.location
= editHref
;
541 function setupCheckboxShiftClick() {
542 if (document
.getElementsByTagName
) {
543 var uls
= document
.getElementsByTagName('ul');
544 var len
= uls
.length
;
545 for (var i
= 0; i
< len
; ++i
) {
546 addCheckboxClickHandlers(uls
[i
]);
551 function addCheckboxClickHandlers(ul
, start
, finish
) {
552 if (ul
.checkboxHandlersTimer
) {
553 clearInterval(ul
.checkboxHandlersTimer
);
555 if ( !ul
.childNodes
) {
558 var len
= ul
.childNodes
.length
;
563 finish
= finish
|| start
+ 250;
564 if ( finish
> len
) { finish
= len
; }
565 ul
.checkboxes
= ul
.checkboxes
|| [];
566 ul
.lastCheckbox
= ul
.lastCheckbox
|| null;
567 for (var i
= start
; i
<finish
; ++i
) {
568 var child
= ul
.childNodes
[i
];
569 if ( child
&& child
.childNodes
&& child
.childNodes
[0] ) {
570 var cb
= child
.childNodes
[0];
571 if ( !cb
.nodeName
|| cb
.nodeName
.toLowerCase() != 'input' ||
572 !cb
.type
|| cb
.type
.toLowerCase() != 'checkbox' ) {
575 cb
.index
= ul
.checkboxes
.push(cb
) - 1;
577 cb
.onmouseup
= checkboxMouseupHandler
;
581 var f=function(){ addCheckboxClickHandlers(ul
, finish
, finish
+250); };
582 ul
.checkboxHandlersTimer
=setInterval(f
, 200);
586 function checkboxMouseupHandler(e
) {
587 if (typeof e
== 'undefined') {
590 if ( !e
.shiftKey
|| this.container
.lastCheckbox
=== null ) {
591 this.container
.lastCheckbox
= this.index
;
594 var endState
= !this.checked
;
595 if ( is_opera
) { // opera has already toggled the checkbox by this point
596 endState
= !endState
;
599 if ( this.index
< this.container
.lastCheckbox
) {
600 start
= this.index
+ 1;
601 finish
= this.container
.lastCheckbox
;
603 start
= this.container
.lastCheckbox
;
604 finish
= this.index
- 1;
606 for (var i
= start
; i
<= finish
; ++i
) {
607 this.container
.checkboxes
[i
].checked
= endState
;
609 this.container
.lastCheckbox
= this.index
;
613 function fillDestFilename() {
614 if (!document
.getElementById
)
616 var path
= document
.getElementById('wpUploadFile').value
;
617 // Find trailing part
618 var slash
= path
.lastIndexOf('/');
619 var backslash
= path
.lastIndexOf('\\');
621 if (slash
== -1 && backslash
== -1) {
623 } else if (slash
> backslash
) {
624 fname
= path
.substring(slash
+1, 10000);
626 fname
= path
.substring(backslash
+1, 10000);
629 // Capitalise first letter and replace spaces by underscores
630 fname
= fname
.charAt(0).toUpperCase().concat(fname
.substring(1,10000)).replace(/ /g
, '_');
633 var destFile
= document
.getElementById('wpDestFile');
635 destFile
.value
= fname
;
639 function considerChangingExpiryFocus() {
640 if (!document
.getElementById
)
642 var drop
= document
.getElementById('wpBlockExpiry');
645 var field
= document
.getElementById('wpBlockOther');
648 var opt
= drop
.value
;
650 field
.style
.display
= '';
652 field
.style
.display
= 'none';
655 function scrollEditBox() {
656 var editBoxEl
= document
.getElementById("wpTextbox1");
657 var scrollTopEl
= document
.getElementById("wpScrolltop");
658 var editFormEl
= document
.getElementById("editform");
660 if (editBoxEl
&& scrollTopEl
) {
661 if (scrollTopEl
.value
) editBoxEl
.scrollTop
= scrollTopEl
.value
;
662 editFormEl
.onsubmit = function() {
663 document
.getElementById("wpScrolltop").value
= document
.getElementById("wpTextbox1").scrollTop
;
668 hookEvent("load", scrollEditBox
);
670 function allmessagesfilter() {
671 text
= document
.getElementById('allmessagesinput').value
;
672 k
= document
.getElementById('allmessagestable');
675 var items
= k
.getElementsByTagName('span');
677 if ( text
.length
> allmessages_prev
.length
) {
678 for (var i
= items
.length
-1, j
= 0; i
>= 0; i
--) {
679 j
= allmessagesforeach(items
, i
, j
);
682 for (var i
= 0, j
= 0; i
< items
.length
; i
++) {
683 j
= allmessagesforeach(items
, i
, j
);
686 allmessages_prev
= text
;
689 function allmessagesforeach(items
, i
, j
) {
690 var hItem
= items
[i
].getAttribute('id');
691 if (hItem
.substring(0,17) == 'sp-allmessages-i-') {
692 if (items
[i
].firstChild
&& items
[i
].firstChild
.nodeName
== '#text' && items
[i
].firstChild
.nodeValue
.indexOf(text
) != -1) {
693 var itemA
= document
.getElementById( hItem
.replace('i', 'r1') );
694 var itemB
= document
.getElementById( hItem
.replace('i', 'r2') );
695 if ( itemA
.style
.display
!= '' ) {
696 var s
= "allmessageshider(\"" + hItem
.replace('i', 'r1') + "\", \"" + hItem
.replace('i', 'r2') + "\", '')";
697 var k
= window
.setTimeout(s
,j
++*5);
700 var itemA
= document
.getElementById( hItem
.replace('i', 'r1') );
701 var itemB
= document
.getElementById( hItem
.replace('i', 'r2') );
702 if ( itemA
.style
.display
!= 'none' ) {
703 var s
= "allmessageshider(\"" + hItem
.replace('i', 'r1') + "\", \"" + hItem
.replace('i', 'r2') + "\", 'none')";
704 var k
= window
.setTimeout(s
,j
++*5);
712 function allmessageshider(idA
, idB
, cstyle
) {
713 var itemA
= document
.getElementById( idA
);
714 var itemB
= document
.getElementById( idB
);
715 if (itemA
) { itemA
.style
.display
= cstyle
; }
716 if (itemB
) { itemB
.style
.display
= cstyle
; }
719 function allmessagesmodified() {
720 allmessages_modified
= !allmessages_modified
;
721 k
= document
.getElementById('allmessagestable');
723 var items
= k
.getElementsByTagName('tr');
724 for (var i
= 0, j
= 0; i
< items
.length
; i
++) {
725 if (!allmessages_modified
) {
726 if ( items
[i
].style
.display
!= '' ) {
727 var s
= "allmessageshider(\"" + items
[i
].getAttribute('id') + "\", null, '')";
728 var k
= window
.setTimeout(s
,j
++*5);
730 } else if (items
[i
].getAttribute('class') == 'def' && allmessages_modified
) {
731 if ( items
[i
].style
.display
!= 'none' ) {
732 var s
= "allmessageshider(\"" + items
[i
].getAttribute('id') + "\", null, 'none')";
733 var k
= window
.setTimeout(s
,j
++*5);
739 function allmessagesshow() {
740 k
= document
.getElementById('allmessagesfilter');
741 if (k
) { k
.style
.display
= ''; }
743 allmessages_prev
= '';
744 allmessages_modified
= false;
747 hookEvent("load", allmessagesshow
);
748 hookEvent("load", mwSetupToolbar
);