183 lines
4.8 KiB
JavaScript
183 lines
4.8 KiB
JavaScript
|
|
<script language="JavaScript1.2" type="text/javascript">
|
|
<!--
|
|
// General functionality for all browsers in this section
|
|
|
|
// Status of the event to be checked
|
|
var keyDownEventEnabled = true;
|
|
|
|
var Netscape = new Boolean();
|
|
Netscape = false;
|
|
if (navigator.appName == "Netscape") Netscape = true;
|
|
|
|
// Status informations
|
|
// document.write(navigator.appName + "<br>" + navigator.appVersion + "<br>" + navigator.appCodeName + "<br><br><br>");
|
|
|
|
|
|
function disableEvent(e) {
|
|
|
|
if (!e) var e = window.event;
|
|
e.cancelBubble = true;
|
|
if (e.stopPropagation) e.stopPropagation();
|
|
|
|
if (e.preventDefault) {
|
|
if (e.cancelable) e.preventDefault();
|
|
} else {
|
|
e.keyCode = 0;
|
|
e.returnValue = 0;
|
|
// e.cancelBubble = true;
|
|
}
|
|
keyDownEventEnabled = false;
|
|
}
|
|
|
|
//-->
|
|
</script>
|
|
|
|
|
|
<script language="JavaScript1.2" type="text/javascript">
|
|
<!--
|
|
function eventKeyUpPressed(e) {
|
|
if (e.altKey) {
|
|
keyDownEventEnabled = true;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
function eventKeyPressed(e) {
|
|
window.status = "Taste mit Dezimalwert " + e.which + " ALT: " + e.altKey;
|
|
if (Netscape) {
|
|
|
|
// Verwaltung
|
|
if (keyDownEventEnabled && e.altKey && e.which == 49) { // "alt-1"
|
|
disableEvent(e);
|
|
top.location.href = "../admin/menu_fs.php?navigationLevel=2&navigationPoint=verwaltung";
|
|
}
|
|
// Auftragserfassung
|
|
if (keyDownEventEnabled && e.altKey && e.which == 50) { // "alt-2"
|
|
disableEvent(e);
|
|
|
|
if (top.openedWindows[1] == "") {
|
|
top.openedWindows[1] == "job_edit";
|
|
window.open("../jobs/job_edit.php","job_edit");
|
|
} else {
|
|
eval(top.openedWindows[1]).focus();
|
|
}
|
|
}
|
|
// Auftragslisten
|
|
if (keyDownEventEnabled && e.altKey && e.which == 51) { // "alt-3"
|
|
disableEvent(e);
|
|
top.menu.location.href = "../admin/menu.php";
|
|
top.maincontent.location.href = "../admin/jb_list.php";
|
|
}
|
|
}
|
|
|
|
if (false && Netscape) {
|
|
|
|
if (e.type == "keypress") {
|
|
|
|
// if (e.cancelable) e.preventDefault();
|
|
// e.stopPropagation();
|
|
|
|
if (e.shiftKey) shiftKeyIsPressed = true;
|
|
if (e.ctrlKey) controlKeyIsPressed = true;
|
|
if (e.altKey) altKeyIsPressed = true;
|
|
}
|
|
|
|
if (e.type == "keyup") {
|
|
|
|
// if (e.cancelable) e.preventDefault();
|
|
// e.stopPropagation();
|
|
|
|
if (e.shiftKey) shiftKeyIsPressed = false;
|
|
if (e.ctrlKey) controlKeyIsPressed = false;
|
|
if (e.altKey) altKeyIsPressed = false;
|
|
}
|
|
|
|
if (e.type == "keydown") {
|
|
|
|
window.status = "Taste mit Dezimalwert " + e.which + " gedrueckt";
|
|
|
|
if (shiftKeyCheck && shiftKeyIsPressed) {
|
|
handleEvent(e,"SHIFT",e.which);
|
|
shiftKeyIsPressed = false;
|
|
}
|
|
|
|
if (controlKeyCheck && controlKeyIsPressed) {
|
|
handleEvent(e,"CTRL",e.which);
|
|
controlKeyIsPressed = false;
|
|
}
|
|
|
|
if (altKeyCheck && altKeyIsPressed) {
|
|
handleEvent(e,"ALT",e.which);
|
|
altKeyIsPressed = false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}; // if
|
|
}; // function
|
|
|
|
|
|
if (Netscape) {
|
|
document.addEventListener("keydown", eventKeyPressed, true);
|
|
document.addEventListener("keyup", eventKeyUpPressed, true);
|
|
document.addEventListener("keypress", eventKeyPressed, true);
|
|
}
|
|
|
|
// Event call
|
|
// document.onkeydown = eventKeyPressed;
|
|
// document.onkeyup = eventKeyPressed;
|
|
// document.onkeypress = eventKeyPressed;
|
|
|
|
// Get the string from the keyCode-number
|
|
// String.fromCharCode(keyCode)
|
|
|
|
// http://webfx.eae.net/dhtml/ieemu/eventobject.html
|
|
// Event.prototype.__defineSetter__("returnValue", function (b) {
|
|
// if (!b) this.preventDefault();
|
|
// );
|
|
|
|
// http://www.javascriptkit.com/jsref/event.shtml
|
|
// Gegenüberstellung von Events IE und Netscape
|
|
|
|
// Disable help on F1
|
|
// document.onhelp = function() { return false; }
|
|
|
|
// http://www.javascriptkit.com/jsref/event.shtml
|
|
// http://www.quirksmode.org/js/events_early.html
|
|
// http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/objects/obj_event.asp
|
|
// http://www.irish-wolfhound-keno.de/uber_template.php
|
|
|
|
//-->
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<!-- JScript-Bereiche fuer MS Internet Explorer -->
|
|
<script for="document" event="onkeydown()" language="JScript" type="text/jscript">
|
|
<!--
|
|
{
|
|
if (window.event.ctrlKey && window.event.altKey) {
|
|
alert("CTRL-ALT");
|
|
}
|
|
|
|
if (window.event.altKey && event.keyCode == 49) { // "alt-1"
|
|
disableEvent(window.event);
|
|
top.location.href = "../admin/menu_fs.php?navigationLevel=2&navigationPoint=verwaltung";
|
|
}
|
|
if (window.event.altKey && event.keyCode == 50) { // "alt-2"
|
|
disableEvent(window.event);
|
|
window.open("../jobs/job_edit.php","_blank");
|
|
}
|
|
if (window.event.altKey && event.keyCode == 51) { // "alt-3"
|
|
disableEvent(window.event);
|
|
top.menu.location.href = "../admin/menu.php";
|
|
top.maincontent.location.href = "../admin/jb_list.php";
|
|
}
|
|
}
|
|
//-->
|
|
</script>
|
|
|