Files
survey-manager/survey-nginx/cgi-bin/js/global.js
2024-07-19 10:05:36 +00:00

42 lines
913 B
JavaScript
Executable File

<SCRIPT language="JavaScript">
<!--
// $Id: global.js,v 1.2 2005/04/27 23:57:35 ddoughty Exp $
function right(event) {
if ("<%=SYSTEM.blockrightclick%>" == 0) {
return true;
}
if ("<%=SESSION.uac%>" == "gadmin") {
return true;
}
alert("<%=PHRASE.473%>");
return false;
}
// This function captures the keys pressed one at a time
// We disallow some characters because they are used as delimiters in
// the text data files. This can be removed when we move to an RDBMS
// or change the delimiters.
function checkKeys(e) {
var kc;
if (!e) {
e=event;
kc=e.keyCode;
} else {
kc=e.which;
}
// Disallowed characters: '&', ';'
if (kc == 38 || kc == 59 ) {
alert("'" + String.fromCharCode(kc) + "' <%=PHRASE.579%>");
return false;
}
return true;
}
document.oncontextmenu=right;
document.onkeypress=checkKeys;
//-->
</SCRIPT>