mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-18 14:27:10 +01:00
Compare commits
53 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
22e6228a08 | ||
|
|
b757e42c88 | ||
|
|
fdf1ef1cb7 | ||
|
|
4797ff84d8 | ||
|
|
3937d733f0 | ||
|
|
0328643c7c | ||
|
|
80c73523e3 | ||
|
|
8c5747798d | ||
|
|
bdf6dbd096 | ||
|
|
0eaef469f9 | ||
|
|
f2d3615e26 | ||
|
|
24f05a1c03 | ||
|
|
570642d820 | ||
|
|
fd794f99d2 | ||
|
|
9a95bae6ba | ||
|
|
1b04504617 | ||
|
|
2a2cd81149 | ||
|
|
2bb961b7a8 | ||
|
|
01b035d7af | ||
|
|
8d0de398fd | ||
|
|
2ebec54476 | ||
|
|
b66d5fe8d3 | ||
|
|
0f989f249f | ||
|
|
6980bdcf7f | ||
|
|
975a016974 | ||
|
|
4be1b45896 | ||
|
|
8e10824189 | ||
|
|
1a881b4eaf | ||
|
|
2a9e91dd55 | ||
|
|
725ea8999a | ||
|
|
3427b736ec | ||
|
|
1dde9d0198 | ||
|
|
7577c3552d | ||
|
|
30de655fb2 | ||
|
|
09cf5589f5 | ||
|
|
b206f8ab78 | ||
|
|
f358cdea5b | ||
|
|
14fe45bda8 | ||
|
|
72ff461b45 | ||
|
|
96fe7d46ba | ||
|
|
d40cdeb65e | ||
|
|
4130df7bf9 | ||
|
|
6e176cdda7 | ||
|
|
bdb171dc6d | ||
|
|
801471a105 | ||
|
|
f86cb53bd9 | ||
|
|
435e1b3b4b | ||
|
|
4b17d76144 | ||
|
|
d96ebe4282 | ||
|
|
e5c5e7dc5e | ||
|
|
fe593dcb09 | ||
|
|
b1056a19a3 | ||
|
|
048c47f7f3 |
File diff suppressed because one or more lines are too long
@@ -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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
5
CodeMirror-3.0/lib/codemirror-compressed.js
Normal file
5
CodeMirror-3.0/lib/codemirror-compressed.js
Normal file
File diff suppressed because one or more lines are too long
239
CodeMirror-3.0/lib/codemirror.css
Normal file
239
CodeMirror-3.0/lib/codemirror.css
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
6
CodeMirror-3.0/theme/ambiance-mobile.css
Normal file
6
CodeMirror-3.0/theme/ambiance-mobile.css
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
.cm-s-ambiance.CodeMirror {
|
||||||
|
-webkit-box-shadow: none;
|
||||||
|
-moz-box-shadow: none;
|
||||||
|
-o-box-shadow: none;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
76
CodeMirror-3.0/theme/ambiance.css
Normal file
76
CodeMirror-3.0/theme/ambiance.css
Normal file
File diff suppressed because one or more lines are too long
@@ -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; }
|
||||||
@@ -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; }
|
||||||
@@ -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; }
|
||||||
@@ -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; }
|
||||||
@@ -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;}
|
||||||
@@ -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; }
|
||||||
@@ -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; }
|
||||||
207
CodeMirror-3.0/theme/solarized.css
Normal file
207
CodeMirror-3.0/theme/solarized.css
Normal file
File diff suppressed because one or more lines are too long
26
CodeMirror-3.0/theme/twilight.css
Normal file
26
CodeMirror-3.0/theme/twilight.css
Normal 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; } /**/
|
||||||
|
|
||||||
@@ -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; }
|
||||||
46
CodeMirror-3.0/theme/xq-dark.css
Normal file
46
CodeMirror-3.0/theme/xq-dark.css
Normal 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;}
|
||||||
101
editor.php
101
editor.php
@@ -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>
|
||||||
18
files.php
18
files.php
@@ -4,6 +4,7 @@
|
|||||||
<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>
|
||||||
|
<meta name="robots" content="noindex, nofollow">
|
||||||
<link rel="stylesheet" type="text/css" href="lib/files.css">
|
<link rel="stylesheet" type="text/css" href="lib/files.css">
|
||||||
<script src="lib/ice-coder.js" type="text/javascript"></script>
|
<script src="lib/ice-coder.js" type="text/javascript"></script>
|
||||||
</head>
|
</head>
|
||||||
@@ -31,8 +32,23 @@ class SortingIterator implements IteratorAggregate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class IgnorantRecursiveDirectoryIterator extends RecursiveDirectoryIterator {
|
||||||
|
function getChildren() {
|
||||||
|
try {
|
||||||
|
if (!isset($GLOBALS['ICEcoder']['bannedPaths']) ||
|
||||||
|
!in_array($this->key(), $GLOBALS['ICEcoder']['bannedPaths'])) {
|
||||||
|
return parent::getChildren();
|
||||||
|
} else {
|
||||||
|
return new RecursiveArrayIterator(array());
|
||||||
|
}
|
||||||
|
} catch(UnexpectedValueException $e) {
|
||||||
|
return new RecursiveArrayIterator(array());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Get a full list of dirs & files and begin sorting using above class & function
|
// 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');
|
$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
|
// With that done, create arrays for out final ordered list and a temp container of files
|
||||||
$finalArray = $tempArray = array();
|
$finalArray = $tempArray = array();
|
||||||
|
|||||||
BIN
images/nest-tag-bg.gif
Normal file
BIN
images/nest-tag-bg.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 120 B |
13
index.php
13
index.php
@@ -35,6 +35,11 @@ window.onbeforeunload = function() {
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
<script language="JavaScript" src="lib/ice-coder.js"></script>
|
<script language="JavaScript" src="lib/ice-coder.js"></script>
|
||||||
|
<?php
|
||||||
|
if (file_exists(dirname(__FILE__)."/plugins/jshint/jshint.js")) {
|
||||||
|
echo '<script src="plugins/jshint/jshint.js"></script>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body onLoad="<?php
|
<body onLoad="<?php
|
||||||
@@ -50,6 +55,8 @@ window.onbeforeunload = function() {
|
|||||||
echo $ICEcoder["tabsIndent"] ? 'true' : 'false';
|
echo $ICEcoder["tabsIndent"] ? 'true' : 'false';
|
||||||
echo ';top.ICEcoder.openLastFiles = ';
|
echo ';top.ICEcoder.openLastFiles = ';
|
||||||
echo $ICEcoder["openLastFiles"] ? 'true' : 'false';
|
echo $ICEcoder["openLastFiles"] ? 'true' : 'false';
|
||||||
|
echo ';top.ICEcoder.lineWrapping = ';
|
||||||
|
echo $ICEcoder["lineWrapping"] ? 'true' : 'false';
|
||||||
echo ';top.ICEcoder.tabWidth = ';
|
echo ';top.ICEcoder.tabWidth = ';
|
||||||
echo $ICEcoder["tabWidth"];
|
echo $ICEcoder["tabWidth"];
|
||||||
?>;ICEcoder.init()<?php echo $updateMsg.$onLoadExtras;?>" onResize="ICEcoder.setLayout()" onKeyDown="return ICEcoder.interceptKeys('coder',event);" onKeyUp="parent.ICEcoder.resetKeys(event);">
|
?>;ICEcoder.init()<?php echo $updateMsg.$onLoadExtras;?>" onResize="ICEcoder.setLayout()" onKeyDown="return ICEcoder.interceptKeys('coder',event);" onKeyUp="parent.ICEcoder.resetKeys(event);">
|
||||||
@@ -116,8 +123,8 @@ window.onbeforeunload = function() {
|
|||||||
<div id="editor" class="editor">
|
<div id="editor" class="editor">
|
||||||
<div id="tabsBar" class="tabsBar" onContextMenu="return false">
|
<div id="tabsBar" class="tabsBar" onContextMenu="return false">
|
||||||
<?php
|
<?php
|
||||||
for ($i=1;$i<=10;$i++) {
|
for ($i=1;$i<=100;$i++) {
|
||||||
echo '<div id="tab'.$i.'" class="tab" draggable="true" onClick="ICEcoder.canSwitchTabs ? ICEcoder.switchTab('.$i.') : ICEcoder.canSwitchTabs=true"></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>';
|
||||||
}
|
}
|
||||||
?><div class="newTab" onClick="ICEcoder.newTab()"><img src="images/nav-new.png"></div>
|
?><div class="newTab" onClick="ICEcoder.newTab()"><img src="images/nav-new.png"></div>
|
||||||
</div>
|
</div>
|
||||||
@@ -160,7 +167,7 @@ window.onbeforeunload = function() {
|
|||||||
|
|
||||||
<div class="footer" id="footer" onContextMenu="return false">
|
<div class="footer" id="footer" onContextMenu="return false">
|
||||||
<div class="nesting" id="nestValid">Nesting OK</div>
|
<div class="nesting" id="nestValid">Nesting OK</div>
|
||||||
<div class="nestLoc">Cursor nest location</div>
|
<div class="nestLoc">cursor nest location</div>
|
||||||
<div class="nestDisplay" id="nestDisplay"></div>
|
<div class="nestDisplay" id="nestDisplay"></div>
|
||||||
<div class="charDisplay" id="charDisplay"><span id="char"></span></div>
|
<div class="charDisplay" id="charDisplay"><span id="char"></span></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -10,14 +10,18 @@ $ICEcoder = array(
|
|||||||
"lockedNav" => true,
|
"lockedNav" => true,
|
||||||
"accountPassword" => "",
|
"accountPassword" => "",
|
||||||
"bannedFiles" => array("_coder","ICEcoder"),
|
"bannedFiles" => array("_coder","ICEcoder"),
|
||||||
|
"bannedPaths" => array("/var/www/.git","/var/www/sites/all/modules","/var/www/sites/default/files"),
|
||||||
"allowedIPs" => array("*"),
|
"allowedIPs" => array("*"),
|
||||||
"plugins" => array(
|
"plugins" => array(
|
||||||
array("Adminer","plugins/adminer/icon.png","margin-top: 3px","plugins/adminer/adminer-3.4.0-mysql-en.php","_blank",""),
|
array("Adminer","plugins/adminer/icon.png","margin-top: 3px","plugins/adminer/adminer-3.4.0-mysql-en.php","_blank",""),
|
||||||
array("Zip It!","plugins/zip-it/icon.png","margin-top: 3px; margin-left: 3px","plugins/zip-it/?zip=|&exclude=*.doc*.gif*.jpg*.jpeg*.pdf*.png*.swf*.xml*.zip","fileControl:<b>Zipping Files</b>","30"),
|
array("Zip It!","plugins/zip-it/icon.png","margin-top: 3px; margin-left: 3px","plugins/zip-it/?zip=|&exclude=*.doc*.gif*.jpg*.jpeg*.pdf*.png*.swf*.xml*.zip","fileControl:<b>Zipping Files</b>","30"),
|
||||||
array("ICErepo","plugins/ice-repo/icon.png","margin-top: 3px","plugins/ice-repo","_blank",""),
|
array("ICErepo","plugins/ice-repo/icon.png","margin-top: 3px","plugins/ice-repo","_blank",""),
|
||||||
array("Dochub","plugins/dochub/icon.png","margin-top: 3px","http://dochub.io","_blank","")
|
array("Dochub","plugins/dochub/icon.png","margin-top: 3px","http://dochub.io","_blank",""),
|
||||||
|
array("Terminal","plugins/terminal/icon.gif","margin-top: 3px","plugins/terminal","_blank",""),
|
||||||
|
array("JS Hint","plugins/jshint/icon.png","margin-top: 3px","http://www.jshint.com","_blank","")
|
||||||
),
|
),
|
||||||
"theme" => "default",
|
"theme" => "default",
|
||||||
|
"lineWrapping" => true,
|
||||||
"tabWidth" => 4,
|
"tabWidth" => 4,
|
||||||
"previousFiles" => "",
|
"previousFiles" => "",
|
||||||
"last10Files" => ""
|
"last10Files" => ""
|
||||||
|
|||||||
@@ -20,29 +20,29 @@ $fileName = basename($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 if (strpos(finfo_file($finfo, $file),"image")===0) {
|
||||||
|
echo '<script>fileType="image";fileName=\''.$fileLoc."/".$fileName.'\'</script>';
|
||||||
} else {
|
} else {
|
||||||
echo '<script>fileType="nothing"; top.ICEcoder.message(\'Sorry, '.$fileLoc."/".$fileName.' doesn\\\'t seem to exist on the server\');</script>';
|
echo '<script>fileType="other";window.open(\'http://'.$_SERVER['SERVER_NAME'].$fileLoc."/".$fileName.'\');</script>';
|
||||||
}
|
};
|
||||||
} else if (strpos(finfo_file($finfo, $file),"image")===0) {
|
|
||||||
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>';
|
||||||
@@ -54,20 +54,37 @@ if ($_GET['action']=="newFolder") {
|
|||||||
|
|
||||||
// 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))) {
|
||||||
|
if (is_dir($source)) {
|
||||||
|
if (!is_dir($dest)) {
|
||||||
|
mkdir($dest, 0705);
|
||||||
|
}
|
||||||
|
foreach ($iterator = new RecursiveIteratorIterator(
|
||||||
|
new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS),
|
||||||
|
RecursiveIteratorIterator::SELF_FIRST) as $item
|
||||||
|
) {
|
||||||
|
if ($item->isDir()) {
|
||||||
|
mkdir($dest.DIRECTORY_SEPARATOR.$iterator->getSubPathName(), 0705);
|
||||||
|
} else {
|
||||||
|
copy($item, $dest.DIRECTORY_SEPARATOR.$iterator->getSubPathName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
copy($source, $dest);
|
||||||
|
}
|
||||||
// Reload file manager
|
// Reload file manager
|
||||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.str_replace($docRoot,"",$location).'\',\''.$fileName.'\');action="pasteFile";</script>';
|
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.strClean(str_replace("|","/",$_GET['location'])).'\',\''.$fileName.'\');action="pasteFile";</script>';
|
||||||
} else {
|
} else {
|
||||||
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot copy file into \\n".$location."')</script>";
|
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot copy \\n".str_replace($docRoot,"",$source)."\\n into \\n".str_replace($docRoot,"",$dest)."')</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 rename a file/folder...
|
// If we're due to rename a file/folder...
|
||||||
if ($_GET['action']=="rename") {
|
if ($_GET['action']=="rename") {
|
||||||
if (is_writable($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])))) {
|
if (!$demoMode && is_writable($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])))) {
|
||||||
rename($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])),$docRoot.$fileLoc."/".$fileName);
|
rename($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])),$docRoot.$fileLoc."/".$fileName);
|
||||||
// Reload file manager
|
// Reload file manager
|
||||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'rename\',\''.$fileLoc.'\',\''.$fileName.'\',\'\',\''.str_replace($iceRoot,"",strClean($_GET['oldFileName'])).'\');';
|
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'rename\',\''.$fileLoc.'\',\''.$fileName.'\',\'\',\''.str_replace($iceRoot,"",strClean($_GET['oldFileName'])).'\');';
|
||||||
@@ -80,7 +97,7 @@ if ($_GET['action']=="rename") {
|
|||||||
|
|
||||||
// If we're due to replace text in a file...
|
// If we're due to replace text in a file...
|
||||||
if ($_GET['action']=="replaceText") {
|
if ($_GET['action']=="replaceText") {
|
||||||
if (is_writable(str_replace("|","/",strClean($_GET['fileRef'])))) {
|
if (!$demoMode && is_writable(str_replace("|","/",strClean($_GET['fileRef'])))) {
|
||||||
$file = str_replace("|","/",strClean($_GET['fileRef']));
|
$file = str_replace("|","/",strClean($_GET['fileRef']));
|
||||||
$loadedFile = file_get_contents($file);
|
$loadedFile = file_get_contents($file);
|
||||||
$newContent = str_replace(strClean($_GET['find']),strClean($_GET['replace']),$loadedFile);
|
$newContent = str_replace(strClean($_GET['find']),strClean($_GET['replace']),$loadedFile);
|
||||||
@@ -96,7 +113,7 @@ if ($_GET['action']=="replaceText") {
|
|||||||
|
|
||||||
// If we're due to change permissions on a file/folder...
|
// If we're due to change permissions on a file/folder...
|
||||||
if ($_GET['action']=="perms") {
|
if ($_GET['action']=="perms") {
|
||||||
if (is_writable($file)) {
|
if (!$demoMode && is_writable($file)) {
|
||||||
chmod($file,octdec(numClean($_GET['perms'])));
|
chmod($file,octdec(numClean($_GET['perms'])));
|
||||||
// Reload file manager
|
// Reload file manager
|
||||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'chmod\',\''.$fileLoc.'\',\''.$fileName.'\',\''.numClean($_GET['perms']).'\');';
|
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'chmod\',\''.$fileLoc.'\',\''.$fileName.'\',\''.numClean($_GET['perms']).'\');';
|
||||||
@@ -111,7 +128,7 @@ if ($_GET['action']=="perms") {
|
|||||||
if ($_GET['action']=="delete") {
|
if ($_GET['action']=="delete") {
|
||||||
$filesArray = explode(";",$file); // May contain more than one file here
|
$filesArray = explode(";",$file); // May contain more than one file here
|
||||||
for ($i=0;$i<=count($filesArray)-1;$i++) {
|
for ($i=0;$i<=count($filesArray)-1;$i++) {
|
||||||
if (is_writable($iceRoot.$filesArray[$i])) {
|
if (!$demoMode && is_writable($iceRoot.$filesArray[$i])) {
|
||||||
is_dir($iceRoot.$filesArray[$i])
|
is_dir($iceRoot.$filesArray[$i])
|
||||||
? rrmdir($iceRoot.$filesArray[$i])
|
? rrmdir($iceRoot.$filesArray[$i])
|
||||||
: unlink($iceRoot.$filesArray[$i]);
|
: unlink($iceRoot.$filesArray[$i]);
|
||||||
@@ -146,7 +163,7 @@ if ($_GET['action']=="save") {
|
|||||||
echo '<script>action="save";</script>';
|
echo '<script>action="save";</script>';
|
||||||
// on the form posting via a reload, save the file
|
// on the form posting via a reload, save the file
|
||||||
if (isset($_POST['contents'])) {
|
if (isset($_POST['contents'])) {
|
||||||
if ((file_exists($file) && is_writable($file)) || isset($_POST['newFileName']) && $_POST['newFileName']!="") {
|
if (!$demoMode && ((file_exists($file) && is_writable($file)) || isset($_POST['newFileName']) && $_POST['newFileName']!="")) {
|
||||||
if (filemtime($file)==$_GET['fileMDT']||!(isset($_GET['fileMDT']))) {
|
if (filemtime($file)==$_GET['fileMDT']||!(isset($_GET['fileMDT']))) {
|
||||||
$fh = fopen($file, 'w') or die("Sorry, cannot save");
|
$fh = fopen($file, 'w') or die("Sorry, cannot save");
|
||||||
fwrite($fh, $_POST['contents']);
|
fwrite($fh, $_POST['contents']);
|
||||||
@@ -202,6 +219,9 @@ if (action=="load") {
|
|||||||
if (!top.ICEcoder.content.contentWindow.createNewCMInstance) {
|
if (!top.ICEcoder.content.contentWindow.createNewCMInstance) {
|
||||||
console.log('There was tech hiccup, likely something wasn\'t quite ready. So ICEcoder reloaded it\'s file control again.');
|
console.log('There was tech hiccup, likely something wasn\'t quite ready. So ICEcoder reloaded it\'s file control again.');
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
|
<?php
|
||||||
|
if (file_exists($file)) {
|
||||||
|
?>
|
||||||
} else {
|
} else {
|
||||||
top.ICEcoder.loadingFile = true;
|
top.ICEcoder.loadingFile = true;
|
||||||
// Reset the various states back to their initial setting
|
// Reset the various states back to their initial setting
|
||||||
@@ -223,11 +243,14 @@ if (action=="load") {
|
|||||||
|
|
||||||
// Then clean it up, set the text cursor, update the display and get the character data
|
// Then clean it up, set the text cursor, update the display and get the character data
|
||||||
top.ICEcoder.contentCleanUp();
|
top.ICEcoder.contentCleanUp();
|
||||||
top.ICEcoder.content.contentWindow['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].setLineClass(top.ICEcoder['cMActiveLine'+top.ICEcoder.selectedTab], null);
|
top.ICEcoder.content.contentWindow['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].removeLineClass(top.ICEcoder['cMActiveLine'+top.ICEcoder.selectedTab], "background");
|
||||||
top.ICEcoder['cMActiveLine'+top.ICEcoder.selectedTab] = top.ICEcoder.content.contentWindow['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].setLineClass(0, "cm-s-activeLine");
|
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++;
|
top.ICEcoder.nextcMInstance++;
|
||||||
top.ICEcoder.openFileMDTs.push('<?php echo filemtime($file); ?>');
|
top.ICEcoder.openFileMDTs.push('<?php echo filemtime($file); ?>');
|
||||||
top.ICEcoder.loadingFile = false;
|
top.ICEcoder.loadingFile = false;
|
||||||
|
<?php
|
||||||
|
;};
|
||||||
|
?>
|
||||||
}
|
}
|
||||||
},4);
|
},4);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
<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">
|
||||||
|
<meta name="robots" content="noindex, nofollow">
|
||||||
<link rel="stylesheet" type="text/css" href="help.css">
|
<link rel="stylesheet" type="text/css" href="help.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
|
|||||||
|
|
||||||
.editor {position: absolute; display: inline-block; top: 0; left: 15px; width: 2400px}
|
.editor {position: absolute; display: inline-block; top: 0; left: 15px; width: 2400px}
|
||||||
.editor .tabsBar {display: inline-block; height: 22px; width: 2400px; margin-top: 40px; padding-left: 41px; background-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;
|
||||||
@@ -127,8 +127,8 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
|
|||||||
|
|
||||||
.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)}
|
||||||
@@ -143,4 +143,4 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
|
|||||||
.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}
|
||||||
236
lib/ice-coder.js
236
lib/ice-coder.js
@@ -23,6 +23,7 @@ var ICEcoder = {
|
|||||||
lockedNav: true, // Nav is locked or not
|
lockedNav: true, // Nav is locked or not
|
||||||
htmlTagArray: [], // Array storing the nest of tags
|
htmlTagArray: [], // Array storing the nest of tags
|
||||||
codeAssist: true, // Assist user with their coding
|
codeAssist: true, // Assist user with their coding
|
||||||
|
snippetLine: false, // Line no of snippet, if shown
|
||||||
mouseDown: false, // If the mouse is down or not
|
mouseDown: false, // If the mouse is down or not
|
||||||
draggingFilesW: false, // If we're dragging the file manager width or not
|
draggingFilesW: false, // If we're dragging the file manager width or not
|
||||||
serverQueueItems: [], // Array of URLs to call in order
|
serverQueueItems: [], // Array of URLs to call in order
|
||||||
@@ -95,6 +96,7 @@ var ICEcoder = {
|
|||||||
this.account.style.height = this.accountH + "px";
|
this.account.style.height = this.accountH + "px";
|
||||||
this.fmLock.style.marginLeft = (this.filesW-42) + "px";
|
this.fmLock.style.marginLeft = (this.filesW-42) + "px";
|
||||||
this.filesFrame.style.height = (winH-headerH-accountH-footerH) + "px";
|
this.filesFrame.style.height = (winH-headerH-accountH-footerH) + "px";
|
||||||
|
top.ICEcoder.setTabWidths();
|
||||||
|
|
||||||
// If we need to set the editor sizes
|
// If we need to set the editor sizes
|
||||||
if (!dontSetEditor) {
|
if (!dontSetEditor) {
|
||||||
@@ -293,7 +295,7 @@ var ICEcoder = {
|
|||||||
highlightBlock: function(nestPos,hide) {
|
highlightBlock: function(nestPos,hide) {
|
||||||
var cM, searchPos, cursor, startPos, endPos;
|
var cM, searchPos, cursor, startPos, endPos;
|
||||||
|
|
||||||
cM = ICEcoder.getcMInstance();
|
cM = top.ICEcoder.getcMInstance();
|
||||||
// Hiding the block
|
// Hiding the block
|
||||||
if (hide) {
|
if (hide) {
|
||||||
// Set cursor back to orig pos if we haven't clicked, or redo nest display if we have
|
// Set cursor back to orig pos if we haven't clicked, or redo nest display if we have
|
||||||
@@ -306,7 +308,6 @@ var ICEcoder = {
|
|||||||
top.ICEcoder.cursorOrigCh = cM.getCursor().ch;
|
top.ICEcoder.cursorOrigCh = cM.getCursor().ch;
|
||||||
top.ICEcoder.cursorOrigLine = cM.getCursor().line;
|
top.ICEcoder.cursorOrigLine = cM.getCursor().line;
|
||||||
top.ICEcoder.dontUpdateNest = true;
|
top.ICEcoder.dontUpdateNest = true;
|
||||||
|
|
||||||
// Set a cursor position object to begin with
|
// Set a cursor position object to begin with
|
||||||
searchPos = new Object();
|
searchPos = new Object();
|
||||||
searchPos.ch = cM.getCursor().ch;
|
searchPos.ch = cM.getCursor().ch;
|
||||||
@@ -326,10 +327,12 @@ var ICEcoder = {
|
|||||||
top.ICEcoder.startPosLine = startPos.line = cursor.from().line;
|
top.ICEcoder.startPosLine = startPos.line = cursor.from().line;
|
||||||
// Now set an end position object that matches this start tag
|
// Now set an end position object that matches this start tag
|
||||||
endPos = new Object();
|
endPos = new Object();
|
||||||
endPos.line = top.ICEcoder.content.contentWindow.CodeMirror.tagRangeFinder(cM,startPos.line) || startPos.line;
|
endPos.line = top.ICEcoder.content.contentWindow.CodeMirror.tagRangeFinder(cM,startPos) || startPos.line;
|
||||||
|
endPos.line = endPos.line.to ? endPos.line.to.line : endPos.line;
|
||||||
endPos.ch = cM.getLine(endPos.line).indexOf("</"+top.ICEcoder.htmlTagArray[nestPos]+">")+top.ICEcoder.htmlTagArray[nestPos].length+3;
|
endPos.ch = cM.getLine(endPos.line).indexOf("</"+top.ICEcoder.htmlTagArray[nestPos]+">")+top.ICEcoder.htmlTagArray[nestPos].length+3;
|
||||||
// Set the selection or escape out of not selecting
|
// Set the selection or escape out of not selecting
|
||||||
!top.ICEcoder.dontSelect ? cM.setSelection(startPos,endPos) : top.ICEcoder.dontSelect = false;
|
!top.ICEcoder.dontSelect ? cM.setSelection(startPos,endPos) : top.ICEcoder.dontSelect = false;
|
||||||
|
cM.scrollIntoView(startPos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -508,8 +511,8 @@ var ICEcoder = {
|
|||||||
shortURL = top.ICEcoder.thisFileFolderLink.replace(/\|/g,"/");
|
shortURL = top.ICEcoder.thisFileFolderLink.replace(/\|/g,"/");
|
||||||
// No reason why we can't open a file (so far)
|
// No reason why we can't open a file (so far)
|
||||||
canOpenFile = true;
|
canOpenFile = true;
|
||||||
// Limit to 10 files open at a time
|
// Limit to 100 files open at a time
|
||||||
if (top.ICEcoder.openFiles.length<10) {
|
if (top.ICEcoder.openFiles.length<100) {
|
||||||
// check if we've already got it in our array
|
// check if we've already got it in our array
|
||||||
if (top.ICEcoder.openFiles.indexOf(shortURL)>-1 && shortURL!="/[NEW]") {
|
if (top.ICEcoder.openFiles.indexOf(shortURL)>-1 && shortURL!="/[NEW]") {
|
||||||
// we have, so instead, switch to that tab
|
// we have, so instead, switch to that tab
|
||||||
@@ -517,8 +520,8 @@ var ICEcoder = {
|
|||||||
top.ICEcoder.switchTab(i+1);
|
top.ICEcoder.switchTab(i+1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// show a message because we have 10 files open
|
// show a message because we have 100 files open
|
||||||
top.ICEcoder.message('Sorry, you can only have 10 files open at a time!');
|
top.ICEcoder.message('Sorry, you can only have 100 files open at a time!');
|
||||||
canOpenFile = false;
|
canOpenFile = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -565,7 +568,7 @@ var ICEcoder = {
|
|||||||
// rename array item and the tab
|
// rename array item and the tab
|
||||||
top.ICEcoder.openFiles[i] = newName;
|
top.ICEcoder.openFiles[i] = newName;
|
||||||
closeTabLink = '<a nohref onClick="top.ICEcoder.files.contentWindow.closeTab('+(i+1)+')"><img src="images/nav-close.gif" id="closeTabButton'+(i+1)+'" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'" onMouseOut="this.style.backgroundColor=prevBG"></a>';
|
closeTabLink = '<a nohref onClick="top.ICEcoder.files.contentWindow.closeTab('+(i+1)+')"><img src="images/nav-close.gif" id="closeTabButton'+(i+1)+'" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'" onMouseOut="this.style.backgroundColor=prevBG"></a>';
|
||||||
top.document.getElementById('tab'+(i+1)).innerHTML = top.ICEcoder.openFiles[i] + " " + closeTabLink;
|
top.document.getElementById('tab'+(i+1)).innerHTML = closeTabLink + " " + top.ICEcoder.openFiles[i].replace(/\//,"") + "/";
|
||||||
}
|
}
|
||||||
top.ICEcoder.serverQueue("add","lib/file-control.php?action=rename&file="+newName+"&oldFileName="+oldName.replace(/\|/g,"/"));
|
top.ICEcoder.serverQueue("add","lib/file-control.php?action=rename&file="+newName+"&oldFileName="+oldName.replace(/\|/g,"/"));
|
||||||
top.ICEcoder.serverMessage('<b>Renaming to</b><br>'+newName);
|
top.ICEcoder.serverMessage('<b>Renaming to</b><br>'+newName);
|
||||||
@@ -748,9 +751,9 @@ var ICEcoder = {
|
|||||||
top.ICEcoder.thisFileFolderType='file';
|
top.ICEcoder.thisFileFolderType='file';
|
||||||
top.ICEcoder.openFile();
|
top.ICEcoder.openFile();
|
||||||
}
|
}
|
||||||
if (action=="newFile") {top.ICEcoder.newFile();}
|
else if (action=="newFile") {top.ICEcoder.newFile();}
|
||||||
if (action=="newFolder") {top.ICEcoder.newFolder();}
|
else if (action=="newFolder") {top.ICEcoder.newFolder();}
|
||||||
if (action=="rename") {top.ICEcoder.renameFile(top.ICEcoder.rightClickedFile);}
|
else if (action=="rename") {top.ICEcoder.renameFile(top.ICEcoder.rightClickedFile);}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action=="delete" && ICEcoder.selectedFiles.length>0) {
|
if (action=="delete" && ICEcoder.selectedFiles.length>0) {
|
||||||
@@ -894,16 +897,24 @@ var ICEcoder = {
|
|||||||
if (find != "" && buttonClick) {
|
if (find != "" && buttonClick) {
|
||||||
replaceQS = "";
|
replaceQS = "";
|
||||||
targetQS = "";
|
targetQS = "";
|
||||||
|
filesQS = "";
|
||||||
if (document.findAndReplace.connector.value=="and") {
|
if (document.findAndReplace.connector.value=="and") {
|
||||||
replaceQS = "&replace="+replace;
|
replaceQS = "&replace="+replace;
|
||||||
}
|
}
|
||||||
if (document.findAndReplace.target.value.indexOf("file")>=0) {
|
if (document.findAndReplace.target.value.indexOf("file")>=0) {
|
||||||
targetQS = "&target="+document.findAndReplace.target.value.replace(/ /g,"-");
|
targetQS = "&target="+document.findAndReplace.target.value.replace(/ /g,"-");
|
||||||
}
|
}
|
||||||
|
if (document.findAndReplace.target.value=="selected files") {
|
||||||
|
filesQS = "&selectedFiles=";
|
||||||
|
for(i=0;i<top.ICEcoder.selectedFiles.length;i++) {
|
||||||
|
filesQS += top.ICEcoder.selectedFiles[i]+":";
|
||||||
|
}
|
||||||
|
filesQS = filesQS.replace(/\:$/,"");
|
||||||
|
}
|
||||||
find = find.replace(/\'/g, ''');
|
find = find.replace(/\'/g, ''');
|
||||||
find != encodeURIComponent(find) ? find = 'ICEcoder:'+encodeURIComponent(find) : find;
|
find != encodeURIComponent(find) ? find = 'ICEcoder:'+encodeURIComponent(find) : find;
|
||||||
top.ICEcoder.showHide('show',top.document.getElementById('loadingMask'));
|
top.ICEcoder.showHide('show',top.document.getElementById('loadingMask'));
|
||||||
top.document.getElementById('mediaContainer').innerHTML = '<iframe src="lib/multiple-results.php?find='+find+replaceQS+targetQS+'" class="whiteGlow" style="width: 700px; height: 500px"></iframe>';
|
top.document.getElementById('mediaContainer').innerHTML = '<iframe src="lib/multiple-results.php?find='+find+replaceQS+targetQS+filesQS+'" class="whiteGlow" style="width: 700px; height: 500px"></iframe>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -950,8 +961,11 @@ var ICEcoder = {
|
|||||||
|
|
||||||
// Then for all the array items, output as the nest display
|
// Then for all the array items, output as the nest display
|
||||||
for (var i=0;i<ICEcoder.htmlTagArray.length;i++) {
|
for (var i=0;i<ICEcoder.htmlTagArray.length;i++) {
|
||||||
ICEcoder.nestDisplay.innerHTML += '<a onMouseover="top.ICEcoder.highlightBlock('+i+')" onMouseout="top.ICEcoder.highlightBlock('+i+',\'hide\')" onClick="top.ICEcoder.setPosition('+i+',top.ICEcoder.startPosLine,\''+ICEcoder.htmlTagArray[i]+'\')" style="cursor: pointer">'+ICEcoder.htmlTagArray[i]+'</a>';
|
if (i==0) {ICEcoder.nestDisplay.innerHTML += '<div style="display: inline-block; width: 7px; margin-top: -5px; height: 30px; background-image: url(images/nest-tag-bg.gif)"></div>'};
|
||||||
if(i<ICEcoder.htmlTagArray.length-1) {ICEcoder.nestDisplay.innerHTML += " > "};
|
ICEcoder.nestDisplay.innerHTML += '<a onMouseover="top.ICEcoder.highlightBlock('+i+')" onMouseout="top.ICEcoder.highlightBlock('+i+',\'hide\')" onClick="top.ICEcoder.setPosition('+i+',top.ICEcoder.startPosLine,\''+ICEcoder.htmlTagArray[i]+'\')" style="display: inline-block; cursor: pointer; background: #333; padding: 7px 2px 7px 7px; margin-top: -5px; height: 30px">'+ICEcoder.htmlTagArray[i]+'</a>';
|
||||||
|
ICEcoder.nestDisplay.innerHTML += i<ICEcoder.htmlTagArray.length-1
|
||||||
|
? '<div style="display: inline-block; width: 8px; margin-top: -5px; height: 30px; background-image: url(images/nest-tag-bg.gif); background-position: -7px 0"></div>'
|
||||||
|
: '<div style="display: inline-block; width: 7px; margin-top: -5px; height: 30px; background-image: url(images/nest-tag-bg.gif); background-position: -15px 0"></div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1005,25 +1019,20 @@ var ICEcoder = {
|
|||||||
cM = ICEcoder.getcMInstance();
|
cM = ICEcoder.getcMInstance();
|
||||||
caretLocType = "Unknown";
|
caretLocType = "Unknown";
|
||||||
caretChunk = cM.getValue().substr(0,ICEcoder.caretPos+1);
|
caretChunk = cM.getValue().substr(0,ICEcoder.caretPos+1);
|
||||||
if (caretChunk.lastIndexOf("<script")>caretChunk.lastIndexOf("</script>")&&caretLocType=="Unknown") {caretLocType = "JavaScript"};
|
if (caretChunk.lastIndexOf("<script")>caretChunk.lastIndexOf("</script>")&&caretLocType=="Unknown") {caretLocType = "JavaScript"}
|
||||||
if (caretChunk.lastIndexOf("<?")>caretChunk.lastIndexOf("?>")&&caretLocType=="Unknown") {caretLocType = "PHP"};
|
else if (caretChunk.lastIndexOf("<?")>caretChunk.lastIndexOf("?>")&&caretLocType=="Unknown") {caretLocType = "PHP"}
|
||||||
if (caretChunk.lastIndexOf("<%")>caretChunk.lastIndexOf("%>")&&caretLocType=="Unknown") {caretLocType = "Ruby"};
|
else if (caretChunk.lastIndexOf("<%")>caretChunk.lastIndexOf("%>")&&caretLocType=="Unknown") {caretLocType = "Ruby"}
|
||||||
if (caretChunk.lastIndexOf("<")>caretChunk.lastIndexOf(">")&&caretLocType=="Unknown") {caretLocType = "HTML"};
|
else if (caretChunk.lastIndexOf("<")>caretChunk.lastIndexOf(">")&&caretLocType=="Unknown") {caretLocType = "HTML"}
|
||||||
if (caretLocType=="Unknown") {caretLocType = "Content"};
|
else if (caretLocType=="Unknown") {caretLocType = "Content"};
|
||||||
|
|
||||||
fileName = ICEcoder.openFiles[ICEcoder.selectedTab-1];
|
fileName = ICEcoder.openFiles[ICEcoder.selectedTab-1];
|
||||||
if (fileName.indexOf(".js")>0) {caretLocType="JavaScript"};
|
if (fileName.indexOf(".js")>0) {caretLocType="JavaScript"}
|
||||||
if (fileName.indexOf(".coffee")>0) {caretLocType="CoffeeScript"};
|
else if (fileName.indexOf(".coffee")>0) {caretLocType="CoffeeScript"}
|
||||||
if (fileName.indexOf(".rb")>0) {caretLocType="Ruby"};
|
else if (fileName.indexOf(".rb")>0) {caretLocType="Ruby"}
|
||||||
if (fileName.indexOf(".css")>0) {caretLocType="CSS"};
|
else if (fileName.indexOf(".css")>0) {caretLocType="CSS"}
|
||||||
if (fileName.indexOf(".less")>0) {caretLocType="LESS"};
|
else if (fileName.indexOf(".less")>0) {caretLocType="LESS"};
|
||||||
|
|
||||||
ICEcoder.caretLocType = caretLocType;
|
ICEcoder.caretLocType = caretLocType;
|
||||||
|
|
||||||
// If we're in a JS, CoffeeScript PHP or Ruby code block, add that to the nest display
|
|
||||||
if (["JavaScript","CoffeeScript","PHP","Ruby"].indexOf(caretLocType)>-1) {
|
|
||||||
ICEcoder.nestDisplay.innerHTML += " > " + caretLocType;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// Alter array indicating which files have changed
|
// Alter array indicating which files have changed
|
||||||
@@ -1123,6 +1132,7 @@ var ICEcoder = {
|
|||||||
newBlock.style.position = "absolute";
|
newBlock.style.position = "absolute";
|
||||||
newBlock.style.display = "block";
|
newBlock.style.display = "block";
|
||||||
newBlock.style.width = newBlock.style.height = "20px";
|
newBlock.style.width = newBlock.style.height = "20px";
|
||||||
|
newBlock.style.zIndex = "1000";
|
||||||
newBlock.style.background = match ? match[0] : '';
|
newBlock.style.background = match ? match[0] : '';
|
||||||
if (newBlock.style.backgroundColor=="") {newBlock.style.display = "none"};
|
if (newBlock.style.backgroundColor=="") {newBlock.style.display = "none"};
|
||||||
top.document.getElementById('header').appendChild(newBlock);
|
top.document.getElementById('header').appendChild(newBlock);
|
||||||
@@ -1148,6 +1158,40 @@ var ICEcoder = {
|
|||||||
return i!=-1 ? i : false;
|
return i!=-1 ? i : false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Show JS Hint errors
|
||||||
|
updateHints: function() {
|
||||||
|
var cM;
|
||||||
|
|
||||||
|
if ("undefined" != typeof JSHINT && top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1].indexOf('.js')>-1) {
|
||||||
|
cM = ICEcoder.getcMInstance();
|
||||||
|
cM.operation(function(){
|
||||||
|
var widgets = top.ICEcoder['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]+'widgets'];
|
||||||
|
for (var i=0; i<widgets.length; ++i) {
|
||||||
|
cM.removeLineWidget(widgets[i]);
|
||||||
|
}
|
||||||
|
widgets.length = 0;
|
||||||
|
|
||||||
|
JSHINT(cM.getValue());
|
||||||
|
for (var i=0; i<JSHINT.errors.length; ++i) {
|
||||||
|
var err = JSHINT.errors[i];
|
||||||
|
if (!err) continue;
|
||||||
|
var msg = document.createElement("div");
|
||||||
|
var icon = msg.appendChild(document.createElement("span"));
|
||||||
|
icon.innerHTML = "!!";
|
||||||
|
icon.className = "lint-error-icon";
|
||||||
|
msg.appendChild(document.createTextNode(err.reason));
|
||||||
|
msg.className = "lint-error";
|
||||||
|
widgets.push(cM.addLineWidget(err.line-1, msg, {coverGutter: false, noHScroll: true}));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var info = cM.getScrollInfo();
|
||||||
|
var after = cM.charCoords({line: cM.getCursor().line+1, ch: 0}, "local").top;
|
||||||
|
if (info.top + info.clientHeight < after) {
|
||||||
|
cM.scrollTo(null, after - info.clientHeight+3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// ==============
|
// ==============
|
||||||
// SYSTEM
|
// SYSTEM
|
||||||
// ==============
|
// ==============
|
||||||
@@ -1178,6 +1222,21 @@ var ICEcoder = {
|
|||||||
top.ICEcoder.codeAssist = !top.ICEcoder.codeAssist;
|
top.ICEcoder.codeAssist = !top.ICEcoder.codeAssist;
|
||||||
top.ICEcoder.cssColorPreview();
|
top.ICEcoder.cssColorPreview();
|
||||||
cM.focus();
|
cM.focus();
|
||||||
|
|
||||||
|
if (!top.ICEcoder.codeAssist) {
|
||||||
|
for (i=0;i<top.ICEcoder.cMInstances.length;i++) {
|
||||||
|
cM = top.ICEcoder.content.contentWindow['cM'+top.ICEcoder.cMInstances[i]];
|
||||||
|
cM.operation(function(){
|
||||||
|
var widgets = top.ICEcoder['cM'+top.ICEcoder.cMInstances[i]+'widgets'];
|
||||||
|
for (var j=0; j<widgets.length; ++j) {
|
||||||
|
cM.removeLineWidget(widgets[j]);
|
||||||
|
}
|
||||||
|
widgets.length = 0;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
top.ICEcoder.updateHints();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// Queue items up for processing in turn
|
// Queue items up for processing in turn
|
||||||
@@ -1203,8 +1262,7 @@ var ICEcoder = {
|
|||||||
document.body.appendChild(txtArea);
|
document.body.appendChild(txtArea);
|
||||||
document.getElementById('saveTemp'+nextSaveID).value = cM.getValue();
|
document.getElementById('saveTemp'+nextSaveID).value = cM.getValue();
|
||||||
}
|
}
|
||||||
}
|
} else if (action=="del") {
|
||||||
if (action=="del") {
|
|
||||||
if (ICEcoder.serverQueueItems[0] && ICEcoder.serverQueueItems[0].indexOf('action=save')>0) {
|
if (ICEcoder.serverQueueItems[0] && ICEcoder.serverQueueItems[0].indexOf('action=save')>0) {
|
||||||
topSaveID = nextSaveID-1;
|
topSaveID = nextSaveID-1;
|
||||||
for (var i=1;i<topSaveID;i++) {
|
for (var i=1;i<topSaveID;i++) {
|
||||||
@@ -1275,7 +1333,7 @@ var ICEcoder = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// Update the settings used when we make a change to them
|
// Update the settings used when we make a change to them
|
||||||
useNewSettings: function(themeURL,tabsIndent,codeAssist,lockedNav,visibleTabs,tabWidth,refreshFM) {
|
useNewSettings: function(themeURL,tabsIndent,codeAssist,lockedNav,visibleTabs,lineWrapping,tabWidth,refreshFM) {
|
||||||
var styleNode, strCSS, cMCSS, activeLineBG;
|
var styleNode, strCSS, cMCSS, activeLineBG;
|
||||||
|
|
||||||
// Add new stylesheet for selected theme
|
// Add new stylesheet for selected theme
|
||||||
@@ -1304,11 +1362,13 @@ var ICEcoder = {
|
|||||||
|
|
||||||
cMCSS = ICEcoder.content.contentWindow.document.styleSheets[2];
|
cMCSS = ICEcoder.content.contentWindow.document.styleSheets[2];
|
||||||
strCSS = cMCSS.rules ? 'rules' : 'cssRules';
|
strCSS = cMCSS.rules ? 'rules' : 'cssRules';
|
||||||
cMCSS[strCSS][5].style['content'] = visibleTabs ? '"\\21e5"' : '" "';
|
cMCSS[strCSS][4].style['content'] = visibleTabs ? '"\\21e5"' : '" "';
|
||||||
cMCSS[strCSS][2].style.cssText = "background: " + activeLineBG + " !important";
|
cMCSS[strCSS][2].style.cssText = "background: " + activeLineBG + " !important";
|
||||||
|
|
||||||
|
top.ICEcoder.lineWrapping = lineWrapping;
|
||||||
top.ICEcoder.tabWidth = tabWidth;
|
top.ICEcoder.tabWidth = tabWidth;
|
||||||
for (var i=0;i<ICEcoder.cMInstances.length;i++) {
|
for (var i=0;i<ICEcoder.cMInstances.length;i++) {
|
||||||
|
ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]].setOption("lineWrapping", top.ICEcoder.lineWrapping);
|
||||||
ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]].setOption("indentUnit", top.ICEcoder.tabWidth);
|
ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]].setOption("indentUnit", top.ICEcoder.tabWidth);
|
||||||
ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]].setOption("tabSize", top.ICEcoder.tabWidth);
|
ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]].setOption("tabSize", top.ICEcoder.tabWidth);
|
||||||
}
|
}
|
||||||
@@ -1465,6 +1525,9 @@ var ICEcoder = {
|
|||||||
top.ICEcoder.findMode = false;
|
top.ICEcoder.findMode = false;
|
||||||
ICEcoder.findReplace('find',true,false);
|
ICEcoder.findReplace('find',true,false);
|
||||||
|
|
||||||
|
// Rerun JS Hint
|
||||||
|
if (top.ICEcoder.codeAssist) {top.ICEcoder.updateHints()};
|
||||||
|
|
||||||
// Finally, update the cursor display
|
// Finally, update the cursor display
|
||||||
top.ICEcoder.getCaretPosition();
|
top.ICEcoder.getCaretPosition();
|
||||||
top.ICEcoder.updateCharDisplay();
|
top.ICEcoder.updateCharDisplay();
|
||||||
@@ -1488,8 +1551,8 @@ var ICEcoder = {
|
|||||||
cM = ICEcoder.getcMInstance('new');
|
cM = ICEcoder.getcMInstance('new');
|
||||||
ICEcoder.switchTab(ICEcoder.openFiles.length);
|
ICEcoder.switchTab(ICEcoder.openFiles.length);
|
||||||
|
|
||||||
cM.setLineClass(ICEcoder['cMActiveLine'+ICEcoder.selectedTab], null);
|
cM.removeLineClass(ICEcoder['cMActiveLine'+ICEcoder.selectedTab], "background");
|
||||||
ICEcoder['cMActiveLine'+ICEcoder.selectedTab] = cM.setLineClass(0, "cm-s-activeLine");
|
ICEcoder['cMActiveLine'+ICEcoder.selectedTab] = cM.addLineClass(0, "background", "cm-s-activeLine");
|
||||||
ICEcoder.nextcMInstance++;
|
ICEcoder.nextcMInstance++;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1503,7 +1566,11 @@ var ICEcoder = {
|
|||||||
// Setup a new tab
|
// Setup a new tab
|
||||||
closeTabLink = '<a nohref onClick="top.ICEcoder.closeTab('+(top.ICEcoder.openFiles.length)+')"><img src="images/nav-close.gif" id="closeTabButton'+(top.ICEcoder.openFiles.length)+'" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'" onMouseOut="this.style.backgroundColor=prevBG"></a>';
|
closeTabLink = '<a nohref onClick="top.ICEcoder.closeTab('+(top.ICEcoder.openFiles.length)+')"><img src="images/nav-close.gif" id="closeTabButton'+(top.ICEcoder.openFiles.length)+'" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'" onMouseOut="this.style.backgroundColor=prevBG"></a>';
|
||||||
top.document.getElementById('tab'+(top.ICEcoder.openFiles.length)).style.display = "inline-block";
|
top.document.getElementById('tab'+(top.ICEcoder.openFiles.length)).style.display = "inline-block";
|
||||||
top.document.getElementById('tab'+(top.ICEcoder.openFiles.length)).innerHTML = top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1] + " " + closeTabLink;
|
top.document.getElementById('tab'+(top.ICEcoder.openFiles.length)).innerHTML = closeTabLink + " " + top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1].replace(/\//,"") + "/";
|
||||||
|
top.document.getElementById('tab'+(top.ICEcoder.openFiles.length)).title = top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1].replace(/\//,"") + "/";
|
||||||
|
|
||||||
|
// Set the widths
|
||||||
|
top.ICEcoder.setTabWidths();
|
||||||
|
|
||||||
// Highlight it and state it's selected
|
// Highlight it and state it's selected
|
||||||
top.ICEcoder.redoTabHighlight(top.ICEcoder.openFiles.length);
|
top.ICEcoder.redoTabHighlight(top.ICEcoder.openFiles.length);
|
||||||
@@ -1540,7 +1607,8 @@ var ICEcoder = {
|
|||||||
|
|
||||||
// Setup a new tab
|
// Setup a new tab
|
||||||
closeTabLink = '<a nohref onClick="parent.ICEcoder.closeTab('+tabNum+')"><img src="images/nav-close.gif" id="closeTabButton'+tabNum+'" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'" onMouseOut="this.style.backgroundColor=prevBG"></a>';
|
closeTabLink = '<a nohref onClick="parent.ICEcoder.closeTab('+tabNum+')"><img src="images/nav-close.gif" id="closeTabButton'+tabNum+'" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'" onMouseOut="this.style.backgroundColor=prevBG"></a>';
|
||||||
top.document.getElementById('tab'+tabNum).innerHTML = top.ICEcoder.openFiles[tabNum-1] + " " + closeTabLink;
|
top.document.getElementById('tab'+tabNum).innerHTML = closeTabLink + " " + top.ICEcoder.openFiles[tabNum-1].replace(/\//,"") + "/";
|
||||||
|
top.document.getElementById('tab'+tabNum).title = top.ICEcoder.openFiles[tabNum-1].replace(/\//,"") + "/";
|
||||||
},
|
},
|
||||||
|
|
||||||
// Reset all tabs to be without a highlight and then highlight the selected
|
// Reset all tabs to be without a highlight and then highlight the selected
|
||||||
@@ -1581,6 +1649,7 @@ var ICEcoder = {
|
|||||||
// recursively copy over all tabs & data from the tab to the right, if there is one
|
// recursively copy over all tabs & data from the tab to the right, if there is one
|
||||||
for (var i=closeTabNum;i<ICEcoder.openFiles.length;i++) {
|
for (var i=closeTabNum;i<ICEcoder.openFiles.length;i++) {
|
||||||
top.document.getElementById('tab'+i).innerHTML = top.document.getElementById('tab'+(i+1)).innerHTML;
|
top.document.getElementById('tab'+i).innerHTML = top.document.getElementById('tab'+(i+1)).innerHTML;
|
||||||
|
top.document.getElementById('tab'+i).title = top.document.getElementById('tab'+(i+1)).title;
|
||||||
ICEcoder.openFiles[i-1] = ICEcoder.openFiles[i];
|
ICEcoder.openFiles[i-1] = ICEcoder.openFiles[i];
|
||||||
ICEcoder.openFileMDTs[i-1] = ICEcoder.openFileMDTs[i];
|
ICEcoder.openFileMDTs[i-1] = ICEcoder.openFileMDTs[i];
|
||||||
|
|
||||||
@@ -1593,6 +1662,7 @@ var ICEcoder = {
|
|||||||
// clear the rightmost tab (or only one left in a 1 tab scenario) & remove from the array
|
// clear the rightmost tab (or only one left in a 1 tab scenario) & remove from the array
|
||||||
top.document.getElementById('tab'+ICEcoder.openFiles.length).style.display = "none";
|
top.document.getElementById('tab'+ICEcoder.openFiles.length).style.display = "none";
|
||||||
top.document.getElementById('tab'+ICEcoder.openFiles.length).innerHTML = "";
|
top.document.getElementById('tab'+ICEcoder.openFiles.length).innerHTML = "";
|
||||||
|
top.document.getElementById('tab'+ICEcoder.openFiles.length).title = "";
|
||||||
ICEcoder.openFiles.pop();
|
ICEcoder.openFiles.pop();
|
||||||
ICEcoder.openFileMDTs.pop();
|
ICEcoder.openFileMDTs.pop();
|
||||||
// If we're closing the selected tab, determin the new selectedTab number, reduced by 1 if we have some tabs, 0 for a reset state
|
// If we're closing the selected tab, determin the new selectedTab number, reduced by 1 if we have some tabs, 0 for a reset state
|
||||||
@@ -1620,6 +1690,22 @@ var ICEcoder = {
|
|||||||
}
|
}
|
||||||
// Lastly, stop it from trying to also switch tab
|
// Lastly, stop it from trying to also switch tab
|
||||||
top.ICEcoder.canSwitchTabs=false;
|
top.ICEcoder.canSwitchTabs=false;
|
||||||
|
// and set the widths
|
||||||
|
top.ICEcoder.setTabWidths();
|
||||||
|
},
|
||||||
|
|
||||||
|
// Set the tabs width
|
||||||
|
setTabWidths: function() {
|
||||||
|
var availWidth, tabWidth, thisWidth;
|
||||||
|
|
||||||
|
availWidth = parseInt(top.ICEcoder.content.style.width,10)-41-24-10; // - left margin - new tab - right margin
|
||||||
|
avgWidth = (availWidth/top.ICEcoder.openFiles.length)-18;
|
||||||
|
|
||||||
|
for (var i=0;i<top.ICEcoder.openFiles.length;i++) {
|
||||||
|
thisWidth = parseInt(avgWidth*i,10) - parseInt(avgWidth*(i-1),10);
|
||||||
|
tabWidth = top.ICEcoder.openFiles.length*(150+18) > availWidth ? thisWidth : 150;
|
||||||
|
top.document.getElementById('tab'+(i+1)).style.width = tabWidth + "px";
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// ==============
|
// ==============
|
||||||
@@ -1721,6 +1807,11 @@ var ICEcoder = {
|
|||||||
top.ICEcoder.ctrlKeyDown = false;
|
top.ICEcoder.ctrlKeyDown = false;
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// CTRL+Space (Show snippet)
|
||||||
|
} else if(key==32 && top.ICEcoder.ctrlKeyDown==true && area=="content") {
|
||||||
|
top.ICEcoder.addSnippet();
|
||||||
|
return false;
|
||||||
|
|
||||||
// ESC in content area (Comment/Uncomment line)
|
// ESC in content area (Comment/Uncomment line)
|
||||||
} else if(key==27 && area == "content") {
|
} else if(key==27 && area == "content") {
|
||||||
top.ICEcoder.lineCommentToggle();
|
top.ICEcoder.lineCommentToggle();
|
||||||
@@ -1744,7 +1835,74 @@ var ICEcoder = {
|
|||||||
key = evt.keyCode ? evt.keyCode : evt.which ? evt.which : evt.charCode;
|
key = evt.keyCode ? evt.keyCode : evt.which ? evt.which : evt.charCode;
|
||||||
|
|
||||||
if (key==17) {top.ICEcoder.ctrlKeyDown = false; top.ICEcoder.stickyTabMaybe = false}
|
if (key==17) {top.ICEcoder.ctrlKeyDown = false; top.ICEcoder.stickyTabMaybe = false}
|
||||||
if (key==16) {top.ICEcoder.shiftKeyDown = false}
|
else if (key==16) {top.ICEcoder.shiftKeyDown = false}
|
||||||
if (key==46) {top.ICEcoder.delKeyDown = false}
|
else if (key==46) {top.ICEcoder.delKeyDown = false}
|
||||||
|
},
|
||||||
|
|
||||||
|
addSnippet: function() {
|
||||||
|
var cM;
|
||||||
|
|
||||||
|
if (top.ICEcoder.snippetLine!==false) {
|
||||||
|
top.ICEcoder.removeSnippet();
|
||||||
|
}
|
||||||
|
|
||||||
|
cM = ICEcoder.getcMInstance();
|
||||||
|
lineNo = cM.getCursor().line;
|
||||||
|
whiteSpace = cM.getLine(lineNo).length - cM.getLine(lineNo).replace(/^\s\s*/, '').length;
|
||||||
|
content = cM.getLine(lineNo).slice(whiteSpace);
|
||||||
|
if (content.slice(0,2)=="f ") {
|
||||||
|
top.ICEcoder.doSnippet('f ','function VAR() {\nINDENT\tCURSOR\nINDENT}');
|
||||||
|
} else if (content.slice(0,2)=="if") {
|
||||||
|
top.ICEcoder.doSnippet('if','if (CURSOR) {\nINDENT\t\nINDENT}');
|
||||||
|
} else {
|
||||||
|
cM.operation(function(){
|
||||||
|
var msg = document.createElement("iframe");
|
||||||
|
msg.src = "snippets/snippet-display.php";
|
||||||
|
msg.className = "snippetFrame";
|
||||||
|
top.ICEcoder.snippetLine = cM.addLineWidget(cM.getCursor().line, msg, {coverGutter: false, noHScroll: true});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
doSnippet: function(tgtString,replaceString) {
|
||||||
|
var cM, lineNo, lineContents, replacedLine;
|
||||||
|
|
||||||
|
cM = top.ICEcoder.getcMInstance();
|
||||||
|
lineNo = cM.getCursor().line;
|
||||||
|
lineContents = cM.getLine(lineNo);
|
||||||
|
if (lineContents.indexOf(tgtString)>-1) {
|
||||||
|
remainder = cM.getLine(lineNo);
|
||||||
|
strPos = remainder.indexOf(tgtString);
|
||||||
|
remainder = remainder.slice(remainder.indexOf(tgtString)+tgtString.length);
|
||||||
|
replaceString = replaceString.replace(/VAR/g,remainder);
|
||||||
|
replacedLine = cM.getLine(lineNo).slice(0,strPos);
|
||||||
|
whiteSpace = cM.getLine(lineNo).length - cM.getLine(lineNo).replace(/^\s\s*/, '').length;
|
||||||
|
whiteSpace = cM.getLine(lineNo).slice(0,whiteSpace);
|
||||||
|
replaceString = replaceString.replace(/INDENT/g,whiteSpace);
|
||||||
|
replacedLine += replaceString;
|
||||||
|
curPos = replacedLine.indexOf("CURSOR");
|
||||||
|
sPos = 0;
|
||||||
|
lineNo2 = lineNo;
|
||||||
|
for (i=0;i<replacedLine.length;i++) {
|
||||||
|
if (replacedLine.indexOf("\n",sPos)<replacedLine.indexOf("CURSOR")) {
|
||||||
|
sPos = replacedLine.indexOf("\n",sPos)+1;
|
||||||
|
lineNo2 = lineNo2+1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cM.setLine(lineNo, replacedLine.replace("CURSOR",""));
|
||||||
|
cM.setCursor(lineNo2,curPos);
|
||||||
|
cM.focus();
|
||||||
|
top.ICEcoder.removeSnippet();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
removeSnippet: function() {
|
||||||
|
var cM;
|
||||||
|
|
||||||
|
cM = ICEcoder.getcMInstance();
|
||||||
|
if (top.ICEcoder.snippetLine!==false) {
|
||||||
|
cM.removeLineWidget(top.ICEcoder.snippetLine);
|
||||||
|
}
|
||||||
|
top.ICEcoder.snippetLine = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1,10 +1,17 @@
|
|||||||
<?php include("settings.php");?>
|
<?php include("settings.php");?>
|
||||||
|
<?php
|
||||||
|
if(isset($_GET['selectedFiles'])) {
|
||||||
|
$selectedFiles=explode(":",strClean($_GET['selectedFiles']));
|
||||||
|
echo $selectedFiles[0].".....".$selectedFiles[1];
|
||||||
|
}
|
||||||
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> multiple results screen</title>
|
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> multiple results screen</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" type="text/css" href="multiple-results.css">
|
<link rel="stylesheet" type="text/css" href="multiple-results.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -67,23 +74,30 @@ if (startTab!=top.ICEcoder.selectedTab) {
|
|||||||
?>
|
?>
|
||||||
var spansArray = top.ICEcoder.filesFrame.contentWindow.document.getElementsByTagName('span');
|
var spansArray = top.ICEcoder.filesFrame.contentWindow.document.getElementsByTagName('span');
|
||||||
for (var i=0;i<spansArray.length;i++) {
|
for (var i=0;i<spansArray.length;i++) {
|
||||||
targetURL = spansArray[i].id.replace(/\|/g,"/");
|
foundInSelected = false;
|
||||||
if (targetURL.toLowerCase().indexOf(findText.toLowerCase())>-1 && targetURL.indexOf('_perms')>-1) {
|
targetURL = spansArray[i].id.replace(/\|/g,"/").toLowerCase();
|
||||||
|
if ( targetURL.lastIndexOf(findText.toLowerCase()) > targetURL.lastIndexOf("/")
|
||||||
|
&& targetURL.indexOf(findText.toLowerCase())>-1 && targetURL.indexOf('_perms')>-1) {
|
||||||
if (userTarget.indexOf("selected")>-1) {
|
if (userTarget.indexOf("selected")>-1) {
|
||||||
for (var j=0;j<top.ICEcoder.selectedFiles.length;j++) {
|
for (var j=0;j<top.ICEcoder.selectedFiles.length;j++) {
|
||||||
if (top.ICEcoder.selectedFiles[j].indexOf(targetURL.replace(/\//g,"|").replace(/_perms/g,""))>-1) {
|
if (
|
||||||
|
targetURL.replace(/\//g,"|").indexOf(top.ICEcoder.selectedFiles[j].replace(/\//g,"|").replace(/_perms/g,""))==0
|
||||||
|
&& (
|
||||||
|
targetURL.replace(/\|/g,"/").replace(/_perms/g,"")==top.ICEcoder.selectedFiles[j].replace(/\|/g,"/").replace(/_perms/g,"")
|
||||||
|
||
|
||||||
|
(targetURL.replace(/\|/g,"/").split("/").length > top.ICEcoder.selectedFiles[j].replace(/\|/g,"/").split("/").length && targetURL.charAt(top.ICEcoder.selectedFiles[j].length)=="/"))) {
|
||||||
foundInSelected = true;
|
foundInSelected = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (userTarget.indexOf("all")>-1 || (userTarget.indexOf("selected")>-1 && foundInSelected)) {
|
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 += '<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.toLowerCase().replace(/\|/g,"/").replace(/_perms/g,"").replace(/<?php echo str_replace("/","\/",strtolower($findText)); ?>/g,"<b>"+findText.toLowerCase()+"</b>");
|
resultsDisplay += targetURL.replace(/\|/g,"/").replace(/_perms/g,"").replace(/<?php echo str_replace("/","\/",strtolower($findText)); ?>/g,"<b>"+findText.toLowerCase()+"</b>");
|
||||||
resultsDisplay += '</a><br>';
|
resultsDisplay += '</a><br>';
|
||||||
<?php if (!isset($_GET['replace'])) { ?>
|
<?php if (!isset($_GET['replace'])) { ?>
|
||||||
resultsDisplay += '<div id="foundCount'+i+'">'+spansArray[i].innerHTML+'</div>';
|
resultsDisplay += '<div id="foundCount'+i+'">'+spansArray[i].innerHTML+'</div>';
|
||||||
<?php ;} else { ?>
|
<?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>';
|
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>';
|
||||||
<?php
|
<?php
|
||||||
;};
|
;};
|
||||||
if (isset($_GET['replace'])) { ?>
|
if (isset($_GET['replace'])) { ?>
|
||||||
@@ -100,9 +114,7 @@ if (startTab!=top.ICEcoder.selectedTab) {
|
|||||||
$r = 0;
|
$r = 0;
|
||||||
function phpGrep($q, $path, $base) {
|
function phpGrep($q, $path, $base) {
|
||||||
$fp = opendir($path);
|
$fp = opendir($path);
|
||||||
global $r;
|
global $r, $ICEcoder, $serverType, $selectedFiles;
|
||||||
global $ICEcoder;
|
|
||||||
global $serverType;
|
|
||||||
if (!isset($ret)) {$ret="";};
|
if (!isset($ret)) {$ret="";};
|
||||||
$slash = $serverType == "Windows" ? "\\" : "/";
|
$slash = $serverType == "Windows" ? "\\" : "/";
|
||||||
while($f = readdir($fp)) {
|
while($f = readdir($fp)) {
|
||||||
@@ -115,6 +127,12 @@ if (startTab!=top.ICEcoder.selectedTab) {
|
|||||||
for ($i=0;$i<count($ICEcoder['bannedFiles']);$i++) {
|
for ($i=0;$i<count($ICEcoder['bannedFiles']);$i++) {
|
||||||
if (strpos($f,$ICEcoder['bannedFiles'][$i])>0) {$bFile = true;};
|
if (strpos($f,$ICEcoder['bannedFiles'][$i])>0) {$bFile = true;};
|
||||||
}
|
}
|
||||||
|
$findPath = str_replace($base,"",$fullPath);
|
||||||
|
for ($i=0;$i<count($selectedFiles);$i++) {
|
||||||
|
if (strpos($findPath,str_replace("|","/",$selectedFiles[$i]))!==0) {
|
||||||
|
$bFile = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!$bFile) {
|
if (!$bFile) {
|
||||||
$ret .= "<a href=\\\"javascript:top.ICEcoder.openFile('".$fullPath."');top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'))\\\">";
|
$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>";
|
$ret .= str_replace($base,"",$fullPath)."</a><div id=\\\"foundCount".$r."\\\">Found ".substr_count(strtolower(file_get_contents($fullPath)),$q)." times</div>";
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
<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">
|
||||||
|
<meta name="robots" content="noindex, nofollow">
|
||||||
<link rel="stylesheet" type="text/css" href="properties.css">
|
<link rel="stylesheet" type="text/css" href="properties.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
<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">
|
||||||
|
<meta name="robots" content="noindex, nofollow">
|
||||||
<link rel="stylesheet" type="text/css" href="settings-screen.css">
|
<link rel="stylesheet" type="text/css" href="settings-screen.css">
|
||||||
<link rel="stylesheet" href="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror.css">
|
<link rel="stylesheet" href="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror.css">
|
||||||
<script src="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror-compressed.js"></script>
|
<script src="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror-compressed.js"></script>
|
||||||
@@ -102,8 +103,9 @@ confirm password<br>
|
|||||||
<br>
|
<br>
|
||||||
banned files/folders<br>
|
banned files/folders<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>
|
<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 paths<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="hidden" name="changedFileSettings" value="false">
|
<input type="hidden" name="changedFileSettings" value="false">
|
||||||
<br>
|
|
||||||
ip addresses<br>
|
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>
|
<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>
|
</div>
|
||||||
@@ -133,7 +135,15 @@ for ($i=0;$i<count($themeArray);$i++) {
|
|||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<span style="position: absolute; margin: -18px 0 0 30px">
|
<span style="position: absolute; margin: -15px 0 0 20px">
|
||||||
|
line wrapping<br>
|
||||||
|
<select onchange="showButton()" name="lineWrapping">
|
||||||
|
<option value="true"<?php if($ICEcoder["lineWrapping"]) {echo " selected";};?>>yes</option>
|
||||||
|
<option value="false"<?php if(!$ICEcoder["lineWrapping"]) {echo " selected";};?>>no</option>
|
||||||
|
</select>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span style="position: absolute; margin: -15px 0 0 120px">
|
||||||
tab width <span style="font-size: 10px; color: #888">chars</span><br>
|
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"];?>">
|
<input type="text" name="tabWidth" id="tabWidth" style="width: 30px" onkeydown="showButton()" onkeyup="changeTabWidth()" value="<?php echo $ICEcoder["tabWidth"];?>">
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -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
BIN
plugins/jshint/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 961 B |
4832
plugins/jshint/jshint.js
Normal file
4832
plugins/jshint/jshint.js
Normal file
File diff suppressed because it is too large
Load Diff
BIN
plugins/terminal/icon.gif
Normal file
BIN
plugins/terminal/icon.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 164 B |
201
plugins/terminal/index.php
Normal file
201
plugins/terminal/index.php
Normal 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">$> <input class="command" name="command" type="text" size='50' onkeyup="key(event)" tabindex="1"></p>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
<?php } ?>
|
||||||
28
plugins/terminal/terminal.css
Normal file
28
plugins/terminal/terminal.css
Normal 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}
|
||||||
41
snippets/snippet-display.php
Normal file
41
snippets/snippet-display.php
Normal 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>
|
||||||
Reference in New Issue
Block a user