diff --git a/lib/ice-coder.js b/lib/ice-coder.js index 75d28db..e7c9e09 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -32,9 +32,11 @@ var ICEcoder = { tabLeftPos: [], // Left position of tabs inside content area tabBGcurrent: '#141414', // BG of current tab tabBGselected: '#49d', // BG of selected tab - tabBGopen: '#888', // BG of open tab + tabBGopen: '#aaa', // BG of open tab tabBGnormal: 'transparent', // BG of normal tab + tabFGcurrent: '#fff', // FG of selected tab tabFGselected: '#fff', // FG of selected tab + tabFGopenFile: '#000', // FG of open file tabFGnormalFile: '#eee', // FG of normal file tabFGnormalTab: '#000', // FG of normal tab serverQueueItems: [], // Array of URLs to call in order @@ -586,7 +588,7 @@ var ICEcoder = { ? top.ICEcoder.tabBGselected : file.style.backgroundColor = isOpen ? top.ICEcoder.tabBGopen : top.ICEcoder.tabBGnormal; } - file.style.color= action=="select" ? top.ICEcoder.tabFGselected : top.ICEcoder.tabFGnormalFile; + file.style.color = action=="select" ? top.ICEcoder.tabFGselected : top.ICEcoder.tabFGnormalFile; } }, @@ -1856,7 +1858,7 @@ var ICEcoder = { // Reset all tabs to be without a highlight and then highlight the selected redoTabHighlight: function(selectedTab) { - var bgVPos, tColor, fileLink; + var tColor, fileLink; for(var i=1;i<=ICEcoder.changedContent.length;i++) { if (document.getElementById('tab'+i).childNodes[0]) { @@ -1866,11 +1868,13 @@ var ICEcoder = { tColor = i==selectedTab ? top.ICEcoder.tabFGselected : top.ICEcoder.tabFGnormalTab; if ("undefined" != typeof top.ICEcoder.openFiles[i-1] && top.ICEcoder.openFiles[i-1] != "/[NEW]") { fileLink = top.ICEcoder.filesFrame.contentWindow.document.getElementById(top.ICEcoder.openFiles[i-1].replace(/\//g,"|")); - if (fileLink) {fileLink.style.backgroundColor = i==selectedTab ? top.ICEcoder.tabBGcurrent : top.ICEcoder.tabBGopen;}; + if (fileLink) { + fileLink.style.backgroundColor = i==selectedTab ? top.ICEcoder.tabBGcurrent : top.ICEcoder.tabBGopen; + fileLink.style.color = i==selectedTab ? top.ICEcoder.tabFGcurrent : top.ICEcoder.tabFGopenFile; + }; } document.getElementById('tab'+i).style.color = tColor; - bgVPos = i==selectedTab ? -22 : 0; - document.getElementById('tab'+i).style.backgroundPosition = "0 "+bgVPos+"px"; + document.getElementById('tab'+i).style.background = i==selectedTab ? top.ICEcoder.tabBGcurrent : top.ICEcoder.tabBGopen; } top.ICEcoder.fMIconVis('fMSave',ICEcoder.changedContent[selectedTab-1]==1 ? 1 : 0.3); }, diff --git a/lib/ice-coder.min.js b/lib/ice-coder.min.js index 13a79be..5d7accf 100644 --- a/lib/ice-coder.min.js +++ b/lib/ice-coder.min.js @@ -1,5 +1,5 @@ -var get=function(a){return top.document.getElementById(a)},ICEcoder={filesW:250,minFilesW:14,maxFilesW:250,selectedTab:0,changedContent:[],canSwitchTabs:!0,openFiles:[],openFileMDTs:[],cMInstances:[],nextcMInstance:1,selectedFiles:[],findMode:!1,lockedNav:!0,htmlTagArray:[],codeAssist:!0,mouseDown:!1,draggingFilesW:!1,draggingTab:!1,tabLeftPos:[],tabBGcurrent:"#141414",tabBGselected:"#49d",tabBGopen:"#888",tabBGnormal:"transparent",tabFGselected:"#fff",tabFGnormalFile:"#eee",tabFGnormalTab:"#000", -serverQueueItems:[],previewWindow:!1,pluginIntervalRefs:[],overPopup:!1,ready:!1,initAliases:function(){for(var a="header files account fmLock filesFrame editor tabsBar findBar content footer system nestValid nestDisplay charDisplay byteDisplay".split(" "),b=0;b '+ c.slice(c.lastIndexOf("/")).replace(/\//,"");top.get("tab"+a).title="/"+top.ICEcoder.openFiles[a-1].replace(/\//,"")},redoTabHighlight:function(a){for(var b,c,d=1;d<=ICEcoder.changedContent.length;d++){document.getElementById("tab"+d).childNodes[0]&&(document.getElementById("tab"+d).childNodes[0].childNodes[0].style.backgroundColor=1==ICEcoder.changedContent[d-1]?"#b00":"transparent");b=d==a?top.ICEcoder.tabFGselected:top.ICEcoder.tabFGnormalTab;if("undefined"!=typeof top.ICEcoder.openFiles[d-1]&& -"/[NEW]"!=top.ICEcoder.openFiles[d-1]&&(c=top.ICEcoder.filesFrame.contentWindow.document.getElementById(top.ICEcoder.openFiles[d-1].replace(/\//g,"|"))))c.style.backgroundColor=d==a?top.ICEcoder.tabBGcurrent:top.ICEcoder.tabBGopen;document.getElementById("tab"+d).style.color=b;b=d==a?-22:0;document.getElementById("tab"+d).style.backgroundPosition="0 "+b+"px"}top.ICEcoder.fMIconVis("fMSave",1==ICEcoder.changedContent[a-1]?1:0.3)},closeTab:function(a,b){var c;ICEcoder.getcMInstance();c=!0;1==ICEcoder.changedContent[a- -1]&&(c=top.ICEcoder.ask("You have made changes.\n\nAre you sure you want to close without saving?"));if(c){c=top.ICEcoder.openFiles[a-1];for(var d=a;db?parseInt(c*g,10)-parseInt(c*(g-1),10):150,e=0==g?41:parseInt(top.get("tab"+g).style.left,10),f=0==g?0:parseInt(top.get("tab"+ -g).style.width,10)+18,a?d=-18:(top.get("tab"+(g+1)).style.left=e+f+"px",top.get("tab"+(g+1)).style.width=d+"px"),top.ICEcoder.tabLeftPos.push(e+f);top.get("newTab").style.left=e+f+d+18+"px"}},tabDragStart:function(a){top.ICEcoder.draggingTab=a;top.ICEcoder.diffStartX=top.ICEcoder.mouseX;top.ICEcoder.tabDragMouseXStart=(top.ICEcoder.mouseX-(parseInt(top.ICEcoder.files.style.width,10)+41+18))%150;top.get("tab"+a).style.zIndex=2;for(var b=1;b<=top.ICEcoder.openFiles.length;b++)top.get("tab"+b).className= -b!==a?"tab tabSlide":"tab tabDrag"},tabDragMove:function(){var a,b;a=parseInt(top.get("tab"+top.ICEcoder.openFiles.length).style.width,10)+18;top.ICEcoder.thisLeft=a=41<=top.ICEcoder.tabDragMouseX?top.ICEcoder.tabDragMouseX<=parseInt(top.get("newTab").style.left,10)-a?top.ICEcoder.tabDragMouseX:parseInt(top.get("newTab").style.left,10)-a:41;top.get("tab"+top.ICEcoder.draggingTab).style.left=a+"px";top.ICEcoder.dragTabNo=top.ICEcoder.draggingTab;for(var c=1;c<=top.ICEcoder.openFiles.length;c++)top.get("tab"+ -c).style.opacity=c==top.ICEcoder.draggingTab?1:0.5,b=top.ICEcoder.tabLeftPos[c]?top.ICEcoder.tabLeftPos[c]-top.ICEcoder.tabLeftPos[c-1]:b,c!=top.ICEcoder.draggingTab&&(c=top.ICEcoder.tabLeftPos[c-1]?top.ICEcoder.tabLeftPos[c-1]-b:top.ICEcoder.tabLeftPos[c-1])},tabDragEnd:function(){var a,b;top.ICEcoder.setTabWidths();for(var c= -1;c<=top.ICEcoder.openFiles.length;c++)top.ICEcoder.thisLeft>=top.ICEcoder.tabLeftPos[c-1]&&(a=top.ICEcoder.thisLeft==top.ICEcoder.tabLeftPos[0]?1:top.ICEcoder.dragTabNo>c?c+1:c),top.get("tab"+c).className="tab",top.get("tab"+c).style.opacity=1,c!=top.ICEcoder.dragTabNo?top.get("tab"+c).style.zIndex=1:setTimeout(function(){top.get("tab"+c).style.zIndex=1},150);if(top.ICEcoder.thisLeft&&!1!==top.ICEcoder.thisLeft){b=[];for(c=1;c<=top.ICEcoder.openFiles.length;c++)b.push(c);b.splice(top.ICEcoder.dragTabNo- -1,1);b.splice(a-1,0,top.ICEcoder.dragTabNo);ICEcoder.sortTabs(b)}top.ICEcoder.setTabWidths();top.ICEcoder.draggingTab=!1;top.ICEcoder.thisLeft=!1},sortTabs:function(a){var b,c,d;b=[ICEcoder.changedContent,ICEcoder.openFiles,ICEcoder.openFileMDTs,ICEcoder.cMInstances];c=[[],[],[],[]];for(var e=0;eb?parseInt(c*g,10)-parseInt(c*(g-1),10):150,e=0==g?41:parseInt(top.get("tab"+g).style.left,10),f=0==g?0:parseInt(top.get("tab"+g).style.width,10)+18,a?d=-18:(top.get("tab"+(g+1)).style.left=e+f+"px",top.get("tab"+(g+1)).style.width=d+"px"),top.ICEcoder.tabLeftPos.push(e+f);top.get("newTab").style.left=e+f+d+18+"px"}},tabDragStart:function(a){top.ICEcoder.draggingTab=a;top.ICEcoder.diffStartX=top.ICEcoder.mouseX;top.ICEcoder.tabDragMouseXStart=(top.ICEcoder.mouseX- +(parseInt(top.ICEcoder.files.style.width,10)+41+18))%150;top.get("tab"+a).style.zIndex=2;for(var b=1;b<=top.ICEcoder.openFiles.length;b++)top.get("tab"+b).className=b!==a?"tab tabSlide":"tab tabDrag"},tabDragMove:function(){var a,b;a=parseInt(top.get("tab"+top.ICEcoder.openFiles.length).style.width,10)+18;top.ICEcoder.thisLeft=a=41<=top.ICEcoder.tabDragMouseX?top.ICEcoder.tabDragMouseX<=parseInt(top.get("newTab").style.left,10)-a?top.ICEcoder.tabDragMouseX:parseInt(top.get("newTab").style.left,10)- +a:41;top.get("tab"+top.ICEcoder.draggingTab).style.left=a+"px";top.ICEcoder.dragTabNo=top.ICEcoder.draggingTab;for(var c=1;c<=top.ICEcoder.openFiles.length;c++)top.get("tab"+c).style.opacity=c==top.ICEcoder.draggingTab?1:0.5,b=top.ICEcoder.tabLeftPos[c]?top.ICEcoder.tabLeftPos[c]-top.ICEcoder.tabLeftPos[c-1]:b,c!=top.ICEcoder.draggingTab&&(c=top.ICEcoder.tabLeftPos[c-1]?top.ICEcoder.tabLeftPos[c-1]-b:top.ICEcoder.tabLeftPos[c-1])},tabDragEnd:function(){var a,b;top.ICEcoder.setTabWidths();for(var c=1;c<=top.ICEcoder.openFiles.length;c++)top.ICEcoder.thisLeft>=top.ICEcoder.tabLeftPos[c-1]&&(a=top.ICEcoder.thisLeft==top.ICEcoder.tabLeftPos[0]?1:top.ICEcoder.dragTabNo>c?c+1:c),top.get("tab"+c).className="tab",top.get("tab"+c).style.opacity=1,c!=top.ICEcoder.dragTabNo?top.get("tab"+c).style.zIndex=1:setTimeout(function(){top.get("tab"+ +c).style.zIndex=1},150);if(top.ICEcoder.thisLeft&&!1!==top.ICEcoder.thisLeft){b=[];for(c=1;c<=top.ICEcoder.openFiles.length;c++)b.push(c);b.splice(top.ICEcoder.dragTabNo-1,1);b.splice(a-1,0,top.ICEcoder.dragTabNo);ICEcoder.sortTabs(b)}top.ICEcoder.setTabWidths();top.ICEcoder.draggingTab=!1;top.ICEcoder.thisLeft=!1},sortTabs:function(a){var b,c,d;b=[ICEcoder.changedContent,ICEcoder.openFiles,ICEcoder.openFileMDTs,ICEcoder.cMInstances];c=[[],[],[],[]];for(var e=0;e