Skip to content
This repository was archived by the owner on Dec 14, 2023. It is now read-only.

Commit 4b207ed

Browse files
author
mattpass
committed
Better design on serverMessages
1 parent 6210eca commit 4b207ed

File tree

4 files changed

+17
-21
lines changed

4 files changed

+17
-21
lines changed

assets/css/icecoder.css

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,6 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
6565
.files .button {position: absolute; border: 0; background: #444; color: #eee; height: 20px; margin-top: 16px; margin-left: 5px; font-size: 11px; cursor: pointer}
6666
.files .button:hover {background-color: #1d1d1b; color: #eee}
6767
.files .frame {display: inline-block; width: 250px; margin-top: 24px}
68-
.files .serverMessage {position: absolute; display: inline-block; width: 450px; bottom: 0; background-color: rgba(255,255,255,0.8); font-size: 10px; padding: 4px 12px 1px 12px; opacity: 0;
69-
transition: opacity 0.2s;
70-
}
71-
.files .serverMessage b {font-size: 10px}
7268

7369
.files .tools {position: absolute; display: inline-block; width: 250px; height: 30px; left: 0; bottom: 0}
7470
.files .tools div {display: inline-block; margin: 8px 0 8px 15px; color: #666; cursor: pointer}
@@ -137,7 +133,8 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
137133
.editor .code {position: relative; display: inline-block; top: 28px; width: 600px; height: 600px; visibility: hidden}
138134

139135
.footer {position: fixed; display: inline-block; width: 100%; height: 30px; bottom: 0; background-color: rgba(0,0,0,0.15); left: 0; z-index: 1}
140-
.footer .versionsDisplay {position: absolute; display: inline-block; padding: 5px; margin-top: 3px; left: 275px; color: #fff; cursor: pointer}
136+
.footer .versionsDisplay {position: absolute; display: inline-block; padding: 5px; margin-top: 3px; left: 275px; color: #fff; transition: opacity 0.2s; z-index: 2; cursor: pointer}
137+
.footer .serverMessage {position: absolute; display: inline-block; padding: 5px; margin-top: 3px; left: 250px; color: #fff; transition: opacity 0.2s; z-index: 1}
141138
.footer .splitPaneControls {position: absolute; display: inline-block; width: 50px; text-align: center; padding: 6px}
142139
.footer .splitPaneControls .off {display: inline-block; width: 18px; height: 18px; margin-right: 10px; background: url('../images/split-pane-controls.gif') no-repeat 0 0; cursor: pointer}
143140
.footer .splitPaneControls .on {display: inline-block; width: 19px; height: 18px; background: url('../images/split-pane-controls.gif') no-repeat -18px 0; cursor: pointer}

assets/js/icecoder.js

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ var ICEcoder = {
198198
this.optionsFile.style.width = this.optionsEdit.style.width = this.optionsSettings.style.width = this.optionsHelp.style.width = this.filesW + "px";
199199
this.filesFrame.style.height = (winH - headerH - fileNavH - 7 - toolsBarH) + "px";
200200
this.versionsDisplay.style.left = (this.filesW + 10) + "px";
201+
get("serverMessage").style.left = (this.filesW + 10) + "px";
201202
this.splitPaneControls.style.left =
202203
parseInt(
203204
((winW - this.filesW) / 2) +
@@ -1854,7 +1855,7 @@ var ICEcoder = {
18541855
if (newFolder) {
18551856
newFolder = (shortURL + "/" + newFolder).replace(/\/\//, "/");
18561857
this.serverQueue("add", iceLoc + "/lib/file-control.php?action=newFolder&csrf=" + this.csrf, encodeURIComponent(newFolder.replace(/\//g, "|")));
1857-
this.serverMessage('<b>' + t['Creating Folder'] + '</b><br>' + newFolder);
1858+
this.serverMessage('<b>' + t['Creating Folder'] + '</b> ' + newFolder);
18581859
}
18591860
},
18601861

@@ -1918,7 +1919,7 @@ var ICEcoder = {
19181919
if ("/[NEW]" !== shortURL) {
19191920
fileLink = fileLink.replace(/\//g, "|");
19201921
this.serverQueue("add", iceLoc + "/lib/file-control.php?action=load&file=" + encodeURIComponent(fileLink) + "&csrf=" + this.csrf + "&lineNumber=" + line);
1921-
this.serverMessage('<b>' + t['Opening File'] + '</b><br>' + shortURL);
1922+
this.serverMessage('<b>' + t['Opening File'] + '</b> ' + shortURL.substr(shortURL.lastIndexOf("/") + 1));
19221923
} else {
19231924
this.createNewTab(true, shortURL);
19241925
}
@@ -1956,7 +1957,7 @@ var ICEcoder = {
19561957
}
19571958

19581959
this.serverQueue("add", iceLoc + "/lib/file-control.php?action=getRemoteFile&csrf=" + this.csrf + "&lineNumber=" + line, encodeURIComponent(remoteFile));
1959-
this.serverMessage('<b>' + t['Getting'] + '</b><br>' + remoteFile);
1960+
this.serverMessage('<b>' + t['Getting'] + '</b> ' + remoteFile);
19601961
},
19611962

19621963
// Get changes to save (used when simply saving, gets diff changes between current and last known version)
@@ -2050,7 +2051,7 @@ var ICEcoder = {
20502051
}
20512052
filePath = filePath.replace("||", "|");
20522053
ic.serverQueue("add", iceLoc + "/lib/file-control.php?action=save&fileMDT=" + ic.openFileMDTs[ic.selectedTab - 1] + "&fileVersion=" + ic.openFileVersions[ic.selectedTab - 1] + "&saveType=" + saveType + "&newFileAutoSave=" + newFileAutoSave + "&tabNum=" + ic.selectedTab + "&csrf=" + ic.csrf,encodeURIComponent(filePath), changes);
2053-
ic.serverMessage('<b>' + t['Saving'] + '</b><br>' + ic.openFiles[ic.selectedTab - 1].replace(iceRoot, ""));
2054+
ic.serverMessage('<b>' + t['Saving'] + '</b> ' + ic.openFiles[ic.selectedTab - 1].replace(iceRoot, ""));
20542055
}, 0, ic);
20552056
},
20562057

@@ -2069,7 +2070,7 @@ var ICEcoder = {
20692070
}
20702071
if (newName) {
20712072
this.serverQueue("add", iceLoc + "/lib/file-control.php?action=rename&oldFileName=" + encodeURIComponent(oldName.replace(/\|/g, "/")) + "&csrf=" + this.csrf,encodeURIComponent(newName));
2072-
this.serverMessage('<b>' + t['Renaming to'] + '</b><br>' + newName);
2073+
this.serverMessage('<b>' + t['Renaming to'] + '</b> ' + newName);
20732074
this.setPreviousFiles();
20742075
}
20752076
},
@@ -2081,7 +2082,7 @@ var ICEcoder = {
20812082
if (newName && newName !== oldName) {
20822083
if (this.ask("Are you sure you want to move file " + oldName + " to " + newName + " ?")){
20832084
this.serverQueue("add", iceLoc + "/lib/file-control.php?action=move&oldFileName=" + encodeURIComponent(oldName.replace(/\//g, "|")) + "&csrf=" + this.csrf, encodeURIComponent(newName.replace(/\//g, "|")));
2084-
this.serverMessage('<b>' + t['Moving to'] + '</b><br>' + newName);
2085+
this.serverMessage('<b>' + t['Moving to'] + '</b> ' + newName);
20852086
}
20862087

20872088
this.setPreviousFiles();
@@ -2096,7 +2097,7 @@ var ICEcoder = {
20962097
tgtListDisplay = tgtFiles.toString().replace(/\|/g, "/").replace(/,/g, "\n");
20972098
if (0 < tgtFiles.length && this.ask('Delete:\n\n' + tgtListDisplay + '?')) {
20982099
this.serverQueue("add", iceLoc + "/lib/file-control.php?action=delete&csrf=" + this.csrf,encodeURIComponent(tgtFiles.join(";")));
2099-
this.serverMessage('<b>' + t['Deleting File'] + '</b><br>' + tgtListDisplay);
2100+
this.serverMessage('<b>' + t['Deleting File'] + '</b> ' + tgtListDisplay);
21002101
}
21012102
},
21022103

@@ -2120,7 +2121,7 @@ var ICEcoder = {
21202121
for (let i = 0; i < this.copiedFiles.length; i++) {
21212122
if ("|" !== this.copiedFiles[i]) {
21222123
this.serverQueue("add", iceLoc + "/lib/file-control.php?action=paste&location=" + location + "&csrf=" + this.csrf, encodeURIComponent(this.copiedFiles[i]));
2123-
this.serverMessage('<b>' + t['Pasting File'] + '</b><br>' + this.copiedFiles[i].toString().replace(/\|/g, "/").replace(/,/g, "\n"));
2124+
this.serverMessage('<b>' + t['Pasting File'] + '</b> ' + this.copiedFiles[i].toString().replace(/\|/g, "/").replace(/,/g, "\n"));
21242125
} else {
21252126
this.message(t['Sorry cannot paste...']);
21262127
}
@@ -2843,7 +2844,7 @@ var ICEcoder = {
28432844
"&replace=" + replace +
28442845
"&csrf=" + this.csrf,
28452846
encodeURIComponent(fileRef.replace(/\//g, "|")));
2846-
this.serverMessage('<b>' + t['Replacing text in'] + '</b><br>' + fileRef);
2847+
this.serverMessage('<b>' + t['Replacing text in'] + '</b> ' + fileRef);
28472848
},
28482849

28492850

@@ -3014,12 +3015,10 @@ var ICEcoder = {
30143015

30153016
serverMessage = get('serverMessage');
30163017
if (message) {
3017-
serverMessage.innerHTML = this.xssClean(message).replace(/\&lt;b\&gt;/g,"<b>").replace(/\&lt;\/b\&gt;/g,"</b>").replace(/\&lt;br\&gt;/g,"<br>");
3018-
serverMessage.style.left = "0";
3019-
} else {
3020-
setTimeout(function() {serverMessage.style.left = "2000px";},200);
3018+
serverMessage.innerHTML = this.xssClean(message).replace(/\&lt;b\&gt;/g,"<b>").replace(/\&lt;\/b\&gt;/g,"</b>");
30213019
}
30223020
serverMessage.style.opacity = message ? 1 : 0;
3021+
get("versionsDisplay").style.opacity = message ? 0 : 1;
30233022
},
30243023

30253024
// Show a CSS color block next to our text cursor
@@ -3671,7 +3670,7 @@ var ICEcoder = {
36713670
file = file.replace(iceRoot,"");
36723671
this.showHide('hide',get('blackMask'));
36733672
this.serverQueue("add",iceLoc+"/lib/file-control.php?action=perms&perms="+perms+"&csrf="+this.csrf,encodeURIComponent(file));
3674-
this.serverMessage('<b>chMod '+perms+' on </b><br>'+file.replace(/\|/g,"/"));
3673+
this.serverMessage('<b>chMod '+perms+' on </b> '+file.replace(/\|/g,"/"));
36753674
},
36763675

36773676
// Open/show the preview window

classes/File.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ public function handleSaveLooparound($fileDetails, $finalAction, $t) {
326326
xhr.open("POST",saveURL,true);
327327
xhr.setRequestHeader(\'Content-type\', \'application/x-www-form-urlencoded\');
328328
xhr.send(\'timeStart=' . numClean($_POST["timeStart"]) . '&file=' . $fileURL . '&newFileName=\' + newFileName.replace(/\\\+/g, "%2B") + \'&contents=\' + encodeURIComponent(ICEcoder.saveAsContent));
329-
ICEcoder.serverMessage("<b>' . $t['Saving'] . '</b><br>" + "'.("Save" === $finalAction ? "newFileName" : "'" . $fileName . "'") . '");
329+
ICEcoder.serverMessage("<b>' . $t['Saving'] . '</b> " + "'.("Save" === $finalAction ? "newFileName" : "'" . $fileName . "'") . '");
330330
}
331331
}
332332
}, 10);' .

index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@
297297
</div>
298298
</div>
299299
<iframe id="filesFrame" class="frame" name="ff" src="<?php echo $iceURLPath;?>/files.php" style="opacity: 0" onLoad="this.style.opacity = '1'; this.contentWindow.onscroll = function(){ICEcoder.mouseDown = false; ICEcoder.mouseDownInCM = false}"></iframe>
300-
<div class="serverMessage" id="serverMessage"></div>
301300

302301
<div class="tools" id="tools">
303302
<div onclick="ICEcoder.toolShowHideToggle('terminal')" id="toolLinkTerminal">Terminal</div>
@@ -376,6 +375,7 @@
376375

377376
<div class="footer" id="footer" oncontextmenu="return false">
378377
<div class="versionsDisplay" id="versionsDisplay" onclick="ICEcoder.versionsScreen(ICEcoder.openFiles[ICEcoder.selectedTab - 1].replace(/\//g, '|'))"></div>
378+
<div class="serverMessage" id="serverMessage"></div>
379379
<div class="splitPaneControls" id="splitPaneControls"><div class="off" id="splitPaneControlsOff" title="<?php echo $t['Single pane'];?>" onclick="ICEcoder.setSplitPane('off')" style="opacity: 0.5"></div><div class="on" id="splitPaneControlsOn" title="<?php echo $t['Diff pane also'];?>" onclick="ICEcoder.setSplitPane('on')" style="opacity: 0.2"></div></div>
380380
<div class="splitPaneNames" id="splitPaneNamesMain">Main Pane</div>
381381
<div class="splitPaneNames" id="splitPaneNamesDiff">Diff Pane</div>

0 commit comments

Comments
 (0)