1 function highlightReply(id)
3 var divs = document.getElementsByTagName('div');
5 for (var i = 0; i < divs.length; i++)
7 if (divs[i].className.indexOf('body') != -1)
8 divs[i].className = divs[i].className.replace(/highlighted/, '');
12 document.getElementById('reply_box_' + id).className += ' highlighted';
17 document.getElementById(id).focus();
21 function checkOrUncheckAllCheckboxes()
23 tmp = document.fuck_off;
25 for (i = 0; i < tmp.elements.length; i++)
27 if (tmp.elements[i].type == 'checkbox')
29 if (tmp.master_checkbox.checked == true)
30 tmp.elements[i].checked = true;
32 tmp.elements[i].checked = false;
37 function submitDummyForm(theAction, theVariableName, theVariableValue, confirmMessage)
39 if (confirmMessage === undefined)
40 var tmp = confirm('Really?');
42 var tmp = confirm(confirmMessage);
46 var form = document.getElementById('dummy_form');
47 form.action = theAction;
48 form.some_var.name = theVariableName;
49 form.some_var.value = theVariableValue;
56 function updateCharactersRemaining(theInputOrTextarea, theElementToUpdate, maxCharacters)
58 tmp = document.getElementById(theElementToUpdate);
59 tmp.firstChild.data = maxCharacters - document.getElementById(theInputOrTextarea).value.length;
62 function printCharactersRemaining(idOfTrackerElement, numDefaultCharacters)
64 document.write(' (<STRONG ID="' + idOfTrackerElement + '">' + numDefaultCharacters + '</STRONG> characters left)');
67 function removeSnapbackLink()
69 var tmp = document.getElementById("snapback_link");
72 tmp.parentNode.removeChild(tmp);
75 function createSnapbackLink(lastReplyId)
79 var div = document.createElement('DIV');
80 div.id = 'snapback_link';
81 var a = document.createElement('A');
82 a.href = '#reply_' + lastReplyId;
83 a.onclick = function () { highlightReply(lastReplyId); removeSnapbackLink(); };
84 a.className = 'help_cursor';
85 a.title = 'Click me to snap back!';
86 var strong = document.createElement('STRONG');
87 strong.appendChild(document.createTextNode('↕'));
88 a.appendChild(strong);
90 document.body.appendChild(div);
95 if (document.getElementById(window.location.hash.substring(1)) && window.location.hash.indexOf('reply_') != -1)
96 highlightReply(window.location.hash.substring(7));
97 else if (window.location.hash.indexOf('new') != -1)
98 highlightReply(document.getElementById('new_id').value);
101 window.onload = init;