diff options
author | Patrick Simianer <p@simianer.de> | 2016-01-29 18:17:46 +0100 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2016-01-29 18:17:46 +0100 |
commit | 7d35b712d33cca0be3af122ecffbbfa7cbc123b2 (patch) | |
tree | 5d90cb23f0a5514e706bf31ae5b232d011516b3e /js | |
parent | 3a45a4076187de8cac3be1f562fb583ee6724a50 (diff) |
cleanup
Diffstat (limited to 'js')
-rw-r--r-- | js/common.js | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/js/common.js b/js/common.js deleted file mode 100644 index 6ccc8ab..0000000 --- a/js/common.js +++ /dev/null @@ -1,71 +0,0 @@ -/* - * (common) global vars - * - */ -var data, // data (from JSON) - ui_type; // 't' (text) or 'g' (graphical) - -/* - * hacky way to remove class from node - * - */ -function removeClass(node, className) -{ - node.className = - node.className.replace(" "+className,''); - node.className = - node.className.replace(" "+className,''); // ??? - - return false; -} - -/* - * toggle display of element (by id) - * - */ -function toggleDisplay(id) -{ - node = $(id); - if (node.style.display=='none') { - node.fadeIn(); - } else { - node.fadeOut(); - } - - return false; -} - -/* - * trim string - * - */ -function trim(s) -{ - return s.replace(/(\||\n|\t)/g, " ").replace(/^\s+|\s+$/g, '').replace(/\s+/g, " "); -} - -function updateProgress (oEvent) { - //alert(oEvent); -} - -/* - * cross-site request - * - */ -function CreateCORSRequest(method, url) -{ - var xhr = new XMLHttpRequest(); - if ("withCredentials" in xhr) { - xhr.addEventListener("progress", updateProgress); - xhr.open(method, url, true); - xhr.timeout = 999999999999; - xhr.ontimeout = function () { alert("XHR TIMEOUT"); } - xhr.onerror = function () { alert("XHR ERRROR 1"); } - xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=UTF-8'); - } else { - xhr = null; - } - - return xhr; -} - |