From 5ad36122d51d325d82a05472f624ef8a585fa2be Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Mon, 12 Mar 2012 17:48:05 +0000 Subject: [PATCH] Lock icon moves with FM width change, setting serverMessages File Manager lock now moves as the width changes (via setLayout) serverMessages block now displays message when creating, saving, deleting, loading and renaming Function to handle display of server messages incl fade in/out --- lib/coder.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/lib/coder.js b/lib/coder.js index 7ff4093..48aab61 100644 --- a/lib/coder.js +++ b/lib/coder.js @@ -30,7 +30,7 @@ var ICEcoder = { // On load, set aliases, set the layout and get the nest location init: function() { - var aliasArray = ["header","files","account","filesFrame","editor","tabsBar","findBar","content","footer","nestValid","nestDisplay","charDisplay"]; + var aliasArray = ["header","files","account","fmLock","filesFrame","editor","tabsBar","findBar","content","footer","nestValid","nestDisplay","charDisplay"]; ICEcoder.tD = top.document; // Create our ID aliases @@ -63,6 +63,7 @@ var ICEcoder = { header.style.width = tabsBar.style.width = findBar.style.width = winW + "px"; files.style.width = editor.style.left = this.filesW + "px"; account.style.height = accountH + "px"; + fmLock.style.marginLeft = (this.filesW-27) + "px"; filesFrame.style.height = (winH-headerH-accountH-footerH) + "px"; if (!dontSetEditor) { @@ -655,6 +656,7 @@ var ICEcoder = { if (newFolder) { newFolder = shortURL + "/" + newFolder; filesFrame.contentWindow.frames['fileControl'].location.href="lib/file-control.php?action=newFolder&file="+newFolder.replace(/\//g,"|"); + top.ICEcoder.serverMessage('Creating Folder
'+newFolder); } }, @@ -694,6 +696,7 @@ var ICEcoder = { // replace forward slashes with pipes so it get be placed in a querystring top.ICEcoder.thisFileFolderLink = top.ICEcoder.thisFileFolderLink.replace(/\//g,"|"); ICEcoder.filesFrame.contentWindow.frames['fileControl'].location.href = "lib/file-control.php?action=load&file="+top.ICEcoder.thisFileFolderLink; + top.ICEcoder.serverMessage('Opening File
'+top.ICEcoder.shortURL); } else { top.ICEcoder.createNewTab(); } @@ -707,6 +710,7 @@ var ICEcoder = { if (saveAs) {saveType = "saveAs"} else {saveType = "save"}; filesFrame.contentWindow.frames['fileControl'].location.href="lib/file-control.php?action=save&file="+ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(/\//g,"|")+"&saveType="+saveType; + top.ICEcoder.serverMessage('Saving
'+ICEcoder.openFiles[ICEcoder.selectedTab-1]); }, // Prompt a rename dialog on demand @@ -729,6 +733,7 @@ var ICEcoder = { } } ICEcoder.filesFrame.contentWindow.frames['fileControl'].location.href = "lib/file-control.php?action=rename&file="+renamedFile+"&oldFileName="+top.ICEcoder.rightClickedFile.replace(/\|/g,"/"); + top.ICEcoder.serverMessage('Renaming to
'+renamedFile); } }, @@ -746,6 +751,7 @@ var ICEcoder = { if (iDeleting File
'+top.ICEcoder.selectedFiles.toString().replace(/\|/g,"/").replace(/,/g,"\n")); }; }, @@ -1088,5 +1094,18 @@ var ICEcoder = { // Turning on/off the Code Assist codeAssistToggle: function() { top.ICEcoder.codeAssist ? top.ICEcoder.codeAssist = false : top.ICEcoder.codeAssist = true; + }, + + // Show or hide a server message + serverMessage: function(message) { + var serverMessage; + + serverMessage = document.getElementById('serverMessage'); + if (message) { + serverMessage.innerHTML = message; + serverMessage.style.opacity = 1; + } else { + serverMessage.style.opacity = 0; + } } }; \ No newline at end of file