mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-23 00:37:14 +01:00
Compare commits
45 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a21772f3c2 | ||
|
|
cbd930a340 | ||
|
|
9f129c9781 | ||
|
|
18931e94b0 | ||
|
|
1520828dff | ||
|
|
43223d1677 | ||
|
|
3fb9836fc8 | ||
|
|
8cd5a10ea8 | ||
|
|
da1850896b | ||
|
|
336ef01dee | ||
|
|
246bf189b5 | ||
|
|
825effadd9 | ||
|
|
51f53855f8 | ||
|
|
65fa29fbb8 | ||
|
|
5bcfa06e19 | ||
|
|
b01218958f | ||
|
|
7887f0e7a1 | ||
|
|
f522502938 | ||
|
|
c7f533cf0a | ||
|
|
a3107de33e | ||
|
|
e69a3249e5 | ||
|
|
f3c24f05e0 | ||
|
|
20364bb1d7 | ||
|
|
3d1c92dae4 | ||
|
|
4048895c6b | ||
|
|
991908bd8d | ||
|
|
8ff559dbef | ||
|
|
d7d483ef9c | ||
|
|
b11064e3a8 | ||
|
|
409d35b29b | ||
|
|
811cf40cd7 | ||
|
|
3aa9d23ac6 | ||
|
|
9c8bb08454 | ||
|
|
2c28af0dd7 | ||
|
|
cc6bd40b15 | ||
|
|
5221ba0959 | ||
|
|
61f132327d | ||
|
|
826730e88b | ||
|
|
5cdb08c35f | ||
|
|
9806d3705a | ||
|
|
55e6e66df6 | ||
|
|
0d38b23a60 | ||
|
|
07fd0ab6bf | ||
|
|
6036b0635d | ||
|
|
74f678076a |
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
error-log.txt
|
||||||
|
backups/*.zip
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
|
|||||||
Copyright (C) 2012 by Marijn Haverbeke <marijnh@gmail.com>
|
Copyright (C) 2013 by Marijn Haverbeke <marijnh@gmail.com>
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
16
CodeMirror-3.01/addon/hint/simple-hint.css
Normal file
16
CodeMirror-3.01/addon/hint/simple-hint.css
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
.CodeMirror-completions {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 10;
|
||||||
|
overflow: hidden;
|
||||||
|
-webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
||||||
|
-moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
||||||
|
box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
||||||
|
}
|
||||||
|
.CodeMirror-completions select {
|
||||||
|
background: #fafafa;
|
||||||
|
outline: none;
|
||||||
|
border: none;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
font-family: monospace;
|
||||||
|
}
|
||||||
6
CodeMirror-3.01/lib/codemirror-compressed.js
Normal file
6
CodeMirror-3.01/lib/codemirror-compressed.js
Normal file
File diff suppressed because one or more lines are too long
@@ -39,14 +39,14 @@
|
|||||||
|
|
||||||
/* CURSOR */
|
/* CURSOR */
|
||||||
|
|
||||||
.CodeMirror pre.CodeMirror-cursor {
|
.CodeMirror div.CodeMirror-cursor {
|
||||||
border-left: 1px solid black;
|
border-left: 1px solid black;
|
||||||
}
|
}
|
||||||
/* Shown when moving in bi-directional text */
|
/* Shown when moving in bi-directional text */
|
||||||
.CodeMirror pre.CodeMirror-secondarycursor {
|
.CodeMirror div.CodeMirror-secondarycursor {
|
||||||
border-left: 1px solid silver;
|
border-left: 1px solid silver;
|
||||||
}
|
}
|
||||||
.cm-keymap-fat-cursor pre.CodeMirror-cursor {
|
.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
|
||||||
width: auto;
|
width: auto;
|
||||||
border: 0;
|
border: 0;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
@@ -54,11 +54,11 @@
|
|||||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800);
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800);
|
||||||
}
|
}
|
||||||
/* Kludge to turn off filter in ie9+, which also accepts rgba */
|
/* Kludge to turn off filter in ie9+, which also accepts rgba */
|
||||||
.cm-keymap-fat-cursor pre.CodeMirror-cursor:not(#nonsense_id) {
|
.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor:not(#nonsense_id) {
|
||||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
||||||
}
|
}
|
||||||
/* Can style cursor different in overwrite (non-insert) mode */
|
/* Can style cursor different in overwrite (non-insert) mode */
|
||||||
.CodeMirror pre.CodeMirror-cursor.CodeMirror-overwrite {}
|
.CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}
|
||||||
|
|
||||||
/* DEFAULT THEME */
|
/* DEFAULT THEME */
|
||||||
|
|
||||||
@@ -196,6 +196,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|||||||
.CodeMirror-linewidget {
|
.CodeMirror-linewidget {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-wrap .CodeMirror-scroll {
|
.CodeMirror-wrap .CodeMirror-scroll {
|
||||||
@@ -210,20 +211,20 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|||||||
}
|
}
|
||||||
.CodeMirror-measure pre { position: static; }
|
.CodeMirror-measure pre { position: static; }
|
||||||
|
|
||||||
.CodeMirror pre.CodeMirror-cursor {
|
.CodeMirror div.CodeMirror-cursor {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
border-right: none;
|
border-right: none;
|
||||||
width: 0;
|
width: 0;
|
||||||
}
|
}
|
||||||
.CodeMirror-focused pre.CodeMirror-cursor {
|
.CodeMirror-focused div.CodeMirror-cursor {
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-selected { background: #d9d9d9; }
|
.CodeMirror-selected { background: #d9d9d9; }
|
||||||
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
|
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
|
||||||
|
|
||||||
.CodeMirror-searching {
|
.cm-searching {
|
||||||
background: #ffa;
|
background: #ffa;
|
||||||
background: rgba(255, 255, 0, .4);
|
background: rgba(255, 255, 0, .4);
|
||||||
}
|
}
|
||||||
@@ -233,7 +234,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|||||||
|
|
||||||
@media print {
|
@media print {
|
||||||
/* Hide the cursor when printing */
|
/* Hide the cursor when printing */
|
||||||
.CodeMirror pre.CodeMirror-cursor {
|
.CodeMirror div.CodeMirror-cursor {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
Early version of the web based IDE which allows for creation of websites in the web browser. Uses the brilliant CodeMirror for code highlighting & editing, with a slick IDE wrapped around it to make the whole thing work.
|
Early version of the web based IDE which allows for creation of websites in the web browser. Uses the brilliant CodeMirror for code highlighting & editing, with a slick IDE wrapped around it to make the whole thing work.
|
||||||
|
|
||||||
<img src="http://icecoder.net/images/icecoder-v1pt4-web-ide.jpg" alt="ICEcoder web IDE">
|
<img src="http://icecoder.net/images/icecoder-v1pt6-web-ide.jpg" alt="ICEcoder web IDE">
|
||||||
|
|
||||||
###Features you'd expect
|
###Features you'd expect
|
||||||
* Context aware code highlighting
|
* Context aware code highlighting
|
||||||
@@ -41,6 +41,8 @@ Early version of the web based IDE which allows for creation of websites in the
|
|||||||
* Shell terminal
|
* Shell terminal
|
||||||
* JS Hint validation as you type
|
* JS Hint validation as you type
|
||||||
* Emmet snippet typing booster
|
* Emmet snippet typing booster
|
||||||
|
* JavaScript code hinting
|
||||||
|
* Alphanumeric tab sorting
|
||||||
|
|
||||||
###Installation
|
###Installation
|
||||||
|
|
||||||
|
|||||||
0
backups/.gitkeep
Normal file
0
backups/.gitkeep
Normal file
@@ -1 +0,0 @@
|
|||||||
Zip It! backups are stored in this folder
|
|
||||||
13
editor.php
13
editor.php
@@ -1,17 +1,18 @@
|
|||||||
<?php include("lib/settings.php");?>
|
<?php include("lib/settings.php");?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
||||||
<html style="margin: 0" onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'editor');top.ICEcoder.canResizeFilesW()}">
|
<html style="margin: 0" onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false; top.ICEcoder.tabDragEnd()" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'editor');top.ICEcoder.canResizeFilesW()}">
|
||||||
<head>
|
<head>
|
||||||
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> editor</title>
|
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> editor</title>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta name="robots" content="noindex, nofollow">
|
<meta name="robots" content="noindex, nofollow">
|
||||||
<link rel="stylesheet" href="<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror.css">
|
<link rel="stylesheet" href="<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror.css">
|
||||||
|
<link rel="stylesheet" href="<?php echo $ICEcoder["codeMirrorDir"]; ?>/addon/hint/simple-hint.css">
|
||||||
<!--
|
<!--
|
||||||
codemirror-compressed.js
|
codemirror-compressed.js
|
||||||
incls: codemirror.js
|
incls: codemirror.js
|
||||||
modes: clike, coffeescript, css, javascript, less, php, ruby & xml
|
modes: clike, coffeescript, css, javascript, less, php, ruby & xml
|
||||||
utils: foldcode, searchcursor, match-highlighter
|
utils: foldcode, searchcursor, match-highlighter, simple-hint, javascript-hint
|
||||||
//-->
|
//-->
|
||||||
<script src="<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror-compressed.js"></script>
|
<script src="<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror-compressed.js"></script>
|
||||||
<?php
|
<?php
|
||||||
@@ -101,10 +102,14 @@ span.CodeMirror-matchhighlight {background: #555}
|
|||||||
CodeMirror.keyMap.ICEcoder = {
|
CodeMirror.keyMap.ICEcoder = {
|
||||||
"Tab": function(cm) {CodeMirror.commands[top.ICEcoder.tabsIndent ? "defaultTab" : "insertTab"](cm);},
|
"Tab": function(cm) {CodeMirror.commands[top.ICEcoder.tabsIndent ? "defaultTab" : "insertTab"](cm);},
|
||||||
"Shift-Tab": "indentLess",
|
"Shift-Tab": "indentLess",
|
||||||
"Ctrl-Up": function() {},
|
"Ctrl-Space": "autocomplete",
|
||||||
"Ctrl-Down": function() {},
|
|
||||||
fallthrough: ["default"]
|
fallthrough: ["default"]
|
||||||
};
|
};
|
||||||
|
CodeMirror.commands.autocomplete = function(cm) {
|
||||||
|
if (top.ICEcoder.caretLocType=="JavaScript") {
|
||||||
|
CodeMirror.simpleHint(cm, CodeMirror.javascriptHint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function createNewCMInstance(num) {
|
function createNewCMInstance(num) {
|
||||||
var fileName = top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];
|
var fileName = top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php include("lib/settings.php");?>
|
<?php include("lib/settings.php");?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
||||||
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'files');top.ICEcoder.canResizeFilesW()}" onContextMenu="top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink; return top.ICEcoder.showMenu()" onClick="top.ICEcoder.selectFileFolder()">
|
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false; top.ICEcoder.tabDragEnd()" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'files');top.ICEcoder.canResizeFilesW()}" onContextMenu="top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink; return top.ICEcoder.showMenu()" onClick="top.ICEcoder.selectFileFolder()">
|
||||||
<head>
|
<head>
|
||||||
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> file manager</title>
|
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> file manager</title>
|
||||||
<meta name="robots" content="noindex, nofollow">
|
<meta name="robots" content="noindex, nofollow">
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 7.0 KiB |
BIN
images/nav-alpha.png
Normal file
BIN
images/nav-alpha.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 990 B |
12
index.php
12
index.php
@@ -1,4 +1,3 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<?php include("lib/settings.php");
|
<?php include("lib/settings.php");
|
||||||
|
|
||||||
// Check IP permissions
|
// Check IP permissions
|
||||||
@@ -16,8 +15,8 @@ if ($ICEcoder["checkUpdates"]) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'top');top.ICEcoder.canResizeFilesW()}">
|
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false;top.ICEcoder.tabDragEnd()" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'top');top.ICEcoder.canResizeFilesW()}">
|
||||||
<head>
|
<head>
|
||||||
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?></title>
|
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?></title>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
@@ -130,12 +129,13 @@ if (file_exists(dirname(__FILE__)."/plugins/jshint/jshint.js")) {
|
|||||||
|
|
||||||
<div id="editor" class="editor">
|
<div id="editor" class="editor">
|
||||||
<div id="tabsBar" class="tabsBar" onContextMenu="return false">
|
<div id="tabsBar" class="tabsBar" onContextMenu="return false">
|
||||||
<a nohref onClick="top.ICEcoder.closeAllTabs()"><img src="images/nav-close.gif" class="closeAllTabs"></a>
|
<a nohref onClick="top.ICEcoder.closeAllTabs()"><img src="images/nav-close.gif" class="closeAllTabs" title="Close all tabs"></a>
|
||||||
|
<a nohref onClick="top.ICEcoder.alphaTabs()"><img src="images/nav-alpha.png" class="alphaTabs" title="Alphabetize tabs"></a>
|
||||||
<?php
|
<?php
|
||||||
for ($i=1;$i<=100;$i++) {
|
for ($i=1;$i<=100;$i++) {
|
||||||
echo '<div id="tab'.$i.'" class="tab" draggable="true" onClick="ICEcoder.canSwitchTabs ? ICEcoder.switchTab('.$i.') : ICEcoder.canSwitchTabs=true; thisColor=\'#000\'" onMouseOver="thisColor=this.style.color;this.style.color=\'#000\'" onMouseOut="this.style.color=thisColor"></div>';
|
echo '<div id="tab'.$i.'" class="tab" onMouseDown="ICEcoder.canSwitchTabs ? ICEcoder.switchTab(parseInt(this.id.slice(3),10)) : ICEcoder.canSwitchTabs=true; thisColor=\'#000\'; ICEcoder.tabDragStart(parseInt(this.id.slice(3),10))" onMouseOver="thisColor=this.style.color;this.style.color=\'#000\'" onMouseOut="this.style.color=thisColor"></div>';
|
||||||
}
|
}
|
||||||
?><div class="newTab" onClick="ICEcoder.newTab()"><img src="images/nav-new.png"></div>
|
?><div class="newTab" onClick="ICEcoder.newTab()" id="newTab"><img src="images/nav-new.png"></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="findBar" class="findBar" onContextMenu="return false">
|
<div id="findBar" class="findBar" onContextMenu="return false">
|
||||||
<form name="findAndReplace" onSubmit="ICEcoder.findReplace('findReplace',false,true);return false">
|
<form name="findAndReplace" onSubmit="ICEcoder.findReplace('findReplace',false,true);return false">
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ $ICEcoder = array(
|
|||||||
array("ICErepo","plugins/ice-repo/icon.png","margin-top: 3px","plugins/ice-repo","_blank",""),
|
array("ICErepo","plugins/ice-repo/icon.png","margin-top: 3px","plugins/ice-repo","_blank",""),
|
||||||
array("Dochub","plugins/dochub/icon.png","margin-top: 3px","http://dochub.io","_blank",""),
|
array("Dochub","plugins/dochub/icon.png","margin-top: 3px","http://dochub.io","_blank",""),
|
||||||
array("JS Regex","plugins/jsregex/icon.png","margin-top: 3px","http://jsregex.herokuapp.com","_blank",""),
|
array("JS Regex","plugins/jsregex/icon.png","margin-top: 3px","http://jsregex.herokuapp.com","_blank",""),
|
||||||
|
array("wireframe|cc","plugins/wireframecc/icon.png","margin-top: 3px","http://wireframe.cc","_blank",""),
|
||||||
array("Zip It!","plugins/zip-it/icon.png","margin-top: 3px; margin-left: 3px","plugins/zip-it/?zip=|&exclude=*.doc*.gif*.jpg*.jpeg*.pdf*.png*.swf*.xml*.zip","fileControl:<b>Zipping Files</b>","30")
|
array("Zip It!","plugins/zip-it/icon.png","margin-top: 3px; margin-left: 3px","plugins/zip-it/?zip=|&exclude=*.doc*.gif*.jpg*.jpeg*.pdf*.png*.swf*.xml*.zip","fileControl:<b>Zipping Files</b>","30")
|
||||||
),
|
),
|
||||||
"theme" => "default",
|
"theme" => "default",
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ if ($_GET['action']=="load") {
|
|||||||
echo 'top.ICEcoder.shortURL = top.ICEcoder.rightClickedFile = top.ICEcoder.thisFileFolderLink = "'.$fileLoc."/".$fileName.'";';
|
echo 'top.ICEcoder.shortURL = top.ICEcoder.rightClickedFile = top.ICEcoder.thisFileFolderLink = "'.$fileLoc."/".$fileName.'";';
|
||||||
echo '</script>';
|
echo '</script>';
|
||||||
$loadedFile = file_get_contents($file);
|
$loadedFile = file_get_contents($file);
|
||||||
echo '<textarea name="loadedFile" id="loadedFile">'.str_replace("</textarea>","<ICEcoder:/:textarea>",htmlentities($loadedFile)).'</textarea>';
|
echo '<textarea name="loadedFile" id="loadedFile">'.str_replace("</textarea>","<ICEcoder:/:textarea>",str_replace("&","&",$loadedFile)).'</textarea>';
|
||||||
} else if (strpos(finfo_file($finfo, $file),"image")===0) {
|
} else if (strpos(finfo_file($finfo, $file),"image")===0) {
|
||||||
echo '<script>fileType="image";fileName=\''.$fileLoc."/".$fileName.'\'</script>';
|
echo '<script>fileType="image";fileName=\''.$fileLoc."/".$fileName.'\'</script>';
|
||||||
} else {
|
} else {
|
||||||
@@ -103,7 +103,7 @@ if ($_GET['action']=="upload") {
|
|||||||
$this->uploadFile=$uploadDir.$current->name;
|
$this->uploadFile=$uploadDir.$current->name;
|
||||||
$fileName = $current->name;
|
$fileName = $current->name;
|
||||||
if ($this->upload($current,$this->uploadFile)) {
|
if ($this->upload($current,$this->uploadFile)) {
|
||||||
echo '<script>action="upload"; top.ICEcoder.updateFileManagerList(\'add\',top.ICEcoder.rightClickedFile.replace(/\|/g,\'/\'),\''.$fileName.'\');</script>';
|
echo '<script>action="upload"; top.ICEcoder.updateFileManagerList(\'add\',top.ICEcoder.rightClickedFile.replace(/\|/g,\'/\'),\''.$fileName.'\',false,false,true); top.ICEcoder.serverMessage("Uploaded file(s) OK");setTimeout(function(){top.ICEcoder.serverMessage();},2000);</script>';
|
||||||
} else {
|
} else {
|
||||||
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot upload \\n".$fileName."\\n into \\n'+top.ICEcoder.rightClickedFile.replace(/\|/g,'/'))</script>";
|
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot upload \\n".$fileName."\\n into \\n'+top.ICEcoder.rightClickedFile.replace(/\|/g,'/'))</script>";
|
||||||
}
|
}
|
||||||
@@ -135,18 +135,25 @@ if ($_GET['action']=="upload") {
|
|||||||
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot upload whilst in demo mode');</script>";
|
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot upload whilst in demo mode');</script>";
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.hideFileMenu();top.ICEcoder.showHide('hide',top.document.getElementById('loadingMask'));</script>";
|
echo "<script>top.ICEcoder.hideFileMenu();top.ICEcoder.showHide('hide',top.document.getElementById('loadingMask'));</script>";
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we're due to rename a file/folder...
|
// If we're due to rename a file/folder...
|
||||||
if ($_GET['action']=="rename") {
|
if ($_GET['action']=="rename") {
|
||||||
if (!$demoMode && is_writable($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])))) {
|
if (!$demoMode && is_writable($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])))) {
|
||||||
rename($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])),$docRoot.$fileLoc."/".$fileName);
|
if(rename($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])),$docRoot.$fileLoc."/".$fileName)) {
|
||||||
// Reload file manager
|
// Reload file manager
|
||||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'rename\',\''.$fileLoc.'\',\''.$fileName.'\',\'\',\''.str_replace($iceRoot,"",strClean($_GET['oldFileName'])).'\');';
|
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'rename\',\''.$fileLoc.'\',\''.$fileName.'\',\'\',\''.str_replace($iceRoot,"",strClean($_GET['oldFileName'])).'\');';
|
||||||
echo 'action="rename";</script>';
|
echo 'action="rename";</script>';
|
||||||
|
$renamed=true;
|
||||||
|
} else {
|
||||||
|
$renamed=false;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot rename\\n".strClean($_GET['oldFileName'])."');</script>";
|
$renamed=false;
|
||||||
|
}
|
||||||
|
if (!$renamed) {
|
||||||
|
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot rename\\n".strClean($_GET['oldFileName'])."\\n\\nMaybe public write permissions needed on this or parent folder?');</script>";
|
||||||
}
|
}
|
||||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
|
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,15 +100,24 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
|
|||||||
|
|
||||||
.editor {position: absolute; display: inline-block; top: 0; left: 15px; width: 2400px}
|
.editor {position: absolute; display: inline-block; top: 0; left: 15px; width: 2400px}
|
||||||
.editor .tabsBar {display: inline-block; height: 22px; width: 2400px; margin-top: 40px; padding-left: 41px; background: #ddd}
|
.editor .tabsBar {display: inline-block; height: 22px; width: 2400px; margin-top: 40px; padding-left: 41px; background: #ddd}
|
||||||
.tabsBar .tab {display: none; background-image: url('../images/nav-bg.jpg'); background-repeat: repeat-x; background-position: 0 0; padding: 5px 8px 2px 8px; font-size: 10px; border-left: solid 1px #eee; border-right: solid 1px #777; border-radius: 4px 4px 0 0; color: #fff; direction: rtl; text-align: right; white-space: nowrap; overflow: hidden; cursor: pointer;
|
.tabsBar .tab {position: absolute; display: none; background: url('../images/nav-bg.jpg') repeat-x 0 0; padding: 5px 8px 2px 8px; font-size: 10px; border-left: solid 1px #eee; border-right: solid 1px #777; border-radius: 4px 4px 0 0; color: #fff; white-space: nowrap; overflow: hidden; cursor: pointer; z-index: 1}
|
||||||
-webkit-transition: all 0.15s;
|
.tabsBar .tabSlide {
|
||||||
-moz-transition: all 0.15s;
|
-webkit-transition: left 0.15s ease-in-out;
|
||||||
transition: all 0.15s;
|
-moz-transition: left 0.15s ease-in-out;
|
||||||
|
transition: left 0.15s ease-in-out;
|
||||||
|
}
|
||||||
|
.tabsBar .tabDrag {
|
||||||
|
-webkit-transition: left 0s ease-in-out;
|
||||||
|
-moz-transition: left 0s ease-in-out;
|
||||||
|
transition: left 0s ease-in-out;
|
||||||
}
|
}
|
||||||
.tabsBar .tab .closeTab, .tabsBar .closeAllTabs {margin: 1px 0 0 5px; border-radius: 6px; cursor: pointer}
|
.tabsBar .tab .closeTab, .tabsBar .closeAllTabs {margin: 1px 0 0 5px; border-radius: 6px; cursor: pointer}
|
||||||
.tabsBar .closeAllTabs {position: absolute; margin: 6px 0 0 -25px; background: #bbb}
|
.tabsBar .tab .closeTab {position: absolute; right: 7px}
|
||||||
|
.tabsBar .alphaTabs {position: absolute; margin: 6px 0 0 -17px; background: #bbb; border-radius: 6px; cursor: pointer}
|
||||||
|
.tabsBar .alphaTabs:hover {background: #000}
|
||||||
|
.tabsBar .closeAllTabs {position: absolute; margin: 6px 0 0 -33px; background: #bbb}
|
||||||
.tabsBar .closeAllTabs:hover {background: #000}
|
.tabsBar .closeAllTabs:hover {background: #000}
|
||||||
.tabsBar .newTab {display: inline-block; background-image: url('../images/nav-bg.jpg'); background-repeat: repeat-x; background-position: 0 0; padding: 6px 5px 5px 5px; border-left: solid 1px #eee; border-right: solid 1px #777; border-radius: 4px 4px 0 0; cursor: pointer;}
|
.tabsBar .newTab {position: absolute; display: inline-block; background-image: url('../images/nav-bg.jpg'); background-repeat: repeat-x; background-position: 0 0; padding: 6px 5px 5px 5px; border-left: solid 1px #eee; border-right: solid 1px #777; border-radius: 4px 4px 0 0; cursor: pointer; z-index: 1}
|
||||||
.editor .findBar {display: inline-block; height: 28px; width: 2400px; color: #fff; background-color: #141414}
|
.editor .findBar {display: inline-block; height: 28px; width: 2400px; color: #fff; background-color: #141414}
|
||||||
.findBar .findReplace {position: absolute; z-index: 1}
|
.findBar .findReplace {position: absolute; z-index: 1}
|
||||||
.findReplace select {position: relative; font-size: 10px; margin: 8px 2px 0 2px; top: -2px;}
|
.findReplace select {position: relative; font-size: 10px; margin: 8px 2px 0 2px; top: -2px;}
|
||||||
|
|||||||
306
lib/ice-coder.js
306
lib/ice-coder.js
@@ -26,10 +26,11 @@ var ICEcoder = {
|
|||||||
snippetLine: false, // Line no of snippet, if shown
|
snippetLine: false, // Line no of snippet, if shown
|
||||||
mouseDown: false, // If the mouse is down or not
|
mouseDown: false, // If the mouse is down or not
|
||||||
draggingFilesW: false, // If we're dragging the file manager width or not
|
draggingFilesW: false, // If we're dragging the file manager width or not
|
||||||
|
draggingTab: false, // If we're dragging a tab
|
||||||
|
tabLeftPos: [], // Left position of tabs inside content area
|
||||||
serverQueueItems: [], // Array of URLs to call in order
|
serverQueueItems: [], // Array of URLs to call in order
|
||||||
stickyTab: false, // Target variable for the sticky tab window
|
stickyTab: false, // Target variable for the sticky tab window
|
||||||
pluginIntervalRefs: [], // Array of plugin interval refs
|
pluginIntervalRefs: [], // Array of plugin interval refs
|
||||||
dragSrcEl: null, // Tab element being dragged
|
|
||||||
ready: false, // Indicates if ICEcoder is ready for action
|
ready: false, // Indicates if ICEcoder is ready for action
|
||||||
|
|
||||||
// Don't consider these tags as part of nesting as they're singles, JS, PHP or Ruby code blocks
|
// Don't consider these tags as part of nesting as they're singles, JS, PHP or Ruby code blocks
|
||||||
@@ -56,15 +57,6 @@ var ICEcoder = {
|
|||||||
top.ICEcoder.showHide('hide',top.document.getElementById('loadingMask'));
|
top.ICEcoder.showHide('hide',top.document.getElementById('loadingMask'));
|
||||||
if (top.ICEcoder.openLastFiles) {top.ICEcoder.autoOpenFiles()};
|
if (top.ICEcoder.openLastFiles) {top.ICEcoder.autoOpenFiles()};
|
||||||
|
|
||||||
// Add drag based events to our tabs
|
|
||||||
var tabs = document.querySelectorAll('.tab');
|
|
||||||
[].forEach.call(tabs, function(tab) {
|
|
||||||
// not used: dragenter, dragleave
|
|
||||||
tab.addEventListener('dragstart', ICEcoder.handleDragStart, false);
|
|
||||||
tab.addEventListener('dragover', ICEcoder.handleDragOver, false);
|
|
||||||
tab.addEventListener('drop', ICEcoder.handleDrop, false);
|
|
||||||
tab.addEventListener('dragend', ICEcoder.handleDragEnd, false);
|
|
||||||
});
|
|
||||||
setInterval(ICEcoder.updateNestingIndicator,30);
|
setInterval(ICEcoder.updateNestingIndicator,30);
|
||||||
|
|
||||||
// Setup fullscreen detection and change icon
|
// Setup fullscreen detection and change icon
|
||||||
@@ -554,7 +546,7 @@ var ICEcoder = {
|
|||||||
|
|
||||||
// Prompt a rename dialog on demand
|
// Prompt a rename dialog on demand
|
||||||
renameFile: function(oldName,newName) {
|
renameFile: function(oldName,newName) {
|
||||||
var shortURL, fileName;
|
var shortURL, fileName, i;
|
||||||
|
|
||||||
if (!oldName) {
|
if (!oldName) {
|
||||||
shortURL = top.ICEcoder.rightClickedFile.replace(/\|/g,"/");
|
shortURL = top.ICEcoder.rightClickedFile.replace(/\|/g,"/");
|
||||||
@@ -566,12 +558,14 @@ var ICEcoder = {
|
|||||||
newName = top.ICEcoder.getInput('Please enter the new name for',shortURL);
|
newName = top.ICEcoder.getInput('Please enter the new name for',shortURL);
|
||||||
}
|
}
|
||||||
if (newName) {
|
if (newName) {
|
||||||
if(top.ICEcoder.openFiles.indexOf(shortURL.replace(/\|/g,"/"))>-1) {
|
i = top.ICEcoder.openFiles.indexOf(shortURL.replace(/\|/g,"/"));
|
||||||
|
if(i>-1) {
|
||||||
// rename array item and the tab
|
// rename array item and the tab
|
||||||
top.ICEcoder.openFiles[i] = newName;
|
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>';
|
closeTabLink = '<a nohref onClick="top.ICEcoder.closeTab(parseInt(this.parentNode.id.slice(3),10))"><img src="images/nav-close.gif" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'" onMouseOut="this.style.backgroundColor=prevBG"></a>';
|
||||||
fileName = top.ICEcoder.openFiles[i];
|
fileName = top.ICEcoder.openFiles[i];
|
||||||
top.document.getElementById('tab'+(i+1)).innerHTML = closeTabLink + " " + fileName.slice(fileName.lastIndexOf("/")).replace(/\//,"");
|
top.document.getElementById('tab'+(i+1)).innerHTML = closeTabLink + " " + fileName.slice(fileName.lastIndexOf("/")).replace(/\//,"");
|
||||||
|
top.document.getElementById('tab'+(i+1)).title = newName;
|
||||||
}
|
}
|
||||||
top.ICEcoder.serverQueue("add","lib/file-control.php?action=rename&file="+newName+"&oldFileName="+oldName.replace(/\|/g,"/"));
|
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);
|
top.ICEcoder.serverMessage('<b>Renaming to</b><br>'+newName);
|
||||||
@@ -652,7 +646,7 @@ var ICEcoder = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// Update the file manager tree list on demand
|
// Update the file manager tree list on demand
|
||||||
updateFileManagerList: function(action,location,file,perms,oldName) {
|
updateFileManagerList: function(action,location,file,perms,oldName,uploaded) {
|
||||||
var actionElemType, cssStyle, perms, targetElem, locNest, newText, innerLI, newUL, newLI, elemType, nameLI, shortURL, newMouseOver;
|
var actionElemType, cssStyle, perms, targetElem, locNest, newText, innerLI, newUL, newLI, elemType, nameLI, shortURL, newMouseOver;
|
||||||
|
|
||||||
// Adding files
|
// Adding files
|
||||||
@@ -714,7 +708,7 @@ var ICEcoder = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If we added a new file, we've saved it under a new filename, so set that
|
// If we added a new file, we've saved it under a new filename, so set that
|
||||||
if (actionElemType=="file") {
|
if (actionElemType=="file" && !uploaded) {
|
||||||
top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]=location+file;
|
top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]=location+file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -722,15 +716,16 @@ var ICEcoder = {
|
|||||||
// Renaming files
|
// Renaming files
|
||||||
if (action=="rename") {
|
if (action=="rename") {
|
||||||
// Get short URL of our right clicked file and get target elem based on this
|
// Get short URL of our right clicked file and get target elem based on this
|
||||||
shortURL = oldName;
|
shortURL = oldName.replace(/\//g,"|");
|
||||||
targetElem = document.getElementById('filesFrame').contentWindow.document.getElementById(shortURL.replace(/\//g,"|"));
|
targetElem = document.getElementById('filesFrame').contentWindow.document.getElementById(shortURL);
|
||||||
// Set the name to be as per our new file/folder name
|
// Set the name to be as per our new file/folder name
|
||||||
targetElem.innerHTML = file;
|
targetElem.innerHTML = file;
|
||||||
// Finally, update the ID of the target & set a new mouseover function for the parent too
|
// Finally, update the ID of the target & set a new mouseover function for the parent too
|
||||||
targetElem.id = location.replace(/\//g,"|") + "|" + file;
|
targetElem.id = location.replace(/\//g,"|") + "|" + file;
|
||||||
newMouseOver = targetElem.parentNode.onmouseover.toString().replace(shortURL.substring(shortURL.lastIndexOf("|")+1),file).split('\'');
|
newMouseOver = targetElem.parentNode.onmouseover.toString().replace(shortURL.substring(shortURL.lastIndexOf("|")+1),file).split('\'');
|
||||||
eval("targetElem.parentNode.onmouseover = function() { top.ICEcoder.overFileFolder('"+newMouseOver[1]+"','"+newMouseOver[3]+"');}");
|
eval("targetElem.parentNode.onmouseover = function() { top.ICEcoder.overFileFolder('"+newMouseOver[1]+"','"+newMouseOver[3]+"');}");
|
||||||
targetElemPerms = document.getElementById('filesFrame').contentWindow.document.getElementById(shortURL.replace(/\//g,"|")+"_perms");
|
eval("targetElem.parentNode.title = newMouseOver[3];");
|
||||||
|
targetElemPerms = document.getElementById('filesFrame').contentWindow.document.getElementById(shortURL+"_perms");
|
||||||
targetElemPerms.id = location.replace(/\//g,"|") + "|" + file + "_perms";
|
targetElemPerms.id = location.replace(/\//g,"|") + "|" + file + "_perms";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1060,7 +1055,7 @@ var ICEcoder = {
|
|||||||
// Exclude a few keys...
|
// Exclude a few keys...
|
||||||
// Escape (27), Caps Lock (20), Shift, CTRL, Alt, Pause/Break (16-19), Left, Up, Right, Down (37-40), Num Lock, Scroll Lock (144-145),
|
// Escape (27), Caps Lock (20), Shift, CTRL, Alt, Pause/Break (16-19), Left, Up, Right, Down (37-40), Num Lock, Scroll Lock (144-145),
|
||||||
// Insert, Delete (45,46), Page Up, Page Down, End, Home (33-36), Left Win Key, Right Win Key (91-92), F1-F12 (112-123)
|
// Insert, Delete (45,46), Page Up, Page Down, End, Home (33-36), Left Win Key, Right Win Key (91-92), F1-F12 (112-123)
|
||||||
if (key!=27 && key!=20 && (key<16||key>19) && (key<37||key>40) && (key!=144||key!=145) && (key!=45||key!=46) && (key<33||key>36) && (key!=91||key!=92) && (key<112||key>123)) {
|
if (!top.ICEcoder.ctrlKeyDown && key!=27 && key!=20 && (key<16||key>19) && (key<37||key>40) && (key!=144||key!=145) && (key!=45||key!=46) && (key<33||key>36) && (key!=91||key!=92) && (key<112||key>123)) {
|
||||||
ICEcoder.changedContent[ICEcoder.selectedTab-1] = cM.historySize().undo > 0 ? 1 : 0;
|
ICEcoder.changedContent[ICEcoder.selectedTab-1] = cM.historySize().undo > 0 ? 1 : 0;
|
||||||
ICEcoder.redoTabHighlight(ICEcoder.selectedTab);
|
ICEcoder.redoTabHighlight(ICEcoder.selectedTab);
|
||||||
}
|
}
|
||||||
@@ -1099,13 +1094,21 @@ var ICEcoder = {
|
|||||||
|
|
||||||
// Test if we need to show a drag cursor or not
|
// Test if we need to show a drag cursor or not
|
||||||
dragCursorTest: function() {
|
dragCursorTest: function() {
|
||||||
var winH, cursorName;
|
var winH, cursorName, diffX;
|
||||||
|
|
||||||
|
diffX = top.ICEcoder.mouseX - top.ICEcoder.diffStartX;
|
||||||
|
if (top.ICEcoder.draggingTab!==false && top.ICEcoder.diffStartX && (diffX <= -10 || diffX >= 10)) {
|
||||||
|
if (top.ICEcoder.mouseX > parseInt(top.ICEcoder.files.style.width,10)) {
|
||||||
|
top.ICEcoder.tabDragMouseX = top.ICEcoder.mouseX - parseInt(top.ICEcoder.files.style.width,10) - top.ICEcoder.tabDragMouseXStart;
|
||||||
|
top.ICEcoder.tabDragMove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (top.ICEcoder.ready) {
|
if (top.ICEcoder.ready) {
|
||||||
winH = window.innerWidth ? window.innerHeight : document.body.clientHeight;
|
winH = window.innerWidth ? window.innerHeight : document.body.clientHeight;
|
||||||
if (!top.ICEcoder.mouseDown) {top.ICEcoder.draggingFilesW = false};
|
if (!top.ICEcoder.mouseDown) {top.ICEcoder.draggingFilesW = false};
|
||||||
|
|
||||||
cursorName = ((top.ICEcoder.mouseX > top.ICEcoder.filesW-7 && top.ICEcoder.mouseX < top.ICEcoder.filesW+7 && top.ICEcoder.mouseY > 40 && top.ICEcoder.mouseY < (winH-30)) || top.ICEcoder.draggingFilesW)
|
cursorName = (!ICEcoder.draggingTab && ((top.ICEcoder.mouseX > top.ICEcoder.filesW-7 && top.ICEcoder.mouseX < top.ICEcoder.filesW+7 && top.ICEcoder.mouseY > 40 && top.ICEcoder.mouseY < (winH-30)) || top.ICEcoder.draggingFilesW))
|
||||||
? "w-resize"
|
? "w-resize"
|
||||||
: "auto";
|
: "auto";
|
||||||
if (top.ICEcoder.content.contentWindow.document && top.ICEcoder.filesFrame.contentWindow) {
|
if (top.ICEcoder.content.contentWindow.document && top.ICEcoder.filesFrame.contentWindow) {
|
||||||
@@ -1321,10 +1324,12 @@ var ICEcoder = {
|
|||||||
|
|
||||||
// Opens the last files we had open
|
// Opens the last files we had open
|
||||||
autoOpenFiles: function() {
|
autoOpenFiles: function() {
|
||||||
for (var i=0;i<top.ICEcoder.previousFiles.length;i++) {
|
if (top.ICEcoder.previousFiles.length>0 && top.ICEcoder.ask('Open previous files?\n\n'+top.ICEcoder.previousFiles.length+' files:\n'+top.ICEcoder.previousFiles.join('\n').replace(/\|/g,"/").replace(new RegExp(top.docRoot+top.iceRoot,'gi'),""))) {
|
||||||
top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink=top.ICEcoder.previousFiles[i].replace('|','/');
|
for (var i=0;i<top.ICEcoder.previousFiles.length;i++) {
|
||||||
top.ICEcoder.thisFileFolderType='file';
|
top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink=top.ICEcoder.previousFiles[i].replace('|','/');
|
||||||
top.ICEcoder.openFile();
|
top.ICEcoder.thisFileFolderType='file';
|
||||||
|
top.ICEcoder.openFile();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1446,51 +1451,6 @@ var ICEcoder = {
|
|||||||
top.ICEcoder.filesFrame.contentWindow.frames['fileControl'].location.href="plugins/zip-it/index.php?zip="+tgt;
|
top.ICEcoder.filesFrame.contentWindow.frames['fileControl'].location.href="plugins/zip-it/index.php?zip="+tgt;
|
||||||
},
|
},
|
||||||
|
|
||||||
// Tab dragging start
|
|
||||||
handleDragStart: function(e) {
|
|
||||||
this.style.opacity = '0.2';
|
|
||||||
ICEcoder.dragSrcEl = this;
|
|
||||||
e.dataTransfer.effectAllowed = 'move';
|
|
||||||
e.dataTransfer.setData('text/html', this.innerHTML);
|
|
||||||
},
|
|
||||||
|
|
||||||
// Tab dragging over tabs
|
|
||||||
handleDragOver: function(e) {
|
|
||||||
if (e.preventDefault) {e.preventDefault()}
|
|
||||||
e.dataTransfer.dropEffect = 'move';
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
|
|
||||||
// Tab dropping on target
|
|
||||||
handleDrop: function(e) {
|
|
||||||
if (e.stopPropagation) {e.stopPropagation()}
|
|
||||||
if (ICEcoder.dragSrcEl != this) {
|
|
||||||
ICEcoder.dragSrcEl.innerHTML = this.innerHTML.split(" ")[0] + ICEcoder.dragSrcEl.innerHTML.substr(ICEcoder.dragSrcEl.innerHTML.indexOf(" "));
|
|
||||||
this.innerHTML = e.dataTransfer.getData('text/html').split(" ")[0] + this.innerHTML.substr(this.innerHTML.indexOf(" "));
|
|
||||||
var dragID = ICEcoder.dragSrcEl.id.substr(3)*1;
|
|
||||||
var dropID = this.id.substr(3)*1;
|
|
||||||
if(dragID==top.ICEcoder.selectedTab) {
|
|
||||||
var a; // array value
|
|
||||||
var b = dragID-1;
|
|
||||||
var c = dropID-1;
|
|
||||||
|
|
||||||
// Swap values for switched tabs in these arrays
|
|
||||||
a = [ICEcoder.changedContent, ICEcoder.openFiles, ICEcoder.openFileMDTs, ICEcoder.cMInstances];
|
|
||||||
for (var i=0;i<a.length;i++) {
|
|
||||||
a[i][b]=[a[i][c],a[i][c]=a[i][b]][0];
|
|
||||||
}
|
|
||||||
|
|
||||||
top.ICEcoder.switchTab(dropID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
|
|
||||||
// Tab drag ending
|
|
||||||
handleDragEnd: function(e) {
|
|
||||||
this.style.opacity = '1';
|
|
||||||
},
|
|
||||||
|
|
||||||
// Change permissions on a file/folder
|
// Change permissions on a file/folder
|
||||||
chmod: function(file,perms) {
|
chmod: function(file,perms) {
|
||||||
top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'));
|
top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'));
|
||||||
@@ -1591,11 +1551,11 @@ var ICEcoder = {
|
|||||||
top.ICEcoder.openFiles.push(top.ICEcoder.shortURL);
|
top.ICEcoder.openFiles.push(top.ICEcoder.shortURL);
|
||||||
|
|
||||||
// Setup a new tab
|
// 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>';
|
closeTabLink = '<a nohref onClick="top.ICEcoder.closeTab(parseInt(this.parentNode.id.slice(3),10))"><img src="images/nav-close.gif" 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)).style.display = "inline-block";
|
||||||
fileName = top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1];
|
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)).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(/\//,"") + "/";
|
top.document.getElementById('tab'+(top.ICEcoder.openFiles.length)).title = "/" + top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1].replace(/\//,"");
|
||||||
|
|
||||||
// Set the widths
|
// Set the widths
|
||||||
top.ICEcoder.setTabWidths();
|
top.ICEcoder.setTabWidths();
|
||||||
@@ -1634,21 +1594,20 @@ var ICEcoder = {
|
|||||||
top.ICEcoder.openFiles[tabNum-1] = newName;
|
top.ICEcoder.openFiles[tabNum-1] = newName;
|
||||||
|
|
||||||
// Setup a new tab
|
// 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>';
|
closeTabLink = '<a nohref onClick="top.ICEcoder.closeTab(parseInt(this.parentNode.id.slice(3),10))"><img src="images/nav-close.gif" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'" onMouseOut="this.style.backgroundColor=prevBG"></a>';
|
||||||
fileName = top.ICEcoder.openFiles[tabNum-1];
|
fileName = top.ICEcoder.openFiles[tabNum-1];
|
||||||
top.document.getElementById('tab'+tabNum).innerHTML = closeTabLink + " " + fileName.slice(fileName.lastIndexOf("/")).replace(/\//,"");
|
top.document.getElementById('tab'+tabNum).innerHTML = closeTabLink + " " + fileName.slice(fileName.lastIndexOf("/")).replace(/\//,"");
|
||||||
top.document.getElementById('tab'+tabNum).title = top.ICEcoder.openFiles[tabNum-1].replace(/\//,"") + "/";
|
top.document.getElementById('tab'+tabNum).title = "/" + top.ICEcoder.openFiles[tabNum-1].replace(/\//,"");
|
||||||
},
|
},
|
||||||
|
|
||||||
// Reset all tabs to be without a highlight and then highlight the selected
|
// Reset all tabs to be without a highlight and then highlight the selected
|
||||||
redoTabHighlight: function(selectedTab) {
|
redoTabHighlight: function(selectedTab) {
|
||||||
var cM, bgVPos, tColor, fileLink;
|
var bgVPos, tColor, fileLink;
|
||||||
|
|
||||||
cM = ICEcoder.getcMInstance();
|
|
||||||
for(var i=1;i<=ICEcoder.changedContent.length;i++) {
|
for(var i=1;i<=ICEcoder.changedContent.length;i++) {
|
||||||
if (document.getElementById('closeTabButton'+i)) {
|
if (document.getElementById('tab'+i).childNodes[0]) {
|
||||||
document.getElementById('closeTabButton'+i).style.backgroundColor = ICEcoder.changedContent[i-1]==1
|
document.getElementById('tab'+i).childNodes[0].childNodes[0].style.backgroundColor = ICEcoder.changedContent[i-1]==1
|
||||||
? "#b00" : "rgba(255,255,255,0.3)";
|
? "#b00" : "transparent";
|
||||||
}
|
}
|
||||||
tColor = i==selectedTab ? "#000" : "#fff";
|
tColor = i==selectedTab ? "#000" : "#fff";
|
||||||
if ("undefined" != typeof top.ICEcoder.openFiles[i-1] && top.ICEcoder.openFiles[i-1] != "/[NEW]") {
|
if ("undefined" != typeof top.ICEcoder.openFiles[i-1] && top.ICEcoder.openFiles[i-1] != "/[NEW]") {
|
||||||
@@ -1663,7 +1622,7 @@ var ICEcoder = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// Close the tab upon request
|
// Close the tab upon request
|
||||||
closeTab: function(closeTabNum) {
|
closeTab: function(closeTabNum, dontSetPV) {
|
||||||
var cM, okToRemove, closeFileName;
|
var cM, okToRemove, closeFileName;
|
||||||
cM = ICEcoder.getcMInstance();
|
cM = ICEcoder.getcMInstance();
|
||||||
okToRemove = true;
|
okToRemove = true;
|
||||||
@@ -1681,9 +1640,6 @@ var ICEcoder = {
|
|||||||
top.document.getElementById('tab'+i).title = top.document.getElementById('tab'+(i+1)).title;
|
top.document.getElementById('tab'+i).title = top.document.getElementById('tab'+(i+1)).title;
|
||||||
ICEcoder.openFiles[i-1] = ICEcoder.openFiles[i];
|
ICEcoder.openFiles[i-1] = ICEcoder.openFiles[i];
|
||||||
ICEcoder.openFileMDTs[i-1] = ICEcoder.openFileMDTs[i];
|
ICEcoder.openFileMDTs[i-1] = ICEcoder.openFileMDTs[i];
|
||||||
|
|
||||||
// reduce the tab reference number on the closeTab link by 1
|
|
||||||
top.document.getElementById('tab'+i).innerHTML = top.document.getElementById('tab'+i).innerHTML.replace(("closeTab("+(i+1)+")"),"closeTab("+i+")").replace(("closeTabButton"+(i+1)),"closeTabButton"+i);
|
|
||||||
}
|
}
|
||||||
// hide the instance we're closing by setting the hide class and removing from the array
|
// hide the instance we're closing by setting the hide class and removing from the array
|
||||||
ICEcoder.content.contentWindow['cM'+top.ICEcoder.cMInstances[closeTabNum-1]].getWrapperElement().style.display = "none";
|
ICEcoder.content.contentWindow['cM'+top.ICEcoder.cMInstances[closeTabNum-1]].getWrapperElement().style.display = "none";
|
||||||
@@ -1715,7 +1671,9 @@ var ICEcoder = {
|
|||||||
// Remove any highlighting from the file manager
|
// Remove any highlighting from the file manager
|
||||||
top.ICEcoder.selectDeselectFile('deselect',top.ICEcoder.filesFrame.contentWindow.document.getElementById(closeFileName.replace(/\//g,"|")));
|
top.ICEcoder.selectDeselectFile('deselect',top.ICEcoder.filesFrame.contentWindow.document.getElementById(closeFileName.replace(/\//g,"|")));
|
||||||
|
|
||||||
top.ICEcoder.setPreviousFiles();
|
if (!dontSetPV) {
|
||||||
|
top.ICEcoder.setPreviousFiles();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Lastly, stop it from trying to also switch tab
|
// Lastly, stop it from trying to also switch tab
|
||||||
top.ICEcoder.canSwitchTabs=false;
|
top.ICEcoder.canSwitchTabs=false;
|
||||||
@@ -1725,23 +1683,171 @@ var ICEcoder = {
|
|||||||
|
|
||||||
// Close all tabs
|
// Close all tabs
|
||||||
closeAllTabs: function() {
|
closeAllTabs: function() {
|
||||||
for (var i=top.ICEcoder.cMInstances.length; i>0; i--) {
|
if (ICEcoder.ask("Close all tabs?")) {
|
||||||
top.ICEcoder.closeTab(i);
|
for (var i=top.ICEcoder.cMInstances.length; i>0; i--) {
|
||||||
|
top.ICEcoder.closeTab(i, i>1? true:false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// Set the tabs width
|
// Set the tabs width
|
||||||
setTabWidths: function() {
|
setTabWidths: function() {
|
||||||
var availWidth, tabWidth, thisWidth;
|
var availWidth, avgWidth, tabWidth, lastLeft, lastWidth;
|
||||||
|
|
||||||
availWidth = parseInt(top.ICEcoder.content.style.width,10)-41-24-10; // - left margin - new tab - right margin
|
availWidth = parseInt(top.ICEcoder.content.style.width,10)-41-24-10; // - left margin - new tab - right margin
|
||||||
avgWidth = (availWidth/top.ICEcoder.openFiles.length)-18;
|
avgWidth = (availWidth/top.ICEcoder.openFiles.length)-18;
|
||||||
|
tabWidth = -18; // Incl 18px offset
|
||||||
|
lastLeft = 41;
|
||||||
|
lastWidth = 0;
|
||||||
|
top.ICEcoder.tabLeftPos = [];
|
||||||
|
|
||||||
for (var i=0;i<top.ICEcoder.openFiles.length;i++) {
|
for (var i=0;i<top.ICEcoder.openFiles.length;i++) {
|
||||||
thisWidth = parseInt(avgWidth*i,10) - parseInt(avgWidth*(i-1),10);
|
tabWidth = top.ICEcoder.openFiles.length*(150+18) > availWidth ? parseInt(avgWidth*i,10) - parseInt(avgWidth*(i-1),10) : 150;
|
||||||
tabWidth = top.ICEcoder.openFiles.length*(150+18) > availWidth ? thisWidth : 150;
|
lastLeft = i==0 ? 41 : parseInt(top.document.getElementById('tab'+(i)).style.left,10);
|
||||||
|
lastWidth = i==0 ? 0 : parseInt(top.document.getElementById('tab'+(i)).style.width,10)+18;
|
||||||
|
top.document.getElementById('tab'+(i+1)).style.left = (lastLeft+lastWidth) + "px";
|
||||||
top.document.getElementById('tab'+(i+1)).style.width = tabWidth + "px";
|
top.document.getElementById('tab'+(i+1)).style.width = tabWidth + "px";
|
||||||
|
top.ICEcoder.tabLeftPos.push(lastLeft+lastWidth);
|
||||||
}
|
}
|
||||||
|
top.document.getElementById('newTab').style.left = (lastLeft+lastWidth+tabWidth+18) + "px";
|
||||||
|
},
|
||||||
|
|
||||||
|
// Tab dragging start
|
||||||
|
tabDragStart: function(tab) {
|
||||||
|
top.ICEcoder.draggingTab = tab;
|
||||||
|
top.ICEcoder.diffStartX = top.ICEcoder.mouseX;
|
||||||
|
top.ICEcoder.tabDragMouseXStart = (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 lastTabWidth, thisLeft, dragTabNo, tabWidth;
|
||||||
|
|
||||||
|
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, tempArray;
|
||||||
|
|
||||||
|
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) {
|
||||||
|
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 a, b, changedContent = [], openFiles = [], openFileMDTs = [], cMInstances = [], selectedTabWillBe;
|
||||||
|
|
||||||
|
a = [ICEcoder.changedContent, ICEcoder.openFiles, ICEcoder.openFileMDTs, ICEcoder.cMInstances];
|
||||||
|
b = [changedContent, openFiles, openFileMDTs, cMInstances];
|
||||||
|
for (var i=0;i<a.length;i++) {
|
||||||
|
for (var j=0;j<a[i].length;j++) {
|
||||||
|
b[i].push(a[i][newOrder[j]-1]);
|
||||||
|
}
|
||||||
|
a[i] = b[i];
|
||||||
|
}
|
||||||
|
for (var i=0;i<newOrder.length;i++) {
|
||||||
|
document.getElementById('tab'+newOrder[i]).id = "tab" + (i+1) + ".temp";
|
||||||
|
if (top.ICEcoder.selectedTab == newOrder[i]) {
|
||||||
|
selectedTabWillBe = (i+1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (var i=0;i<newOrder.length;i++) {
|
||||||
|
document.getElementById('tab'+(i+1)+'.temp').id = "tab"+(i+1);
|
||||||
|
}
|
||||||
|
if (top.document.getElementById('tab'+selectedTabWillBe)) {
|
||||||
|
top.document.getElementById('tab'+selectedTabWillBe).className = "tab tabSlide";
|
||||||
|
}
|
||||||
|
ICEcoder.changedContent = a[0];
|
||||||
|
ICEcoder.openFiles = a[1];
|
||||||
|
ICEcoder.openFileMDTs = a[2];
|
||||||
|
ICEcoder.cMInstances = a[3];
|
||||||
|
top.ICEcoder.setTabWidths();
|
||||||
|
top.ICEcoder.switchTab(selectedTabWillBe);
|
||||||
|
},
|
||||||
|
|
||||||
|
// Alphabetize tabs
|
||||||
|
alphaTabs: function() {
|
||||||
|
var currentArray, currentArrayFull, alphaArray, nextValue, nextPos;
|
||||||
|
|
||||||
|
currentArray = [];
|
||||||
|
currentArrayFull = [];
|
||||||
|
alphaArray = [];
|
||||||
|
for (var i=0;i<top.ICEcoder.openFiles.length;i++) {
|
||||||
|
currentArray.push(top.ICEcoder.openFiles[i].slice(top.ICEcoder.openFiles[i].lastIndexOf('/')+1));
|
||||||
|
currentArrayFull.push(top.ICEcoder.openFiles[i]);
|
||||||
|
top.document.getElementById('tab'+(i+1)).className = "tab tabSlide";
|
||||||
|
}
|
||||||
|
while (currentArray.length>0) {
|
||||||
|
nextValue = currentArray[0];
|
||||||
|
nextValueFull = currentArrayFull[0];
|
||||||
|
nextPos = 0;
|
||||||
|
for (var i=0;i<currentArray.length;i++) {
|
||||||
|
if (currentArray[i] < nextValue) {
|
||||||
|
nextValue = currentArray[i];
|
||||||
|
nextValueFull = top.ICEcoder.openFiles[top.ICEcoder.openFiles.indexOf(currentArrayFull[i])];
|
||||||
|
nextPos = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
alphaArray.push((top.ICEcoder.openFiles.indexOf(nextValueFull)+1));
|
||||||
|
currentArray.splice(nextPos,1);
|
||||||
|
currentArrayFull.splice(nextPos,1);
|
||||||
|
}
|
||||||
|
top.ICEcoder.sortTabs(alphaArray);
|
||||||
},
|
},
|
||||||
|
|
||||||
// ==============
|
// ==============
|
||||||
@@ -1887,19 +1993,12 @@ var ICEcoder = {
|
|||||||
lineNo = cM.getCursor().line;
|
lineNo = cM.getCursor().line;
|
||||||
whiteSpace = cM.getLine(lineNo).length - cM.getLine(lineNo).replace(/^\s\s*/, '').length;
|
whiteSpace = cM.getLine(lineNo).length - cM.getLine(lineNo).replace(/^\s\s*/, '').length;
|
||||||
content = cM.getLine(lineNo).slice(whiteSpace);
|
content = cM.getLine(lineNo).slice(whiteSpace);
|
||||||
if (content.slice(0,2)=="f ") {
|
if (content.slice(0,8)=="function") {
|
||||||
top.ICEcoder.doSnippet('f ','function VAR() {\nINDENT\tCURSOR\nINDENT}');
|
top.ICEcoder.doSnippet('function','function VAR() {\nINDENT\tCURSOR\nINDENT}');
|
||||||
} else if (content.slice(0,2)=="if") {
|
} else if (content.slice(0,2)=="if") {
|
||||||
top.ICEcoder.doSnippet('if','if (CURSOR) {\nINDENT\t\nINDENT}');
|
top.ICEcoder.doSnippet('if','if (CURSOR) {\nINDENT\t\nINDENT}');
|
||||||
} else if (content.slice(0,3)=="for") {
|
} else if (content.slice(0,3)=="for") {
|
||||||
top.ICEcoder.doSnippet('for','for (var i=0; i<CURSOR; i++) {\nINDENT\t\nINDENT}');
|
top.ICEcoder.doSnippet('for','for (var i=0; i<CURSOR; i++) {\nINDENT\t\nINDENT}');
|
||||||
} else {
|
|
||||||
cM.operation(function(){
|
|
||||||
var msg = document.createElement("iframe");
|
|
||||||
msg.src = "lib/snippet-display.php";
|
|
||||||
msg.className = "snippetFrame";
|
|
||||||
top.ICEcoder.snippetLine = cM.addLineWidget(cM.getCursor().line, msg, {coverGutter: false, noHScroll: true});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1934,16 +2033,5 @@ var ICEcoder = {
|
|||||||
cM.focus();
|
cM.focus();
|
||||||
top.ICEcoder.removeSnippet();
|
top.ICEcoder.removeSnippet();
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
// Remove snippet panel
|
|
||||||
removeSnippet: function() {
|
|
||||||
var cM;
|
|
||||||
|
|
||||||
cM = ICEcoder.getcMInstance();
|
|
||||||
if (top.ICEcoder.snippetLine!==false) {
|
|
||||||
cM.removeLineWidget(top.ICEcoder.snippetLine);
|
|
||||||
}
|
|
||||||
top.ICEcoder.snippetLine = false;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -45,8 +45,8 @@ include($settingsFile);
|
|||||||
|
|
||||||
// Add ICEcoder settings to beginning of $ICEcoder array
|
// Add ICEcoder settings to beginning of $ICEcoder array
|
||||||
$ICEcoder = array(
|
$ICEcoder = array(
|
||||||
"versionNo" => "1.5",
|
"versionNo" => "1.6",
|
||||||
"codeMirrorDir" => "CodeMirror-3.0",
|
"codeMirrorDir" => "CodeMirror-3.01",
|
||||||
"demoMode" => false
|
"demoMode" => false
|
||||||
)+$ICEcoder;
|
)+$ICEcoder;
|
||||||
|
|
||||||
@@ -147,15 +147,20 @@ if ($_SESSION['loggedIn'] && isset($_GET["saveFiles"]) && $_GET['saveFiles']) {
|
|||||||
// Replace our previousFiles var with the the current
|
// Replace our previousFiles var with the the current
|
||||||
$repPosStart = strpos($settingsContents,'previousFiles" => "')+20;
|
$repPosStart = strpos($settingsContents,'previousFiles" => "')+20;
|
||||||
$repPosEnd = strpos($settingsContents,'",',$repPosStart)-$repPosStart;
|
$repPosEnd = strpos($settingsContents,'",',$repPosStart)-$repPosStart;
|
||||||
if (!$demoMode && $_GET['saveFiles']!="CLEAR") {
|
if (!$demoMode) {
|
||||||
$saveFiles=strClean($_GET['saveFiles']);
|
if ($_GET['saveFiles']!="CLEAR") {
|
||||||
$saveFilesArray = explode(",",$saveFiles);
|
$saveFiles=strClean($_GET['saveFiles']);
|
||||||
$saveFiles="";
|
$saveFilesArray = explode(",",$saveFiles);
|
||||||
for ($i=0;$i<count($saveFilesArray);$i++) {
|
$saveFiles="";
|
||||||
$saveFilesArray[$i] = str_replace("/","|",$docRoot).$saveFilesArray[$i];
|
for ($i=0;$i<count($saveFilesArray);$i++) {
|
||||||
$saveFiles .= $saveFilesArray[$i].",";
|
$saveFilesArray[$i] = str_replace("/","|",$docRoot).$saveFilesArray[$i];
|
||||||
|
$saveFiles .= $saveFilesArray[$i].",";
|
||||||
|
}
|
||||||
|
$saveFiles = rtrim($saveFiles,",");
|
||||||
|
} else {
|
||||||
|
$saveFilesArray = array();
|
||||||
|
$saveFiles = "";
|
||||||
}
|
}
|
||||||
$saveFiles = rtrim($saveFiles,",");
|
|
||||||
$settingsContents = substr($settingsContents,0,$repPosStart).$saveFiles.substr($settingsContents,($repPosStart+$repPosEnd),strlen($settingsContents));
|
$settingsContents = substr($settingsContents,0,$repPosStart).$saveFiles.substr($settingsContents,($repPosStart+$repPosEnd),strlen($settingsContents));
|
||||||
// Now update the config file
|
// Now update the config file
|
||||||
$fh = fopen($settingsFile, 'w') or die("Can't update config file. Please set public write permissions on lib/".$settingsFile." and press refresh");
|
$fh = fopen($settingsFile, 'w') or die("Can't update config file. Please set public write permissions on lib/".$settingsFile." and press refresh");
|
||||||
@@ -227,8 +232,10 @@ if ($_SESSION['loggedIn']) {
|
|||||||
$onLoadExtras .= ";top.ICEcoder.content.style.visibility='visible'";
|
$onLoadExtras .= ";top.ICEcoder.content.style.visibility='visible'";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((!$_SESSION['loggedIn'] || $ICEcoder["accountPassword"] == "") && !strpos($_SERVER['SCRIPT_NAME'],"lib/settings.php")) {
|
||||||
|
header('Location: lib/settings.php');
|
||||||
// If we're due to show the settings screen
|
// If we're due to show the settings screen
|
||||||
if (!$_SESSION['loggedIn']) {
|
} elseif (!$_SESSION['loggedIn']) {
|
||||||
// If the password hasn't been set and we're setting it
|
// If the password hasn't been set and we're setting it
|
||||||
if ($ICEcoder["accountPassword"] == "" && isset($_POST['accountPassword'])) {
|
if ($ICEcoder["accountPassword"] == "" && isset($_POST['accountPassword'])) {
|
||||||
$password = generateHash(strClean($_POST['accountPassword']));
|
$password = generateHash(strClean($_POST['accountPassword']));
|
||||||
@@ -280,8 +287,4 @@ echo $ICEcoder["accountPassword"] == "" ? "Setup" : "Login";
|
|||||||
</html>
|
</html>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!$_SESSION['loggedIn'] || $ICEcoder["accountPassword"] == "") && !strpos($_SERVER['SCRIPT_NAME'],"lib/settings.php")) {
|
|
||||||
header('Location: lib/settings.php');
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
<?php include("lib/settings.php");?>
|
|
||||||
<!DOCTYPE html>
|
|
||||||
|
|
||||||
<html style="margin: 0">
|
|
||||||
<head>
|
|
||||||
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> snippet display</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
||||||
<meta name="robots" content="noindex, nofollow">
|
|
||||||
<style type="text/css">
|
|
||||||
body {font-family: arial; font-size: 10px; background: #ccc}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body style="margin: 5px">
|
|
||||||
|
|
||||||
<table border="0" cellpadding="0" cellspacing="0" width="500">
|
|
||||||
<tr valign="top"><td style="padding-bottom: 5px; font-size: 11px"><b>abbreviation plus CTRL+space</td><td style="font-size: 11px"><b>produces</b></td></tr>
|
|
||||||
<tr valign="top"><td>f name</td><td style="padding-bottom: 5px">function name() {...}</td></tr>
|
|
||||||
<tr valign="top"><td>if</td><td style="padding-bottom: 5px">if () {...}</td></tr>
|
|
||||||
<tr valign="top"><td>for</td><td style="padding-bottom: 5px">for (var i=0; i<; i++) {...}</td></tr>
|
|
||||||
</table>
|
|
||||||
<br><br>
|
|
||||||
Tip: If you have Emmet installed, also try tab key after your abbreviation
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<span onClick="top.ICEcoder.removeSnippet()" style="position: absolute; top: 5px; right: 5px; height: 11px; background: #444; margin: 1px 0 0 5px; border-radius: 6px; cursor: pointer"><img src="../images/nav-close.gif"></span>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
BIN
plugins/wireframecc/icon.png
Normal file
BIN
plugins/wireframecc/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Reference in New Issue
Block a user