From 7e671ae37f6c951d4db18c446eed52685200b2e0 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 11 Sep 2008 16:47:45 +0200 Subject: rename swat => swat2, so that we don't conflict with samba3 metze (This used to be commit bf852a3dbeee8900fa36978f08a5cdceabcbd926) --- swat2/scripting/client/call.js | 118 ++++++++++++++++++++++++++ swat2/scripting/client/desktop.js | 121 ++++++++++++++++++++++++++ swat2/scripting/client/encoder.js | 84 ++++++++++++++++++ swat2/scripting/client/js_scripts.js | 60 +++++++++++++ swat2/scripting/client/regedit.js | 160 +++++++++++++++++++++++++++++++++++ swat2/scripting/client/status.js | 40 +++++++++ 6 files changed, 583 insertions(+) create mode 100644 swat2/scripting/client/call.js create mode 100644 swat2/scripting/client/desktop.js create mode 100644 swat2/scripting/client/encoder.js create mode 100644 swat2/scripting/client/js_scripts.js create mode 100644 swat2/scripting/client/regedit.js create mode 100644 swat2/scripting/client/status.js (limited to 'swat2/scripting/client') diff --git a/swat2/scripting/client/call.js b/swat2/scripting/client/call.js new file mode 100644 index 0000000000..316dec5bb1 --- /dev/null +++ b/swat2/scripting/client/call.js @@ -0,0 +1,118 @@ +/* + client side js functions for remote calls into the server + + Copyright Andrew Tridgell 2005 + released under the GNU GPL Version 3 or later +*/ + +var __call = new Object(); + +/* + we can't use the qooxdoo portability layer for this, as it assumes + you are using an XML transport, so instead replicate the portability + code for remote calls here. Don't look too closely or you will go + blind. +*/ +__call._activex = window.ActiveXObject && !(new QxClient).isOpera() ? true : false; +__call._activexobj = null; +__call._ok = QxXmlHttpLoader._http || QxXmlHttpLoader._activex; + +if (__call._activex) { + var servers = ["MSXML2", "Microsoft", "MSXML", "MSXML3"]; + for (var i=0; i -1) { + return true; + } else { + return false; + } + } +} + +function __get_js_script(file) +{ + var i; + for (i=0; i -1) { + return scripts[i]; + } + } +} + +function __add_js_script(path) +{ + // Create a unique ID for this script + var srcID = new Date().getTime(); + + var script = document.createElement('script'); + script.type = 'text/javascript'; + script.id = srcID; + + head.appendChild(script); + + // IE works only with the path set after appending to the document + document.getElementById(srcID).src = path; +} + +function __remove_js_script(path) +{ + var script = __get_js_script(path); + script.parentNode.removeChild(script); +} + +document.js = new Object(); +document.js.scripts = scripts; +document.js.hasScript = __has_js_script; +document.js.getScript = __get_js_script; +document.js.add = __add_js_script; +document.js.remove = __remove_js_script; + diff --git a/swat2/scripting/client/regedit.js b/swat2/scripting/client/regedit.js new file mode 100644 index 0000000000..555ba9fb90 --- /dev/null +++ b/swat2/scripting/client/regedit.js @@ -0,0 +1,160 @@ +/* + client side js functions for registry editing + + Copyright Andrew Tridgell 2005 + released under the GNU GPL Version 3 or later +*/ + + +/* + callback from the key enumeration call +*/ +function __folder_keys(fParent, list) +{ + var i; + if (fParent.working == 1) { + fParent.working = 0; + fParent.removeAll(); + } + for (i=0;i