Compare commits

..

53 Commits
v1.1 ... v1.3

Author SHA1 Message Date
Matt Pass
22e6228a08 Version 1.3 2012-12-24 13:16:00 +00:00
Matt Pass
b757e42c88 JS hint icon altered
Now includes word HINT
2012-12-24 12:53:01 +00:00
Matt Pass
fdf1ef1cb7 Now considering indents and better templates
Indents are now considered when completing the snippet
Replaced the mix of various template elements with uppercase
alternatives (VAR, INDENT & CURSOR)
2012-12-21 08:43:25 +00:00
Matt Pass
4797ff84d8 Quick effort at getting snippet notations working
You can now press CTRL+space to have your shorthand notation completed.
2 options for function and if setup so far.
What I've written is a pretty horrible hacky effort to get this working.
It does work but needs a LOT of refining.
2012-12-20 22:12:27 +00:00
Matt Pass
3937d733f0 QS var cleaning, removing test logs and /
strClean on GET var selectedFiles
Remove 2 x console.logs
Remove commented text
2 x areas need first slash removing and ending with a slash
Need to var thisWidth to avoid global
2012-12-20 17:15:26 +00:00
Matt Pass
0328643c7c Now only loads file if it exists
if file_exists needs now wraps load PHP and JS code to allow escaping
and server message when files don't exist
2012-12-18 09:15:13 +00:00
Matt Pass
80c73523e3 No need to globally replace end colon
There will be only one
2012-12-18 08:49:07 +00:00
Matt Pass
8c5747798d Tabs now have closelink fist as it's RTL and clear first slash and end
with one for same reason
Else if conditions to give better perf
newBlock has a z-index of 1000 to show above code
Show titles on tab hovers
New setTabWidths function to reset tab widths on demand
2012-12-17 09:06:46 +00:00
Matt Pass
bdf6dbd096 Meta noindex, nofollow, set & clear gutter marks
Meta robots of noindex, nofollow to stop it being indexed by search
engines
Set & clear gutter with line no etc, need to look at using this for code
folding
2012-12-17 09:04:21 +00:00
Matt Pass
0eaef469f9 Tabs change color hover 2012-12-17 08:59:59 +00:00
Matt Pass
f2d3615e26 Tabs RTL dir, r-align, nowrap, hidden overflow
This is to allow them to be cropped off to the left side if not big
enough
2012-12-17 08:52:28 +00:00
Matt Pass
24f05a1c03 Meta robots noindex, nofollow
Don't allow ICEcoder installations to be indexed by search engines
Remove a couple of console logs from testing.
2012-12-17 08:50:11 +00:00
Matt Pass
570642d820 Meta robots noindex, no follow & dont selectTheme
Don't want ICEcoder installs showing up on search engine results
Also no need to selectTheme onChange of linewrapping select menu
2012-12-17 08:48:41 +00:00
Matt Pass
fd794f99d2 UTF-8 and meta robots noindex, nofollow
Need UTF-8 settings like other pages and don't want ICEcoder
installation showing up on search engine results
2012-12-17 08:47:41 +00:00
Matt Pass
9a95bae6ba Meta robots noindex, nofollow
To stop ICEcoder showing up on search engine results
2012-12-17 08:46:43 +00:00
Matt Pass
1b04504617 Find in selectedFiles & fix to find in filenames
Get an array of selectedFiles if there is one
Fix by resetting foundInSelected on each loop
targetURL is now lowercase as standard
Only provide results if it's a file
Also only provide results if the beginning of the path matches and
either the targetURL is the same or if it forms the beginning
Set $bFile = true if the file which contains our match doesn't match the
selected file
2012-12-17 08:40:37 +00:00
Matt Pass
2a2cd81149 Pass thru list of selected files on find/replace
If we choose selected files when performing a find/replace, build up a
colon seperated list and tack on as a querysting
2012-12-17 08:29:12 +00:00
Matt Pass
2bb961b7a8 Now only loads & runs if JSHint is available
Script only loads if file is available
Processes in function only run if JSHINT is available
2012-12-13 09:16:13 +00:00
Matt Pass
01b035d7af Clear or set JS Hints based on codeAssist
On toggle of codeAssist and being false, clear all JS Hint widgets in
all tabs
If turned on though, set in current tab
Run updateHints on switching tab (helps complete above step)
2012-12-13 08:56:53 +00:00
Matt Pass
8d0de398fd Only if codeAssist is on run JS Hint 2012-12-13 08:54:21 +00:00
Matt Pass
2ebec54476 Line Wrapping and Banned Paths Options
New options available to set in the settings screen
Also passes through to useNewSettings function for in session changes
A couple of other minor changes to style and layout
2012-12-12 17:56:43 +00:00
Matt Pass
b66d5fe8d3 Slight tweaks to CSS and commented code 2012-12-12 09:23:58 +00:00
Matt Pass
0f989f249f Moving function to the info & display section 2012-12-12 09:23:02 +00:00
Matt Pass
6980bdcf7f No need for 3rd arg here 2012-12-11 18:05:11 +00:00
Matt Pass
975a016974 Added width setting twice 2012-12-11 18:04:57 +00:00
Matt Pass
4be1b45896 Upgrading to CM v3 from v3 RC2
Upgrading to official v3 released now it's been released
2012-12-11 17:35:57 +00:00
Matt Pass
8e10824189 Sent argument and returned objected are different
It now takes a {line, ch} object as second argument, instead of an
integer, and will return a {from: {line, ch}, to: {line, ch}} object.
2012-12-11 11:53:06 +00:00
Matt Pass
1a881b4eaf JS Hint available as icon
Takes user to website for now
2012-12-10 17:57:17 +00:00
Matt Pass
2a9e91dd55 JS Hint Icon styles, vars & clear & set timeout
New styles for icon shown in widget
Var waiting used by setTimeout and and widgets array
Set & clear timeouts on change of editor content
2012-12-10 17:56:45 +00:00
Matt Pass
725ea8999a Load the JS Hint plugin JS file 2012-12-10 17:54:59 +00:00
Matt Pass
3427b736ec New updateHints function for JS Hint
Calls on JS Hint and returns with any errors and shows as a widget under
relevant line
This example code taken from CodeMirror's Widgets example
2012-12-10 17:54:43 +00:00
Matt Pass
1dde9d0198 JS Hint plugin added
Added as a plugin, will make optional in the future as a few hooks in
ICEcoder's code by default
2012-12-10 17:52:48 +00:00
Matt Pass
7577c3552d Folding on tag & braces again now
Folds according to the content/lang type at the cursor.
Nest step is to set the cursor to the clicked line, get the type and set
cursor back again, then we know what we can fold on.
2012-12-04 18:07:36 +00:00
Matt Pass
30de655fb2 CSS alts and moving to new on function
No longer setting BG color or color on CodeMirror class
onCursorActivity, onChange, onScroll and onGutterClick now set outside
of main codeMirror object and appended
Using addLineClass now instead of setLineClass
2012-12-03 19:14:20 +00:00
Matt Pass
09cf5589f5 Use addLineClass and removeLineClass
These are used in place of setLineClass now
2012-12-03 19:11:15 +00:00
Matt Pass
b206f8ab78 Remove caretLocType in nest & add/removeLineClass
Don't end the nestDisplay with the caretLocType, this is shown already
near the line/chr counter
For some reason, the array pos of the visible tabs is 4 not 5
Use new removeLineClass and addLineClass methods instead of setLineClass
2012-12-03 19:10:36 +00:00
Matt Pass
f358cdea5b Upgrading to CodeMirror v3 RC2 2012-12-03 19:04:16 +00:00
Matt Pass
14fe45bda8 Version 1.2 2012-12-01 14:35:49 +00:00
Matt Pass
72ff461b45 Nesting tags now have BG chevrons
Slight adjust to make text in footer look in line
'cursor nest locaton' wording starts with lowercase c
BG gif added which contains start, middle and end chevron graphics
Now showing DIV containing BG for start, middle or end chunks between
next tag names
2012-12-01 14:35:03 +00:00
Matt Pass
96fe7d46ba Scroll selected range into view
On hovering mouse over nest tags, scroll the start of the selected range
into view
2012-11-28 17:26:45 +00:00
Matt Pass
d40cdeb65e Syntax tidy up
Removed commented code, simplify parens & tabbed formatting
2012-11-28 17:04:01 +00:00
mattpass
4130df7bf9 Merge pull request #104 from kucerarichard/master
bannedPaths setting added and ignore Drupal modules as standard
2012-11-28 08:49:43 -08:00
Matt Pass
6e176cdda7 Upgrade to CodeMirror 2.36 2012-11-28 16:47:52 +00:00
Rich Kucera
bdb171dc6d add banned paths 2012-11-28 10:57:57 -05:00
Matt Pass
801471a105 3 new themes added
Ambiance altered to not include background image
(avoids file being 26k, instead 3k)
2012-11-25 16:58:55 +00:00
Matt Pass
f86cb53bd9 Standardise font size to 13px 2012-11-25 16:58:14 +00:00
Matt Pass
435e1b3b4b Now pastes files and folders
Also includes, sub folders & files
2012-11-25 16:22:36 +00:00
Matt Pass
4b17d76144 Extend 10 tabs to 100 tabs
10 tabs can sometimes be too few no one should ideally need more than
100 tabs open so this is a good new level.
Doesn't appear to impact on DOM or JS at all, especially as I don't need
to rework code to move to an unlimited tabs setup instead.
Having a limit also helps save crashing or bogging down the browser.
2012-11-25 14:18:36 +00:00
Matt Pass
d96ebe4282 Password protect based on ICEcoder password 2012-11-21 18:24:57 +00:00
Matt Pass
e5c5e7dc5e Terminal plugin added
Will die if in demoMode or not loggedIn
Code needs revising to enable extra login, set sudo etc if necessary?
2012-11-21 17:50:30 +00:00
Matt Pass
fe593dcb09 demoMode no longer saves opened files list 2012-11-18 11:10:13 +00:00
Matt Pass
b1056a19a3 Restrict demo mode to load only
Cannot only make new folder, paste, rename, replace text in file, change
perms, delete or save if demoMode is false
2012-11-17 18:43:32 +00:00
Matt Pass
048c47f7f3 demoMode setting added
demoMode bool added to ICEcoder array, false by default
If set to true and we have a password, set logginIn to true
$demoMode var equivalent to array var
demoMode must be false to possibly allow saving
2012-11-17 18:41:54 +00:00
40 changed files with 9168 additions and 3363 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1,174 +0,0 @@
.CodeMirror {
line-height: 1em;
font-family: monospace;
/* Necessary so the scrollbar can be absolutely positioned within the wrapper on Lion. */
position: relative;
/* This prevents unwanted scrollbars from showing up on the body and wrapper in IE. */
overflow: hidden;
}
.CodeMirror-scroll {
overflow: auto;
height: 300px;
/* This is needed to prevent an IE[67] bug where the scrolled content
is visible outside of the scrolling box. */
position: relative;
outline: none;
}
/* Vertical scrollbar */
.CodeMirror-scrollbar {
position: absolute;
right: 0; top: 0;
overflow-x: hidden;
overflow-y: scroll;
z-index: 5;
}
.CodeMirror-scrollbar-inner {
/* This needs to have a nonzero width in order for the scrollbar to appear
in Firefox and IE9. */
width: 1px;
}
.CodeMirror-scrollbar.cm-sb-overlap {
/* Ensure that the scrollbar appears in Lion, and that it overlaps the content
rather than sitting to the right of it. */
position: absolute;
z-index: 1;
float: none;
right: 0;
min-width: 12px;
}
.CodeMirror-scrollbar.cm-sb-nonoverlap {
min-width: 12px;
}
.CodeMirror-scrollbar.cm-sb-ie7 {
min-width: 18px;
}
.CodeMirror-gutter {
position: absolute; left: 0; top: 0;
z-index: 10;
background-color: #f7f7f7;
border-right: 1px solid #eee;
min-width: 2em;
height: 100%;
}
.CodeMirror-gutter-text {
color: #aaa;
text-align: right;
padding: .4em .2em .4em .4em;
white-space: pre !important;
cursor: default;
}
.CodeMirror-lines {
padding: .4em;
white-space: pre;
cursor: text;
}
.CodeMirror pre {
-moz-border-radius: 0;
-webkit-border-radius: 0;
-o-border-radius: 0;
border-radius: 0;
border-width: 0; margin: 0; padding: 0; background: transparent;
font-family: inherit;
font-size: inherit;
padding: 0; margin: 0;
white-space: pre;
word-wrap: normal;
line-height: inherit;
color: inherit;
overflow: visible;
}
.CodeMirror-wrap pre {
word-wrap: break-word;
white-space: pre-wrap;
word-break: normal;
}
.CodeMirror-wrap .CodeMirror-scroll {
overflow-x: hidden;
}
.CodeMirror textarea {
outline: none !important;
}
.CodeMirror pre.CodeMirror-cursor {
z-index: 10;
position: absolute;
visibility: hidden;
border-left: 1px solid black;
border-right: none;
width: 0;
}
.cm-keymap-fat-cursor pre.CodeMirror-cursor {
width: auto;
border: 0;
background: transparent;
background: rgba(0, 200, 0, .4);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800);
}
/* Kludge to turn off filter in ie9+, which also accepts rgba */
.cm-keymap-fat-cursor pre.CodeMirror-cursor:not(#nonsense_id) {
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
}
.CodeMirror pre.CodeMirror-cursor.CodeMirror-overwrite {}
.CodeMirror-focused pre.CodeMirror-cursor {
visibility: visible;
}
div.CodeMirror-selected { background: #d9d9d9; }
.CodeMirror-focused div.CodeMirror-selected { background: #d7d4f0; }
.CodeMirror-searching {
background: #ffa;
background: rgba(255, 255, 0, .4);
}
/* Default theme */
.cm-s-default span.cm-keyword {color: #708;}
.cm-s-default span.cm-atom {color: #219;}
.cm-s-default span.cm-number {color: #164;}
.cm-s-default span.cm-def {color: #00f;}
.cm-s-default span.cm-variable {color: black;}
.cm-s-default span.cm-variable-2 {color: #05a;}
.cm-s-default span.cm-variable-3 {color: #085;}
.cm-s-default span.cm-property {color: black;}
.cm-s-default span.cm-operator {color: black;}
.cm-s-default span.cm-comment {color: #a50;}
.cm-s-default span.cm-string {color: #a11;}
.cm-s-default span.cm-string-2 {color: #f50;}
.cm-s-default span.cm-meta {color: #555;}
.cm-s-default span.cm-error {color: #f00;}
.cm-s-default span.cm-qualifier {color: #555;}
.cm-s-default span.cm-builtin {color: #30a;}
.cm-s-default span.cm-bracket {color: #997;}
.cm-s-default span.cm-tag {color: #170;}
.cm-s-default span.cm-attribute {color: #00c;}
.cm-s-default span.cm-header {color: blue;}
.cm-s-default span.cm-quote {color: #090;}
.cm-s-default span.cm-hr {color: #999;}
.cm-s-default span.cm-link {color: #00c;}
span.cm-header, span.cm-strong {font-weight: bold;}
span.cm-em {font-style: italic;}
span.cm-emstrong {font-style: italic; font-weight: bold;}
span.cm-link {text-decoration: underline;}
span.cm-invalidchar {color: #f00;}
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
@media print {
/* Hide the cursor when printing */
.CodeMirror pre.CodeMirror-cursor {
visibility: hidden;
}
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,239 @@
/* BASICS */
.CodeMirror {
/* Set height, width, borders, and global font properties here */
font-family: monospace;
height: 300px;
}
.CodeMirror-scroll {
/* Set scrolling behaviour here */
overflow: auto;
}
/* PADDING */
.CodeMirror-lines {
padding: 4px 0; /* Vertical padding around content */
}
.CodeMirror pre {
padding: 0 4px; /* Horizontal padding of content */
}
.CodeMirror-scrollbar-filler {
background-color: white; /* The little square between H and V scrollbars */
}
/* GUTTER */
.CodeMirror-gutters {
border-right: 1px solid #ddd;
background-color: #f7f7f7;
}
.CodeMirror-linenumbers {}
.CodeMirror-linenumber {
padding: 0 3px 0 5px;
min-width: 20px;
text-align: right;
color: #999;
}
/* CURSOR */
.CodeMirror pre.CodeMirror-cursor {
border-left: 1px solid black;
}
/* Shown when moving in bi-directional text */
.CodeMirror pre.CodeMirror-secondarycursor {
border-left: 1px solid silver;
}
.cm-keymap-fat-cursor pre.CodeMirror-cursor {
width: auto;
border: 0;
background: transparent;
background: rgba(0, 200, 0, .4);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800);
}
/* Kludge to turn off filter in ie9+, which also accepts rgba */
.cm-keymap-fat-cursor pre.CodeMirror-cursor:not(#nonsense_id) {
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
}
/* Can style cursor different in overwrite (non-insert) mode */
.CodeMirror pre.CodeMirror-cursor.CodeMirror-overwrite {}
/* DEFAULT THEME */
.cm-s-default .cm-keyword {color: #708;}
.cm-s-default .cm-atom {color: #219;}
.cm-s-default .cm-number {color: #164;}
.cm-s-default .cm-def {color: #00f;}
.cm-s-default .cm-variable {color: black;}
.cm-s-default .cm-variable-2 {color: #05a;}
.cm-s-default .cm-variable-3 {color: #085;}
.cm-s-default .cm-property {color: black;}
.cm-s-default .cm-operator {color: black;}
.cm-s-default .cm-comment {color: #a50;}
.cm-s-default .cm-string {color: #a11;}
.cm-s-default .cm-string-2 {color: #f50;}
.cm-s-default .cm-meta {color: #555;}
.cm-s-default .cm-error {color: #f00;}
.cm-s-default .cm-qualifier {color: #555;}
.cm-s-default .cm-builtin {color: #30a;}
.cm-s-default .cm-bracket {color: #997;}
.cm-s-default .cm-tag {color: #170;}
.cm-s-default .cm-attribute {color: #00c;}
.cm-s-default .cm-header {color: blue;}
.cm-s-default .cm-quote {color: #090;}
.cm-s-default .cm-hr {color: #999;}
.cm-s-default .cm-link {color: #00c;}
.cm-negative {color: #d44;}
.cm-positive {color: #292;}
.cm-header, .cm-strong {font-weight: bold;}
.cm-em {font-style: italic;}
.cm-emstrong {font-style: italic; font-weight: bold;}
.cm-link {text-decoration: underline;}
.cm-invalidchar {color: #f00;}
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
/* STOP */
/* The rest of this file contains styles related to the mechanics of
the editor. You probably shouldn't touch them. */
.CodeMirror {
line-height: 1;
position: relative;
overflow: hidden;
}
.CodeMirror-scroll {
/* 30px is the magic margin used to hide the element's real scrollbars */
/* See overflow: hidden in .CodeMirror, and the paddings in .CodeMirror-sizer */
margin-bottom: -30px; margin-right: -30px;
padding-bottom: 30px; padding-right: 30px;
height: 100%;
outline: none; /* Prevent dragging from highlighting the element */
position: relative;
}
.CodeMirror-sizer {
position: relative;
}
/* The fake, visible scrollbars. Used to force redraw during scrolling
before actuall scrolling happens, thus preventing shaking and
flickering artifacts. */
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler {
position: absolute;
z-index: 6;
display: none;
}
.CodeMirror-vscrollbar {
right: 0; top: 0;
overflow-x: hidden;
overflow-y: scroll;
}
.CodeMirror-hscrollbar {
bottom: 0; left: 0;
overflow-y: hidden;
overflow-x: scroll;
}
.CodeMirror-scrollbar-filler {
right: 0; bottom: 0;
z-index: 6;
}
.CodeMirror-gutters {
position: absolute; left: 0; top: 0;
height: 100%;
z-index: 3;
}
.CodeMirror-gutter {
height: 100%;
display: inline-block;
/* Hack to make IE7 behave */
*zoom:1;
*display:inline;
}
.CodeMirror-gutter-elt {
position: absolute;
cursor: default;
z-index: 4;
}
.CodeMirror-lines {
cursor: text;
}
.CodeMirror pre {
/* Reset some styles that the rest of the page might have set */
-moz-border-radius: 0; -webkit-border-radius: 0; -o-border-radius: 0; border-radius: 0;
border-width: 0;
background: transparent;
font-family: inherit;
font-size: inherit;
margin: 0;
white-space: pre;
word-wrap: normal;
line-height: inherit;
color: inherit;
z-index: 2;
position: relative;
overflow: visible;
}
.CodeMirror-wrap pre {
word-wrap: break-word;
white-space: pre-wrap;
word-break: normal;
}
.CodeMirror-linebackground {
position: absolute;
left: 0; right: 0; top: 0; bottom: 0;
z-index: 0;
}
.CodeMirror-linewidget {
position: relative;
z-index: 2;
}
.CodeMirror-wrap .CodeMirror-scroll {
overflow-x: hidden;
}
.CodeMirror-measure {
position: absolute;
width: 100%; height: 0px;
overflow: hidden;
visibility: hidden;
}
.CodeMirror-measure pre { position: static; }
.CodeMirror pre.CodeMirror-cursor {
position: absolute;
visibility: hidden;
border-right: none;
width: 0;
}
.CodeMirror-focused pre.CodeMirror-cursor {
visibility: visible;
}
.CodeMirror-selected { background: #d9d9d9; }
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
.CodeMirror-searching {
background: #ffa;
background: rgba(255, 255, 0, .4);
}
/* IE7 hack to prevent it from returning funny offsetTops on the spans */
.CodeMirror span { *vertical-align: text-bottom; }
@media print {
/* Hide the cursor when printing */
.CodeMirror pre.CodeMirror-cursor {
visibility: hidden;
}
}

View File

@@ -0,0 +1,6 @@
.cm-s-ambiance.CodeMirror {
-webkit-box-shadow: none;
-moz-box-shadow: none;
-o-box-shadow: none;
box-shadow: none;
}

File diff suppressed because one or more lines are too long

View File

@@ -1,9 +1,9 @@
/* Port of TextMate's Blackboard theme */ /* Port of TextMate's Blackboard theme */
.cm-s-blackboard { background: #0C1021; color: #F8F8F8; } .cm-s-blackboard.CodeMirror { background: #0C1021; color: #F8F8F8; }
.cm-s-blackboard .CodeMirror-selected { background: #253B76 !important; } .cm-s-blackboard .CodeMirror-selected { background: #253B76 !important; }
.cm-s-blackboard .CodeMirror-gutter { background: #0C1021; border-right: 0; } .cm-s-blackboard .CodeMirror-gutters { background: #0C1021; border-right: 0; }
.cm-s-blackboard .CodeMirror-gutter-text { color: #888; } .cm-s-blackboard .CodeMirror-linenumber { color: #888; }
.cm-s-blackboard .CodeMirror-cursor { border-left: 1px solid #A7A7A7 !important; } .cm-s-blackboard .CodeMirror-cursor { border-left: 1px solid #A7A7A7 !important; }
.cm-s-blackboard .cm-keyword { color: #FBDE2D; } .cm-s-blackboard .cm-keyword { color: #FBDE2D; }

View File

@@ -1,7 +1,7 @@
.cm-s-cobalt { background: #002240; color: white; } .cm-s-cobalt.CodeMirror { background: #002240; color: white; }
.cm-s-cobalt div.CodeMirror-selected { background: #b36539 !important; } .cm-s-cobalt div.CodeMirror-selected { background: #b36539 !important; }
.cm-s-cobalt .CodeMirror-gutter { background: #002240; border-right: 1px solid #aaa; } .cm-s-cobalt .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; }
.cm-s-cobalt .CodeMirror-gutter-text { color: #d0d0d0; } .cm-s-cobalt .CodeMirror-linenumber { color: #d0d0d0; }
.cm-s-cobalt .CodeMirror-cursor { border-left: 1px solid white !important; } .cm-s-cobalt .CodeMirror-cursor { border-left: 1px solid white !important; }
.cm-s-cobalt span.cm-comment { color: #08f; } .cm-s-cobalt span.cm-comment { color: #08f; }

View File

@@ -1,7 +1,7 @@
.cm-s-erlang-dark { background: #002240; color: white; } .cm-s-erlang-dark.CodeMirror { background: #002240; color: white; }
.cm-s-erlang-dark div.CodeMirror-selected { background: #b36539 !important; } .cm-s-erlang-dark div.CodeMirror-selected { background: #b36539 !important; }
.cm-s-erlang-dark .CodeMirror-gutter { background: #002240; border-right: 1px solid #aaa; } .cm-s-erlang-dark .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; }
.cm-s-erlang-dark .CodeMirror-gutter-text { color: #d0d0d0; } .cm-s-erlang-dark .CodeMirror-linenumber { color: #d0d0d0; }
.cm-s-erlang-dark .CodeMirror-cursor { border-left: 1px solid white !important; } .cm-s-erlang-dark .CodeMirror-cursor { border-left: 1px solid white !important; }
.cm-s-erlang-dark span.cm-atom { color: #845dc4; } .cm-s-erlang-dark span.cm-atom { color: #845dc4; }

View File

@@ -9,15 +9,15 @@ Ported to CodeMirror by Peter Kroon
font-family: 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', 'Monaco', Courier, monospace !important; font-family: 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', 'Monaco', Courier, monospace !important;
} }
.cm-s-lesser-dark { background: #262626; color: #EBEFE7; text-shadow: 0 -1px 1px #262626; } .cm-s-lesser-dark.CodeMirror { background: #262626; color: #EBEFE7; text-shadow: 0 -1px 1px #262626; }
.cm-s-lesser-dark div.CodeMirror-selected {background: #45443B !important;} /* 33322B*/ .cm-s-lesser-dark div.CodeMirror-selected {background: #45443B !important;} /* 33322B*/
.cm-s-lesser-dark .CodeMirror-cursor { border-left: 1px solid white !important; } .cm-s-lesser-dark .CodeMirror-cursor { border-left: 1px solid white !important; }
.cm-s-lesser-dark .CodeMirror-lines { margin-left:3px; margin-right:3px; }/*editable code holder*/ .cm-s-lesser-dark pre { padding: 0 8px; }/*editable code holder*/
div.CodeMirror span.CodeMirror-matchingbracket { color: #7EFC7E; }/*65FC65*/ div.CodeMirror span.CodeMirror-matchingbracket { color: #7EFC7E; }/*65FC65*/
.cm-s-lesser-dark .CodeMirror-gutter { background: #262626; border-right:1px solid #aaa; padding-right:3px; min-width:2.5em; } .cm-s-lesser-dark .CodeMirror-gutters { background: #262626; border-right:1px solid #aaa; }
.cm-s-lesser-dark .CodeMirror-gutter-text { color: #777; } .cm-s-lesser-dark .CodeMirror-linenumber { color: #777; }
.cm-s-lesser-dark span.cm-keyword { color: #599eff; } .cm-s-lesser-dark span.cm-keyword { color: #599eff; }
.cm-s-lesser-dark span.cm-atom { color: #C2B470; } .cm-s-lesser-dark span.cm-atom { color: #C2B470; }

View File

@@ -1,9 +1,9 @@
/* Based on Sublime Text's Monokai theme */ /* Based on Sublime Text's Monokai theme */
.cm-s-monokai {background: #272822; color: #f8f8f2;} .cm-s-monokai.CodeMirror {background: #272822; color: #f8f8f2;}
.cm-s-monokai div.CodeMirror-selected {background: #49483E !important;} .cm-s-monokai div.CodeMirror-selected {background: #49483E !important;}
.cm-s-monokai .CodeMirror-gutter {background: #272822; border-right: 0px;} .cm-s-monokai .CodeMirror-gutters {background: #272822; border-right: 0px;}
.cm-s-monokai .CodeMirror-gutter-text {color: #d0d0d0;} .cm-s-monokai .CodeMirror-linenumber {color: #d0d0d0;}
.cm-s-monokai .CodeMirror-cursor {border-left: 1px solid #f8f8f0 !important;} .cm-s-monokai .CodeMirror-cursor {border-left: 1px solid #f8f8f0 !important;}
.cm-s-monokai span.cm-comment {color: #75715e;} .cm-s-monokai span.cm-comment {color: #75715e;}

View File

@@ -1,9 +1,9 @@
/* Loosely based on the Midnight Textmate theme */ /* Loosely based on the Midnight Textmate theme */
.cm-s-night { background: #0a001f; color: #f8f8f8; } .cm-s-night.CodeMirror { background: #0a001f; color: #f8f8f8; }
.cm-s-night div.CodeMirror-selected { background: #447 !important; } .cm-s-night div.CodeMirror-selected { background: #447 !important; }
.cm-s-night .CodeMirror-gutter { background: #0a001f; border-right: 1px solid #aaa; } .cm-s-night .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; }
.cm-s-night .CodeMirror-gutter-text { color: #f8f8f8; } .cm-s-night .CodeMirror-linenumber { color: #f8f8f8; }
.cm-s-night .CodeMirror-cursor { border-left: 1px solid white !important; } .cm-s-night .CodeMirror-cursor { border-left: 1px solid white !important; }
.cm-s-night span.cm-comment { color: #6900a1; } .cm-s-night span.cm-comment { color: #6900a1; }

View File

@@ -1,9 +1,9 @@
.cm-s-rubyblue { font:13px/1.4em Trebuchet, Verdana, sans-serif; } /* - customized editor font - */ .cm-s-rubyblue { font:13px/1.4em Trebuchet, Verdana, sans-serif; } /* - customized editor font - */
.cm-s-rubyblue { background: #112435; color: white; } .cm-s-rubyblue.CodeMirror { background: #112435; color: white; }
.cm-s-rubyblue div.CodeMirror-selected { background: #38566F !important; } .cm-s-rubyblue div.CodeMirror-selected { background: #38566F !important; }
.cm-s-rubyblue .CodeMirror-gutter { background: #1F4661; border-right: 7px solid #3E7087; min-width:2.5em; } .cm-s-rubyblue .CodeMirror-gutters { background: #1F4661; border-right: 7px solid #3E7087; }
.cm-s-rubyblue .CodeMirror-gutter-text { color: white; } .cm-s-rubyblue .CodeMirror-linenumber { color: white; }
.cm-s-rubyblue .CodeMirror-cursor { border-left: 1px solid white !important; } .cm-s-rubyblue .CodeMirror-cursor { border-left: 1px solid white !important; }
.cm-s-rubyblue span.cm-comment { color: #999; font-style:italic; line-height: 1em; } .cm-s-rubyblue span.cm-comment { color: #999; font-style:italic; line-height: 1em; }

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,26 @@
.cm-s-twilight.CodeMirror { background: #141414; color: #f7f7f7; } /**/
.cm-s-twilight .CodeMirror-selected { background: #323232 !important; } /**/
.cm-s-twilight .CodeMirror-gutters { background: #222; border-right: 1px solid #aaa; }
.cm-s-twilight .CodeMirror-linenumber { color: #aaa; }
.cm-s-twilight .CodeMirror-cursor { border-left: 1px solid white !important; }
.cm-s-twilight .cm-keyword { color: #f9ee98; } /**/
.cm-s-twilight .cm-atom { color: #FC0; }
.cm-s-twilight .cm-number { color: #ca7841; } /**/
.cm-s-twilight .cm-def { color: #8DA6CE; }
.cm-s-twilight span.cm-variable-2, .cm-s-twilight span.cm-tag { color: #607392; } /**/
.cm-s-twilight span.cm-variable-3, .cm-s-twilight span.cm-def { color: #607392; } /**/
.cm-s-twilight .cm-operator { color: #cda869; } /**/
.cm-s-twilight .cm-comment { color:#777; font-style:italic; font-weight:normal; } /**/
.cm-s-twilight .cm-string { color:#8f9d6a; font-style:italic; } /**/
.cm-s-twilight .cm-string-2 { color:#bd6b18 } /*?*/
.cm-s-twilight .cm-meta { background-color:#141414; color:#f7f7f7; } /*?*/
.cm-s-twilight .cm-error { border-bottom: 1px solid red; }
.cm-s-twilight .cm-builtin { color: #cda869; } /*?*/
.cm-s-twilight .cm-tag { color: #997643; } /**/
.cm-s-twilight .cm-attribute { color: #d6bb6d; } /*?*/
.cm-s-twilight .cm-header { color: #FF6400; }
.cm-s-twilight .cm-hr { color: #AEAEAE; }
.cm-s-twilight .cm-link { color:#ad9361; font-style:italic; text-decoration:none; } /**/

View File

@@ -1,10 +1,10 @@
/* Taken from the popular Visual Studio Vibrant Ink Schema */ /* Taken from the popular Visual Studio Vibrant Ink Schema */
.cm-s-vibrant-ink { background: black; color: white; } .cm-s-vibrant-ink.CodeMirror { background: black; color: white; }
.cm-s-vibrant-ink .CodeMirror-selected { background: #35493c !important; } .cm-s-vibrant-ink .CodeMirror-selected { background: #35493c !important; }
.cm-s-vibrant-ink .CodeMirror-gutter { background: #002240; border-right: 1px solid #aaa; } .cm-s-vibrant-ink .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; }
.cm-s-vibrant-ink .CodeMirror-gutter-text { color: #d0d0d0; } .cm-s-vibrant-ink .CodeMirror-linenumber { color: #d0d0d0; }
.cm-s-vibrant-ink .CodeMirror-cursor { border-left: 1px solid white !important; } .cm-s-vibrant-ink .CodeMirror-cursor { border-left: 1px solid white !important; }
.cm-s-vibrant-ink .cm-keyword { color: #CC7832; } .cm-s-vibrant-ink .cm-keyword { color: #CC7832; }

View File

@@ -0,0 +1,46 @@
/*
Copyright (C) 2011 by MarkLogic Corporation
Author: Mike Brevoort <mike@brevoort.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
.cm-s-xq-dark.CodeMirror { background: #0a001f; color: #f8f8f8; }
.cm-s-xq-dark span.CodeMirror-selected { background: #a8f !important; }
.cm-s-xq-dark .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; }
.cm-s-xq-dark .CodeMirror-linenumber { color: #f8f8f8; }
.cm-s-xq-dark .CodeMirror-cursor { border-left: 1px solid white !important; }
.cm-s-xq-dark span.cm-keyword {color: #FFBD40;}
.cm-s-xq-dark span.cm-atom {color: #6C8CD5;}
.cm-s-xq-dark span.cm-number {color: #164;}
.cm-s-xq-dark span.cm-def {color: #FFF; text-decoration:underline;}
.cm-s-xq-dark span.cm-variable {color: #FFF;}
.cm-s-xq-dark span.cm-variable-2 {color: #EEE;}
.cm-s-xq-dark span.cm-variable-3 {color: #DDD;}
.cm-s-xq-dark span.cm-property {}
.cm-s-xq-dark span.cm-operator {}
.cm-s-xq-dark span.cm-comment {color: gray;}
.cm-s-xq-dark span.cm-string {color: #9FEE00;}
.cm-s-xq-dark span.cm-meta {color: yellow;}
.cm-s-xq-dark span.cm-error {color: #f00;}
.cm-s-xq-dark span.cm-qualifier {color: #FFF700;}
.cm-s-xq-dark span.cm-builtin {color: #30a;}
.cm-s-xq-dark span.cm-bracket {color: #cc7;}
.cm-s-xq-dark span.cm-tag {color: #FFBD40;}
.cm-s-xq-dark span.cm-attribute {color: #FFF700;}

View File

@@ -5,6 +5,7 @@
<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">
<link rel="stylesheet" href="<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror.css"> <link rel="stylesheet" href="<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror.css">
<!-- <!--
codemirror-compressed.js codemirror-compressed.js
@@ -18,14 +19,17 @@ if ($ICEcoder["theme"]=="default") {echo 'lib/editor.css';} else {echo $ICEcoder
$activeLineBG = $ICEcoder["theme"]=="eclipse" || $ICEcoder["theme"]=="elegant" || $ICEcoder["theme"]=="neat" ? "#ccc" : "#000"; $activeLineBG = $ICEcoder["theme"]=="eclipse" || $ICEcoder["theme"]=="elegant" || $ICEcoder["theme"]=="neat" ? "#ccc" : "#000";
?>"> ?>">
<style type="text/css"> <style type="text/css">
.CodeMirror {position: absolute; width: 0; background-color: #fff; color: #000; top: 0px; width: 100%; z-index: 1} .CodeMirror {position: absolute; top: 0px; width: 100%; font-size: 13px; z-index: 1}
.CodeMirror-scroll {height: auto; overflow: visible} .CodeMirror-scroll {} // was: height: auto; overflow: visible
/* Make sure this next one remains the 3rd item, updated with JS */ /* Make sure this next one remains the 3rd item, updated with JS */
.cm-s-activeLine {background: <?php echo $activeLineBG;?> !important} .cm-s-activeLine {background: <?php echo $activeLineBG;?> !important}
span.CodeMirror-matchhighlight {background: #555} span.CodeMirror-matchhighlight {background: #555}
.CodeMirror-focused span.CodeMirror-matchhighlight {color: #000; background: #555; !important} .CodeMirror-focused span.CodeMirror-matchhighlight {color: #000; background: #555; !important}
/* Make sure this next one remains the 6th item, updated with JS */ /* Make sure this next one remains the 6th item, updated with JS */
.cm-tab:after {position: relative; display: inline-block; width: 0; left: -1.4em; overflow: visible; color: #aaa; content: "<?php if($ICEcoder["visibleTabs"]) {echo '\\21e5';};?>";} .cm-tab:after {position: relative; display: inline-block; width: 0; left: -1.4em; overflow: visible; color: #aaa; content: "<?php if($ICEcoder["visibleTabs"]) {echo '\\21e5';};?>";}
.lint-error {font-family: arial; font-size: 80%; background: #ccc; color: #b00; padding: 3px 5px}
.lint-error-icon {background-color: #b00; color: #fff; font-weight: bold; border-radius: 50%; padding: 0 3px; margin-right: 5px}
.snippetFrame {border: 1px; width: 100%}
</style> </style>
</head> </head>
@@ -92,44 +96,17 @@ span.CodeMirror-matchhighlight {background: #555}
<script> <script>
function createNewCMInstance(num) { function createNewCMInstance(num) {
var fileName = top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]; var fileName = top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];
top.ICEcoder.foldStyle = '<span style="position: absolute; display: inline-block; width: 13px; height: 13px; left: 0; background-color: #b00; color: #fff; text-align: center; cursor: pointer"><span style="position: relative; left: -1px">+</span></span> %N%'; top.ICEcoder['cM'+num+'waiting'] = "";
var codeFoldTag = CodeMirror.newFoldFunction(CodeMirror.tagRangeFinder,top.ICEcoder.foldStyle); top.ICEcoder['cM'+num+'widgets'] = [];
var codeFoldBrace = CodeMirror.newFoldFunction(CodeMirror.braceRangeFinder,top.ICEcoder.foldStyle);
window['cM'+num] = CodeMirror(document.body, { window['cM'+num] = CodeMirror(document.body, {
mode: "application/x-httpd-php", mode: "application/x-httpd-php",
lineNumbers: true, lineNumbers: true,
lineWrapping: true, lineWrapping: top.ICEcoder.lineWrapping,
indentUnit: top.ICEcoder.tabWidth, indentUnit: top.ICEcoder.tabWidth,
tabSize: top.ICEcoder.tabWidth, tabSize: top.ICEcoder.tabWidth,
indentWithTabs: true, indentWithTabs: true,
electricChars: false, electricChars: false,
onCursorActivity: function(thisCM) {
top.ICEcoder.getCaretPosition();
top.ICEcoder.updateCharDisplay();
window['cM'+num].setLineClass(top.ICEcoder['cMActiveLine'+num], null);
if(!window['cM'+num].somethingSelected()) {
top.ICEcoder['cMActiveLine'+num] = window['cM'+num].setLineClass(window['cM'+num].getCursor().line, "cm-s-activeLine");
}
thisCM.matchHighlight("CodeMirror-matchhighlight");
top.ICEcoder.cssColorPreview();
},
onChange: function() {
// If we're not loading the file, it's a change, so update tab
if (!top.ICEcoder.loadingFile) {
top.ICEcoder.changedContent[top.ICEcoder.selectedTab-1] = 1;
top.ICEcoder.redoTabHighlight(top.ICEcoder.selectedTab);
}
top.ICEcoder.getCaretPosition();
top.ICEcoder.dontUpdateNest = false;
top.ICEcoder.updateCharDisplay();
top.ICEcoder.updateNestingIndicator();
if (top.ICEcoder.findMode) {
top.ICEcoder.results.splice(top.ICEcoder.findResult,1);
top.document.getElementById('results').innerHTML = top.ICEcoder.results.length + " results";
top.ICEcoder.findMode = false;
}
},
onKeyEvent: function(thisCM, e) { onKeyEvent: function(thisCM, e) {
top.ICEcoder.redoChangedContent(e); top.ICEcoder.redoChangedContent(e);
top.ICEcoder.findReplace('find',true,false); top.ICEcoder.findReplace('find',true,false);
@@ -173,10 +150,6 @@ function createNewCMInstance(num) {
}; };
lastKeyCode = e.keyCode; lastKeyCode = e.keyCode;
}, },
onScroll: function() {
top.ICEcoder.mouseDown=false;
},
onGutterClick: !fileName || (fileName && fileName.indexOf(".js") == -1 && fileName.indexOf(".coffee") == -1 && fileName.indexOf(".php") && fileName.indexOf(".rb") == -1) ? codeFoldTag : codeFoldBrace,
extraKeys: { extraKeys: {
"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",
@@ -185,12 +158,66 @@ function createNewCMInstance(num) {
} }
}); });
window['cM'+num].on("cursorActivity", function(thisCM) {
top.ICEcoder.getCaretPosition();
top.ICEcoder.updateCharDisplay();
window['cM'+num].removeLineClass(top.ICEcoder['cMActiveLine'+num], "background");
if(!window['cM'+num].somethingSelected()) {
top.ICEcoder['cMActiveLine'+num] = window['cM'+num].addLineClass(window['cM'+num].getCursor().line, "background","cm-s-activeLine");
}
thisCM.matchHighlight("CodeMirror-matchhighlight");
top.ICEcoder.cssColorPreview();
}
);
window['cM'+num].on("change", function(thisCM, changeObj) {
// If we're not loading the file, it's a change, so update tab
if (!top.ICEcoder.loadingFile) {
top.ICEcoder.changedContent[top.ICEcoder.selectedTab-1] = 1;
top.ICEcoder.redoTabHighlight(top.ICEcoder.selectedTab);
}
top.ICEcoder.getCaretPosition();
top.ICEcoder.dontUpdateNest = false;
top.ICEcoder.updateCharDisplay();
top.ICEcoder.updateNestingIndicator();
if (top.ICEcoder.findMode) {
top.ICEcoder.results.splice(top.ICEcoder.findResult,1);
top.document.getElementById('results').innerHTML = top.ICEcoder.results.length + " results";
top.ICEcoder.findMode = false;
}
if (top.ICEcoder.codeAssist) {
clearTimeout(window['cM'+num+'waiting']);
window['cM'+num+'waiting'] = setTimeout(top.ICEcoder.updateHints, 100);
}
}
);
window['cM'+num].on("scroll", function(thisCM) {
top.ICEcoder.mouseDown=false;
}
);
window['cM'+num].on("gutterClick", function(thisCM, line, gutter, clickEvent) {
["JavaScript","CoffeeScript","PHP","Ruby"].indexOf(top.ICEcoder.caretLocType) > -1
? codeFoldBrace(window['cM'+num], line) : codeFoldTag(window['cM'+num], line);
window['cM'+num].setGutterMarker(line, "CodeMirror-linenumbers", document.createTextNode("+ "+(line+1)));
setTimeout(function() {
window['cM'+num].setGutterMarker(line, "CodeMirror-linenumbers", null);
},1000);
}
);
// Now create the active line for this CodeMirror object // Now create the active line for this CodeMirror object
top.ICEcoder['cMActiveLine'+num] = window['cM'+num].setLineClass(0, "cm-s-activeLine"); top.ICEcoder['cMActiveLine'+num] = window['cM'+num].addLineClass(0, "background", "cm-s-activeLine");
}; };
// var top.ICEcoder.foldStyle = '<span style="position: absolute; display: inline-block; width: 13px; height: 13px; left: 0; background-color: #b00; color: #fff; text-align: center; cursor: pointer"><span style="position: relative; left: -1px">+</span></span> %N%';
var codeFoldTag = CodeMirror.newFoldFunction(CodeMirror.tagRangeFinder);
var codeFoldBrace = CodeMirror.newFoldFunction(CodeMirror.braceRangeFinder);
</script> </script>
<iframe name="snippetLoader" src="snippets/snippet-display.php" style="display: none"></iframe>
</body> </body>
</html> </html>

296
files.php
View File

@@ -1,141 +1,157 @@
<?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" 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>
<link rel="stylesheet" type="text/css" href="lib/files.css"> <meta name="robots" content="noindex, nofollow">
<script src="lib/ice-coder.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="lib/files.css">
</head> <script src="lib/ice-coder.js" type="text/javascript"></script>
</head>
<body onLoad="top.ICEcoder.fileManager()" onDblClick="top.ICEcoder.openFile()" onKeyDown="return top.ICEcoder.interceptKeys('files', event);" onKeyUp="top.ICEcoder.resetKeys(event);">
<body onLoad="top.ICEcoder.fileManager()" onDblClick="top.ICEcoder.openFile()" onKeyDown="return top.ICEcoder.interceptKeys('files', event);" onKeyUp="top.ICEcoder.resetKeys(event);">
<div title="Refresh" onClick="top.ICEcoder.refreshFileManager()" class="refresh"></div>
<div title="Refresh" onClick="top.ICEcoder.refreshFileManager()" class="refresh"></div>
<?php
// Function to sort given values alphabetically <?php
function alphasort($a, $b) { // Function to sort given values alphabetically
return strcasecmp($a->getPathname(), $b->getPathname()); function alphasort($a, $b) {
} return strcasecmp($a->getPathname(), $b->getPathname());
}
// Class to put forward the values for sorting
class SortingIterator implements IteratorAggregate { // Class to put forward the values for sorting
private $iterator = null; class SortingIterator implements IteratorAggregate {
public function __construct(Traversable $iterator, $callback) { private $iterator = null;
$array = iterator_to_array($iterator); public function __construct(Traversable $iterator, $callback) {
usort($array, $callback); $array = iterator_to_array($iterator);
$this->iterator = new ArrayIterator($array); usort($array, $callback);
} $this->iterator = new ArrayIterator($array);
public function getIterator() { }
return $this->iterator; public function getIterator() {
} return $this->iterator;
} }
}
// Get a full list of dirs & files and begin sorting using above class & function
$objectList = new SortingIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($docRoot.$iceRoot), RecursiveIteratorIterator::SELF_FIRST), 'alphasort'); class IgnorantRecursiveDirectoryIterator extends RecursiveDirectoryIterator {
function getChildren() {
// With that done, create arrays for out final ordered list and a temp container of files try {
$finalArray = $tempArray = array(); if (!isset($GLOBALS['ICEcoder']['bannedPaths']) ||
!in_array($this->key(), $GLOBALS['ICEcoder']['bannedPaths'])) {
// To start, push folders from object into finalArray, files into tempArray return parent::getChildren();
foreach ($objectList as $objectRef) { } else {
$fileFolderName = substr($objectRef->getPathname(), strlen($docRoot.$iceRoot)); return new RecursiveArrayIterator(array());
$canAdd = true; }
for ($i=0;$i<count($_SESSION['bannedFiles']);$i++) { } catch(UnexpectedValueException $e) {
if(strpos($fileFolderName,$_SESSION['bannedFiles'][$i])!==false) {$canAdd = false;} return new RecursiveArrayIterator(array());
} }
if ($objectRef->getFilename()!="." && $objectRef->getFilename()!=".." && $fileFolderName[strlen($fileFolderName)-1]!="/" && $canAdd) { }
$fileFolderName!="/" && is_dir($docRoot.$iceRoot.$fileFolderName) }
? array_push($finalArray,$fileFolderName)
: array_push($tempArray,$fileFolderName); // Get a full list of dirs & files and begin sorting using above class & function
} $objectList = new SortingIterator(new RecursiveIteratorIterator(new IgnorantRecursiveDirectoryIterator($docRoot.$iceRoot), RecursiveIteratorIterator::SELF_FIRST), 'alphasort');
}
// With that done, create arrays for out final ordered list and a temp container of files
// Now push root files onto the end of finalArray and splice from the temp, leaving only files that reside in subdirs $finalArray = $tempArray = array();
for ($i=0;$i<count($tempArray);$i++) {
if (count(explode("/",$tempArray[$i]))==2) { // To start, push folders from object into finalArray, files into tempArray
array_push($finalArray,$tempArray[$i]); foreach ($objectList as $objectRef) {
array_splice($tempArray,$i,1); $fileFolderName = substr($objectRef->getPathname(), strlen($docRoot.$iceRoot));
$i--; $canAdd = true;
} for ($i=0;$i<count($_SESSION['bannedFiles']);$i++) {
} if(strpos($fileFolderName,$_SESSION['bannedFiles'][$i])!==false) {$canAdd = false;}
}
// Lastly we push remaining files into the right subdirs in finalArray if ($objectRef->getFilename()!="." && $objectRef->getFilename()!=".." && $fileFolderName[strlen($fileFolderName)-1]!="/" && $canAdd) {
for ($i=0;$i<count($tempArray);$i++) { $fileFolderName!="/" && is_dir($docRoot.$iceRoot.$fileFolderName)
$insertAt = array_search(dirname($tempArray[$i]),$finalArray)+1; ? array_push($finalArray,$fileFolderName)
for ($j=$insertAt;$j<count($finalArray);$j++) { : array_push($tempArray,$fileFolderName);
if ( strcasecmp(dirname($finalArray[$j]), dirname($tempArray[$i]))==0 && }
strcasecmp(basename($finalArray[$j]), basename($tempArray[$i]))<0 || }
(strpos(dirname($finalArray[$j]),dirname($tempArray[$i]))===0 && substr($finalArray[$j],strlen(dirname($tempArray[$i])),1)=="/")) {
$insertAt++; // Now push root files onto the end of finalArray and splice from the temp, leaving only files that reside in subdirs
} for ($i=0;$i<count($tempArray);$i++) {
} if (count(explode("/",$tempArray[$i]))==2) {
array_splice($finalArray, $insertAt, 0, $tempArray[$i]); array_push($finalArray,$tempArray[$i]);
} array_splice($tempArray,$i,1);
$i--;
// Finally, we have our ordered list, so display in a UL }
$fileAtts = ""; }
if ($serverType=="Linux") {
$chmodInfo = substr(sprintf('%o', fileperms($docRoot.$iceRoot)), -3); // Lastly we push remaining files into the right subdirs in finalArray
$fileAtts = '<span style="color: #888; font-size: 8px" id="|_perms">'.$chmodInfo.'</span>'; for ($i=0;$i<count($tempArray);$i++) {
} $insertAt = array_search(dirname($tempArray[$i]),$finalArray)+1;
?> for ($j=$insertAt;$j<count($finalArray);$j++) {
<ul class="fileManager"> if ( strcasecmp(dirname($finalArray[$j]), dirname($tempArray[$i]))==0 &&
<li class="pft-directory"> strcasecmp(basename($finalArray[$j]), basename($tempArray[$i]))<0 ||
<a nohref title="/" onMouseOver="top.ICEcoder.overFileFolder('folder','/')" onMouseOut="top.ICEcoder.overFileFolder('folder','')" style="position: relative; left:-22px"> (strpos(dirname($finalArray[$j]),dirname($tempArray[$i]))===0 && substr($finalArray[$j],strlen(dirname($tempArray[$i])),1)=="/")) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $insertAt++;
<span id="|">/ }
<?php echo $iceRoot == "" ? "[ROOT]" : trim($iceRoot,"/");?> }
</span> array_splice($finalArray, $insertAt, 0, $tempArray[$i]);
<?php echo $fileAtts;?> }
</a>
</li> // Finally, we have our ordered list, so display in a UL
<?php $fileAtts = "";
$lastPath=""; if ($serverType=="Linux") {
$fileCount=0; $chmodInfo = substr(sprintf('%o', fileperms($docRoot.$iceRoot)), -3);
$fileBytes=0; $fileAtts = '<span style="color: #888; font-size: 8px" id="|_perms">'.$chmodInfo.'</span>';
$dirCount=0; }
for ($i=0;$i<count($finalArray);$i++) { ?>
$fileFolderName = str_replace("\\","/",$finalArray[$i]); <ul class="fileManager">
$type = is_dir($docRoot.$iceRoot.$fileFolderName) ? "folder" : "file"; <li class="pft-directory">
$type=="folder" ? $dirCount++ : $fileCount++; <a nohref title="/" onMouseOver="top.ICEcoder.overFileFolder('folder','/')" onMouseOut="top.ICEcoder.overFileFolder('folder','')" style="position: relative; left:-22px">
if ($type=="file") { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$fileBytes+=filesize($docRoot.$iceRoot.$fileFolderName); <span id="|">/
// Get extension (prefix 'ext-' to prevent invalid classes from extensions that begin with numbers) <?php echo $iceRoot == "" ? "[ROOT]" : trim($iceRoot,"/");?>
$ext = "ext-".pathinfo($docRoot.$iceRoot.$fileFolderName, PATHINFO_EXTENSION); </span>
} <?php echo $fileAtts;?>
$thisDepth = count(explode("/",$fileFolderName)); </a>
$lastDepth = count(explode("/",$lastPath)); </li>
if ($thisDepth > $lastDepth) {echo "<ul>\n";} <?php
if ($thisDepth < $lastDepth) { $lastPath="";
for ($j=$lastDepth;$j>$thisDepth;$j--) { $fileCount=0;
echo "</ul>\n"; $fileBytes=0;
} $dirCount=0;
} for ($i=0;$i<count($finalArray);$i++) {
if ($serverType=="Linux") { $fileFolderName = str_replace("\\","/",$finalArray[$i]);
$chmodInfo = substr(sprintf('%o', fileperms($docRoot.$iceRoot.$fileFolderName)), -3); $type = is_dir($docRoot.$iceRoot.$fileFolderName) ? "folder" : "file";
$fileAtts = '<span style="color: #888; font-size: 8px" id="'.str_replace($docRoot,"",str_replace("/","|",$fileFolderName)).'_perms">'.$chmodInfo.'</span>'; $type=="folder" ? $dirCount++ : $fileCount++;
} if ($type=="file") {
$type == "folder" ? $class = 'pft-directory' : $class = 'pft-file '.strtolower($ext); $fileBytes+=filesize($docRoot.$iceRoot.$fileFolderName);
echo "<li class=\"".$class."\"><a nohref title=\"$fileFolderName\" onMouseOver=\"top.ICEcoder.overFileFolder('$type','".str_replace($docRoot,"",str_replace("/","|",$fileFolderName))."')\" onMouseOut=\"top.ICEcoder.overFileFolder('$type','')\" style=\"position: relative; left:-22px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span id=\"".str_replace($docRoot,"",str_replace("/","|",$fileFolderName))."\">".basename($fileFolderName)."</span> ".$fileAtts."</a>\n"; // Get extension (prefix 'ext-' to prevent invalid classes from extensions that begin with numbers)
if ($i<count($finalArray)) {echo "</li>\n";} $ext = "ext-".pathinfo($docRoot.$iceRoot.$fileFolderName, PATHINFO_EXTENSION);
$lastPath = $fileFolderName; }
} $thisDepth = count(explode("/",$fileFolderName));
echo "</ul>\n</ul>\n"; $lastDepth = count(explode("/",$lastPath));
if ($thisDepth > $lastDepth) {echo "<ul>\n";}
// Output the JS vars if ($thisDepth < $lastDepth) {
echo "<script>\n"; for ($j=$lastDepth;$j>$thisDepth;$j--) {
echo "top.ICEcoder.dirCount="; echo "</ul>\n";
echo $dirCount ? $dirCount : "0"; }
echo ";\ntop.ICEcoder.fileCount="; }
echo $fileCount ? $fileCount : "0"; if ($serverType=="Linux") {
echo ";\ntop.ICEcoder.fileBytes="; $chmodInfo = substr(sprintf('%o', fileperms($docRoot.$iceRoot.$fileFolderName)), -3);
echo $fileBytes ? $fileBytes : "0"; $fileAtts = '<span style="color: #888; font-size: 8px" id="'.str_replace($docRoot,"",str_replace("/","|",$fileFolderName)).'_perms">'.$chmodInfo.'</span>';
echo ";\n</script>"; }
?> $type == "folder" ? $class = 'pft-directory' : $class = 'pft-file '.strtolower($ext);
echo "<li class=\"".$class."\"><a nohref title=\"$fileFolderName\" onMouseOver=\"top.ICEcoder.overFileFolder('$type','".str_replace($docRoot,"",str_replace("/","|",$fileFolderName))."')\" onMouseOut=\"top.ICEcoder.overFileFolder('$type','')\" style=\"position: relative; left:-22px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span id=\"".str_replace($docRoot,"",str_replace("/","|",$fileFolderName))."\">".basename($fileFolderName)."</span> ".$fileAtts."</a>\n";
<iframe name="fileControl" style="display: none"></iframe> if ($i<count($finalArray)) {echo "</li>\n";}
$lastPath = $fileFolderName;
</body> }
echo "</ul>\n</ul>\n";
// Output the JS vars
echo "<script>\n";
echo "top.ICEcoder.dirCount=";
echo $dirCount ? $dirCount : "0";
echo ";\ntop.ICEcoder.fileCount=";
echo $fileCount ? $fileCount : "0";
echo ";\ntop.ICEcoder.fileBytes=";
echo $fileBytes ? $fileBytes : "0";
echo ";\n</script>";
?>
<iframe name="fileControl" style="display: none"></iframe>
</body>
</html> </html>

BIN
images/nest-tag-bg.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 B

355
index.php
View File

@@ -1,175 +1,182 @@
<?php include("lib/settings.php"); <?php include("lib/settings.php");
// Check IP permissions // Check IP permissions
if (!in_array($_SERVER["REMOTE_ADDR"], $_SESSION['allowedIPs']) && !in_array("*", $_SESSION['allowedIPs'])) { if (!in_array($_SERVER["REMOTE_ADDR"], $_SESSION['allowedIPs']) && !in_array("*", $_SESSION['allowedIPs'])) {
header('Location: /'); header('Location: /');
}; };
$updateMsg = ''; $updateMsg = '';
// Check for updates // Check for updates
if ($ICEcoder["checkUpdates"]) { if ($ICEcoder["checkUpdates"]) {
$icv = json_encode(file_get_contents("http://icecoder.net/latest-version.txt")); $icv = json_encode(file_get_contents("http://icecoder.net/latest-version.txt"));
$icv = rtrim(ltrim($icv,'"'),'"\\n'); $icv = rtrim(ltrim($icv,'"'),'"\\n');
if ($ICEcoder["versionNo"]<$icv) { if ($ICEcoder["versionNo"]<$icv) {
$updateMsg = ';top.ICEcoder.message(\'ICEcoder '.$icv.' now released\n\nPlease upgrade\')'; $updateMsg = ';top.ICEcoder.message(\'ICEcoder '.$icv.' now released\n\nPlease upgrade\')';
} }
} }
?> ?>
<!DOCTYPE html> <!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" 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">
<meta name="robots" content="noindex, nofollow"> <meta name="robots" content="noindex, nofollow">
<link rel="stylesheet" type="text/css" href="lib/ice-coder.css"> <link rel="stylesheet" type="text/css" href="lib/ice-coder.css">
<link rel="icon" type="image/png" href="favicon.png"> <link rel="icon" type="image/png" href="favicon.png">
<script> <script>
iceRoot = "<?php echo $ICEcoder["root"]; ?>"; iceRoot = "<?php echo $ICEcoder["root"]; ?>";
window.onbeforeunload = function() { window.onbeforeunload = function() {
if (top.ICEcoder.changedContent.indexOf(1)>-1) { if (top.ICEcoder.changedContent.indexOf(1)>-1) {
return "You have some unsaved changes."; return "You have some unsaved changes.";
} }
} }
</script> </script>
<script language="JavaScript" src="lib/ice-coder.js"></script> <script language="JavaScript" src="lib/ice-coder.js"></script>
</head> <?php
if (file_exists(dirname(__FILE__)."/plugins/jshint/jshint.js")) {
<body onLoad="<?php echo '<script src="plugins/jshint/jshint.js"></script>';
echo 'top.ICEcoder.previousFiles = ['; }
if ($ICEcoder["previousFiles"]!="") { ?>
$openFilesArray = explode(",",$ICEcoder["previousFiles"]); </head>
echo "'".implode("','",$openFilesArray)."'";
} <body onLoad="<?php
echo "];top.ICEcoder.theme = '"; echo 'top.ICEcoder.previousFiles = [';
echo $ICEcoder["theme"]=="default" ? 'icecoder' : $ICEcoder["theme"]; if ($ICEcoder["previousFiles"]!="") {
echo "'"; $openFilesArray = explode(",",$ICEcoder["previousFiles"]);
echo ';top.ICEcoder.tabsIndent = '; echo "'".implode("','",$openFilesArray)."'";
echo $ICEcoder["tabsIndent"] ? 'true' : 'false'; }
echo ';top.ICEcoder.openLastFiles = '; echo "];top.ICEcoder.theme = '";
echo $ICEcoder["openLastFiles"] ? 'true' : 'false'; echo $ICEcoder["theme"]=="default" ? 'icecoder' : $ICEcoder["theme"];
echo ';top.ICEcoder.tabWidth = '; echo "'";
echo $ICEcoder["tabWidth"]; echo ';top.ICEcoder.tabsIndent = ';
?>;ICEcoder.init()<?php echo $updateMsg.$onLoadExtras;?>" onResize="ICEcoder.setLayout()" onKeyDown="return ICEcoder.interceptKeys('coder',event);" onKeyUp="parent.ICEcoder.resetKeys(event);"> echo $ICEcoder["tabsIndent"] ? 'true' : 'false';
echo ';top.ICEcoder.openLastFiles = ';
<div id="blackMask" class="blackMask" onClick="ICEcoder.showHide('hide',this)" onContextMenu="return false"> echo $ICEcoder["openLastFiles"] ? 'true' : 'false';
<div class="popupVCenter"> echo ';top.ICEcoder.lineWrapping = ';
<div class="popup" id="mediaContainer"></div> echo $ICEcoder["lineWrapping"] ? 'true' : 'false';
</div> echo ';top.ICEcoder.tabWidth = ';
</div> echo $ICEcoder["tabWidth"];
?>;ICEcoder.init()<?php echo $updateMsg.$onLoadExtras;?>" onResize="ICEcoder.setLayout()" onKeyDown="return ICEcoder.interceptKeys('coder',event);" onKeyUp="parent.ICEcoder.resetKeys(event);">
<div id="loadingMask" class="blackMask" style="visibility: visible" onContextMenu="return false">
<span class="progressBar" id="progressBar" style="-webkit-animation:fullexpand 10s ease-out; -moz-animation:fullexpand 10s ease-out"></span> <div id="blackMask" class="blackMask" onClick="ICEcoder.showHide('hide',this)" onContextMenu="return false">
<div class="popupVCenter"> <div class="popupVCenter">
<div class="popup"> <div class="popup" id="mediaContainer"></div>
<div class="circleOutside"></div> </div>
<div class="circleInside"></div> </div>
&nbsp;&nbsp;&nbsp;working...
</div> <div id="loadingMask" class="blackMask" style="visibility: visible" onContextMenu="return false">
</div> <span class="progressBar" id="progressBar" style="-webkit-animation:fullexpand 10s ease-out; -moz-animation:fullexpand 10s ease-out"></span>
</div> <div class="popupVCenter">
<div class="popup">
<div id="fileMenu" class="fileMenu" onMouseOver="ICEcoder.changeFilesW('expand')" onMouseOut="ICEcoder.changeFilesW('contract');this.style.display='none'" onContextMenu="return false"> <div class="circleOutside"></div>
<span id="folderMenuItems"> <div class="circleInside"></div>
<a href="javascript:top.ICEcoder.newFile()" onMouseOver="ICEcoder.showFileMenu()">New File</a> &nbsp;&nbsp;&nbsp;working...
<a href="javascript:top.ICEcoder.newFolder()" onMouseOver="ICEcoder.showFileMenu()">New Folder</a> </div>
<a href="javascript:top.ICEcoder.pasteFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Paste</a> </div>
</span> </div>
<a href="javascript:top.ICEcoder.deleteFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Delete</a>
<span id="singleFileMenuItems"> <div id="fileMenu" class="fileMenu" onMouseOver="ICEcoder.changeFilesW('expand')" onMouseOut="ICEcoder.changeFilesW('contract');this.style.display='none'" onContextMenu="return false">
<a href="javascript:top.ICEcoder.copyFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Copy</a> <span id="folderMenuItems">
<a href="javascript:top.ICEcoder.renameFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Rename</a> <a href="javascript:top.ICEcoder.newFile()" onMouseOver="ICEcoder.showFileMenu()">New File</a>
<a href="javascript:window.open(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">View Webpage</a> <a href="javascript:top.ICEcoder.newFolder()" onMouseOver="ICEcoder.showFileMenu()">New Folder</a>
</span> <a href="javascript:top.ICEcoder.pasteFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Paste</a>
<a href="javascript:top.ICEcoder.zipIt(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Zip It!</a> </span>
<a href="javascript:top.ICEcoder.propertiesScreen(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Properties</a> <a href="javascript:top.ICEcoder.deleteFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Delete</a>
</div> <span id="singleFileMenuItems">
<a href="javascript:top.ICEcoder.copyFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Copy</a>
<div id="header" class="header" onContextMenu="return false"> <a href="javascript:top.ICEcoder.renameFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Rename</a>
<div class="plugins" id="pluginsContainer"> <a href="javascript:window.open(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">View Webpage</a>
<?php echo $pluginsDisplay; ?> </span>
</div> <a href="javascript:top.ICEcoder.zipIt(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Zip It!</a>
<div class="version">v <?php echo $ICEcoder["versionNo"];?></div><img src="images/full-screen.gif" id="screenMode" class="screenModeIcon" onClick="top.ICEcoder.fullScreenSwitcher()"> <a href="javascript:top.ICEcoder.propertiesScreen(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Properties</a>
<img src="images/ice-coder.png" class="logo" onClick="ICEcoder.helpScreen()" onContextMenu="ICEcoder.settingsScreen()"> </div>
</div>
<div id="header" class="header" onContextMenu="return false">
<div id="files" class="files" onMouseOver="ICEcoder.changeFilesW('expand')" onMouseOut="ICEcoder.changeFilesW('contract'); top.document.getElementById('fileMenu').style.display='none';"> <div class="plugins" id="pluginsContainer">
<div class="account" id="account"> <?php echo $pluginsDisplay; ?>
<div class="accountOptions"> </div>
<div title="Save" onClick="ICEcoder.fMIcon('save')" id="fMSave" class="save"></div> <div class="version">v <?php echo $ICEcoder["versionNo"];?></div><img src="images/full-screen.gif" id="screenMode" class="screenModeIcon" onClick="top.ICEcoder.fullScreenSwitcher()">
<div title="Open" onClick="ICEcoder.fMIcon('open')" id="fMOpen" class="open"></div> <img src="images/ice-coder.png" class="logo" onClick="ICEcoder.helpScreen()" onContextMenu="ICEcoder.settingsScreen()">
<div title="New File" onClick="ICEcoder.fMIcon('newFile')" id="fMNewFile" class="newFile"></div> </div>
<div title="New Folder" onClick="ICEcoder.fMIcon('newFolder')" id="fMNewFolder" class="newFolder"></div>
<div title="Delete" onClick="ICEcoder.fMIcon('delete')" id="fMDelete" class="delete"></div> <div id="files" class="files" onMouseOver="ICEcoder.changeFilesW('expand')" onMouseOut="ICEcoder.changeFilesW('contract'); top.document.getElementById('fileMenu').style.display='none';">
<div title="Rename" onClick="ICEcoder.fMIcon('rename')" id="fMRename" class="rename"></div> <div class="account" id="account">
<div title="View" onClick="ICEcoder.fMIcon('view')" id="fMView" class="view"></div> <div class="accountOptions">
<div title="Save" onClick="ICEcoder.fMIcon('save')" id="fMSave" class="save"></div>
<div title="Lock" onClick="ICEcoder.lockUnlockNav()" id="fmLock" class="lock"></div> <div title="Open" onClick="ICEcoder.fMIcon('open')" id="fMOpen" class="open"></div>
</div> <div title="New File" onClick="ICEcoder.fMIcon('newFile')" id="fMNewFile" class="newFile"></div>
</div> <div title="New Folder" onClick="ICEcoder.fMIcon('newFolder')" id="fMNewFolder" class="newFolder"></div>
<iframe id="filesFrame" class="frame" name="ff" src="files.php" style="opacity: 0" onLoad="this.style.opacity='1';this.contentWindow.onscroll=function(){top.ICEcoder.mouseDown=false}"></iframe> <div title="Delete" onClick="ICEcoder.fMIcon('delete')" id="fMDelete" class="delete"></div>
<div class="serverMessage" id="serverMessage"></div> <div title="Rename" onClick="ICEcoder.fMIcon('rename')" id="fMRename" class="rename"></div>
</div> <div title="View" onClick="ICEcoder.fMIcon('view')" id="fMView" class="view"></div>
<div id="editor" class="editor"> <div title="Lock" onClick="ICEcoder.lockUnlockNav()" id="fmLock" class="lock"></div>
<div id="tabsBar" class="tabsBar" onContextMenu="return false"> </div>
<?php </div>
for ($i=1;$i<=10;$i++) { <iframe id="filesFrame" class="frame" name="ff" src="files.php" style="opacity: 0" onLoad="this.style.opacity='1';this.contentWindow.onscroll=function(){top.ICEcoder.mouseDown=false}"></iframe>
echo '<div id="tab'.$i.'" class="tab" draggable="true" onClick="ICEcoder.canSwitchTabs ? ICEcoder.switchTab('.$i.') : ICEcoder.canSwitchTabs=true"></div>'; <div class="serverMessage" id="serverMessage"></div>
} </div>
?><div class="newTab" onClick="ICEcoder.newTab()"><img src="images/nav-new.png"></div>
</div> <div id="editor" class="editor">
<div id="findBar" class="findBar" onContextMenu="return false"> <div id="tabsBar" class="tabsBar" onContextMenu="return false">
<form name="findAndReplace" onSubmit="ICEcoder.findReplace('findReplace',false,true);return false"> <?php
<div class="findReplace"> for ($i=1;$i<=100;$i++) {
<div class="findText">Find</div> 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>';
<input type="text" name="find" value="" id="find" class="textbox find" onKeyUp="ICEcoder.findReplace('find',true,false)"> }
?><div class="newTab" onClick="ICEcoder.newTab()"><img src="images/nav-new.png"></div>
<select name="connector" onChange="ICEcoder.findReplaceOptions()"> </div>
<option>in</option> <div id="findBar" class="findBar" onContextMenu="return false">
<option>and</option> <form name="findAndReplace" onSubmit="ICEcoder.findReplace('findReplace',false,true);return false">
</select> <div class="findReplace">
<div class="replaceText" id="rText" style="display: none"> <div class="findText">Find</div>
<select name="replaceAction" class="replaceAction"> <input type="text" name="find" value="" id="find" class="textbox find" onKeyUp="ICEcoder.findReplace('find',true,false)">
<option>replace</option>
<option>replace all</option> <select name="connector" onChange="ICEcoder.findReplaceOptions()">
</select> <option>in</option>
with <option>and</option>
</div> </select>
<input type="text" name="replace" value="" id="replace" class="textbox replace" style="display: none"> <div class="replaceText" id="rText" style="display: none">
<div class="targetText" id="rTarget" style="display: none">in</div> <select name="replaceAction" class="replaceAction">
<select name="target" onChange="ICEcoder.updateResultsDisplay(this.value=='this document' ? 'show' : 'hide')"> <option>replace</option>
<option>this document</option> <option>replace all</option>
<option>open documents</option> </select>
<option>all files</option> with
<option>all filenames</option> </div>
</select> <input type="text" name="replace" value="" id="replace" class="textbox replace" style="display: none">
<input type="submit" name="submit" value="&gt;&gt;" class="submit"> <div class="targetText" id="rTarget" style="display: none">in</div>
<div class="results" id="results"></div> <select name="target" onChange="ICEcoder.updateResultsDisplay(this.value=='this document' ? 'show' : 'hide')">
</div> <option>this document</option>
</form> <option>open documents</option>
<form onSubmit="return ICEcoder.goToLine()"> <option>all files</option>
<div class="codeAssist"><input type="checkbox" name="codeAssist" id="codeAssist" checked onClick="top.ICEcoder.codeAssistToggle()">Code Assist</div> <option>all filenames</option>
<div class="goLine">Go to Line<input type="text" name="goToLine" value="" id="goToLineNo" class="textbox goToLine"> </select>
</form> <input type="submit" name="submit" value="&gt;&gt;" class="submit">
</div> <div class="results" id="results"></div>
<iframe name="contentFrame" id="content" src="editor.php" class="code"></iframe> </div>
</div> </form>
<form onSubmit="return ICEcoder.goToLine()">
<div class="footer" id="footer" onContextMenu="return false"> <div class="codeAssist"><input type="checkbox" name="codeAssist" id="codeAssist" checked onClick="top.ICEcoder.codeAssistToggle()">Code Assist</div>
<div class="nesting" id="nestValid">Nesting OK</div> <div class="goLine">Go to Line<input type="text" name="goToLine" value="" id="goToLineNo" class="textbox goToLine">
<div class="nestLoc">Cursor nest location</div> </form>
<div class="nestDisplay" id="nestDisplay"></div> </div>
<div class="charDisplay" id="charDisplay"><span id="char"></span></div> <iframe name="contentFrame" id="content" src="editor.php" class="code"></iframe>
</div> </div>
<script> <div class="footer" id="footer" onContextMenu="return false">
ICEcoder.initAliases(); <div class="nesting" id="nestValid">Nesting OK</div>
ICEcoder.setLayout('dontSetEditor'); <div class="nestLoc">cursor nest location</div>
</script> <div class="nestDisplay" id="nestDisplay"></div>
<div class="charDisplay" id="charDisplay"><span id="char"></span></div>
</body> </div>
<script>
ICEcoder.initAliases();
ICEcoder.setLayout('dontSetEditor');
</script>
</body>
</html> </html>

View File

@@ -1,25 +1,29 @@
<?php <?php
$ICEcoder = array( $ICEcoder = array(
"root" => "", "root" => "",
"tabsIndent" => true, "tabsIndent" => true,
"checkUpdates" => true, "checkUpdates" => true,
"openLastFiles" => true, "openLastFiles" => true,
"findFilesExclude" => array("_coder","ICEcoder",".doc",".gif",".jpg",".jpeg",".pdf",".png",".swf",".xml",".zip"), "findFilesExclude" => array("_coder","ICEcoder",".doc",".gif",".jpg",".jpeg",".pdf",".png",".swf",".xml",".zip"),
"codeAssist" => true, "codeAssist" => true,
"visibleTabs" => false, "visibleTabs" => false,
"lockedNav" => true, "lockedNav" => true,
"accountPassword" => "", "accountPassword" => "",
"bannedFiles" => array("_coder","ICEcoder"), "bannedFiles" => array("_coder","ICEcoder"),
"allowedIPs" => array("*"), "bannedPaths" => array("/var/www/.git","/var/www/sites/all/modules","/var/www/sites/default/files"),
"plugins" => array( "allowedIPs" => array("*"),
array("Adminer","plugins/adminer/icon.png","margin-top: 3px","plugins/adminer/adminer-3.4.0-mysql-en.php","_blank",""), "plugins" => array(
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("Adminer","plugins/adminer/icon.png","margin-top: 3px","plugins/adminer/adminer-3.4.0-mysql-en.php","_blank",""),
array("ICErepo","plugins/ice-repo/icon.png","margin-top: 3px","plugins/ice-repo","_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("Dochub","plugins/dochub/icon.png","margin-top: 3px","http://dochub.io","_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",""),
"theme" => "default", array("Terminal","plugins/terminal/icon.gif","margin-top: 3px","plugins/terminal","_blank",""),
"tabWidth" => 4, array("JS Hint","plugins/jshint/icon.png","margin-top: 3px","http://www.jshint.com","_blank","")
"previousFiles" => "", ),
"last10Files" => "" "theme" => "default",
); "lineWrapping" => true,
"tabWidth" => 4,
"previousFiles" => "",
"last10Files" => ""
);
?> ?>

View File

@@ -1,284 +1,307 @@
<?php include("settings.php");?> <?php include("settings.php");?>
<?php <?php
// Get the save type if any // Get the save type if any
$saveType = ""; $saveType = "";
if (isset($_GET['saveType'])) {$saveType = strClean($_GET['saveType']);}; if (isset($_GET['saveType'])) {$saveType = strClean($_GET['saveType']);};
// Establish the filename/new filename // Establish the filename/new filename
$file = str_replace("|","/",strClean( $file = str_replace("|","/",strClean(
isset($_POST['newFileName']) && $_POST['newFileName']!="" isset($_POST['newFileName']) && $_POST['newFileName']!=""
? $_POST['newFileName'] ? $_POST['newFileName']
: $_GET['file'] : $_GET['file']
)); ));
// Make $file a full path and establish the $fileLoc and $fileName // Make $file a full path and establish the $fileLoc and $fileName
if (strpos($file,$docRoot)===false) {$file=str_replace("|","/",$docRoot.$iceRoot.$file);}; if (strpos($file,$docRoot)===false) {$file=str_replace("|","/",$docRoot.$iceRoot.$file);};
$fileLoc = substr(str_replace($docRoot,"",$file),0,strrpos(str_replace($docRoot,"",$file),"/")); $fileLoc = substr(str_replace($docRoot,"",$file),0,strrpos(str_replace($docRoot,"",$file),"/"));
$fileName = basename($file); $fileName = basename($file);
// If we're due to open a file... // If we're due to open a file...
if ($_GET['action']=="load") { if ($_GET['action']=="load") {
echo '<script>action="load";</script>'; echo '<script>action="load";</script>';
// Determine what to do based on mime type if (file_exists($file)) {
$finfo = finfo_open(FILEINFO_MIME_TYPE); // Determine what to do based on mime type
if (strpos(finfo_file($finfo, $file),"text")===0) { $finfo = finfo_open(FILEINFO_MIME_TYPE);
if (file_exists($file)) { if (strpos(finfo_file($finfo, $file),"text")===0) {
echo '<script>fileType="text";'; echo '<script>fileType="text";';
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>",htmlentities($loadedFile)).'</textarea>';
} else { } else if (strpos(finfo_file($finfo, $file),"image")===0) {
echo '<script>fileType="nothing"; top.ICEcoder.message(\'Sorry, '.$fileLoc."/".$fileName.' doesn\\\'t seem to exist on the server\');</script>'; echo '<script>fileType="image";fileName=\''.$fileLoc."/".$fileName.'\'</script>';
} } else {
} else if (strpos(finfo_file($finfo, $file),"image")===0) { echo '<script>fileType="other";window.open(\'http://'.$_SERVER['SERVER_NAME'].$fileLoc."/".$fileName.'\');</script>';
echo '<script>fileType="image";fileName=\''.$fileLoc."/".$fileName.'\'</script>'; };
} else { } else {
echo '<script>fileType="other";window.open(\'http://'.$_SERVER['SERVER_NAME'].$fileLoc."/".$fileName.'\');</script>'; echo '<script>fileType="nothing"; top.ICEcoder.message(\'Sorry, '.$fileLoc."/".$fileName.' doesn\\\'t seem to exist on the server\');</script>';
}; }
finfo_close($finfo); finfo_close($finfo);
}; };
// If we're due to add a new folder... // If we're due to add a new folder...
if ($_GET['action']=="newFolder") { if ($_GET['action']=="newFolder") {
if (is_writable($docRoot.$fileLoc)) { if (!$demoMode && is_writable($docRoot.$fileLoc)) {
mkdir($file, 0705); mkdir($file, 0705);
// Reload file manager // Reload file manager
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.$fileLoc.'\',\''.$fileName.'\');action="newFolder";</script>'; echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.$fileLoc.'\',\''.$fileName.'\');action="newFolder";</script>';
} else { } else {
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot create folder at\\n".$fileLoc."')</script>"; echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot create folder at\\n".$fileLoc."')</script>";
} }
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>'; echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
} }
// If we're due to paste a new file... // If we're due to paste a new file...
if ($_GET['action']=="paste") { if ($_GET['action']=="paste") {
$location = $docRoot.strClean(str_replace("|","/",$_GET['location'])); $source = $file;
if (is_writable($location)) { $dest = $docRoot.strClean(str_replace("|","/",$_GET['location']))."/".basename($source);
copy($file, $location."/".basename($file)); if (!$demoMode && is_writable(dirname($dest))) {
// Reload file manager if (is_dir($source)) {
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.str_replace($docRoot,"",$location).'\',\''.$fileName.'\');action="pasteFile";</script>'; if (!is_dir($dest)) {
} else { mkdir($dest, 0705);
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot copy file into \\n".$location."')</script>"; }
} foreach ($iterator = new RecursiveIteratorIterator(
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>'; new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS),
} RecursiveIteratorIterator::SELF_FIRST) as $item
) {
// If we're due to rename a file/folder... if ($item->isDir()) {
if ($_GET['action']=="rename") { mkdir($dest.DIRECTORY_SEPARATOR.$iterator->getSubPathName(), 0705);
if (is_writable($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])))) { } else {
rename($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])),$docRoot.$fileLoc."/".$fileName); copy($item, $dest.DIRECTORY_SEPARATOR.$iterator->getSubPathName());
// Reload file manager }
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'rename\',\''.$fileLoc.'\',\''.$fileName.'\',\'\',\''.str_replace($iceRoot,"",strClean($_GET['oldFileName'])).'\');'; }
echo 'action="rename";</script>'; } else {
} else { copy($source, $dest);
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot rename\\n".strClean($_GET['oldFileName'])."');</script>"; }
} // Reload file manager
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>'; echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.strClean(str_replace("|","/",$_GET['location'])).'\',\''.$fileName.'\');action="pasteFile";</script>';
} } else {
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot copy \\n".str_replace($docRoot,"",$source)."\\n into \\n".str_replace($docRoot,"",$dest)."')</script>";
// If we're due to replace text in a file... }
if ($_GET['action']=="replaceText") { echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
if (is_writable(str_replace("|","/",strClean($_GET['fileRef'])))) { }
$file = str_replace("|","/",strClean($_GET['fileRef']));
$loadedFile = file_get_contents($file); // If we're due to rename a file/folder...
$newContent = str_replace(strClean($_GET['find']),strClean($_GET['replace']),$loadedFile); if ($_GET['action']=="rename") {
$fh = fopen($file, 'w') or die("Sorry, cannot save"); if (!$demoMode && is_writable($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])))) {
fwrite($fh, $newContent); rename($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])),$docRoot.$fileLoc."/".$fileName);
fclose($fh); // Reload file manager
echo '<script>action="replaceText";</script>'; echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'rename\',\''.$fileLoc.'\',\''.$fileName.'\',\'\',\''.str_replace($iceRoot,"",strClean($_GET['oldFileName'])).'\');';
} else { echo 'action="rename";</script>';
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot replace text in\\n".strClean($_GET['fileRef'])."');</script>"; } else {
} echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot rename\\n".strClean($_GET['oldFileName'])."');</script>";
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>'; }
} echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
}
// If we're due to change permissions on a file/folder...
if ($_GET['action']=="perms") { // If we're due to replace text in a file...
if (is_writable($file)) { if ($_GET['action']=="replaceText") {
chmod($file,octdec(numClean($_GET['perms']))); if (!$demoMode && is_writable(str_replace("|","/",strClean($_GET['fileRef'])))) {
// Reload file manager $file = str_replace("|","/",strClean($_GET['fileRef']));
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'chmod\',\''.$fileLoc.'\',\''.$fileName.'\',\''.numClean($_GET['perms']).'\');'; $loadedFile = file_get_contents($file);
echo 'action="perms";</script>'; $newContent = str_replace(strClean($_GET['find']),strClean($_GET['replace']),$loadedFile);
} else { $fh = fopen($file, 'w') or die("Sorry, cannot save");
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot change permissions on \\n".strClean($file)."');</script>"; fwrite($fh, $newContent);
} fclose($fh);
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>'; echo '<script>action="replaceText";</script>';
} } else {
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot replace text in\\n".strClean($_GET['fileRef'])."');</script>";
// If we're due to delete a file... }
if ($_GET['action']=="delete") { echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
$filesArray = explode(";",$file); // May contain more than one file here }
for ($i=0;$i<=count($filesArray)-1;$i++) {
if (is_writable($iceRoot.$filesArray[$i])) { // If we're due to change permissions on a file/folder...
is_dir($iceRoot.$filesArray[$i]) if ($_GET['action']=="perms") {
? rrmdir($iceRoot.$filesArray[$i]) if (!$demoMode && is_writable($file)) {
: unlink($iceRoot.$filesArray[$i]); chmod($file,octdec(numClean($_GET['perms'])));
// Reload file manager // Reload file manager
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'delete\',\''.$fileLoc.'\',\''.$fileName.'\');'; echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'chmod\',\''.$fileLoc.'\',\''.$fileName.'\',\''.numClean($_GET['perms']).'\');';
echo 'action="delete";</script>'; echo 'action="perms";</script>';
} else { } else {
echo "<script>top.ICEcoder.message('Sorry can\\'t delete\\n".$filesArray[$i]."');</script>"; echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot change permissions on \\n".strClean($file)."');</script>";
} }
echo '<script>action="nothing";</script>'; echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
} }
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
} // If we're due to delete a file...
if ($_GET['action']=="delete") {
// The function to recursively remove folders & files $filesArray = explode(";",$file); // May contain more than one file here
function rrmdir($dir) { for ($i=0;$i<=count($filesArray)-1;$i++) {
if (is_dir($dir)) { if (!$demoMode && is_writable($iceRoot.$filesArray[$i])) {
$objects = scandir($dir); is_dir($iceRoot.$filesArray[$i])
foreach ($objects as $object) { ? rrmdir($iceRoot.$filesArray[$i])
if ($object != "." && $object != "..") { : unlink($iceRoot.$filesArray[$i]);
filetype($dir."/".$object) == "dir" // Reload file manager
? rrmdir($dir."/".$object) echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'delete\',\''.$fileLoc.'\',\''.$fileName.'\');';
: unlink($dir."/".$object); echo 'action="delete";</script>';
} } else {
} echo "<script>top.ICEcoder.message('Sorry can\\'t delete\\n".$filesArray[$i]."');</script>";
reset($objects); }
rmdir($dir); echo '<script>action="nothing";</script>';
} }
} echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
}
if ($_GET['action']=="save") {
echo '<script>action="save";</script>'; // The function to recursively remove folders & files
// on the form posting via a reload, save the file function rrmdir($dir) {
if (isset($_POST['contents'])) { if (is_dir($dir)) {
if ((file_exists($file) && is_writable($file)) || isset($_POST['newFileName']) && $_POST['newFileName']!="") { $objects = scandir($dir);
if (filemtime($file)==$_GET['fileMDT']||!(isset($_GET['fileMDT']))) { foreach ($objects as $object) {
$fh = fopen($file, 'w') or die("Sorry, cannot save"); if ($object != "." && $object != "..") {
fwrite($fh, $_POST['contents']); filetype($dir."/".$object) == "dir"
fclose($fh); ? rrmdir($dir."/".$object)
clearstatcache(); : unlink($dir."/".$object);
echo '<script>top.ICEcoder.openFileMDTs[top.ICEcoder.selectedTab-1]="'.filemtime($file).'";</script>'; }
// Reload file manager & rename tab if it was a new file }
if (isset($_POST['newFileName']) && $_POST['newFileName']!="") { reset($objects);
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.$fileLoc.'\',\''.$fileName.'\');'; rmdir($dir);
echo 'top.ICEcoder.renameTab(top.ICEcoder.selectedTab,\''.$fileLoc."/".$fileName.'\');</script>'; }
} }
// Reload stickytab window
echo '<script>if (top.ICEcoder.stickyTab.location) {top.ICEcoder.stickyTab.location.reload()};action="doneSave";</script>'; if ($_GET['action']=="save") {
} else { echo '<script>action="save";</script>';
$loadedFile = file_get_contents($file); // on the form posting via a reload, save the file
echo '<textarea name="loadedFile" id="loadedFile">'.str_replace("</textarea>","<ICEcoder:/:textarea>",htmlentities($loadedFile)).'</textarea>'; if (isset($_POST['contents'])) {
echo '<textarea name="userVersionFile" id="userVersionFile"></textarea>'; if (!$demoMode && ((file_exists($file) && is_writable($file)) || isset($_POST['newFileName']) && $_POST['newFileName']!="")) {
?> if (filemtime($file)==$_GET['fileMDT']||!(isset($_GET['fileMDT']))) {
<script> $fh = fopen($file, 'w') or die("Sorry, cannot save");
var refreshFile = top.ICEcoder.ask('Sorry, this file has changed, cannot save\n<?php echo $file;?>\n\nReload this file and copy your version to a new document?'); fwrite($fh, $_POST['contents']);
if (refreshFile) { fclose($fh);
var cM = top.ICEcoder.getcMInstance(); clearstatcache();
var thisTab = top.ICEcoder.selectedTab; echo '<script>top.ICEcoder.openFileMDTs[top.ICEcoder.selectedTab-1]="'.filemtime($file).'";</script>';
document.getElementById('userVersionFile').value = cM.getValue(); // Reload file manager & rename tab if it was a new file
// Revert back to original if (isset($_POST['newFileName']) && $_POST['newFileName']!="") {
cM.setValue(document.getElementById('loadedFile').value); echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.$fileLoc.'\',\''.$fileName.'\');';
top.ICEcoder.changedContent[thisTab-1] = 0; echo 'top.ICEcoder.renameTab(top.ICEcoder.selectedTab,\''.$fileLoc."/".$fileName.'\');</script>';
top.ICEcoder.openFileMDTs[top.ICEcoder.selectedTab-1] = "<?php echo filemtime($file); ?>"; }
cM.clearHistory(); // Reload stickytab window
// Now for the new file echo '<script>if (top.ICEcoder.stickyTab.location) {top.ICEcoder.stickyTab.location.reload()};action="doneSave";</script>';
top.ICEcoder.newTab(); } else {
cM = top.ICEcoder.getcMInstance(); $loadedFile = file_get_contents($file);
cM.setValue(document.getElementById('userVersionFile').value); echo '<textarea name="loadedFile" id="loadedFile">'.str_replace("</textarea>","<ICEcoder:/:textarea>",htmlentities($loadedFile)).'</textarea>';
cM.clearHistory(); echo '<textarea name="userVersionFile" id="userVersionFile"></textarea>';
// Finally, switch back to original tab ?>
top.ICEcoder.switchTab(thisTab); <script>
} var refreshFile = top.ICEcoder.ask('Sorry, this file has changed, cannot save\n<?php echo $file;?>\n\nReload this file and copy your version to a new document?');
action='nothing'; if (refreshFile) {
</script> var cM = top.ICEcoder.getcMInstance();
<?php var thisTab = top.ICEcoder.selectedTab;
} document.getElementById('userVersionFile').value = cM.getValue();
} else { // Revert back to original
echo "<script>action='nothing';top.ICEcoder.message('Sorry, cannot write\\n".$file."')</script>"; cM.setValue(document.getElementById('loadedFile').value);
} top.ICEcoder.changedContent[thisTab-1] = 0;
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>'; top.ICEcoder.openFileMDTs[top.ICEcoder.selectedTab-1] = "<?php echo filemtime($file); ?>";
} cM.clearHistory();
}; // Now for the new file
?> top.ICEcoder.newTab();
<script> cM = top.ICEcoder.getcMInstance();
if (action=="load") { cM.setValue(document.getElementById('userVersionFile').value);
if (fileType=="text") { cM.clearHistory();
setTimeout(function() { // Finally, switch back to original tab
if (!top.ICEcoder.content.contentWindow.createNewCMInstance) { top.ICEcoder.switchTab(thisTab);
console.log('There was tech hiccup, likely something wasn\'t quite ready. So ICEcoder reloaded it\'s file control again.'); }
window.location.reload(); action='nothing';
} else { </script>
top.ICEcoder.loadingFile = true; <?php
// Reset the various states back to their initial setting }
selectedTab = top.ICEcoder.openFiles.length; // The tab that's currently selected } else {
echo "<script>action='nothing';top.ICEcoder.message('Sorry, cannot write\\n".$file."')</script>";
// Finally, store all data, show tabs etc }
top.ICEcoder.createNewTab(); echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
top.ICEcoder.cMInstances.push(top.ICEcoder.nextcMInstance); }
top.ICEcoder.setLayout(); };
top.ICEcoder.content.contentWindow.createNewCMInstance(top.ICEcoder.nextcMInstance); ?>
<script>
// Set the value & innerHTML of the code textarea to that of our loaded file plus make it visible (it's hidden on _coder's load) if (action=="load") {
top.ICEcoder.switchMode(); if (fileType=="text") {
cM = top.ICEcoder.getcMInstance(); setTimeout(function() {
cM.setValue(document.getElementById('loadedFile').value); if (!top.ICEcoder.content.contentWindow.createNewCMInstance) {
top.document.getElementById('content').style.visibility='visible'; console.log('There was tech hiccup, likely something wasn\'t quite ready. So ICEcoder reloaded it\'s file control again.');
top.ICEcoder.switchTab(top.ICEcoder.selectedTab); window.location.reload();
cM.focus(); <?php
if (file_exists($file)) {
// Then clean it up, set the text cursor, update the display and get the character data ?>
top.ICEcoder.contentCleanUp(); } else {
top.ICEcoder.content.contentWindow['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].setLineClass(top.ICEcoder['cMActiveLine'+top.ICEcoder.selectedTab], null); top.ICEcoder.loadingFile = true;
top.ICEcoder['cMActiveLine'+top.ICEcoder.selectedTab] = top.ICEcoder.content.contentWindow['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].setLineClass(0, "cm-s-activeLine"); // Reset the various states back to their initial setting
top.ICEcoder.nextcMInstance++; selectedTab = top.ICEcoder.openFiles.length; // The tab that's currently selected
top.ICEcoder.openFileMDTs.push('<?php echo filemtime($file); ?>');
top.ICEcoder.loadingFile = false; // Finally, store all data, show tabs etc
} top.ICEcoder.createNewTab();
},4); top.ICEcoder.cMInstances.push(top.ICEcoder.nextcMInstance);
} top.ICEcoder.setLayout();
top.ICEcoder.content.contentWindow.createNewCMInstance(top.ICEcoder.nextcMInstance);
if (fileType=="image") {
top.document.getElementById('blackMask').style.visibility = "visible"; // Set the value & innerHTML of the code textarea to that of our loaded file plus make it visible (it's hidden on _coder's load)
top.document.getElementById('mediaContainer').innerHTML = "<img src=\"<?php echo $fileLoc."/".$fileName;?>\" class=\"whiteGlow\" style=\"border: solid 10px #fff; max-width: 700px; max-height: 500px\" onClick=\"return false\"><br><span class=\"whiteGlow\" style=\"border: solid 10px #fff; color: #000; background-color: #fff\" onClick=\"return false\"><?php echo $fileLoc."/".$fileName;?></span>"; top.ICEcoder.switchMode();
} cM = top.ICEcoder.getcMInstance();
cM.setValue(document.getElementById('loadedFile').value);
top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0); top.document.getElementById('content').style.visibility='visible';
} top.ICEcoder.switchTab(top.ICEcoder.selectedTab);
</script> cM.focus();
<form name="saveFile" action="file-control.php?action=save&file=<?php if (isset($file)) {echo $file;}; if (isset($_GET['fileMDT']) && $_GET['fileMDT']!="undefined") {echo "&fileMDT=".numClean($_GET['fileMDT']);};?>" method="POST"> // Then clean it up, set the text cursor, update the display and get the character data
<textarea name="contents"></textarea> top.ICEcoder.contentCleanUp();
<input type="hidden" name="newFileName" value=""> top.ICEcoder.content.contentWindow['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].removeLineClass(top.ICEcoder['cMActiveLine'+top.ICEcoder.selectedTab], "background");
</form> top.ICEcoder['cMActiveLine'+top.ICEcoder.selectedTab] = top.ICEcoder.content.contentWindow['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].addLineClass(0, "background", "cm-s-activeLine");
top.ICEcoder.nextcMInstance++;
<script> top.ICEcoder.openFileMDTs.push('<?php echo filemtime($file); ?>');
if (action=="save") { top.ICEcoder.loadingFile = false;
<?php <?php
if (strpos($file,"[NEW]")>0||$saveType=="saveAs") { ;};
if (strpos($fileName,"[NEW]")>0) {echo "fileLoc = '".$fileLoc."';";} else {echo "fileLoc = '';";}; ?>
?> }
newFileName = top.ICEcoder.getInput(fileLoc != "" },4);
? 'Enter filename to save at '+fileLoc }
: 'Enter filename (including path, prefixed with /)'
,''); if (fileType=="image") {
if (newFileName.substr(0,1)!="/") {newFileName = "/" + newFileName} top.document.getElementById('blackMask').style.visibility = "visible";
if (newFileName) { top.document.getElementById('mediaContainer').innerHTML = "<img src=\"<?php echo $fileLoc."/".$fileName;?>\" class=\"whiteGlow\" style=\"border: solid 10px #fff; max-width: 700px; max-height: 500px\" onClick=\"return false\"><br><span class=\"whiteGlow\" style=\"border: solid 10px #fff; color: #000; background-color: #fff\" onClick=\"return false\"><?php echo $fileLoc."/".$fileName;?></span>";
newFileName = fileLoc == "" ? newFileName : fileLoc + "/" + fileName; }
}
if (newFileName && top.document.getElementById('filesFrame').contentWindow.document.getElementById(newFileName.replace(/\//g,"|"))) { top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);
overwriteOK = top.ICEcoder.ask('That file exists already, overwrite?'); }
} </script>
document.saveFile.newFileName.value = '<?php echo $docRoot; ?>' + newFileName;
<?php ;};?> <form name="saveFile" action="file-control.php?action=save&file=<?php if (isset($file)) {echo $file;}; if (isset($_GET['fileMDT']) && $_GET['fileMDT']!="undefined") {echo "&fileMDT=".numClean($_GET['fileMDT']);};?>" method="POST">
if ("undefined" == typeof newFileName || (newFileName && "undefined" == typeof overwriteOK) || ("undefined" != typeof overwriteOK && overwriteOK)) { <textarea name="contents"></textarea>
top.ICEcoder.serverMessage('<b>Saving</b><br>'+ <?php echo strpos($file,"[NEW]")>0 ? "newFileName" : "'$file'"; ?>); <input type="hidden" name="newFileName" value="">
document.saveFile.contents.value = top.document.getElementById('saveTemp1').value; </form>
document.saveFile.submit();
} else { <script>
top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0); if (action=="save") {
action=="nothing"; <?php
} if (strpos($file,"[NEW]")>0||$saveType=="saveAs") {
} if (strpos($fileName,"[NEW]")>0) {echo "fileLoc = '".$fileLoc."';";} else {echo "fileLoc = '';";};
</script> ?>
newFileName = top.ICEcoder.getInput(fileLoc != ""
<script> ? 'Enter filename to save at '+fileLoc
if (action=="doneSave") { : 'Enter filename (including path, prefixed with /)'
top.ICEcoder.changedContent[top.ICEcoder.selectedTab-1] = 0; ,'');
top.ICEcoder.redoTabHighlight(top.ICEcoder.selectedTab); if (newFileName.substr(0,1)!="/") {newFileName = "/" + newFileName}
} if (newFileName) {
newFileName = fileLoc == "" ? newFileName : fileLoc + "/" + fileName;
}
if (newFileName && top.document.getElementById('filesFrame').contentWindow.document.getElementById(newFileName.replace(/\//g,"|"))) {
overwriteOK = top.ICEcoder.ask('That file exists already, overwrite?');
}
document.saveFile.newFileName.value = '<?php echo $docRoot; ?>' + newFileName;
<?php ;};?>
if ("undefined" == typeof newFileName || (newFileName && "undefined" == typeof overwriteOK) || ("undefined" != typeof overwriteOK && overwriteOK)) {
top.ICEcoder.serverMessage('<b>Saving</b><br>'+ <?php echo strpos($file,"[NEW]")>0 ? "newFileName" : "'$file'"; ?>);
document.saveFile.contents.value = top.document.getElementById('saveTemp1').value;
document.saveFile.submit();
} else {
top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);
action=="nothing";
}
}
</script>
<script>
if (action=="doneSave") {
top.ICEcoder.changedContent[top.ICEcoder.selectedTab-1] = 0;
top.ICEcoder.redoTabHighlight(top.ICEcoder.selectedTab);
}
</script> </script>

View File

@@ -1,44 +1,45 @@
<?php include("settings.php");?> <?php include("settings.php");?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> help</title> <title>ICEcoder <?php echo $ICEcoder["versionNo"];?> help</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="help.css"> <meta name="robots" content="noindex, nofollow">
</head> <link rel="stylesheet" type="text/css" href="help.css">
</head>
<body class="help">
<body class="help">
<h1 id="title">help</h1>
<h1 id="title">help</h1>
<h2>In file manager</h2>
<span class="key">Delete</span> <span class="shortcut">Delete file</span><br><br> <h2>In file manager</h2>
<span class="key">Delete</span> <span class="shortcut">Delete file</span><br><br>
<h2>Within document</h2>
<span class="key">CTRL <span class="plus">+</span> &uarr;</span> <span class="shortcut">Move line up</span><br> <h2>Within document</h2>
<span class="key">CTRL <span class="plus">+</span> &darr;</span> <span class="shortcut">Move line down</span><br> <span class="key">CTRL <span class="plus">+</span> &uarr;</span> <span class="shortcut">Move line up</span><br>
<span class="key">CTRL <span class="plus">+</span> I</span> <span class="shortcut">Search selected text</span><br> <span class="key">CTRL <span class="plus">+</span> &darr;</span> <span class="shortcut">Move line down</span><br>
<span class="key">Esc</span> <span class="shortcut">Comment / uncomment text</span><br> <span class="key">CTRL <span class="plus">+</span> I</span> <span class="shortcut">Search selected text</span><br>
<span class="key">Tab</span> <span class="shortcut">Insert tab / indent selected text</span><br><br> <span class="key">Esc</span> <span class="shortcut">Comment / uncomment text</span><br>
<span class="key">Tab</span> <span class="shortcut">Insert tab / indent selected text</span><br><br>
<h2>Anywhere</h2>
<span class="key">CTRL <span class="plus">+</span> &rarr;</span> <span class="shortcut">Next tab</span><br> <h2>Anywhere</h2>
<span class="key">CTRL <span class="plus">+</span> &larr;</span> <span class="shortcut">Previous tab</span><br> <span class="key">CTRL <span class="plus">+</span> &rarr;</span> <span class="shortcut">Next tab</span><br>
<span class="key">CTRL <span class="plus">+</span> +</span> <span class="shortcut">New tab</span><br> <span class="key">CTRL <span class="plus">+</span> &larr;</span> <span class="shortcut">Previous tab</span><br>
<span class="key">CTRL <span class="plus">+</span> -</span> <span class="shortcut">Close current tab</span><br> <span class="key">CTRL <span class="plus">+</span> +</span> <span class="shortcut">New tab</span><br>
<span class="key">CTRL <span class="plus">+</span> F</span> <span class="shortcut">Find</span><br> <span class="key">CTRL <span class="plus">+</span> -</span> <span class="shortcut">Close current tab</span><br>
<span class="key">CTRL <span class="plus">+</span> G</span> <span class="shortcut">Go to line</span><br> <span class="key">CTRL <span class="plus">+</span> F</span> <span class="shortcut">Find</span><br>
<span class="key">CTRL <span class="plus">+</span> S</span> <span class="shortcut">Save</span><br> <span class="key">CTRL <span class="plus">+</span> G</span> <span class="shortcut">Go to line</span><br>
<span class="key">CTRL <span class="plus">+</span> Shift <span class="plus">+</span> S</span> <span class="shortcut">Save as...</span><br> <span class="key">CTRL <span class="plus">+</span> S</span> <span class="shortcut">Save</span><br>
<span class="key">CTRL <span class="plus">+</span> Enter</span> <span class="shortcut">View webpage</span><br> <span class="key">CTRL <span class="plus">+</span> Shift <span class="plus">+</span> S</span> <span class="shortcut">Save as...</span><br>
<span class="key">CTRL <span class="plus">+</span> S <span class="plus">+</span> Enter</span> <span class="shortcut">Save & create sticky tab</span><br> <span class="key">CTRL <span class="plus">+</span> Enter</span> <span class="shortcut">View webpage</span><br>
<span class="key">Esc</span> <span class="shortcut">Cancel tasks</span><br><br> <span class="key">CTRL <span class="plus">+</span> S <span class="plus">+</span> Enter</span> <span class="shortcut">Save & create sticky tab</span><br>
<span class="key">Esc</span> <span class="shortcut">Cancel tasks</span><br><br>
<h2>Logo</h2>
<span class="key">Left click</span> <span class="shortcut">Help</span><br> <h2>Logo</h2>
<span class="key">Right click</span> <span class="shortcut">Settings</span><br> <span class="key">Left click</span> <span class="shortcut">Help</span><br>
<span class="key">Right click</span> <span class="shortcut">Settings</span><br>
</body>
</body>
</html> </html>

View File

@@ -1,146 +1,146 @@
/* First, reset everything to a standard */ /* First, reset everything to a standard */
html, body, div, span, applet, object, iframe, html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre, h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code, a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp, del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var, small, strike, strong, sub, sup, tt, var,
b, u, i, center, b, u, i, center,
dl, dt, dd, ol, ul, li, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend, fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td { table, caption, tbody, tfoot, thead, tr, th, td {
font-family: arial, verdana, helvetica, sans-serif; font-family: arial, verdana, helvetica, sans-serif;
border: 0; border: 0;
margin: 0; margin: 0;
padding: 0; padding: 0;
outline: 0; outline: 0;
font-size: 12px; font-size: 12px;
vertical-align: top; vertical-align: top;
} }
body {overflow: hidden; body {overflow: hidden;
-webkit-user-select: none; -webkit-user-select: none;
-moz-user-select: none; -moz-user-select: none;
user-select: none; user-select: none;
background-color: #222; background-color: #222;
} }
h1 {font-size: 36px; font-weight: normal; color: #888; margin-bottom: 20px} h1 {font-size: 36px; font-weight: normal; color: #888; margin-bottom: 20px}
h2 {font-size: 18px; font-weight: normal; color: #fff} h2 {font-size: 18px; font-weight: normal; color: #fff}
.blackMask {position: fixed; display: table; width: 100%; height: 100%; top: 0; left: 0; visibility: hidden; background-color: rgba(0,0,0,0.8); text-align: center; z-index: 100} .blackMask {position: fixed; display: table; width: 100%; height: 100%; top: 0; left: 0; visibility: hidden; background-color: rgba(0,0,0,0.8); text-align: center; z-index: 100}
.blackMask .popupVCenter {#position: absolute; display: table-cell; #top: 50%; vertical-align: middle; text-align: center} .blackMask .popupVCenter {#position: absolute; display: table-cell; #top: 50%; vertical-align: middle; text-align: center}
.popupVCenter .popup {#position: relative; #top: -50%; text-align: center; color: #fff; font-size: 10px} .popupVCenter .popup {#position: relative; #top: -50%; text-align: center; color: #fff; font-size: 10px}
.whiteGlow {box-shadow: 0 0 8px 2px rgba(255,255,255,0.6)} .whiteGlow {box-shadow: 0 0 8px 2px rgba(255,255,255,0.6)}
.circleOutside {background-color: rgba(0,0,0,0); border:5px solid rgba(0,183,229,0.9); opacity:.9; border-top:5px solid rgba(0,0,0,0); border-left:5px solid rgba(0,0,0,0); border-radius:50px; box-shadow: 0 0 35px #2187e7; .circleOutside {background-color: rgba(0,0,0,0); border:5px solid rgba(0,183,229,0.9); opacity:.9; border-top:5px solid rgba(0,0,0,0); border-left:5px solid rgba(0,0,0,0); border-radius:50px; box-shadow: 0 0 35px #2187e7;
width:50px; height:50px; margin:0 auto; -moz-animation:spin .5s infinite linear; -webkit-animation:spin .5s infinite linear; width:50px; height:50px; margin:0 auto; -moz-animation:spin .5s infinite linear; -webkit-animation:spin .5s infinite linear;
} }
.circleInside {background-color: rgba(0,0,0,0); border:5px solid rgba(0,183,229,0.9); opacity:.9; border-top:5px solid rgba(0,0,0,0); border-left:5px solid rgba(0,0,0,0); border-radius:50px; box-shadow: 0 0 15px #2187e7; .circleInside {background-color: rgba(0,0,0,0); border:5px solid rgba(0,183,229,0.9); opacity:.9; border-top:5px solid rgba(0,0,0,0); border-left:5px solid rgba(0,0,0,0); border-radius:50px; box-shadow: 0 0 15px #2187e7;
width:30px; height:30px; margin:0 auto; position:relative; top:-50px; -moz-animation:spinoff .5s infinite linear; -webkit-animation:spinoff .5s infinite linear; width:30px; height:30px; margin:0 auto; position:relative; top:-50px; -moz-animation:spinoff .5s infinite linear; -webkit-animation:spinoff .5s infinite linear;
} }
@-moz-keyframes spin { @-moz-keyframes spin {
0% {-moz-transform:rotate(0deg)} 0% {-moz-transform:rotate(0deg)}
100% {-moz-transform:rotate(360deg)} 100% {-moz-transform:rotate(360deg)}
} }
@-moz-keyframes spinoff { @-moz-keyframes spinoff {
0% {-moz-transform:rotate(0deg)} 0% {-moz-transform:rotate(0deg)}
100% {-moz-transform:rotate(-360deg)} 100% {-moz-transform:rotate(-360deg)}
} }
@-webkit-keyframes spin { @-webkit-keyframes spin {
0% {-webkit-transform:rotate(0deg)} 0% {-webkit-transform:rotate(0deg)}
100% {-webkit-transform:rotate(360deg)} 100% {-webkit-transform:rotate(360deg)}
} }
@-webkit-keyframes spinoff { @-webkit-keyframes spinoff {
0% {-webkit-transform:rotate(0deg)} 0% {-webkit-transform:rotate(0deg)}
100% {-webkit-transform:rotate(-360deg)} 100% {-webkit-transform:rotate(-360deg)}
} }
.progressBar {position:absolute; top: 0; left: 0; width:100%; height:1px; margin:2px 0; background:#2187e7; box-shadow:0 0 10px 1px rgba(0,198,255,0.7)} .progressBar {position:absolute; top: 0; left: 0; width:100%; height:1px; margin:2px 0; background:#2187e7; box-shadow:0 0 10px 1px rgba(0,198,255,0.7)}
@-moz-keyframes fullexpand { @-moz-keyframes fullexpand {
0% {width:0} 0% {width:0}
100%{width:100%} 100%{width:100%}
} }
@-webkit-keyframes fullexpand { @-webkit-keyframes fullexpand {
0% {width:0} 0% {width:0}
100%{width:100%} 100%{width:100%}
} }
.header {position: absolute; display: inline-block; top: 0; left: 0; width: 100%; height: 40px; background-color: #fff; text-align: right; z-index: 2} .header {position: absolute; display: inline-block; top: 0; left: 0; width: 100%; height: 40px; background-color: #fff; text-align: right; z-index: 2}
.header .plugins {position: absolute; display: inline-block; left: 15px; top: 3px} .header .plugins {position: absolute; display: inline-block; left: 15px; top: 3px}
.header .plugins img {position: relative; display: inline-block; margin-right: 15px} .header .plugins img {position: relative; display: inline-block; margin-right: 15px}
.header .screenModeIcon {position: absolute; top: 5px; right: 178px; cursor: pointer} .header .screenModeIcon {position: absolute; top: 5px; right: 178px; cursor: pointer}
.header .version {position: relative; display: inline-block; margin-top: 25px; font-size: 10px; color: #bbb} .header .version {position: relative; display: inline-block; margin-top: 25px; font-size: 10px; color: #bbb}
.header .logo {position: relative; margin: 5px 10px 0 5px; cursor: pointer} .header .logo {position: relative; margin: 5px 10px 0 5px; cursor: pointer}
.files {position: absolute; display: inline-block; top: 0; left: 0; height: 100%; width: 250px; background-color: #444; background-image: url('../images/files-arrow.png'); background-repeat: no-repeat; background-position: 100% 50%; overflow: hidden; z-index: 1; .files {position: absolute; display: inline-block; top: 0; left: 0; height: 100%; width: 250px; background-color: #444; background-image: url('../images/files-arrow.png'); background-repeat: no-repeat; background-position: 100% 50%; overflow: hidden; z-index: 1;
box-shadow: 0 0 10px 4px rgba(0,0,0,0.4); box-shadow: 0 0 10px 4px rgba(0,0,0,0.4);
} }
.files .account {display: inline-block; height: 50px; width: 250px; margin-top: 40px; background-color: #888} .files .account {display: inline-block; height: 50px; width: 250px; margin-top: 40px; background-color: #888}
.files .accountOptions {position: relative; height: 32px; width: 100%; margin-left: 15px; margin-top: 8px} .files .accountOptions {position: relative; height: 32px; width: 100%; margin-left: 15px; margin-top: 8px}
.files .accountOptions div {display: inline-block; background: url('../images/file-manager-icons.png') 0 0 no-repeat; cursor: pointer} .files .accountOptions div {display: inline-block; background: url('../images/file-manager-icons.png') 0 0 no-repeat; cursor: pointer}
.files .accountOptions .save {width: 30px; height: 32px; opacity: 0.3} .files .accountOptions .save {width: 30px; height: 32px; opacity: 0.3}
.files .accountOptions .open {width: 25px; height: 32px; background-position: -32px -3px; margin: 3px 0 0 7px; opacity: 0.3} .files .accountOptions .open {width: 25px; height: 32px; background-position: -32px -3px; margin: 3px 0 0 7px; opacity: 0.3}
.files .accountOptions .newFile {width: 15px; height: 16px; background-position: -64px 0; margin: 8px 0 0 10px; opacity: 0.3} .files .accountOptions .newFile {width: 15px; height: 16px; background-position: -64px 0; margin: 8px 0 0 10px; opacity: 0.3}
.files .accountOptions .newFolder {width: 20px; height: 16px; background-position: -80px 0; margin: 8px 0 0 5px; opacity: 0.3} .files .accountOptions .newFolder {width: 20px; height: 16px; background-position: -80px 0; margin: 8px 0 0 5px; opacity: 0.3}
.files .accountOptions .delete {width: 16px; height: 16px; background-position: -100px 0; margin: 8px 0 0 5px; opacity: 0.3} .files .accountOptions .delete {width: 16px; height: 16px; background-position: -100px 0; margin: 8px 0 0 5px; opacity: 0.3}
.files .accountOptions .rename {width: 16px; height: 16px; background-position: -116px 0; margin: 8px 0 0 5px; opacity: 0.3} .files .accountOptions .rename {width: 16px; height: 16px; background-position: -116px 0; margin: 8px 0 0 5px; opacity: 0.3}
.files .accountOptions .view {width: 16px; height: 16px; background-position: -132px 0; margin: 8px 0 0 5px; opacity: 0.3} .files .accountOptions .view {width: 16px; height: 16px; background-position: -132px 0; margin: 8px 0 0 5px; opacity: 0.3}
.files .accountOptions .lock {position: relative; margin-left: 208px; margin-top: -27px; width: 12px; height: 16px; background-position: -64px -16px; z-index: 1} .files .accountOptions .lock {position: relative; margin-left: 208px; margin-top: -27px; width: 12px; height: 16px; background-position: -64px -16px; z-index: 1}
.files input:focus, .findReplace input:focus, .findReplace select:focus, .accountPassword:focus {outline: none; box-shadow: 0 0 10px 1px rgba(0,198,255,1)} .files input:focus, .findReplace input:focus, .findReplace select:focus, .accountPassword:focus {outline: none; box-shadow: 0 0 10px 1px rgba(0,198,255,1)}
.files .button {position: absolute; border: 0; background: #444; color: #eee; height:20px; margin-top: 16px; margin-left: 5px; font-size: 11px; cursor: pointer} .files .button {position: absolute; border: 0; background: #444; color: #eee; height:20px; margin-top: 16px; margin-left: 5px; font-size: 11px; cursor: pointer}
.files .button:hover {background-color: #222; color: #eee} .files .button:hover {background-color: #222; color: #eee}
.files .frame {display: inline-block; width: 250px} .files .frame {display: inline-block; width: 250px}
.files .serverMessage {position: absolute; display: none; width: 450px; bottom: 0; margin-bottom: 30px; background-color: rgba(255,255,255,0.8); font-size: 10px; padding: 7px 12px; opacity: 0; .files .serverMessage {position: absolute; display: none; width: 450px; bottom: 0; margin-bottom: 30px; background-color: rgba(255,255,255,0.8); font-size: 10px; padding: 7px 12px; opacity: 0;
-webkit-transition: opacity 0.2s; -webkit-transition: opacity 0.2s;
-moz-transition: opacity 0.2s; -moz-transition: opacity 0.2s;
transition: opacity 0.2s; transition: opacity 0.2s;
} }
.files .serverMessage b {font-size: 10px} .files .serverMessage b {font-size: 10px}
.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-color: #888;} .editor .tabsBar {display: inline-block; height: 22px; width: 2400px; margin-top: 40px; padding-left: 41px; background-color: #888;}
.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 #fff; border-right: solid 1px #777; color: #fff; cursor: pointer; .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 #fff; border-right: solid 1px #777; color: #fff; direction: rtl; text-align: right; white-space: nowrap; overflow: hidden; cursor: pointer;
-webkit-transition: all 0.15s; -webkit-transition: all 0.15s;
-moz-transition: all 0.15s; -moz-transition: all 0.15s;
transition: all 0.15s; transition: all 0.15s;
} }
.tabsBar .tab .closeTab {margin: 1px 0 0 5px; border-radius: 6px} .tabsBar .tab .closeTab {margin: 1px 0 0 5px; border-radius: 6px}
.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 #fff; border-right: solid 1px #777; cursor: pointer;} .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 #fff; border-right: solid 1px #777; cursor: pointer;}
.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;}
.findReplace .findText {display: inline-block; height: 21px; font-size: 10px; margin: 8px 2px 0 2px; margin-left: 43px} .findReplace .findText {display: inline-block; height: 21px; font-size: 10px; margin: 8px 2px 0 2px; margin-left: 43px}
.findReplace .find {position: relative; width: 120px; height: 16px; border: 0; top: -3px; font-size: 10px; padding-left: 5px; margin-right: 3px} .findReplace .find {position: relative; width: 120px; height: 16px; border: 0; top: -3px; font-size: 10px; padding-left: 5px; margin-right: 3px}
.findReplace .replaceAction {margin: 0 2px 0 0; top: -2px} .findReplace .replaceAction {margin: 0 2px 0 0; top: -2px}
.findReplace .replaceText {height: 21px; font-size: 10px; margin: 8px 2px 0 2px} .findReplace .replaceText {height: 21px; font-size: 10px; margin: 8px 2px 0 2px}
.findReplace .replace {position: relative; width: 120px; height: 16px; border: 0; top: -3px; font-size: 10px; padding-left: 5px} .findReplace .replace {position: relative; width: 120px; height: 16px; border: 0; top: -3px; font-size: 10px; padding-left: 5px}
.findReplace .targetText {height: 21px; font-size: 10px; margin: 8px 2px 0 2px} .findReplace .targetText {height: 21px; font-size: 10px; margin: 8px 2px 0 2px}
.findReplace .submit {position: relative; top: -2px; height: 17px; border: 0; background-color: #444; color: #eee; font-size: 10px; margin-left: 2px; cursor: pointer} .findReplace .submit {position: relative; top: -2px; height: 17px; border: 0; background-color: #444; color: #eee; font-size: 10px; margin-left: 2px; cursor: pointer}
.findReplace .submit:hover {background-color: #2187e7; color: #eee} .findReplace .submit:hover {background-color: #2187e7; color: #eee}
.findReplace .results {position: relative; display: inline-block; width: 200px; height: 20px; font-size: 10px; margin: 8px 0 0 20px} .findReplace .results {position: relative; display: inline-block; width: 200px; height: 20px; font-size: 10px; margin: 8px 0 0 20px}
.findBar .codeAssist {position: fixed; display: inline-block; width: 100px; right: 74px; top: 70px; height: 21px; font-size: 10px; z-index: 1} .findBar .codeAssist {position: fixed; display: inline-block; width: 100px; right: 74px; top: 70px; height: 21px; font-size: 10px; z-index: 1}
.findBar .codeAssist input {margin-top: -1px} .findBar .codeAssist input {margin-top: -1px}
.findBar .goLine {position: fixed; display: inline-block; width: 100px; right: -10px; top: 70px; height: 21px; font-size: 10px; z-index: 1} .findBar .goLine {position: fixed; display: inline-block; width: 100px; right: -10px; top: 70px; height: 21px; font-size: 10px; z-index: 1}
.goLine .goToLine {width: 25px; height: 16px; border: 0; font-size: 10px; margin: -3px 0 0 3px} .goLine .goToLine {width: 25px; height: 16px; border: 0; font-size: 10px; margin: -3px 0 0 3px}
.goLine .goToLine:focus {outline: none; box-shadow: 0 0 10px 1px rgba(0,198,255,1)} .goLine .goToLine:focus {outline: none; box-shadow: 0 0 10px 1px rgba(0,198,255,1)}
.editor .code {position: relative; display: inline-block; top: 28px; width: 600px; height: 600px; visibility: hidden} .editor .code {position: relative; display: inline-block; top: 28px; width: 600px; height: 600px; visibility: hidden}
.footer {position: fixed; display: inline-block; width: 100%; height: 30px; bottom: 0; background-color: rgba(0,0,0,0.7); left: 0; z-index: 2} .footer {position: fixed; display: inline-block; width: 100%; height: 30px; bottom: 0; background-color: rgba(0,0,0,0.7); left: 0; z-index: 2}
.footer .nesting {display: inline-block; padding: 5px 8px; margin: 4px 0 0 15px; font-weight: bold; font-size: 10px; color: #fff; background-color: #0b0} .footer .nesting {display: inline-block; padding: 5px 8px; margin: 4px 0 0 15px; font-weight: bold; font-size: 10px; color: #fff; background-color: #0b0}
.footer .nestLoc {position: absolute; display: inline-block; width: 120px; padding: 5px 0 0 8px; margin-top: 3px; left: 112px; font-weight: bold; font-size: 12px; color: #fff; text-align: right} .footer .nestLoc {position: absolute; display: inline-block; width: 120px; padding: 5px 0 0 8px; margin-top: 2px; left: 112px; font-weight: bold; font-size: 12px; color: #fff; text-align: right}
.footer .nestDisplay {position: absolute; display: inline-block; padding: 5px 0 0 8px; margin-top: 3px; left: 255px; font-size: 12px; color: #fff; text-align: right} .footer .nestDisplay {position: absolute; display: inline-block; padding: 5px 0 0 8px; margin-top: 0px; left: 255px; font-size: 12px; color: #fff; text-align: right}
.footer .charDisplay {position: absolute; display: inline-block; padding: 5px 0 0 8px; margin-top: 3px; left: 100%; font-weight: bold; font-size: 12px; color: #fff; text-align: right; width: 200px; text-align: right; margin-left: -220px} .footer .charDisplay {position: absolute; display: inline-block; padding: 5px 0 0 8px; margin-top: 3px; left: 100%; font-weight: bold; font-size: 12px; color: #fff; text-align: right; width: 200px; text-align: right; margin-left: -220px}
.textbox {box-shadow: inset 1px 1px 2px 0 rgba(0,0,0,0.4)} .textbox {box-shadow: inset 1px 1px 2px 0 rgba(0,0,0,0.4)}
.fileMenu {position: absolute; display: none; left: 0; top: 0; background-color: #333; z-index: 10} .fileMenu {position: absolute; display: none; left: 0; top: 0; background-color: #333; z-index: 10}
.fileMenu a {display: block; padding: 2px 5px; background-color: #333; color: #eee; text-decoration: none} .fileMenu a {display: block; padding: 2px 5px; background-color: #333; color: #eee; text-decoration: none}
.fileMenu a:hover {background-color: #666} .fileMenu a:hover {background-color: #666}
.screenContainer {position: absolute; display: table; width: 100%; height: 100%; top: 0; left: 0; text-align: center} .screenContainer {position: absolute; display: table; width: 100%; height: 100%; top: 0; left: 0; text-align: center}
.screenContainer .screenVCenter {#position: absolute; display: table-cell; #top: 50%; vertical-align: middle; text-align: center} .screenContainer .screenVCenter {#position: absolute; display: table-cell; #top: 50%; vertical-align: middle; text-align: center}
.screenVCenter .screenCenter {#position: relative; #top: -50%; text-align: center; display: inline} .screenVCenter .screenCenter {#position: relative; #top: -50%; text-align: center; display: inline}
.screenCenter .version {position: relative; display: block; margin: 5px 0 15px 0; font-size: 10px; color: #bbb} .screenCenter .version {position: relative; display: block; margin: 5px 0 15px 0; font-size: 10px; color: #bbb}
.screenCenter .accountPassword {border: 0; background-color: #333; color: #fff; height: 20px} .screenCenter .accountPassword {border: 0; background-color: #333; color: #fff; height: 20px}
.screenCenter .button {border: 0; background: #444; color: #eee; height: 22px; cursor: pointer} .screenCenter .button {border: 0; background: #444; color: #eee; height: 22px; cursor: pointer}
.screenCenter .button:hover {background-color: #2187e7; color: #eee} .screenCenter .button:hover {background: #2187e7; color: #eee}

File diff suppressed because it is too large Load Diff

View File

@@ -1,199 +1,217 @@
<?php include("settings.php");?> <?php include("settings.php");?>
<!DOCTYPE html> <?php
if(isset($_GET['selectedFiles'])) {
<html> $selectedFiles=explode(":",strClean($_GET['selectedFiles']));
<head> echo $selectedFiles[0].".....".$selectedFiles[1];
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> multiple results screen</title> }
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> ?>
<link rel="stylesheet" type="text/css" href="multiple-results.css"> <!DOCTYPE html>
</head>
<html>
<body class="results" onLoad="top.document.getElementById('loadingMask').style.visibility = 'hidden'"> <head>
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> multiple results screen</title>
<h1 id="title"></h1> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<div class="resultsPane" id="resultsPane"> <meta name="robots" content="noindex, nofollow">
<div id="results"></div> <link rel="stylesheet" type="text/css" href="multiple-results.css">
</div> </head>
<?php if (isset($_GET['replace'])) { ?>
<div class="replaceAll" id="replaceAll" onClick="<?php <body class="results" onLoad="top.document.getElementById('loadingMask').style.visibility = 'hidden'">
if (isset($_GET['target']) && strpos($_GET['target'],"filenames")) {
echo 'renameAll()'; <h1 id="title"></h1>
} else if (isset($_GET['target']) && strpos($_GET['target'],"files")) { <div class="resultsPane" id="resultsPane">
echo 'replaceInFilesAll()'; <div id="results"></div>
} else { </div>
echo 'replaceAll()'; <?php if (isset($_GET['replace'])) { ?>
} <div class="replaceAll" id="replaceAll" onClick="<?php
?>" style="opacity: 0.1"><?php echo isset($_GET['target']) && strpos($_GET['target'],"filenames") ? 'rename all' : 'replace all';?></div> if (isset($_GET['target']) && strpos($_GET['target'],"filenames")) {
<?php ;}; ?> echo 'renameAll()';
} else if (isset($_GET['target']) && strpos($_GET['target'],"files")) {
<script> echo 'replaceInFilesAll()';
<?php if (!isset($_GET['replace'])) { ?> } else {
document.getElementById('resultsPane').style.height = "380px"; echo 'replaceAll()';
<?php ;}; ?> }
var resultsDisplay = ""; ?>" style="opacity: 0.1"><?php echo isset($_GET['target']) && strpos($_GET['target'],"filenames") ? 'rename all' : 'replace all';?></div>
var foundArray = []; <?php ;}; ?>
foundInSelected = false;
userTarget = top.document.findAndReplace.target.value; <script>
findText = top.findAndReplace.find.value.toLowerCase(); <?php if (!isset($_GET['replace'])) { ?>
<?php document.getElementById('resultsPane').style.height = "380px";
$findText = str_replace("ICEcoder:","",str_replace("&#39;","\'",$_GET['find'])); <?php ;}; ?>
// Find in open docs? var resultsDisplay = "";
if (!isset($_GET['target'])) { var foundArray = [];
$targetName = "document"; foundInSelected = false;
?> userTarget = top.document.findAndReplace.target.value;
var startTab = top.ICEcoder.selectedTab; findText = top.findAndReplace.find.value.toLowerCase();
var rExp = new RegExp(findText,"gi"); <?php
for (var i=1;i<=top.ICEcoder.openFiles.length;i++) { $findText = str_replace("ICEcoder:","",str_replace("&#39;","\'",$_GET['find']));
top.ICEcoder.switchTab(i); // Find in open docs?
var cM = top.ICEcoder.getcMInstance(); if (!isset($_GET['target'])) {
var content = cM.getValue(); $targetName = "document";
if (content.match(rExp)) { ?>
resultsDisplay += '<a href="javascript:gotoTab('+i+')">'+ top.ICEcoder.openFiles[i-1]+ '</a><br><div id="foundCount'+i+'">Found '+content.match(rExp).length+' times</div>'; var startTab = top.ICEcoder.selectedTab;
<?php if (isset($_GET['replace'])) { ?> var rExp = new RegExp(findText,"gi");
resultsDisplay += '<div class="replace" id="replace" onClick="replaceSingle('+i+');this.style.display=\'none\'">replace</div>'; for (var i=1;i<=top.ICEcoder.openFiles.length;i++) {
<?php ;}; ?> top.ICEcoder.switchTab(i);
resultsDisplay += '<hr>'; var cM = top.ICEcoder.getcMInstance();
foundArray.push(i); var content = cM.getValue();
} if (content.match(rExp)) {
} resultsDisplay += '<a href="javascript:gotoTab('+i+')">'+ top.ICEcoder.openFiles[i-1]+ '</a><br><div id="foundCount'+i+'">Found '+content.match(rExp).length+' times</div>';
if (startTab!=top.ICEcoder.selectedTab) { <?php if (isset($_GET['replace'])) { ?>
top.ICEcoder.switchTab(startTab); resultsDisplay += '<div class="replace" id="replace" onClick="replaceSingle('+i+');this.style.display=\'none\'">replace</div>';
} <?php ;}; ?>
<?php resultsDisplay += '<hr>';
// Find in files or filenames foundArray.push(i);
} else { }
if (strpos($_GET['target'],"filenames")>0) { }
$targetName = "file/folder"; if (startTab!=top.ICEcoder.selectedTab) {
?> top.ICEcoder.switchTab(startTab);
var spansArray = top.ICEcoder.filesFrame.contentWindow.document.getElementsByTagName('span'); }
for (var i=0;i<spansArray.length;i++) { <?php
targetURL = spansArray[i].id.replace(/\|/g,"/"); // Find in files or filenames
if (targetURL.toLowerCase().indexOf(findText.toLowerCase())>-1 && targetURL.indexOf('_perms')>-1) { } else {
if (userTarget.indexOf("selected")>-1) { if (strpos($_GET['target'],"filenames")>0) {
for (var j=0;j<top.ICEcoder.selectedFiles.length;j++) { $targetName = "file/folder";
if (top.ICEcoder.selectedFiles[j].indexOf(targetURL.replace(/\//g,"|").replace(/_perms/g,""))>-1) { ?>
foundInSelected = true; var spansArray = top.ICEcoder.filesFrame.contentWindow.document.getElementsByTagName('span');
} for (var i=0;i<spansArray.length;i++) {
} foundInSelected = false;
} targetURL = spansArray[i].id.replace(/\|/g,"/").toLowerCase();
if (userTarget.indexOf("all")>-1 || (userTarget.indexOf("selected")>-1 && foundInSelected)) { if ( targetURL.lastIndexOf(findText.toLowerCase()) > targetURL.lastIndexOf("/")
resultsDisplay += '<a href="javascript:top.ICEcoder.openFile(\'<?php echo $docRoot;?>'+targetURL.replace(/\|/g,"/").replace(/_perms/g,"")+'\');top.ICEcoder.showHide(\'hide\',top.document.getElementById(\'blackMask\'))">'; && targetURL.indexOf(findText.toLowerCase())>-1 && targetURL.indexOf('_perms')>-1) {
resultsDisplay += targetURL.toLowerCase().replace(/\|/g,"/").replace(/_perms/g,"").replace(/<?php echo str_replace("/","\/",strtolower($findText)); ?>/g,"<b>"+findText.toLowerCase()+"</b>"); if (userTarget.indexOf("selected")>-1) {
resultsDisplay += '</a><br>'; for (var j=0;j<top.ICEcoder.selectedFiles.length;j++) {
<?php if (!isset($_GET['replace'])) { ?> if (
resultsDisplay += '<div id="foundCount'+i+'">'+spansArray[i].innerHTML+'</div>'; targetURL.replace(/\//g,"|").indexOf(top.ICEcoder.selectedFiles[j].replace(/\//g,"|").replace(/_perms/g,""))==0
<?php ;} else { ?> && (
resultsDisplay += '<div id="foundCount'+i+'">'+spansArray[i].innerHTML+', rename to '+targetURL.toLowerCase().replace(/\|/g,"/").replace(/_perms/g,"").replace(/<?php echo str_replace("/","\/",strtolower($findText)); ?>/g,"<b><?php if(isset($_GET['replace'])) {echo strtolower(strClean($_GET['replace']));};?></b>")+'</div>'; targetURL.replace(/\|/g,"/").replace(/_perms/g,"")==top.ICEcoder.selectedFiles[j].replace(/\|/g,"/").replace(/_perms/g,"")
<?php ||
;}; (targetURL.replace(/\|/g,"/").split("/").length > top.ICEcoder.selectedFiles[j].replace(/\|/g,"/").split("/").length && targetURL.charAt(top.ICEcoder.selectedFiles[j].length)=="/"))) {
if (isset($_GET['replace'])) { ?> foundInSelected = true;
resultsDisplay += '<div class="replace" id="replace" onClick="renameSingle('+i+');this.style.display=\'none\'">rename</div>'; }
<?php ;}; ?> }
resultsDisplay += '<hr>'; }
foundArray.push(i); if (userTarget.indexOf("all")>-1 || (userTarget.indexOf("selected")>-1 && foundInSelected)) {
} resultsDisplay += '<a href="javascript:top.ICEcoder.openFile(\'<?php echo $docRoot;?>'+targetURL.replace(/\|/g,"/").replace(/_perms/g,"")+'\');top.ICEcoder.showHide(\'hide\',top.document.getElementById(\'blackMask\'))">';
} resultsDisplay += targetURL.replace(/\|/g,"/").replace(/_perms/g,"").replace(/<?php echo str_replace("/","\/",strtolower($findText)); ?>/g,"<b>"+findText.toLowerCase()+"</b>");
} resultsDisplay += '</a><br>';
<?php <?php if (!isset($_GET['replace'])) { ?>
} else { resultsDisplay += '<div id="foundCount'+i+'">'+spansArray[i].innerHTML+'</div>';
$targetName = "file"; <?php ;} else { ?>
$r = 0; resultsDisplay += '<div id="foundCount'+i+'">'+spansArray[i].innerHTML+', rename to '+targetURL.replace(/\|/g,"/").replace(/_perms/g,"").replace(/<?php echo str_replace("/","\/",strtolower($findText)); ?>/g,"<b><?php if(isset($_GET['replace'])) {echo strtolower(strClean($_GET['replace']));};?></b>")+'</div>';
function phpGrep($q, $path, $base) { <?php
$fp = opendir($path); ;};
global $r; if (isset($_GET['replace'])) { ?>
global $ICEcoder; resultsDisplay += '<div class="replace" id="replace" onClick="renameSingle('+i+');this.style.display=\'none\'">rename</div>';
global $serverType; <?php ;}; ?>
if (!isset($ret)) {$ret="";}; resultsDisplay += '<hr>';
$slash = $serverType == "Windows" ? "\\" : "/"; foundArray.push(i);
while($f = readdir($fp)) { }
if(preg_match("#^\.+$#", $f)) continue; }
$fullPath = $path.$slash.$f; }
if(is_dir($fullPath)) { <?php
$ret .= phpGrep($q, $fullPath, $base); } else {
} else if(stristr(file_get_contents($fullPath), $q)) { $targetName = "file";
$bFile = false; $r = 0;
for ($i=0;$i<count($ICEcoder['bannedFiles']);$i++) { function phpGrep($q, $path, $base) {
if (strpos($f,$ICEcoder['bannedFiles'][$i])>0) {$bFile = true;}; $fp = opendir($path);
} global $r, $ICEcoder, $serverType, $selectedFiles;
if (!$bFile) { if (!isset($ret)) {$ret="";};
$ret .= "<a href=\\\"javascript:top.ICEcoder.openFile('".$fullPath."');top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'))\\\">"; $slash = $serverType == "Windows" ? "\\" : "/";
$ret .= str_replace($base,"",$fullPath)."</a><div id=\\\"foundCount".$r."\\\">Found ".substr_count(strtolower(file_get_contents($fullPath)),$q)." times</div>"; while($f = readdir($fp)) {
if (isset($_GET['replace'])) { if(preg_match("#^\.+$#", $f)) continue;
$ret .= "<div class=\\\"replace\\\" id=\\\"replace\\\" onClick=\\\"replaceInFileSingle('".$fullPath."');this.style.display=\'none\'\\\">replace</div>"; $fullPath = $path.$slash.$f;
}; if(is_dir($fullPath)) {
$ret .= '<hr>'; $ret .= phpGrep($q, $fullPath, $base);
echo 'foundArray.push("'.$fullPath.'");'; } else if(stristr(file_get_contents($fullPath), $q)) {
$r++; $bFile = false;
} for ($i=0;$i<count($ICEcoder['bannedFiles']);$i++) {
} if (strpos($f,$ICEcoder['bannedFiles'][$i])>0) {$bFile = true;};
} }
return $ret; $findPath = str_replace($base,"",$fullPath);
} for ($i=0;$i<count($selectedFiles);$i++) {
if (strpos($findPath,str_replace("|","/",$selectedFiles[$i]))!==0) {
$results = phpGrep($findText, $docRoot.$iceRoot, $docRoot.$iceRoot); $bFile = true;
echo 'resultsDisplay += "'.$results.'";'; }
?> }
<?php if (!$bFile) {
} $ret .= "<a href=\\\"javascript:top.ICEcoder.openFile('".$fullPath."');top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'))\\\">";
} $ret .= str_replace($base,"",$fullPath)."</a><div id=\\\"foundCount".$r."\\\">Found ".substr_count(strtolower(file_get_contents($fullPath)),$q)." times</div>";
?> if (isset($_GET['replace'])) {
showHide = foundArray.length==0 ? "hide" : "show"; $ret .= "<div class=\\\"replace\\\" id=\\\"replace\\\" onClick=\\\"replaceInFileSingle('".$fullPath."');this.style.display=\'none\'\\\">replace</div>";
top.ICEcoder.showHide(showHide,top.document.getElementById('blackMask')); };
if (foundArray.length==0) {top.ICEcoder.message('No matches found')}; $ret .= '<hr>';
<?php if (isset($_GET['replace'])) { ?> echo 'foundArray.push("'.$fullPath.'");';
if (foundArray.length!=0) {document.getElementById('replaceAll').style.opacity = 1}; $r++;
<?php ;}; ?> }
plural = foundArray.length >= 2 ? "s" : ""; }
targetName = "<?php echo $targetName;?>"; }
selectedText = foundInSelected ? "selected " : ""; return $ret;
document.getElementById('title').innerHTML = findText.replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")+" found in "+foundArray.length+" "+selectedText+targetName+plural; }
document.getElementById('results').innerHTML = resultsDisplay;
$results = phpGrep($findText, $docRoot.$iceRoot, $docRoot.$iceRoot);
var gotoTab = function(tab) { echo 'resultsDisplay += "'.$results.'";';
top.ICEcoder.switchTab(tab); ?>
top.ICEcoder.showHide('hide',top.document.getElementById('blackMask')); <?php
} }
}
var replaceSingle = function(tab) { ?>
top.ICEcoder.switchTab(tab); showHide = foundArray.length==0 ? "hide" : "show";
cM = top.ICEcoder.getcMInstance(); top.ICEcoder.showHide(showHide,top.document.getElementById('blackMask'));
content = cM.getValue(); if (foundArray.length==0) {top.ICEcoder.message('No matches found')};
cM.setValue(cM.getValue().replace(rExp,top.document.getElementById('replace').value)); <?php if (isset($_GET['replace'])) { ?>
document.getElementById('foundCount'+tab).innerHTML = document.getElementById('foundCount'+tab).innerHTML.replace('Found','Replaced'); if (foundArray.length!=0) {document.getElementById('replaceAll').style.opacity = 1};
} <?php ;}; ?>
plural = foundArray.length >= 2 ? "s" : "";
var replaceAll = function() { targetName = "<?php echo $targetName;?>";
for (var i=0;i<=foundArray.length-1;i++) { selectedText = foundInSelected ? "selected " : "";
replaceSingle(foundArray[i]); document.getElementById('title').innerHTML = findText.replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")+" found in "+foundArray.length+" "+selectedText+targetName+plural;
} document.getElementById('results').innerHTML = resultsDisplay;
top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'));
} var gotoTab = function(tab) {
top.ICEcoder.switchTab(tab);
var replaceInFileSingle = function(fileRef) { top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'));
top.ICEcoder.replaceInFile(fileRef,findText,'<?php if(isset($_GET['replace'])) {echo strClean($_GET['replace']);}; ?>'); }
}
var replaceSingle = function(tab) {
var replaceInFilesAll = function() { top.ICEcoder.switchTab(tab);
for (var i=0;i<=foundArray.length-1;i++) { cM = top.ICEcoder.getcMInstance();
replaceInFileSingle(foundArray[i]); content = cM.getValue();
} cM.setValue(cM.getValue().replace(rExp,top.document.getElementById('replace').value));
top.ICEcoder.showHide('hide',top.document.getElementById('blackMask')); document.getElementById('foundCount'+tab).innerHTML = document.getElementById('foundCount'+tab).innerHTML.replace('Found','Replaced');
} }
var renameSingle = function(arrayRef) { var replaceAll = function() {
fileRef = spansArray[arrayRef].id.replace(/\|/g,"/").replace(/_perms/g,""); for (var i=0;i<=foundArray.length-1;i++) {
newName = spansArray[arrayRef].id.replace(/\|/g,"/").replace(/_perms/g,"").replace(find,"<?php if(isset($_GET['replace'])) {echo strClean($_GET['replace']);}; ?>"); replaceSingle(foundArray[i]);
top.ICEcoder.renameFile(fileRef,newName); }
} top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'));
}
var renameAll = function() {
for (var i=0;i<=foundArray.length-1;i++) { var replaceInFileSingle = function(fileRef) {
renameSingle(foundArray[i]); top.ICEcoder.replaceInFile(fileRef,findText,'<?php if(isset($_GET['replace'])) {echo strClean($_GET['replace']);}; ?>');
} }
top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'));
} var replaceInFilesAll = function() {
</script> for (var i=0;i<=foundArray.length-1;i++) {
replaceInFileSingle(foundArray[i]);
</body> }
top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'));
}
var renameSingle = function(arrayRef) {
fileRef = spansArray[arrayRef].id.replace(/\|/g,"/").replace(/_perms/g,"");
newName = spansArray[arrayRef].id.replace(/\|/g,"/").replace(/_perms/g,"").replace(find,"<?php if(isset($_GET['replace'])) {echo strClean($_GET['replace']);}; ?>");
top.ICEcoder.renameFile(fileRef,newName);
}
var renameAll = function() {
for (var i=0;i<=foundArray.length-1;i++) {
renameSingle(foundArray[i]);
}
top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'));
}
</script>
</body>
</html> </html>

View File

@@ -1,147 +1,148 @@
<?php include("settings.php");?> <?php include("settings.php");?>
<!DOCTYPE html> <!DOCTYPE html>
<html onContextMenu="return false"> <html onContextMenu="return false">
<head> <head>
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> file/folder properties</title> <title>ICEcoder <?php echo $ICEcoder["versionNo"];?> file/folder properties</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="properties.css"> <meta name="robots" content="noindex, nofollow">
</head> <link rel="stylesheet" type="text/css" href="properties.css">
</head>
<body class="properties">
<body class="properties">
<h1 id="title">properties</h1>
<h1 id="title">properties</h1>
<?php
$fileName=$docRoot.$iceRoot.str_replace("|","/",strClean($_GET['fileName'])); <?php
?> $fileName=$docRoot.$iceRoot.str_replace("|","/",strClean($_GET['fileName']));
<h2><?php echo basename($fileName); ?></h2><br> ?>
<span class="column" style="width: 180px">Size: <?php <h2><?php echo basename($fileName); ?></h2><br>
$bytes = filesize($fileName); <span class="column" style="width: 180px">Size: <?php
// If it's a dir, get the dir size $bytes = filesize($fileName);
if (is_dir($fileName)) { // If it's a dir, get the dir size
$io = popen('/usr/bin/du -sb '.$fileName, 'r'); if (is_dir($fileName)) {
$bytes = intval(fgets($io,80)); $io = popen('/usr/bin/du -sb '.$fileName, 'r');
pclose($io); $bytes = intval(fgets($io,80));
} pclose($io);
// Change into kilobytes }
$outputSize = ($bytes/1024); // Change into kilobytes
$outputUnit = "kb"; $outputSize = ($bytes/1024);
// Maybe we should show in megabytes? $outputUnit = "kb";
if ($outputSize >= 1024) { // Maybe we should show in megabytes?
$outputSize = ($outputSize/1024); if ($outputSize >= 1024) {
$outputUnit = "mb"; $outputSize = ($outputSize/1024);
} $outputUnit = "mb";
echo number_format($outputSize, 2, '.', '').$outputUnit." (".number_format($bytes)." bytes)"; }
?></span> echo number_format($outputSize, 2, '.', '').$outputUnit." (".number_format($bytes)." bytes)";
<span class="column" style="margin: 0 10px">Modified: <?php echo date( "D d M Y g:i:sa", filemtime($fileName)); ?></span> ?></span>
<span class="column">Last access: <?php echo date( "D d M Y g:i:sa", fileatime($fileName)); ?></span> <span class="column" style="margin: 0 10px">Modified: <?php echo date( "D d M Y g:i:sa", filemtime($fileName)); ?></span>
<br><br> <span class="column">Last access: <?php echo date( "D d M Y g:i:sa", fileatime($fileName)); ?></span>
<span class="column" style="width: 180px">Type: <?php echo is_dir($fileName) ? "Folder" : "File"; ?></span> <br><br>
<span class="column" style="margin: 0 10px">Readable / Writeable: <span class="column" style="width: 180px">Type: <?php echo is_dir($fileName) ? "Folder" : "File"; ?></span>
<?php echo is_readable($fileName) ? "Yes" : "No"; ?> / <?php echo is_writeable($fileName) ? "Yes" : "No";?> <span class="column" style="margin: 0 10px">Readable / Writeable:
</span> <?php echo is_readable($fileName) ? "Yes" : "No"; ?> / <?php echo is_writeable($fileName) ? "Yes" : "No";?>
<span class="column">Relative path: <?php echo str_replace($docRoot,"",$fileName);?></span> </span>
<span style="font-size:10px"> <span class="column">Relative path: <?php echo str_replace($docRoot,"",$fileName);?></span>
<br><br> <span style="font-size:10px">
Absolute path:<br><?php echo $fileName;?> <br><br>
<br><br> Absolute path:<br><?php echo $fileName;?>
</span> <br><br>
<span class="column" style="width: 180px"> </span>
Permissions: <span class="column" style="width: 180px">
<?php Permissions:
$chmodInfo = substr(sprintf('%o', fileperms($fileName)), -4); <?php
echo $chmodInfo; $chmodInfo = substr(sprintf('%o', fileperms($fileName)), -4);
?> echo $chmodInfo;
</span> ?>
<span class="column" style="margin: 0 10px"> </span>
<?php <span class="column" style="margin: 0 10px">
$perms = str_split(substr($chmodInfo,1,3)); // reduces 0705 down to 705 <?php
$readVars = array(4,5,6,7); $perms = str_split(substr($chmodInfo,1,3)); // reduces 0705 down to 705
$writeVars = array(2,3,6,7); $readVars = array(4,5,6,7);
$execVars = array(1,3,5,7); $writeVars = array(2,3,6,7);
?> $execVars = array(1,3,5,7);
<table> ?>
<tr><th>Owner</th><th>Group</th><th>Public</th></tr> <table>
<tr> <tr><th>Owner</th><th>Group</th><th>Public</th></tr>
<td><input type="checkbox" name="ownerR" id="owner4"<?php if(in_array($perms[0],$readVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Read</td> <tr>
<td><input type="checkbox" name="groupR" id="group4"<?php if(in_array($perms[1],$readVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Read</td> <td><input type="checkbox" name="ownerR" id="owner4"<?php if(in_array($perms[0],$readVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Read</td>
<td><input type="checkbox" name="publicR" id="public4"<?php if(in_array($perms[2],$readVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Read</td> <td><input type="checkbox" name="groupR" id="group4"<?php if(in_array($perms[1],$readVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Read</td>
</tr> <td><input type="checkbox" name="publicR" id="public4"<?php if(in_array($perms[2],$readVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Read</td>
<tr> </tr>
<td><input type="checkbox" name="ownerW" id="owner2"<?php if(in_array($perms[0],$writeVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Write</td> <tr>
<td><input type="checkbox" name="groupW" id="group2"<?php if(in_array($perms[1],$writeVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Write</td> <td><input type="checkbox" name="ownerW" id="owner2"<?php if(in_array($perms[0],$writeVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Write</td>
<td><input type="checkbox" name="publicW" id="public2"<?php if(in_array($perms[2],$writeVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Write</td> <td><input type="checkbox" name="groupW" id="group2"<?php if(in_array($perms[1],$writeVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Write</td>
</tr> <td><input type="checkbox" name="publicW" id="public2"<?php if(in_array($perms[2],$writeVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Write</td>
<tr> </tr>
<td><input type="checkbox" name="ownerE" id="owner1"<?php if(in_array($perms[0],$execVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Execute</td> <tr>
<td><input type="checkbox" name="groupE" id="group1"<?php if(in_array($perms[1],$execVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Execute</td> <td><input type="checkbox" name="ownerE" id="owner1"<?php if(in_array($perms[0],$execVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Execute</td>
<td><input type="checkbox" name="publicE" id="public1"<?php if(in_array($perms[2],$execVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Execute</td> <td><input type="checkbox" name="groupE" id="group1"<?php if(in_array($perms[1],$execVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Execute</td>
</tr> <td><input type="checkbox" name="publicE" id="public1"<?php if(in_array($perms[2],$execVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Execute</td>
</table> </tr>
</span> </table>
<span class="column"> </span>
Change to:<br> <span class="column">
<form name="chmod" action="#" method="GET"> Change to:<br>
<input type="text" name="chmod" id="permText" style="width: 30px; border: 0; background-color: #444; font-size: 10px; color: #fff" maxlength="3" value="<?php echo substr($chmodInfo,1,3); ?>" onKeyUp="changePerms(this.value);showButton()" onChange="changePerms(this.value);showButton()"> <form name="chmod" action="#" method="GET">
</form> <input type="text" name="chmod" id="permText" style="width: 30px; border: 0; background-color: #444; font-size: 10px; color: #fff" maxlength="3" value="<?php echo substr($chmodInfo,1,3); ?>" onKeyUp="changePerms(this.value);showButton()" onChange="changePerms(this.value);showButton()">
</span> </form>
</span>
<div class="update" id="updateButton" onClick="validatePerms()">update</div>
<div class="update" id="updateButton" onClick="validatePerms()">update</div>
<script>
readVars = [4,5,6,7]; <script>
writeVars = [2,3,6,7]; readVars = [4,5,6,7];
execVars = [1,3,5,7]; writeVars = [2,3,6,7];
permGroups = ['owner','group','public']; execVars = [1,3,5,7];
permValues = [4,2,1]; permGroups = ['owner','group','public'];
permTypes = ['read','write','exec']; permValues = [4,2,1];
permTypes = ['read','write','exec'];
function changePerms(val) {
var permText = document.getElementById('permText').value; function changePerms(val) {
// change checkboxes var permText = document.getElementById('permText').value;
if (val) { // change checkboxes
// set values if (val) {
if (permText.length==3) { // set values
for (var i=0;i<=2;i++) { if (permText.length==3) {
for (var j=0;j<=2;j++) { for (var i=0;i<=2;i++) {
document.getElementById(permGroups[i]+permValues[j]).checked = window[permTypes[j]+'Vars'].indexOf(permText.split("")[i]*1)>-1; for (var j=0;j<=2;j++) {
} document.getElementById(permGroups[i]+permValues[j]).checked = window[permTypes[j]+'Vars'].indexOf(permText.split("")[i]*1)>-1;
} }
// clear values }
} else { // clear values
for (var i=0;i<=2;i++) { } else {
for (var j=0;j<=2;j++) { for (var i=0;i<=2;i++) {
document.getElementById(permGroups[i]+permValues[j]).checked = false; for (var j=0;j<=2;j++) {
} document.getElementById(permGroups[i]+permValues[j]).checked = false;
} }
} }
// change text value }
} else { // change text value
ownerPerms = (document.getElementById('owner4').checked*4)+(document.getElementById('owner2').checked*2)+(document.getElementById('owner1').checked*1); } else {
groupPerms = (document.getElementById('group4').checked*4)+(document.getElementById('group2').checked*2)+(document.getElementById('group1').checked*1); ownerPerms = (document.getElementById('owner4').checked*4)+(document.getElementById('owner2').checked*2)+(document.getElementById('owner1').checked*1);
publicPerms = (document.getElementById('public4').checked*4)+(document.getElementById('public2').checked*2)+(document.getElementById('public1').checked*1); groupPerms = (document.getElementById('group4').checked*4)+(document.getElementById('group2').checked*2)+(document.getElementById('group1').checked*1);
document.getElementById('permText').value = ownerPerms.toString() + groupPerms.toString() + publicPerms.toString(); publicPerms = (document.getElementById('public4').checked*4)+(document.getElementById('public2').checked*2)+(document.getElementById('public1').checked*1);
} document.getElementById('permText').value = ownerPerms.toString() + groupPerms.toString() + publicPerms.toString();
} }
}
var showButton = function() {
document.getElementById('updateButton').style.opacity = 1; var showButton = function() {
} document.getElementById('updateButton').style.opacity = 1;
}
var validatePerms = function() {
var permText = document.getElementById('permText').value; var validatePerms = function() {
canUpdate = true; var permText = document.getElementById('permText').value;
if (permText.length!=3 || isNaN(permText)) {canUpdate = false}; canUpdate = true;
if ( permText.split("")[0]*1 <0 || permText.split("")[0]*1 >7 || if (permText.length!=3 || isNaN(permText)) {canUpdate = false};
permText.split("")[1]*1 <0 || permText.split("")[1]*1 >7 || if ( permText.split("")[0]*1 <0 || permText.split("")[0]*1 >7 ||
permText.split("")[2]*1 <0 || permText.split("")[2]*1 >7) { permText.split("")[1]*1 <0 || permText.split("")[1]*1 >7 ||
canUpdate = false; permText.split("")[2]*1 <0 || permText.split("")[2]*1 >7) {
} canUpdate = false;
if (canUpdate) {top.ICEcoder.chmod('<?php echo str_replace($docRoot,"",$fileName);?>',permText)}; }
} if (canUpdate) {top.ICEcoder.chmod('<?php echo str_replace($docRoot,"",$fileName);?>',permText)};
</script> }
</script>
</body>
</body>
</html> </html>

View File

@@ -1,217 +1,227 @@
<?php include("settings.php");?> <?php include("settings.php");?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> settings screen</title> <title>ICEcoder <?php echo $ICEcoder["versionNo"];?> settings screen</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="settings-screen.css"> <meta name="robots" content="noindex, nofollow">
<link rel="stylesheet" href="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror.css"> <link rel="stylesheet" type="text/css" href="settings-screen.css">
<script src="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror-compressed.js"></script> <link rel="stylesheet" href="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror.css">
<script src="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror-compressed.js"></script>
<style type="text/css">
.CodeMirror {position: absolute; width: 0; background-color: #fff; color: #000; font-family: monospace; width: 420px} <style type="text/css">
.CodeMirror-scroll {height: 240px; overflow: hidden} .CodeMirror {position: absolute; width: 0; background-color: #fff; color: #000; font-family: monospace; width: 420px}
/* Make sure this next one remains the 3rd item, updated with JS */ .CodeMirror-scroll {height: 240px; overflow: hidden}
.cm-tab:after {position: relative; display: inline-block; width: 0; left: -1.4em; overflow: visible; color: #aaa; content: "<?php if($ICEcoder["visibleTabs"]) {echo '\21e5';};?>";} /* Make sure this next one remains the 3rd item, updated with JS */
</style> .cm-tab:after {position: relative; display: inline-block; width: 0; left: -1.4em; overflow: visible; color: #aaa; content: "<?php if($ICEcoder["visibleTabs"]) {echo '\21e5';};?>";}
</style>
<link rel="stylesheet" href="editor.css">
<?php <link rel="stylesheet" href="editor.css">
$themeArray = array(); <?php
$handle = opendir('../'.$ICEcoder["codeMirrorDir"].'/theme/'); $themeArray = array();
while (false !== ($file = readdir($handle))) { $handle = opendir('../'.$ICEcoder["codeMirrorDir"].'/theme/');
if ($file !== "." && $file != "..") { while (false !== ($file = readdir($handle))) {
array_push($themeArray,basename($file,".css")); if ($file !== "." && $file != "..") {
} array_push($themeArray,basename($file,".css"));
} }
sort($themeArray); }
for ($i=0;$i<count($themeArray);$i++) { sort($themeArray);
echo '<link rel="stylesheet" href="../'.$ICEcoder["codeMirrorDir"].'/theme/'.$themeArray[$i].'.css">'.PHP_EOL; for ($i=0;$i<count($themeArray);$i++) {
} echo '<link rel="stylesheet" href="../'.$ICEcoder["codeMirrorDir"].'/theme/'.$themeArray[$i].'.css">'.PHP_EOL;
?> }
</head> ?>
</head>
<body class="settings">
<body class="settings">
<div class="infoPane">
<img src="../images/ice-coder.png" class="logo"> <div class="infoPane">
<div class="version">v <?php echo $ICEcoder["versionNo"];?></div> <img src="../images/ice-coder.png" class="logo">
<div class="version">v <?php echo $ICEcoder["versionNo"];?></div>
<p>
git:<br> <p>
<a href="http://github.com/mattpass/ICEcoder" target="_blank">http://github.com/mattpass/ICEcoder</a> git:<br>
<br><br> <a href="http://github.com/mattpass/ICEcoder" target="_blank">http://github.com/mattpass/ICEcoder</a>
<br><br>
codemirror dir:<br>
<?php echo $ICEcoder["codeMirrorDir"]; ?> codemirror dir:<br>
<br><br> <?php echo $ICEcoder["codeMirrorDir"]; ?>
<br><br>
codemirror version:<br>
<script> codemirror version:<br>
document.write(CodeMirror.version); <script>
</script> document.write(CodeMirror.version);
<br><br> </script>
<br><br>
file manager root:<br>
<?php echo $ICEcoder['root'];?> file manager root:<br>
<br><br><br><br> <?php echo $ICEcoder['root'];?>
<br><br><br><br>
<div style="font-size: 10px; line-height: 12px">ICE coder by Matt Pass (<a href="http://www.twitter.com/mattpass" style="font-size: 10px" target="_blank">@mattpass</a>)<br><br>
Free to use it for your own purposes, commercial or not, just let me know of any cool uses or customisations. :)<br><br> <div style="font-size: 10px; line-height: 12px">ICE coder by Matt Pass (<a href="http://www.twitter.com/mattpass" style="font-size: 10px" target="_blank">@mattpass</a>)<br><br>
No warranty or liability accepted for anything, all responsibility of use is your own.<br><br> Free to use it for your own purposes, commercial or not, just let me know of any cool uses or customisations. :)<br><br>
No warranty or liability accepted for anything, all responsibility of use is your own.<br><br>
Thanks go to the following people who have inspired me to create this and in the odd case, provided feedback or code:<br>
<?php Thanks go to the following people who have inspired me to create this and in the odd case, provided feedback or code:<br>
$peopleArray = array("marijnjh", "maettig", "wimtibackx", "jakubvrana", "_higg_", "yandle", "davidwalshblog", "kuvos", "mathias", "rem"); <?php
for ($i=0;$i<count($peopleArray)-1;$i++) { $peopleArray = array("marijnjh", "maettig", "wimtibackx", "jakubvrana", "_higg_", "yandle", "davidwalshblog", "kuvos", "mathias", "rem");
echo '<a href="http://www.twitter.com/'.$peopleArray[$i].'" style="font-size: 10px" target="_blank">@'.$peopleArray[$i].'</a>'; for ($i=0;$i<count($peopleArray)-1;$i++) {
if ($i<count($peopleArray)-2) { echo '<a href="http://www.twitter.com/'.$peopleArray[$i].'" style="font-size: 10px" target="_blank">@'.$peopleArray[$i].'</a>';
echo ", "; if ($i<count($peopleArray)-2) {
} echo ", ";
} }
?> }
?>
</div>
</p> </div>
</div> </p>
</div>
<form name="settings" action="settings.php" method="POST">
<div class="settingsColumn1"> <form name="settings" action="settings.php" method="POST">
<h1>settings</h1> <div class="settingsColumn1">
<h2>functionality</h2> <h1>settings</h1>
<input type="checkbox" onclick="showButton()" name="tabsIndent" value="true"<?php if($ICEcoder["tabsIndent"]) {echo ' checked';};?>> tab indents selection<br> <h2>functionality</h2>
<input type="checkbox" onclick="showButton()" name="checkUpdates" value="true"<?php if($ICEcoder["checkUpdates"]) {echo ' checked';};?>> check for updates on load<br> <input type="checkbox" onclick="showButton()" name="tabsIndent" value="true"<?php if($ICEcoder["tabsIndent"]) {echo ' checked';};?>> tab indents selection<br>
<input type="checkbox" onclick="showButton()" name="openLastFiles" value="true"<?php if($ICEcoder["openLastFiles"]) {echo ' checked';};?>> auto open last files on login<br> <input type="checkbox" onclick="showButton()" name="checkUpdates" value="true"<?php if($ICEcoder["checkUpdates"]) {echo ' checked';};?>> check for updates on load<br>
<br> <input type="checkbox" onclick="showButton()" name="openLastFiles" value="true"<?php if($ICEcoder["openLastFiles"]) {echo ' checked';};?>> auto open last files on login<br>
when finding in files, exclude:<br> <br>
<input type="text" onkeydown="showButton()" name="findFilesExclude" value="<?php for($i=0;$i<=count($ICEcoder["findFilesExclude"])-1;$i++) {echo $ICEcoder["findFilesExclude"][$i]; if ($i<count($ICEcoder["findFilesExclude"])-1) {echo ', ';};}; ?>"><br> when finding in files, exclude:<br>
<br> <input type="text" onkeydown="showButton()" name="findFilesExclude" value="<?php for($i=0;$i<=count($ICEcoder["findFilesExclude"])-1;$i++) {echo $ICEcoder["findFilesExclude"][$i]; if ($i<count($ICEcoder["findFilesExclude"])-1) {echo ', ';};}; ?>"><br>
<br>
<h2>assisting</h2>
<input type="checkbox" onclick="showButton()" name="codeAssist" value="true"<?php if($ICEcoder["codeAssist"]) {echo ' checked';};?>> code assist<br> <h2>assisting</h2>
<input type="checkbox" onclick="showButton();showHideTabs()" name="visibleTabs" value="true"<?php if($ICEcoder["visibleTabs"]) {echo ' checked';};?>> visible tabs<br> <input type="checkbox" onclick="showButton()" name="codeAssist" value="true"<?php if($ICEcoder["codeAssist"]) {echo ' checked';};?>> code assist<br>
<input type="checkbox" onclick="showButton()" name="lockedNav" value="true"<?php if($ICEcoder["lockedNav"]) {echo ' checked';};?>> locked nav<br> <input type="checkbox" onclick="showButton();showHideTabs()" name="visibleTabs" value="true"<?php if($ICEcoder["visibleTabs"]) {echo ' checked';};?>> visible tabs<br>
<br> <input type="checkbox" onclick="showButton()" name="lockedNav" value="true"<?php if($ICEcoder["lockedNav"]) {echo ' checked';};?>> locked nav<br>
<br>
<h2>security</h2>
new password <span style="font-size: 10px; color: #888">8 chars</span><br> <h2>security</h2>
<input type="password" name="accountPassword" onkeydown="showButton()"><br> new password <span style="font-size: 10px; color: #888">8 chars</span><br>
confirm password<br> <input type="password" name="accountPassword" onkeydown="showButton()"><br>
<input type="password" name="confirmPassword" onkeydown="showButton()"><br> confirm password<br>
<br> <input type="password" name="confirmPassword" onkeydown="showButton()"><br>
banned files/folders<br> <br>
<input type="text" onkeydown="document.settings.changedFileSettings.value='true';showButton()" name="bannedFiles" value="<?php for($i=0;$i<=count($ICEcoder["bannedFiles"])-1;$i++) {echo $ICEcoder["bannedFiles"][$i]; if ($i<count($ICEcoder["bannedFiles"])-1) {echo ', ';};}; ?>"><br> banned files/folders<br>
<input type="hidden" name="changedFileSettings" value="false"> <input type="text" onkeydown="document.settings.changedFileSettings.value='true';showButton()" name="bannedFiles" value="<?php for($i=0;$i<=count($ICEcoder["bannedFiles"])-1;$i++) {echo $ICEcoder["bannedFiles"][$i]; if ($i<count($ICEcoder["bannedFiles"])-1) {echo ', ';};}; ?>"><br>
<br> banned paths<br>
ip addresses<br> <input type="text" onkeydown="document.settings.changedFileSettings.value='true';showButton()" name="bannedPaths" value="<?php for($i=0;$i<=count($ICEcoder["bannedPaths"])-1;$i++) {echo $ICEcoder["bannedPaths"][$i]; if ($i<count($ICEcoder["bannedPaths"])-1) {echo ', ';};}; ?>"><br>
<input type="text" onkeydown="showButton()" name="allowedIPs" value="<?php for($i=0;$i<=count($ICEcoder["allowedIPs"])-1;$i++) {echo $ICEcoder["allowedIPs"][$i]; if ($i<count($ICEcoder["allowedIPs"])-1) {echo ', ';};}; ?>"><br> <input type="hidden" name="changedFileSettings" value="false">
</div> ip addresses<br>
<input type="text" onkeydown="showButton()" name="allowedIPs" value="<?php for($i=0;$i<=count($ICEcoder["allowedIPs"])-1;$i++) {echo $ICEcoder["allowedIPs"][$i]; if ($i<count($ICEcoder["allowedIPs"])-1) {echo ', ';};}; ?>"><br>
<div class="settingsColumn2"> </div>
<h2>plugins</h2>
plugins array <span style="font-size: 10px; color: #888">name, img src, style, url, target, setInterval (mins)</span><br> <div class="settingsColumn2">
<textarea name="plugins" class="plugins" onkeydown="showButton()"><?php <h2>plugins</h2>
for($i=0;$i<count($ICEcoder["plugins"]);$i++) { plugins array <span style="font-size: 10px; color: #888">name, img src, style, url, target, setInterval (mins)</span><br>
echo '"'.implode('",'.PHP_EOL.'"', $ICEcoder["plugins"][$i]).'"'; <textarea name="plugins" class="plugins" onkeydown="showButton()"><?php
if ($i<count($ICEcoder["plugins"])-1) { for($i=0;$i<count($ICEcoder["plugins"]);$i++) {
echo PHP_EOL."====================".PHP_EOL; echo '"'.implode('",'.PHP_EOL.'"', $ICEcoder["plugins"][$i]).'"';
} if ($i<count($ICEcoder["plugins"])-1) {
} echo PHP_EOL."====================".PHP_EOL;
?></textarea> }
<br><br> }
?></textarea>
<h2>style</h2> <br><br>
theme<br>
<select onchange="selectTheme();showButton()" id="select" name="theme"> <h2>style</h2>
<option<?php if ($ICEcoder["theme"]=="default") {echo ' selected';}; ?>>default</option> theme<br>
<?php <select onchange="selectTheme();showButton()" id="select" name="theme">
for ($i=0;$i<count($themeArray);$i++) { <option<?php if ($ICEcoder["theme"]=="default") {echo ' selected';}; ?>>default</option>
$optionSelected = $ICEcoder["theme"]==$themeArray[$i] ? ' selected' : ''; <?php
echo '<option'.$optionSelected.'>'.$themeArray[$i].'</option>'.PHP_EOL; for ($i=0;$i<count($themeArray);$i++) {
} $optionSelected = $ICEcoder["theme"]==$themeArray[$i] ? ' selected' : '';
?> echo '<option'.$optionSelected.'>'.$themeArray[$i].'</option>'.PHP_EOL;
</select> }
?>
<span style="position: absolute; margin: -18px 0 0 30px"> </select>
tab width <span style="font-size: 10px; color: #888">chars</span><br>
<input type="text" name="tabWidth" id="tabWidth" style="width: 30px" onkeydown="showButton()" onkeyup="changeTabWidth()" value="<?php echo $ICEcoder["tabWidth"];?>"> <span style="position: absolute; margin: -15px 0 0 20px">
</span> line wrapping<br>
<br><br> <select onchange="showButton()" name="lineWrapping">
<option value="true"<?php if($ICEcoder["lineWrapping"]) {echo " selected";};?>>yes</option>
<textarea id="code" name="code"> <option value="false"<?php if(!$ICEcoder["lineWrapping"]) {echo " selected";};?>>no</option>
function findSequence(goal) { </select>
function find(start,history) { </span>
if (start==goal)
return history; <span style="position: absolute; margin: -15px 0 0 120px">
else if (start>goal) tab width <span style="font-size: 10px; color: #888">chars</span><br>
return null; <input type="text" name="tabWidth" id="tabWidth" style="width: 30px" onkeydown="showButton()" onkeyup="changeTabWidth()" value="<?php echo $ICEcoder["tabWidth"];?>">
else </span>
return find(start+5,"("+history+"+5)") || <br><br>
find(start*3,"("+history+"*3)");
} <textarea id="code" name="code">
return find(1,"1"); function findSequence(goal) {
}</textarea> function find(start,history) {
<br> if (start==goal)
return history;
<span style="position: absolute; top: 510px"> else if (start>goal)
<h2>file manager</h2> return null;
root <span style="font-size: 10px; color: #888">slash prefixed</span><br> else
<input type="text" name="root" style="width: 250px" onkeydown="document.settings.changedFileSettings.value='true';showButton()" value="<?php echo $ICEcoder["root"];?>"> return find(start+5,"("+history+"+5)") ||
</span> find(start*3,"("+history+"*3)");
}
<script> return find(1,"1");
var editor = CodeMirror.fromTextArea(document.getElementById("code"), { }</textarea>
lineNumbers: true, <br>
readOnly: "nocursor",
indentUnit: top.ICEcoder.tabWidth, <span style="position: absolute; top: 510px">
tabSize: top.ICEcoder.tabWidth, <h2>file manager</h2>
mode: "javascript", root <span style="font-size: 10px; color: #888">slash prefixed</span><br>
theme: "<?php echo $ICEcoder["theme"]=="default" ? 'icecoder' : $ICEcoder["theme"];?>" <input type="text" name="root" style="width: 250px" onkeydown="document.settings.changedFileSettings.value='true';showButton()" value="<?php echo $ICEcoder["root"];?>">
}); </span>
var input = document.getElementById("select"); <script>
function selectTheme() { var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
var theme = input.options[input.selectedIndex].innerHTML; lineNumbers: true,
if (theme=="default") {theme = "icecoder"}; readOnly: "nocursor",
editor.setOption("theme", theme); indentUnit: top.ICEcoder.tabWidth,
} tabSize: top.ICEcoder.tabWidth,
mode: "javascript",
function changeTabWidth() { theme: "<?php echo $ICEcoder["theme"]=="default" ? 'icecoder' : $ICEcoder["theme"];?>"
var tabWidth = document.getElementById("tabWidth").value; });
editor.setOption("indentUnit", tabWidth);
editor.setOption("tabSize", tabWidth); var input = document.getElementById("select");
} function selectTheme() {
var theme = input.options[input.selectedIndex].innerHTML;
var showButton = function() { if (theme=="default") {theme = "icecoder"};
document.getElementById('updateButton').style.opacity = 1; editor.setOption("theme", theme);
} }
var showHideTabs = function() { function changeTabWidth() {
cMCSS = document.styleSheets[2]; var tabWidth = document.getElementById("tabWidth").value;
cMCSS.rules ? strCSS = 'rules' : strCSS = 'cssRules'; editor.setOption("indentUnit", tabWidth);
document.settings.visibleTabs.checked ? cMCSS[strCSS][2].style['content'] = '"\\21e5"' : cMCSS[strCSS][2].style['content'] = '" "'; editor.setOption("tabSize", tabWidth);
} }
var validatePasswords = function() { var showButton = function() {
if (document.settings.accountPassword.value != 0 && document.settings.accountPassword.value.length<8) { document.getElementById('updateButton').style.opacity = 1;
top.ICEcoder.message('Please use at least 8 chars in the password'); }
} else {
if (document.settings.accountPassword.value != document.settings.confirmPassword.value) { var showHideTabs = function() {
top.ICEcoder.message('Sorry, your passwords don\'t match') cMCSS = document.styleSheets[2];
} else { cMCSS.rules ? strCSS = 'rules' : strCSS = 'cssRules';
document.settings.submit(); document.settings.visibleTabs.checked ? cMCSS[strCSS][2].style['content'] = '"\\21e5"' : cMCSS[strCSS][2].style['content'] = '" "';
} }
}
} var validatePasswords = function() {
</script> if (document.settings.accountPassword.value != 0 && document.settings.accountPassword.value.length<8) {
top.ICEcoder.message('Please use at least 8 chars in the password');
<div class="update" id="updateButton" onClick="validatePasswords()">update</div> } else {
if (document.settings.accountPassword.value != document.settings.confirmPassword.value) {
</div> top.ICEcoder.message('Sorry, your passwords don\'t match')
} else {
</form> document.settings.submit();
}
</body> }
}
</script>
<div class="update" id="updateButton" onClick="validatePasswords()">update</div>
</div>
</form>
</body>
</html> </html>

View File

@@ -38,15 +38,19 @@ include($settingsFile);
// Add ICEcoder settings to beginning of $ICEcoder array // Add ICEcoder settings to beginning of $ICEcoder array
$ICEcoder = array( $ICEcoder = array(
"versionNo" => "1.1", "versionNo" => "1.3",
"codeMirrorDir" => "CodeMirror-2.35" "codeMirrorDir" => "CodeMirror-3.0",
"demoMode" => false
)+$ICEcoder; )+$ICEcoder;
$onLoadExtras = ""; $onLoadExtras = "";
$pluginsDisplay = ""; $pluginsDisplay = "";
if ($ICEcoder['demoMode'] && $ICEcoder['accountPassword']!="") {$_SESSION['loggedIn']=true;};
$demoMode = $ICEcoder['demoMode'];
// Update this config file? // Update this config file?
if (isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset($_POST["theme"]) && $_POST["theme"]) { if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset($_POST["theme"]) && $_POST["theme"]) {
$settingsContents = file_get_contents($settingsFile); $settingsContents = file_get_contents($settingsFile);
// Replace our settings vars // Replace our settings vars
$repPosStart = strpos($settingsContents,'"root"'); $repPosStart = strpos($settingsContents,'"root"');
@@ -63,12 +67,14 @@ if (isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset($_POST["theme
$ICEcoder["lockedNav"] = isset($_POST['lockedNav']) && $_POST['lockedNav'] ? "true" : "false"; $ICEcoder["lockedNav"] = isset($_POST['lockedNav']) && $_POST['lockedNav'] ? "true" : "false";
if ($_POST['accountPassword']!="") {$ICEcoder["accountPassword"] = generateHash(strClean($_POST['accountPassword']));}; if ($_POST['accountPassword']!="") {$ICEcoder["accountPassword"] = generateHash(strClean($_POST['accountPassword']));};
$ICEcoder["bannedFiles"] = 'array("'.str_replace(',','","',str_replace(" ","",strClean($_POST['bannedFiles']))).'")'; $ICEcoder["bannedFiles"] = 'array("'.str_replace(',','","',str_replace(" ","",strClean($_POST['bannedFiles']))).'")';
$ICEcoder["bannedPaths"] = 'array("'.str_replace(',','","',str_replace(" ","",strClean($_POST['bannedPaths']))).'")';
$ICEcoder["allowedIPs"] = 'array("'.str_replace(',','","',str_replace(" ","",strClean($_POST['allowedIPs']))).'")'; $ICEcoder["allowedIPs"] = 'array("'.str_replace(',','","',str_replace(" ","",strClean($_POST['allowedIPs']))).'")';
$ICEcoder["plugins"] = 'array('.PHP_EOL.' array('.PHP_EOL.' '.str_replace('====================','),'.PHP_EOL.' array(',$_POST['plugins']).'))'; $ICEcoder["plugins"] = 'array('.PHP_EOL.' array('.PHP_EOL.' '.str_replace('====================','),'.PHP_EOL.' array(',$_POST['plugins']).'))';
$ICEcoder["theme"] = strClean($_POST['theme']); $ICEcoder["theme"] = strClean($_POST['theme']);
$ICEcoder["lineWrapping"] = strClean($_POST['lineWrapping']);
$ICEcoder["tabWidth"] = numClean($_POST['tabWidth']); $ICEcoder["tabWidth"] = numClean($_POST['tabWidth']);
$settingsArray = array("root","tabsIndent","checkUpdates","openLastFiles","findFilesExclude","codeAssist","visibleTabs","lockedNav","accountPassword","bannedFiles","allowedIPs","plugins","theme","tabWidth"); $settingsArray = array("root","tabsIndent","checkUpdates","openLastFiles","findFilesExclude","codeAssist","visibleTabs","lockedNav","accountPassword","bannedFiles","bannedPaths","allowedIPs","plugins","theme","lineWrapping","tabWidth");
$settingsNew = ""; $settingsNew = "";
for ($i=0;$i<count($settingsArray);$i++) { for ($i=0;$i<count($settingsArray);$i++) {
$settingsNew .= '"'.$settingsArray[$i].'"'.PHP_EOL.' => '; $settingsNew .= '"'.$settingsArray[$i].'"'.PHP_EOL.' => ';
@@ -93,7 +99,7 @@ if (isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset($_POST["theme
// Do we need a file manager refresh? // Do we need a file manager refresh?
$refreshFM = $_POST['changedFileSettings']=="true" ? "true" : "false"; $refreshFM = $_POST['changedFileSettings']=="true" ? "true" : "false";
// With all that worked out, we can now hide the settings screen and apply the new settings // With all that worked out, we can now hide the settings screen and apply the new settings
echo "<script>top.ICEcoder.settingsScreen('hide');top.ICEcoder.useNewSettings('".$themeURL."',".$ICEcoder["tabsIndent"].",".$ICEcoder["codeAssist"].",".$ICEcoder["lockedNav"].",".$ICEcoder["visibleTabs"].",".$ICEcoder["tabWidth"].",".$refreshFM.");</script>"; echo "<script>top.ICEcoder.settingsScreen('hide');top.ICEcoder.useNewSettings('".$themeURL."',".$ICEcoder["tabsIndent"].",".$ICEcoder["codeAssist"].",".$ICEcoder["lockedNav"].",".$ICEcoder["visibleTabs"].",".$ICEcoder["lineWrapping"].",".$ICEcoder["tabWidth"].",".$refreshFM.");</script>";
} }
// Establish our user level // Establish our user level
@@ -134,7 +140,7 @@ 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 ($_GET['saveFiles']!="CLEAR") { if (!$demoMode && $_GET['saveFiles']!="CLEAR") {
$saveFiles=strClean($_GET['saveFiles']); $saveFiles=strClean($_GET['saveFiles']);
$saveFilesArray = explode(",",$saveFiles); $saveFilesArray = explode(",",$saveFiles);
$saveFiles=""; $saveFiles="";
@@ -241,6 +247,8 @@ if (!$_SESSION['loggedIn']) {
echo $ICEcoder["versionNo"]." : "; echo $ICEcoder["versionNo"]." : ";
echo $ICEcoder["accountPassword"] == "" ? "Setup" : "Login"; echo $ICEcoder["accountPassword"] == "" ? "Setup" : "Login";
?></title> ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow">
<link rel="stylesheet" type="text/css" href="ice-coder.css"> <link rel="stylesheet" type="text/css" href="ice-coder.css">
<link rel="icon" type="image/png" href="../favicon.png"> <link rel="icon" type="image/png" href="../favicon.png">
</head> </head>
@@ -253,7 +261,7 @@ echo $ICEcoder["accountPassword"] == "" ? "Setup" : "Login";
<img src="../images/ice-coder.png"> <img src="../images/ice-coder.png">
<div class="version">v <?php echo $ICEcoder["versionNo"];?></div> <div class="version">v <?php echo $ICEcoder["versionNo"];?></div>
<form name="settingsUpdate" action="settings.php" method="POST"> <form name="settingsUpdate" action="settings.php" method="POST">
<input type="password" name="<?php echo $ICEcoder["accountPassword"] == "" ? "account" : "login"; ?>Password" class="accountPassword"> <input type="password" name="<?php echo $ICEcoder["accountPassword"] == "" ? "account" : "login"; ?>Password" class="accountPassword"><br><br>
<input type="submit" name="submit" value="<?php echo $ICEcoder["accountPassword"] == "" ? "Set Password" : "Login"; ?>" class="button"> <input type="submit" name="submit" value="<?php echo $ICEcoder["accountPassword"] == "" ? "Set Password" : "Login"; ?>" class="button">
</form> </form>
</div> </div>

BIN
plugins/jshint/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 961 B

4832
plugins/jshint/jshint.js Normal file

File diff suppressed because it is too large Load Diff

BIN
plugins/terminal/icon.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

201
plugins/terminal/index.php Normal file
View File

@@ -0,0 +1,201 @@
<?php
include("../../lib/settings.php");
if ($demoMode || !$_SESSION['loggedIn']) {
die("You must be logged in to access Terminal");
}
error_reporting(E_ALL);
@session_start();
if (isset($_SERVER['PHP_AUTH_USER'])) {
$_SESSION['user'] = $_SERVER['PHP_AUTH_USER'];
$_SESSION['pass'] = generateHash(strClean($_SERVER['PHP_AUTH_PW']),$ICEcoder["accountPassword"]);
}
$passwd = array($_SESSION['user'] => $ICEcoder["accountPassword"]);
$aliases = array('la' => 'ls -la',
'll' => 'ls -lvhF',
'dir' => 'ls' );
class phpTerm {
function phpTerm() {} // constructor
function formatPrompt() {
$user=shell_exec("whoami");
$host=explode(".", shell_exec("uname -n"));
$_SESSION['prompt'] = "".rtrim($user).""."@"."".rtrim($host[0])."";
}
function checkPassword($passwd) {
if( !isset($_SERVER['PHP_AUTH_USER'])||
!isset($_SERVER['PHP_AUTH_PW']) ||
!isset($passwd[$_SERVER['PHP_AUTH_USER']]) ||
$passwd[$_SERVER['PHP_AUTH_USER']] != $_SESSION['pass']) {
return false;
} else {
return true;
}
}
function logout() {
header('WWW-Authenticate: Basic realm="Terminal"');
header('HTTP/1.0 401 Unauthorized');
exit();
}
function initVars() {
if (empty($_SESSION['cwd']) || @!empty($_GET['reset'])) {
$_SESSION['cwd'] = getcwd();
$_SESSION['history'] = array();
$_SESSION['output'] = '';
$_REQUEST['command'] ='';
}
}
function buildCommandHistory() {
if(!empty($_REQUEST['command'])) {
if(get_magic_quotes_gpc()) {
$_REQUEST['command'] = stripslashes($_REQUEST['command']);
}
// drop old commands from list if exists
if (($i = array_search($_REQUEST['command'], $_SESSION['history'])) !== false) {
unset($_SESSION['history'][$i]);
}
array_unshift($_SESSION['history'], $_REQUEST['command']);
// append commmand */
$_SESSION['output'] .= "{$_SESSION['prompt']}".":>"."{$_REQUEST['command']}"."\n";
}
}
function buildJavaHistory() {
// build command history for use in the JavaScript
if (empty($_SESSION['history'])) {
$_SESSION['js_command_hist'] = '""';
} else {
$escaped = array_map('addslashes', $_SESSION['history']);
$_SESSION['js_command_hist'] = '"", "' . implode('", "', $escaped) . '"';
}
}
function outputHandle($aliases) {
if (preg_match('/^[[:blank:]]*cd[[:blank:]]*$/', @$_REQUEST['command']))
{
$_SESSION['cwd'] = getcwd(); //dirname(__FILE__);
}
elseif(preg_match('/^[[:blank:]]*cd[[:blank:]]+([^;]+)$/', @$_REQUEST['command'], $regs)) {
// The current command is 'cd', which we have to handle as an internal shell command.
// absolute/relative path ?"
($regs[1][0] == '/') ? $new_dir = $regs[1] : $new_dir = $_SESSION['cwd'] . '/' . $regs[1];
// cosmetics
while (strpos($new_dir, '/./') !== false) {
$new_dir = str_replace('/./', '/', $new_dir);
}
while (strpos($new_dir, '//') !== false) {
$new_dir = str_replace('//', '/', $new_dir);
}
while (preg_match('|/\.\.(?!\.)|', $new_dir)) {
$new_dir = preg_replace('|/?[^/]+/\.\.(?!\.)|', '', $new_dir);
}
if(empty($new_dir)): $new_dir = "/"; endif;
(@chdir($new_dir)) ? $_SESSION['cwd'] = $new_dir : $_SESSION['output'] .= "could not change to: $new_dir\n";
} else {
/* The command is not a 'cd' command, so we execute it after
changing the directory and save the output. */
chdir($_SESSION['cwd']);
/* Alias expansion. */
$length = strcspn(@$_REQUEST['command'], " \t");
$token = substr(@$_REQUEST['command'], 0, $length);
if (isset($aliases[$token]))
$_REQUEST['command'] = $aliases[$token] . substr($_REQUEST['command'], $length);
$p = proc_open(@$_REQUEST['command'],
array(1 => array('pipe', 'w'),
2 => array('pipe', 'w')), $io);
/* Read output sent to stdout. */
while (!feof($io[1])) {
$_SESSION['output'] .= htmlspecialchars(fgets($io[1]),ENT_COMPAT, 'UTF-8');
}
/* Read output sent to stderr. */
while (!feof($io[2])) {
$_SESSION['output'] .= htmlspecialchars(fgets($io[2]),ENT_COMPAT, 'UTF-8');
}
fclose($io[1]);
fclose($io[2]);
proc_close($p);
}
}
}
$terminal = new phpTerm;
if ($_REQUEST['command']=="logout") {
$terminal->logout();
}
if(!$terminal->checkPassword($passwd)) {
header('WWW-Authenticate: Basic realm="Terminal"');
header('HTTP/1.0 401 Unauthorized');
} else {
$terminal->initVars();
$terminal->buildCommandHistory();
$terminal->buildJavaHistory();
if(!isset($_SESSION['prompt'])):$terminal->formatPrompt(); endif;
$terminal->outputHandle($aliases);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>PHP Terminal</title>
<link rel="stylesheet" type="text/css" href="terminal.css" />
<script type="text/javascript" language="JavaScript">
var current_line = 0;
var command_hist = new Array(<?php echo $_SESSION['js_command_hist']; ?>);
var last = 0;
function key(e) {
if (!e) var e = window.event;
if (e.keyCode == 38 && current_line < command_hist.length-1) {
command_hist[current_line] = document.shell.command.value;
current_line++;
document.shell.command.value = command_hist[current_line];
}
if (e.keyCode == 40 && current_line > 0) {
command_hist[current_line] = document.shell.command.value;
current_line--;
document.shell.command.value = command_hist[current_line];
}
}
function init() {
document.shell.setAttribute("autocomplete", "off");
document.shell.output.scrollTop = document.shell.output.scrollHeight;
document.shell.command.focus();
}
</script>
</head>
<body onload="init()">
<div class="head"><?php echo $_SESSION['prompt'].":"."$_SESSION[cwd]"; ?></div>
<form name="shell" action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
<textarea name="output" readonly="readonly" rows="24"><?php
$lines = substr_count($_SESSION['output'], "\n");
$padding = str_repeat("\n", max(0, 25 - $lines));
echo "\n\n".trim($padding . $_SESSION['output'])."\n";
?>
</textarea>
<p class="commandLine">$&gt; <input class="command" name="command" type="text" size='50' onkeyup="key(event)" tabindex="1"></p>
</form>
</body>
</html>
<?php } ?>

View File

@@ -0,0 +1,28 @@
/* First, reset everything to a standard */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, input, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
font-family: verdana, arial, monospace, sans-serif;
border: 0;
margin: 0;
padding: 0;
outline: 0;
font-size: 12px;
vertical-align: top;
}
html, body {width: 100%; height: 100%; background: #000}
.head {position: fixed; top: 0; padding: 2px; background: rgba(124,124,124,0.8); color: #fff; font-weight: bold; z-index: 1}
textarea {position: absolute; display: block; top: 0; padding: 0; width: 100%; height: 100%; min-height: 100%; border: 0; background: #000; color: #0c0}
textarea:focus {outline: none}
p {color: #0c0}
.commandLine {position: fixed; width: 100%; bottom: 0; padding: 2px; background: rgba(32,32,32,0.9); z-index: 1}
.command {width: 95%; font-family: verdana, arial, monospace, sans-serif; border: none; background: transparent; color: #0c0}
.command:focus {outline: none}

View File

@@ -0,0 +1,41 @@
<?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 {background: #fff}
</style>
</head>
<body>
<?php
$snippets = array(
array(
"name" => "Function",
"replace" => "f ",
"with" => "function ::var::() {\\n\\t::|::\\n}"
),
array(
"name" => "If",
"replace" => "if",
"with" => "if (::|::) {\\n\\t\\n}"
)
);
?>
<?php
for ($i=0;$i<count($snippets);$i++) {
echo '<div style="cursor: pointer" onClick="top.ICEcoder.doSnippet(\''.$snippets[$i]['replace'].'\',\''.$snippets[$i]['with'].'\')">'.$snippets[$i]['name'].'</div>';
}
;?>
</script>
</body>
</html>