diff --git a/lib/ice-coder.js b/lib/ice-coder.js index 2274013..3032e25 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -1451,143 +1451,6 @@ var ICEcoder = { top.ICEcoder.filesFrame.contentWindow.frames['fileControl'].location.href="plugins/zip-it/index.php?zip="+tgt; }, - tabDragStart: function(tab) { - top.ICEcoder.draggingTab = tab; - top.ICEcoder.diffStartX = top.ICEcoder.mouseX; - top.ICEcoder.tagDragMouseXStart = (top.ICEcoder.mouseX - (parseInt(top.ICEcoder.files.style.width,10)+41+18)) % 150; - top.document.getElementById('tab'+tab).style.zIndex = 2; - for (var i=1; i<=top.ICEcoder.openFiles.length; i++) { - top.document.getElementById('tab'+i).className = i!==tab - ? "tab tabSlide" - : "tab tabDrag"; - } - }, - - // Tab dragging - tabDragMove: function() { - var tabWidth, lastTabWidth; - - lastTabWidth = parseInt(top.document.getElementById('tab'+top.ICEcoder.openFiles.length).style.width,10)+18; - - top.ICEcoder.thisLeft = thisLeft = top.ICEcoder.tabDragMouseX >= 41 - ? top.ICEcoder.tabDragMouseX <= parseInt(top.document.getElementById('newTab').style.left,10) - lastTabWidth - ? top.ICEcoder.tabDragMouseX : (parseInt(top.document.getElementById('newTab').style.left,10) - lastTabWidth) : 41; - - top.document.getElementById('tab'+top.ICEcoder.draggingTab).style.left = thisLeft + "px"; - - top.ICEcoder.dragTabNo = dragTabNo = top.ICEcoder.draggingTab; - for (var i=1; i<=top.ICEcoder.openFiles.length; i++) { - top.document.getElementById('tab'+i).style.opacity = i == top.ICEcoder.draggingTab ? 1 : 0.5; - tabWidth = top.ICEcoder.tabLeftPos[i] ? top.ICEcoder.tabLeftPos[i] - top.ICEcoder.tabLeftPos[i-1] : tabWidth; - if (i!=top.ICEcoder.draggingTab) { - if (i < top.ICEcoder.draggingTab) { - top.document.getElementById('tab'+i).style.left = thisLeft <= top.ICEcoder.tabLeftPos[i-1] - ? top.ICEcoder.tabLeftPos[i-1]+tabWidth - : top.ICEcoder.tabLeftPos[i-1]; - } else { - top.document.getElementById('tab'+i).style.left = thisLeft >= top.ICEcoder.tabLeftPos[i-1] - ? top.ICEcoder.tabLeftPos[i-1]-tabWidth - : top.ICEcoder.tabLeftPos[i-1]; - } - } - } - }, - - // Tab dragging end - tabDragEnd: function() { - var swapWith; - - top.ICEcoder.setTabWidths(); - for (var i=1; i<=top.ICEcoder.openFiles.length; i++) { - if (top.ICEcoder.thisLeft >= top.ICEcoder.tabLeftPos[i-1]) { - swapWith = top.ICEcoder.thisLeft == top.ICEcoder.tabLeftPos[0] ? 1 : top.ICEcoder.dragTabNo > i ? i+1 : i; - } - top.document.getElementById('tab'+i).className = "tab"; - top.document.getElementById('tab'+i).style.opacity = 1; - if (i!=top.ICEcoder.dragTabNo) { - top.document.getElementById('tab'+i).style.zIndex = 1; - } else { - setTimeout(function() { - top.document.getElementById('tab'+i).style.zIndex = 1; - },150); - } - } - if (top.ICEcoder.thisLeft && top.ICEcoder.thisLeft!==false) { - var tempArray = []; - for (var i=1;i<=top.ICEcoder.openFiles.length;i++) { - tempArray.push(i); - } - tempArray.splice(top.ICEcoder.dragTabNo-1,1); - tempArray.splice(swapWith-1,0,top.ICEcoder.dragTabNo); - ICEcoder.sortTabs(tempArray); - } - top.ICEcoder.setTabWidths(); - top.ICEcoder.draggingTab = false; - top.ICEcoder.thisLeft = false; - }, - - // Sort tabs into new order - sortTabs: function(newOrder) { - var changedContent = [], openFiles = [], openFileMDTs = [], cMInstances = []; - - a = [ICEcoder.changedContent, ICEcoder.openFiles, ICEcoder.openFileMDTs, ICEcoder.cMInstances]; - b = [changedContent, openFiles, openFileMDTs, cMInstances]; - for (var i=0;i0) { - nextValue = currentArray[0]; - nextValueFull = currentArrayFull[0]; - nextPos = 0; - for (i=0;i= 41 + ? top.ICEcoder.tabDragMouseX <= parseInt(top.document.getElementById('newTab').style.left,10) - lastTabWidth + ? top.ICEcoder.tabDragMouseX : (parseInt(top.document.getElementById('newTab').style.left,10) - lastTabWidth) : 41; + + top.document.getElementById('tab'+top.ICEcoder.draggingTab).style.left = thisLeft + "px"; + + top.ICEcoder.dragTabNo = dragTabNo = top.ICEcoder.draggingTab; + for (var i=1; i<=top.ICEcoder.openFiles.length; i++) { + top.document.getElementById('tab'+i).style.opacity = i == top.ICEcoder.draggingTab ? 1 : 0.5; + tabWidth = top.ICEcoder.tabLeftPos[i] ? top.ICEcoder.tabLeftPos[i] - top.ICEcoder.tabLeftPos[i-1] : tabWidth; + if (i!=top.ICEcoder.draggingTab) { + if (i < top.ICEcoder.draggingTab) { + top.document.getElementById('tab'+i).style.left = thisLeft <= top.ICEcoder.tabLeftPos[i-1] + ? top.ICEcoder.tabLeftPos[i-1]+tabWidth + : top.ICEcoder.tabLeftPos[i-1]; + } else { + top.document.getElementById('tab'+i).style.left = thisLeft >= top.ICEcoder.tabLeftPos[i-1] + ? top.ICEcoder.tabLeftPos[i-1]-tabWidth + : top.ICEcoder.tabLeftPos[i-1]; + } + } + } + }, + + // Tab dragging end + tabDragEnd: function() { + var swapWith; + + top.ICEcoder.setTabWidths(); + for (var i=1; i<=top.ICEcoder.openFiles.length; i++) { + if (top.ICEcoder.thisLeft >= top.ICEcoder.tabLeftPos[i-1]) { + swapWith = top.ICEcoder.thisLeft == top.ICEcoder.tabLeftPos[0] ? 1 : top.ICEcoder.dragTabNo > i ? i+1 : i; + } + top.document.getElementById('tab'+i).className = "tab"; + top.document.getElementById('tab'+i).style.opacity = 1; + if (i!=top.ICEcoder.dragTabNo) { + top.document.getElementById('tab'+i).style.zIndex = 1; + } else { + setTimeout(function() { + top.document.getElementById('tab'+i).style.zIndex = 1; + },150); + } + } + if (top.ICEcoder.thisLeft && top.ICEcoder.thisLeft!==false) { + var tempArray = []; + for (var i=1;i<=top.ICEcoder.openFiles.length;i++) { + tempArray.push(i); + } + tempArray.splice(top.ICEcoder.dragTabNo-1,1); + tempArray.splice(swapWith-1,0,top.ICEcoder.dragTabNo); + ICEcoder.sortTabs(tempArray); + } + top.ICEcoder.setTabWidths(); + top.ICEcoder.draggingTab = false; + top.ICEcoder.thisLeft = false; + }, + + // Sort tabs into new order + sortTabs: function(newOrder) { + var changedContent = [], openFiles = [], openFileMDTs = [], cMInstances = []; + + a = [ICEcoder.changedContent, ICEcoder.openFiles, ICEcoder.openFileMDTs, ICEcoder.cMInstances]; + b = [changedContent, openFiles, openFileMDTs, cMInstances]; + for (var i=0;i0) { + nextValue = currentArray[0]; + nextValueFull = currentArrayFull[0]; + nextPos = 0; + for (i=0;i