// Put the nick of the user who was clicked on in the messages or the users frames // to the message box in the input frame; function userClick(user,privMsg) { if (window.frames['input'] && window.frames['input'].window.document.forms['MsgForm'].elements['MsgTo']) { window.frames['input'].window.document.forms['MsgForm'].elements['MsgTo'].value = user; var msgbox = window.frames['input'].window.document.forms['MsgForm'].elements['M']; if (privMsg) { var oldStr = msgbox.value; if (oldStr == "" || oldStr.substring(0,1) != " ") oldStr = " " + oldStr; msgbox.value = "/TO " + user + oldStr; } else { msgbox.value += user; if (msgbox.value == user) msgbox.value += "> "; }; msgbox.focus(); }; };
// Color choice at the input frame; isModerator = <?php echo((isset($status) && ($status == "a" || $status == "m")) ? 1 : 0); ?>; imgColor1 = new Image(4,20); imgColor1.src = path2Chat + "images/unselColor.gif"; imgColor2 = new Image(4,20); imgColor2.src = path2Chat + "images/selColor.gif"; var SelColor = null;
function ChangeColor(ColorVal,ColorRank) { if (SelColor != ColorRank) { if (document.all) { obj1 = window.frames['input'].window.document.all[SelColor]; obj2 = window.frames['input'].window.document.all[ColorRank]; } else if (document.images) { obj1 = window.frames['input'].window.document.images[SelColor]; obj2 = window.frames['input'].window.document.images[ColorRank]; } else return;
// Set the focus to the message box at the input frame; function get_focus() { window.frames['input'].window.focus(); window.frames['input'].window.document.forms['MsgForm'].elements['M'].focus(); }; // --> </SCRIPT> <SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript1.2"> <!-- // Get the position for the help popup var mouseX = 0; var mouseY = 0;
function displayLocation(e) { if (ver4) { if (IE4) e = window.frames['input'].window.event; mouseX = e.screenX; mouseY = e.screenY; } return; }
// Quick validation of the message or the command submited at the input frame function validateSubmission() { inputFrameForm = window.frames['input'].window.document.forms['MsgForm'];
// Submission looks like a command? isCmd = (inputFrameForm.elements['M'].value.substring(0,1) == '/'); // RegExp to quick check for valid commands re = /^\/(!$|announce .+|ban .+|clear$|help$|\?$|ignore|invite .+|join .+|kick .+|me .+|msg .+|to .+|notify$|order$|profile$|promote .+|quit|exit|bye|refresh|save|show|last|timestamp$|whois .+)/i;
// Ensure the message box isn't empty if (inputFrameForm.elements['M'].value == '') { inputFrameForm.elements['M'].focus(); return false; } // It looks like a command but's not a valid one -> display error message else if (isCmd && !re.test(inputFrameForm.elements['M'].value)) { inputFrameForm.elements['M'].select(); alert("<?php echo(str_replace("\"","\\\"",L_BAD_CMD)); ?>"); return false; } // It doesn't look like a command -> it's a message, then ensure a message // isn't currently being submitted... else if (!isCmd && inputFrameForm.elements['sent'].value == '1') { inputFrameForm.elements['M'].focus(); return false; } // ... and that the same message hasn't been submitted the last time else if (!isCmd && inputFrameForm.elements['M'].value == inputFrameForm.elements['M0'].value) { inputFrameForm.elements['M'].value = ''; inputFrameForm.elements['M'].focus(); return false; } // All the tests have been succesfully passed -> submit the from else { inputFrameForm.elements['sent'].value = '1'; if (document.all) inputFrameForm.elements['sendForm'].disabled = true; return true; }; } // --> </SCRIPT>
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.