From 85d4bfa04ce28b5ec3eb0054306c43bc59c55128 Mon Sep 17 00:00:00 2001 From: anbr Date: Sat, 8 Oct 2011 07:43:51 +0200 Subject: Merge skins into common directory --- skins/html/javascript/XHConn.js | 41 +++ skins/html/javascript/global.js | 173 +++++++++++++ skins/html/javascript/helptip.js | 240 +++++++++++++++++ skins/html/javascript/records.js | 26 ++ skins/html/javascript/tabpane.js | 368 ++++++++++++++++++++++++++ skins/html/javascript/tooltip.js | 210 +++++++++++++++ skins/html/javascript/xtree.js | 541 +++++++++++++++++++++++++++++++++++++++ 7 files changed, 1599 insertions(+) create mode 100644 skins/html/javascript/XHConn.js create mode 100644 skins/html/javascript/global.js create mode 100644 skins/html/javascript/helptip.js create mode 100644 skins/html/javascript/records.js create mode 100644 skins/html/javascript/tabpane.js create mode 100644 skins/html/javascript/tooltip.js create mode 100644 skins/html/javascript/xtree.js (limited to 'skins/html/javascript') diff --git a/skins/html/javascript/XHConn.js b/skins/html/javascript/XHConn.js new file mode 100644 index 0000000..537b555 --- /dev/null +++ b/skins/html/javascript/XHConn.js @@ -0,0 +1,41 @@ +/** XHRequest based on ** + ** XHConn - Simple XMLHTTP Interface - bfults@gmail.com - 2005-04-08 ** + ** Code licensed under Creative Commons Attribution-ShareAlike License ** + ** http://creativecommons.org/licenses/by-sa/2.0/ **/ + +function XHRequest() +{ + var xmlhttp, bComplete = false; + try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } + catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } + catch (e) { try { xmlhttp = new XMLHttpRequest(); } + catch (e) { xmlhttp = false; }}} + if (!xmlhttp) + return null; + + this.connect = function(sRequest, fnDone, sData) + { + if (!xmlhttp) return false; + bComplete = false; + + try { + xmlhttp.open("GET", sRequest, true); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && !bComplete) + { + bComplete = true; + fnDone(xmlhttp, sData); + } + }; + xmlhttp.send(null); + } catch(z) { alert(z); return false; } + return true; + }; + return this; +} + +var ajaxconn = new XHRequest(); + +if (!ajaxconn) + alert("XMLHTTP not available. Try a newer/better browser."); diff --git a/skins/html/javascript/global.js b/skins/html/javascript/global.js new file mode 100644 index 0000000..8572445 --- /dev/null +++ b/skins/html/javascript/global.js @@ -0,0 +1,173 @@ +// To status frame und dann refresh der seite +function tostatus(url) { + myoldurl = location.href; + location.href = url; +} + +// Redirect +function redirect(url, wait, par) { + if(! wait) { + wait = 0.1; + } + if(par) { + window.setTimeout(par + '.location.href = "' + url + '"', wait * 1000); + } else { + window.setTimeout('location.href = "' + url + '"', wait * 1000); + } +} + +// Program choose +function di(wert, url) { + location.href = url + wert; +} + +// Question bevor delete +function sure(form, text, url, id) { + id = (id) ? id : ''; + var erg = confirm(text); + var refe = encodeURIComponent(form.referer.value); + if(erg == true) { + var callurl = url + id + '&referer=' + refe; + location.href = callurl; + } +} + +function Delete(question,warn,cmd,form) { +// test on checked Boxes + ok = new Array; + txt = new Array; + x = 0; + for(var i=0;i 0) { + if(confirm(question + '\n' + txt.join("\n"))) { + tostatus('?cmd=' + cmd + '&data=' + ok.join('_')); + } + } else { + alert(warn); + } +} + +function Toggle(warn,form) { +// test on checked Boxes + ok = new Array; + txt = new Array; + x = 0; + for(var i=0;i 0) { + tostatus('?cmd=ttoggle&data=' + ok.join('_')); + } else { + alert(warn); + } +} + +function selAll(form, type) { +// check all Boxes + for(var i=0;i 0) { + var url = '?cmd=mplaylist&data=' + ok.join('_'); + location.href = url; + } else { + alert(warnmsg); + } +} + +/* -------------------- Widget Routines --------------- */ + +/* +- An AjaxCall to check for right values in HTML Widget +checkValue(inputObject, msgId, perlCall, wrongMessage, goodMessage); +checkValue(this, 'id', 'getip', 'host: %s is not exists!', 'ip address is %s') +*/ +function checkValue (valobj, msgname, cmd, wrongMsg, goodMsg) { + + var fnWhenDone = function (oXML, sData) { + var val = sData[0]; + var msg = sData[1]; + var wrongMsg = sData[2]; + var goodMsg = sData[3]; + + var o = eval("("+oXML.responseText+")"); + if(o && o.data && typeof(o.data) == 'string' + && o.success && o.success == true) { + msg.className = 'good'; + msg.innerHTML = goodMsg.replace('%s', o.data); + } else { + msg.className = 'error'; + msg.innerHTML = wrongMsg.replace('%s', o.data); + } + }; + + var inputvalue = valobj.value; + var msgobj = document.getElementById(msgname); + msgobj.innerHTML = 'Check value ...'; + + if(inputvalue) { + var url = "?cmd=checkvalue&data=" + cmd + ":" + inputvalue + "&ajax=json"; + var aconn = new XHRequest(); + if(!aconn) + return false; + return aconn.connect(url, fnWhenDone, [valobj, msgobj, wrongMsg, goodMsg]); + } +} diff --git a/skins/html/javascript/helptip.js b/skins/html/javascript/helptip.js new file mode 100644 index 0000000..6c129d4 --- /dev/null +++ b/skins/html/javascript/helptip.js @@ -0,0 +1,240 @@ +/*----------------------------------------------------------------------------\ +| Help Tip 1.12 | +|-----------------------------------------------------------------------------| +| Created by Erik Arvidsson | +| (http://webfx.eae.net/contact.html#erik) | +| For WebFX (http://webfx.eae.net/) | +|-----------------------------------------------------------------------------| +| A tool tip like script that can be used for context help | +|-----------------------------------------------------------------------------| +| Copyright (c) 1999 - 2002 Erik Arvidsson | +|-----------------------------------------------------------------------------| +| This software is provided "as is", without warranty of any kind, express or | +| implied, including but not limited to the warranties of merchantability, | +| fitness for a particular purpose and noninfringement. In no event shall the | +| authors or copyright holders be liable for any claim, damages or other | +| liability, whether in an action of contract, tort or otherwise, arising | +| from, out of or in connection with the software or the use or other | +| dealings in the software. | +| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | +| This software is available under the three different licenses mentioned | +| below. To use this software you must chose, and qualify, for one of those. | +| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | +| The WebFX Non-Commercial License http://webfx.eae.net/license.html | +| Permits anyone the right to use the software in a non-commercial context | +| free of charge. | +| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | +| The WebFX Commercial license http://webfx.eae.net/commercial.html | +| Permits the license holder the right to use the software in a commercial | +| context. Such license must be specifically obtained, however it's valid for | +| any number of implementations of the licensed software. | +| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | +| GPL - The GNU General Public License http://www.gnu.org/licenses/gpl.txt | +| Permits anyone the right to use and modify the software without limitations | +| as long as proper credits are given and the original and modified source | +| code are included. Requires that the final product, software derivate from | +| the original source or any software utilizing a GPL component, such as | +| this, is also licensed under the GPL license. | +|-----------------------------------------------------------------------------| +| 2002-09-27 | | +| 2001-11-25 | Added a resize to the tooltip if the document width is too | +| | small. | +| 2002-05-19 | IE50 did not recognise the JS keyword undefined so the test | +| | for scroll support was updated to be IE50 friendly. | +| 2002-07-06 | Added flag to hide selects for IE | +| 2002-10-04 | (1.1) Restructured and made code more IE garbage collector | +| | friendly. This solved the most nasty memory leaks. Also added | +| | support for hiding the tooltip if ESC is pressed. | +| 2002-10-18 | Fixed verrical position in case of scrolled document. | +| 2002-12-02 | Mozilla bug workaround related to mousedown and move. | +|-----------------------------------------------------------------------------| +| Dependencies: helptip.css (To set up the CSS of the help-tooltip class) | +|-----------------------------------------------------------------------------| +| Usage: | +| | +|