var LastClick; document.onselectstart = function() { return false; } var aTitle; var aWidth; var aHeight; function initSizes(titles, w, h) { aTitle = titles.split(','); aWidth = w.split(','); aHeight = h.split(','); } function showShortcuts(appTitles, appUrls, appImgs, appTop, appLeft, appType, appName) { var aTitle = appTitles.split(','); var aUrl = appUrls.split(','); var aImg = appImgs.split(','); var aTop = appTop.split(','); var aLeft = appLeft.split(','); var aType = appType.split(','); var aName = appName.split(','); for(i=0;i 500) { mouseUp(this.id,e); } else { mObj = document.getElementById(this.id); if(mObj.tagName == "IMG" || mObj.tagName == "SPAN") { mObj = mObj.parentNode; } source = mObj.src; mObj.onmousemove = ""; for(i = 0; i < mObj.childNodes.length; i++) { if(mObj.childNodes[i].tagName == "SPAN") { Title = mObj.childNodes[i].innerHTML; } } openX(Title,source); } } mocuob = null; } } function mousedown(e) { if (!e) var e = window.event; var source = (e.target) ? e.target : e.srcElement; if(e.button != 2) { LastClick = new Date().getTime(); //return false; if (!e) var e = window.event; var source = (e.target) ? e.target : e.srcElement; if(source.tagName == "SPAN") { source = source.parentNode; } source.onmousemove = mouseDrag; } else { if (!e) var e = window.event; var source = (e.target) ? e.target : e.srcElement; if(source.tagName == "SPAN") { source = source.parentNode; } createContext(false, source.id ,e.clientX, e.clientY); } mocuob = source; } function createContext(add, url,x,y) { if(!document.getElementById('context')) { ul = document.createElement('ul'); } else { removeAllChilds(ul); } li = document.createElement('li'); a = document.createElement('a'); if(add == true) { a.href = "javascript:openShort('"+titleAdd+"','"+url+"','"+y+"','"+x+"');"; a.innerHTML = titleAdd; } else { a.href = "javascript:remShort('"+url+"');"; a.innerHTML = titleRem; } li.appendChild(a); ul.appendChild(li); li2 = document.createElement('li'); a2 = document.createElement('a'); a2.innerHTML = titlePref; a2.href="javascript:openX('"+titlePref+"','"+url_pref+"');"; li2.appendChild(a2); ul.appendChild(li2); li3 = document.createElement('li'); a3 = document.createElement('a'); a3.innerHTML = titleAbout; a3.href="javascript:openX('"+titleAbout+"','about.php');"; li3.appendChild(a3); ul.appendChild(li3); ul.id = "context"; ul.style.display = "block"; document.body.appendChild(ul); createPos(ul, x, y); } var hitTop; var hitLeft; function openShort(title, url, top, left) { hitTop = top; hitLeft = left; //openX(title,url); if(document.getElementById('context')) { document.getElementById('context').style.display = "none"; } if(document.getElementById('launchmenu')) { document.getElementById('launchmenu').style.display = "none"; } xDT.addWindow('short', title, 320, 200, 'center', 'IDOTS2'); xDT.url('short', url); xDT.show('short'); correctPNG(); } function remShort(id) { mObj = document.getElementById(id); if (mObj.tagName == "SPAN") { id = mObj.parentNode.id; } strXmlRemUrl2 = strXmlUrl + "remove_shortcut.php?id="; strXmlRemUrl2 = strXmlRemUrl2 + id; if (window.XMLHttpRequest) { req = new XMLHttpRequest(); req.open("GET", strXmlRemUrl2, true); req.send(null); } else { if (window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP"); if (req) { req.open("GET", strXmlRemUrl2, true); req.send(); } } } shortcut = document.getElementById(id); shortcut.parentNode.removeChild(shortcut); con = document.getElementById("context"); con.parentNode.removeChild(con); } function mouseDrag(e) { if (!e) var e = window.event; var source = (e.target) ? e.target : e.srcElement; if(source.tagName == "SPAN" || source.tagName == "span") { source = source.parentNode; } if(mocuob == source) { if( e.clientY > ((source.clientHeight / 2) + 5) && e.clientY < getWindowHeight()-((source.clientHeight / 2)+35) ) { source.style.top = e.clientY - (source.clientHeight / 2) + "px"; } if(e.clientX > ((source.clientWidth /2) + 5) && e.clientX < getWindowWidth()- (source.clientWidth /2)) { source.style.left = e.clientX - (source.clientWidth /2) + "px"; } LastClick = 0; } } function mouseUp(id,e) { mObj = document.getElementById(id); y = e.clientY + mObj.clientHeight; x = e.clientX + mObj.clientWidth; y2 = findPosY(mObj); x2 = findPosX(mObj); mObj.onmousemove = ""; strXmlUrl2 = strXmlUrl + "/write_settings.php?action=shortcut_sets&id=" + id + "&top=" + y2 + "&left=" + x2; createPos(mObj, x2,y2); if (window.XMLHttpRequest) { req = new XMLHttpRequest(); req.open("GET", strXmlUrl2, true); req.send(null); // req.onreadystatechange = test9; } else { if (window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP"); if (req) { req.open("GET", strXmlUrl2, true); req.send(); } } } } document.oncontextmenu = function(e) { if (!e) var e = window.event; var source = (e.target) ? e.target : e.srcElement; if(source.nodeName =="SPAN"|| source.nodeName == "span") { source = source.parentNode; } if(document.getElementById('context') && source.className !="shortcut") { ul.style.display = "none"; } if(source.id != "launch") { document.getElementById('launchmenu').style.display = "none"; } if (source.className != "shortcut" && source.parentNode.className != "shortcut") { createContext(true, strXmlUrl + "/add_shortcut.php",e.clientY); } e.cancelBubble = true; if(e.stopPropagation) { e.stopPropagation(); } return false; }