Tabs contain only filename

No longer show path as well
(This is now shown on hover)
This commit is contained in:
Matt Pass
2012-12-27 13:37:05 +00:00
parent ca35084160
commit 5887a9c755

View File

@@ -552,7 +552,7 @@ var ICEcoder = {
// Prompt a rename dialog on demand
renameFile: function(oldName,newName) {
var shortURL;
var shortURL, fileName;
if (!oldName) {
shortURL = top.ICEcoder.rightClickedFile.replace(/\|/g,"/");
@@ -568,7 +568,8 @@ var ICEcoder = {
// rename array item and the tab
top.ICEcoder.openFiles[i] = newName;
closeTabLink = '<a nohref onClick="top.ICEcoder.files.contentWindow.closeTab('+(i+1)+')"><img src="images/nav-close.gif" id="closeTabButton'+(i+1)+'" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'" onMouseOut="this.style.backgroundColor=prevBG"></a>';
top.document.getElementById('tab'+(i+1)).innerHTML = closeTabLink + " " + top.ICEcoder.openFiles[i].replace(/\//,"") + "/";
fileName = top.ICEcoder.openFiles[i];
top.document.getElementById('tab'+(i+1)).innerHTML = closeTabLink + " " + fileName.slice(fileName.lastIndexOf("/")).replace(/\//,"");
}
top.ICEcoder.serverQueue("add","lib/file-control.php?action=rename&file="+newName+"&oldFileName="+oldName.replace(/\|/g,"/"));
top.ICEcoder.serverMessage('<b>Renaming to</b><br>'+newName);
@@ -1560,7 +1561,7 @@ var ICEcoder = {
// Create a new tab for a file
createNewTab: function() {
var closeTabLink;
var closeTabLink, fileName;
// Push new file into array
top.ICEcoder.openFiles.push(top.ICEcoder.shortURL);
@@ -1568,7 +1569,8 @@ var ICEcoder = {
// Setup a new tab
closeTabLink = '<a nohref onClick="top.ICEcoder.closeTab('+(top.ICEcoder.openFiles.length)+')"><img src="images/nav-close.gif" id="closeTabButton'+(top.ICEcoder.openFiles.length)+'" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'" onMouseOut="this.style.backgroundColor=prevBG"></a>';
top.document.getElementById('tab'+(top.ICEcoder.openFiles.length)).style.display = "inline-block";
top.document.getElementById('tab'+(top.ICEcoder.openFiles.length)).innerHTML = closeTabLink + " " + top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1].replace(/\//,"") + "/";
fileName = top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1];
top.document.getElementById('tab'+(top.ICEcoder.openFiles.length)).innerHTML = closeTabLink + " " + fileName.slice(fileName.lastIndexOf("/")).replace(/\//,"");
top.document.getElementById('tab'+(top.ICEcoder.openFiles.length)).title = top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1].replace(/\//,"") + "/";
// Set the widths
@@ -1602,14 +1604,15 @@ var ICEcoder = {
// Create a new tab for a file
renameTab: function(tabNum,newName) {
var closeTabLink;
var closeTabLink, fileName;
// Push new file into array
top.ICEcoder.openFiles[tabNum-1] = newName;
// Setup a new tab
closeTabLink = '<a nohref onClick="parent.ICEcoder.closeTab('+tabNum+')"><img src="images/nav-close.gif" id="closeTabButton'+tabNum+'" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'" onMouseOut="this.style.backgroundColor=prevBG"></a>';
top.document.getElementById('tab'+tabNum).innerHTML = closeTabLink + " " + top.ICEcoder.openFiles[tabNum-1].replace(/\//,"") + "/";
fileName = top.ICEcoder.openFiles[tabNum-1];
top.document.getElementById('tab'+tabNum).innerHTML = closeTabLink + " " + fileName.slice(fileName.lastIndexOf("/")).replace(/\//,"");
top.document.getElementById('tab'+tabNum).title = top.ICEcoder.openFiles[tabNum-1].replace(/\//,"") + "/";
},