mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-15 12:57:10 +01:00
Compare commits
95 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3f378f6bd | ||
|
|
09e1562fbc | ||
|
|
4e14ac6d9b | ||
|
|
97882f0c60 | ||
|
|
482a5cfb11 | ||
|
|
f73dee1103 | ||
|
|
9034e1ad45 | ||
|
|
7e35481b62 | ||
|
|
2f87f2adc3 | ||
|
|
6b345ac041 | ||
|
|
19e18f6a10 | ||
|
|
f181cef9e9 | ||
|
|
dd19c39cf8 | ||
|
|
5887a9c755 | ||
|
|
ca35084160 | ||
|
|
644eee0aca | ||
|
|
510a0c1087 | ||
|
|
4afbe4c2fc | ||
|
|
6cf36cc99c | ||
|
|
b98127e83a | ||
|
|
f7f195f083 | ||
|
|
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 | ||
|
|
a4bb1605ce | ||
|
|
c4d24c0a4c | ||
|
|
99dedb61cb | ||
|
|
702c3d069f | ||
|
|
8ec8efe967 | ||
|
|
4aa0260399 | ||
|
|
f24aaf1396 | ||
|
|
00ddd056af | ||
|
|
2438fbb13d | ||
|
|
20832c3dcc | ||
|
|
725461f04e | ||
|
|
a3edd7bdf9 | ||
|
|
8d9d330678 | ||
|
|
d46fa3012b | ||
|
|
75e9f916ec | ||
|
|
f71277008f | ||
|
|
184a9d223b | ||
|
|
b4c45e33e9 | ||
|
|
eea960bcbd | ||
|
|
609e4397db | ||
|
|
b8bfbc5f6a |
File diff suppressed because one or more lines are too long
@@ -1,173 +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;
|
||||
}
|
||||
|
||||
.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 */
|
||||
|
||||
.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-gutter { background: #0C1021; border-right: 0; }
|
||||
.cm-s-blackboard .CodeMirror-gutter-text { color: #888; }
|
||||
.cm-s-blackboard .CodeMirror-gutters { background: #0C1021; border-right: 0; }
|
||||
.cm-s-blackboard .CodeMirror-linenumber { color: #888; }
|
||||
.cm-s-blackboard .CodeMirror-cursor { border-left: 1px solid #A7A7A7 !important; }
|
||||
|
||||
.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 .CodeMirror-gutter { background: #002240; border-right: 1px solid #aaa; }
|
||||
.cm-s-cobalt .CodeMirror-gutter-text { color: #d0d0d0; }
|
||||
.cm-s-cobalt .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; }
|
||||
.cm-s-cobalt .CodeMirror-linenumber { color: #d0d0d0; }
|
||||
.cm-s-cobalt .CodeMirror-cursor { border-left: 1px solid white !important; }
|
||||
|
||||
.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 .CodeMirror-gutter { background: #002240; border-right: 1px solid #aaa; }
|
||||
.cm-s-erlang-dark .CodeMirror-gutter-text { color: #d0d0d0; }
|
||||
.cm-s-erlang-dark .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; }
|
||||
.cm-s-erlang-dark .CodeMirror-linenumber { color: #d0d0d0; }
|
||||
.cm-s-erlang-dark .CodeMirror-cursor { border-left: 1px solid white !important; }
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
.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 .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*/
|
||||
|
||||
.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-gutter-text { color: #777; }
|
||||
.cm-s-lesser-dark .CodeMirror-gutters { background: #262626; border-right:1px solid #aaa; }
|
||||
.cm-s-lesser-dark .CodeMirror-linenumber { color: #777; }
|
||||
|
||||
.cm-s-lesser-dark span.cm-keyword { color: #599eff; }
|
||||
.cm-s-lesser-dark span.cm-atom { color: #C2B470; }
|
||||
@@ -1,9 +1,9 @@
|
||||
/* 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 .CodeMirror-gutter {background: #272822; border-right: 0px;}
|
||||
.cm-s-monokai .CodeMirror-gutter-text {color: #d0d0d0;}
|
||||
.cm-s-monokai .CodeMirror-gutters {background: #272822; border-right: 0px;}
|
||||
.cm-s-monokai .CodeMirror-linenumber {color: #d0d0d0;}
|
||||
.cm-s-monokai .CodeMirror-cursor {border-left: 1px solid #f8f8f0 !important;}
|
||||
|
||||
.cm-s-monokai span.cm-comment {color: #75715e;}
|
||||
@@ -1,9 +1,9 @@
|
||||
/* 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 .CodeMirror-gutter { background: #0a001f; border-right: 1px solid #aaa; }
|
||||
.cm-s-night .CodeMirror-gutter-text { color: #f8f8f8; }
|
||||
.cm-s-night .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; }
|
||||
.cm-s-night .CodeMirror-linenumber { color: #f8f8f8; }
|
||||
.cm-s-night .CodeMirror-cursor { border-left: 1px solid white !important; }
|
||||
|
||||
.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 { background: #112435; color: white; }
|
||||
.cm-s-rubyblue.CodeMirror { background: #112435; color: white; }
|
||||
.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-gutter-text { color: white; }
|
||||
.cm-s-rubyblue .CodeMirror-gutters { background: #1F4661; border-right: 7px solid #3E7087; }
|
||||
.cm-s-rubyblue .CodeMirror-linenumber { color: white; }
|
||||
.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; }
|
||||
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 */
|
||||
|
||||
.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-gutter { background: #002240; border-right: 1px solid #aaa; }
|
||||
.cm-s-vibrant-ink .CodeMirror-gutter-text { color: #d0d0d0; }
|
||||
.cm-s-vibrant-ink .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; }
|
||||
.cm-s-vibrant-ink .CodeMirror-linenumber { color: #d0d0d0; }
|
||||
.cm-s-vibrant-ink .CodeMirror-cursor { border-left: 1px solid white !important; }
|
||||
|
||||
.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;}
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
Early version of the web based IDE which allows for creation of websites in the web browser. Uses the brilliant CodeMirror for code highlighting & editing, with a slick IDE wrapped around it to make the whole thing work.
|
||||
|
||||
<img src="http://icecoder.net/images/ice-coder-web-ide.jpg" alt="ICEcoder web IDE">
|
||||
<img src="http://icecoder.net/images/icecoder-v1pt4-web-ide.jpg" alt="ICEcoder web IDE">
|
||||
|
||||
###Features you'd expect
|
||||
* Context aware code highlighting
|
||||
@@ -38,6 +38,9 @@ Early version of the web based IDE which allows for creation of websites in the
|
||||
* MySQL Database management via Adminer plugin
|
||||
* Backs up files every 10 mins or on click of backup plugin icon
|
||||
* Github repo syncing with ICErepo plugin
|
||||
* Shell terminal
|
||||
* JS Hint validation as you type
|
||||
* Emmet snippet typing booster
|
||||
|
||||
###Installation
|
||||
|
||||
|
||||
117
editor.php
117
editor.php
@@ -5,6 +5,7 @@
|
||||
<head>
|
||||
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> editor</title>
|
||||
<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">
|
||||
<!--
|
||||
codemirror-compressed.js
|
||||
@@ -13,19 +14,26 @@ modes: clike, coffeescript, css, javascript, less, php, ruby & xml
|
||||
utils: foldcode, searchcursor, match-highlighter
|
||||
//-->
|
||||
<script src="<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror-compressed.js"></script>
|
||||
<?php
|
||||
if (file_exists(dirname(__FILE__)."/plugins/emmet/emmet.min.js")) {
|
||||
echo '<script src="plugins/emmet/emmet.min.js"></script>';
|
||||
};?>
|
||||
<link rel="stylesheet" href="<?php
|
||||
if ($ICEcoder["theme"]=="default") {echo 'lib/editor.css';} else {echo $ICEcoder["codeMirrorDir"].'/theme/'.$ICEcoder["theme"].'.css';};
|
||||
$activeLineBG = $ICEcoder["theme"]=="eclipse" || $ICEcoder["theme"]=="elegant" || $ICEcoder["theme"]=="neat" ? "#ccc" : "#000";
|
||||
?>">
|
||||
<style type="text/css">
|
||||
.CodeMirror {position: absolute; width: 0; background-color: #fff; color: #000; top: 0px; width: 100%; z-index: 1}
|
||||
.CodeMirror-scroll {height: auto; overflow: visible}
|
||||
.CodeMirror {position: absolute; top: 0px; width: 100%; font-size: 13px; z-index: 1}
|
||||
.CodeMirror-scroll {} // was: height: auto; overflow: visible
|
||||
/* Make sure this next one remains the 3rd item, updated with JS */
|
||||
.cm-s-activeLine {background: <?php echo $activeLineBG;?> !important}
|
||||
span.CodeMirror-matchhighlight {background: #555}
|
||||
.CodeMirror-focused span.CodeMirror-matchhighlight {color: #000; background: #555; !important}
|
||||
/* 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';};?>";}
|
||||
.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>
|
||||
</head>
|
||||
|
||||
@@ -90,46 +98,28 @@ span.CodeMirror-matchhighlight {background: #555}
|
||||
</div>
|
||||
|
||||
<script>
|
||||
CodeMirror.keyMap.ICEcoder = {
|
||||
"Tab": function(cm) {CodeMirror.commands[top.ICEcoder.tabsIndent ? "defaultTab" : "insertTab"](cm);},
|
||||
"Shift-Tab": "indentLess",
|
||||
"Ctrl-Up": function() {},
|
||||
"Ctrl-Down": function() {},
|
||||
fallthrough: ["default"]
|
||||
};
|
||||
|
||||
function createNewCMInstance(num) {
|
||||
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%';
|
||||
var codeFoldTag = CodeMirror.newFoldFunction(CodeMirror.tagRangeFinder,top.ICEcoder.foldStyle);
|
||||
var codeFoldBrace = CodeMirror.newFoldFunction(CodeMirror.braceRangeFinder,top.ICEcoder.foldStyle);
|
||||
top.ICEcoder['cM'+num+'waiting'] = "";
|
||||
top.ICEcoder['cM'+num+'widgets'] = [];
|
||||
|
||||
window['cM'+num] = CodeMirror(document.body, {
|
||||
mode: "application/x-httpd-php",
|
||||
lineNumbers: true,
|
||||
lineWrapping: true,
|
||||
lineWrapping: top.ICEcoder.lineWrapping,
|
||||
indentUnit: top.ICEcoder.tabWidth,
|
||||
tabSize: top.ICEcoder.tabWidth,
|
||||
indentWithTabs: true,
|
||||
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;
|
||||
}
|
||||
},
|
||||
keyMap: "ICEcoder",
|
||||
onKeyEvent: function(thisCM, e) {
|
||||
top.ICEcoder.redoChangedContent(e);
|
||||
top.ICEcoder.findReplace('find',true,false);
|
||||
@@ -172,22 +162,69 @@ function createNewCMInstance(num) {
|
||||
}
|
||||
};
|
||||
lastKeyCode = e.keyCode;
|
||||
},
|
||||
onGutterClick: !fileName || (fileName && fileName.indexOf(".js") == -1 && fileName.indexOf(".coffee") == -1 && fileName.indexOf(".php") && fileName.indexOf(".rb") == -1) ? codeFoldTag : codeFoldBrace,
|
||||
extraKeys: {
|
||||
"Tab": function(cm) {CodeMirror.commands[top.ICEcoder.tabsIndent ? "defaultTab" : "insertTab"](cm);},
|
||||
"Shift-Tab": "indentLess",
|
||||
"Ctrl-Up": function() {},
|
||||
"Ctrl-Down": function() {}
|
||||
}
|
||||
});
|
||||
|
||||
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
|
||||
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>
|
||||
|
||||
<iframe name="snippetLoader" src="snippets/snippet-display.php" style="display: none"></iframe>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
296
files.php
296
files.php
@@ -1,141 +1,157 @@
|
||||
<?php include("lib/settings.php");?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'files');top.ICEcoder.canResizeFilesW()}" onContextMenu="top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink; return top.ICEcoder.showMenu()" onClick="top.ICEcoder.selectFileFolder()">
|
||||
<head>
|
||||
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> file manager</title>
|
||||
<link rel="stylesheet" type="text/css" href="lib/files.css">
|
||||
<script src="lib/ice-coder.js" type="text/javascript"></script>
|
||||
</head>
|
||||
|
||||
<body onLoad="top.ICEcoder.fileManager()" onDblClick="top.ICEcoder.openFile()" onKeyDown="return top.ICEcoder.interceptKeys('files', event);" onKeyUp="top.ICEcoder.resetKeys(event);">
|
||||
|
||||
<div title="Refresh" onClick="top.ICEcoder.refreshFileManager()" class="refresh"></div>
|
||||
|
||||
<?php
|
||||
// Function to sort given values alphabetically
|
||||
function alphasort($a, $b) {
|
||||
return strcasecmp($a->getPathname(), $b->getPathname());
|
||||
}
|
||||
|
||||
// Class to put forward the values for sorting
|
||||
class SortingIterator implements IteratorAggregate {
|
||||
private $iterator = null;
|
||||
public function __construct(Traversable $iterator, $callback) {
|
||||
$array = iterator_to_array($iterator);
|
||||
usort($array, $callback);
|
||||
$this->iterator = new ArrayIterator($array);
|
||||
}
|
||||
public function getIterator() {
|
||||
return $this->iterator;
|
||||
}
|
||||
}
|
||||
|
||||
// Get a full list of dirs & files and begin sorting using above class & function
|
||||
$objectList = new SortingIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($docRoot.$iceRoot), RecursiveIteratorIterator::SELF_FIRST), 'alphasort');
|
||||
|
||||
// With that done, create arrays for out final ordered list and a temp container of files
|
||||
$finalArray = $tempArray = array();
|
||||
|
||||
// To start, push folders from object into finalArray, files into tempArray
|
||||
foreach ($objectList as $objectRef) {
|
||||
$fileFolderName = substr($objectRef->getPathname(), strlen($docRoot.$iceRoot));
|
||||
$canAdd = true;
|
||||
for ($i=0;$i<count($_SESSION['bannedFiles']);$i++) {
|
||||
if(strpos($fileFolderName,$_SESSION['bannedFiles'][$i])!==false) {$canAdd = false;}
|
||||
}
|
||||
if ($objectRef->getFilename()!="." && $objectRef->getFilename()!=".." && $fileFolderName[strlen($fileFolderName)-1]!="/" && $canAdd) {
|
||||
$fileFolderName!="/" && is_dir($docRoot.$iceRoot.$fileFolderName)
|
||||
? array_push($finalArray,$fileFolderName)
|
||||
: array_push($tempArray,$fileFolderName);
|
||||
}
|
||||
}
|
||||
|
||||
// Now push root files onto the end of finalArray and splice from the temp, leaving only files that reside in subdirs
|
||||
for ($i=0;$i<count($tempArray);$i++) {
|
||||
if (count(explode("/",$tempArray[$i]))==2) {
|
||||
array_push($finalArray,$tempArray[$i]);
|
||||
array_splice($tempArray,$i,1);
|
||||
$i--;
|
||||
}
|
||||
}
|
||||
|
||||
// Lastly we push remaining files into the right subdirs in finalArray
|
||||
for ($i=0;$i<count($tempArray);$i++) {
|
||||
$insertAt = array_search(dirname($tempArray[$i]),$finalArray)+1;
|
||||
for ($j=$insertAt;$j<count($finalArray);$j++) {
|
||||
if ( strcasecmp(dirname($finalArray[$j]), dirname($tempArray[$i]))==0 &&
|
||||
strcasecmp(basename($finalArray[$j]), basename($tempArray[$i]))<0 ||
|
||||
strpos(dirname($finalArray[$j]),dirname($tempArray[$i]))===0) {
|
||||
$insertAt++;
|
||||
}
|
||||
}
|
||||
array_splice($finalArray, $insertAt, 0, $tempArray[$i]);
|
||||
}
|
||||
|
||||
// Finally, we have our ordered list, so display in a UL
|
||||
$fileAtts = "";
|
||||
if ($serverType=="Linux") {
|
||||
$chmodInfo = substr(sprintf('%o', fileperms($docRoot.$iceRoot)), -3);
|
||||
$fileAtts = '<span style="color: #888; font-size: 8px" id="|_perms">'.$chmodInfo.'</span>';
|
||||
}
|
||||
?>
|
||||
<ul class="fileManager">
|
||||
<li class="pft-directory">
|
||||
<a nohref title="/" onMouseOver="top.ICEcoder.overFileFolder('folder','/')" onMouseOut="top.ICEcoder.overFileFolder('folder','')" style="position: relative; left:-22px">
|
||||
|
||||
<span id="|">/
|
||||
<?php echo $iceRoot == "" ? "[ROOT]" : trim($iceRoot,"/");?>
|
||||
</span>
|
||||
<?php echo $fileAtts;?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
$lastPath="";
|
||||
$fileCount=0;
|
||||
$fileBytes=0;
|
||||
$dirCount=0;
|
||||
for ($i=0;$i<count($finalArray);$i++) {
|
||||
$fileFolderName = str_replace("\\","/",$finalArray[$i]);
|
||||
$type = is_dir($docRoot.$iceRoot.$fileFolderName) ? "folder" : "file";
|
||||
$type=="folder" ? $dirCount++ : $fileCount++;
|
||||
if ($type=="file") {
|
||||
$fileBytes+=filesize($docRoot.$iceRoot.$fileFolderName);
|
||||
// Get extension (prefix 'ext-' to prevent invalid classes from extensions that begin with numbers)
|
||||
$ext = "ext-".pathinfo($docRoot.$iceRoot.$fileFolderName, PATHINFO_EXTENSION);
|
||||
}
|
||||
$thisDepth = count(explode("/",$fileFolderName));
|
||||
$lastDepth = count(explode("/",$lastPath));
|
||||
if ($thisDepth > $lastDepth) {echo "<ul>\n";}
|
||||
if ($thisDepth < $lastDepth) {
|
||||
for ($j=$lastDepth;$j>$thisDepth;$j--) {
|
||||
echo "</ul>\n";
|
||||
}
|
||||
}
|
||||
if ($serverType=="Linux") {
|
||||
$chmodInfo = substr(sprintf('%o', fileperms($docRoot.$iceRoot.$fileFolderName)), -3);
|
||||
$fileAtts = '<span style="color: #888; font-size: 8px" id="'.str_replace($docRoot,"",str_replace("/","|",$fileFolderName)).'_perms">'.$chmodInfo.'</span>';
|
||||
}
|
||||
$type == "folder" ? $class = 'pft-directory' : $class = 'pft-file '.strtolower($ext);
|
||||
echo "<li class=\"".$class."\"><a nohref title=\"$fileFolderName\" onMouseOver=\"top.ICEcoder.overFileFolder('$type','".str_replace($docRoot,"",str_replace("/","|",$fileFolderName))."')\" onMouseOut=\"top.ICEcoder.overFileFolder('$type','')\" style=\"position: relative; left:-22px\"> <span id=\"".str_replace($docRoot,"",str_replace("/","|",$fileFolderName))."\">".basename($fileFolderName)."</span> ".$fileAtts."</a>\n";
|
||||
if ($i<count($finalArray)) {echo "</li>\n";}
|
||||
$lastPath = $fileFolderName;
|
||||
}
|
||||
echo "</ul>\n</ul>\n";
|
||||
|
||||
// Output the JS vars
|
||||
echo "<script>\n";
|
||||
echo "top.ICEcoder.dirCount=";
|
||||
echo $dirCount ? $dirCount : "0";
|
||||
echo ";\ntop.ICEcoder.fileCount=";
|
||||
echo $fileCount ? $fileCount : "0";
|
||||
echo ";\ntop.ICEcoder.fileBytes=";
|
||||
echo $fileBytes ? $fileBytes : "0";
|
||||
echo ";\n</script>";
|
||||
?>
|
||||
|
||||
<iframe name="fileControl" style="display: none"></iframe>
|
||||
|
||||
</body>
|
||||
|
||||
<?php include("lib/settings.php");?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'files');top.ICEcoder.canResizeFilesW()}" onContextMenu="top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink; return top.ICEcoder.showMenu()" onClick="top.ICEcoder.selectFileFolder()">
|
||||
<head>
|
||||
<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">
|
||||
<script src="lib/ice-coder.js" type="text/javascript"></script>
|
||||
</head>
|
||||
|
||||
<body onLoad="top.ICEcoder.fileManager()" onDblClick="top.ICEcoder.openFile()" onKeyDown="return top.ICEcoder.interceptKeys('files', event);" onKeyUp="top.ICEcoder.resetKeys(event);">
|
||||
|
||||
<div title="Refresh" onClick="top.ICEcoder.refreshFileManager()" class="refresh"></div>
|
||||
|
||||
<?php
|
||||
// Function to sort given values alphabetically
|
||||
function alphasort($a, $b) {
|
||||
return strcasecmp($a->getPathname(), $b->getPathname());
|
||||
}
|
||||
|
||||
// Class to put forward the values for sorting
|
||||
class SortingIterator implements IteratorAggregate {
|
||||
private $iterator = null;
|
||||
public function __construct(Traversable $iterator, $callback) {
|
||||
$array = iterator_to_array($iterator);
|
||||
usort($array, $callback);
|
||||
$this->iterator = new ArrayIterator($array);
|
||||
}
|
||||
public function getIterator() {
|
||||
return $this->iterator;
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
$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
|
||||
$finalArray = $tempArray = array();
|
||||
|
||||
// To start, push folders from object into finalArray, files into tempArray
|
||||
foreach ($objectList as $objectRef) {
|
||||
$fileFolderName = substr($objectRef->getPathname(), strlen($docRoot.$iceRoot));
|
||||
$canAdd = true;
|
||||
for ($i=0;$i<count($_SESSION['bannedFiles']);$i++) {
|
||||
if(strpos($fileFolderName,$_SESSION['bannedFiles'][$i])!==false) {$canAdd = false;}
|
||||
}
|
||||
if ($objectRef->getFilename()!="." && $objectRef->getFilename()!=".." && $fileFolderName[strlen($fileFolderName)-1]!="/" && $canAdd) {
|
||||
$fileFolderName!="/" && is_dir($docRoot.$iceRoot.$fileFolderName)
|
||||
? array_push($finalArray,$fileFolderName)
|
||||
: array_push($tempArray,$fileFolderName);
|
||||
}
|
||||
}
|
||||
|
||||
// Now push root files onto the end of finalArray and splice from the temp, leaving only files that reside in subdirs
|
||||
for ($i=0;$i<count($tempArray);$i++) {
|
||||
if (count(explode("/",$tempArray[$i]))==2) {
|
||||
array_push($finalArray,$tempArray[$i]);
|
||||
array_splice($tempArray,$i,1);
|
||||
$i--;
|
||||
}
|
||||
}
|
||||
|
||||
// Lastly we push remaining files into the right subdirs in finalArray
|
||||
for ($i=0;$i<count($tempArray);$i++) {
|
||||
$insertAt = array_search(dirname($tempArray[$i]),$finalArray)+1;
|
||||
for ($j=$insertAt;$j<count($finalArray);$j++) {
|
||||
if ( strcasecmp(dirname($finalArray[$j]), dirname($tempArray[$i]))==0 &&
|
||||
strcasecmp(basename($finalArray[$j]), basename($tempArray[$i]))<0 ||
|
||||
(strpos(dirname($finalArray[$j]),dirname($tempArray[$i]))===0 && substr($finalArray[$j],strlen(dirname($tempArray[$i])),1)=="/")) {
|
||||
$insertAt++;
|
||||
}
|
||||
}
|
||||
array_splice($finalArray, $insertAt, 0, $tempArray[$i]);
|
||||
}
|
||||
|
||||
// Finally, we have our ordered list, so display in a UL
|
||||
$fileAtts = "";
|
||||
if ($serverType=="Linux") {
|
||||
$chmodInfo = substr(sprintf('%o', fileperms($docRoot.$iceRoot)), -3);
|
||||
$fileAtts = '<span style="color: #888; font-size: 8px" id="|_perms">'.$chmodInfo.'</span>';
|
||||
}
|
||||
?>
|
||||
<ul class="fileManager">
|
||||
<li class="pft-directory">
|
||||
<a nohref title="/" onMouseOver="top.ICEcoder.overFileFolder('folder','/')" onMouseOut="top.ICEcoder.overFileFolder('folder','')" style="position: relative; left:-22px">
|
||||
|
||||
<span id="|">/
|
||||
<?php echo $iceRoot == "" ? "[ROOT]" : trim($iceRoot,"/");?>
|
||||
</span>
|
||||
<?php echo $fileAtts;?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
$lastPath="";
|
||||
$fileCount=0;
|
||||
$fileBytes=0;
|
||||
$dirCount=0;
|
||||
for ($i=0;$i<count($finalArray);$i++) {
|
||||
$fileFolderName = str_replace("\\","/",$finalArray[$i]);
|
||||
$type = is_dir($docRoot.$iceRoot.$fileFolderName) ? "folder" : "file";
|
||||
$type=="folder" ? $dirCount++ : $fileCount++;
|
||||
if ($type=="file") {
|
||||
$fileBytes+=filesize($docRoot.$iceRoot.$fileFolderName);
|
||||
// Get extension (prefix 'ext-' to prevent invalid classes from extensions that begin with numbers)
|
||||
$ext = "ext-".pathinfo($docRoot.$iceRoot.$fileFolderName, PATHINFO_EXTENSION);
|
||||
}
|
||||
$thisDepth = count(explode("/",$fileFolderName));
|
||||
$lastDepth = count(explode("/",$lastPath));
|
||||
if ($thisDepth > $lastDepth) {echo "<ul>\n";}
|
||||
if ($thisDepth < $lastDepth) {
|
||||
for ($j=$lastDepth;$j>$thisDepth;$j--) {
|
||||
echo "</ul>\n";
|
||||
}
|
||||
}
|
||||
if ($serverType=="Linux") {
|
||||
$chmodInfo = substr(sprintf('%o', fileperms($docRoot.$iceRoot.$fileFolderName)), -3);
|
||||
$fileAtts = '<span style="color: #888; font-size: 8px" id="'.str_replace($docRoot,"",str_replace("/","|",$fileFolderName)).'_perms">'.$chmodInfo.'</span>';
|
||||
}
|
||||
$type == "folder" ? $class = 'pft-directory' : $class = 'pft-file '.strtolower($ext);
|
||||
echo "<li class=\"".$class."\"><a nohref title=\"$fileFolderName\" onMouseOver=\"top.ICEcoder.overFileFolder('$type','".str_replace($docRoot,"",str_replace("/","|",$fileFolderName))."')\" onMouseOut=\"top.ICEcoder.overFileFolder('$type','')\" style=\"position: relative; left:-22px\"> <span id=\"".str_replace($docRoot,"",str_replace("/","|",$fileFolderName))."\">".basename($fileFolderName)."</span> ".$fileAtts."</a>\n";
|
||||
if ($i<count($finalArray)) {echo "</li>\n";}
|
||||
$lastPath = $fileFolderName;
|
||||
}
|
||||
echo "</ul>\n</ul>\n";
|
||||
|
||||
// Output the JS vars
|
||||
echo "<script>\n";
|
||||
echo "top.ICEcoder.dirCount=";
|
||||
echo $dirCount ? $dirCount : "0";
|
||||
echo ";\ntop.ICEcoder.fileCount=";
|
||||
echo $fileCount ? $fileCount : "0";
|
||||
echo ";\ntop.ICEcoder.fileBytes=";
|
||||
echo $fileBytes ? $fileBytes : "0";
|
||||
echo ";\n</script>";
|
||||
?>
|
||||
|
||||
<iframe name="fileControl" style="display: none"></iframe>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
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 |
353
index.php
353
index.php
@@ -1,173 +1,182 @@
|
||||
<?php include("lib/settings.php");
|
||||
|
||||
// Check IP permissions
|
||||
if (!in_array($_SERVER["REMOTE_ADDR"], $_SESSION['allowedIPs']) && !in_array("*", $_SESSION['allowedIPs'])) {
|
||||
header('Location: /');
|
||||
};
|
||||
|
||||
$updateMsg = '';
|
||||
// Check for updates
|
||||
if ($ICEcoder["checkUpdates"]) {
|
||||
$icv = json_encode(file_get_contents("http://icecoder.net/latest-version.txt"));
|
||||
$icv = rtrim(ltrim($icv,'"'),'"\\n');
|
||||
if ($ICEcoder["versionNo"]<$icv) {
|
||||
$updateMsg = ';top.ICEcoder.message(\'ICEcoder '.$icv.' now released\n\nPlease upgrade\')';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'top');top.ICEcoder.canResizeFilesW()}">
|
||||
<head>
|
||||
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?></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="lib/ice-coder.css">
|
||||
<link rel="icon" type="image/png" href="favicon.png">
|
||||
<script>
|
||||
iceRoot = "<?php echo $ICEcoder["root"]; ?>";
|
||||
|
||||
window.onbeforeunload = function() {
|
||||
if (top.ICEcoder.changedContent.indexOf(1)>-1) {
|
||||
return "You have some unsaved changes.";
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<script language="JavaScript" src="lib/ice-coder.js"></script>
|
||||
</head>
|
||||
|
||||
<body onLoad="<?php
|
||||
echo 'top.ICEcoder.previousFiles = [';
|
||||
if ($ICEcoder["previousFiles"]!="") {
|
||||
$openFilesArray = explode(",",$ICEcoder["previousFiles"]);
|
||||
echo "'".implode("','",$openFilesArray)."'";
|
||||
}
|
||||
echo "];top.ICEcoder.theme = '";
|
||||
echo $ICEcoder["theme"]=="default" ? 'icecoder' : $ICEcoder["theme"];
|
||||
echo "'";
|
||||
echo ';top.ICEcoder.tabsIndent = ';
|
||||
echo $ICEcoder["tabsIndent"] ? 'true' : 'false';
|
||||
echo ';top.ICEcoder.openLastFiles = ';
|
||||
echo $ICEcoder["openLastFiles"] ? 'true' : 'false';
|
||||
echo ';top.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);">
|
||||
|
||||
<div id="blackMask" class="blackMask" onClick="ICEcoder.showHide('hide',this)" onContextMenu="return false">
|
||||
<div class="popupVCenter">
|
||||
<div class="popup" id="mediaContainer"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="loadingMask" class="blackMask" style="visibility: visible" onContextMenu="return false">
|
||||
<span class="progressBar" id="progressBar" style="-webkit-animation:fullexpand 10s ease-out; -moz-animation:fullexpand 10s ease-out"></span>
|
||||
<div class="popupVCenter">
|
||||
<div class="popup">
|
||||
<div class="circleOutside"></div>
|
||||
<div class="circleInside"></div>
|
||||
working...
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="fileMenu" class="fileMenu" onMouseOver="ICEcoder.changeFilesW('expand')" onMouseOut="ICEcoder.changeFilesW('contract');this.style.display='none'" onContextMenu="return false">
|
||||
<span id="folderMenuItems">
|
||||
<a href="javascript:top.ICEcoder.newFile()" onMouseOver="ICEcoder.showFileMenu()">New File</a>
|
||||
<a href="javascript:top.ICEcoder.newFolder()" onMouseOver="ICEcoder.showFileMenu()">New Folder</a>
|
||||
</span>
|
||||
<a href="javascript:top.ICEcoder.deleteFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Delete</a>
|
||||
<span id="singleFileMenuItems">
|
||||
<a href="javascript:top.ICEcoder.renameFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Rename</a>
|
||||
<a href="javascript:window.open(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">View Webpage</a>
|
||||
</span>
|
||||
<a href="javascript:top.ICEcoder.zipIt(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Zip It!</a>
|
||||
<a href="javascript:top.ICEcoder.propertiesScreen(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Properties</a>
|
||||
</div>
|
||||
|
||||
<div id="header" class="header" onContextMenu="return false">
|
||||
<div class="plugins" id="pluginsContainer">
|
||||
<?php echo $pluginsDisplay; ?>
|
||||
</div>
|
||||
<div class="version">v <?php echo $ICEcoder["versionNo"];?></div><img src="images/full-screen.gif" id="screenMode" class="screenModeIcon" onClick="top.ICEcoder.fullScreenSwitcher()">
|
||||
<img src="images/ice-coder.png" class="logo" onClick="ICEcoder.helpScreen()" onContextMenu="ICEcoder.settingsScreen()">
|
||||
</div>
|
||||
|
||||
<div id="files" class="files" onMouseOver="ICEcoder.changeFilesW('expand')" onMouseOut="ICEcoder.changeFilesW('contract'); top.document.getElementById('fileMenu').style.display='none';">
|
||||
<div class="account" id="account">
|
||||
<div class="accountOptions">
|
||||
<div title="Save" onClick="ICEcoder.fMIcon('save')" id="fMSave" class="save"></div>
|
||||
<div title="Open" onClick="ICEcoder.fMIcon('open')" id="fMOpen" class="open"></div>
|
||||
<div title="New File" onClick="ICEcoder.fMIcon('newFile')" id="fMNewFile" class="newFile"></div>
|
||||
<div title="New Folder" onClick="ICEcoder.fMIcon('newFolder')" id="fMNewFolder" class="newFolder"></div>
|
||||
<div title="Delete" onClick="ICEcoder.fMIcon('delete')" id="fMDelete" class="delete"></div>
|
||||
<div title="Rename" onClick="ICEcoder.fMIcon('rename')" id="fMRename" class="rename"></div>
|
||||
<div title="View" onClick="ICEcoder.fMIcon('view')" id="fMView" class="view"></div>
|
||||
|
||||
<div title="Lock" onClick="ICEcoder.lockUnlockNav()" id="fmLock" class="lock"></div>
|
||||
</div>
|
||||
</div>
|
||||
<iframe id="filesFrame" class="frame" name="ff" src="files.php" style="opacity: 0" onLoad="this.style.opacity='1'"></iframe>
|
||||
<div class="serverMessage" id="serverMessage"></div>
|
||||
</div>
|
||||
|
||||
<div id="editor" class="editor">
|
||||
<div id="tabsBar" class="tabsBar" onContextMenu="return false">
|
||||
<?php
|
||||
for ($i=1;$i<=10;$i++) {
|
||||
echo '<div id="tab'.$i.'" class="tab" draggable="true" onClick="ICEcoder.canSwitchTabs ? ICEcoder.switchTab('.$i.') : ICEcoder.canSwitchTabs=true"></div>';
|
||||
}
|
||||
?><div class="newTab" onClick="ICEcoder.newTab()"><img src="images/nav-new.png"></div>
|
||||
</div>
|
||||
<div id="findBar" class="findBar" onContextMenu="return false">
|
||||
<form name="findAndReplace">
|
||||
<div class="findReplace">
|
||||
<div class="findText">Find</div>
|
||||
<input type="text" name="find" value="" id="find" class="textbox find" onKeyUp="ICEcoder.findReplace('find',true,false)">
|
||||
|
||||
<select name="connector" onChange="ICEcoder.findReplaceOptions()">
|
||||
<option>in</option>
|
||||
<option>and</option>
|
||||
</select>
|
||||
<div class="replaceText" id="rText" style="display: none">
|
||||
<select name="replaceAction" class="replaceAction">
|
||||
<option>replace</option>
|
||||
<option>replace all</option>
|
||||
</select>
|
||||
with
|
||||
</div>
|
||||
<input type="text" name="replace" value="" id="replace" class="textbox replace" style="display: none">
|
||||
<div class="targetText" id="rTarget" style="display: none">in</div>
|
||||
<select name="target" onChange="ICEcoder.updateResultsDisplay(this.value=='this document' ? 'show' : 'hide')">
|
||||
<option>this document</option>
|
||||
<option>open documents</option>
|
||||
<option>all files</option>
|
||||
<option>all filenames</option>
|
||||
</select>
|
||||
<input type="button" name="submit" value=">>" class="submit" onClick="ICEcoder.findReplace('findReplace',false,true)">
|
||||
<div class="results" id="results"></div>
|
||||
</div>
|
||||
</form>
|
||||
<form onSubmit="return ICEcoder.goToLine()">
|
||||
<div class="codeAssist"><input type="checkbox" name="codeAssist" id="codeAssist" checked onClick="top.ICEcoder.codeAssistToggle()">Code Assist</div>
|
||||
<div class="goLine">Go to Line<input type="text" name="goToLine" value="" id="goToLineNo" class="textbox goToLine">
|
||||
</form>
|
||||
</div>
|
||||
<iframe name="contentFrame" id="content" src="editor.php" class="code"></iframe>
|
||||
</div>
|
||||
|
||||
<div class="footer" id="footer" onContextMenu="return false">
|
||||
<div class="nesting" id="nestValid">Nesting OK</div>
|
||||
<div class="nestLoc">Cursor nest location</div>
|
||||
<div class="nestDisplay" id="nestDisplay"></div>
|
||||
<div class="charDisplay" id="charDisplay"><span id="char"></span></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
ICEcoder.initAliases();
|
||||
ICEcoder.setLayout('dontSetEditor');
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
<?php include("lib/settings.php");
|
||||
|
||||
// Check IP permissions
|
||||
if (!in_array($_SERVER["REMOTE_ADDR"], $_SESSION['allowedIPs']) && !in_array("*", $_SESSION['allowedIPs'])) {
|
||||
header('Location: /');
|
||||
};
|
||||
|
||||
$updateMsg = '';
|
||||
// Check for updates
|
||||
if ($ICEcoder["checkUpdates"]) {
|
||||
$icv = json_encode(file_get_contents("http://icecoder.net/latest-version.txt"));
|
||||
$icv = rtrim(ltrim($icv,'"'),'"\\n');
|
||||
if ($ICEcoder["versionNo"]<$icv) {
|
||||
$updateMsg = ';top.ICEcoder.message(\'ICEcoder '.$icv.' now released\n\nPlease upgrade\')';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'top');top.ICEcoder.canResizeFilesW()}">
|
||||
<head>
|
||||
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?></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="lib/ice-coder.css">
|
||||
<link rel="icon" type="image/png" href="favicon.png">
|
||||
<script>
|
||||
iceRoot = "<?php echo $ICEcoder["root"]; ?>";
|
||||
|
||||
window.onbeforeunload = function() {
|
||||
if (top.ICEcoder.changedContent.indexOf(1)>-1) {
|
||||
return "You have some unsaved changes.";
|
||||
}
|
||||
}
|
||||
|
||||
</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>
|
||||
|
||||
<body onLoad="<?php
|
||||
echo 'top.ICEcoder.previousFiles = [';
|
||||
if ($ICEcoder["previousFiles"]!="") {
|
||||
$openFilesArray = explode(",",$ICEcoder["previousFiles"]);
|
||||
echo "'".implode("','",$openFilesArray)."'";
|
||||
}
|
||||
echo "];top.ICEcoder.theme = '";
|
||||
echo $ICEcoder["theme"]=="default" ? 'icecoder' : $ICEcoder["theme"];
|
||||
echo "'";
|
||||
echo ';top.ICEcoder.tabsIndent = ';
|
||||
echo $ICEcoder["tabsIndent"] ? 'true' : 'false';
|
||||
echo ';top.ICEcoder.openLastFiles = ';
|
||||
echo $ICEcoder["openLastFiles"] ? 'true' : 'false';
|
||||
echo ';top.ICEcoder.lineWrapping = ';
|
||||
echo $ICEcoder["lineWrapping"] ? 'true' : 'false';
|
||||
echo ';top.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);">
|
||||
|
||||
<div id="blackMask" class="blackMask" onClick="ICEcoder.showHide('hide',this)" onContextMenu="return false">
|
||||
<div class="popupVCenter">
|
||||
<div class="popup" id="mediaContainer"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="loadingMask" class="blackMask" style="visibility: visible" onContextMenu="return false">
|
||||
<span class="progressBar" id="progressBar" style="-webkit-animation:fullexpand 10s ease-out; -moz-animation:fullexpand 10s ease-out"></span>
|
||||
<div class="popupVCenter">
|
||||
<div class="popup">
|
||||
<div class="circleOutside"></div>
|
||||
<div class="circleInside"></div>
|
||||
working...
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="fileMenu" class="fileMenu" onMouseOver="ICEcoder.changeFilesW('expand')" onMouseOut="ICEcoder.changeFilesW('contract');this.style.display='none'" onContextMenu="return false">
|
||||
<span id="folderMenuItems">
|
||||
<a href="javascript:top.ICEcoder.newFile()" onMouseOver="ICEcoder.showFileMenu()">New File</a>
|
||||
<a href="javascript:top.ICEcoder.newFolder()" onMouseOver="ICEcoder.showFileMenu()">New Folder</a>
|
||||
<a href="javascript:top.ICEcoder.pasteFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Paste</a>
|
||||
</span>
|
||||
<a href="javascript:top.ICEcoder.deleteFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Delete</a>
|
||||
<span id="singleFileMenuItems">
|
||||
<a href="javascript:top.ICEcoder.copyFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Copy</a>
|
||||
<a href="javascript:top.ICEcoder.renameFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Rename</a>
|
||||
<a href="javascript:window.open(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">View Webpage</a>
|
||||
</span>
|
||||
<a href="javascript:top.ICEcoder.zipIt(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Zip It!</a>
|
||||
<a href="javascript:top.ICEcoder.propertiesScreen(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Properties</a>
|
||||
</div>
|
||||
|
||||
<div id="header" class="header" onContextMenu="return false">
|
||||
<div class="plugins" id="pluginsContainer">
|
||||
<?php echo $pluginsDisplay; ?>
|
||||
</div>
|
||||
<div class="version">v <?php echo $ICEcoder["versionNo"];?></div><img src="images/full-screen.gif" id="screenMode" class="screenModeIcon" onClick="top.ICEcoder.fullScreenSwitcher()">
|
||||
<img src="images/ice-coder.png" class="logo" onClick="ICEcoder.helpScreen()" onContextMenu="ICEcoder.settingsScreen()">
|
||||
</div>
|
||||
|
||||
<div id="files" class="files" onMouseOver="ICEcoder.changeFilesW('expand')" onMouseOut="ICEcoder.changeFilesW('contract'); top.document.getElementById('fileMenu').style.display='none';">
|
||||
<div class="account" id="account">
|
||||
<div class="accountOptions">
|
||||
<div title="Save" onClick="ICEcoder.fMIcon('save')" id="fMSave" class="save"></div>
|
||||
<div title="Open" onClick="ICEcoder.fMIcon('open')" id="fMOpen" class="open"></div>
|
||||
<div title="New File" onClick="ICEcoder.fMIcon('newFile')" id="fMNewFile" class="newFile"></div>
|
||||
<div title="New Folder" onClick="ICEcoder.fMIcon('newFolder')" id="fMNewFolder" class="newFolder"></div>
|
||||
<div title="Delete" onClick="ICEcoder.fMIcon('delete')" id="fMDelete" class="delete"></div>
|
||||
<div title="Rename" onClick="ICEcoder.fMIcon('rename')" id="fMRename" class="rename"></div>
|
||||
<div title="View" onClick="ICEcoder.fMIcon('view')" id="fMView" class="view"></div>
|
||||
|
||||
<div title="Lock" onClick="ICEcoder.lockUnlockNav()" id="fmLock" class="lock"></div>
|
||||
</div>
|
||||
</div>
|
||||
<iframe id="filesFrame" class="frame" name="ff" src="files.php" style="opacity: 0" onLoad="this.style.opacity='1';this.contentWindow.onscroll=function(){top.ICEcoder.mouseDown=false}"></iframe>
|
||||
<div class="serverMessage" id="serverMessage"></div>
|
||||
</div>
|
||||
|
||||
<div id="editor" class="editor">
|
||||
<div id="tabsBar" class="tabsBar" onContextMenu="return false">
|
||||
<?php
|
||||
for ($i=1;$i<=100;$i++) {
|
||||
echo '<div id="tab'.$i.'" class="tab" draggable="true" onClick="ICEcoder.canSwitchTabs ? ICEcoder.switchTab('.$i.') : ICEcoder.canSwitchTabs=true; thisColor=\'#000\'" onMouseOver="thisColor=this.style.color;this.style.color=\'#000\'" onMouseOut="this.style.color=thisColor"></div>';
|
||||
}
|
||||
?><div class="newTab" onClick="ICEcoder.newTab()"><img src="images/nav-new.png"></div>
|
||||
</div>
|
||||
<div id="findBar" class="findBar" onContextMenu="return false">
|
||||
<form name="findAndReplace" onSubmit="ICEcoder.findReplace('findReplace',false,true);return false">
|
||||
<div class="findReplace">
|
||||
<div class="findText">Find</div>
|
||||
<input type="text" name="find" value="" id="find" class="textbox find" onKeyUp="ICEcoder.findReplace('find',true,false)">
|
||||
|
||||
<select name="connector" onChange="ICEcoder.findReplaceOptions()">
|
||||
<option>in</option>
|
||||
<option>and</option>
|
||||
</select>
|
||||
<div class="replaceText" id="rText" style="display: none">
|
||||
<select name="replaceAction" class="replaceAction">
|
||||
<option>replace</option>
|
||||
<option>replace all</option>
|
||||
</select>
|
||||
with
|
||||
</div>
|
||||
<input type="text" name="replace" value="" id="replace" class="textbox replace" style="display: none">
|
||||
<div class="targetText" id="rTarget" style="display: none">in</div>
|
||||
<select name="target" onChange="ICEcoder.updateResultsDisplay(this.value=='this document' ? 'show' : 'hide')">
|
||||
<option>this document</option>
|
||||
<option>open documents</option>
|
||||
<option>all files</option>
|
||||
<option>all filenames</option>
|
||||
</select>
|
||||
<input type="submit" name="submit" value=">>" class="submit">
|
||||
<div class="results" id="results"></div>
|
||||
</div>
|
||||
</form>
|
||||
<form onSubmit="return ICEcoder.goToLine()">
|
||||
<div class="codeAssist"><input type="checkbox" name="codeAssist" id="codeAssist" checked onClick="top.ICEcoder.codeAssistToggle()">Code Assist</div>
|
||||
<div class="goLine">Go to Line<input type="text" name="goToLine" value="" id="goToLineNo" class="textbox goToLine">
|
||||
</form>
|
||||
</div>
|
||||
<iframe name="contentFrame" id="content" src="editor.php" class="code"></iframe>
|
||||
</div>
|
||||
|
||||
<div class="footer" id="footer" onContextMenu="return false">
|
||||
<div class="nesting" id="nestValid">Nesting OK</div>
|
||||
<div class="nestLoc">cursor nest location</div>
|
||||
<div class="nestDisplay" id="nestDisplay"></div>
|
||||
<div class="charDisplay" id="charDisplay"><span id="char"></span></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
ICEcoder.initAliases();
|
||||
ICEcoder.setLayout('dontSetEditor');
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -10,14 +10,20 @@ $ICEcoder = array(
|
||||
"lockedNav" => true,
|
||||
"accountPassword" => "",
|
||||
"bannedFiles" => array("_coder","ICEcoder"),
|
||||
"bannedPaths" => array("/var/www/.git","/var/www/sites/all/modules","/var/www/sites/default/files"),
|
||||
"allowedIPs" => array("*"),
|
||||
"plugins" => array(
|
||||
array("Terminal","plugins/terminal/icon.gif","margin-top: 3px","plugins/terminal","_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("JS Hint","plugins/jshint/icon.png","margin-top: 3px","http://www.jshint.com","_blank",""),
|
||||
array("Emmet","plugins/emmet/icon.png","margin-top: 3px","http://docs.emmet.io","_blank",""),
|
||||
array("ICErepo","plugins/ice-repo/icon.png","margin-top: 3px","plugins/ice-repo","_blank",""),
|
||||
array("Dochub","plugins/dochub/icon.png","margin-top: 3px","http://dochub.io","_blank","")
|
||||
array("Dochub","plugins/dochub/icon.png","margin-top: 3px","http://dochub.io","_blank",""),
|
||||
array("JS Regex","plugins/jsregex/icon.png","margin-top: 3px","http://jsregex.herokuapp.com","_blank",""),
|
||||
array("Zip It!","plugins/zip-it/icon.png","margin-top: 3px; margin-left: 3px","plugins/zip-it/?zip=|&exclude=*.doc*.gif*.jpg*.jpeg*.pdf*.png*.swf*.xml*.zip","fileControl:<b>Zipping Files</b>","30")
|
||||
),
|
||||
"theme" => "default",
|
||||
"lineWrapping" => true,
|
||||
"tabWidth" => 4,
|
||||
"previousFiles" => "",
|
||||
"last10Files" => ""
|
||||
|
||||
@@ -35,6 +35,6 @@
|
||||
|
||||
.cm-s-icecoder .CodeMirror-cursor {border-left: 1px solid white !important}
|
||||
.cm-s-icecoder .CodeMirror-selected {background: #037 !important}
|
||||
.cm-s-icecoder .CodeMirror-gutter {background: #333; border-right: 1px solid #e8e8e8}
|
||||
.cm-s-icecoder .CodeMirror-gutter-text {color: #999; width: 35px; cursor: default}
|
||||
.cm-s-icecoder .CodeMirror-gutters {background: #333; width: 41px; text-align: right; border-right: 1px solid #ccc}
|
||||
.cm-s-icecoder .CodeMirror-linenumber {color: #999; cursor: default}
|
||||
.cm-s-icecoder .CodeMirror-matchingbracket {border: 1px solid grey; color: black !important}
|
||||
@@ -1,273 +1,307 @@
|
||||
<?php include("settings.php");?>
|
||||
<?php
|
||||
// Get the save type if any
|
||||
$saveType = "";
|
||||
if (isset($_GET['saveType'])) {$saveType = strClean($_GET['saveType']);};
|
||||
|
||||
// Establish the filename/new filename
|
||||
$file = str_replace("|","/",strClean(
|
||||
isset($_POST['newFileName']) && $_POST['newFileName']!=""
|
||||
? $_POST['newFileName']
|
||||
: $_GET['file']
|
||||
));
|
||||
|
||||
// Make $file a full path and establish the $fileLoc and $fileName
|
||||
if (strpos($file,$docRoot)===false) {$file=str_replace("|","/",$docRoot.$iceRoot.$file);};
|
||||
$fileLoc = substr(str_replace($docRoot,"",$file),0,strrpos(str_replace($docRoot,"",$file),"/"));
|
||||
$fileName = basename($file);
|
||||
|
||||
// If we're due to open a file...
|
||||
if ($_GET['action']=="load") {
|
||||
echo '<script>action="load";</script>';
|
||||
|
||||
// Determine what to do based on filename
|
||||
// Everything is opened as text in the editor unless specified otherwise
|
||||
$fileType="text";
|
||||
if (strpos($fileName,".jpg")>0||strpos($fileName,".jpeg")>0||strpos($fileName,".gif")>0||strpos($fileName,".png")>0) {$fileType="image";};
|
||||
|
||||
if ($fileType=="text") {
|
||||
if (file_exists($file)) {
|
||||
echo '<script>fileType="text";';
|
||||
echo 'top.ICEcoder.shortURL = top.ICEcoder.rightClickedFile = top.ICEcoder.thisFileFolderLink = "'.$fileLoc."/".$fileName.'";';
|
||||
echo '</script>';
|
||||
$loadedFile = file_get_contents($file);
|
||||
echo '<textarea name="loadedFile" id="loadedFile">'.str_replace("</textarea>","<ICEcoder:/:textarea>",htmlentities($loadedFile)).'</textarea>';
|
||||
} else {
|
||||
echo '<script>fileType="nothing"; top.ICEcoder.message(\'Sorry, '.$fileLoc."/".$fileName.' doesn\\\'t seem to exist on the server\');</script>';
|
||||
}
|
||||
};
|
||||
|
||||
if ($fileType=="image") {
|
||||
echo '<script>fileType="image";fileName=\''.$fileLoc."/".$fileName.'\'</script>';
|
||||
};
|
||||
};
|
||||
|
||||
// If we're due to add a new folder...
|
||||
if ($_GET['action']=="newFolder") {
|
||||
if (is_writable($docRoot.$fileLoc)) {
|
||||
mkdir($file, 0705);
|
||||
// Reload file manager
|
||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.$fileLoc.'\',\''.$fileName.'\');action="newFolder";</script>';
|
||||
} else {
|
||||
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot create folder at\\n".$fileLoc."')</script>";
|
||||
}
|
||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
|
||||
}
|
||||
|
||||
// If we're due to rename a file/folder...
|
||||
if ($_GET['action']=="rename") {
|
||||
if (is_writable($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])))) {
|
||||
rename($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])),$docRoot.$fileLoc."/".$fileName);
|
||||
// Reload file manager
|
||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'rename\',\''.$fileLoc.'\',\''.$fileName.'\',\'\',\''.str_replace($iceRoot,"",strClean($_GET['oldFileName'])).'\');';
|
||||
echo 'action="rename";</script>';
|
||||
} else {
|
||||
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot rename\\n".strClean($_GET['oldFileName'])."');</script>";
|
||||
}
|
||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
|
||||
}
|
||||
|
||||
// If we're due to replace text in a file...
|
||||
if ($_GET['action']=="replaceText") {
|
||||
if (is_writable(str_replace("|","/",strClean($_GET['fileRef'])))) {
|
||||
$file = str_replace("|","/",strClean($_GET['fileRef']));
|
||||
$loadedFile = file_get_contents($file);
|
||||
$newContent = str_replace(strClean($_GET['find']),strClean($_GET['replace']),$loadedFile);
|
||||
$fh = fopen($file, 'w') or die("Sorry, cannot save");
|
||||
fwrite($fh, $newContent);
|
||||
fclose($fh);
|
||||
echo '<script>action="replaceText";</script>';
|
||||
} else {
|
||||
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot replace text in\\n".strClean($_GET['fileRef'])."');</script>";
|
||||
}
|
||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
|
||||
}
|
||||
|
||||
// If we're due to change permissions on a file/folder...
|
||||
if ($_GET['action']=="perms") {
|
||||
if (is_writable($file)) {
|
||||
chmod($file,octdec(numClean($_GET['perms'])));
|
||||
// Reload file manager
|
||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'chmod\',\''.$fileLoc.'\',\''.$fileName.'\',\''.numClean($_GET['perms']).'\');';
|
||||
echo 'action="perms";</script>';
|
||||
} else {
|
||||
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot change permissions on \\n".strClean($file)."');</script>";
|
||||
}
|
||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
|
||||
}
|
||||
|
||||
// If we're due to delete a file...
|
||||
if ($_GET['action']=="delete") {
|
||||
$filesArray = explode(";",$file); // May contain more than one file here
|
||||
for ($i=0;$i<=count($filesArray)-1;$i++) {
|
||||
if (is_writable($iceRoot.$filesArray[$i])) {
|
||||
is_dir($iceRoot.$filesArray[$i])
|
||||
? rrmdir($iceRoot.$filesArray[$i])
|
||||
: unlink($iceRoot.$filesArray[$i]);
|
||||
// Reload file manager
|
||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'delete\',\''.$fileLoc.'\',\''.$fileName.'\');';
|
||||
echo 'action="delete";</script>';
|
||||
} else {
|
||||
echo "<script>top.ICEcoder.message('Sorry can\\'t delete\\n".$filesArray[$i]."');</script>";
|
||||
}
|
||||
echo '<script>action="nothing";</script>';
|
||||
}
|
||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
|
||||
}
|
||||
|
||||
// The function to recursively remove folders & files
|
||||
function rrmdir($dir) {
|
||||
if (is_dir($dir)) {
|
||||
$objects = scandir($dir);
|
||||
foreach ($objects as $object) {
|
||||
if ($object != "." && $object != "..") {
|
||||
filetype($dir."/".$object) == "dir"
|
||||
? rrmdir($dir."/".$object)
|
||||
: unlink($dir."/".$object);
|
||||
}
|
||||
}
|
||||
reset($objects);
|
||||
rmdir($dir);
|
||||
}
|
||||
}
|
||||
|
||||
if ($_GET['action']=="save") {
|
||||
echo '<script>action="save";</script>';
|
||||
// on the form posting via a reload, save the file
|
||||
if (isset($_POST['contents'])) {
|
||||
if ((file_exists($file) && is_writable($file)) || isset($_POST['newFileName']) && $_POST['newFileName']!="") {
|
||||
if (filemtime($file)==$_GET['fileMDT']||!(isset($_GET['fileMDT']))) {
|
||||
$fh = fopen($file, 'w') or die("Sorry, cannot save");
|
||||
fwrite($fh, $_POST['contents']);
|
||||
fclose($fh);
|
||||
clearstatcache();
|
||||
echo '<script>top.ICEcoder.openFileMDTs[top.ICEcoder.selectedTab-1]="'.filemtime($file).'";</script>';
|
||||
// Reload file manager & rename tab if it was a new file
|
||||
if (isset($_POST['newFileName']) && $_POST['newFileName']!="") {
|
||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.$fileLoc.'\',\''.$fileName.'\');';
|
||||
echo 'top.ICEcoder.renameTab(top.ICEcoder.selectedTab,\''.$fileLoc."/".$fileName.'\');</script>';
|
||||
}
|
||||
// Reload stickytab window
|
||||
echo '<script>if (top.ICEcoder.stickyTab.location) {top.ICEcoder.stickyTab.location.reload()};action="doneSave";</script>';
|
||||
} else {
|
||||
$loadedFile = file_get_contents($file);
|
||||
echo '<textarea name="loadedFile" id="loadedFile">'.str_replace("</textarea>","<ICEcoder:/:textarea>",htmlentities($loadedFile)).'</textarea>';
|
||||
echo '<textarea name="userVersionFile" id="userVersionFile"></textarea>';
|
||||
?>
|
||||
<script>
|
||||
var refreshFile = top.ICEcoder.ask('Sorry, this file has changed, cannot save\n<?php echo $file;?>\n\nReload this file and copy your version to a new document?');
|
||||
if (refreshFile) {
|
||||
var cM = top.ICEcoder.getcMInstance();
|
||||
var thisTab = top.ICEcoder.selectedTab;
|
||||
document.getElementById('userVersionFile').value = cM.getValue();
|
||||
// Revert back to original
|
||||
cM.setValue(document.getElementById('loadedFile').value);
|
||||
top.ICEcoder.changedContent[thisTab-1] = 0;
|
||||
top.ICEcoder.openFileMDTs[top.ICEcoder.selectedTab-1] = "<?php echo filemtime($file); ?>";
|
||||
cM.clearHistory();
|
||||
// Now for the new file
|
||||
top.ICEcoder.newTab();
|
||||
cM = top.ICEcoder.getcMInstance();
|
||||
cM.setValue(document.getElementById('userVersionFile').value);
|
||||
cM.clearHistory();
|
||||
// Finally, switch back to original tab
|
||||
top.ICEcoder.switchTab(thisTab);
|
||||
}
|
||||
action='nothing';
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
echo "<script>action='nothing';top.ICEcoder.message('Sorry, cannot write\\n".$file."')</script>";
|
||||
}
|
||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
|
||||
}
|
||||
};
|
||||
?>
|
||||
<script>
|
||||
if (action=="load") {
|
||||
if (fileType=="text") {
|
||||
setTimeout(function() {
|
||||
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.');
|
||||
window.location.reload();
|
||||
} else {
|
||||
top.ICEcoder.loadingFile = true;
|
||||
// Reset the various states back to their initial setting
|
||||
selectedTab = top.ICEcoder.openFiles.length; // The tab that's currently selected
|
||||
|
||||
// Finally, store all data, show tabs etc
|
||||
top.ICEcoder.createNewTab();
|
||||
top.ICEcoder.cMInstances.push(top.ICEcoder.nextcMInstance);
|
||||
top.ICEcoder.setLayout();
|
||||
top.ICEcoder.content.contentWindow.createNewCMInstance(top.ICEcoder.nextcMInstance);
|
||||
|
||||
// Set the value & innerHTML of the code textarea to that of our loaded file plus make it visible (it's hidden on _coder's load)
|
||||
top.ICEcoder.switchMode();
|
||||
cM = top.ICEcoder.getcMInstance();
|
||||
cM.setValue(document.getElementById('loadedFile').value);
|
||||
top.document.getElementById('content').style.visibility='visible';
|
||||
top.ICEcoder.switchTab(top.ICEcoder.selectedTab);
|
||||
cM.focus();
|
||||
|
||||
// Then clean it up, set the text cursor, update the display and get the character data
|
||||
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['cMActiveLine'+top.ICEcoder.selectedTab] = top.ICEcoder.content.contentWindow['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].setLineClass(0, "cm-s-activeLine");
|
||||
top.ICEcoder.nextcMInstance++;
|
||||
top.ICEcoder.openFileMDTs.push('<?php echo filemtime($file); ?>');
|
||||
top.ICEcoder.loadingFile = false;
|
||||
}
|
||||
},4);
|
||||
}
|
||||
|
||||
if (fileType=="image") {
|
||||
top.document.getElementById('blackMask').style.visibility = "visible";
|
||||
top.document.getElementById('mediaContainer').innerHTML = "<img src=\"<?php echo $fileLoc."/".$fileName;?>\" class=\"whiteGlow\" style=\"border: solid 10px #fff; max-width: 700px; max-height: 500px\" onClick=\"return false\"><br><span class=\"whiteGlow\" style=\"border: solid 10px #fff; color: #000; background-color: #fff\" onClick=\"return false\"><?php echo $fileLoc."/".$fileName;?></span>";
|
||||
}
|
||||
|
||||
top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);
|
||||
}
|
||||
</script>
|
||||
|
||||
<form name="saveFile" action="file-control.php?action=save&file=<?php if (isset($file)) {echo $file;}; if (isset($_GET['fileMDT']) && $_GET['fileMDT']!="undefined") {echo "&fileMDT=".numClean($_GET['fileMDT']);};?>" method="POST">
|
||||
<textarea name="contents"></textarea>
|
||||
<input type="hidden" name="newFileName" value="">
|
||||
</form>
|
||||
|
||||
<script>
|
||||
if (action=="save") {
|
||||
<?php
|
||||
if (strpos($file,"[NEW]")>0||$saveType=="saveAs") {
|
||||
if (strpos($fileName,"[NEW]")>0) {echo "fileLoc = '".$fileLoc."';";} else {echo "fileLoc = '';";};
|
||||
?>
|
||||
newFileName = top.ICEcoder.getInput(fileLoc != ""
|
||||
? 'Enter filename to save at '+fileLoc
|
||||
: 'Enter filename (including path, prefixed with /)'
|
||||
,'');
|
||||
if (newFileName.substr(0,1)!="/") {newFileName = "/" + newFileName}
|
||||
if (newFileName) {
|
||||
newFileName = fileLoc == "" ? newFileName : fileLoc + "/" + fileName;
|
||||
}
|
||||
if (newFileName && top.document.getElementById('filesFrame').contentWindow.document.getElementById(newFileName.replace(/\//g,"|"))) {
|
||||
overwriteOK = top.ICEcoder.ask('That file exists already, overwrite?');
|
||||
}
|
||||
document.saveFile.newFileName.value = '<?php echo $docRoot; ?>' + newFileName;
|
||||
<?php ;};?>
|
||||
if ("undefined" == typeof newFileName || (newFileName && "undefined" == typeof overwriteOK) || ("undefined" != typeof overwriteOK && overwriteOK)) {
|
||||
top.ICEcoder.serverMessage('<b>Saving</b><br>'+ <?php echo strpos($file,"[NEW]")>0 ? "newFileName" : "'$file'"; ?>);
|
||||
document.saveFile.contents.value = top.document.getElementById('saveTemp1').value;
|
||||
document.saveFile.submit();
|
||||
} else {
|
||||
top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);
|
||||
action=="nothing";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
if (action=="doneSave") {
|
||||
top.ICEcoder.changedContent[top.ICEcoder.selectedTab-1] = 0;
|
||||
top.ICEcoder.redoTabHighlight(top.ICEcoder.selectedTab);
|
||||
}
|
||||
<?php include("settings.php");?>
|
||||
<?php
|
||||
// Get the save type if any
|
||||
$saveType = "";
|
||||
if (isset($_GET['saveType'])) {$saveType = strClean($_GET['saveType']);};
|
||||
|
||||
// Establish the filename/new filename
|
||||
$file = str_replace("|","/",strClean(
|
||||
isset($_POST['newFileName']) && $_POST['newFileName']!=""
|
||||
? $_POST['newFileName']
|
||||
: $_GET['file']
|
||||
));
|
||||
|
||||
// Make $file a full path and establish the $fileLoc and $fileName
|
||||
if (strpos($file,$docRoot)===false) {$file=str_replace("|","/",$docRoot.$iceRoot.$file);};
|
||||
$fileLoc = substr(str_replace($docRoot,"",$file),0,strrpos(str_replace($docRoot,"",$file),"/"));
|
||||
$fileName = basename($file);
|
||||
|
||||
// If we're due to open a file...
|
||||
if ($_GET['action']=="load") {
|
||||
echo '<script>action="load";</script>';
|
||||
|
||||
if (file_exists($file)) {
|
||||
// Determine what to do based on mime type
|
||||
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
||||
if (strpos(finfo_file($finfo, $file),"text")===0) {
|
||||
echo '<script>fileType="text";';
|
||||
echo 'top.ICEcoder.shortURL = top.ICEcoder.rightClickedFile = top.ICEcoder.thisFileFolderLink = "'.$fileLoc."/".$fileName.'";';
|
||||
echo '</script>';
|
||||
$loadedFile = file_get_contents($file);
|
||||
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 {
|
||||
echo '<script>fileType="other";window.open(\'http://'.$_SERVER['SERVER_NAME'].$fileLoc."/".$fileName.'\');</script>';
|
||||
};
|
||||
} else {
|
||||
echo '<script>fileType="nothing"; top.ICEcoder.message(\'Sorry, '.$fileLoc."/".$fileName.' doesn\\\'t seem to exist on the server\');</script>';
|
||||
}
|
||||
finfo_close($finfo);
|
||||
};
|
||||
|
||||
// If we're due to add a new folder...
|
||||
if ($_GET['action']=="newFolder") {
|
||||
if (!$demoMode && is_writable($docRoot.$fileLoc)) {
|
||||
mkdir($file, 0705);
|
||||
// Reload file manager
|
||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.$fileLoc.'\',\''.$fileName.'\');action="newFolder";</script>';
|
||||
} else {
|
||||
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot create folder at\\n".$fileLoc."')</script>";
|
||||
}
|
||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
|
||||
}
|
||||
|
||||
// If we're due to paste a new file...
|
||||
if ($_GET['action']=="paste") {
|
||||
$source = $file;
|
||||
$dest = $docRoot.strClean(str_replace("|","/",$_GET['location']))."/".basename($source);
|
||||
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
|
||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.strClean(str_replace("|","/",$_GET['location'])).'\',\''.$fileName.'\');action="pasteFile";</script>';
|
||||
} else {
|
||||
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot copy \\n".str_replace($docRoot,"",$source)."\\n into \\n".str_replace($docRoot,"",$dest)."')</script>";
|
||||
}
|
||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
|
||||
}
|
||||
|
||||
// If we're due to rename a file/folder...
|
||||
if ($_GET['action']=="rename") {
|
||||
if (!$demoMode && is_writable($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])))) {
|
||||
rename($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])),$docRoot.$fileLoc."/".$fileName);
|
||||
// Reload file manager
|
||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'rename\',\''.$fileLoc.'\',\''.$fileName.'\',\'\',\''.str_replace($iceRoot,"",strClean($_GET['oldFileName'])).'\');';
|
||||
echo 'action="rename";</script>';
|
||||
} else {
|
||||
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot rename\\n".strClean($_GET['oldFileName'])."');</script>";
|
||||
}
|
||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
|
||||
}
|
||||
|
||||
// If we're due to replace text in a file...
|
||||
if ($_GET['action']=="replaceText") {
|
||||
if (!$demoMode && is_writable(str_replace("|","/",strClean($_GET['fileRef'])))) {
|
||||
$file = str_replace("|","/",strClean($_GET['fileRef']));
|
||||
$loadedFile = file_get_contents($file);
|
||||
$newContent = str_replace(strClean($_GET['find']),strClean($_GET['replace']),$loadedFile);
|
||||
$fh = fopen($file, 'w') or die("Sorry, cannot save");
|
||||
fwrite($fh, $newContent);
|
||||
fclose($fh);
|
||||
echo '<script>action="replaceText";</script>';
|
||||
} else {
|
||||
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot replace text in\\n".strClean($_GET['fileRef'])."');</script>";
|
||||
}
|
||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
|
||||
}
|
||||
|
||||
// If we're due to change permissions on a file/folder...
|
||||
if ($_GET['action']=="perms") {
|
||||
if (!$demoMode && is_writable($file)) {
|
||||
chmod($file,octdec(numClean($_GET['perms'])));
|
||||
// Reload file manager
|
||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'chmod\',\''.$fileLoc.'\',\''.$fileName.'\',\''.numClean($_GET['perms']).'\');';
|
||||
echo 'action="perms";</script>';
|
||||
} else {
|
||||
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot change permissions on \\n".strClean($file)."');</script>";
|
||||
}
|
||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
|
||||
}
|
||||
|
||||
// If we're due to delete a file...
|
||||
if ($_GET['action']=="delete") {
|
||||
$filesArray = explode(";",$file); // May contain more than one file here
|
||||
for ($i=0;$i<=count($filesArray)-1;$i++) {
|
||||
if (!$demoMode && is_writable($iceRoot.$filesArray[$i])) {
|
||||
is_dir($iceRoot.$filesArray[$i])
|
||||
? rrmdir($iceRoot.$filesArray[$i])
|
||||
: unlink($iceRoot.$filesArray[$i]);
|
||||
// Reload file manager
|
||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'delete\',\''.$fileLoc.'\',\''.$fileName.'\');';
|
||||
echo 'action="delete";</script>';
|
||||
} else {
|
||||
echo "<script>top.ICEcoder.message('Sorry can\\'t delete\\n".$filesArray[$i]."');</script>";
|
||||
}
|
||||
echo '<script>action="nothing";</script>';
|
||||
}
|
||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
|
||||
}
|
||||
|
||||
// The function to recursively remove folders & files
|
||||
function rrmdir($dir) {
|
||||
if (is_dir($dir)) {
|
||||
$objects = scandir($dir);
|
||||
foreach ($objects as $object) {
|
||||
if ($object != "." && $object != "..") {
|
||||
filetype($dir."/".$object) == "dir"
|
||||
? rrmdir($dir."/".$object)
|
||||
: unlink($dir."/".$object);
|
||||
}
|
||||
}
|
||||
reset($objects);
|
||||
rmdir($dir);
|
||||
}
|
||||
}
|
||||
|
||||
if ($_GET['action']=="save") {
|
||||
echo '<script>action="save";</script>';
|
||||
// on the form posting via a reload, save the file
|
||||
if (isset($_POST['contents'])) {
|
||||
if (!$demoMode && ((file_exists($file) && is_writable($file)) || isset($_POST['newFileName']) && $_POST['newFileName']!="")) {
|
||||
if (filemtime($file)==$_GET['fileMDT']||!(isset($_GET['fileMDT']))) {
|
||||
$fh = fopen($file, 'w') or die("Sorry, cannot save");
|
||||
fwrite($fh, $_POST['contents']);
|
||||
fclose($fh);
|
||||
clearstatcache();
|
||||
echo '<script>top.ICEcoder.openFileMDTs[top.ICEcoder.selectedTab-1]="'.filemtime($file).'";</script>';
|
||||
// Reload file manager & rename tab if it was a new file
|
||||
if (isset($_POST['newFileName']) && $_POST['newFileName']!="") {
|
||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.$fileLoc.'\',\''.$fileName.'\');';
|
||||
echo 'top.ICEcoder.renameTab(top.ICEcoder.selectedTab,\''.$fileLoc."/".$fileName.'\');</script>';
|
||||
}
|
||||
// Reload stickytab window
|
||||
echo '<script>if (top.ICEcoder.stickyTab.location) {top.ICEcoder.stickyTab.location.reload()};action="doneSave";</script>';
|
||||
} else {
|
||||
$loadedFile = file_get_contents($file);
|
||||
echo '<textarea name="loadedFile" id="loadedFile">'.str_replace("</textarea>","<ICEcoder:/:textarea>",htmlentities($loadedFile)).'</textarea>';
|
||||
echo '<textarea name="userVersionFile" id="userVersionFile"></textarea>';
|
||||
?>
|
||||
<script>
|
||||
var refreshFile = top.ICEcoder.ask('Sorry, this file has changed, cannot save\n<?php echo $file;?>\n\nReload this file and copy your version to a new document?');
|
||||
if (refreshFile) {
|
||||
var cM = top.ICEcoder.getcMInstance();
|
||||
var thisTab = top.ICEcoder.selectedTab;
|
||||
document.getElementById('userVersionFile').value = cM.getValue();
|
||||
// Revert back to original
|
||||
cM.setValue(document.getElementById('loadedFile').value);
|
||||
top.ICEcoder.changedContent[thisTab-1] = 0;
|
||||
top.ICEcoder.openFileMDTs[top.ICEcoder.selectedTab-1] = "<?php echo filemtime($file); ?>";
|
||||
cM.clearHistory();
|
||||
// Now for the new file
|
||||
top.ICEcoder.newTab();
|
||||
cM = top.ICEcoder.getcMInstance();
|
||||
cM.setValue(document.getElementById('userVersionFile').value);
|
||||
cM.clearHistory();
|
||||
// Finally, switch back to original tab
|
||||
top.ICEcoder.switchTab(thisTab);
|
||||
}
|
||||
action='nothing';
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
echo "<script>action='nothing';top.ICEcoder.message('Sorry, cannot write\\n".$file."')</script>";
|
||||
}
|
||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
|
||||
}
|
||||
};
|
||||
?>
|
||||
<script>
|
||||
if (action=="load") {
|
||||
if (fileType=="text") {
|
||||
setTimeout(function() {
|
||||
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.');
|
||||
window.location.reload();
|
||||
<?php
|
||||
if (file_exists($file)) {
|
||||
?>
|
||||
} else {
|
||||
top.ICEcoder.loadingFile = true;
|
||||
// Reset the various states back to their initial setting
|
||||
selectedTab = top.ICEcoder.openFiles.length; // The tab that's currently selected
|
||||
|
||||
// Finally, store all data, show tabs etc
|
||||
top.ICEcoder.createNewTab();
|
||||
top.ICEcoder.cMInstances.push(top.ICEcoder.nextcMInstance);
|
||||
top.ICEcoder.setLayout();
|
||||
top.ICEcoder.content.contentWindow.createNewCMInstance(top.ICEcoder.nextcMInstance);
|
||||
|
||||
// Set the value & innerHTML of the code textarea to that of our loaded file plus make it visible (it's hidden on _coder's load)
|
||||
top.ICEcoder.switchMode();
|
||||
cM = top.ICEcoder.getcMInstance();
|
||||
cM.setValue(document.getElementById('loadedFile').value);
|
||||
top.document.getElementById('content').style.visibility='visible';
|
||||
top.ICEcoder.switchTab(top.ICEcoder.selectedTab);
|
||||
cM.focus();
|
||||
|
||||
// Then clean it up, set the text cursor, update the display and get the character data
|
||||
top.ICEcoder.contentCleanUp();
|
||||
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]].addLineClass(0, "background", "cm-s-activeLine");
|
||||
top.ICEcoder.nextcMInstance++;
|
||||
top.ICEcoder.openFileMDTs.push('<?php echo filemtime($file); ?>');
|
||||
top.ICEcoder.loadingFile = false;
|
||||
<?php
|
||||
;};
|
||||
?>
|
||||
}
|
||||
},4);
|
||||
}
|
||||
|
||||
if (fileType=="image") {
|
||||
top.document.getElementById('blackMask').style.visibility = "visible";
|
||||
top.document.getElementById('mediaContainer').innerHTML = "<img src=\"<?php echo $fileLoc."/".$fileName;?>\" class=\"whiteGlow\" style=\"border: solid 10px #fff; max-width: 700px; max-height: 500px\" onClick=\"return false\"><br><span class=\"whiteGlow\" style=\"border: solid 10px #fff; color: #000; background-color: #fff\" onClick=\"return false\"><?php echo $fileLoc."/".$fileName;?></span>";
|
||||
}
|
||||
|
||||
top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);
|
||||
}
|
||||
</script>
|
||||
|
||||
<form name="saveFile" action="file-control.php?action=save&file=<?php if (isset($file)) {echo $file;}; if (isset($_GET['fileMDT']) && $_GET['fileMDT']!="undefined") {echo "&fileMDT=".numClean($_GET['fileMDT']);};?>" method="POST">
|
||||
<textarea name="contents"></textarea>
|
||||
<input type="hidden" name="newFileName" value="">
|
||||
</form>
|
||||
|
||||
<script>
|
||||
if (action=="save") {
|
||||
<?php
|
||||
if (strpos($file,"[NEW]")>0||$saveType=="saveAs") {
|
||||
if (strpos($fileName,"[NEW]")>0) {echo "fileLoc = '".$fileLoc."';";} else {echo "fileLoc = '';";};
|
||||
?>
|
||||
newFileName = top.ICEcoder.getInput(fileLoc != ""
|
||||
? 'Enter filename to save at '+fileLoc
|
||||
: 'Enter filename (including path, prefixed with /)'
|
||||
,'');
|
||||
if (newFileName.substr(0,1)!="/") {newFileName = "/" + newFileName}
|
||||
if (newFileName) {
|
||||
newFileName = fileLoc == "" ? newFileName : fileLoc + "/" + fileName;
|
||||
}
|
||||
if (newFileName && top.document.getElementById('filesFrame').contentWindow.document.getElementById(newFileName.replace(/\//g,"|"))) {
|
||||
overwriteOK = top.ICEcoder.ask('That file exists already, overwrite?');
|
||||
}
|
||||
document.saveFile.newFileName.value = '<?php echo $docRoot; ?>' + newFileName;
|
||||
<?php ;};?>
|
||||
if ("undefined" == typeof newFileName || (newFileName && "undefined" == typeof overwriteOK) || ("undefined" != typeof overwriteOK && overwriteOK)) {
|
||||
top.ICEcoder.serverMessage('<b>Saving</b><br>'+ <?php echo strpos($file,"[NEW]")>0 ? "newFileName" : "'$file'"; ?>);
|
||||
document.saveFile.contents.value = top.document.getElementById('saveTemp1').value;
|
||||
document.saveFile.submit();
|
||||
} else {
|
||||
top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);
|
||||
action=="nothing";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
if (action=="doneSave") {
|
||||
top.ICEcoder.changedContent[top.ICEcoder.selectedTab-1] = 0;
|
||||
top.ICEcoder.redoTabHighlight(top.ICEcoder.selectedTab);
|
||||
}
|
||||
</script>
|
||||
87
lib/help.php
87
lib/help.php
@@ -1,44 +1,45 @@
|
||||
<?php include("settings.php");?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> help</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<link rel="stylesheet" type="text/css" href="help.css">
|
||||
</head>
|
||||
|
||||
<body class="help">
|
||||
|
||||
<h1 id="title">help</h1>
|
||||
|
||||
<h2>In file manager</h2>
|
||||
<span class="key">Delete</span> <span class="shortcut">Delete file</span><br><br>
|
||||
|
||||
<h2>Within document</h2>
|
||||
<span class="key">CTRL <span class="plus">+</span> ↑</span> <span class="shortcut">Move line up</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> ↓</span> <span class="shortcut">Move line down</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> I</span> <span class="shortcut">Search selected text</span><br>
|
||||
<span class="key">Esc</span> <span class="shortcut">Comment / uncomment text</span><br>
|
||||
<span class="key">Tab</span> <span class="shortcut">Insert tab / indent selected text</span><br><br>
|
||||
|
||||
<h2>Anywhere</h2>
|
||||
<span class="key">CTRL <span class="plus">+</span> →</span> <span class="shortcut">Next tab</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> ←</span> <span class="shortcut">Previous tab</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> +</span> <span class="shortcut">New tab</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> -</span> <span class="shortcut">Close current tab</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> F</span> <span class="shortcut">Find</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> G</span> <span class="shortcut">Go to line</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> S</span> <span class="shortcut">Save</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> Shift <span class="plus">+</span> S</span> <span class="shortcut">Save as...</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> Enter</span> <span class="shortcut">View webpage</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> S <span class="plus">+</span> Enter</span> <span class="shortcut">Save & create sticky tab</span><br>
|
||||
<span class="key">Esc</span> <span class="shortcut">Cancel tasks</span><br><br>
|
||||
|
||||
<h2>Logo</h2>
|
||||
<span class="key">Left click</span> <span class="shortcut">Help</span><br>
|
||||
<span class="key">Right click</span> <span class="shortcut">Settings</span><br>
|
||||
|
||||
</body>
|
||||
|
||||
<?php include("settings.php");?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> help</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="help.css">
|
||||
</head>
|
||||
|
||||
<body class="help">
|
||||
|
||||
<h1 id="title">help</h1>
|
||||
|
||||
<h2>In file manager</h2>
|
||||
<span class="key">Delete</span> <span class="shortcut">Delete file</span><br><br>
|
||||
|
||||
<h2>Within document</h2>
|
||||
<span class="key">CTRL <span class="plus">+</span> ↑</span> <span class="shortcut">Move line up</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> ↓</span> <span class="shortcut">Move line down</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> I</span> <span class="shortcut">Search selected text</span><br>
|
||||
<span class="key">Esc</span> <span class="shortcut">Comment / uncomment text</span><br>
|
||||
<span class="key">Tab</span> <span class="shortcut">Insert tab / indent selected text</span><br><br>
|
||||
|
||||
<h2>Anywhere</h2>
|
||||
<span class="key">CTRL <span class="plus">+</span> →</span> <span class="shortcut">Next tab</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> ←</span> <span class="shortcut">Previous tab</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> +</span> <span class="shortcut">New tab</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> -</span> <span class="shortcut">Close current tab</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> F</span> <span class="shortcut">Find</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> G</span> <span class="shortcut">Go to line</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> S</span> <span class="shortcut">Save</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> Shift <span class="plus">+</span> S</span> <span class="shortcut">Save as...</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> Enter</span> <span class="shortcut">View webpage</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> S <span class="plus">+</span> Enter</span> <span class="shortcut">Save & create sticky tab</span><br>
|
||||
<span class="key">Esc</span> <span class="shortcut">Cancel tasks</span><br><br>
|
||||
|
||||
<h2>Logo</h2>
|
||||
<span class="key">Left click</span> <span class="shortcut">Help</span><br>
|
||||
<span class="key">Right click</span> <span class="shortcut">Settings</span><br>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -73,7 +73,7 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
|
||||
.header .logo {position: relative; margin: 5px 10px 0 5px; cursor: pointer}
|
||||
|
||||
.files {position: absolute; display: inline-block; top: 0; left: 0; height: 100%; width: 250px; background-color: #444; background-image: url('../images/files-arrow.png'); background-repeat: no-repeat; background-position: 100% 50%; overflow: hidden; z-index: 1;
|
||||
box-shadow: 0 0 10px 4px rgba(0,0,0,0.4);
|
||||
box-shadow: 0 50px 10px 4px rgba(0,0,0,0.4);
|
||||
}
|
||||
.files .account {display: inline-block; height: 50px; width: 250px; margin-top: 40px; background-color: #888}
|
||||
.files .accountOptions {position: relative; height: 32px; width: 100%; margin-left: 15px; margin-top: 8px}
|
||||
@@ -90,32 +90,33 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
|
||||
.files .button {position: absolute; border: 0; background: #444; color: #eee; height:20px; margin-top: 16px; margin-left: 5px; font-size: 11px; cursor: pointer}
|
||||
.files .button:hover {background-color: #222; color: #eee}
|
||||
.files .frame {display: inline-block; width: 250px}
|
||||
.files .serverMessage {position: absolute; display: inline-block; width: 450px; bottom: 0; margin-bottom: 30px; background-color: rgba(255,255,255,0.8); font-size: 10px; padding: 7px 12px; opacity: 0;
|
||||
-webkit-transition: all 0.2s;
|
||||
-moz-transition: all 0.2s;
|
||||
transition: all 0.2s;
|
||||
.files .serverMessage {position: absolute; display: none; width: 450px; bottom: 0; margin-bottom: 30px; background-color: rgba(255,255,255,0.8); font-size: 10px; padding: 7px 12px; opacity: 0;
|
||||
-webkit-transition: opacity 0.2s;
|
||||
-moz-transition: opacity 0.2s;
|
||||
transition: opacity 0.2s;
|
||||
}
|
||||
.files .serverMessage b {font-size: 10px}
|
||||
|
||||
.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;}
|
||||
.tabsBar .tab {display: inline-block; 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;
|
||||
.editor .tabsBar {display: inline-block; height: 22px; width: 2400px; margin-top: 40px; padding-left: 41px; background: #ddd}
|
||||
.tabsBar .tab {display: none; background-image: url('../images/nav-bg.jpg'); background-repeat: repeat-x; background-position: 0 0; padding: 5px 8px 2px 8px; font-size: 10px; border-left: solid 1px #eee; border-right: solid 1px #777; border-radius: 4px 4px 0 0; color: #fff; direction: rtl; text-align: right; white-space: nowrap; overflow: hidden; cursor: pointer;
|
||||
-webkit-transition: all 0.15s;
|
||||
-moz-transition: all 0.15s;
|
||||
transition: all 0.15s;
|
||||
}
|
||||
.tabsBar .tab .closeTab {margin: 1px 0 0 5px; border-radius: 6px}
|
||||
.tabsBar .newTab {display: inline-block; background-image: url('../images/nav-bg.jpg'); background-repeat: repeat-x; background-position: 0 0; padding: 6px 5px 5px 5px; border-left: solid 1px #fff; border-right: solid 1px #777; cursor: pointer;}
|
||||
.tabsBar .newTab {display: inline-block; background-image: url('../images/nav-bg.jpg'); background-repeat: repeat-x; background-position: 0 0; padding: 6px 5px 5px 5px; border-left: solid 1px #eee; border-right: solid 1px #777; border-radius: 4px 4px 0 0; cursor: pointer;}
|
||||
.editor .findBar {display: inline-block; height: 28px; width: 2400px; color: #fff; background-color: #141414}
|
||||
.findBar .findReplace {position: absolute; z-index: 1}
|
||||
.findReplace select {position: relative; font-size: 10px; margin: 8px 2px 0 2px; top: -2px;}
|
||||
.findReplace .findText {display: inline-block; height: 21px; font-size: 10px; margin: 8px 2px 0 2px; margin-left: 43px}
|
||||
.findReplace .find {position: relative; width: 120px; height: 14px; border: 0; top: -2px; font-size: 10px; padding-left: 5px; margin-right: 3px}
|
||||
.findReplace .find {position: relative; width: 120px; height: 16px; border: 0; top: -3px; font-size: 10px; padding-left: 5px; margin-right: 3px}
|
||||
.findReplace .replaceAction {margin: 0 2px 0 0; top: -2px}
|
||||
.findReplace .replaceText {height: 21px; font-size: 10px; margin: 8px 2px 0 2px}
|
||||
.findReplace .replace {position: relative; width: 120px; height: 16px; border: 0; top: -2px; font-size: 10px; padding-left: 5px}
|
||||
.findReplace .replace {position: relative; width: 120px; height: 16px; border: 0; top: -3px; font-size: 10px; padding-left: 5px}
|
||||
.findReplace .targetText {height: 21px; font-size: 10px; margin: 8px 2px 0 2px}
|
||||
.findReplace .submit {position: relative; top: -2px; height: 17px; border: 1px solid #bbb; background-color: #f8f8f8; font-size: 10px; cursor: pointer}
|
||||
.findReplace .submit {position: relative; top: -2px; height: 17px; border: 0; background-color: #444; color: #eee; font-size: 10px; margin-left: 2px; cursor: pointer}
|
||||
.findReplace .submit:hover {background-color: #2187e7; color: #eee}
|
||||
.findReplace .results {position: relative; display: inline-block; width: 200px; height: 20px; font-size: 10px; margin: 8px 0 0 20px}
|
||||
.findBar .codeAssist {position: fixed; display: inline-block; width: 100px; right: 74px; top: 70px; height: 21px; font-size: 10px; z-index: 1}
|
||||
.findBar .codeAssist input {margin-top: -1px}
|
||||
@@ -126,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 .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 .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 .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: 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}
|
||||
|
||||
.textbox {box-shadow: inset 1px 1px 2px 0 rgba(0,0,0,0.4)}
|
||||
@@ -142,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 .accountPassword {border: 0; background-color: #333; color: #fff; height: 20px}
|
||||
.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}
|
||||
342
lib/ice-coder.js
342
lib/ice-coder.js
@@ -23,6 +23,7 @@ var ICEcoder = {
|
||||
lockedNav: true, // Nav is locked or not
|
||||
htmlTagArray: [], // Array storing the nest of tags
|
||||
codeAssist: true, // Assist user with their coding
|
||||
snippetLine: false, // Line no of snippet, if shown
|
||||
mouseDown: false, // If the mouse is down or not
|
||||
draggingFilesW: false, // If we're dragging the file manager width or not
|
||||
serverQueueItems: [], // Array of URLs to call in order
|
||||
@@ -95,6 +96,7 @@ var ICEcoder = {
|
||||
this.account.style.height = this.accountH + "px";
|
||||
this.fmLock.style.marginLeft = (this.filesW-42) + "px";
|
||||
this.filesFrame.style.height = (winH-headerH-accountH-footerH) + "px";
|
||||
top.ICEcoder.setTabWidths();
|
||||
|
||||
// If we need to set the editor sizes
|
||||
if (!dontSetEditor) {
|
||||
@@ -239,7 +241,7 @@ var ICEcoder = {
|
||||
linePos = cM.getCursor().line;
|
||||
lineContent = cM.getLine(linePos);
|
||||
lCLen = lineContent.length;
|
||||
adjustCursor = 3;
|
||||
adjustCursor = 2;
|
||||
|
||||
if (["JavaScript","CoffeeScript","PHP","Ruby","CSS"].indexOf(ICEcoder.caretLocType)>-1) {
|
||||
if (cM.somethingSelected()) {
|
||||
@@ -247,9 +249,9 @@ var ICEcoder = {
|
||||
startLine = cM.getCursor(true).line;
|
||||
endLine = cM.getCursor().line;
|
||||
for (var i=startLine; i<=endLine; i++) {
|
||||
cM.setLine(i, cM.getLine(i).slice(0,2)!="# "
|
||||
? "# " + cM.getLine(i)
|
||||
: cM.getLine(i).slice(2,cM.getLine(i).length));
|
||||
cM.setLine(i, cM.getLine(i).slice(0,1)!="#"
|
||||
? "#" + cM.getLine(i)
|
||||
: cM.getLine(i).slice(1,cM.getLine(i).length));
|
||||
}
|
||||
} else {
|
||||
cM.replaceSelection(cM.getSelection().slice(0,2)!="/*"
|
||||
@@ -258,20 +260,20 @@ var ICEcoder = {
|
||||
}
|
||||
} else {
|
||||
if (["CoffeeScript","CSS"].indexOf(ICEcoder.caretLocType)>-1) {
|
||||
cM.setLine(linePos, lineContent.slice(0,3)!="/* "
|
||||
? "/* " + lineContent + " */"
|
||||
: lineContent.slice(3,lCLen).slice(0,lCLen-5));
|
||||
if (lineContent.slice(0,3)=="/* ") {adjustCursor = -adjustCursor};
|
||||
cM.setLine(linePos, lineContent.slice(0,2)!="/*"
|
||||
? "/*" + lineContent + "*/"
|
||||
: lineContent.slice(2,lCLen).slice(0,lCLen-4));
|
||||
if (lineContent.slice(0,2)=="/*") {adjustCursor = -adjustCursor};
|
||||
} else if (ICEcoder.caretLocType=="Ruby") {
|
||||
cM.setLine(linePos, lineContent.slice(0,2)!="# "
|
||||
? "# " + lineContent
|
||||
: lineContent.slice(2,lCLen));
|
||||
if (lineContent.slice(0,2)=="# ") {adjustCursor = -adjustCursor};
|
||||
cM.setLine(linePos, lineContent.slice(0,1)!="#"
|
||||
? "#" + lineContent
|
||||
: lineContent.slice(1,lCLen));
|
||||
if (lineContent.slice(0,1)=="#") {adjustCursor = -adjustCursor};
|
||||
} else {
|
||||
cM.setLine(linePos, lineContent.slice(0,3)!="// "
|
||||
? "// " + lineContent
|
||||
: lineContent.slice(3,lCLen));
|
||||
if (lineContent.slice(0,3)=="// ") {adjustCursor = -adjustCursor};
|
||||
cM.setLine(linePos, lineContent.slice(0,2)!="//"
|
||||
? "//" + lineContent
|
||||
: lineContent.slice(2,lCLen));
|
||||
if (lineContent.slice(0,2)=="//") {adjustCursor = -adjustCursor};
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -293,7 +295,7 @@ var ICEcoder = {
|
||||
highlightBlock: function(nestPos,hide) {
|
||||
var cM, searchPos, cursor, startPos, endPos;
|
||||
|
||||
cM = ICEcoder.getcMInstance();
|
||||
cM = top.ICEcoder.getcMInstance();
|
||||
// Hiding the block
|
||||
if (hide) {
|
||||
// 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.cursorOrigLine = cM.getCursor().line;
|
||||
top.ICEcoder.dontUpdateNest = true;
|
||||
|
||||
// Set a cursor position object to begin with
|
||||
searchPos = new Object();
|
||||
searchPos.ch = cM.getCursor().ch;
|
||||
@@ -326,10 +327,12 @@ var ICEcoder = {
|
||||
top.ICEcoder.startPosLine = startPos.line = cursor.from().line;
|
||||
// Now set an end position object that matches this start tag
|
||||
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;
|
||||
// Set the selection or escape out of not selecting
|
||||
!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,"/");
|
||||
// No reason why we can't open a file (so far)
|
||||
canOpenFile = true;
|
||||
// Limit to 10 files open at a time
|
||||
if (top.ICEcoder.openFiles.length<10) {
|
||||
// Limit to 100 files open at a time
|
||||
if (top.ICEcoder.openFiles.length<100) {
|
||||
// check if we've already got it in our array
|
||||
if (top.ICEcoder.openFiles.indexOf(shortURL)>-1 && shortURL!="/[NEW]") {
|
||||
// we have, so instead, switch to that tab
|
||||
@@ -517,8 +520,8 @@ var ICEcoder = {
|
||||
top.ICEcoder.switchTab(i+1);
|
||||
}
|
||||
} else {
|
||||
// show a message because we have 10 files open
|
||||
top.ICEcoder.message('Sorry, you can only have 10 files open at a time!');
|
||||
// show a message because we have 100 files open
|
||||
top.ICEcoder.message('Sorry, you can only have 100 files open at a time!');
|
||||
canOpenFile = false;
|
||||
}
|
||||
|
||||
@@ -549,7 +552,7 @@ var ICEcoder = {
|
||||
|
||||
// Prompt a rename dialog on demand
|
||||
renameFile: function(oldName,newName) {
|
||||
var shortURL;
|
||||
var shortURL, fileName;
|
||||
|
||||
if (!oldName) {
|
||||
shortURL = top.ICEcoder.rightClickedFile.replace(/\|/g,"/");
|
||||
@@ -565,7 +568,8 @@ var ICEcoder = {
|
||||
// rename array item and the tab
|
||||
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>';
|
||||
top.document.getElementById('tab'+(i+1)).innerHTML = top.ICEcoder.openFiles[i] + " " + closeTabLink;
|
||||
fileName = top.ICEcoder.openFiles[i];
|
||||
top.document.getElementById('tab'+(i+1)).innerHTML = closeTabLink + " " + fileName.slice(fileName.lastIndexOf("/")).replace(/\//,"");
|
||||
}
|
||||
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);
|
||||
@@ -591,6 +595,18 @@ var ICEcoder = {
|
||||
};
|
||||
},
|
||||
|
||||
// Copy a file on demand
|
||||
copyFile: function(selFile) {
|
||||
top.ICEcoder.copiedFile = selFile;
|
||||
top.ICEcoder.hideFileMenu();
|
||||
},
|
||||
|
||||
// Paste a file on demand
|
||||
pasteFile: function(location) {
|
||||
top.ICEcoder.serverQueue("add","lib/file-control.php?action=paste&file="+top.ICEcoder.copiedFile+"&location="+location);
|
||||
top.ICEcoder.serverMessage('<b>Pasting File</b><br>'+top.ICEcoder.copiedFile.toString().replace(/\|/g,"/").replace(/,/g,"\n"));
|
||||
},
|
||||
|
||||
// Show menu on right clicking in file manager
|
||||
showMenu: function() {
|
||||
var menuType, folderMenuItems;
|
||||
@@ -617,6 +633,11 @@ var ICEcoder = {
|
||||
document.getElementById('fileMenu').style.display='inline-block';
|
||||
},
|
||||
|
||||
// Continue to show the file manager
|
||||
hideFileMenu: function() {
|
||||
document.getElementById('fileMenu').style.display='none';
|
||||
},
|
||||
|
||||
// Update the file manager tree list on demand
|
||||
updateFileManagerList: function(action,location,file,perms,oldName) {
|
||||
var actionElemType, cssStyle, perms, targetElem, locNest, newText, innerLI, newUL, newLI, elemType, nameLI, shortURL, newMouseOver;
|
||||
@@ -731,9 +752,9 @@ var ICEcoder = {
|
||||
top.ICEcoder.thisFileFolderType='file';
|
||||
top.ICEcoder.openFile();
|
||||
}
|
||||
if (action=="newFile") {top.ICEcoder.newFile();}
|
||||
if (action=="newFolder") {top.ICEcoder.newFolder();}
|
||||
if (action=="rename") {top.ICEcoder.renameFile(top.ICEcoder.rightClickedFile);}
|
||||
else if (action=="newFile") {top.ICEcoder.newFile();}
|
||||
else if (action=="newFolder") {top.ICEcoder.newFolder();}
|
||||
else if (action=="rename") {top.ICEcoder.renameFile(top.ICEcoder.rightClickedFile);}
|
||||
}
|
||||
|
||||
if (action=="delete" && ICEcoder.selectedFiles.length>0) {
|
||||
@@ -782,27 +803,27 @@ var ICEcoder = {
|
||||
var find, replace, results, cM, content, lineCount, numChars, charsToCursor, charCount, cursor, replaceQS, targetQS;
|
||||
|
||||
// Determine our find & replace strings and the length of them
|
||||
find = top.document.getElementById('find').value;
|
||||
replace = top.document.getElementById('replace').value;
|
||||
find = top.document.getElementById('find').value.toLowerCase();
|
||||
replace = top.document.getElementById('replace').value.toLowerCase();
|
||||
results = top.document.getElementById('results');
|
||||
|
||||
// If we have something to find in currrent document
|
||||
if (find.length>0 && document.findAndReplace.target.value=="this document") {
|
||||
cM = ICEcoder.getcMInstance();
|
||||
content = cM.getValue();
|
||||
content = cM.getValue().toLowerCase();
|
||||
|
||||
// Find & replace the next instance, or all?
|
||||
if (document.findAndReplace.connector.value=="and") {
|
||||
if (document.findAndReplace.replaceAction.value=="replace" && cM.getSelection()==find) {
|
||||
if (document.findAndReplace.replaceAction.value=="replace" && cM.getSelection().toLowerCase()==find) {
|
||||
cM.replaceSelection(replace);
|
||||
} else if (document.findAndReplace.replaceAction.value=="replace all" && buttonClick) {
|
||||
var rExp = new RegExp(find,"g");
|
||||
var rExp = new RegExp(find,"gi");
|
||||
cM.setValue(cM.getValue().replace(rExp,replace));
|
||||
}
|
||||
}
|
||||
|
||||
// Get the content again, as it might of changed
|
||||
content = cM.getValue();
|
||||
content = cM.getValue().toLowerCase();
|
||||
if (!top.ICEcoder.findMode||find!=top.ICEcoder.lastsearch) {
|
||||
ICEcoder.results = [];
|
||||
|
||||
@@ -858,10 +879,10 @@ var ICEcoder = {
|
||||
charCount++;
|
||||
}
|
||||
|
||||
cursor = cM.getSearchCursor(find,cM.getCursor());
|
||||
cursor = cM.getSearchCursor(find,cM.getCursor(),true);
|
||||
cursor.findNext();
|
||||
if (!cursor.from()) {
|
||||
cursor = cM.getSearchCursor(find,{line:0,ch:0});
|
||||
cursor = cM.getSearchCursor(find,{line:0,ch:0},true);
|
||||
cursor.findNext();
|
||||
}
|
||||
// Finally, highlight our selection
|
||||
@@ -877,16 +898,24 @@ var ICEcoder = {
|
||||
if (find != "" && buttonClick) {
|
||||
replaceQS = "";
|
||||
targetQS = "";
|
||||
filesQS = "";
|
||||
if (document.findAndReplace.connector.value=="and") {
|
||||
replaceQS = "&replace="+replace;
|
||||
}
|
||||
if (document.findAndReplace.target.value.indexOf("file")>=0) {
|
||||
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 != encodeURIComponent(find) ? find = 'ICEcoder:'+encodeURIComponent(find) : find;
|
||||
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>';
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -913,7 +942,9 @@ var ICEcoder = {
|
||||
if ("undefined" != typeof state.curState) {
|
||||
ICEcoder.htmlTagArray = [];
|
||||
for (cx = state.curState.context; cx; cx = cx.prev) {
|
||||
ICEcoder.htmlTagArray.unshift(cx.tagName);
|
||||
if ("undefined" != typeof cx.tagName) {
|
||||
ICEcoder.htmlTagArray.unshift(cx.tagName);
|
||||
}
|
||||
}
|
||||
}
|
||||
ICEcoder.tagString = ICEcoder.htmlTagArray[ICEcoder.htmlTagArray.length-1];
|
||||
@@ -933,8 +964,11 @@ var ICEcoder = {
|
||||
|
||||
// Then for all the array items, output as the nest display
|
||||
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<ICEcoder.htmlTagArray.length-1) {ICEcoder.nestDisplay.innerHTML += " > "};
|
||||
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>'};
|
||||
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>';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -988,34 +1022,35 @@ var ICEcoder = {
|
||||
cM = ICEcoder.getcMInstance();
|
||||
caretLocType = "Unknown";
|
||||
caretChunk = cM.getValue().substr(0,ICEcoder.caretPos+1);
|
||||
if (caretChunk.lastIndexOf("<script")>caretChunk.lastIndexOf("</script>")&&caretLocType=="Unknown") {caretLocType = "JavaScript"};
|
||||
if (caretChunk.lastIndexOf("<?")>caretChunk.lastIndexOf("?>")&&caretLocType=="Unknown") {caretLocType = "PHP"};
|
||||
if (caretChunk.lastIndexOf("<%")>caretChunk.lastIndexOf("%>")&&caretLocType=="Unknown") {caretLocType = "Ruby"};
|
||||
if (caretChunk.lastIndexOf("<")>caretChunk.lastIndexOf(">")&&caretLocType=="Unknown") {caretLocType = "HTML"};
|
||||
if (caretLocType=="Unknown") {caretLocType = "Content"};
|
||||
if (caretChunk.lastIndexOf("<script")>caretChunk.lastIndexOf("</script>")&&caretLocType=="Unknown") {caretLocType = "JavaScript"}
|
||||
else if (caretChunk.lastIndexOf("<?")>caretChunk.lastIndexOf("?>")&&caretLocType=="Unknown") {caretLocType = "PHP"}
|
||||
else if (caretChunk.lastIndexOf("<%")>caretChunk.lastIndexOf("%>")&&caretLocType=="Unknown") {caretLocType = "Ruby"}
|
||||
else if (caretChunk.lastIndexOf("<")>caretChunk.lastIndexOf(">")&&caretLocType=="Unknown") {caretLocType = "HTML"}
|
||||
else if (caretLocType=="Unknown") {caretLocType = "Content"};
|
||||
|
||||
fileName = ICEcoder.openFiles[ICEcoder.selectedTab-1];
|
||||
if (fileName.indexOf(".js")>0) {caretLocType="JavaScript"};
|
||||
if (fileName.indexOf(".coffee")>0) {caretLocType="CoffeeScript"};
|
||||
if (fileName.indexOf(".rb")>0) {caretLocType="Ruby"};
|
||||
if (fileName.indexOf(".css")>0) {caretLocType="CSS"};
|
||||
if (fileName.indexOf(".less")>0) {caretLocType="LESS"};
|
||||
if (fileName.indexOf(".js")>0) {caretLocType="JavaScript"}
|
||||
else if (fileName.indexOf(".coffee")>0) {caretLocType="CoffeeScript"}
|
||||
else if (fileName.indexOf(".rb")>0) {caretLocType="Ruby"}
|
||||
else if (fileName.indexOf(".css")>0) {caretLocType="CSS"}
|
||||
else if (fileName.indexOf(".less")>0) {caretLocType="LESS"};
|
||||
|
||||
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
|
||||
redoChangedContent: function(evt) {
|
||||
var cM;
|
||||
var cM, key;
|
||||
|
||||
cM = ICEcoder.getcMInstance();
|
||||
ICEcoder.changedContent[ICEcoder.selectedTab-1] = cM.historySize().undo > 0 ? 1 : 0;
|
||||
ICEcoder.redoTabHighlight(ICEcoder.selectedTab);
|
||||
key = evt.keyCode ? evt.keyCode : evt.which ? evt.which : evt.charCode;
|
||||
// Exclude a few keys...
|
||||
// Escape (27), Caps Lock (20), Shift, CTRL, Alt, Pause/Break (16-19), Left, Up, Right, Down (37-40), Num Lock, Scroll Lock (144-145),
|
||||
// Insert, Delete (45,46), Page Up, Page Down, End, Home (33-36), Left Win Key, Right Win Key (91-92), F1-F12 (112-123)
|
||||
if (key!=27 && key!=20 && (key<16||key>19) && (key<37||key>40) && (key!=144||key!=145) && (key!=45||key!=46) && (key<33||key>36) && (key!=91||key!=92) && (key<112||key>123)) {
|
||||
ICEcoder.changedContent[ICEcoder.selectedTab-1] = cM.historySize().undo > 0 ? 1 : 0;
|
||||
ICEcoder.redoTabHighlight(ICEcoder.selectedTab);
|
||||
}
|
||||
},
|
||||
|
||||
// Show & hide target element
|
||||
@@ -1035,7 +1070,7 @@ var ICEcoder = {
|
||||
|
||||
// Get the mouse position on demand
|
||||
getMouseXY: function(e,area) {
|
||||
var tempX, tempY, scrollTop, winW;
|
||||
var tempX, tempY, scrollTop;
|
||||
|
||||
top.ICEcoder.mouseX = e.pageX ? e.pageX : e.clientX + document.body.scrollLeft;
|
||||
top.ICEcoder.mouseY = e.pageY ? e.pageY : e.clientY + document.body.scrollTop;
|
||||
@@ -1046,8 +1081,6 @@ var ICEcoder = {
|
||||
if (area=="editor") {
|
||||
top.ICEcoder.mouseX += top.ICEcoder.filesW;
|
||||
}
|
||||
winW = window.innerWidth ? window.innerWidth : document.body.clientWidth;
|
||||
if (top.ICEcoder.mouseX > (winW-20)) {top.ICEcoder.mouseDown=false};
|
||||
top.ICEcoder.dragCursorTest();
|
||||
},
|
||||
|
||||
@@ -1075,7 +1108,12 @@ var ICEcoder = {
|
||||
var serverMessage;
|
||||
|
||||
serverMessage = document.getElementById('serverMessage');
|
||||
if (message) {serverMessage.innerHTML = message};
|
||||
if (message) {
|
||||
serverMessage.innerHTML = message;
|
||||
serverMessage.style.display = "inline-block";
|
||||
} else {
|
||||
setTimeout(function() {serverMessage.style.display = "none"},200);
|
||||
}
|
||||
serverMessage.style.opacity = message ? 1 : 0;
|
||||
},
|
||||
|
||||
@@ -1097,6 +1135,7 @@ var ICEcoder = {
|
||||
newBlock.style.position = "absolute";
|
||||
newBlock.style.display = "block";
|
||||
newBlock.style.width = newBlock.style.height = "20px";
|
||||
newBlock.style.zIndex = "1000";
|
||||
newBlock.style.background = match ? match[0] : '';
|
||||
if (newBlock.style.backgroundColor=="") {newBlock.style.display = "none"};
|
||||
top.document.getElementById('header').appendChild(newBlock);
|
||||
@@ -1122,6 +1161,40 @@ var ICEcoder = {
|
||||
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
|
||||
// ==============
|
||||
@@ -1152,6 +1225,21 @@ var ICEcoder = {
|
||||
top.ICEcoder.codeAssist = !top.ICEcoder.codeAssist;
|
||||
top.ICEcoder.cssColorPreview();
|
||||
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
|
||||
@@ -1177,8 +1265,7 @@ var ICEcoder = {
|
||||
document.body.appendChild(txtArea);
|
||||
document.getElementById('saveTemp'+nextSaveID).value = cM.getValue();
|
||||
}
|
||||
}
|
||||
if (action=="del") {
|
||||
} else if (action=="del") {
|
||||
if (ICEcoder.serverQueueItems[0] && ICEcoder.serverQueueItems[0].indexOf('action=save')>0) {
|
||||
topSaveID = nextSaveID-1;
|
||||
for (var i=1;i<topSaveID;i++) {
|
||||
@@ -1249,7 +1336,7 @@ var ICEcoder = {
|
||||
},
|
||||
|
||||
// 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;
|
||||
|
||||
// Add new stylesheet for selected theme
|
||||
@@ -1278,11 +1365,13 @@ var ICEcoder = {
|
||||
|
||||
cMCSS = ICEcoder.content.contentWindow.document.styleSheets[2];
|
||||
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";
|
||||
|
||||
top.ICEcoder.lineWrapping = lineWrapping;
|
||||
top.ICEcoder.tabWidth = tabWidth;
|
||||
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("tabSize", top.ICEcoder.tabWidth);
|
||||
}
|
||||
@@ -1439,6 +1528,9 @@ var ICEcoder = {
|
||||
top.ICEcoder.findMode = false;
|
||||
ICEcoder.findReplace('find',true,false);
|
||||
|
||||
// Rerun JS Hint
|
||||
if (top.ICEcoder.codeAssist) {top.ICEcoder.updateHints()};
|
||||
|
||||
// Finally, update the cursor display
|
||||
top.ICEcoder.getCaretPosition();
|
||||
top.ICEcoder.updateCharDisplay();
|
||||
@@ -1462,14 +1554,14 @@ var ICEcoder = {
|
||||
cM = ICEcoder.getcMInstance('new');
|
||||
ICEcoder.switchTab(ICEcoder.openFiles.length);
|
||||
|
||||
cM.setLineClass(ICEcoder['cMActiveLine'+ICEcoder.selectedTab], null);
|
||||
ICEcoder['cMActiveLine'+ICEcoder.selectedTab] = cM.setLineClass(0, "cm-s-activeLine");
|
||||
cM.removeLineClass(ICEcoder['cMActiveLine'+ICEcoder.selectedTab], "background");
|
||||
ICEcoder['cMActiveLine'+ICEcoder.selectedTab] = cM.addLineClass(0, "background", "cm-s-activeLine");
|
||||
ICEcoder.nextcMInstance++;
|
||||
},
|
||||
|
||||
// Create a new tab for a file
|
||||
createNewTab: function() {
|
||||
var closeTabLink;
|
||||
var closeTabLink, fileName;
|
||||
|
||||
// Push new file into array
|
||||
top.ICEcoder.openFiles.push(top.ICEcoder.shortURL);
|
||||
@@ -1477,7 +1569,12 @@ var ICEcoder = {
|
||||
// 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>';
|
||||
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;
|
||||
fileName = top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1];
|
||||
top.document.getElementById('tab'+(top.ICEcoder.openFiles.length)).innerHTML = closeTabLink + " " + fileName.slice(fileName.lastIndexOf("/")).replace(/\//,"");
|
||||
top.document.getElementById('tab'+(top.ICEcoder.openFiles.length)).title = top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1].replace(/\//,"") + "/";
|
||||
|
||||
// Set the widths
|
||||
top.ICEcoder.setTabWidths();
|
||||
|
||||
// Highlight it and state it's selected
|
||||
top.ICEcoder.redoTabHighlight(top.ICEcoder.openFiles.length);
|
||||
@@ -1507,14 +1604,16 @@ var ICEcoder = {
|
||||
|
||||
// Create a new tab for a file
|
||||
renameTab: function(tabNum,newName) {
|
||||
var closeTabLink;
|
||||
var closeTabLink, fileName;
|
||||
|
||||
// Push new file into array
|
||||
top.ICEcoder.openFiles[tabNum-1] = newName;
|
||||
|
||||
// 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>';
|
||||
top.document.getElementById('tab'+tabNum).innerHTML = top.ICEcoder.openFiles[tabNum-1] + " " + closeTabLink;
|
||||
fileName = top.ICEcoder.openFiles[tabNum-1];
|
||||
top.document.getElementById('tab'+tabNum).innerHTML = closeTabLink + " " + fileName.slice(fileName.lastIndexOf("/")).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
|
||||
@@ -1555,6 +1654,7 @@ var ICEcoder = {
|
||||
// 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++) {
|
||||
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.openFileMDTs[i-1] = ICEcoder.openFileMDTs[i];
|
||||
|
||||
@@ -1567,6 +1667,7 @@ var ICEcoder = {
|
||||
// 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).innerHTML = "";
|
||||
top.document.getElementById('tab'+ICEcoder.openFiles.length).title = "";
|
||||
ICEcoder.openFiles.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
|
||||
@@ -1594,6 +1695,22 @@ var ICEcoder = {
|
||||
}
|
||||
// Lastly, stop it from trying to also switch tab
|
||||
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";
|
||||
}
|
||||
},
|
||||
|
||||
// ==============
|
||||
@@ -1695,6 +1812,11 @@ var ICEcoder = {
|
||||
top.ICEcoder.ctrlKeyDown = 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)
|
||||
} else if(key==27 && area == "content") {
|
||||
top.ICEcoder.lineCommentToggle();
|
||||
@@ -1718,7 +1840,79 @@ var ICEcoder = {
|
||||
key = evt.keyCode ? evt.keyCode : evt.which ? evt.which : evt.charCode;
|
||||
|
||||
if (key==17) {top.ICEcoder.ctrlKeyDown = false; top.ICEcoder.stickyTabMaybe = false}
|
||||
if (key==16) {top.ICEcoder.shiftKeyDown = false}
|
||||
if (key==46) {top.ICEcoder.delKeyDown = false}
|
||||
else if (key==16) {top.ICEcoder.shiftKeyDown = false}
|
||||
else if (key==46) {top.ICEcoder.delKeyDown = false}
|
||||
},
|
||||
|
||||
// Add snippet panel below line
|
||||
addSnippet: function() {
|
||||
var cM, lineNo, whiteSpace, content;
|
||||
|
||||
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 if (content.slice(0,3)=="for") {
|
||||
top.ICEcoder.doSnippet('for','for (var i=0; i<CURSOR; i++) {\nINDENT\t\nINDENT}');
|
||||
} else {
|
||||
cM.operation(function(){
|
||||
var msg = document.createElement("iframe");
|
||||
msg.src = "lib/snippet-display.php";
|
||||
msg.className = "snippetFrame";
|
||||
top.ICEcoder.snippetLine = cM.addLineWidget(cM.getCursor().line, msg, {coverGutter: false, noHScroll: true});
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// Action a snippet
|
||||
doSnippet: function(tgtString,replaceString) {
|
||||
var cM, lineNo, lineContents, remainder, strPos, replacedLine, whiteSpace, curPos, sPos, lineNoCount;
|
||||
|
||||
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;
|
||||
lineNoCount = lineNo;
|
||||
for (i=0;i<replacedLine.length;i++) {
|
||||
if (replacedLine.indexOf("\n",sPos)<replacedLine.indexOf("CURSOR")) {
|
||||
sPos = replacedLine.indexOf("\n",sPos)+1;
|
||||
lineNoCount = lineNoCount+1;
|
||||
}
|
||||
}
|
||||
cM.setLine(lineNo, replacedLine.replace("CURSOR",""));
|
||||
cM.setCursor(lineNoCount,curPos);
|
||||
cM.focus();
|
||||
top.ICEcoder.removeSnippet();
|
||||
}
|
||||
},
|
||||
|
||||
// Remove snippet panel
|
||||
removeSnippet: function() {
|
||||
var cM;
|
||||
|
||||
cM = ICEcoder.getcMInstance();
|
||||
if (top.ICEcoder.snippetLine!==false) {
|
||||
cM.removeLineWidget(top.ICEcoder.snippetLine);
|
||||
}
|
||||
top.ICEcoder.snippetLine = false;
|
||||
}
|
||||
};
|
||||
@@ -1,191 +1,217 @@
|
||||
<?php include("settings.php");?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> multiple results screen</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<link rel="stylesheet" type="text/css" href="multiple-results.css">
|
||||
</head>
|
||||
|
||||
<body class="results" onLoad="top.document.getElementById('loadingMask').style.visibility = 'hidden'">
|
||||
|
||||
<h1 id="title"></h1>
|
||||
<div class="resultsPane" id="resultsPane">
|
||||
<div id="results"></div>
|
||||
</div>
|
||||
<?php if (isset($_GET['replace'])) { ?>
|
||||
<div class="replaceAll" id="replaceAll" onClick="<?php
|
||||
if (strpos($_GET['target'],"filenames")) {
|
||||
echo 'renameAll()';
|
||||
} else if (strpos($_GET['target'],"files")) {
|
||||
echo 'replaceInFilesAll()';
|
||||
} else {
|
||||
echo 'replaceAll()';
|
||||
}
|
||||
?>" style="opacity: 0.1"><?php echo strpos($_GET['target'],"filenames") ? 'rename all' : 'replace all';?></div>
|
||||
<?php ;}; ?>
|
||||
|
||||
<script>
|
||||
<?php if (!isset($_GET['replace'])) { ?>
|
||||
document.getElementById('resultsPane').style.height = "380px";
|
||||
<?php ;}; ?>
|
||||
var resultsDisplay = "";
|
||||
var foundArray = [];
|
||||
foundInSelected = false;
|
||||
userTarget = top.document.findAndReplace.target.value;
|
||||
findText = top.findAndReplace.find.value;
|
||||
<?php
|
||||
$findText = str_replace("ICEcoder:","",str_replace("'","\'",$_GET['find']));
|
||||
// Find in open docs?
|
||||
if (!isset($_GET['target'])) {
|
||||
$targetName = "document";
|
||||
?>
|
||||
var startTab = top.ICEcoder.selectedTab;
|
||||
var rExp = new RegExp(findText,"g");
|
||||
for (var i=1;i<=top.ICEcoder.openFiles.length;i++) {
|
||||
top.ICEcoder.switchTab(i);
|
||||
var cM = top.ICEcoder.getcMInstance();
|
||||
var content = cM.getValue();
|
||||
if (content.match(rExp)) {
|
||||
resultsDisplay += '<a href="javascript:gotoTab('+i+')">'+ top.ICEcoder.openFiles[i-1]+ '</a><br><div id="foundCount'+i+'">Found '+content.match(rExp).length+' times</div>';
|
||||
<?php if (isset($_GET['replace'])) { ?>
|
||||
resultsDisplay += '<div class="replace" id="replace" onClick="replaceSingle('+i+');this.style.display=\'none\'">replace</div>';
|
||||
<?php ;}; ?>
|
||||
resultsDisplay += '<hr>';
|
||||
foundArray.push(i);
|
||||
}
|
||||
}
|
||||
if (startTab!=top.ICEcoder.selectedTab) {
|
||||
top.ICEcoder.switchTab(startTab);
|
||||
}
|
||||
<?php
|
||||
// Find in files or filenames
|
||||
} else {
|
||||
if (strpos($_GET['target'],"filenames")>0) {
|
||||
$targetName = "file/folder";
|
||||
?>
|
||||
var spansArray = top.ICEcoder.filesFrame.contentWindow.document.getElementsByTagName('span');
|
||||
for (var i=0;i<spansArray.length;i++) {
|
||||
targetURL = spansArray[i].id.replace(/\|/g,"/");
|
||||
if (targetURL.indexOf(findText)>-1 && targetURL.indexOf('_perms')>-1) {
|
||||
if (userTarget.indexOf("selected")>-1) {
|
||||
for (var j=0;j<top.ICEcoder.selectedFiles.length;j++) {
|
||||
if (top.ICEcoder.selectedFiles[j].indexOf(targetURL.replace(/\//g,"|").replace(/_perms/g,""))>-1) {
|
||||
foundInSelected = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
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\'))">'+ targetURL.replace(/\|/g,"/").replace(/_perms/g,"").replace(/<?php echo str_replace("/","\/",$findText); ?>/g,"<b>"+findText+"</b>")+ '</a><br><div id="foundCount'+i+'">'+spansArray[i].innerHTML+', rename to '+targetURL.replace(/\|/g,"/").replace(/_perms/g,"").replace(/<?php echo str_replace("/","\/",$findText); ?>/g,"<b><?php if(isset($_GET['replace'])) {echo strClean($_GET['replace']);};?></b>")+'</div>';
|
||||
<?php if (isset($_GET['replace'])) { ?>
|
||||
resultsDisplay += '<div class="replace" id="replace" onClick="renameSingle('+i+');this.style.display=\'none\'">rename</div>';
|
||||
<?php ;}; ?>
|
||||
resultsDisplay += '<hr>';
|
||||
foundArray.push(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
<?php
|
||||
} else {
|
||||
$targetName = "file";
|
||||
$r = 0;
|
||||
function phpGrep($q, $path, $base) {
|
||||
$fp = opendir($path);
|
||||
global $r;
|
||||
global $ICEcoder;
|
||||
global $serverType;
|
||||
if (!isset($ret)) {$ret="";};
|
||||
$slash = $serverType == "Windows" ? "\\" : "/";
|
||||
while($f = readdir($fp)) {
|
||||
if(preg_match("#^\.+$#", $f)) continue;
|
||||
$fullPath = $path.$slash.$f;
|
||||
if(is_dir($fullPath)) {
|
||||
$ret .= phpGrep($q, $fullPath, $base);
|
||||
} else if(stristr(file_get_contents($fullPath), $q)) {
|
||||
$bFile = false;
|
||||
for ($i=0;$i<count($ICEcoder['bannedFiles']);$i++) {
|
||||
if (strpos($f,$ICEcoder['bannedFiles'][$i])>0) {$bFile = true;};
|
||||
}
|
||||
if (!$bFile) {
|
||||
$ret .= "<a href=\\\"javascript:top.ICEcoder.openFile('".$fullPath."');top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'))\\\">";
|
||||
$ret .= str_replace($base,"",$fullPath)."</a><div id=\\\"foundCount".$r."\\\">Found ".substr_count(strtolower(file_get_contents($fullPath)),$q)." times</div>";
|
||||
if (isset($_GET['replace'])) {
|
||||
$ret .= "<div class=\\\"replace\\\" id=\\\"replace\\\" onClick=\\\"replaceInFileSingle('".$fullPath."');this.style.display=\'none\'\\\">replace</div>";
|
||||
};
|
||||
$ret .= '<hr>';
|
||||
echo 'foundArray.push("'.$fullPath.'");';
|
||||
$r++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
$results = phpGrep($findText, $docRoot.$iceRoot, $docRoot.$iceRoot);
|
||||
echo 'resultsDisplay += "'.$results.'";';
|
||||
?>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
showHide = foundArray.length==0 ? "hide" : "show";
|
||||
top.ICEcoder.showHide(showHide,top.document.getElementById('blackMask'));
|
||||
if (foundArray.length==0) {top.ICEcoder.message('No matches found')};
|
||||
<?php if (isset($_GET['replace'])) { ?>
|
||||
if (foundArray.length!=0) {document.getElementById('replaceAll').style.opacity = 1};
|
||||
<?php ;}; ?>
|
||||
plural = foundArray.length >= 2 ? "s" : "";
|
||||
targetName = "<?php echo $targetName;?>";
|
||||
selectedText = foundInSelected ? "selected " : "";
|
||||
document.getElementById('title').innerHTML = findText.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/"/g,""").replace(/'/g,"'")+" found in "+foundArray.length+" "+selectedText+targetName+plural;
|
||||
document.getElementById('results').innerHTML = resultsDisplay;
|
||||
|
||||
var gotoTab = function(tab) {
|
||||
top.ICEcoder.switchTab(tab);
|
||||
top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'));
|
||||
}
|
||||
|
||||
var replaceSingle = function(tab) {
|
||||
top.ICEcoder.switchTab(tab);
|
||||
cM = top.ICEcoder.getcMInstance();
|
||||
content = cM.getValue();
|
||||
cM.setValue(cM.getValue().replace(rExp,top.document.getElementById('replace').value));
|
||||
document.getElementById('foundCount'+tab).innerHTML = document.getElementById('foundCount'+tab).innerHTML.replace('Found','Replaced');
|
||||
}
|
||||
|
||||
var replaceAll = function() {
|
||||
for (var i=0;i<=foundArray.length-1;i++) {
|
||||
replaceSingle(foundArray[i]);
|
||||
}
|
||||
top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'));
|
||||
}
|
||||
|
||||
var replaceInFileSingle = function(fileRef) {
|
||||
top.ICEcoder.replaceInFile(fileRef,findText,'<?php if(isset($_GET['replace'])) {echo strClean($_GET['replace']);}; ?>');
|
||||
}
|
||||
|
||||
var replaceInFilesAll = function() {
|
||||
for (var i=0;i<=foundArray.length-1;i++) {
|
||||
replaceInFileSingle(foundArray[i]);
|
||||
}
|
||||
top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'));
|
||||
}
|
||||
|
||||
var renameSingle = function(arrayRef) {
|
||||
fileRef = spansArray[arrayRef].id.replace(/\|/g,"/").replace(/_perms/g,"");
|
||||
newName = spansArray[arrayRef].id.replace(/\|/g,"/").replace(/_perms/g,"").replace(find,"<?php if(isset($_GET['replace'])) {echo strClean($_GET['replace']);}; ?>");
|
||||
top.ICEcoder.renameFile(fileRef,newName);
|
||||
}
|
||||
|
||||
var renameAll = function() {
|
||||
for (var i=0;i<=foundArray.length-1;i++) {
|
||||
renameSingle(foundArray[i]);
|
||||
}
|
||||
top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'));
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
<?php include("settings.php");?>
|
||||
<?php
|
||||
if(isset($_GET['selectedFiles'])) {
|
||||
$selectedFiles=explode(":",strClean($_GET['selectedFiles']));
|
||||
echo $selectedFiles[0].".....".$selectedFiles[1];
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> multiple results screen</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="multiple-results.css">
|
||||
</head>
|
||||
|
||||
<body class="results" onLoad="top.document.getElementById('loadingMask').style.visibility = 'hidden'">
|
||||
|
||||
<h1 id="title"></h1>
|
||||
<div class="resultsPane" id="resultsPane">
|
||||
<div id="results"></div>
|
||||
</div>
|
||||
<?php if (isset($_GET['replace'])) { ?>
|
||||
<div class="replaceAll" id="replaceAll" onClick="<?php
|
||||
if (isset($_GET['target']) && strpos($_GET['target'],"filenames")) {
|
||||
echo 'renameAll()';
|
||||
} else if (isset($_GET['target']) && strpos($_GET['target'],"files")) {
|
||||
echo 'replaceInFilesAll()';
|
||||
} else {
|
||||
echo 'replaceAll()';
|
||||
}
|
||||
?>" style="opacity: 0.1"><?php echo isset($_GET['target']) && strpos($_GET['target'],"filenames") ? 'rename all' : 'replace all';?></div>
|
||||
<?php ;}; ?>
|
||||
|
||||
<script>
|
||||
<?php if (!isset($_GET['replace'])) { ?>
|
||||
document.getElementById('resultsPane').style.height = "380px";
|
||||
<?php ;}; ?>
|
||||
var resultsDisplay = "";
|
||||
var foundArray = [];
|
||||
foundInSelected = false;
|
||||
userTarget = top.document.findAndReplace.target.value;
|
||||
findText = top.findAndReplace.find.value.toLowerCase();
|
||||
<?php
|
||||
$findText = str_replace("ICEcoder:","",str_replace("'","\'",$_GET['find']));
|
||||
// Find in open docs?
|
||||
if (!isset($_GET['target'])) {
|
||||
$targetName = "document";
|
||||
?>
|
||||
var startTab = top.ICEcoder.selectedTab;
|
||||
var rExp = new RegExp(findText,"gi");
|
||||
for (var i=1;i<=top.ICEcoder.openFiles.length;i++) {
|
||||
top.ICEcoder.switchTab(i);
|
||||
var cM = top.ICEcoder.getcMInstance();
|
||||
var content = cM.getValue();
|
||||
if (content.match(rExp)) {
|
||||
resultsDisplay += '<a href="javascript:gotoTab('+i+')">'+ top.ICEcoder.openFiles[i-1]+ '</a><br><div id="foundCount'+i+'">Found '+content.match(rExp).length+' times</div>';
|
||||
<?php if (isset($_GET['replace'])) { ?>
|
||||
resultsDisplay += '<div class="replace" id="replace" onClick="replaceSingle('+i+');this.style.display=\'none\'">replace</div>';
|
||||
<?php ;}; ?>
|
||||
resultsDisplay += '<hr>';
|
||||
foundArray.push(i);
|
||||
}
|
||||
}
|
||||
if (startTab!=top.ICEcoder.selectedTab) {
|
||||
top.ICEcoder.switchTab(startTab);
|
||||
}
|
||||
<?php
|
||||
// Find in files or filenames
|
||||
} else {
|
||||
if (strpos($_GET['target'],"filenames")>0) {
|
||||
$targetName = "file/folder";
|
||||
?>
|
||||
var spansArray = top.ICEcoder.filesFrame.contentWindow.document.getElementsByTagName('span');
|
||||
for (var i=0;i<spansArray.length;i++) {
|
||||
foundInSelected = false;
|
||||
targetURL = spansArray[i].id.replace(/\|/g,"/").toLowerCase();
|
||||
if ( targetURL.lastIndexOf(findText.toLowerCase()) > targetURL.lastIndexOf("/")
|
||||
&& targetURL.indexOf(findText.toLowerCase())>-1 && targetURL.indexOf('_perms')>-1) {
|
||||
if (userTarget.indexOf("selected")>-1) {
|
||||
for (var j=0;j<top.ICEcoder.selectedFiles.length;j++) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (userTarget.indexOf("all")>-1 || (userTarget.indexOf("selected")>-1 && foundInSelected)) {
|
||||
resultsDisplay += '<a href="javascript:top.ICEcoder.openFile(\'<?php echo $docRoot;?>'+targetURL.replace(/\|/g,"/").replace(/_perms/g,"")+'\');top.ICEcoder.showHide(\'hide\',top.document.getElementById(\'blackMask\'))">';
|
||||
resultsDisplay += targetURL.replace(/\|/g,"/").replace(/_perms/g,"").replace(/<?php echo str_replace("/","\/",strtolower($findText)); ?>/g,"<b>"+findText.toLowerCase()+"</b>");
|
||||
resultsDisplay += '</a><br>';
|
||||
<?php if (!isset($_GET['replace'])) { ?>
|
||||
resultsDisplay += '<div id="foundCount'+i+'">'+spansArray[i].innerHTML+'</div>';
|
||||
<?php ;} else { ?>
|
||||
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
|
||||
;};
|
||||
if (isset($_GET['replace'])) { ?>
|
||||
resultsDisplay += '<div class="replace" id="replace" onClick="renameSingle('+i+');this.style.display=\'none\'">rename</div>';
|
||||
<?php ;}; ?>
|
||||
resultsDisplay += '<hr>';
|
||||
foundArray.push(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
<?php
|
||||
} else {
|
||||
$targetName = "file";
|
||||
$r = 0;
|
||||
function phpGrep($q, $path, $base) {
|
||||
$fp = opendir($path);
|
||||
global $r, $ICEcoder, $serverType, $selectedFiles;
|
||||
if (!isset($ret)) {$ret="";};
|
||||
$slash = $serverType == "Windows" ? "\\" : "/";
|
||||
while($f = readdir($fp)) {
|
||||
if(preg_match("#^\.+$#", $f)) continue;
|
||||
$fullPath = $path.$slash.$f;
|
||||
if(is_dir($fullPath)) {
|
||||
$ret .= phpGrep($q, $fullPath, $base);
|
||||
} else if(stristr(file_get_contents($fullPath), $q)) {
|
||||
$bFile = false;
|
||||
for ($i=0;$i<count($ICEcoder['bannedFiles']);$i++) {
|
||||
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) {
|
||||
$ret .= "<a href=\\\"javascript:top.ICEcoder.openFile('".$fullPath."');top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'))\\\">";
|
||||
$ret .= str_replace($base,"",$fullPath)."</a><div id=\\\"foundCount".$r."\\\">Found ".substr_count(strtolower(file_get_contents($fullPath)),$q)." times</div>";
|
||||
if (isset($_GET['replace'])) {
|
||||
$ret .= "<div class=\\\"replace\\\" id=\\\"replace\\\" onClick=\\\"replaceInFileSingle('".$fullPath."');this.style.display=\'none\'\\\">replace</div>";
|
||||
};
|
||||
$ret .= '<hr>';
|
||||
echo 'foundArray.push("'.$fullPath.'");';
|
||||
$r++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
$results = phpGrep($findText, $docRoot.$iceRoot, $docRoot.$iceRoot);
|
||||
echo 'resultsDisplay += "'.$results.'";';
|
||||
?>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
showHide = foundArray.length==0 ? "hide" : "show";
|
||||
top.ICEcoder.showHide(showHide,top.document.getElementById('blackMask'));
|
||||
if (foundArray.length==0) {top.ICEcoder.message('No matches found')};
|
||||
<?php if (isset($_GET['replace'])) { ?>
|
||||
if (foundArray.length!=0) {document.getElementById('replaceAll').style.opacity = 1};
|
||||
<?php ;}; ?>
|
||||
plural = foundArray.length >= 2 ? "s" : "";
|
||||
targetName = "<?php echo $targetName;?>";
|
||||
selectedText = foundInSelected ? "selected " : "";
|
||||
document.getElementById('title').innerHTML = findText.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/"/g,""").replace(/'/g,"'")+" found in "+foundArray.length+" "+selectedText+targetName+plural;
|
||||
document.getElementById('results').innerHTML = resultsDisplay;
|
||||
|
||||
var gotoTab = function(tab) {
|
||||
top.ICEcoder.switchTab(tab);
|
||||
top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'));
|
||||
}
|
||||
|
||||
var replaceSingle = function(tab) {
|
||||
top.ICEcoder.switchTab(tab);
|
||||
cM = top.ICEcoder.getcMInstance();
|
||||
content = cM.getValue();
|
||||
cM.setValue(cM.getValue().replace(rExp,top.document.getElementById('replace').value));
|
||||
document.getElementById('foundCount'+tab).innerHTML = document.getElementById('foundCount'+tab).innerHTML.replace('Found','Replaced');
|
||||
}
|
||||
|
||||
var replaceAll = function() {
|
||||
for (var i=0;i<=foundArray.length-1;i++) {
|
||||
replaceSingle(foundArray[i]);
|
||||
}
|
||||
top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'));
|
||||
}
|
||||
|
||||
var replaceInFileSingle = function(fileRef) {
|
||||
top.ICEcoder.replaceInFile(fileRef,findText,'<?php if(isset($_GET['replace'])) {echo strClean($_GET['replace']);}; ?>');
|
||||
}
|
||||
|
||||
var replaceInFilesAll = function() {
|
||||
for (var i=0;i<=foundArray.length-1;i++) {
|
||||
replaceInFileSingle(foundArray[i]);
|
||||
}
|
||||
top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'));
|
||||
}
|
||||
|
||||
var renameSingle = function(arrayRef) {
|
||||
fileRef = spansArray[arrayRef].id.replace(/\|/g,"/").replace(/_perms/g,"");
|
||||
newName = spansArray[arrayRef].id.replace(/\|/g,"/").replace(/_perms/g,"").replace(find,"<?php if(isset($_GET['replace'])) {echo strClean($_GET['replace']);}; ?>");
|
||||
top.ICEcoder.renameFile(fileRef,newName);
|
||||
}
|
||||
|
||||
var renameAll = function() {
|
||||
for (var i=0;i<=foundArray.length-1;i++) {
|
||||
renameSingle(foundArray[i]);
|
||||
}
|
||||
top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'));
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,147 +1,148 @@
|
||||
<?php include("settings.php");?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html onContextMenu="return false">
|
||||
<head>
|
||||
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> file/folder properties</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<link rel="stylesheet" type="text/css" href="properties.css">
|
||||
</head>
|
||||
|
||||
<body class="properties">
|
||||
|
||||
<h1 id="title">properties</h1>
|
||||
|
||||
<?php
|
||||
$fileName=$docRoot.$iceRoot.str_replace("|","/",strClean($_GET['fileName']));
|
||||
?>
|
||||
<h2><?php echo basename($fileName); ?></h2><br>
|
||||
<span class="column" style="width: 180px">Size: <?php
|
||||
$bytes = filesize($fileName);
|
||||
// If it's a dir, get the dir size
|
||||
if (is_dir($fileName)) {
|
||||
$io = popen('/usr/bin/du -sb '.$fileName, 'r');
|
||||
$bytes = intval(fgets($io,80));
|
||||
pclose($io);
|
||||
}
|
||||
// Change into kilobytes
|
||||
$outputSize = ($bytes/1024);
|
||||
$outputUnit = "kb";
|
||||
// Maybe we should show in megabytes?
|
||||
if ($outputSize >= 1024) {
|
||||
$outputSize = ($outputSize/1024);
|
||||
$outputUnit = "mb";
|
||||
}
|
||||
echo number_format($outputSize, 2, '.', '').$outputUnit." (".number_format($bytes)." bytes)";
|
||||
?></span>
|
||||
<span class="column" style="margin: 0 10px">Modified: <?php echo date( "D d M Y g:i:sa", filemtime($fileName)); ?></span>
|
||||
<span class="column">Last access: <?php echo date( "D d M Y g:i:sa", fileatime($fileName)); ?></span>
|
||||
<br><br>
|
||||
<span class="column" style="width: 180px">Type: <?php echo is_dir($fileName) ? "Folder" : "File"; ?></span>
|
||||
<span class="column" style="margin: 0 10px">Readable / Writeable:
|
||||
<?php echo is_readable($fileName) ? "Yes" : "No"; ?> / <?php echo is_writeable($fileName) ? "Yes" : "No";?>
|
||||
</span>
|
||||
<span class="column">Relative path: <?php echo str_replace($docRoot,"",$fileName);?></span>
|
||||
<span style="font-size:10px">
|
||||
<br><br>
|
||||
Absolute path:<br><?php echo $fileName;?>
|
||||
<br><br>
|
||||
</span>
|
||||
<span class="column" style="width: 180px">
|
||||
Permissions:
|
||||
<?php
|
||||
$chmodInfo = substr(sprintf('%o', fileperms($fileName)), -4);
|
||||
echo $chmodInfo;
|
||||
?>
|
||||
</span>
|
||||
<span class="column" style="margin: 0 10px">
|
||||
<?php
|
||||
$perms = str_split(substr($chmodInfo,1,3)); // reduces 0705 down to 705
|
||||
$readVars = array(4,5,6,7);
|
||||
$writeVars = array(2,3,6,7);
|
||||
$execVars = array(1,3,5,7);
|
||||
?>
|
||||
<table>
|
||||
<tr><th>Owner</th><th>Group</th><th>Public</th></tr>
|
||||
<tr>
|
||||
<td><input type="checkbox" name="ownerR" id="owner4"<?php if(in_array($perms[0],$readVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Read</td>
|
||||
<td><input type="checkbox" name="groupR" id="group4"<?php if(in_array($perms[1],$readVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Read</td>
|
||||
<td><input type="checkbox" name="publicR" id="public4"<?php if(in_array($perms[2],$readVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Read</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="checkbox" name="ownerW" id="owner2"<?php if(in_array($perms[0],$writeVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Write</td>
|
||||
<td><input type="checkbox" name="groupW" id="group2"<?php if(in_array($perms[1],$writeVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Write</td>
|
||||
<td><input type="checkbox" name="publicW" id="public2"<?php if(in_array($perms[2],$writeVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Write</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="checkbox" name="ownerE" id="owner1"<?php if(in_array($perms[0],$execVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Execute</td>
|
||||
<td><input type="checkbox" name="groupE" id="group1"<?php if(in_array($perms[1],$execVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Execute</td>
|
||||
<td><input type="checkbox" name="publicE" id="public1"<?php if(in_array($perms[2],$execVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Execute</td>
|
||||
</tr>
|
||||
</table>
|
||||
</span>
|
||||
<span class="column">
|
||||
Change to:<br>
|
||||
<form name="chmod" action="#" method="GET">
|
||||
<input type="text" name="chmod" id="permText" style="width: 30px; border: 0; background-color: #444; font-size: 10px; color: #fff" maxlength="3" value="<?php echo substr($chmodInfo,1,3); ?>" onKeyUp="changePerms(this.value);showButton()" onChange="changePerms(this.value);showButton()">
|
||||
</form>
|
||||
</span>
|
||||
|
||||
<div class="update" id="updateButton" onClick="validatePerms()">update</div>
|
||||
|
||||
<script>
|
||||
readVars = [4,5,6,7];
|
||||
writeVars = [2,3,6,7];
|
||||
execVars = [1,3,5,7];
|
||||
permGroups = ['owner','group','public'];
|
||||
permValues = [4,2,1];
|
||||
permTypes = ['read','write','exec'];
|
||||
|
||||
function changePerms(val) {
|
||||
var permText = document.getElementById('permText').value;
|
||||
// change checkboxes
|
||||
if (val) {
|
||||
// set values
|
||||
if (permText.length==3) {
|
||||
for (var i=0;i<=2;i++) {
|
||||
for (var j=0;j<=2;j++) {
|
||||
document.getElementById(permGroups[i]+permValues[j]).checked = window[permTypes[j]+'Vars'].indexOf(permText.split("")[i]*1)>-1;
|
||||
}
|
||||
}
|
||||
// clear values
|
||||
} else {
|
||||
for (var i=0;i<=2;i++) {
|
||||
for (var j=0;j<=2;j++) {
|
||||
document.getElementById(permGroups[i]+permValues[j]).checked = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
// change text value
|
||||
} else {
|
||||
ownerPerms = (document.getElementById('owner4').checked*4)+(document.getElementById('owner2').checked*2)+(document.getElementById('owner1').checked*1);
|
||||
groupPerms = (document.getElementById('group4').checked*4)+(document.getElementById('group2').checked*2)+(document.getElementById('group1').checked*1);
|
||||
publicPerms = (document.getElementById('public4').checked*4)+(document.getElementById('public2').checked*2)+(document.getElementById('public1').checked*1);
|
||||
document.getElementById('permText').value = ownerPerms.toString() + groupPerms.toString() + publicPerms.toString();
|
||||
}
|
||||
}
|
||||
|
||||
var showButton = function() {
|
||||
document.getElementById('updateButton').style.opacity = 1;
|
||||
}
|
||||
|
||||
var validatePerms = function() {
|
||||
var permText = document.getElementById('permText').value;
|
||||
canUpdate = true;
|
||||
if (permText.length!=3 || isNaN(permText)) {canUpdate = false};
|
||||
if ( permText.split("")[0]*1 <0 || permText.split("")[0]*1 >7 ||
|
||||
permText.split("")[1]*1 <0 || permText.split("")[1]*1 >7 ||
|
||||
permText.split("")[2]*1 <0 || permText.split("")[2]*1 >7) {
|
||||
canUpdate = false;
|
||||
}
|
||||
if (canUpdate) {top.ICEcoder.chmod('<?php echo str_replace($docRoot,"",$fileName);?>',permText)};
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
<?php include("settings.php");?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html onContextMenu="return false">
|
||||
<head>
|
||||
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> file/folder properties</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="properties.css">
|
||||
</head>
|
||||
|
||||
<body class="properties">
|
||||
|
||||
<h1 id="title">properties</h1>
|
||||
|
||||
<?php
|
||||
$fileName=$docRoot.$iceRoot.str_replace("|","/",strClean($_GET['fileName']));
|
||||
?>
|
||||
<h2><?php echo basename($fileName); ?></h2><br>
|
||||
<span class="column" style="width: 180px">Size: <?php
|
||||
$bytes = filesize($fileName);
|
||||
// If it's a dir, get the dir size
|
||||
if (is_dir($fileName)) {
|
||||
$io = popen('/usr/bin/du -sb '.$fileName, 'r');
|
||||
$bytes = intval(fgets($io,80));
|
||||
pclose($io);
|
||||
}
|
||||
// Change into kilobytes
|
||||
$outputSize = ($bytes/1024);
|
||||
$outputUnit = "kb";
|
||||
// Maybe we should show in megabytes?
|
||||
if ($outputSize >= 1024) {
|
||||
$outputSize = ($outputSize/1024);
|
||||
$outputUnit = "mb";
|
||||
}
|
||||
echo number_format($outputSize, 2, '.', '').$outputUnit." (".number_format($bytes)." bytes)";
|
||||
?></span>
|
||||
<span class="column" style="margin: 0 10px">Modified: <?php echo date( "D d M Y g:i:sa", filemtime($fileName)); ?></span>
|
||||
<span class="column">Last access: <?php echo date( "D d M Y g:i:sa", fileatime($fileName)); ?></span>
|
||||
<br><br>
|
||||
<span class="column" style="width: 180px">Type: <?php echo is_dir($fileName) ? "Folder" : "File"; ?></span>
|
||||
<span class="column" style="margin: 0 10px">Readable / Writeable:
|
||||
<?php echo is_readable($fileName) ? "Yes" : "No"; ?> / <?php echo is_writeable($fileName) ? "Yes" : "No";?>
|
||||
</span>
|
||||
<span class="column">Relative path: <?php echo str_replace($docRoot,"",$fileName);?></span>
|
||||
<span style="font-size:10px">
|
||||
<br><br>
|
||||
Absolute path:<br><?php echo $fileName;?>
|
||||
<br><br>
|
||||
</span>
|
||||
<span class="column" style="width: 180px">
|
||||
Permissions:
|
||||
<?php
|
||||
$chmodInfo = substr(sprintf('%o', fileperms($fileName)), -4);
|
||||
echo $chmodInfo;
|
||||
?>
|
||||
</span>
|
||||
<span class="column" style="margin: 0 10px">
|
||||
<?php
|
||||
$perms = str_split(substr($chmodInfo,1,3)); // reduces 0705 down to 705
|
||||
$readVars = array(4,5,6,7);
|
||||
$writeVars = array(2,3,6,7);
|
||||
$execVars = array(1,3,5,7);
|
||||
?>
|
||||
<table>
|
||||
<tr><th>Owner</th><th>Group</th><th>Public</th></tr>
|
||||
<tr>
|
||||
<td><input type="checkbox" name="ownerR" id="owner4"<?php if(in_array($perms[0],$readVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Read</td>
|
||||
<td><input type="checkbox" name="groupR" id="group4"<?php if(in_array($perms[1],$readVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Read</td>
|
||||
<td><input type="checkbox" name="publicR" id="public4"<?php if(in_array($perms[2],$readVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Read</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="checkbox" name="ownerW" id="owner2"<?php if(in_array($perms[0],$writeVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Write</td>
|
||||
<td><input type="checkbox" name="groupW" id="group2"<?php if(in_array($perms[1],$writeVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Write</td>
|
||||
<td><input type="checkbox" name="publicW" id="public2"<?php if(in_array($perms[2],$writeVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Write</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="checkbox" name="ownerE" id="owner1"<?php if(in_array($perms[0],$execVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Execute</td>
|
||||
<td><input type="checkbox" name="groupE" id="group1"<?php if(in_array($perms[1],$execVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Execute</td>
|
||||
<td><input type="checkbox" name="publicE" id="public1"<?php if(in_array($perms[2],$execVars)!="") {echo ' checked';};?> onClick="changePerms();showButton()"> Execute</td>
|
||||
</tr>
|
||||
</table>
|
||||
</span>
|
||||
<span class="column">
|
||||
Change to:<br>
|
||||
<form name="chmod" action="#" method="GET">
|
||||
<input type="text" name="chmod" id="permText" style="width: 30px; border: 0; background-color: #444; font-size: 10px; color: #fff" maxlength="3" value="<?php echo substr($chmodInfo,1,3); ?>" onKeyUp="changePerms(this.value);showButton()" onChange="changePerms(this.value);showButton()">
|
||||
</form>
|
||||
</span>
|
||||
|
||||
<div class="update" id="updateButton" onClick="validatePerms()">update</div>
|
||||
|
||||
<script>
|
||||
readVars = [4,5,6,7];
|
||||
writeVars = [2,3,6,7];
|
||||
execVars = [1,3,5,7];
|
||||
permGroups = ['owner','group','public'];
|
||||
permValues = [4,2,1];
|
||||
permTypes = ['read','write','exec'];
|
||||
|
||||
function changePerms(val) {
|
||||
var permText = document.getElementById('permText').value;
|
||||
// change checkboxes
|
||||
if (val) {
|
||||
// set values
|
||||
if (permText.length==3) {
|
||||
for (var i=0;i<=2;i++) {
|
||||
for (var j=0;j<=2;j++) {
|
||||
document.getElementById(permGroups[i]+permValues[j]).checked = window[permTypes[j]+'Vars'].indexOf(permText.split("")[i]*1)>-1;
|
||||
}
|
||||
}
|
||||
// clear values
|
||||
} else {
|
||||
for (var i=0;i<=2;i++) {
|
||||
for (var j=0;j<=2;j++) {
|
||||
document.getElementById(permGroups[i]+permValues[j]).checked = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
// change text value
|
||||
} else {
|
||||
ownerPerms = (document.getElementById('owner4').checked*4)+(document.getElementById('owner2').checked*2)+(document.getElementById('owner1').checked*1);
|
||||
groupPerms = (document.getElementById('group4').checked*4)+(document.getElementById('group2').checked*2)+(document.getElementById('group1').checked*1);
|
||||
publicPerms = (document.getElementById('public4').checked*4)+(document.getElementById('public2').checked*2)+(document.getElementById('public1').checked*1);
|
||||
document.getElementById('permText').value = ownerPerms.toString() + groupPerms.toString() + publicPerms.toString();
|
||||
}
|
||||
}
|
||||
|
||||
var showButton = function() {
|
||||
document.getElementById('updateButton').style.opacity = 1;
|
||||
}
|
||||
|
||||
var validatePerms = function() {
|
||||
var permText = document.getElementById('permText').value;
|
||||
canUpdate = true;
|
||||
if (permText.length!=3 || isNaN(permText)) {canUpdate = false};
|
||||
if ( permText.split("")[0]*1 <0 || permText.split("")[0]*1 >7 ||
|
||||
permText.split("")[1]*1 <0 || permText.split("")[1]*1 >7 ||
|
||||
permText.split("")[2]*1 <0 || permText.split("")[2]*1 >7) {
|
||||
canUpdate = false;
|
||||
}
|
||||
if (canUpdate) {top.ICEcoder.chmod('<?php echo str_replace($docRoot,"",$fileName);?>',permText)};
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,217 +1,227 @@
|
||||
<?php include("settings.php");?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> settings screen</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<link rel="stylesheet" type="text/css" href="settings-screen.css">
|
||||
<link rel="stylesheet" href="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror.css">
|
||||
<script src="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror-compressed.js"></script>
|
||||
|
||||
<style type="text/css">
|
||||
.CodeMirror {position: absolute; width: 0; background-color: #fff; color: #000; font-family: monospace; width: 420px}
|
||||
.CodeMirror-scroll {height: 240px; overflow: hidden}
|
||||
/* Make sure this next one remains the 3rd 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';};?>";}
|
||||
</style>
|
||||
|
||||
<link rel="stylesheet" href="editor.css">
|
||||
<?php
|
||||
$themeArray = array();
|
||||
$handle = opendir('../'.$ICEcoder["codeMirrorDir"].'/theme/');
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file !== "." && $file != "..") {
|
||||
array_push($themeArray,basename($file,".css"));
|
||||
}
|
||||
}
|
||||
sort($themeArray);
|
||||
for ($i=0;$i<count($themeArray);$i++) {
|
||||
echo '<link rel="stylesheet" href="../'.$ICEcoder["codeMirrorDir"].'/theme/'.$themeArray[$i].'.css">'.PHP_EOL;
|
||||
}
|
||||
?>
|
||||
</head>
|
||||
|
||||
<body class="settings">
|
||||
|
||||
<div class="infoPane">
|
||||
<img src="../images/ice-coder.png" class="logo">
|
||||
<div class="version">v <?php echo $ICEcoder["versionNo"];?></div>
|
||||
|
||||
<p>
|
||||
git:<br>
|
||||
<a href="http://github.com/mattpass/ICEcoder" target="_blank">http://github.com/mattpass/ICEcoder</a>
|
||||
<br><br>
|
||||
|
||||
codemirror dir:<br>
|
||||
<?php echo $ICEcoder["codeMirrorDir"]; ?>
|
||||
<br><br>
|
||||
|
||||
codemirror version:<br>
|
||||
<script>
|
||||
document.write(CodeMirror.version);
|
||||
</script>
|
||||
<br><br>
|
||||
|
||||
file manager root:<br>
|
||||
<?php echo $ICEcoder['root'];?>
|
||||
<br><br><br><br>
|
||||
|
||||
<div style="font-size: 10px; line-height: 12px">ICE coder by Matt Pass (<a href="http://www.twitter.com/mattpass" style="font-size: 10px" target="_blank">@mattpass</a>)<br><br>
|
||||
Free to use it for your own purposes, commercial or not, just let me know of any cool uses or customisations. :)<br><br>
|
||||
No warranty or liability accepted for anything, all responsibility of use is your own.<br><br>
|
||||
|
||||
Thanks go to the following people who have inspired me to create this and in the odd case, provided feedback or code:<br>
|
||||
<?php
|
||||
$peopleArray = array("marijnjh", "maettig", "wimtibackx", "jakubvrana", "_higg_", "yandle", "davidwalshblog", "kuvos", "mathias", "rem");
|
||||
for ($i=0;$i<count($peopleArray)-1;$i++) {
|
||||
echo '<a href="http://www.twitter.com/'.$peopleArray[$i].'" style="font-size: 10px" target="_blank">@'.$peopleArray[$i].'</a>';
|
||||
if ($i<count($peopleArray)-2) {
|
||||
echo ", ";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<form name="settings" action="settings.php" method="POST">
|
||||
<div class="settingsColumn1">
|
||||
<h1>settings</h1>
|
||||
<h2>functionality</h2>
|
||||
<input type="checkbox" onclick="showButton()" name="tabsIndent" value="true"<?php if($ICEcoder["tabsIndent"]) {echo ' checked';};?>> tab indents selection<br>
|
||||
<input type="checkbox" onclick="showButton()" name="checkUpdates" value="true"<?php if($ICEcoder["checkUpdates"]) {echo ' checked';};?>> check for updates on load<br>
|
||||
<input type="checkbox" onclick="showButton()" name="openLastFiles" value="true"<?php if($ICEcoder["openLastFiles"]) {echo ' checked';};?>> auto open last files on login<br>
|
||||
<br>
|
||||
when finding in files, exclude:<br>
|
||||
<input type="text" onkeydown="showButton()" name="findFilesExclude" value="<?php for($i=0;$i<=count($ICEcoder["findFilesExclude"])-1;$i++) {echo $ICEcoder["findFilesExclude"][$i]; if ($i<count($ICEcoder["findFilesExclude"])-1) {echo ', ';};}; ?>"><br>
|
||||
<br>
|
||||
|
||||
<h2>assisting</h2>
|
||||
<input type="checkbox" onclick="showButton()" name="codeAssist" value="true"<?php if($ICEcoder["codeAssist"]) {echo ' checked';};?>> code assist<br>
|
||||
<input type="checkbox" onclick="showButton();showHideTabs()" name="visibleTabs" value="true"<?php if($ICEcoder["visibleTabs"]) {echo ' checked';};?>> visible tabs<br>
|
||||
<input type="checkbox" onclick="showButton()" name="lockedNav" value="true"<?php if($ICEcoder["lockedNav"]) {echo ' checked';};?>> locked nav<br>
|
||||
<br>
|
||||
|
||||
<h2>security</h2>
|
||||
new password <span style="font-size: 10px; color: #888">8 chars</span><br>
|
||||
<input type="password" name="accountPassword" onkeydown="showButton()"><br>
|
||||
confirm password<br>
|
||||
<input type="password" name="confirmPassword" onkeydown="showButton()"><br>
|
||||
<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="hidden" name="changedFileSettings" value="false">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<div class="settingsColumn2">
|
||||
<h2>plugins</h2>
|
||||
plugins array <span style="font-size: 10px; color: #888">name, img src, style, url, target, setInterval (mins)</span><br>
|
||||
<textarea name="plugins" class="plugins" onkeydown="showButton()"><?php
|
||||
for($i=0;$i<count($ICEcoder["plugins"]);$i++) {
|
||||
echo '"'.implode('",'.PHP_EOL.'"', $ICEcoder["plugins"][$i]).'"';
|
||||
if ($i<count($ICEcoder["plugins"])-1) {
|
||||
echo PHP_EOL."====================".PHP_EOL;
|
||||
}
|
||||
}
|
||||
?></textarea>
|
||||
<br><br>
|
||||
|
||||
<h2>style</h2>
|
||||
theme<br>
|
||||
<select onchange="selectTheme();showButton()" id="select" name="theme">
|
||||
<option<?php if ($ICEcoder["theme"]=="default") {echo ' selected';}; ?>>default</option>
|
||||
<?php
|
||||
for ($i=0;$i<count($themeArray);$i++) {
|
||||
$optionSelected = $ICEcoder["theme"]==$themeArray[$i] ? ' selected' : '';
|
||||
echo '<option'.$optionSelected.'>'.$themeArray[$i].'</option>'.PHP_EOL;
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
<span style="position: absolute; margin: -18px 0 0 30px">
|
||||
tab width <span style="font-size: 10px; color: #888">chars</span><br>
|
||||
<input type="text" name="tabWidth" id="tabWidth" style="width: 30px" onkeydown="showButton()" onkeyup="changeTabWidth()" value="<?php echo $ICEcoder["tabWidth"];?>">
|
||||
</span>
|
||||
<br><br>
|
||||
|
||||
<textarea id="code" name="code">
|
||||
function findSequence(goal) {
|
||||
function find(start,history) {
|
||||
if (start==goal)
|
||||
return history;
|
||||
else if (start>goal)
|
||||
return null;
|
||||
else
|
||||
return find(start+5,"("+history+"+5)") ||
|
||||
find(start*3,"("+history+"*3)");
|
||||
}
|
||||
return find(1,"1");
|
||||
}</textarea>
|
||||
<br>
|
||||
|
||||
<span style="position: absolute; top: 510px">
|
||||
<h2>file manager</h2>
|
||||
root <span style="font-size: 10px; color: #888">slash prefixed</span><br>
|
||||
<input type="text" name="root" style="width: 250px" onkeydown="document.settings.changedFileSettings.value='true';showButton()" value="<?php echo $ICEcoder["root"];?>">
|
||||
</span>
|
||||
|
||||
<script>
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
||||
lineNumbers: true,
|
||||
readOnly: "nocursor",
|
||||
indentUnit: top.ICEcoder.tabWidth,
|
||||
tabSize: top.ICEcoder.tabWidth,
|
||||
mode: "javascript",
|
||||
theme: "<?php echo $ICEcoder["theme"]=="default" ? 'icecoder' : $ICEcoder["theme"];?>"
|
||||
});
|
||||
|
||||
var input = document.getElementById("select");
|
||||
function selectTheme() {
|
||||
var theme = input.options[input.selectedIndex].innerHTML;
|
||||
if (theme=="default") {theme = "icecoder"};
|
||||
editor.setOption("theme", theme);
|
||||
}
|
||||
|
||||
function changeTabWidth() {
|
||||
var tabWidth = document.getElementById("tabWidth").value;
|
||||
editor.setOption("indentUnit", tabWidth);
|
||||
editor.setOption("tabSize", tabWidth);
|
||||
}
|
||||
|
||||
var showButton = function() {
|
||||
document.getElementById('updateButton').style.opacity = 1;
|
||||
}
|
||||
|
||||
var showHideTabs = function() {
|
||||
cMCSS = document.styleSheets[2];
|
||||
cMCSS.rules ? strCSS = 'rules' : strCSS = 'cssRules';
|
||||
document.settings.visibleTabs.checked ? cMCSS[strCSS][2].style['content'] = '"\\21e5"' : cMCSS[strCSS][2].style['content'] = '" "';
|
||||
}
|
||||
|
||||
var validatePasswords = function() {
|
||||
if (document.settings.accountPassword.value != 0 && document.settings.accountPassword.value.length<8) {
|
||||
top.ICEcoder.message('Please use at least 8 chars in the password');
|
||||
} else {
|
||||
if (document.settings.accountPassword.value != document.settings.confirmPassword.value) {
|
||||
top.ICEcoder.message('Sorry, your passwords don\'t match')
|
||||
} else {
|
||||
document.settings.submit();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="update" id="updateButton" onClick="validatePasswords()">update</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</body>
|
||||
|
||||
<?php include("settings.php");?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> settings screen</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="settings-screen.css">
|
||||
<link rel="stylesheet" href="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror.css">
|
||||
<script src="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror-compressed.js"></script>
|
||||
|
||||
<style type="text/css">
|
||||
.CodeMirror {position: absolute; width: 0; background-color: #fff; color: #000; font-family: monospace; width: 420px}
|
||||
.CodeMirror-scroll {height: 240px; overflow: hidden}
|
||||
/* Make sure this next one remains the 3rd 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';};?>";}
|
||||
</style>
|
||||
|
||||
<link rel="stylesheet" href="editor.css">
|
||||
<?php
|
||||
$themeArray = array();
|
||||
$handle = opendir('../'.$ICEcoder["codeMirrorDir"].'/theme/');
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file !== "." && $file != "..") {
|
||||
array_push($themeArray,basename($file,".css"));
|
||||
}
|
||||
}
|
||||
sort($themeArray);
|
||||
for ($i=0;$i<count($themeArray);$i++) {
|
||||
echo '<link rel="stylesheet" href="../'.$ICEcoder["codeMirrorDir"].'/theme/'.$themeArray[$i].'.css">'.PHP_EOL;
|
||||
}
|
||||
?>
|
||||
</head>
|
||||
|
||||
<body class="settings">
|
||||
|
||||
<div class="infoPane">
|
||||
<img src="../images/ice-coder.png" class="logo">
|
||||
<div class="version">v <?php echo $ICEcoder["versionNo"];?></div>
|
||||
|
||||
<p>
|
||||
git:<br>
|
||||
<a href="http://github.com/mattpass/ICEcoder" target="_blank">http://github.com/mattpass/ICEcoder</a>
|
||||
<br><br>
|
||||
|
||||
codemirror dir:<br>
|
||||
<?php echo $ICEcoder["codeMirrorDir"]; ?>
|
||||
<br><br>
|
||||
|
||||
codemirror version:<br>
|
||||
<script>
|
||||
document.write(CodeMirror.version);
|
||||
</script>
|
||||
<br><br>
|
||||
|
||||
file manager root:<br>
|
||||
<?php echo $ICEcoder['root'];?>
|
||||
<br><br><br><br>
|
||||
|
||||
<div style="font-size: 10px; line-height: 12px">ICE coder by Matt Pass (<a href="http://www.twitter.com/mattpass" style="font-size: 10px" target="_blank">@mattpass</a>)<br><br>
|
||||
Free to use it for your own purposes, commercial or not, just let me know of any cool uses or customisations. :)<br><br>
|
||||
No warranty or liability accepted for anything, all responsibility of use is your own.<br><br>
|
||||
|
||||
Thanks go to the following people who have inspired me to create this and in the odd case, provided feedback or code:<br>
|
||||
<?php
|
||||
$peopleArray = array("marijnjh", "maettig", "wimtibackx", "jakubvrana", "_higg_", "yandle", "davidwalshblog", "kuvos", "mathias", "rem");
|
||||
for ($i=0;$i<count($peopleArray)-1;$i++) {
|
||||
echo '<a href="http://www.twitter.com/'.$peopleArray[$i].'" style="font-size: 10px" target="_blank">@'.$peopleArray[$i].'</a>';
|
||||
if ($i<count($peopleArray)-2) {
|
||||
echo ", ";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<form name="settings" action="settings.php" method="POST">
|
||||
<div class="settingsColumn1">
|
||||
<h1>settings</h1>
|
||||
<h2>functionality</h2>
|
||||
<input type="checkbox" onclick="showButton()" name="tabsIndent" value="true"<?php if($ICEcoder["tabsIndent"]) {echo ' checked';};?>> tab indents selection<br>
|
||||
<input type="checkbox" onclick="showButton()" name="checkUpdates" value="true"<?php if($ICEcoder["checkUpdates"]) {echo ' checked';};?>> check for updates on load<br>
|
||||
<input type="checkbox" onclick="showButton()" name="openLastFiles" value="true"<?php if($ICEcoder["openLastFiles"]) {echo ' checked';};?>> auto open last files on login<br>
|
||||
<br>
|
||||
when finding in files, exclude:<br>
|
||||
<input type="text" onkeydown="showButton()" name="findFilesExclude" value="<?php for($i=0;$i<=count($ICEcoder["findFilesExclude"])-1;$i++) {echo $ICEcoder["findFilesExclude"][$i]; if ($i<count($ICEcoder["findFilesExclude"])-1) {echo ', ';};}; ?>"><br>
|
||||
<br>
|
||||
|
||||
<h2>assisting</h2>
|
||||
<input type="checkbox" onclick="showButton()" name="codeAssist" value="true"<?php if($ICEcoder["codeAssist"]) {echo ' checked';};?>> code assist<br>
|
||||
<input type="checkbox" onclick="showButton();showHideTabs()" name="visibleTabs" value="true"<?php if($ICEcoder["visibleTabs"]) {echo ' checked';};?>> visible tabs<br>
|
||||
<input type="checkbox" onclick="showButton()" name="lockedNav" value="true"<?php if($ICEcoder["lockedNav"]) {echo ' checked';};?>> locked nav<br>
|
||||
<br>
|
||||
|
||||
<h2>security</h2>
|
||||
new password <span style="font-size: 10px; color: #888">8 chars</span><br>
|
||||
<input type="password" name="accountPassword" onkeydown="showButton()"><br>
|
||||
confirm password<br>
|
||||
<input type="password" name="confirmPassword" onkeydown="showButton()"><br>
|
||||
<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>
|
||||
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">
|
||||
ip addresses<br>
|
||||
<input type="text" onkeydown="showButton()" name="allowedIPs" value="<?php for($i=0;$i<=count($ICEcoder["allowedIPs"])-1;$i++) {echo $ICEcoder["allowedIPs"][$i]; if ($i<count($ICEcoder["allowedIPs"])-1) {echo ', ';};}; ?>"><br>
|
||||
</div>
|
||||
|
||||
<div class="settingsColumn2">
|
||||
<h2>plugins</h2>
|
||||
plugins array <span style="font-size: 10px; color: #888">name, img src, style, url, target, setInterval (mins)</span><br>
|
||||
<textarea name="plugins" class="plugins" onkeydown="showButton()"><?php
|
||||
for($i=0;$i<count($ICEcoder["plugins"]);$i++) {
|
||||
echo '"'.implode('",'.PHP_EOL.'"', $ICEcoder["plugins"][$i]).'"';
|
||||
if ($i<count($ICEcoder["plugins"])-1) {
|
||||
echo PHP_EOL."====================".PHP_EOL;
|
||||
}
|
||||
}
|
||||
?></textarea>
|
||||
<br><br>
|
||||
|
||||
<h2>style</h2>
|
||||
theme<br>
|
||||
<select onchange="selectTheme();showButton()" id="select" name="theme">
|
||||
<option<?php if ($ICEcoder["theme"]=="default") {echo ' selected';}; ?>>default</option>
|
||||
<?php
|
||||
for ($i=0;$i<count($themeArray);$i++) {
|
||||
$optionSelected = $ICEcoder["theme"]==$themeArray[$i] ? ' selected' : '';
|
||||
echo '<option'.$optionSelected.'>'.$themeArray[$i].'</option>'.PHP_EOL;
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
<span style="position: absolute; margin: -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>
|
||||
<input type="text" name="tabWidth" id="tabWidth" style="width: 30px" onkeydown="showButton()" onkeyup="changeTabWidth()" value="<?php echo $ICEcoder["tabWidth"];?>">
|
||||
</span>
|
||||
<br><br>
|
||||
|
||||
<textarea id="code" name="code">
|
||||
function findSequence(goal) {
|
||||
function find(start,history) {
|
||||
if (start==goal)
|
||||
return history;
|
||||
else if (start>goal)
|
||||
return null;
|
||||
else
|
||||
return find(start+5,"("+history+"+5)") ||
|
||||
find(start*3,"("+history+"*3)");
|
||||
}
|
||||
return find(1,"1");
|
||||
}</textarea>
|
||||
<br>
|
||||
|
||||
<span style="position: absolute; top: 510px">
|
||||
<h2>file manager</h2>
|
||||
root <span style="font-size: 10px; color: #888">slash prefixed</span><br>
|
||||
<input type="text" name="root" style="width: 250px" onkeydown="document.settings.changedFileSettings.value='true';showButton()" value="<?php echo $ICEcoder["root"];?>">
|
||||
</span>
|
||||
|
||||
<script>
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
||||
lineNumbers: true,
|
||||
readOnly: "nocursor",
|
||||
indentUnit: top.ICEcoder.tabWidth,
|
||||
tabSize: top.ICEcoder.tabWidth,
|
||||
mode: "javascript",
|
||||
theme: "<?php echo $ICEcoder["theme"]=="default" ? 'icecoder' : $ICEcoder["theme"];?>"
|
||||
});
|
||||
|
||||
var input = document.getElementById("select");
|
||||
function selectTheme() {
|
||||
var theme = input.options[input.selectedIndex].innerHTML;
|
||||
if (theme=="default") {theme = "icecoder"};
|
||||
editor.setOption("theme", theme);
|
||||
}
|
||||
|
||||
function changeTabWidth() {
|
||||
var tabWidth = document.getElementById("tabWidth").value;
|
||||
editor.setOption("indentUnit", tabWidth);
|
||||
editor.setOption("tabSize", tabWidth);
|
||||
}
|
||||
|
||||
var showButton = function() {
|
||||
document.getElementById('updateButton').style.opacity = 1;
|
||||
}
|
||||
|
||||
var showHideTabs = function() {
|
||||
cMCSS = document.styleSheets[2];
|
||||
cMCSS.rules ? strCSS = 'rules' : strCSS = 'cssRules';
|
||||
document.settings.visibleTabs.checked ? cMCSS[strCSS][2].style['content'] = '"\\21e5"' : cMCSS[strCSS][2].style['content'] = '" "';
|
||||
}
|
||||
|
||||
var validatePasswords = function() {
|
||||
if (document.settings.accountPassword.value != 0 && document.settings.accountPassword.value.length<8) {
|
||||
top.ICEcoder.message('Please use at least 8 chars in the password');
|
||||
} else {
|
||||
if (document.settings.accountPassword.value != document.settings.confirmPassword.value) {
|
||||
top.ICEcoder.message('Sorry, your passwords don\'t match')
|
||||
} else {
|
||||
document.settings.submit();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="update" id="updateButton" onClick="validatePasswords()">update</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,8 +1,13 @@
|
||||
<?php
|
||||
// Display & log all errors
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('log_errors', 1);
|
||||
ini_set('error_log', dirname(__FILE__).'/../error_log.txt');
|
||||
ini_set('error_log', dirname(__FILE__).'/../error-log.txt');
|
||||
error_reporting(-1);
|
||||
|
||||
// Set our default timezone and supress warning with @
|
||||
@date_default_timezone_set(date_default_timezone_get());
|
||||
|
||||
// Start a session if we haven't already
|
||||
if(!isset($_SESSION)) {session_start();}
|
||||
|
||||
@@ -33,15 +38,19 @@ include($settingsFile);
|
||||
|
||||
// Add ICEcoder settings to beginning of $ICEcoder array
|
||||
$ICEcoder = array(
|
||||
"versionNo" => "1.0.0",
|
||||
"codeMirrorDir" => "CodeMirror-2.34"
|
||||
"versionNo" => "1.4",
|
||||
"codeMirrorDir" => "CodeMirror-3.0",
|
||||
"demoMode" => false
|
||||
)+$ICEcoder;
|
||||
|
||||
$onLoadExtras = "";
|
||||
$pluginsDisplay = "";
|
||||
|
||||
if ($ICEcoder['demoMode'] && $ICEcoder['accountPassword']!="") {$_SESSION['loggedIn']=true;};
|
||||
$demoMode = $ICEcoder['demoMode'];
|
||||
|
||||
// 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);
|
||||
// Replace our settings vars
|
||||
$repPosStart = strpos($settingsContents,'"root"');
|
||||
@@ -58,12 +67,14 @@ if (isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset($_POST["theme
|
||||
$ICEcoder["lockedNav"] = isset($_POST['lockedNav']) && $_POST['lockedNav'] ? "true" : "false";
|
||||
if ($_POST['accountPassword']!="") {$ICEcoder["accountPassword"] = generateHash(strClean($_POST['accountPassword']));};
|
||||
$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["plugins"] = 'array('.PHP_EOL.' array('.PHP_EOL.' '.str_replace('====================','),'.PHP_EOL.' array(',$_POST['plugins']).'))';
|
||||
$ICEcoder["theme"] = strClean($_POST['theme']);
|
||||
$ICEcoder["lineWrapping"] = strClean($_POST['lineWrapping']);
|
||||
$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 = "";
|
||||
for ($i=0;$i<count($settingsArray);$i++) {
|
||||
$settingsNew .= '"'.$settingsArray[$i].'"'.PHP_EOL.' => ';
|
||||
@@ -88,7 +99,7 @@ if (isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset($_POST["theme
|
||||
// Do we need a file manager refresh?
|
||||
$refreshFM = $_POST['changedFileSettings']=="true" ? "true" : "false";
|
||||
// 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
|
||||
@@ -129,7 +140,7 @@ if ($_SESSION['loggedIn'] && isset($_GET["saveFiles"]) && $_GET['saveFiles']) {
|
||||
// Replace our previousFiles var with the the current
|
||||
$repPosStart = strpos($settingsContents,'previousFiles" => "')+20;
|
||||
$repPosEnd = strpos($settingsContents,'",',$repPosStart)-$repPosStart;
|
||||
if ($_GET['saveFiles']!="CLEAR") {
|
||||
if (!$demoMode && $_GET['saveFiles']!="CLEAR") {
|
||||
$saveFiles=strClean($_GET['saveFiles']);
|
||||
$saveFilesArray = explode(",",$saveFiles);
|
||||
$saveFiles="";
|
||||
@@ -236,6 +247,8 @@ if (!$_SESSION['loggedIn']) {
|
||||
echo $ICEcoder["versionNo"]." : ";
|
||||
echo $ICEcoder["accountPassword"] == "" ? "Setup" : "Login";
|
||||
?></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="icon" type="image/png" href="../favicon.png">
|
||||
</head>
|
||||
@@ -248,7 +261,7 @@ echo $ICEcoder["accountPassword"] == "" ? "Setup" : "Login";
|
||||
<img src="../images/ice-coder.png">
|
||||
<div class="version">v <?php echo $ICEcoder["versionNo"];?></div>
|
||||
<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">
|
||||
</form>
|
||||
</div>
|
||||
|
||||
28
lib/snippet-display.php
Normal file
28
lib/snippet-display.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php include("lib/settings.php");?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html style="margin: 0">
|
||||
<head>
|
||||
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> snippet display</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<style type="text/css">
|
||||
body {font-family: arial; font-size: 10px; background: #ccc}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body style="margin: 5px">
|
||||
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="500">
|
||||
<tr valign="top"><td style="padding-bottom: 5px; font-size: 11px"><b>abbreviation plus CTRL+space</td><td style="font-size: 11px"><b>produces</b></td></tr>
|
||||
<tr valign="top"><td>f name</td><td style="padding-bottom: 5px">function name() {...}</td></tr>
|
||||
<tr valign="top"><td>if</td><td style="padding-bottom: 5px">if () {...}</td></tr>
|
||||
<tr valign="top"><td>for</td><td style="padding-bottom: 5px">for (var i=0; i<; i++) {...}</td></tr>
|
||||
</table>
|
||||
<br><br>
|
||||
Tip: If you have Emmet installed, also try tab key after your abbreviation
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
304
plugins/emmet/emmet.min.js
vendored
Normal file
304
plugins/emmet/emmet.min.js
vendored
Normal file
@@ -0,0 +1,304 @@
|
||||
var _=function(){function h(a,b,c){if(a===b)return a!==0||1/a==1/b;if(a==null||b==null)return a===b;if(a._chain)a=a._wrapped;if(b._chain)b=b._wrapped;if(a.isEqual&&k.isFunction(a.isEqual))return a.isEqual(b);if(b.isEqual&&k.isFunction(b.isEqual))return b.isEqual(a);var e=g.call(a);if(e!=g.call(b))return!1;switch(e){case "[object String]":return a==String(b);case "[object Number]":return a!=+a?b!=+b:a==0?1/a==1/b:a==+b;case "[object Date]":case "[object Boolean]":return+a==+b;case "[object RegExp]":return a.source==
|
||||
b.source&&a.global==b.global&&a.multiline==b.multiline&&a.ignoreCase==b.ignoreCase}if(typeof a!="object"||typeof b!="object")return!1;for(var d=c.length;d--;)if(c[d]==a)return!0;c.push(a);var d=0,j=!0;if(e=="[object Array]"){if(d=a.length,j=d==b.length)for(;d--;)if(!(j=d in a==d in b&&h(a[d],b[d],c)))break}else{if("constructor"in a!="constructor"in b||a.constructor!=b.constructor)return!1;for(var f in a)if(k.has(a,f)&&(d++,!(j=k.has(b,f)&&h(a[f],b[f],c))))break;if(j){for(f in b)if(k.has(b,f)&&!d--)break;
|
||||
j=!d}}c.pop();return j}var d=this,f=d._,i={},b=Array.prototype,c=Object.prototype,a=b.slice,e=b.unshift,g=c.toString,j=c.hasOwnProperty,l=b.forEach,m=b.map,n=b.reduce,o=b.reduceRight,q=b.filter,s=b.every,r=b.some,u=b.indexOf,p=b.lastIndexOf,c=Array.isArray,v=Object.keys,w=Function.prototype.bind,k=function(a){return new y(a)};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=k;exports._=k}else d._=k;k.VERSION="1.3.3";var t=k.each=k.forEach=function(a,
|
||||
b,c){if(a!=null)if(l&&a.forEach===l)a.forEach(b,c);else if(a.length===+a.length)for(var g=0,e=a.length;g<e;g++){if(g in a&&b.call(c,a[g],g,a)===i)break}else for(g in a)if(k.has(a,g)&&b.call(c,a[g],g,a)===i)break};k.map=k.collect=function(a,b,c){var g=[];if(a==null)return g;if(m&&a.map===m)return a.map(b,c);t(a,function(a,e,d){g[g.length]=b.call(c,a,e,d)});if(a.length===+a.length)g.length=a.length;return g};k.reduce=k.foldl=k.inject=function(a,b,c,g){var e=arguments.length>2;a==null&&(a=[]);if(n&&
|
||||
a.reduce===n)return g&&(b=k.bind(b,g)),e?a.reduce(b,c):a.reduce(b);t(a,function(a,d,j){e?c=b.call(g,c,a,d,j):(c=a,e=!0)});if(!e)throw new TypeError("Reduce of empty array with no initial value");return c};k.reduceRight=k.foldr=function(a,b,c,g){var e=arguments.length>2;a==null&&(a=[]);if(o&&a.reduceRight===o)return g&&(b=k.bind(b,g)),e?a.reduceRight(b,c):a.reduceRight(b);var d=k.toArray(a).reverse();g&&!e&&(b=k.bind(b,g));return e?k.reduce(d,b,c,g):k.reduce(d,b)};k.find=k.detect=function(a,b,c){var g;
|
||||
z(a,function(a,e,d){if(b.call(c,a,e,d))return g=a,!0});return g};k.filter=k.select=function(a,b,c){var g=[];if(a==null)return g;if(q&&a.filter===q)return a.filter(b,c);t(a,function(a,e,d){b.call(c,a,e,d)&&(g[g.length]=a)});return g};k.reject=function(a,b,c){var g=[];if(a==null)return g;t(a,function(a,e,d){b.call(c,a,e,d)||(g[g.length]=a)});return g};k.every=k.all=function(a,b,c){var g=!0;if(a==null)return g;if(s&&a.every===s)return a.every(b,c);t(a,function(a,e,d){if(!(g=g&&b.call(c,a,e,d)))return i});
|
||||
return!!g};var z=k.some=k.any=function(a,b,c){b||(b=k.identity);var g=!1;if(a==null)return g;if(r&&a.some===r)return a.some(b,c);t(a,function(a,e,d){if(g||(g=b.call(c,a,e,d)))return i});return!!g};k.include=k.contains=function(a,b){var c=!1;return a==null?c:u&&a.indexOf===u?a.indexOf(b)!=-1:c=z(a,function(a){return a===b})};k.invoke=function(b,c){var g=a.call(arguments,2);return k.map(b,function(a){return(k.isFunction(c)?c||a:a[c]).apply(a,g)})};k.pluck=function(a,b){return k.map(a,function(a){return a[b]})};
|
||||
k.max=function(a,b,c){if(!b&&k.isArray(a)&&a[0]===+a[0])return Math.max.apply(Math,a);if(!b&&k.isEmpty(a))return-Infinity;var g={computed:-Infinity};t(a,function(a,e,d){e=b?b.call(c,a,e,d):a;e>=g.computed&&(g={value:a,computed:e})});return g.value};k.min=function(a,b,c){if(!b&&k.isArray(a)&&a[0]===+a[0])return Math.min.apply(Math,a);if(!b&&k.isEmpty(a))return Infinity;var g={computed:Infinity};t(a,function(a,e,d){e=b?b.call(c,a,e,d):a;e<g.computed&&(g={value:a,computed:e})});return g.value};k.shuffle=
|
||||
function(a){var b=[],c;t(a,function(a,g){c=Math.floor(Math.random()*(g+1));b[g]=b[c];b[c]=a});return b};k.sortBy=function(a,b,c){var g=k.isFunction(b)?b:function(a){return a[b]};return k.pluck(k.map(a,function(a,b,e){return{value:a,criteria:g.call(c,a,b,e)}}).sort(function(a,b){var c=a.criteria,g=b.criteria;return c===void 0?1:g===void 0?-1:c<g?-1:c>g?1:0}),"value")};k.groupBy=function(a,b){var c={},g=k.isFunction(b)?b:function(a){return a[b]};t(a,function(a,b){var e=g(a,b);(c[e]||(c[e]=[])).push(a)});
|
||||
return c};k.sortedIndex=function(a,b,c){c||(c=k.identity);for(var g=0,e=a.length;g<e;){var d=g+e>>1;c(a[d])<c(b)?g=d+1:e=d}return g};k.toArray=function(b){return!b?[]:k.isArray(b)?a.call(b):k.isArguments(b)?a.call(b):b.toArray&&k.isFunction(b.toArray)?b.toArray():k.values(b)};k.size=function(a){return k.isArray(a)?a.length:k.keys(a).length};k.first=k.head=k.take=function(b,c,g){return c!=null&&!g?a.call(b,0,c):b[0]};k.initial=function(b,c,g){return a.call(b,0,b.length-(c==null||g?1:c))};k.last=function(b,
|
||||
c,g){return c!=null&&!g?a.call(b,Math.max(b.length-c,0)):b[b.length-1]};k.rest=k.tail=function(b,c,g){return a.call(b,c==null||g?1:c)};k.compact=function(a){return k.filter(a,function(a){return!!a})};k.flatten=function(a,b){return k.reduce(a,function(a,c){if(k.isArray(c))return a.concat(b?c:k.flatten(c));a[a.length]=c;return a},[])};k.without=function(b){return k.difference(b,a.call(arguments,1))};k.uniq=k.unique=function(a,b,c){var c=c?k.map(a,c):a,g=[];a.length<3&&(b=!0);k.reduce(c,function(c,e,
|
||||
d){if(b?k.last(c)!==e||!c.length:!k.include(c,e))c.push(e),g.push(a[d]);return c},[]);return g};k.union=function(){return k.uniq(k.flatten(arguments,!0))};k.intersection=k.intersect=function(b){var c=a.call(arguments,1);return k.filter(k.uniq(b),function(a){return k.every(c,function(b){return k.indexOf(b,a)>=0})})};k.difference=function(b){var c=k.flatten(a.call(arguments,1),!0);return k.filter(b,function(a){return!k.include(c,a)})};k.zip=function(){for(var b=a.call(arguments),c=k.max(k.pluck(b,"length")),
|
||||
g=Array(c),e=0;e<c;e++)g[e]=k.pluck(b,""+e);return g};k.indexOf=function(a,b,c){if(a==null)return-1;var g;if(c)return c=k.sortedIndex(a,b),a[c]===b?c:-1;if(u&&a.indexOf===u)return a.indexOf(b);c=0;for(g=a.length;c<g;c++)if(c in a&&a[c]===b)return c;return-1};k.lastIndexOf=function(a,b){if(a==null)return-1;if(p&&a.lastIndexOf===p)return a.lastIndexOf(b);for(var c=a.length;c--;)if(c in a&&a[c]===b)return c;return-1};k.range=function(a,b,c){arguments.length<=1&&(b=a||0,a=0);for(var c=arguments[2]||1,
|
||||
g=Math.max(Math.ceil((b-a)/c),0),e=0,d=Array(g);e<g;)d[e++]=a,a+=c;return d};var x=function(){};k.bind=function(b,c){var g,e;if(b.bind===w&&w)return w.apply(b,a.call(arguments,1));if(!k.isFunction(b))throw new TypeError;e=a.call(arguments,2);return g=function(){if(!(this instanceof g))return b.apply(c,e.concat(a.call(arguments)));x.prototype=b.prototype;var d=new x,j=b.apply(d,e.concat(a.call(arguments)));return Object(j)===j?j:d}};k.bindAll=function(b){var c=a.call(arguments,1);c.length==0&&(c=k.functions(b));
|
||||
t(c,function(a){b[a]=k.bind(b[a],b)});return b};k.memoize=function(a,b){var c={};b||(b=k.identity);return function(){var g=b.apply(this,arguments);return k.has(c,g)?c[g]:c[g]=a.apply(this,arguments)}};k.delay=function(b,c){var g=a.call(arguments,2);return setTimeout(function(){return b.apply(null,g)},c)};k.defer=function(b){return k.delay.apply(k,[b,1].concat(a.call(arguments,1)))};k.throttle=function(a,b){var c,g,e,d,j,f,h=k.debounce(function(){j=d=!1},b);return function(){c=this;g=arguments;var k;
|
||||
e||(e=setTimeout(function(){e=null;j&&a.apply(c,g);h()},b));d?j=!0:f=a.apply(c,g);h();d=!0;return f}};k.debounce=function(a,b,c){var g;return function(){var e=this,d=arguments;c&&!g&&a.apply(e,d);clearTimeout(g);g=setTimeout(function(){g=null;c||a.apply(e,d)},b)}};k.once=function(a){var b=!1,c;return function(){if(b)return c;b=!0;return c=a.apply(this,arguments)}};k.wrap=function(b,c){return function(){var g=[b].concat(a.call(arguments,0));return c.apply(this,g)}};k.compose=function(){var a=arguments;
|
||||
return function(){for(var b=arguments,c=a.length-1;c>=0;c--)b=[a[c].apply(this,b)];return b[0]}};k.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};k.keys=v||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[],c;for(c in a)k.has(a,c)&&(b[b.length]=c);return b};k.values=function(a){return k.map(a,k.identity)};k.functions=k.methods=function(a){var b=[],c;for(c in a)k.isFunction(a[c])&&b.push(c);return b.sort()};k.extend=function(b){t(a.call(arguments,
|
||||
1),function(a){for(var c in a)b[c]=a[c]});return b};k.pick=function(b){var c={};t(k.flatten(a.call(arguments,1)),function(a){a in b&&(c[a]=b[a])});return c};k.defaults=function(b){t(a.call(arguments,1),function(a){for(var c in a)b[c]==null&&(b[c]=a[c])});return b};k.clone=function(a){return!k.isObject(a)?a:k.isArray(a)?a.slice():k.extend({},a)};k.tap=function(a,b){b(a);return a};k.isEqual=function(a,b){return h(a,b,[])};k.isEmpty=function(a){if(a==null)return!0;if(k.isArray(a)||k.isString(a))return a.length===
|
||||
0;for(var b in a)if(k.has(a,b))return!1;return!0};k.isElement=function(a){return!!(a&&a.nodeType==1)};k.isArray=c||function(a){return g.call(a)=="[object Array]"};k.isObject=function(a){return a===Object(a)};k.isArguments=function(a){return g.call(a)=="[object Arguments]"};if(!k.isArguments(arguments))k.isArguments=function(a){return!(!a||!k.has(a,"callee"))};k.isFunction=function(a){return g.call(a)=="[object Function]"};k.isString=function(a){return g.call(a)=="[object String]"};k.isNumber=function(a){return g.call(a)==
|
||||
"[object Number]"};k.isFinite=function(a){return k.isNumber(a)&&isFinite(a)};k.isNaN=function(a){return a!==a};k.isBoolean=function(a){return a===!0||a===!1||g.call(a)=="[object Boolean]"};k.isDate=function(a){return g.call(a)=="[object Date]"};k.isRegExp=function(a){return g.call(a)=="[object RegExp]"};k.isNull=function(a){return a===null};k.isUndefined=function(a){return a===void 0};k.has=function(a,b){return j.call(a,b)};k.noConflict=function(){d._=f;return this};k.identity=function(a){return a};
|
||||
k.times=function(a,b,c){for(var g=0;g<a;g++)b.call(c,g)};k.escape=function(a){return(""+a).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};k.result=function(a,b){if(a==null)return null;var c=a[b];return k.isFunction(c)?c.call(a):c};k.mixin=function(a){t(k.functions(a),function(b){F(b,k[b]=a[b])})};var G=0;k.uniqueId=function(a){var b=G++;return a?a+b:b};k.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,
|
||||
escape:/<%-([\s\S]+?)%>/g};var B=/.^/,A={"\\":"\\","'":"'",r:"\r",n:"\n",t:"\t",u2028:"\u2028",u2029:"\u2029"},C;for(C in A)A[A[C]]=C;var H=/\\|'|\r|\n|\t|\u2028|\u2029/g,I=/\\(\\|'|r|n|t|u2028|u2029)/g,D=function(a){return a.replace(I,function(a,b){return A[b]})};k.template=function(a,b,c){c=k.defaults(c||{},k.templateSettings);a="__p+='"+a.replace(H,function(a){return"\\"+A[a]}).replace(c.escape||B,function(a,b){return"'+\n_.escape("+D(b)+")+\n'"}).replace(c.interpolate||B,function(a,b){return"'+\n("+
|
||||
D(b)+")+\n'"}).replace(c.evaluate||B,function(a,b){return"';\n"+D(b)+"\n;__p+='"})+"';\n";c.variable||(a="with(obj||{}){\n"+a+"}\n");var a="var __p='';var print=function(){__p+=Array.prototype.join.call(arguments, '')};\n"+a+"return __p;\n",g=new Function(c.variable||"obj","_",a);if(b)return g(b,k);b=function(a){return g.call(this,a,k)};b.source="function("+(c.variable||"obj")+"){\n"+a+"}";return b};k.chain=function(a){return k(a).chain()};var y=function(a){this._wrapped=a};k.prototype=y.prototype;
|
||||
var E=function(a,b){return b?k(a).chain():a},F=function(b,c){y.prototype[b]=function(){var b=a.call(arguments);e.call(b,this._wrapped);return E(c.apply(k,b),this._chain)}};k.mixin(k);t(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var c=b[a];y.prototype[a]=function(){var b=this._wrapped;c.apply(b,arguments);var g=b.length;(a=="shift"||a=="splice")&&g===0&&delete b[0];return E(b,this._chain)}});t(["concat","join","slice"],function(a){var c=b[a];y.prototype[a]=function(){return E(c.apply(this._wrapped,
|
||||
arguments),this._chain)}});y.prototype.chain=function(){this._chain=!0;return this};y.prototype.value=function(){return this._wrapped};return k}.call({}),emmet=function(h){function d(a,b,d){var f;f=b&&b.hasOwnProperty("constructor")?b.constructor:function(){a.apply(this,arguments)};_.extend(f,a);c.prototype=a.prototype;f.prototype=new c;b&&_.extend(f.prototype,b);d&&_.extend(f,d);f.prototype.constructor=f;f.__super__=a.prototype;return f}function f(c){!(c in b)&&a&&a(c);return b[c]}if(typeof _=="undefined")try{_=
|
||||
h.require("underscore")}catch(i){}if(typeof _=="undefined")throw"Cannot access to Underscore.js lib";var b={_:_},c=function(){},a=null;return{define:function(a,c){a in b||(b[a]=_.isFunction(c)?this.exec(c):c)},require:f,exec:function(a,b){return a.call(b||h,_.bind(f,this),_,this)},extend:function(a,b){var c=d(this,a,b);c.extend=this.extend;if(a.hasOwnProperty("toString"))c.prototype.toString=a.toString;return c},expandAbbreviation:function(a,b,c,d){if(!a)return"";var b=b||"html",h=f("filters"),i=
|
||||
f("abbreviationParser"),c=f("profile").get(c,b);f("tabStops").resetTabstopIndex();a=h.extractFromAbbreviation(a);d=i.parse(a[0],{syntax:b,contextNode:d});b=h.composeList(b,c,a[1]);h.apply(d,b,c);return d.toString()},defaultSyntax:function(){return"html"},defaultProfile:function(){return"plain"},log:function(){h.console&&h.console.log&&h.console.log.apply(h.console,arguments)},setModuleLoader:function(b){a=b}}}(this);
|
||||
if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=emmet;exports.emmet=emmet}
|
||||
emmet.define("abbreviationParser",function(h,d){function f(){this.parent=null;this.children=[];this._attributes=[];this.abbreviation="";this.counter=1;this._name=null;this._text="";this.repeatCount=1;this.hasImplicitRepeat=!1;this._data={};this.padding=this.content=this.end=this.start=""}function i(a){return a.substring(1,a.length-1)}function b(a){for(var a=h("utils").trim(a),c=new f,g=c.addChild(),e,j=h("stringStream").create(a),a=1E3,l;!j.eol()&&--a>0;)switch(e=j.peek(),e){case "(":j.start=j.pos;
|
||||
if(j.skipToPair("(",")"))e=b(i(j.current())),(l=j.match(/^\*(\d+)?/,!0))&&g._setRepeat(l[1]),d.each(e.children,function(a){g.addChild(a)});else throw'Invalid abbreviation: mo matching ")" found for character at '+j.pos;break;case ">":g=g.addChild();j.next();break;case "+":g=g.parent.addChild();j.next();break;case "^":e=g.parent||g;g=(e.parent||e).addChild();j.next();break;default:j.start=j.pos,j.eatWhile(function(a){if(a=="["||a=="{"){if(j.skipToPair(a,q[a]))return j.backUp(1),!0;throw'Invalid abbreviation: mo matching "'+
|
||||
q[a]+'" found for character at '+j.pos;}return a=="+"?(j.next(),a=j.eol()||~"+>^*".indexOf(j.peek()),j.backUp(1),a):a!="("&&m(a)}),g.setAbbreviation(j.current()),j.start=j.pos}if(a<1)throw"Endless loop detected";return c}function c(a){var a=h("utils").trim(a),b=[],a=h("stringStream").create(a);for(a.eatSpace();!a.eol();)if(a.start=a.pos,a.eatWhile(o)){var c=a.current(),g="";if(a.peek()=="="){a.next();a.start=a.pos;var e=a.peek();if(e=='"'||e=="'"){a.next();a:{for(var g=a,d=void 0;d=g.next();)if(d===
|
||||
e){g=!0;break a}g=!1}if(g)g=a.current(),g=g.substring(1,g.length-1);else throw"Invalid attribute value";}else if(a.eatWhile(/[^\s\]]/))g=a.current();else throw"Invalid attribute value";}b.push({name:c,value:g});a.eatSpace()}else break;return b}function a(a){for(var b=[],g={"#":"id",".":"class"},d=null,j=h("stringStream").create(a);!j.eol();)switch(j.peek()){case "#":case ".":if(d===null)d=j.pos;var f=g[j.peek()];j.next();j.start=j.pos;j.eatWhile(o);b.push({name:f,value:j.current()});break;case "[":if(d===
|
||||
null)d=j.pos;j.start=j.pos;if(!j.skipToPair("[","]"))throw"Invalid attribute set definition";b=b.concat(c(i(j.current())));break;default:j.next()}return!b.length?null:{element:a.substring(0,d),attributes:e(b)}}function e(a){var a=d.map(a,function(a){return d.clone(a)}),b={};return d.filter(a,function(a){if(!(a.name in b))return b[a.name]=a;var c=b[a.name];a.name.toLowerCase()=="class"?c.value+=(c.value.length?" ":"")+a.value:c.value=a.value;return!1})}function g(a){if(!~a.indexOf("{"))return null;
|
||||
for(var b=h("stringStream").create(a);!b.eol();)switch(b.peek()){case "[":case "(":b.skipToPair(b.peek(),q[b.peek()]);break;case "{":return b.start=b.pos,b.skipToPair("{","}"),{element:a.substring(0,b.start),text:i(b.current())};default:b.next()}}function j(a){for(var b=a.children.length-1,c,g;b>=0;b--)if(g=a.children[b],g.isRepeating()){c=g.repeatCount;g.repeatCount=1;for(g.updateProperty("counter",1);--c>0;)g.parent.addChild(g.clone(),b+1).updateProperty("counter",c+1)}d.each(a.children,j);return a}
|
||||
function l(a){for(var b=a.children.length-1;b>=0;b--){var c=a.children[b];c.isGroup()?c.replace(l(c).children):c.isEmpty()&&c.remove()}d.each(a.children,l);return a}function m(a){var b=a.charCodeAt(0);return b>64&&b<91||b>96&&b<123||b>47&&b<58||"#.*:$-_!@|%".indexOf(a)!=-1}var n=/^[\w\-\$\:@\!%]+\+?$/i,o=/[\w\-:\$]/,q={"[":"]","(":")","{":"}"},s=Array.prototype.splice,r=[],u=[],p=[];f.prototype={addChild:function(a,b){a=a||new f;a.parent=this;d.isUndefined(b)?this.children.push(a):this.children.splice(b,
|
||||
0,a);return a},clone:function(){var a=new f;d.each(["abbreviation","counter","_name","_text","repeatCount","hasImplicitRepeat","start","end","content","padding"],function(b){a[b]=this[b]},this);a._attributes=d.map(this._attributes,function(a){return d.clone(a)});a._data=d.clone(this._data);a.children=d.map(this.children,function(b){b=b.clone();b.parent=a;return b});return a},remove:function(){if(this.parent)this.parent.children=d.without(this.parent.children,this);return this},replace:function(){var a=
|
||||
this.parent,b=d.indexOf(a.children,this),c=d.flatten(arguments);s.apply(a.children,[b,1].concat(c));d.each(c,function(b){b.parent=a})},updateProperty:function(a,b){this[a]=b;d.each(this.children,function(c){c.updateProperty(a,b)})},find:function(a){return this.findAll(a)[0]},findAll:function(a){if(!d.isFunction(a))var b=a.toLowerCase(),a=function(a){return a.name().toLowerCase()==b};var c=[];d.each(this.children,function(b){a(b)&&c.push(b);c=c.concat(b.findAll(a))});return d.compact(c)},data:function(a,
|
||||
b){if(arguments.length==2&&(this._data[a]=b,a=="resource"&&h("elements").is(b,"snippet")&&(this.content=b.data,this._text)))this.content=h("abbreviationUtils").insertChildContent(b.data,this._text);return this._data[a]},name:function(){var a=this.matchedResource();return h("elements").is(a,"element")?a.name:this._name},attributeList:function(){var a=[],b=this.matchedResource();h("elements").is(b,"element")&&d.isArray(b.attributes)&&(a=a.concat(b.attributes));return e(a.concat(this._attributes))},
|
||||
attribute:function(a,b){if(arguments.length==2){var c=d.indexOf(d.pluck(this._attributes,"name"),a.toLowerCase());~c?this._attributes[c].value=b:this._attributes.push({name:a,value:b})}return(d.find(this.attributeList(),function(b){return b.name==a})||{}).value},matchedResource:function(){return this.data("resource")},index:function(){return this.parent?d.indexOf(this.parent.children,this):-1},_setRepeat:function(a){a?this.repeatCount=parseInt(a,10)||1:this.hasImplicitRepeat=!0},setAbbreviation:function(b){var c=
|
||||
this;this.abbreviation=b=(b||"").replace(/\*(\d+)?$/,function(a,b){c._setRepeat(b);return""});var e=g(b);if(e)b=e.element,this.content=this._text=e.text;if(e=a(b))b=e.element,this._attributes=e.attributes;if((this._name=b)&&!n.test(this._name))throw"Invalid abbreviation";},toString:function(){var a=h("utils"),b=this.start,c=this.end,g=this.content,e=this;d.each(p,function(a){b=a(b,e,"start");g=a(g,e,"content");c=a(c,e,"end")});var j=d.map(this.children,function(a){return a.toString()}).join(""),g=
|
||||
h("abbreviationUtils").insertChildContent(g,j,{keepVariable:!1});return b+a.padString(g,this.padding)+c},hasEmptyChildren:function(){return!!d.find(this.children,function(a){return a.isEmpty()})},hasImplicitName:function(){return!this._name&&!this.isTextNode()},isGroup:function(){return!this.abbreviation},isEmpty:function(){return!this.abbreviation&&!this.children.length},isRepeating:function(){return this.repeatCount>1||this.hasImplicitRepeat},isTextNode:function(){return!this.name()&&!this.attributeList().length},
|
||||
isElement:function(){return!this.isEmpty()&&!this.isTextNode()},deepestChild:function(){if(!this.children.length)return null;for(var a=this;a.children.length;)a=d.last(a.children);return a}};p.push(function(a,b){return h("utils").replaceCounter(a,b.counter)});return{parse:function(a,c){var c=c||{},g=b(a);if(c.contextNode){g._name=c.contextNode.name;var e={};d.each(g._attributes,function(a){e[a.name]=a});d.each(c.contextNode.attributes,function(a){a.name in e?e[a.name].value=a.value:(a=d.clone(a),
|
||||
g._attributes.push(a),e[a.name]=a)})}d.each(r,function(a){a(g,c)});g=l(j(g));d.each(u,function(a){a(g,c)});return g},AbbreviationNode:f,addPreprocessor:function(a){d.include(r,a)||r.push(a)},removeFilter:function(a){preprocessor=d.without(r,a)},addPostprocessor:function(a){d.include(u,a)||u.push(a)},removePostprocessor:function(a){u=d.without(u,a)},addOutputProcessor:function(a){d.include(p,a)||p.push(a)},removeOutputProcessor:function(a){p=d.without(p,a)},isAllowedChar:function(a){a=String(a);return m(a)||
|
||||
~">+^[](){}".indexOf(a)}}});
|
||||
emmet.exec(function(h,d){function f(i,b){var c=h("resources"),a=h("elements"),e=h("abbreviationParser");d.each(d.clone(i.children),function(g){var j=c.getMatchedResource(g,b);if(d.isString(j))g.data("resource",a.create("snippet",j));else if(a.is(j,"reference")){j=e.parse(j.data,{syntax:b});if(g.repeatCount>1){var h=j.findAll(function(a){return a.hasImplicitRepeat});d.each(h,function(a){a.repeatCount=g.repeatCount;a.hasImplicitRepeat=!1})}var i=j.deepestChild();i&&d.each(g.children,function(a){i.addChild(a)});
|
||||
d.each(j.children,function(a){d.each(g.attributeList(),function(b){a.attribute(b.name,b.value)})});g.replace(j.children)}else g.data("resource",j);f(g,b)})}h("abbreviationParser").addPreprocessor(function(d,b){var c=b.syntax||emmet.defaultSyntax();f(d,c)})});
|
||||
emmet.exec(function(h,d){function f(a){for(var b=h("range"),c=[],a=h("stringStream").create(a);!a.eol();){if(a.peek()=="\\")a.next();else if(a.start=a.pos,a.match(e,!0)){c.push(b.create(a.start,e));continue}a.next()}return c}function i(a,b){var c=h("utils"),e=f(a);e.reverse();d.each(e,function(e){a=c.replaceSubstring(a,b,e)});return a}function b(a){return f(a.content).length?!0:!!d.find(a.attributeList(),function(a){return!!f(a.value).length})}function c(a,c,e){var f=a.findAll(function(a){return b(a)});
|
||||
b(a)&&f.unshift(a);f.length?d.each(f,function(a){a.content=i(a.content,c);d.each(a._attributes,function(a){a.value=i(a.value,c)})}):(a=a.deepestChild()||a,a.content=e?c:h("abbreviationUtils").insertChildContent(a.content,c))}var a=h("abbreviationParser"),e="$#";a.addPreprocessor(function(a,b){if(b.pastedContent){var c=h("utils"),e=d.map(c.splitByLines(b.pastedContent,!0),c.trim);a.findAll(function(a){if(a.hasImplicitRepeat)return a.data("paste",e),a.repeatCount=e.length})}});a.addPostprocessor(function(a,
|
||||
b){!a.findAll(function(a){var b=a.data("paste"),g="";d.isArray(b)?g=b[a.counter-1]:d.isFunction(b)?g=b(a.counter-1,a.content):b&&(g=b);g&&c(a,g,!!a.data("pasteOverwrites"));a.data("paste",null);return!!b}).length&&b.pastedContent&&c(a,b.pastedContent)})});emmet.exec(function(h,d){function f(i){var b=h("tagName");d.each(i.children,function(c){if(c.hasImplicitName()||c.data("forceNameResolving"))c._name=b.resolve(c.parent.name());f(c)});return i}h("abbreviationParser").addPostprocessor(f)});
|
||||
emmet.define("cssParser",function(h,d){function f(a){return typeof a!=="undefined"}function i(){return{"char":g.chnum,line:g.linenum}}function b(a,b,c){var e=g,c=c||{};j.push({charstart:f(c["char"])?c["char"]:e.chnum,charend:f(c.charend)?c.charend:e.chnum,linestart:f(c.line)?c.line:e.linenum,lineend:f(c.lineend)?c.lineend:e.linenum,value:a,type:b||a})}function c(a,b){var c=g,e=b||{},d=f(e["char"])?e["char"]:c.chnum,e=f(e.line)?e.line:c.linenum;return{name:"ParseError",message:a+" at line "+(e+1)+
|
||||
" char "+(d+1),walker:c,tokens:j}}function a(a){var c=g,e=c.ch,d=i(),j=a?a+e:e,e=c.nextChar();for(a&&(d["char"]-=a.length);m(e)||n(e);)j+=e,e=c.nextChar();b(j,"identifier",d)}function e(){var e=g.ch;if(e===" "||e==="\t"){for(var d=g.ch,j="",f=i();d===" "||d==="\t";)j+=d,d=g.nextChar();b(j,"white",f)}else{if(e==="/"){var d=g,e=f=d.ch,h,p=i();h=d.nextChar();if(h!=="*")p.charend=p["char"],p.lineend=p.line,j=b(e,e,p);else{for(;!(f==="*"&&h==="/");)e+=h,f=h,h=d.nextChar();e+=h;d.nextChar();b(e,"comment",
|
||||
p)}return j}if(e==='"'||e==="'"){d=g;e=f=j=d.ch;p=i();for(j=d.nextChar();j!==f;){if(j==="\n")if(h=d.nextChar(),h==="\\")e+=j+h;else throw c("Unterminated string",p);else e+=j==="\\"?j+d.nextChar():j;j=d.nextChar()}e+=j;d.nextChar();b(e,"string",p)}else if(e==="("){d=g;j=d.ch;f=0;e=j;h=i();for(j=d.nextChar();j!==")"&&!f;){if(j==="(")f++;else if(j===")")f--;else if(j===!1)throw c("Unterminated brace",h);e+=j;j=d.nextChar()}e+=j;d.nextChar();b(e,"brace",h)}else{if(e==="-"||e==="."||n(e)){j=g;f=j.ch;
|
||||
e=i();h=f;var p=h===".",v,f=j.nextChar();v=!n(f);if(p&&v)e.charend=e["char"],e.lineend=e.line,d=b(h,".",e);else if(h==="-"&&v)d=a("-");else{for(;f!==!1&&(n(f)||!p&&f===".");)f==="."&&(p=!0),h+=f,f=j.nextChar();b(h,"number",e)}return d}if(m(e))return a();if(l(e))return d=g,e=d.ch,j=i(),h=d.nextChar(),h==="="&&l(e,!0)?(e+=h,b(e,"match",j),d.nextChar(),f=void 0):(j.charend=j["char"]+1,j.lineend=j.line,b(e,e,j)),f;if(e==="\n")b("line"),g.nextChar();else throw c("Unrecognized character");}}}var g,j=[],
|
||||
l,m,n;g={lines:null,total_lines:0,linenum:-1,line:"",ch:"",chnum:-1,init:function(a){var b=g;b.lines=a.replace(/\r\n/g,"\n").replace(/\r/g,"\n").split("\n");b.total_lines=b.lines.length;b.chnum=-1;b.linenum=-1;b.ch="";b.line="";b.nextLine();b.nextChar()},nextLine:function(){this.linenum+=1;this.line=this.total_lines<=this.linenum?!1:this.lines[this.linenum];if(this.chnum!==-1)this.chnum=0;return this.line},nextChar:function(){for(this.chnum+=1;this.line.charAt(this.chnum)==="";){if(this.nextLine()===
|
||||
!1)return this.ch=!1;this.chnum=-1;return this.ch="\n"}return this.ch=this.line.charAt(this.chnum)},peek:function(){return this.line.charAt(this.chnum+1)}};m=function(a){return a=="&"||a==="_"||a==="-"||a>="a"&&a<="z"||a>="A"&&a<="Z"};n=function(a){return a!==!1&&a>="0"&&a<="9"};l=function(){for(var a="{}[]()+*=.,;:>~|\\%$#@^!".split(""),b="*^|$~".split(""),c={},e={},g=0;g<a.length;g+=1)c[a[g]]=!0;for(g=0;g<b.length;g+=1)e[b[g]]=!0;return function(a,b){return b?!!e[a]:!!c[a]}}();return{lex:function(a){g.init(a);
|
||||
for(j=[];g.ch!==!1;)e();return j},parse:function(a){var b=0;return d.map(this.lex(a),function(c){if(c.type=="line")c.value=a.charAt(b)=="\r"&&a.charAt(b+1)=="\n"?"\r\n":a.charAt(b);return{type:c.type,start:b,end:b+=c.value.length}})},toSource:function(a){for(var b=0,c=a.length,e,g="";b<c;b+=1)e=a[b],g+=e.type==="line"?"\n":e.value;return g}}});
|
||||
emmet.define("xmlParser",function(h){function d(a,e){function g(b){e.tokenize=b;return b(a,e)}var d=a.next();if(d=="<")if(a.eat("!"))return a.eat("[")?a.match("CDATA[")?g(b("atom","]]\>")):null:a.match("--")?g(b("comment","--\>")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),g(c(1))):null;else if(a.eat("?"))return a.eatWhile(/[\w\._\-]/),e.tokenize=b("meta","?>"),"meta";else{w=a.eat("/")?"closeTag":"openTag";a.eatSpace();for(v="";d=a.eat(/[^\s\u00a0=<>\"\'\/?]/);)v+=d;e.tokenize=f;return"tag"}else return d==
|
||||
"&"?(a.eat("#")?a.eat("x")?a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):a.eatWhile(/[\d]/)&&a.eat(";"):a.eatWhile(/[\w\.\-:]/)&&a.eat(";"))?"atom":"error":(a.eatWhile(/[^&<]/),"text")}function f(a,b){var c=a.next();return c==">"||c=="/"&&a.eat(">")?(b.tokenize=d,w=c==">"?"endTag":"selfcloseTag","tag"):c=="="?(w="equals",null):/[\'\"]/.test(c)?(b.tokenize=i(c),b.tokenize(a,b)):(a.eatWhile(/[^\s\u00a0=<>\"\'\/?]/),"word")}function i(a){return function(b,c){for(;!b.eol();)if(b.next()==a){c.tokenize=f;break}return"string"}}
|
||||
function b(a,b){return function(c,e){for(;!c.eol();){if(c.match(b)){e.tokenize=d;break}c.next()}return a}}function c(a){return function(b,e){for(var g;(g=b.next())!=null;)if(g=="<")return e.tokenize=c(a+1),e.tokenize(b,e);else if(g==">")if(a==1){e.tokenize=d;break}else return e.tokenize=c(a-1),e.tokenize(b,e);return"meta"}}function a(){for(var a=arguments.length-1;a>=0;a--)k.cc.push(arguments[a])}function e(){a.apply(null,arguments);return!0}function g(){if(k.context)k.context=k.context.prev}function j(a){if(a==
|
||||
"openTag")return k.tagName=v,e(o,l(k.startOfLine));else if(a=="closeTag")return a=!1,k.context?k.context.tagName!=v&&(p.implicitlyClosed.hasOwnProperty(k.context.tagName.toLowerCase())&&g(),a=!k.context||k.context.tagName!=v):a=!0,a&&(t="error"),e(m(a));return e()}function l(a){return function(b){if(b=="selfcloseTag"||b=="endTag"&&p.autoSelfClosers.hasOwnProperty(k.tagName.toLowerCase()))return n(k.tagName.toLowerCase()),e();if(b=="endTag"){n(k.tagName.toLowerCase());var b=k.tagName,c=p.doNotIndent.hasOwnProperty(b)||
|
||||
k.context&&k.context.noIndent;k.context={prev:k.context,tagName:b,indent:k.indented,startOfLine:a,noIndent:c}}return e()}}function m(a){return function(b){a&&(t="error");if(b=="endTag")return g(),e();t="error";return e(arguments.callee)}}function n(a){for(var b;;){if(!k.context)break;b=k.context.tagName.toLowerCase();if(!p.contextGrabbers.hasOwnProperty(b)||!p.contextGrabbers[b].hasOwnProperty(a))break;g()}}function o(b){if(b=="word")return t="attribute",e(q,o);if(b=="endTag"||b=="selfcloseTag")return a();
|
||||
t="error";return e(o)}function q(b){if(b=="equals")return e(s,o);p.allowMissing||(t="error");return b=="endTag"||b=="selfcloseTag"?a():e()}function s(b){if(b=="string")return e(r);if(b=="word"&&p.allowUnquoted)return t="string",e();t="error";return b=="endTag"||b=="selfCloseTag"?a():e()}function r(b){return b=="string"?e(r):a()}function u(a,b){if(a.sol())b.startOfLine=!0,b.indented=0;if(a.eatSpace())return null;t=w=v=null;var c=b.tokenize(a,b);b.type=w;if((c||w)&&c!="comment")for(k=b;;)if((b.cc.pop()||
|
||||
j)(w||c))break;b.startOfLine=!1;return t||c}var p={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!0,allowMissing:!0},v=null,w=null,k=null,t;return{parse:function(a,b){for(var b=b||0,c={tokenize:d,cc:[],indented:0,startOfLine:!0,tagName:null,context:null},e=h("stringStream").create(a),g=[];!e.eol();)g.push({type:u(e,c),start:e.start+b,end:e.pos+b}),e.start=e.pos;return g}}});
|
||||
emmet.define("string-score",function(){return{score:function(h,d,f){if(h==d)return 1;if(d=="")return 0;for(var i=0,b=d.length,c=h.length,a,e=1,g=0,j,l,m,n;g<b;++g){m=d.charAt(g);j=h.indexOf(m.toLowerCase());l=h.indexOf(m.toUpperCase());n=Math.min(j,l);l=n>-1?n:Math.max(j,l);if(l===-1)if(f){e+=1-f;continue}else return 0;else j=0.1;h[l]===m&&(j+=0.1);l===0?(j+=0.6,g===0&&(a=1)):h.charAt(l-1)===" "&&(j+=0.8);h=h.substring(l+1,c);i+=j}h=i/b;b=(h*(b/c)+h)/2;b/=e;a&&b+0.15<1&&(b+=0.15);return b}}});
|
||||
emmet.define("utils",function(h,d){function f(b){this._data=[];this.length=0;b&&this.append(b)}var i="${0}";f.prototype={append:function(b){this._data.push(b);this.length+=b.length},toString:function(){return this._data.join("")},valueOf:function(){return this.toString()}};return{reTag:/<\/?[\w:\-]+(?:\s+[\w\-:]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*\s*(\/?)>$/,endsWithTag:function(b){return this.reTag.test(b)},isNumeric:function(b){typeof b=="string"&&(b=b.charCodeAt(0));return b&&b>47&&
|
||||
b<58},trim:function(b){return(b||"").replace(/^\s+|\s+$/g,"")},getNewline:function(){var b=h("resources");if(!b)return"\n";b=b.getVariable("newline");return d.isString(b)?b:"\n"},setNewline:function(b){var c=h("resources");c.setVariable("newline",b);c.setVariable("nl",b)},splitByLines:function(b,c){var a=this.getNewline(),a=(b||"").replace(/\r\n/g,"\n").replace(/\n\r/g,"\n").replace(/\r/g,"\n").replace(/\n/g,a).split(a);c&&(a=d.filter(a,function(a){return a.length&&!!this.trim(a)},this));return a},
|
||||
normalizeNewline:function(b){return this.splitByLines(b).join(this.getNewline())},repeatString:function(b,c){for(var a=[],e=0;e<c;e++)a.push(b);return a.join("")},padString:function(b,c){var a=d.isNumber(c)?this.repeatString(h("resources").getVariable("indentation")||"\t",c):c,e=[],g=this.splitByLines(b),j=this.getNewline();e.push(g[0]);for(var f=1;f<g.length;f++)e.push(j+a+g[f]);return e.join("")},zeroPadString:function(b,c){for(var a="",e=b.length;c>e++;)a+="0";return a+b},unindentString:function(b,
|
||||
c){for(var a=this.splitByLines(b),e=0;e<a.length;e++)a[e].search(c)==0&&(a[e]=a[e].substr(c.length));return a.join(this.getNewline())},replaceUnescapedSymbol:function(b,c,a){for(var e=0,g=b.length,j=c.length,f=0;e<g;)if(b.charAt(e)=="\\")e+=j+1;else if(b.substr(e,j)==c){var h=j;f++;var i=a;if(d.isFunction(a))(i=a(b,c,e,f))?(h=i[0].length,i=i[1]):i=!1;i===!1?e++:(b=b.substring(0,e)+i+b.substring(e+h),g=b.length,e+=i.length)}else e++;return b},replaceVariables:function(b,c){var c=c||{},a=d.isFunction(c)?
|
||||
c:function(a,b){return b in c?c[b]:null},e=h("resources");return h("tabStops").processText(b,{variable:function(b){var c=a(b.token,b.name,b);c===null&&(c=e.getVariable(b.name));if(c===null||d.isUndefined(c))c=b.token;return c}})},replaceCounter:function(b,c){var c=String(c),a=this;return this.replaceUnescapedSymbol(String(b),"$",function(b,g,d){if(b.charAt(d+1)=="{"||a.isNumeric(b.charAt(d+1)))return!1;for(g=d+1;b.charAt(g)=="$"&&b.charAt(g+1)!="{";)g++;return[b.substring(d,g),a.zeroPadString(c,g-
|
||||
d)]})},matchesTag:function(b){return this.reTag.test(b||"")},escapeText:function(b){return b.replace(/([\$\\])/g,"\\$1")},unescapeText:function(b){return b.replace(/\\(.)/g,"$1")},getCaretPlaceholder:function(){return d.isFunction(i)?i.apply(this,arguments):i},setCaretPlaceholder:function(b){i=b},getLinePadding:function(b){return(b.match(/^(\s+)/)||[""])[0]},getLinePaddingFromPosition:function(b,c){return this.getLinePadding(this.findNewlineBounds(b,c).substring(b))},escapeForRegexp:function(b){return b.replace(RegExp("[.*+?|()\\[\\]{}\\\\]",
|
||||
"g"),"\\$&")},prettifyNumber:function(b,c){return b.toFixed(typeof c=="undefined"?2:c).replace(/\.?0+$/,"")},stringBuilder:function(b){return new f(b)},replaceSubstring:function(b,c,a,e){if(d.isObject(a)&&"end"in a)e=a.end,a=a.start;d.isString(e)&&(e=a+e.length);d.isUndefined(e)&&(e=a);return a<0||a>b.length?b:b.substring(0,a)+c+b.substring(e)},narrowToNonSpace:function(b,c,a){c=h("range").create(c,a);for(a=/[\s\n\r\u00a0]/;c.start<c.end;){if(!a.test(b.charAt(c.start)))break;c.start++}for(;c.end>
|
||||
c.start;)if(c.end--,!a.test(b.charAt(c.end))){c.end++;break}return c},findNewlineBounds:function(b,c){for(var a=b.length,e=0,g=a-1,d=c-1;d>0;d--){var f=b.charAt(d);if(f=="\n"||f=="\r"){e=d+1;break}}for(d=c;d<a;d++)if(f=b.charAt(d),f=="\n"||f=="\r"){g=d;break}return h("range").create(e,g-e)},deepMerge:function(){var b,c,a,e,g,j=arguments[0]||{},f=1,h=arguments.length;for(!d.isObject(j)&&!d.isFunction(j)&&(j={});f<h;f++)if((b=arguments[f])!=null)for(c in b)a=j[c],e=b[c],j!==e&&(e&&(d.isObject(e)||(g=
|
||||
d.isArray(e)))?(g?(g=!1,a=a&&d.isArray(a)?a:[]):a=a&&d.isObject(a)?a:{},j[c]=this.deepMerge(a,e)):e!==void 0&&(j[c]=e));return j}}});
|
||||
emmet.define("range",function(h,d){function f(b,c,a){switch(a){case "eq":case "==":return b===c;case "lt":case "<":return b<c;case "lte":case "<=":return b<=c;case "gt":case ">":return b>c;case "gte":case ">=":return b>=c}}function i(b,c){d.isObject(b)&&"start"in b?(this.start=Math.min(b.start,b.end),this.end=Math.max(b.start,b.end)):d.isArray(b)?(this.start=b[0],this.end=b[1]):(c=d.isString(c)?c.length:+c,this.start=b,this.end=b+c)}i.prototype={length:function(){return Math.abs(this.end-this.start)},
|
||||
equal:function(b){return this.cmp(b,"eq","eq")},shift:function(b){this.start+=b;this.end+=b;return this},overlap:function(b){return b.start<=this.end&&b.end>=this.start},intersection:function(b){if(this.overlap(b)){var c=Math.max(b.start,this.start);return new i(c,Math.min(b.end,this.end)-c)}return null},union:function(b){if(this.overlap(b)){var c=Math.min(b.start,this.start);return new i(c,Math.max(b.end,this.end)-c)}return null},inside:function(b){return this.cmp(b,"lte","gt")},contains:function(b){return this.cmp(b,
|
||||
"lt","gt")},include:function(){return this.cmp(loc,"lte","gte")},cmp:function(b,c,a){var e;b instanceof i?(e=b.start,b=b.end):e=b;return f(this.start,e,c||"<=")&&f(this.end,b,a||">")},substring:function(b){return this.length()>0?b.substring(this.start,this.end):""},clone:function(){return new i(this.start,this.length())},toArray:function(){return[this.start,this.end]},toString:function(){return"{"+this.start+", "+this.length()+"}"}};return{create:function(b,c){if(d.isUndefined(b)||b===null)return null;
|
||||
if(b instanceof i)return b;if(d.isObject(b)&&"start"in b&&"end"in b)c=b.end-b.start,b=b.start;return new i(b,c)},create2:function(b,c){d.isNumber(b)&&d.isNumber(c)&&(c-=b);return this.create(b,c)}}});
|
||||
emmet.define("handlerList",function(h,d){function f(){this._list=[]}f.prototype={add:function(f,b){this._list.push(d.extend({order:0},b||{},{fn:f}))},remove:function(f){this._list=d.without(this._list,d.find(this._list,function(b){return b.fn===f}))},list:function(){return d.sortBy(this._list,"order").reverse()},listFn:function(){return d.pluck(this.list(),"fn")},exec:function(f,b){var b=b||[],c=null;d.find(this.list(),function(a){c=a.fn.apply(a,b);if(c!==f)return!0});return c}};return{create:function(){return new f}}});
|
||||
emmet.define("tokenIterator",function(h,d){function f(d){this.tokens=d;this._position=0;this.reset()}f.prototype={next:function(){if(this.hasNext()){var d=this.tokens[++this._i];this._position=d.start;return d}return null},current:function(){return this.tokens[this._i]},position:function(){return this._position},hasNext:function(){return this._i<this._il-1},reset:function(){this._i=-1;this._il=this.tokens.length},item:function(){return this.tokens[this._i]},itemNext:function(){return this.tokens[this._i+
|
||||
1]},itemPrev:function(){return this.tokens[this._i-1]},nextUntil:function(f,b){for(var c,a=d.isString(f)?function(a){return a.type==f}:f;c=this.next();)if(b&&b.call(this,c),a.call(this,c))break}};return{create:function(d){return new f(d)}}});
|
||||
emmet.define("stringStream",function(){function h(d){this.pos=this.start=0;this.string=d}h.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==0},peek:function(){return this.string.charAt(this.pos)},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(d){var f=this.string.charAt(this.pos);if(typeof d=="string"?f==d:f&&(d.test?d.test(f):d(f)))return++this.pos,f},eatWhile:function(d){for(var f=this.pos;this.eat(d););
|
||||
return this.pos>f},eatSpace:function(){for(var d=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>d},skipToEnd:function(){this.pos=this.string.length},skipTo:function(d){d=this.string.indexOf(d,this.pos);if(d>-1)return this.pos=d,!0},skipToPair:function(d,f){for(var h=0,b,c=this.pos,a=this.string.length;c<a;)if(b=this.string.charAt(c++),b==d)h++;else if(b==f&&(h--,h<1))return this.pos=c,!0;return!1},backUp:function(d){this.pos-=d},match:function(d,f,h){if(typeof d==
|
||||
"string"){if(h=h?function(b){return b.toLowerCase()}:function(b){return b},h(this.string).indexOf(h(d),this.pos)==this.pos)return f!==!1&&(this.pos+=d.length),!0}else return(d=this.string.slice(this.pos).match(d))&&f!==!1&&(this.pos+=d[0].length),d},current:function(){return this.string.slice(this.start,this.pos)}};return{create:function(d){return new h(d)}}});
|
||||
emmet.define("resources",function(h,d){function f(a,c,e){var d=h("utils"),c=d.replaceUnescapedSymbol(c,"|",d.getCaretPlaceholder());if(e=="snippets")return h("elements").create("snippet",c);if(e=="abbreviations"){e=c;h("utils").trim(a);var a=h("elements"),f;return(f=b.exec(e))?a.create("element",f[1],f[2],f[4]=="/"):a.create("reference",e)}}var i={},b=/^<(\w+\:?[\w\-]*)((?:\s+[\w\:\-]+\s*=\s*(['"]).*?\3)*)\s*(\/?)>/,c={},a={},e=h("handlerList").create();return{setVocabulary:function(b,e){i={};e==
|
||||
"system"?c=b:a=b},getVocabulary:function(b){return b=="system"?c:a},getMatchedResource:function(a,b){return e.exec(null,d.toArray(arguments))||this.findSnippet(b,a.name())},getVariable:function(a){return(this.getSection("variables")||{})[a]},setVariable:function(a,b){var c=this.getVocabulary("user")||{};if(!("variables"in c))c.variables={};c.variables[a]=b;this.setVocabulary(c,"user")},hasSyntax:function(a){return a in this.getVocabulary("user")||a in this.getVocabulary("system")},addResolver:function(a,
|
||||
b){e.add(a,b)},removeResolver:function(a){e.remove(a)},getSection:function(b){if(!b)return null;b in i||(i[b]=h("utils").deepMerge({},c[b],a[b]));for(var e=i[b],f=d.rest(arguments),m;e&&(m=f.shift());)if(m in e)e=e[m];else return null;return e},findItem:function(a,b){for(var c=this.getSection(a);c;){if(b in c)return c[b];c=this.getSection(c["extends"])}},findSnippet:function(a,b,c){if(!a||!b)return null;var c=c||[],e=[b];~b.indexOf("-")&&e.push(b.replace(/\-/g,":"));var h=this.getSection(a),i=null;
|
||||
d.find(["snippets","abbreviations"],function(b){var c=this.getSection(a,b);if(c)return d.find(e,function(a){if(c[a])return i=f(a,c[a],b)})},this);c.push(a);return!i&&h["extends"]&&!d.include(c,h["extends"])?this.findSnippet(h["extends"],b,c):i},fuzzyFindSnippet:function(a,b,c){var c=c||0.3,a=this.getAllSnippets(a),e=h("string-score"),b=b.replace(/:$/,"").replace(/:/g,"-"),f=d.map(a,function(a,c){return{key:c,score:e.score(a.nk,b,0.1)}});if((f=d.last(d.sortBy(f,"score")))&&f.score>=c)return a[f.key].parsedValue},
|
||||
getAllSnippets:function(a){var b="all-"+a;if(!i[b]){var c=[],e=[];do{var h=this.getSection(a);if(!h)break;d.each(["snippets","abbreviations"],function(a){var b={};d.each(h[a]||null,function(c,e){b[e]={nk:e.replace(/:$/,"").replace(/:/g,"-"),value:c,parsedValue:f(e,c,a),type:a}});c.push(b)});e.push(a);a=h["extends"]}while(a&&!d.include(e,a));i[b]=d.extend.apply(d,c.reverse())}return i[b]}}});
|
||||
emmet.define("actions",function(h,d){function f(b){return h("utils").trim(b.charAt(0).toUpperCase()+b.substring(1).replace(/_[a-z]/g,function(b){return" "+b.charAt(1).toUpperCase()}))}var i={};return{add:function(b,c,a){b=b.toLowerCase();a=a||{};if(!a.label)a.label=f(b);i[b]={name:b,fn:c,options:a}},get:function(b){return i[b.toLowerCase()]},run:function(b,c){d.isArray(c)||(c=d.rest(arguments));var a=this.get(b);return a?a.fn.apply(emmet,c):(emmet.log('Action "%s" is not defined',b),!1)},getAll:function(){return i},
|
||||
getList:function(){return d.values(this.getAll())},getMenu:function(b){var c=[],b=b||[];d.each(this.getList(),function(a){if(!a.options.hidden&&!d.include(b,a.name)){var e=f(a.name),g=c;if(a.options.label)for(var j=a.options.label.split("/"),e=j.pop(),h,i;h=j.shift();)i=d.find(g,function(a){return a.type=="submenu"&&a.name==h}),i||(i={name:h,type:"submenu",items:[]},g.push(i)),g=i.items;g.push({type:"action",name:a.name,label:e})}});return c},getActionNameForMenuTitle:function(b,c){var a=null;d.find(c||
|
||||
this.getMenu(),function(c){if(c.type=="action"){if(c.label==b||c.name==b)return a=c.name}else return a=this.getActionNameForMenuTitle(b,c.items)},this);return a||null}}});
|
||||
emmet.define("profile",function(h,d){function f(a){d.extend(this,e,a)}function i(a,b){switch(String(b||"").toLowerCase()){case "lower":return a.toLowerCase();case "upper":return a.toUpperCase()}return a}function b(b,c){return a[b.toLowerCase()]=new f(c)}function c(){b("xhtml");b("html",{self_closing_tag:!1});b("xml",{self_closing_tag:!0,tag_nl:!0});b("plain",{tag_nl:!1,indent:!1,place_cursor:!1});b("line",{tag_nl:!1,indent:!1,extraFilters:"s"})}var a={},e={tag_case:"asis",attr_case:"asis",attr_quotes:"double",
|
||||
tag_nl:"decide",tag_nl_leaf:!1,place_cursor:!0,indent:!0,inline_break:3,self_closing_tag:"xhtml",filters:"",extraFilters:""};f.prototype={tagName:function(a){return i(a,this.tag_case)},attributeName:function(a){return i(a,this.attr_case)},attributeQuote:function(){return this.attr_quotes=="single"?"'":'"'},selfClosing:function(){return this.self_closing_tag=="xhtml"?" /":this.self_closing_tag===!0?"/":""},cursor:function(){return this.place_cursor?h("utils").getCaretPlaceholder():""}};c();return{create:function(a,
|
||||
c){return arguments.length==2?b(a,c):new f(d.defaults(a||{},e))},get:function(b,c){if(!b&&c){var e=h("resources").findItem(c,"profile");e&&(b=e)}return!b?a.plain:b instanceof f?b:d.isString(b)&&b.toLowerCase()in a?a[b.toLowerCase()]:this.create(b)},remove:function(b){b=(b||"").toLowerCase();b in a&&delete a[b]},reset:function(){a={};c()},stringCase:i}});
|
||||
emmet.define("editorUtils",function(h){return{isInsideTag:function(d,f){for(var h=/^<\/?\w[\w\:\-]*.*?>/,b=f;b>-1;){if(d.charAt(b)=="<")break;b--}return b!=-1&&(h=h.exec(d.substring(b)))&&f>b&&f<b+h[0].length?!0:!1},outputInfo:function(d,f,h){h=h||d.getProfileName();return{syntax:String(f||d.getSyntax()),profile:h?String(h):null,content:String(d.getContent())}},unindent:function(d,f){return h("utils").unindentString(f,this.getCurrentLinePadding(d))},getCurrentLinePadding:function(d){return h("utils").getLinePadding(d.getCurrentLine())}}});
|
||||
emmet.define("actionUtils",function(h){return{mimeTypes:{gif:"image/gif",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",svg:"image/svg+xml",html:"text/html",htm:"text/html"},extractAbbreviation:function(d){for(var f=d.length,i=-1,b=0,c=0,a=0,e=h("utils"),g=h("abbreviationParser");;){f--;if(f<0){i=0;break}var j=d.charAt(f);if(j=="]")c++;else if(j=="["){if(!c){i=f+1;break}c--}else if(j=="}")a++;else if(j=="{"){if(!a){i=f+1;break}a--}else if(j==")")b++;else if(j=="("){if(!b){i=f+1;break}b--}else if(!c&&
|
||||
!a&&(!g.isAllowedChar(j)||j==">"&&e.endsWithTag(d.substring(0,f+1)))){i=f+1;break}}return i!=-1&&!a&&!c&&!b?d.substring(i).replace(/^[\*\+\>\^]+/,""):""},getImageSize:function(d){var f=function(){return d.charCodeAt(h++)};if(d.substr(0,8)==="\u0089PNG\r\n\u001a\n"){var h=d.indexOf("IHDR")+4;return{width:f()<<24|f()<<16|f()<<8|f(),height:f()<<24|f()<<16|f()<<8|f()}}else if(d.substr(0,4)==="GIF8")return h=6,{width:f()|f()<<8,height:f()|f()<<8};else if(d.substr(0,2)==="\u00ff\u00d8")for(var h=2,b=d.length;h<
|
||||
b;){if(f()!=255)break;var c=f();if(c==218)break;var a=f()<<8|f();if(c>=192&&c<=207&&!(c&4)&&!(c&8))return h+=1,{height:f()<<8|f(),width:f()<<8|f()};else h+=a-2}},captureContext:function(d){if(String(d.getSyntax())in{html:1,xml:1,xsl:1}){var f=String(d.getContent()),i=h("htmlMatcher").find(f,d.getCaretPos());if(i&&i.type=="tag"){for(var d=/([\w\-:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g,i=i.open,f=i.range.substring(f).replace(/^<[\w\-\:]+/,""),i={name:i.name,attributes:[]},
|
||||
b;b=d.exec(f);)i.attributes.push({name:b[1],value:b[2]});return i}}return null},findExpressionBounds:function(d,f){for(var i=String(d.getContent()),b=i.length,c=d.getCaretPos()-1,a=c+1;c>=0&&f(i.charAt(c),c,i);)c--;for(;a<b&&f(i.charAt(a),a,i);)a++;if(a>c)return h("range").create([++c,a])},compoundUpdate:function(d,f){if(f){var h=d.getSelectionRange();d.replaceContent(f.data,f.start,f.end,!0);d.createSelection(f.caret,f.caret+h.end-h.start);return!0}return!1},detectSyntax:function(d,f){var i=f||"html";
|
||||
h("resources").hasSyntax(i)||(i="html");if(i=="html"&&(this.isStyle(d)||this.isInlineCSS(d)))i="css";return i},detectProfile:function(d){var f=d.getSyntax(),i=h("resources").findItem(f,"profile");if(i)return i;switch(f){case "xml":case "xsl":return"xml";case "css":if(this.isInlineCSS(d))return"line";break;case "html":return(i=h("resources").getVariable("profile"))||(i=this.isXHTML(d)?"xhtml":"html"),i}return"xhtml"},isXHTML:function(d){return d.getContent().search(/<!DOCTYPE[^>]+XHTML/i)!=-1},isStyle:function(d){var f=
|
||||
String(d.getContent()),d=d.getCaretPos();return(f=h("htmlMatcher").tag(f,d))&&f.open.name.toLowerCase()=="style"&&f.innerRange.cmp(d,"lte","gte")},isInlineCSS:function(d){var f=String(d.getContent()),d=d.getCaretPos();return(f=h("xmlEditTree").parseFromPosition(f,d,!0))?(f=f.itemFromPosition(d,!0))&&f.name().toLowerCase()=="style"&&f.valueRange(!0).cmp(d,"lte","gte"):!1}}});
|
||||
emmet.define("abbreviationUtils",function(h,d){return{isSnippet:function(d){return h("elements").is(d.matchedResource(),"snippet")},isUnary:function(d){var i=d.matchedResource();return d.children.length||this.isSnippet(d)?!1:i&&i.is_empty||h("tagName").isEmptyElement(d.name())},isInline:function(d){return d.isTextNode()||!d.name()||h("tagName").isInlineLevel(d.name())},isBlock:function(d){return this.isSnippet(d)||!this.isInline(d)},isSnippet:function(d){return h("elements").is(d.matchedResource(),
|
||||
"snippet")},hasTagsInContent:function(d){return h("utils").matchesTag(d.content)},hasBlockChildren:function(h){return this.hasTagsInContent(h)&&this.isBlock(h)||d.any(h.children,function(d){return this.isBlock(d)},this)},insertChildContent:function(f,i,b){var b=d.extend({keepVariable:!0,appendIfNoChild:!0},b||{}),c=!1,a=h("utils"),f=a.replaceVariables(f,function(e,d,h){var l=e;d=="child"&&(l=a.padString(i,a.getLinePaddingFromPosition(f,h.start)),c=!0,b.keepVariable&&(l+=e));return l});!c&&b.appendIfNoChild&&
|
||||
(f+=i);return f}}});
|
||||
emmet.define("base64",function(){return{encode:function(h){for(var d=[],f,i,b,c,a,e,g=0,j=h.length;g<j;)c=h.charCodeAt(g++),a=h.charCodeAt(g++),e=h.charCodeAt(g++),f=c&255,i=a&255,b=e&255,c=f>>2,f=(f&3)<<4|i>>4,i=(i&15)<<2|b>>6,b&=63,isNaN(a)?i=b=64:isNaN(e)&&(b=64),d.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(c)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(f)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(i)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(b));
|
||||
return d.join("")},decode:function(h){var d,f,i,b,c,a=0,e=0,g=[],j=h.length;if(!h)return h;h+="";do d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(h.charAt(a++)),f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(h.charAt(a++)),b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(h.charAt(a++)),c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(h.charAt(a++)),i=d<<18|f<<12|b<<6|c,d=i>>16&
|
||||
255,f=i>>8&255,i&=255,b==64?g[e++]=String.fromCharCode(d):c==64?g[e++]=String.fromCharCode(d,f):g[e++]=String.fromCharCode(d,f,i);while(a<j);return g.join("")}}});
|
||||
emmet.define("htmlMatcher",function(h,d){function f(b){var d={},j;return{open:function(a){return(a=this.matches(a))&&a.type=="open"?a:null},close:function(a){return(a=this.matches(a))&&a.type=="close"?a:null},matches:function(f){var i="p"+f;if(!(i in d)&&b.charAt(f)=="<"){var n=b.slice(f);d[i]=(j=n.match(c))?{name:j[1],selfClose:!!j[3],range:h("range").create(f,j[0]),type:"open"}:(j=n.match(a))?{name:j[1],range:h("range").create(f,j[0]),type:"close"}:!1}return d[i]},text:function(){return b}}}function i(a,
|
||||
b,c){return a.substring(b,b+c.length)==c}function b(a,b){for(var c=[],h=null,f=b.text(),n=a.range.end,o=f.length;n<o;n++){if(i(f,n,"<\!--"))for(h=n;h<o;h++)if(i(f,h,"--\>")){n=h+3;break}if(h=b.matches(n))if(h.type=="open"&&!h.selfClose)c.push(h.name);else if(h.type=="close"){if(!c.length)return h.name==a.name?h:null;if(d.last(c)==h.name)c.pop();else{for(var q=!1;c.length&&!q;)c.pop()==h.name&&(q=!0);if(!c.length&&!q)return h.name==a.name?h:null}}}}var c=/^<([\w\:\-]+)((?:\s+[\w\-:]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,
|
||||
a=/^<\/([\w\:\-]+)[^>]*>/;return{find:function(a,c){for(var j=h("range"),l=f(a),m=null,n=null,o=c;o>=0;o--)if(m=l.open(o)){if(m.selfClose&&m.range.cmp(c,"lt","gt"))break;if(n=b(m,l)){if(j.create2(m.range.start,n.range.end).contains(c))break}else if(m.range.contains(c))break;m=null}else if(i(a,o,"--\>"))for(var q=o-1;q>=0;q--)if(i(a,q,"--\>"))break;else{if(i(a,q,"<\!--")){o=q;break}}else if(i(a,o,"<\!--")){q=o+4;for(m=a.length;q<m;q++)if(i(a,q,"--\>")){q+=3;break}m={range:h("range").create(o,d.isNumber(q)?
|
||||
q-o:q[0]),type:"comment"};break}if(m)return q=o=null,n?(o=j.create2(m.range.start,n.range.end),q=j.create2(m.range.end,n.range.start)):o=q=j.create2(m.range.start,m.range.end),m.type=="comment"&&(j=o.substring(a),q.start+=j.length-j.replace(/^<\!--\s*/,"").length,q.end-=j.length-j.replace(/\s*--\>$/,"").length),{open:m,close:n,type:m.type=="comment"?"comment":"tag",innerRange:q,innerContent:function(){return this.innerRange.substring(a)},outerRange:o,outerContent:function(){return this.outerRange.substring(a)},
|
||||
range:!q.length()||!q.cmp(c,"lte","gte")?o:q,content:function(){return this.range.substring(a)},source:a}},tag:function(a,b){var c=this.find(a,b);if(c&&c.type=="tag")return c}}});
|
||||
emmet.define("tabStops",function(h,d){var f=100,i=0,b={replaceCarets:!1,escape:function(b){return"\\"+b},tabstop:function(b){return b.token},variable:function(b){return b.token}};h("abbreviationParser").addOutputProcessor(function(b,a){var e=0,d=h("tabStops"),f=h("utils"),l={tabstop:function(a){var b=parseInt(a.group);if(b==0)return"${0}";b>e&&(e=b);return a.placeholder?(b+=i,a=d.processText(a.placeholder,l),"${"+b+":"+a+"}"):"${"+(b+i)+"}"}},b=d.processText(b,l),b=f.replaceVariables(b,d.variablesResolver(a));
|
||||
i+=e+1;return b});return{extract:function(c,a){var e=h("utils"),g={carets:""},f=[],a=d.extend({},b,a,{tabstop:function(a){var b=a.token,c="";if(a.placeholder=="cursor")f.push({start:a.start,end:a.start+b.length,group:"carets",value:""});else{if("placeholder"in a)g[a.group]=a.placeholder;a.group in g&&(c=g[a.group]);f.push({start:a.start,end:a.start+b.length,group:a.group,value:c})}return b}});a.replaceCarets&&(c=c.replace(RegExp(e.escapeForRegexp(e.getCaretPlaceholder()),"g"),"${0:cursor}"));var c=
|
||||
this.processText(c,a),i=e.stringBuilder(),m=0,e=d.map(f,function(a){i.append(c.substring(m,a.start));var b=i.length,e=g[a.group]||"";i.append(e);m=a.end;return{group:a.group,start:b,end:b+e.length}});i.append(c.substring(m));return{text:i.toString(),tabstops:d.sortBy(e,"start")}},processText:function(c,a){for(var a=d.extend({},b,a),e=h("utils").stringBuilder(),g=h("stringStream").create(c),f,i;f=g.next();)if(f=="\\"&&!g.eol())e.append(a.escape(g.next()));else{i=f;if(f=="$")if(g.start=g.pos-1,g.match(/^[0-9]+/))i=
|
||||
a.tabstop({start:e.length,group:g.current().substr(1),token:g.current()});else if(f=g.match(/^\{([a-z_\-][\w\-]*)\}/))i=a.variable({start:e.length,name:f[1],token:g.current()});else if(f=g.match(/^\{([0-9]+)(:.+?)?\}/,!1)){g.skipToPair("{","}");i={start:e.length,group:f[1],token:g.current()};if(f=i.token.substring(i.group.length+2,i.token.length-1))i.placeholder=f.substr(1);i=a.tabstop(i)}e.append(i)}return e.toString()},upgrade:function(b,a){var e=0,g={tabstop:function(b){var c=parseInt(b.group);
|
||||
c>e&&(e=c);return b.placeholder?"${"+(c+a)+":"+b.placeholder+"}":"${"+(c+a)+"}"}};d.each(["start","end","content"],function(a){b[a]=this.processText(b[a],g)},this);return e},variablesResolver:function(b){var a={},e=h("resources");return function(g,j){if(j=="child")return g;if(j=="cursor")return h("utils").getCaretPlaceholder();var i=b.attribute(j);if(!d.isUndefined(i))return i;if(i=e.getVariable(j))return i;a[j]||(a[j]=f++);return"${"+a[j]+":"+j+"}"}},resetPlaceholderCounter:function(){console.log("deprecated");
|
||||
f=100},resetTabstopIndex:function(){i=0;f=100}}});
|
||||
emmet.define("preferences",function(h,d){var f={},i={},b=null,c=null;return{define:function(a,b,c){var h=a;d.isString(a)&&(h={},h[a]={value:b,description:c});d.each(h,function(a,b){i[b]=d.isObject(a)&&"value"in a&&d.keys(a).length<3?a:{value:a}})},set:function(a,b){var c=a;d.isString(a)&&(c={},c[a]=b);d.each(c,function(a,b){if(!(b in i))throw'Property "'+b+'" is not defined. You should define it first with `define` method of current module';if(a!==i[b].value){switch(typeof i[b].value){case "boolean":var c=
|
||||
a;d.isString(c)?(c=c.toLowerCase(),a=c=="yes"||c=="true"||c=="1"):a=!!c;break;case "number":a=parseInt(a+"",10)||0;break;default:a+=""}f[b]=a}else b in f&&delete f[b]})},get:function(a){if(a in f)return f[a];if(a in i)return i[a].value},getArray:function(a){a=this.get(a);d.isUndefined(a)||(a=d.map(a.split(","),h("utils").trim),a.length||(a=null));return a},getDict:function(a){var b={};d.each(this.getArray(a),function(a){a=a.split(":");b[a[0]]=a[1]});return b},description:function(a){return a in i?
|
||||
i[a].description:void 0},remove:function(a){d.isArray(a)||(a=[a]);d.each(a,function(a){a in f&&delete f[a];a in i&&delete i[a]})},list:function(){return d.map(d.keys(i).sort(),function(a){return{name:a,value:this.get(a),type:typeof i[a].value,description:i[a].description}},this)},load:function(a){d.each(a,function(a,b){this.set(b,a)},this)},exportModified:function(){return d.clone(f)},reset:function(){f={}},_startTest:function(){b=i;c=f;i={};f={}},_stopTest:function(){i=b;f=c}}});
|
||||
emmet.define("filters",function(h,d){function f(b){return!b?[]:d.isString(b)?b.split(/[\|,]/g):b}var i={};return{add:function(b,c){i[b]=c},apply:function(b,c,a){var e=h("utils"),a=h("profile").get(a);d.each(f(c),function(c){(c=e.trim(c.toLowerCase()))&&c in i&&(b=i[c](b,a))});return b},composeList:function(b,c,a){c=h("profile").get(c);b=f(c.filters||h("resources").findItem(b,"filters")||"html");c.extraFilters&&(b=b.concat(f(c.extraFilters)));a&&(b=b.concat(f(a)));if(!b||!b.length)b=f("html");return b},
|
||||
extractFromAbbreviation:function(b){var c="",b=b.replace(/\|([\w\|\-]+)$/,function(a,b){c=b;return""});return[b,f(c)]}}});
|
||||
emmet.define("elements",function(h,d){function f(a){return{data:a}}var i={},b=/([\w\-]+)\s*=\s*(['"])(.*?)\2/g,c={add:function(a,b){var c=this;i[a]=function(){var d=b.apply(c,arguments);if(d)d.type=a;return d}},get:function(a){return i[a]},create:function(a){var b=[].slice.call(arguments,1),c=this.get(a);return c?c.apply(this,b):null},is:function(a,b){return a&&a.type===b}};c.add("element",function(a,c,g){var h={name:a,is_empty:!!g};if(c)if(h.attributes=[],d.isArray(c))h.attributes=c;else if(d.isString(c))for(;a=
|
||||
b.exec(c);)h.attributes.push({name:a[1],value:a[3]});else d.each(c,function(a,b){h.attributes.push({name:b,value:a})});return h});c.add("snippet",f);c.add("reference",f);c.add("empty",function(){return{}});return c});
|
||||
emmet.define("editTree",function(h,d,f){function i(a,b){this.options=d.extend({offset:0},b);this.source=a;this._children=[];this._positions={name:0};this.initialize.apply(this,arguments)}function b(a,b,c){this.parent=a;this._name=b.value;this._value=c?c.value:"";this._positions={name:b.start,value:c?c.start:-1};this.initialize.apply(this,arguments)}var c=h("range").create;i.extend=f.extend;i.prototype={initialize:function(){},_updateSource:function(a,b,g){var f=c(b,d.isUndefined(g)?0:g-b),i=a.length-
|
||||
f.length(),m=function(a){d.each(a,function(b,c){b>=f.end&&(a[c]+=i)})};m(this._positions);d.each(this.list(),function(a){m(a._positions)});this.source=h("utils").replaceSubstring(this.source,a,f)},add:function(a,c){var d=new b(a,c);this._children.push(d);return d},get:function(a){return d.isNumber(a)?this.list()[a]:d.isString(a)?d.find(this.list(),function(b){return b.name()===a}):a},getAll:function(a){d.isArray(a)||(a=[a]);var b=[],c=[];d.each(a,function(a){d.isString(a)?b.push(a):d.isNumber(a)&&
|
||||
c.push(a)});return d.filter(this.list(),function(a,h){return d.include(c,h)||d.include(b,a.name())})},value:function(a,b,c){var h=this.get(a);if(h)return h.value(b);if(!d.isUndefined(b))return this.add(a,b,c)},values:function(a){return d.map(this.getAll(a),function(a){return a.value()})},remove:function(a){if(a=this.get(a))this._updateSource("",a.fullRange()),this._children=d.without(this._children,a)},list:function(){return this._children},indexOf:function(a){return d.indexOf(this.list(),this.get(a))},
|
||||
name:function(a){if(!d.isUndefined(a)&&this._name!==(a=String(a)))this._updateSource(a,this._positions.name,this._positions.name+this._name.length),this._name=a;return this._name},nameRange:function(a){return c(this._positions.name+(a?this.options.offset:0),this.name())},range:function(a){return c(a?this.options.offset:0,this.toString())},itemFromPosition:function(a,b){return d.find(this.list(),function(c){return c.range(b).inside(a)})},toString:function(){return this.source}};b.extend=f.extend;b.prototype=
|
||||
{initialize:function(){},_pos:function(a,b){return a+(b?this.parent.options.offset:0)},value:function(a){if(!d.isUndefined(a)&&this._value!==(a=String(a)))this.parent._updateSource(a,this.valueRange()),this._value=a;return this._value},name:function(a){if(!d.isUndefined(a)&&this._name!==(a=String(a)))this.parent._updateSource(a,this.nameRange()),this._name=a;return this._name},namePosition:function(a){return this._pos(this._positions.name,a)},valuePosition:function(a){return this._pos(this._positions.value,
|
||||
a)},range:function(a){return c(this.namePosition(a),this.toString())},fullRange:function(a){return this.range(a)},nameRange:function(a){return c(this.namePosition(a),this.name())},valueRange:function(a){return c(this.valuePosition(a),this.value())},toString:function(){return this.name()+this.value()},valueOf:function(){return this.toString()}};return{EditContainer:i,EditElement:b,createToken:function(a,b,c){a={start:a||0,value:b||"",type:c};a.end=a.start+a.value.length;return a}}});
|
||||
emmet.define("cssEditTree",function(h,d){function f(a,b){return h("range").create(a,b)}function i(a,b){var b=b||e|g,c=["white","line"];if((b&g)==g)for(;a.length&&d.include(c,d.last(a).type);)a.pop();if((b&e)==e)for(;a.length&&d.include(c,a[0].type);)a.shift();return a}function b(a){var b=["white","line",":"],c=[],h,j;a.nextUntil(function(){return!d.include(b,this.itemNext().type)});for(j=a.current().end;h=a.next();){if(h.type=="}"||h.type==";")return i(c,e|(h.type=="}"?g:0)),c.length?(j=c[0].start,
|
||||
a=d.last(c).end):a=j,f(j,a-j);c.push(h)}if(c.length)return f(c[0].start,d.last(c).end-c[0].start)}function c(a){var b=h("stringStream").create(a),c=[],e=/[\s\u00a0,]/,g=function(){b.next();c.push(f(b.start,b.current()));b.start=b.pos};b.eatSpace();for(b.start=b.pos;a=b.next();)if(a=='"'||a=="'"){b.next();if(!b.skipTo(a))break;g()}else if(a=="("){b.backUp(1);if(!b.skipToPair("(",")"))break;b.backUp(1);g()}else if(e.test(a))c.push(f(b.start,b.current().length-1)),b.eatWhile(e),b.start=b.pos;g();return d.chain(c).filter(function(a){return!!a.length()}).uniq(!1,
|
||||
function(a){return a.toString()}).value()}var a={styleBefore:"\n\t",styleSeparator:": ",offset:0},e=1,g=2,j=h("editTree").EditContainer.extend({initialize:function(c){d.defaults(this.options,a);var e=h("editTree"),g=h("tokenIterator").create(h("cssParser").parse(c)),j,s=[],r;for(j=g.position();r=g.next();){if(r.type=="{")break;s.push(r)}i(s);s.length?(j=s[0].start,s=d.last(s).end):s=j;j=f(j,s-j);this._positions.name=j.start;this._name=j.substring(c);if(!g.current()||g.current().type!="{")throw"Invalid CSS rule";
|
||||
for(this._positions.contentStart=g.position()+1;j=g.next();){if(s=j.type=="identifier")a:{s=g.tokens;r=g._i+1;for(var u=s.length;r<u;r++){if(s[r].type==":"){s=!0;break a}if(s[r].type=="identifier"||s[r].type=="line"){s=!1;break a}}s=!1}s&&(j=f(j),s=b(g),r=g.current()&&g.current().type==";"?f(g.current()):f(s.end,0),this._children.push(new l(this,e.createToken(j.start,j.substring(c)),e.createToken(s.start,s.substring(c)),e.createToken(r.start,r.substring(c)))))}this._saveStyle()},_saveStyle:function(){var a=
|
||||
this._positions.contentStart,b=this.source,c=h("utils");d.each(this.list(),function(e){e.styleBefore=b.substring(a,e.namePosition());var g=c.splitByLines(e.styleBefore);if(g.length>1)e.styleBefore="\n"+d.last(g);e.styleSeparator=b.substring(e.nameRange().end,e.valuePosition());e.styleBefore=d.last(e.styleBefore.split("*/"));e.styleSeparator=e.styleSeparator.replace(/\/\*.*?\*\//g,"");a=e.range().end})},add:function(a,b,c){var e=this.list(),g=this._positions.contentStart,f=d.pick(this.options,"styleBefore",
|
||||
"styleSeparator"),j=h("editTree");if(d.isUndefined(c))c=e.length;var i=e[c];if(i)g=i.fullRange().start;else if(i=e[c-1])i.end(";"),g=i.range().end;i&&(f=d.pick(i,"styleBefore","styleSeparator"));a=j.createToken(g+f.styleBefore.length,a);b=j.createToken(a.end+f.styleSeparator.length,b);j=new l(this,a,b,j.createToken(b.end,";"));d.extend(j,f);this._updateSource(j.styleBefore+j.toString(),g);this._children.splice(c,0,j);return j}}),l=h("editTree").EditElement.extend({initialize:function(a,b,c,d){this.styleBefore=
|
||||
a.options.styleBefore;this.styleSeparator=a.options.styleSeparator;this._end=d.value;this._positions.end=d.start},valueParts:function(a){var b=c(this.value());if(a){var e=this.valuePosition(!0);d.each(b,function(a){a.shift(e)})}return b},end:function(a){if(!d.isUndefined(a)&&this._end!==a)this.parent._updateSource(a,this._positions.end,this._positions.end+this._end.length),this._end=a;return this._end},fullRange:function(a){a=this.range(a);a.start-=this.styleBefore.length;return a},toString:function(){return this.name()+
|
||||
this.styleSeparator+this.value()+this.end()}});return{parse:function(a,b){return new j(a,b)},parseFromPosition:function(a,b,c){c=this.extractRule(a,b,c);return!c||!c.inside(b)?null:this.parse(c.substring(a),{offset:c.start})},extractRule:function(a,b,c){for(var d="",e=a.length,g=-1,f;b>=0;){f=a.charAt(b);if(f=="{"){g=b;break}else if(f=="}"&&!c){b++;break}b--}for(;b<e;){f=a.charAt(b);if(f=="{")g=b;else if(f=="}"){g!=-1&&(d=a.substring(g,b+1));break}b++}if(d){b=g-1;for(c="";b>=0;){f=a.charAt(b);if("{}/\\<>\n\r".indexOf(f)!=
|
||||
-1)break;b--}c=a.substring(b+1,g).replace(/^[\s\n\r]+/m,"");return h("range").create(g-c.length,d.length+c.length)}return null},baseName:function(a){return a.replace(/^\s*\-\w+\-/,"")},findParts:c}});
|
||||
emmet.define("xmlEditTree",function(h,d){var f={styleBefore:" ",styleSeparator:"=",styleQuote:'"',offset:0},i=/^<([\w\:\-]+)((?:\s+[\w\-:]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/m,b=h("editTree").EditContainer.extend({initialize:function(a){d.defaults(this.options,f);this._positions.name=1;var b=null,g=h("xmlParser").parse(a),j=h("range");d.each(g,function(d){d.value=j.create(d).substring(a);switch(d.type){case "tag":if(/^<[^\/]+/.test(d.value))this._name=d.value.substring(1);
|
||||
break;case "attribute":b&&this._children.push(new c(this,b));b=d;break;case "string":this._children.push(new c(this,b,d)),b=null}},this);b&&this._children.push(new c(this,b));this._saveStyle()},_saveStyle:function(){var a=this.nameRange().end,b=this.source;d.each(this.list(),function(c){c.styleBefore=b.substring(a,c.namePosition());if(c.valuePosition()!==-1)c.styleSeparator=b.substring(c.namePosition()+c.name().length,c.valuePosition()-c.styleQuote.length);a=c.range().end})},add:function(a,b,g){var f=
|
||||
this.list(),i=this.nameRange().end,m=h("editTree"),n=d.pick(this.options,"styleBefore","styleSeparator","styleQuote");if(d.isUndefined(g))g=f.length;var o=f[g];if(o)i=o.fullRange().start;else if(o=f[g-1])i=o.range().end;o&&(n=d.pick(o,"styleBefore","styleSeparator","styleQuote"));b=n.styleQuote+b+n.styleQuote;a=new c(this,m.createToken(i+n.styleBefore.length,a),m.createToken(i+n.styleBefore.length+a.length+n.styleSeparator.length,b));d.extend(a,n);this._updateSource(a.styleBefore+a.toString(),i);
|
||||
this._children.splice(g,0,a);return a}}),c=h("editTree").EditElement.extend({initialize:function(a,b,c){this.styleBefore=a.options.styleBefore;this.styleSeparator=a.options.styleSeparator;b="";a=a.options.styleQuote;if(c)b=c.value,a=b.charAt(0),a=='"'||a=="'"?b=b.substring(1):a="",a&&b.charAt(b.length-1)==a&&(b=b.substring(0,b.length-1));this.styleQuote=a;this._value=b;this._positions.value=c?c.start+a.length:-1},fullRange:function(a){a=this.range(a);a.start-=this.styleBefore.length;return a},toString:function(){return this.name()+
|
||||
this.styleSeparator+this.styleQuote+this.value()+this.styleQuote}});return{parse:function(a,c){return new b(a,c)},parseFromPosition:function(a,b,c){c=this.extractTag(a,b,c);return!c||!c.inside(b)?null:this.parse(c.substring(a),{offset:c.start})},extractTag:function(a,b,c){var d=a.length,f,m=h("range"),n=Math.min(2E3,d),o=null,q=function(b){var c;if(a.charAt(b)=="<"&&(c=a.substr(b,n).match(i)))return m.create(b,c[0])};for(f=b;f>=0;f--)if(o=q(f))break;if(o&&(o.inside(b)||c))return o;if(!o&&c)return null;
|
||||
for(f=b;f<d;f++)if(o=q(f))return o}}});
|
||||
emmet.define("expandAbbreviation",function(h,d){var f=h("handlerList").create(),i=null,b=h("actions");b.add("expand_abbreviation",function(b,a,e){var g=d.toArray(arguments),j=h("editorUtils").outputInfo(b,a,e);g[1]=j.syntax;g[2]=j.profile;return f.exec(!1,g)});b.add("expand_abbreviation_with_tab",function(c,a,d){var g=c.getSelection(),f=h("resources").getVariable("indentation");if(g)return d=h("utils"),a=h("range").create(c.getSelectionRange()),g=d.padString(g,f),c.replaceContent(f+"${0}",c.getCaretPos()),
|
||||
f=h("range").create(c.getCaretPos(),a.length()),c.replaceContent(g,f.start,f.end,!0),c.createSelection(f.start,f.start+g.length),!0;b.run("expand_abbreviation",c,a,d)||c.replaceContent(f,c.getCaretPos());return!0},{hidden:!0});f.add(function(b,a,d){var g=b.getSelectionRange().end,f=i.findAbbreviation(b);return f&&(a=emmet.expandAbbreviation(f,a,d,h("actionUtils").captureContext(b)))?(b.replaceContent(a,g-f.length,g),!0):!1},{order:-1});return i={addHandler:function(b,a){f.add(b,a)},removeHandler:function(b){f.remove(b,
|
||||
options)},findAbbreviation:function(b){var a=h("range").create(b.getSelectionRange()),d=String(b.getContent());if(a.length())return a.substring(d);b=b.getCurrentLineRange();return h("actionUtils").extractAbbreviation(d.substring(b.start,a.start))}}});
|
||||
emmet.define("wrapWithAbbreviation",function(h){var d=null;h("actions").add("wrap_with_abbreviation",function(f,i,b,c){var b=h("editorUtils").outputInfo(f,b,c),a=h("utils"),c=h("editorUtils"),i=i||f.prompt("Enter abbreviation");if(!i)return null;var i=String(i),e=h("range").create(f.getSelectionRange());if(!e.length()){e=h("htmlMatcher").tag(b.content,e.start);if(!e)return!1;e=a.narrowToNonSpace(b.content,e.range)}a=a.escapeText(e.substring(b.content));return(i=d.wrap(i,c.unindent(f,a),b.syntax,b.profile,
|
||||
h("actionUtils").captureContext(f)))?(f.replaceContent(i,e.start,e.end),!0):!1});return d={wrap:function(d,i,b,c,a){var e=h("filters"),g=h("utils"),b=b||emmet.defaultSyntax(),c=h("profile").get(c,b);h("tabStops").resetTabstopIndex();d=e.extractFromAbbreviation(d);return(i=h("abbreviationParser").parse(d[0],{syntax:b,pastedContent:i,contextNode:a}))?(b=e.composeList(b,c,d[1]),e.apply(i,b,c),g.replaceVariables(i.toString())):null}}});
|
||||
emmet.exec(function(h,d){function f(b,a){var e=a-(b.options.offset||0),g=/^[\s\n\r]/;return d.find(b.list(),function(a){return a.range().end===e?g.test(b.source.charAt(e)):a.range().inside(e)})}function i(b,a,d,g){for(var f=-1,i=-1;a--;)if(b.substr(a,d.length)==d){f=a;break}if(f!=-1){a=f;for(d=b.length;d>=a++;)if(b.substr(a,g.length)==g){i=a+g.length;break}}return f!=-1&&i!=-1?h("range").create(f,i-f):null}function b(b,a,d,g){function f(b){return b.replace(RegExp("^"+q.escapeForRegexp(a)+"\\s*"),
|
||||
function(a){n-=a.length;return""}).replace(RegExp("\\s*"+q.escapeForRegexp(d)+"$"),"")}var l=h("editorUtils"),m=l.outputInfo(b).content,n=b.getCaretPos(),o=null,q=h("utils");(o=i(m,n,a,d))&&o.overlap(g)?(g=o,o=f(g.substring(m))):(o=a+" "+g.substring(m).replace(RegExp(q.escapeForRegexp(a)+"\\s*|\\s*"+q.escapeForRegexp(d),"g"),"")+" "+d,n+=a.length+1);return o!==null?(o=q.escapeText(o),b.setCaretPos(g.start),b.replaceContent(l.unindent(b,o),g.start,g.end),b.setCaretPos(n),!0):!1}h("actions").add("toggle_comment",
|
||||
function(c){var a=h("editorUtils").outputInfo(c);if(a.syntax=="css"){var d=c.getCaretPos(),g=h("htmlMatcher").tag(a.content,d);if(g&&g.open.range.inside(d))a.syntax="html"}if(a.syntax=="css"){g=h("range").create(c.getSelectionRange());a=h("editorUtils").outputInfo(c);if(!g.length()&&(d=h("cssEditTree").parseFromPosition(a.content,c.getCaretPos())))g=(g=f(d,c.getCaretPos()))?g.range(!0):h("range").create(d.nameRange(!0).start,d.source);g.length()||(g=h("range").create(c.getCurrentLineRange()),h("utils").narrowToNonSpace(a.content,
|
||||
g));c=b(c,"/*","*/",g)}else{a=h("range").create(c.getSelectionRange());d=h("editorUtils").outputInfo(c);if(!a.length()&&(d=h("htmlMatcher").tag(d.content,c.getCaretPos())))a=d.outerRange;c=b(c,"<\!--","--\>",a)}return c})});
|
||||
emmet.exec(function(h){function d(d,h,b){function c(b){for(var c=b;c>=0;){var d=a.charAt(c);if(d=="\n"||d=="\r")break;c--}return a.substring(c,b)}for(var h=h||1,b=d.getCaretPos()+(b||0),a=String(d.getContent()),d=a.length,e=-1,g=/^\s+$/;b<=d&&b>=0;){b+=h;var j=a.charAt(b),l=a.charAt(b+1),m=a.charAt(b-1);switch(j){case '"':case "'":l==j&&m=="="&&(e=b+1);break;case ">":l=="<"&&(e=b+1);break;case "\n":case "\r":g.test(c(b-1))&&(e=b)}if(e!=-1)break}return e}h=h("actions");h.add("prev_edit_point",function(f){var h=
|
||||
f.getCaretPos(),b=d(f,-1);b==h&&(b=d(f,-1,-2));return b!=-1?(f.setCaretPos(b),!0):!1},{label:"Previous Edit Point"});h.add("next_edit_point",function(f){var h=d(f,1);return h!=-1?(f.setCaretPos(h),!0):!1})});
|
||||
emmet.exec(function(h,d){function f(a,b,c,d){var e=h("range"),g=h("editorUtils").outputInfo(a).content,f=g.length,j,i=e.create(-1,0),l=e.create(a.getSelectionRange());j=l.start;for(var o=1E5;j>=0&&j<f&&--o>0;){if(e=c(g,j,b)){if(i.equal(e))break;i=e.clone();if(j=d(e.substring(g),e.start,l.clone()))return a.createSelection(j.start,j.end),!0;else j=b?e.start:e.end-1}j+=b?-1:1}return!1}function i(a){var b=!0;return f(a,!1,function(a,c){if(b){b=!1;var d;a:{d=c;for(var e;d>=0;){if(e=g(a,d)){d=e;break a}d--}d=
|
||||
null}return d}else return g(a,c)},function(a,b,c){return e(a,b,c,!1)})}function b(a){return f(a,!0,g,function(a,b,c){return e(a,b,c,!0)})}function c(b,c,e){var e=e||0,g=h("range"),f=[],i=-1,l="",z="",x,o;d.each(c,function(c){switch(c.type){case "tag":o=b.substring(c.start,c.end);/^<[\w\:\-]/.test(o)&&f.push(g.create({start:c.start+1,end:c.end}));break;case "attribute":i=c.start;l=b.substring(c.start,c.end);break;case "string":f.push(g.create(i,c.end-i)),x=g.create(c),z=x.substring(b),j(z.charAt(0))&&
|
||||
x.start++,j(z.charAt(z.length-1))&&x.end--,f.push(x),l=="class"&&(f=f.concat(a(x.substring(b),x.start)))}});d.each(f,function(a){a.shift(e)});return d.chain(f).filter(function(a){return!!a.length()}).uniq(!1,function(a){return a.toString()}).value()}function a(a,b){var b=b||0,c=[],d=h("stringStream").create(a),e=h("range");d.eatSpace();d.start=d.pos;for(var g;g=d.next();)if(/[\s\u00a0]/.test(g))c.push(e.create(d.start+b,d.pos-d.start-1)),d.eatSpace(),d.start=d.pos;c.push(e.create(d.start+b,d.pos-
|
||||
d.start));return c}function e(a,b,e,g){a=c(a,h("xmlParser").parse(a),b);g&&a.reverse();return(b=d.find(a,function(a){return a.equal(e)}))?(g=d.indexOf(a,b),g<a.length-1?a[g+1]:null):g?d.find(a,function(a){return a.start<e.start}):!b&&(g=d.filter(a,function(a){return a.inside(e.end)}),g.length>1)?g[1]:d.find(a,function(a){return a.end>e.end})}function g(a,b){var c;if(a.charAt(b)=="<"&&(c=a.substring(b,a.length).match(q)))return h("range").create(b,c[0])}function j(a){return a=='"'||a=="'"}function l(a){var b=
|
||||
a.valueRange(!0),c=[a.range(!0),b],e=h("stringStream"),g=h("cssEditTree"),f=h("range"),j=a.value();d.each(a.valueParts(),function(a){var h=a.clone();c.push(h.shift(b.start));var i=e.create(a.substring(j));if(i.match(/^[\w\-]+\(/,!0)){i.start=i.pos;i.skipToPair("(",")");var l=i.current();c.push(f.create(h.start+i.start,l));d.each(g.findParts(l),function(a){c.push(f.create(h.start+i.start+a.start,a.substring(l)))})}});return d.chain(c).filter(function(a){return!!a.length()}).uniq(!1,function(a){return a.toString()}).value()}
|
||||
function m(a,b,c){var e=null,g=null,f=a.list(),h,j;c?(f.reverse(),h=function(a){return a.range(!0).start<=b.start},j=function(a){return a.start<b.start}):(h=function(a){return a.range(!0).end>=b.end},j=function(a){return a.end>b.start});for(;e=d.find(f,h);){a=l(e);c&&a.reverse();if(g=d.find(a,function(a){return a.equal(b)})){if(g=d.indexOf(a,g),g!=a.length-1){g=a[g+1];break}}else{g=d.filter(a,function(a){return a.inside(b.end)});if(g.length>1){g=g[1];break}if(g=d.find(a,j))break}g=null;b.start=b.end=
|
||||
c?e.range(!0).start-1:e.range(!0).end+1}return g}function n(a,b,c){a=h("cssEditTree").parse(a,{offset:b});b=a.nameRange(!0);return c.end<b.end?b:m(a,c,!1)}function o(a,b,c){b=h("cssEditTree").parse(a,{offset:b});a=m(b,c,!0);return!a&&(b=b.nameRange(!0),c.start>b.start)?b:a}var q=/^<([\w\:\-]+)((?:\s+[\w\-:]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,s=h("actions");s.add("select_next_item",function(a){return a.getSyntax()=="css"?f(a,!1,h("cssEditTree").extractRule,n):i(a)});s.add("select_previous_item",
|
||||
function(a){return a.getSyntax()=="css"?f(a,!0,h("cssEditTree").extractRule,o):b(a)})});
|
||||
emmet.exec(function(h){function d(c,a){var a=String((a||"out").toLowerCase()),d=h("editorUtils").outputInfo(c),g=h("range").create(c.getSelectionRange()),d=d.content;b&&!b.range.equal(g)&&(b=null);if(b&&g.length())if(a=="in")if(b.type=="tag"&&!b.close)return!1;else if(b.range.equal(b.outerRange))b.range=b.innerRange;else{var f=h("utils").narrowToNonSpace(d,b.innerRange);if((b=i.find(d,f.start+1))&&b.range.equal(g)&&b.outerRange.equal(g))b.range=b.innerRange}else if(!b.innerRange.equal(b.outerRange)&&
|
||||
b.range.equal(b.innerRange)&&g.equal(b.range))b.range=b.outerRange;else{if((b=i.find(d,g.start))&&b.range.equal(g)&&b.innerRange.equal(g))b.range=b.outerRange}else b=i.find(d,g.start);if(b&&!b.range.equal(g))return c.createSelection(b.range.start,b.range.end),!0;b=null;return!1}var f=h("actions"),i=h("htmlMatcher"),b=null;f.add("match_pair",d,{hidden:!0});f.add("match_pair_inward",function(b){return d(b,"in")},{label:"HTML/Match Pair Tag (inward)"});f.add("match_pair_outward",function(b){return d(b,
|
||||
"out")},{label:"HTML/Match Pair Tag (outward)"});f.add("matching_pair",function(b){var a=String(b.getContent()),d=b.getCaretPos();a.charAt(d)=="<"&&d++;return(a=i.tag(a,d))&&a.close?(a.open.range.inside(d)?b.setCaretPos(a.close.range.start):b.setCaretPos(a.open.range.start),!0):!1},{label:"HTML/Go To Matching Tag Pair"})});
|
||||
emmet.exec(function(h){h("actions").add("remove_tag",function(d){var f=h("utils"),i=h("editorUtils").outputInfo(d),b=h("htmlMatcher").tag(i.content,d.getCaretPos());if(b){if(b.close){var c=f.narrowToNonSpace(i.content,b.innerRange),a=f.findNewlineBounds(i.content,c.start),a=f.getLinePadding(a.substring(i.content)),i=c.substring(i.content),i=f.unindentString(i,a);d.replaceContent(f.getCaretPlaceholder()+f.escapeText(i),b.outerRange.start,b.outerRange.end)}else d.replaceContent(f.getCaretPlaceholder(),
|
||||
b.range.start,b.range.end);return!0}return!1},{label:"HTML/Remove Tag"})});
|
||||
emmet.exec(function(h){h("actions").add("split_join_tag",function(d,f){var i=h("htmlMatcher"),b=h("editorUtils").outputInfo(d,null,f),c=h("profile").get(b.profile);if(i=i.tag(b.content,d.getCaretPos())){if(i.close){var b=h("utils"),c=c.selfClosing()||" /",c=i.open.range.substring(i.source).replace(/\s*>$/,c+">"),a=d.getCaretPos();c.length+i.outerRange.start<a&&(a=c.length+i.outerRange.start);c=b.escapeText(c);d.replaceContent(c,i.outerRange.start,i.outerRange.end)}else{var b=h("utils"),e=b.getNewline(),
|
||||
g=h("resources").getVariable("indentation"),a=d.getCaretPos(),c=c.tag_nl===!0?e+g+e:"",e=i.outerContent().replace(/\s*\/>$/,">"),a=i.outerRange.start+e.length;e+=c+"</"+i.open.name+">";e=b.escapeText(e);d.replaceContent(e,i.outerRange.start,i.outerRange.end)}d.setCaretPos(a);i=!0}else i=!1;return i},{label:"HTML/Split\\Join Tag Declaration"})});
|
||||
emmet.define("reflectCSSValue",function(h,d){function f(c){var a=h("cssEditTree"),d=h("editorUtils").outputInfo(c),c=c.getCaretPos();if(a=a.parseFromPosition(d.content,c))if(d=a.itemFromPosition(c,!0)){var g=a.source,f=a.options.offset,c=c-f-d.range().start;b.exec(!1,[d]);if(g!==a.source)return{data:a.source,start:f,end:f+g.length,caret:f+d.range().start+c}}}function i(b){var b=h("cssEditTree").baseName(b),a;if(b=="opacity"||b=="filter")return/^(?:\-\w+\-)?(?:opacity|filter)$/;else if(a=b.match(/^border-radius-(top|bottom)(left|right)/))return RegExp("^(?:\\-\\w+\\-)?(?:"+
|
||||
b+"|border-"+a[1]+"-"+a[2]+"-radius)$");else if(a=b.match(/^border-(top|bottom)-(left|right)-radius/))return RegExp("^(?:\\-\\w+\\-)?(?:"+b+"|border-radius-"+a[1]+a[2]+")$");return RegExp("^(?:\\-\\w+\\-)?"+b+"$")}var b=h("handlerList").create();h("actions").add("reflect_css_value",function(b){return b.getSyntax()!="css"?!1:h("actionUtils").compoundUpdate(b,f(b))},{label:"CSS/Reflect Value"});b.add(function(b){var a=i(b.name());d.each(b.parent.list(),function(d){if(a.test(d.name())){var g;var f=b.name(),
|
||||
i=b.value(),m=d.name();g=d.value();var n=h("cssEditTree"),o=h("utils"),f=n.baseName(f),m=n.baseName(m);g=f=="opacity"&&m=="filter"?g.replace(/opacity=[^)]*/i,"opacity="+Math.floor(parseFloat(i)*100)):f=="filter"&&m=="opacity"?(f=i.match(/opacity=([^)]*)/i))?o.prettifyNumber(parseInt(f[1])/100):g:i;d.value(g)}})},{order:-1});return{addHandler:function(c,a){b.add(c,a)},removeHandler:function(c){b.remove(c,options)}}});
|
||||
emmet.exec(function(h){h("actions").add("evaluate_math_expression",function(d){var f=h("actionUtils"),i=h("utils"),b=String(d.getContent()),c=h("range").create(d.getSelectionRange());c.length()||(c=f.findExpressionBounds(d,function(a){return i.isNumeric(a)||".+-*/\\".indexOf(a)!=-1}));if(c&&c.length()){f=c.substring(b);f=f.replace(/([\d\.\-]+)\\([\d\.\-]+)/g,"Math.round($1/$2)");try{var a=i.prettifyNumber((new Function("return "+f))());d.replaceContent(a,c.start,c.end);d.setCaretPos(c.start+a.length);
|
||||
return!0}catch(e){}}return!1},{label:"Numbers/Evaluate Math Expression"})});
|
||||
emmet.exec(function(h,d){function f(b,a){var e=h("utils"),g=!1,f=!1,l=h("actionUtils").findExpressionBounds(b,function(a,b,c){return e.isNumeric(a)?!0:a=="."?!e.isNumeric(c.charAt(b+1))?!1:f?!1:f=!0:a=="-"?g?!1:g=!0:!1});if(l&&l.length()){var m=l.substring(String(b.getContent())),n=parseFloat(m);if(!d.isNaN(n)){n=e.prettifyNumber(n+a);if(/^(\-?)0+[1-9]/.test(m)){var o="";RegExp.$1&&(o="-",n=n.substring(1));n=n.split(".");n[0]=e.zeroPadString(n[0],i(m));n=o+n.join(".")}b.replaceContent(n,l.start,l.end);
|
||||
b.createSelection(l.start,l.start+n.length);return!0}}return!1}function i(b){b=b.replace(/^\-/,"");return~b.indexOf(".")?b.split(".")[0].length:b.length}var b=h("actions");d.each([1,-1,10,-10,0.1,-0.1],function(c){var a=c>0?"increment":"decrement";b.add(a+"_number_by_"+String(Math.abs(c)).replace(".","").substring(0,2),function(a){return f(a,c)},{label:"Numbers/"+a.charAt(0).toUpperCase()+a.substring(1)+" number by "+Math.abs(c)})})});
|
||||
emmet.exec(function(h,d){var f=h("actions"),i=h("preferences");i.define("css.closeBraceIndentation","\n","Indentation before closing brace of CSS rule. Some users prefere indented closing brace of CSS rule for better readability. This preference\u2019s value will be automatically inserted before closing brace when user adds newline in newly created CSS rule (e.g. when \u201cInsert formatted linebreak\u201d action will be performed in CSS file). If you\u2019re such user, you may want to write put a value like <code>\\n\\t</code> in this preference.");
|
||||
f.add("insert_formatted_line_break_only",function(b){var c=h("utils"),a=h("resources"),e=h("editorUtils").outputInfo(b),g=b.getCaretPos(),f=c.getNewline();if(d.include(["html","xml","xsl"],e.syntax)){if(a=a.getVariable("indentation"),(e=h("htmlMatcher").tag(e.content,g))&&!e.innerRange.length())return b.replaceContent(f+a+c.getCaretPlaceholder()+f,g),!0}else if(e.syntax=="css"&&(e=e.content,g&&e.charAt(g-1)=="{")){var l=i.get("css.closeBraceIndentation"),a=a.getVariable("indentation"),m=e.charAt(g)==
|
||||
"}";if(!m)for(var n=g,o=e.length,q;n<o;n++){q=e.charAt(n);if(q=="{")break;if(q=="}"){l="";m=!0;break}}m||(l+="}");c=f+a+c.getCaretPlaceholder()+l;b.replaceContent(c,g);return!0}return!1},{hidden:!0});f.add("insert_formatted_line_break",function(b){if(!f.run("insert_formatted_line_break_only",b)){for(var c=h("utils"),a=h("editorUtils").getCurrentLinePadding(b),d=String(b.getContent()),g=b.getCaretPos(),i=d.length,c=c.getNewline(),l="",m=b.getCurrentLineRange().end+1,n;m<i;m++)if(n=d.charAt(m),n==" "||
|
||||
n=="\t")l+=n;else break;l.length>a.length?b.replaceContent(c+l,g,g,!0):b.replaceContent(c,g)}return!0},{hidden:!0})});
|
||||
emmet.exec(function(h){h("actions").add("merge_lines",function(d){var f=h("htmlMatcher"),i=h("utils"),b=h("editorUtils").outputInfo(d),c=h("range").create(d.getSelectionRange());if(!c.length()&&(f=f.find(b.content,d.getCaretPos())))c=f.outerRange;if(c.length()){b=c.substring(b.content);b=i.splitByLines(b);for(f=1;f<b.length;f++)b[f]=b[f].replace(/^\s+/,"");b=b.join("").replace(/\s{2,}/," ");f=b.length;b=i.escapeText(b);d.replaceContent(b,c.start,c.end);d.createSelection(c.start,c.start+f);return!0}return!1})});
|
||||
emmet.exec(function(h){function d(d,h,b){b=b||0;return h.charAt(b)==d.charAt(0)&&h.substr(b,d.length)==d}h("actions").add("encode_decode_data_url",function(f){var i=String(f.getSelection()),b=f.getCaretPos();if(!i)for(var c=String(f.getContent());b-- >=0;)if(d("src=",c,b)){if(c=c.substr(b).match(/^(src=(["'])?)([^'"<>\s]+)\1?/))i=c[3],b+=c[1].length;break}else if(d("url(",c,b)){if(c=c.substr(b).match(/^(url\((['"])?)([^'"\)\s]+)\1?/))i=c[3],b+=c[1].length;break}if(i)if(d("data:",i))if(c=String(f.prompt("Enter path to file (absolute or relative)"))){var a=
|
||||
h("file"),e=a.createPath(f.getFilePath(),c);if(!e)throw"Can't save file";a.save(e,h("base64").decode(i.replace(/^data\:.+?;.+?,/,"")));f.replaceContent("$0"+c,b,b+i.length);f=!0}else f=!1;else{c=h("file");a=h("actionUtils");e=f.getFilePath();if(e===null)throw"You should save your file before using this action";e=c.locateFile(e,i);if(e===null)throw"Can't find "+i+" file";var g=h("base64").encode(String(c.read(e)));if(!g)throw"Can't encode file content to base64";g="data:"+(a.mimeTypes[String(c.getExt(e))]||
|
||||
"application/octet-stream")+";base64,"+g;f.replaceContent("$0"+g,b,b+i.length);f=!0}else f=!1;return f},{label:"Encode\\Decode data:URL image"})});
|
||||
emmet.exec(function(h,d){function f(d,b){var c;if(b){if(/^data:/.test(b))c=h("base64").decode(b.replace(/^data\:.+?;.+?,/,""));else{c=h("file");var a=c.locateFile(d.getFilePath(),b);if(a===null)throw"Can't find "+b+" file";c=String(c.read(a))}return h("actionUtils").getImageSize(c)}}h("actions").add("update_image_size",function(i){var b;if(String(i.getSyntax())=="css")a:{b=i.getCaretPos();var c=h("editorUtils").outputInfo(i);if(c=h("cssEditTree").parseFromPosition(c.content,b,!0)){var a=c.itemFromPosition(b,
|
||||
!0),e;if(a&&(e=/url\((["']?)(.+?)\1\)/i.exec(a.value()||"")))if(e=f(i,e[2])){a=c.range(!0);c.value("width",e.width+"px");c.value("height",e.height+"px",c.indexOf("width")+1);b=d.extend(a,{data:c.toString(),caret:b});break a}}b=null}else a:{b=i.getCaretPos();c=h("editorUtils").outputInfo(i);if((c=h("xmlEditTree").parseFromPosition(c.content,b,!0))&&(c.name()||"").toLowerCase()=="img")if(e=f(i,c.value("src"))){a=c.range(!0);c.value("width",e.width);c.value("height",e.height,c.indexOf("width")+1);b=
|
||||
d.extend(a,{data:c.toString(),caret:b});break a}b=null}return h("actionUtils").compoundUpdate(i,b)})});
|
||||
emmet.define("cssResolver",function(h,d){function f(a){var b=a&&a.charCodeAt(0);return a&&a=="."||b>47&&b<58}function i(a){a=h("utils").trim(a);if(~a.indexOf("/*")||/[\n\r]/.test(a))return!1;if(!/^[a-z0-9\-]+\s*\:/i.test(a))return!1;a=h("tabStops").processText(a,{replaceCarets:!0,tabstop:function(){return"value"}});return a.split(":").length==2}function b(a){a.charAt(0);if(a.charAt(0)=="#"){var b=a.replace(/^#+/,"")||"0",d=h("utils").repeatString,a=null;switch(b.length){case 1:a=d(b,6);break;case 2:a=
|
||||
d(b,3);break;case 3:a=b.charAt(0)+b.charAt(0)+b.charAt(1)+b.charAt(1)+b.charAt(2)+b.charAt(2);break;case 4:a=b+b.substr(0,2);break;case 5:a=b+b.charAt(0);break;default:a=b.substr(0,6)}p.get("css.color.short")&&(b=a.split(""),b[0]==b[1]&&b[2]==b[3]&&b[4]==b[5]&&(a=b[0]+b[2]+b[4]));switch(p.get("css.color.case")){case "upper":a=a.toUpperCase();break;case "lower":a=a.toLowerCase()}a="#"+a}else a=c(a);return a}function c(a){var b=p.getDict("css.keywordAliases");return a in b?b[a]:a}function a(a){return d.include(p.getArray("css.keywords"),
|
||||
c(a))}function e(a){var b=h("utils"),a=b.trim(a);if(a.indexOf(":")==-1)return{name:a,value:u};a=a.split(":");return{name:b.trim(a.shift()),value:b.trim(a.join(":")).replace(/^(\$\{0\}|\$0)(\s*;?)$/,"${1}$2")}}function g(a,b){var c=r[b];c||(c=d.find(r,function(a){return a.prefix==b}));return c&&c.supports(a)}function j(a,b){var c=[];d.each(r,function(b,d){g(a,d)&&c.push(d)});!c.length&&!b&&d.each(r,function(a,b){a.obsolete||c.push(b)});return c}function l(a,b){d.isString(b)&&(b={prefix:b});r[a]=d.extend({},
|
||||
s,b)}function m(a,b){if(b){var c=p.get(b+"."+a);if(!d.isUndefined(c))return c}return p.get("css."+a)}function n(a,b,c){if(!d.isString(a))a=a.data;if(!i(a))return a;b&&(~a.indexOf(";")?a=a.split(";").join(" !important;"):a+=" !important");b=a.indexOf(":");a=a.substring(0,b).replace(/\s+$/,"")+m("valueSeparator",c)+h("utils").trim(a.substring(b+1));return a.replace(/\s*;\s*$/,m("propertyEnd",c))}function o(a){var b=p.getArray(a);d.each(p.getArray(a+"Addon"),function(a){a.charAt(0)=="-"?b=d.without(b,
|
||||
a.substr(1)):(a.charAt(0)=="+"&&(a=a.substr(1)),b.push(a))});return b}var q=null,s={prefix:"emmet",obsolete:!1,transformName:function(a){return"-"+this.prefix+"-"+a},properties:function(){return o("css."+this.prefix+"Properties")||[]},supports:function(a){return d.include(this.properties(),a)}},r={},u="${1};",p=h("preferences");p.define("css.valueSeparator",": ","Defines a symbol that should be placed between CSS property and value when expanding CSS abbreviations.");p.define("css.propertyEnd",";",
|
||||
"Defines a symbol that should be placed at the end of CSS property when expanding CSS abbreviations.");p.define("stylus.valueSeparator"," ","Defines a symbol that should be placed between CSS property and value when expanding CSS abbreviations in Stylus dialect.");p.define("stylus.propertyEnd","","Defines a symbol that should be placed at the end of CSS property when expanding CSS abbreviations in Stylus dialect.");p.define("sass.propertyEnd","","Defines a symbol that should be placed at the end of CSS property when expanding CSS abbreviations in SASS dialect.");
|
||||
p.define("css.autoInsertVendorPrefixes",!0,"Automatically generate vendor-prefixed copies of expanded CSS property. By default, Emmet will generate vendor-prefixed properties only when you put dash before abbreviation (e.g. <code>-bxsh</code>). With this option enabled, you don\u2019t need dashes before abbreviations: Emmet will produce vendor-prefixed properties for you.");var v=d.template("A comma-separated list of CSS properties that may have <code><%= vendor %></code> vendor prefix. This list is used to generate a list of prefixed properties when expanding <code>-property</code> abbreviations. Empty list means that all possible CSS values may have <code><%= vendor %></code> prefix."),
|
||||
w=d.template("A comma-separated list of <em>additional</em> CSS properties for <code>css.<%= vendor %>Preperties</code> preference. You should use this list if you want to add or remove a few CSS properties to original set. To add a new property, simply write its name, to remove it, precede property with hyphen.<br>For example, to add <em>foo</em> property and remove <em>border-radius</em> one, the preference value will look like this: <code>foo, -border-radius</code>.");d.each({webkit:"animation, animation-delay, animation-direction, animation-duration, animation-fill-mode, animation-iteration-count, animation-name, animation-play-state, animation-timing-function, appearance, backface-visibility, background-clip, background-composite, background-origin, background-size, border-fit, border-horizontal-spacing, border-image, border-vertical-spacing, box-align, box-direction, box-flex, box-flex-group, box-lines, box-ordinal-group, box-orient, box-pack, box-reflect, box-shadow, color-correction, column-break-after, column-break-before, column-break-inside, column-count, column-gap, column-rule-color, column-rule-style, column-rule-width, column-span, column-width, dashboard-region, font-smoothing, highlight, hyphenate-character, hyphenate-limit-after, hyphenate-limit-before, hyphens, line-box-contain, line-break, line-clamp, locale, margin-before-collapse, margin-after-collapse, marquee-direction, marquee-increment, marquee-repetition, marquee-style, mask-attachment, mask-box-image, mask-box-image-outset, mask-box-image-repeat, mask-box-image-slice, mask-box-image-source, mask-box-image-width, mask-clip, mask-composite, mask-image, mask-origin, mask-position, mask-repeat, mask-size, nbsp-mode, perspective, perspective-origin, rtl-ordering, text-combine, text-decorations-in-effect, text-emphasis-color, text-emphasis-position, text-emphasis-style, text-fill-color, text-orientation, text-security, text-stroke-color, text-stroke-width, transform, transition, transform-origin, transform-style, transition-delay, transition-duration, transition-property, transition-timing-function, user-drag, user-modify, user-select, writing-mode, svg-shadow, box-sizing, border-radius",
|
||||
moz:"animation-delay, animation-direction, animation-duration, animation-fill-mode, animation-iteration-count, animation-name, animation-play-state, animation-timing-function, appearance, backface-visibility, background-inline-policy, binding, border-bottom-colors, border-image, border-left-colors, border-right-colors, border-top-colors, box-align, box-direction, box-flex, box-ordinal-group, box-orient, box-pack, box-shadow, box-sizing, column-count, column-gap, column-rule-color, column-rule-style, column-rule-width, column-width, float-edge, font-feature-settings, font-language-override, force-broken-image-icon, hyphens, image-region, orient, outline-radius-bottomleft, outline-radius-bottomright, outline-radius-topleft, outline-radius-topright, perspective, perspective-origin, stack-sizing, tab-size, text-blink, text-decoration-color, text-decoration-line, text-decoration-style, text-size-adjust, transform, transform-origin, transform-style, transition, transition-delay, transition-duration, transition-property, transition-timing-function, user-focus, user-input, user-modify, user-select, window-shadow, background-clip, border-radius",
|
||||
ms:"accelerator, backface-visibility, background-position-x, background-position-y, behavior, block-progression, box-align, box-direction, box-flex, box-line-progression, box-lines, box-ordinal-group, box-orient, box-pack, content-zoom-boundary, content-zoom-boundary-max, content-zoom-boundary-min, content-zoom-chaining, content-zoom-snap, content-zoom-snap-points, content-zoom-snap-type, content-zooming, filter, flow-from, flow-into, font-feature-settings, grid-column, grid-column-align, grid-column-span, grid-columns, grid-layer, grid-row, grid-row-align, grid-row-span, grid-rows, high-contrast-adjust, hyphenate-limit-chars, hyphenate-limit-lines, hyphenate-limit-zone, hyphens, ime-mode, interpolation-mode, layout-flow, layout-grid, layout-grid-char, layout-grid-line, layout-grid-mode, layout-grid-type, line-break, overflow-style, perspective, perspective-origin, perspective-origin-x, perspective-origin-y, scroll-boundary, scroll-boundary-bottom, scroll-boundary-left, scroll-boundary-right, scroll-boundary-top, scroll-chaining, scroll-rails, scroll-snap-points-x, scroll-snap-points-y, scroll-snap-type, scroll-snap-x, scroll-snap-y, scrollbar-arrow-color, scrollbar-base-color, scrollbar-darkshadow-color, scrollbar-face-color, scrollbar-highlight-color, scrollbar-shadow-color, scrollbar-track-color, text-align-last, text-autospace, text-justify, text-kashida-space, text-overflow, text-size-adjust, text-underline-position, touch-action, transform, transform-origin, transform-origin-x, transform-origin-y, transform-origin-z, transform-style, transition, transition-delay, transition-duration, transition-property, transition-timing-function, user-select, word-break, word-wrap, wrap-flow, wrap-margin, wrap-through, writing-mode",
|
||||
o:"dashboard-region, animation, animation-delay, animation-direction, animation-duration, animation-fill-mode, animation-iteration-count, animation-name, animation-play-state, animation-timing-function, border-image, link, link-source, object-fit, object-position, tab-size, table-baseline, transform, transform-origin, transition, transition-delay, transition-duration, transition-property, transition-timing-function, accesskey, input-format, input-required, marquee-dir, marquee-loop, marquee-speed, marquee-style"},
|
||||
function(a,b){p.define("css."+b+"Properties",a,v({vendor:b}));p.define("css."+b+"PropertiesAddon","",w({vendor:b}))});p.define("css.unitlessProperties","z-index, line-height, opacity, font-weight, zoom","The list of properties whose values \u200b\u200bmust not contain units.");p.define("css.intUnit","px","Default unit for integer values");p.define("css.floatUnit","em","Default unit for float values");p.define("css.keywords","auto, inherit","A comma-separated list of valid keywords that can be used in CSS abbreviations.");
|
||||
p.define("css.keywordAliases","a:auto, i:inherit, s:solid, da:dashed, do:dotted","A comma-separated list of keyword aliases, used in CSS abbreviation. Each alias should be defined as <code>alias:keyword_name</code>.");p.define("css.unitAliases","e:em, p:%, x:ex, r:rem","A comma-separated list of unit aliases, used in CSS abbreviation. Each alias should be defined as <code>alias:unit_value</code>.");p.define("css.color.short",!0,"Should color values like <code>#ffffff</code> be shortened to <code>#fff</code> after abbreviation with color was expanded.");
|
||||
p.define("css.color.case","keep","Letter case of color values generated by abbreviations with color (like <code>c#0</code>). Possible values are <code>upper</code>, <code>lower</code> and <code>keep</code>.");p.define("css.fuzzySearch",!0,"Enable fuzzy search among CSS snippet names. When enabled, every <em>unknown</em> snippet will be scored against available snippet names (not values or CSS properties!). The match with best score will be used to resolve snippet value. For example, with this preference enabled, the following abbreviations are equal: <code>ov:h</code> == <code>ov-h</code> == <code>o-h</code> == <code>oh</code>");
|
||||
p.define("css.fuzzySearchMinScore",0.3,"The minium score (from 0 to 1) that fuzzy-matched abbreviation should achive. Lower values may produce many false-positive matches, higher values may reduce possible matches.");l("w",{prefix:"webkit"});l("m",{prefix:"moz"});l("s",{prefix:"ms"});l("o",{prefix:"o"});var k=["css","less","sass","scss","stylus"];h("resources").addResolver(function(a,b){return d.include(k,b)&&a.isElement()?q.expandToSnippet(a.abbreviation,b):null});var t=h("expandAbbreviation");t.addHandler(function(a,
|
||||
b,c){if(!d.include(k,b))return!1;var e=a.getSelectionRange().end,g=t.findAbbreviation(a);return g&&(b=emmet.expandAbbreviation(g,b,c))?(g=e-g.length,c=e,a.getContent().charAt(e)==";"&&b.charAt(b.length-1)==";"&&c++,a.replaceContent(b,g,c),!0):!1});return q={addPrefix:l,supportsPrefix:g,prefixed:function(a,b){return g(a,b)?"-"+b+"-"+a:a},listPrefixes:function(){return d.map(r,function(a){return a.prefix})},getPrefix:function(a){return r[a]},removePrefix:function(a){a in r&&delete r[a]},extractPrefixes:function(a){if(a.charAt(0)!=
|
||||
"-")return{property:a,prefixes:null};for(var b=1,c=a.length,d,e=[];b<c;){d=a.charAt(b);if(d=="-"){b++;break}if(d in r)e.push(d);else{e.length=0;b=1;break}b++}if(b==c-1)b=1,e.length=1;return{property:a.substring(b),prefixes:e.length?e:"all"}},findValuesInAbbreviation:function(b,c){for(var c=c||"css",d=0,e=b.length,g="",i;d<e;){i=b.charAt(d);if(f(i)||i=="#"||i=="-"&&f(b.charAt(d+1))){g=b.substring(d);break}d++}i=b.substring(0,b.length-g.length);d=h("resources");for(e=[];~i.indexOf("-")&&!d.findSnippet(c,
|
||||
i);){i=i.split("-");var j=i.pop();if(!a(j))break;e.unshift(j);i=i.join("-")}return e.join("-")+g},parseValues:function(c){for(var e=h("stringStream").create(c),g=[],i=null;i=e.next();){if(i=="#")e.match(/^[0-9a-f]+/,!0);else if(i=="-"){if(a(d.last(g))||e.start&&f(c.charAt(e.start-1)))e.start=e.pos;e.match(/^\-?[0-9]*(\.[0-9]+)?[a-z%\.]*/,!0)}else e.match(/^[0-9]*(\.[0-9]*)?[a-z%]*/,!0);g.push(e.current());e.start=e.pos}return d.map(d.compact(g),b)},extractValues:function(a){var b=this.findValuesInAbbreviation(a);
|
||||
return!b?{property:a,values:null}:{property:a.substring(0,a.length-b.length).replace(/-$/,""),values:this.parseValues(b)}},normalizeValue:function(a,b){var b=(b||"").toLowerCase(),c=p.getArray("css.unitlessProperties");return a.replace(/^(\-?[0-9\.]+)([a-z]*)$/,function(a,e,g){if(!g&&(e=="0"||d.include(c,b)))return e;g?(a=p.getDict("css.unitAliases"),e+=g in a?a[g]:g):e=e.replace(/\.$/,"")+p.get(~e.indexOf(".")?"css.floatUnit":"css.intUnit");return e})},expand:function(a,b,c){var c=c||"css",g=h("resources"),
|
||||
f=p.get("css.autoInsertVendorPrefixes"),k;if(k=/^(.+)\!$/.test(a))a=RegExp.$1;var l=g.findSnippet(c,a);if(l&&!f)return n(l,k,c);l=this.extractPrefixes(a);a=this.extractValues(l.property);a=d.extend(l,a);l=g.findSnippet(c,a.property);!l&&p.get("css.fuzzySearch")&&(l=g.fuzzyFindSnippet(c,a.property,parseFloat(p.get("css.fuzzySearchMinScore"))));if(l){if(!d.isString(l))l=l.data}else l=a.property+":"+u;if(!i(l))return l;var o=e(l),m=[];!b&&a.values&&(b=d.map(a.values,function(a){return this.normalizeValue(a,
|
||||
o.name)},this).join(" ")+";");o.value=b||o.value;b=a.prefixes=="all"||!a.prefixes&&f?j(o.name,f&&a.prefixes!="all"):a.prefixes;d.each(b,function(a){a in r&&m.push(n(r[a].transformName(o.name)+":"+o.value,k,c))});m.push(n(o.name+":"+o.value,k,c));return m},expandToSnippet:function(a,b){var c=this.expand(a,null,b);return d.isArray(c)?c.join("\n"):!d.isString(c)?c.data:String(c)},getSyntaxPreference:m,transformSnippet:n}});
|
||||
emmet.define("cssGradient",function(h,d){function f(a){return h("utils").trim(a).replace(/\s+/g," ")}function i(a){var a=f(a),b=null,a=a.replace(/^(\w+\(.+?\))\s*/,function(a,c){b=c;return""});b||(a=a.split(" "),b=a[0],a=a[1]||"");var c={color:b};a&&a.replace(/^(\-?[\d\.]+)([a-z%]+)?$/,function(a,b,d){c.position=b;~b.indexOf(".")?d="":d||(d="%");if(d)c.unit=d});return c}function b(a){var b=0;d.each(a,function(c,e){if(!e)return c.position=c.position||0;if(e==a.length-1&&!("position"in c))c.position=
|
||||
1;if("position"in c){var g=a[b].position||0,f=(c.position-g)/(e-b);d.each(a.slice(b,e),function(a,b){a.position=g+f*b});b=e}})}function c(a){var b=parseFloat(a);if(!d.isNaN(b))switch(b%360){case 0:return"left";case 90:return"bottom";case 180:return"right";case 240:return"top"}return a}function a(a){a=c(a);if(r.test(a))throw"The direction is an angle that can\u2019t be converted.";var b=function(b){return~a.indexOf(b)?"100%":"0"};return b("right")+" "+b("bottom")+", "+b("left")+" "+b("top")}function e(a){var b=
|
||||
p.getArray("css.gradient.prefixes"),b=d.map(b,function(b){return"-"+b+"-"+a});b.push(a);return b}function g(a,b){var c=[],e=h("cssResolver");p.get("css.gradient.fallback")&&~b.toLowerCase().indexOf("background")&&c.push({name:"background-color",value:"${1:"+a.colorStops[0].color+"}"});d.each(p.getArray("css.gradient.prefixes"),function(d){var g=e.prefixed(b,d);if(d=="webkit"&&p.get("css.gradient.oldWebkit"))try{c.push({name:g,value:q.oldWebkitLinearGradient(a)})}catch(f){}c.push({name:g,value:q.toString(a,
|
||||
d)})});return c.sort(function(a,b){return b.name.length-a.name.length})}function j(a,b,c){var f=a.parent,i=h("utils");d.each(f.getAll(e(a.name())),function(b){b!=a&&/gradient/i.test(b.value())&&f.remove(b)});var j=a.value();c||(c=h("range").create(0,a.value()));a.value(function(a){return i.replaceSubstring(j,a,c)}(q.toString(b))+"${2}");b=g(b,a.name());d.each(b,function(b){f.add(b.name,b.value,f.indexOf(a))})}function l(a){var b=a.value(),c=null;return(a=d.find(a.valueParts(),function(a){return c=
|
||||
q.parse(a.substring(b))}))&&c?{gradient:c,valueRange:a}:null}function m(a,b){var c=p.get("css.gradient.defaultProperty");if(!c)return!1;var e=String(a.getContent()),f=h("range").create(a.getCurrentLineRange()),i=f.substring(e).replace(/^\s+/,function(a){f.start+=a.length;return""}).replace(/\s+$/,function(a){f.end-=a.length;return""}),e=h("cssResolver");if(i=q.parse(i)){var j=g(i,c);j.push({name:c,value:q.toString(i)+"${2}"});var l=e.getSyntaxPreference("valueSeparator",b),o=e.getSyntaxPreference("propertyEnd",
|
||||
b),j=d.map(j,function(a){return a.name+l+a.value+o});a.replaceContent(j.join("\n"),f.start,f.end);return!0}return!1}function n(a,b){var c=null,e=h("cssEditTree").parseFromPosition(a,b,!0);e&&((c=e.itemFromPosition(b,!0))||(c=d.find(e.list(),function(a){return a.range(!0).end==b})));return{rule:e,property:c}}var o=["top","to bottom","0deg"],q=null,s=["css","less","sass","scss","stylus","styl"],r=/\d+deg/i,u=/top|bottom|left|right/i,p=h("preferences");p.define("css.gradient.prefixes","webkit, moz, o",
|
||||
"A comma-separated list of vendor-prefixes for which values should be generated.");p.define("css.gradient.oldWebkit",!0,"Generate gradient definition for old Webkit implementations");p.define("css.gradient.omitDefaultDirection",!0,"Do not output default direction definition in generated gradients.");p.define("css.gradient.defaultProperty","background-image","When gradient expanded outside CSS value context, it will produce properties with this name.");p.define("css.gradient.fallback",!1,"With this option enabled, CSS gradient generator will produce <code>background-color</code> property with gradient first color as fallback for old browsers.");
|
||||
h("expandAbbreviation").addHandler(function(a,b,c){var e=h("editorUtils").outputInfo(a,b,c);if(!d.include(s,e.syntax))return!1;var c=a.getCaretPos(),g=e.content,e=n(g,c);if(e.property){var f=l(e.property);if(f){var b=e.rule.options.offset||0,i=b+e.rule.toString().length;if(/[\n\r]/.test(e.property.value())){var o=e.property.valueRange(!0).start+f.valueRange.end,g=h("utils").replaceSubstring(g,";",o),c=n(g,c);c.property&&(f=l(c.property),e=c)}e.property.end(";");j(e.property,f.gradient,f.valueRange);
|
||||
a.replaceContent(e.rule.toString(),b,i,!0);return!0}}return m(a,b)});h("reflectCSSValue").addHandler(function(a){var b=h("utils"),c=l(a);if(!c)return!1;var g=a.value(),f=function(a){return b.replaceSubstring(g,a,c.valueRange)};d.each(a.parent.getAll(e(a.name())),function(b){if(b!==a){var d=b.value().match(/^\s*(\-([a-z]+)\-)?linear\-gradient/);d?b.value(f(q.toString(c.gradient,d[2]||""))):b.value().match(/\s*\-webkit\-gradient/)&&b.value(f(q.oldWebkitLinearGradient(c.gradient)))}});return!0});return q=
|
||||
{parse:function(a){var b=null;h("utils").trim(a).replace(/^([\w\-]+)\((.+?)\)$/,function(a,c,e){c=c.toLowerCase().replace(/^\-[a-z]+\-/,"");if(c=="linear-gradient"||c=="lg"){for(var a=o[0],e=h("stringStream").create(h("utils").trim(e)),c=[],g;g=e.next();)e.peek()==","?(c.push(e.current()),e.next(),e.eatSpace(),e.start=e.pos):g=="("&&e.skipTo(")");c.push(e.current());c=d.compact(d.map(c,f));if(c.length){if(r.test(c[0])||u.test(c[0]))a=c.shift();b={type:"linear",direction:a,colorStops:d.map(c,i)}}else b=
|
||||
null;return""}return a});return b},oldWebkitLinearGradient:function(c){d.isString(c)&&(c=this.parse(c));if(!c)return null;var e=d.map(c.colorStops,d.clone);d.each(e,function(a){if("position"in a)if(~a.position.indexOf(".")||a.unit=="%")a.position=parseFloat(a.position)/(a.unit=="%"?100:1);else throw"Can't convert color stop '"+(a.position+(a.unit||""))+"'";});b(e);e=d.map(e,function(a,b){return!a.position&&!b?"from("+a.color+")":a.position==1&&b==e.length-1?"to("+a.color+")":"color-stop("+a.position.toFixed(2).replace(/\.?0+$/,
|
||||
"")+", "+a.color+")"});return"-webkit-gradient(linear, "+a(c.direction)+", "+e.join(", ")+")"},toString:function(a,b){if(a.type=="linear"){var c=(b?"-"+b+"-":"")+"linear-gradient",e=d.map(a.colorStops,function(a){return a.color+("position"in a?" "+a.position+(a.unit||""):"")});a.direction&&(!p.get("css.gradient.omitDefaultDirection")||!d.include(o,a.direction))&&e.unshift(a.direction);return c+"("+e.join(", ")+")"}}}});
|
||||
emmet.exec(function(h,d){var f=h("handlerList").create(),i=h("resources");d.extend(i,{addGenerator:function(b,c,a){d.isString(b)&&(b=RegExp(b));f.add(function(a,d){var f;return(f=b.exec(a.name()))?c(f,a,d):null},a)}});i.addResolver(function(b,c){return f.exec(null,d.toArray(arguments))})});
|
||||
emmet.define("tagName",function(h,d){var f={empty:"area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,keygen,command".split(","),blockLevel:"address,applet,blockquote,button,center,dd,del,dir,div,dl,dt,fieldset,form,frameset,hr,iframe,ins,isindex,li,link,map,menu,noframes,noscript,object,ol,p,pre,script,table,tbody,td,tfoot,th,thead,tr,ul,h1,h2,h3,h4,h5,h6".split(","),inlineLevel:"a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var".split(",")},
|
||||
i={p:"span",ul:"li",ol:"li",table:"tr",tr:"td",tbody:"tr",thead:"tr",tfoot:"tr",colgroup:"col",select:"option",optgroup:"option",audio:"source",video:"source",object:"param",map:"area"};return{resolve:function(b){b=(b||"").toLowerCase();return b in i?this.getMapping(b):this.isInlineLevel(b)?"span":"div"},getMapping:function(b){return i[b.toLowerCase()]},isInlineLevel:function(b){return this.isTypeOf(b,"inlineLevel")},isBlockLevel:function(b){return this.isTypeOf(b,"blockLevel")},isEmptyElement:function(b){return this.isTypeOf(b,
|
||||
"empty")},isTypeOf:function(b,c){return d.include(f[c],b)},addMapping:function(b,c){i[b]=c},removeMapping:function(b){b in i&&delete i[b]},addElementToCollection:function(b,c){f[c]||(f[c]=[]);var a=this.getCollection(c);d.include(a,b)||a.push(b)},removeElementFromCollection:function(b,c){c in f&&(f[c]=d.without(this.getCollection(c),b))},getCollection:function(b){return f[b]}}});
|
||||
emmet.exec(function(h,d){function f(){return{element:e.get("bem.elementSeparator"),modifier:e.get("bem.modifierSeparator")}}function i(a){if(h("abbreviationUtils").isSnippet(a))return a;a.__bem={block:"",element:"",modifier:""};var e=b(a.attribute("class")).split(" "),g=/^[a-z]\-/i;a.__bem.block=d.find(e,function(a){return g.test(a)});if(!a.__bem.block)g=/^[a-z]/i,a.__bem.block=d.find(e,function(a){return g.test(a)})||"";(e=d.chain(e).map(function(b){var d;d=c(b,a,"element");d=c(d,a,"modifier");var e=
|
||||
"",g="",h="",b=f();~d.indexOf(b.element)?(e=d.split(b.element),h=e[1].split(b.modifier),e=e[0],g=h.shift(),h=h.join(b.modifier)):~d.indexOf(b.modifier)&&(h=d.split(b.modifier),e=h.shift(),h=h.join(b.modifier));if(e||g||h){if(!e)e=a.__bem.block;d=e;var i=[];g&&(d+=b.element+g);i.push(d);h&&i.push(d+b.modifier+h);a.__bem.block=e;a.__bem.element=g;a.__bem.modifier=h;b=i}else b=d;return b}).flatten().uniq().value().join(" "))&&a.attribute("class",e);return a}function b(a){var b=h("utils"),a=(" "+(a||
|
||||
"")+" ").replace(/\s+/g," "),c=e.get("bem.shortElementPrefix");c&&(c=RegExp("\\s("+b.escapeForRegexp(c)+"+)","g"),a=a.replace(c,function(a,c){return" "+b.repeatString(f().element,c.length)}));return b.trim(a)}function c(a,b,c){var d=f(),e=RegExp("^("+d[c]+")+","g");if(e.test(a)){for(var g=0,e=a.replace(e,function(a){g=a.length/d[c].length;return""}),h=b;h.parent&&g--;)h=h.parent;if(!h||!h.__bem)h=b;if(h&&h.__bem)return a=h.__bem.block,c=="modifier"&&h.__bem.element&&(a+=d.element+h.__bem.element),
|
||||
a+d[c]+e}return a}function a(b,c){b.name&&i(b,c);var e=h("abbreviationUtils");d.each(b.children,function(b){a(b,c);!e.isSnippet(b)&&b.start&&(g=!0)});return b}var e=h("preferences");e.define("bem.elementSeparator","__","Class name\u2019s element separator.");e.define("bem.modifierSeparator","_","Class name\u2019s modifier separator.");e.define("bem.shortElementPrefix","-","Symbol for describing short \u201cblock-element\u201d notation. Class names prefixed with this symbol will be treated as element name for parent\u2018s block name. Each symbol instance traverses one level up in parsed tree for block name lookup. Empty value will disable short notation.");
|
||||
var g=!1;h("filters").add("bem",function(b,c){g=!1;b=a(b,c);g&&(b=h("filters").apply(b,"html",c));return b})});
|
||||
emmet.exec(function(h,d){function f(c,a,e){var g=h("utils"),f=b.get("filter.commentTrigger");if(f=="*"||d.find(f.split(","),function(a){return!!c.attribute(g.trim(a))}))f={node:c,name:c.name(),padding:c.parent?c.parent.padding:"",attr:function(a,b,d){return(a=c.attribute(a))?(b||"")+a+(d||""):""}},a=g.normalizeNewline(a?a(f):""),e=g.normalizeNewline(e?e(f):""),c.start=c.start.replace(/</,a+"<"),c.end=c.end.replace(/>/,">"+e)}function i(b,a,e){var g=h("abbreviationUtils");d.each(b.children,function(b){g.isBlock(b)&&
|
||||
f(b,a,e);i(b,a,e)});return b}var b=h("preferences");b.define("filter.commentAfter",'\n<\!-- /<%= attr("id", "#") %><%= attr("class", ".") %> --\>',"A definition of comment that should be placed <i>after</i> matched element when <code>comment</code> filter is applied. This definition is an ERB-style template passed to <code>_.template()</code> function (see Underscore.js docs for details). In template context, the following properties and functions are availabe:\n<ul><li><code>attr(name, before, after)</code> \u2013 a function that outputsspecified attribute value concatenated with <code>before</code> and <code>after</code> strings. If attribute doesn't exists, the empty string will be returned.</li><li><code>node</code> \u2013 current node (instance of <code>AbbreviationNode</code>)</li><li><code>name</code> \u2013 name of current tag</li><li><code>padding</code> \u2013 current string padding, can be used for formatting</li></ul>");
|
||||
b.define("filter.commentBefore","","A definition of comment that should be placed <i>before</i> matched element when <code>comment</code> filter is applied. For more info, read description of <code>filter.commentAfter</code> property");b.define("filter.commentTrigger","id, class","A comma-separated list of attribute names that should exist in abbreviatoin where comment should be added. If you wish to add comment for every element, set this option to <code>*</code>");h("filters").add("c",function(c){var a=
|
||||
d.template(b.get("filter.commentBefore")),e=d.template(b.get("filter.commentAfter"));return i(c,a,e)})});emmet.exec(function(h,d){function f(b){return b.replace(/([<>&])/g,function(b,a){return i[a]})}var i={"<":"<",">":">","&":"&"};h("filters").add("e",function c(a){d.each(a.children,function(a){a.start=f(a.start);a.end=f(a.end);a.content=f(a.content);c(a)});return a})});
|
||||
emmet.exec(function(h,d){function f(){return h("resources").getVariable("indentation")}function i(a){return a.parent&&!a.parent.parent&&!a.index()}function b(a,b){var d=h("abbreviationUtils");return b.tag_nl===!0||d.isBlock(a)?!0:!a.parent||!b.inline_break?!1:c(a.parent,b)}function c(a,b){var c=0,f=h("abbreviationUtils");return!!d.find(a.children,function(a){a.isTextNode()||!f.isInline(a)?c=0:f.isInline(a)&&c++;if(c>=b.inline_break)return!0})}function a(a,b){var f=h("abbreviationUtils");return!d.any(a.children,
|
||||
function(a){return f.isSnippet(a)?!1:!f.isInline(a)})?c(a,b):!0}h("filters").add("_format",function g(c,l,m){var m=m||0,n=h("abbreviationUtils");d.each(c.children,function(c){if(n.isSnippet(c)){if(c.start=c.end="",!i(c)&&l.tag_nl!==!1&&b(c,l)&&!h("abbreviationUtils").isInline(c.parent))c.start=h("utils").getNewline()+c.start}else{c.start=c.end="%s";var d=h("utils"),j=h("abbreviationUtils"),r=j.isUnary(c),d=d.getNewline();if(l.tag_nl!==!1){var u=l.tag_nl===!0&&(l.tag_nl_leaf||c.children.length);if(!c.isTextNode()){if(b(c,
|
||||
l)){if(!i(c)&&(!j.isSnippet(c.parent)||c.index()))c.start=d+c.start;if(j.hasBlockChildren(c)||c.children.length&&b(c.children[0],l)||u&&!r)c.end=d+c.end;if(j.hasTagsInContent(c)||u&&!c.children.length&&!r)c.start+=d+f()}else if(j.isInline(c)&&c.parent&&h("abbreviationUtils").hasBlockChildren(c.parent)&&!i(c))c.start=d+c.start;else if(j.isInline(c)&&a(c,l))c.end=d+c.end;c.padding=f()}}}g(c,l,m+1)});return c})});
|
||||
emmet.exec(function(h,d){function f(f,b){var c="",a=[],e=b.attributeQuote(),g=b.cursor();d.each(f.attributeList(),function(d){var f=b.attributeName(d.name);switch(f.toLowerCase()){case "id":c+="#"+(d.value||g);break;case "class":c+="."+h("utils").trim(d.value||g).replace(/\s+/g,".");break;default:a.push(":"+f+" => "+e+(d.value||g)+e)}});a.length&&(c+="{"+a.join(", ")+"}");return c}h("filters").add("haml",function b(c,a,e){var e=e||0,g=h("abbreviationUtils");e||(c=h("filters").apply(c,"_format",a));
|
||||
d.each(c.children,function(c){if(!g.isSnippet(c)&&c.parent){var d=h("abbreviationUtils"),m=h("utils"),n=f(c,a),o=a.cursor(),d=d.isUnary(c),q=a.self_closing_tag&&d?"/":"",s="",s="%"+a.tagName(c.name());s.toLowerCase()=="%div"&&n&&n.indexOf("{")==-1&&(s="");c.end="";c.start=m.replaceSubstring(c.start,s+n+q+" ",c.start.indexOf("%s"),"%s");!c.children.length&&!d&&(c.start+=o)}b(c,a,e+1)});return c})});
|
||||
emmet.exec(function(h,d){function f(f,b){var c=b.attributeQuote(),a=b.cursor();return d.map(f.attributeList(),function(d){return" "+b.attributeName(d.name)+"="+c+(d.value||a)+c}).join("")}h("filters").add("html",function b(c,a,e){var e=e||0,g=h("abbreviationUtils");e||(c=h("filters").apply(c,"_format",a));d.each(c.children,function(c){if(!g.isSnippet(c)&&c.parent){var d=h("abbreviationUtils"),m=h("utils"),n=f(c,a),o=a.cursor(),d=d.isUnary(c),q="",s="";if(!c.isTextNode()){var r=a.tagName(c.name());
|
||||
d?(q="<"+r+n+a.selfClosing()+">",c.end=""):(q="<"+r+n+">",s="</"+r+">")}c.start=m.replaceSubstring(c.start,q,c.start.indexOf("%s"),"%s");c.end=m.replaceSubstring(c.end,s,c.end.indexOf("%s"),"%s");!c.children.length&&!d&&c.content.indexOf(o)==-1&&(c.start+=o)}b(c,a,e+1)});return c})});
|
||||
emmet.exec(function(h,d){var f=/^\s+/,i=/[\n\r]/g;h("filters").add("s",function c(a){var e=h("abbreviationUtils");d.each(a.children,function(a){if(!e.isSnippet(a))a.start=a.start.replace(f,""),a.end=a.end.replace(f,"");a.start=a.start.replace(i,"");a.end=a.end.replace(i,"");a.content=a.content.replace(i,"");c(a)});return a})});
|
||||
emmet.exec(function(h,d){function f(h,b){d.each(h.children,function(c){if(c.content)c.content=c.content.replace(b,"");f(c,b)});return h}h("preferences").define("filter.trimRegexp","[\\s|\\u00a0]*[\\d|#|\\-|*|\\u2022]+\\.?\\s*","Regular expression used to remove list markers (numbers, dashes, bullets, etc.) in <code>t</code> (trim) filter. The trim filter is useful for wrapping with abbreviation lists, pased from other documents (for example, Word documents).");h("filters").add("t",function(d){var b=
|
||||
RegExp(h("preferences").get("filter.trimRegexp"));return f(d,b)})});emmet.exec(function(h,d){var f={"xsl:variable":1,"xsl:with-param":1};h("filters").add("xsl",function b(c){var a=h("abbreviationUtils");d.each(c.children,function(c){if(!a.isSnippet(c)&&(c.name()||"").toLowerCase()in f&&c.children.length)c.start=c.start.replace(/\s+select\s*=\s*(['"]).*?\1/,"");b(c)});return c})});
|
||||
emmet.exec(function(h,d){function f(a,b){return Math.round(Math.random()*(b-a)+a)}function i(a,b){for(var c=a.length,e=Math.min(c,b),h=[];h.length<e;){var i=f(0,c-1);d.include(h,i)||h.push(i)}return d.map(h,function(b){return a[b]})}function b(a,b){a.length&&(a[0]=a[0].charAt(0).toUpperCase()+a[0].substring(1));return a.join(" ")+(b||(d.isString("?!...")?"?!...".charAt(f(0,4)):"?!..."[f(0,4)]))}function c(a){var b=a.length,c=0,c=b>3&&b<=6?f(0,1):b>6&&b<=12?f(0,2):f(1,4);d.each(i(d.range(c)),function(b){a[b]+=
|
||||
","})}h("abbreviationParser").addPreprocessor(function(d){var h=/^(?:lorem|lipsum)(\d*)$/i,l;d.findAll(function(d){if(d._name&&(l=d._name.match(h))){var g=l[1]||30;d._name="";d.data("forceNameResolving",d.isRepeating()||d.attributeList().length);d.data("pasteOverwrites",!0);d.data("paste",function(d){var h=g,j=!d,d=[],l=0,h=parseInt(h,10);j&&(j=a.slice(0,h),j.length>5&&(j[4]+=","),l+=j.length,d.push(b(j,".")));for(;l<h;)j=i(e,Math.min(f(3,12)*f(1,5),h-l)),l+=j.length,c(j),d.push(b(j));return d.join(" ")})}})});
|
||||
var a="lorem ipsum dolor sit amet consectetur adipisicing elit".split(" "),e=["exercitationem","perferendis","perspiciatis","laborum","eveniet","sunt","iure","nam","nobis","eum","cum","officiis","excepturi","odio","consectetur","quasi","aut","quisquam","vel","eligendi","itaque","non","odit","tempore","quaerat","dignissimos","facilis","neque","nihil","expedita","vitae","vero","ipsum","nisi","animi","cumque","pariatur","velit","modi","natus","iusto","eaque","sequi","illo","sed","ex","et","voluptatibus",
|
||||
"tempora","veritatis","ratione","assumenda","incidunt","nostrum","placeat","aliquid","fuga","provident","praesentium","rem","necessitatibus","suscipit","adipisci","quidem","possimus","voluptas","debitis","sint","accusantium","unde","sapiente","voluptate","qui","aspernatur","laudantium","soluta","amet","quo","aliquam","saepe","culpa","libero","ipsa","dicta","reiciendis","nesciunt","doloribus","autem","impedit","minima","maiores","repudiandae","ipsam","obcaecati","ullam","enim","totam","delectus","ducimus",
|
||||
"quis","voluptates","dolores","molestiae","harum","dolorem","quia","voluptatem","molestias","magni","distinctio","omnis","illum","dolorum","voluptatum","ea","quas","quam","corporis","quae","blanditiis","atque","deserunt","laboriosam","earum","consequuntur","hic","cupiditate","quibusdam","accusamus","ut","rerum","error","minus","eius","ab","ad","nemo","fugit","officia","at","in","id","quos","reprehenderit","numquam","iste","fugiat","sit","inventore","beatae","repellendus","magnam","recusandae","quod",
|
||||
"explicabo","doloremque","aperiam","consequatur","asperiores","commodi","optio","dolor","labore","temporibus","repellat","veniam","architecto","est","esse","mollitia","nulla","a","similique","eos","alias","dolore","tenetur","deleniti","porro","facere","maxime","corrupti"]});emmet.exec(function(h){h("actions").add("select_line",function(d){var f=d.getCurrentLineRange();d.createSelection(f.start,f.end);return!0})});
|
||||
emmet.exec(function(h){h("resources").setVocabulary({variables:{lang:"en",locale:"en-US",charset:"UTF-8",indentation:"\t",newline:"\n"},css:{filters:"html",snippets:{"@i":"@import url(|);","@m":"@media print {\n\t|\n}","@f":"@font-face {\n\tfont-family:|;\n\tsrc:url(|);\n}","@f+":"@font-face {\n\tfont-family: '${1:FontName}';\n\tsrc: url('${2:FileName}.eot');\n\tsrc: url('${2:FileName}.eot?#iefix') format('embedded-opentype'),\n\t\t url('${2:FileName}.woff') format('woff'),\n\t\t url('${2:FileName}.ttf') format('truetype'),\n\t\t url('${2:FileName}.svg#${1:FontName}') format('svg');\n\tfont-style: ${3:normal};\n\tfont-weight: ${4:normal};\n}",
|
||||
"!":"!important",pos:"position:|;","pos:s":"position:static;","pos:a":"position:absolute;","pos:r":"position:relative;","pos:f":"position:fixed;",t:"top:|;","t:a":"top:auto;",r:"right:|;","r:a":"right:auto;",b:"bottom:|;","b:a":"bottom:auto;",l:"left:|;","l:a":"left:auto;",z:"z-index:|;","z:a":"z-index:auto;",fl:"float:|;","fl:n":"float:none;","fl:l":"float:left;","fl:r":"float:right;",cl:"clear:|;","cl:n":"clear:none;","cl:l":"clear:left;","cl:r":"clear:right;","cl:b":"clear:both;",d:"display:|;",
|
||||
"d:n":"display:none;","d:b":"display:block;","d:i":"display:inline;","d:ib":"display:inline-block;","d:li":"display:list-item;","d:ri":"display:run-in;","d:cp":"display:compact;","d:tb":"display:table;","d:itb":"display:inline-table;","d:tbcp":"display:table-caption;","d:tbcl":"display:table-column;","d:tbclg":"display:table-column-group;","d:tbhg":"display:table-header-group;","d:tbfg":"display:table-footer-group;","d:tbr":"display:table-row;","d:tbrg":"display:table-row-group;","d:tbc":"display:table-cell;",
|
||||
"d:rb":"display:ruby;","d:rbb":"display:ruby-base;","d:rbbg":"display:ruby-base-group;","d:rbt":"display:ruby-text;","d:rbtg":"display:ruby-text-group;",v:"visibility:|;","v:v":"visibility:visible;","v:h":"visibility:hidden;","v:c":"visibility:collapse;",ov:"overflow:|;","ov:v":"overflow:visible;","ov:h":"overflow:hidden;","ov:s":"overflow:scroll;","ov:a":"overflow:auto;",ovx:"overflow-x:|;","ovx:v":"overflow-x:visible;","ovx:h":"overflow-x:hidden;","ovx:s":"overflow-x:scroll;","ovx:a":"overflow-x:auto;",
|
||||
ovy:"overflow-y:|;","ovy:v":"overflow-y:visible;","ovy:h":"overflow-y:hidden;","ovy:s":"overflow-y:scroll;","ovy:a":"overflow-y:auto;",ovs:"overflow-style:|;","ovs:a":"overflow-style:auto;","ovs:s":"overflow-style:scrollbar;","ovs:p":"overflow-style:panner;","ovs:m":"overflow-style:move;","ovs:mq":"overflow-style:marquee;",zoo:"zoom:1;",cp:"clip:|;","cp:a":"clip:auto;","cp:r":"clip:rect(|);",bxz:"box-sizing:|;","bxz:cb":"box-sizing:content-box;","bxz:bb":"box-sizing:border-box;",bxsh:"box-shadow:${1:hoff} ${2:voff} ${3:radius} ${4:color};",
|
||||
"bxsh:n":"box-shadow:none;",m:"margin:|;","m:a":"margin:auto;",mt:"margin-top:|;","mt:a":"margin-top:auto;",mr:"margin-right:|;","mr:a":"margin-right:auto;",mb:"margin-bottom:|;","mb:a":"margin-bottom:auto;",ml:"margin-left:|;","ml:a":"margin-left:auto;",p:"padding:|;",pt:"padding-top:|;",pr:"padding-right:|;",pb:"padding-bottom:|;",pl:"padding-left:|;",w:"width:|;","w:a":"width:auto;",h:"height:|;","h:a":"height:auto;",maw:"max-width:|;","maw:n":"max-width:none;",mah:"max-height:|;","mah:n":"max-height:none;",
|
||||
miw:"min-width:|;",mih:"min-height:|;",o:"outline:|;","o:n":"outline:none;",oo:"outline-offset:|;",ow:"outline-width:|;",os:"outline-style:|;",oc:"outline-color:#${1:000};","oc:i":"outline-color:invert;",bd:"border:|;","bd+":"border:${1:1px} ${2:solid} ${3:#000};","bd:n":"border:none;",bdbk:"border-break:|;","bdbk:c":"border-break:close;",bdcl:"border-collapse:|;","bdcl:c":"border-collapse:collapse;","bdcl:s":"border-collapse:separate;",bdc:"border-color:#${1:000};",bdi:"border-image:url(|);","bdi:n":"border-image:none;",
|
||||
bdti:"border-top-image:url(|);","bdti:n":"border-top-image:none;",bdri:"border-right-image:url(|);","bdri:n":"border-right-image:none;",bdbi:"border-bottom-image:url(|);","bdbi:n":"border-bottom-image:none;",bdli:"border-left-image:url(|);","bdli:n":"border-left-image:none;",bdci:"border-corner-image:url(|);","bdci:n":"border-corner-image:none;","bdci:c":"border-corner-image:continue;",bdtli:"border-top-left-image:url(|);","bdtli:n":"border-top-left-image:none;","bdtli:c":"border-top-left-image:continue;",
|
||||
bdtri:"border-top-right-image:url(|);","bdtri:n":"border-top-right-image:none;","bdtri:c":"border-top-right-image:continue;",bdbri:"border-bottom-right-image:url(|);","bdbri:n":"border-bottom-right-image:none;","bdbri:c":"border-bottom-right-image:continue;",bdbli:"border-bottom-left-image:url(|);","bdbli:n":"border-bottom-left-image:none;","bdbli:c":"border-bottom-left-image:continue;",bdf:"border-fit:|;","bdf:c":"border-fit:clip;","bdf:r":"border-fit:repeat;","bdf:sc":"border-fit:scale;","bdf:st":"border-fit:stretch;",
|
||||
"bdf:ow":"border-fit:overwrite;","bdf:of":"border-fit:overflow;","bdf:sp":"border-fit:space;",bdl:"border-length:|;","bdl:a":"border-length:auto;",bdsp:"border-spacing:|;",bds:"border-style:|;","bds:n":"border-style:none;","bds:h":"border-style:hidden;","bds:dt":"border-style:dotted;","bds:ds":"border-style:dashed;","bds:s":"border-style:solid;","bds:db":"border-style:double;","bds:dtds":"border-style:dot-dash;","bds:dtdtds":"border-style:dot-dot-dash;","bds:w":"border-style:wave;","bds:g":"border-style:groove;",
|
||||
"bds:r":"border-style:ridge;","bds:i":"border-style:inset;","bds:o":"border-style:outset;",bdw:"border-width:|;",bdt:"border-top:|;",bt:"border-top:|;","bdt+":"border-top:${1:1px} ${2:solid} ${3:#000};","bdt:n":"border-top:none;",bdtw:"border-top-width:|;",bdts:"border-top-style:|;","bdts:n":"border-top-style:none;",bdtc:"border-top-color:#${1:000};",bdr:"border-right:|;",br:"border-right:|;","bdr+":"border-right:${1:1px} ${2:solid} ${3:#000};","bdr:n":"border-right:none;",bdrw:"border-right-width:|;",
|
||||
bdrs:"border-right-style:|;","bdrs:n":"border-right-style:none;",bdrc:"border-right-color:#${1:000};",bdb:"border-bottom:|;",bb:"border-bottom:|;","bdb+":"border-bottom:${1:1px} ${2:solid} ${3:#000};","bdb:n":"border-bottom:none;",bdbw:"border-bottom-width:|;",bdbs:"border-bottom-style:|;","bdbs:n":"border-bottom-style:none;",bdbc:"border-bottom-color:#${1:000};",bdl:"border-left:|;",bl:"border-left:|;","bdl+":"border-left:${1:1px} ${2:solid} ${3:#000};","bdl:n":"border-left:none;",bdlw:"border-left-width:|;",
|
||||
bdls:"border-left-style:|;","bdls:n":"border-left-style:none;",bdlc:"border-left-color:#${1:000};",bdrs:"border-radius:|;",bdtrrs:"border-top-right-radius:|;",bdtlrs:"border-top-left-radius:|;",bdbrrs:"border-bottom-right-radius:|;",bdblrs:"border-bottom-left-radius:|;",bg:"background:|;","bg+":"background:${1:#fff} url(${2}) ${3:0} ${4:0} ${5:no-repeat};","bg:n":"background:none;","bg:ie":"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='${1:x}.png',sizingMethod='${2:crop}');",bgc:"background-color:#${1:fff};",
|
||||
bgi:"background-image:url(|);","bgi:n":"background-image:none;",bgr:"background-repeat:|;","bgr:n":"background-repeat:no-repeat;","bgr:x":"background-repeat:repeat-x;","bgr:y":"background-repeat:repeat-y;",bga:"background-attachment:|;","bga:f":"background-attachment:fixed;","bga:s":"background-attachment:scroll;",bgp:"background-position:${1:0} ${2:0};",bgpx:"background-position-x:|;",bgpy:"background-position-y:|;",bgbk:"background-break:|;","bgbk:bb":"background-break:bounding-box;","bgbk:eb":"background-break:each-box;",
|
||||
"bgbk:c":"background-break:continuous;",bgcp:"background-clip:|;","bgcp:bb":"background-clip:border-box;","bgcp:pb":"background-clip:padding-box;","bgcp:cb":"background-clip:content-box;","bgcp:nc":"background-clip:no-clip;",bgo:"background-origin:|;","bgo:pb":"background-origin:padding-box;","bgo:bb":"background-origin:border-box;","bgo:cb":"background-origin:content-box;",bgz:"background-size:|;","bgz:a":"background-size:auto;","bgz:ct":"background-size:contain;","bgz:cv":"background-size:cover;",
|
||||
c:"color:#${1:000};",cm:"/* |${child} */",cn:"content:|;",tbl:"table-layout:|;","tbl:a":"table-layout:auto;","tbl:f":"table-layout:fixed;",cps:"caption-side:|;","cps:t":"caption-side:top;","cps:b":"caption-side:bottom;",ec:"empty-cells:|;","ec:s":"empty-cells:show;","ec:h":"empty-cells:hide;",lis:"list-style:|;","lis:n":"list-style:none;",lisp:"list-style-position:|;","lisp:i":"list-style-position:inside;","lisp:o":"list-style-position:outside;",list:"list-style-type:|;","list:n":"list-style-type:none;",
|
||||
"list:d":"list-style-type:disc;","list:c":"list-style-type:circle;","list:s":"list-style-type:square;","list:dc":"list-style-type:decimal;","list:dclz":"list-style-type:decimal-leading-zero;","list:lr":"list-style-type:lower-roman;","list:ur":"list-style-type:upper-roman;",lisi:"list-style-image:|;","lisi:n":"list-style-image:none;",q:"quotes:|;","q:n":"quotes:none;","q:ru":"quotes:'\\00AB' '\\00BB' '\\201E' '\\201C';","q:en":"quotes:'\\201C' '\\201D' '\\2018' '\\2019';",ct:"content:|;","ct:n":"content:normal;",
|
||||
"ct:oq":"content:open-quote;","ct:noq":"content:no-open-quote;","ct:cq":"content:close-quote;","ct:ncq":"content:no-close-quote;","ct:a":"content:attr(|);","ct:c":"content:counter(|);","ct:cs":"content:counters(|);",coi:"counter-increment:|;",cor:"counter-reset:|;",va:"vertical-align:|;","va:sup":"vertical-align:super;","va:t":"vertical-align:top;","va:tt":"vertical-align:text-top;","va:m":"vertical-align:middle;","va:bl":"vertical-align:baseline;","va:b":"vertical-align:bottom;","va:tb":"vertical-align:text-bottom;",
|
||||
"va:sub":"vertical-align:sub;",ta:"text-align:|;","ta:l":"text-align:left;","ta:c":"text-align:center;","ta:r":"text-align:right;",tal:"text-align-last:|;","tal:a":"text-align-last:auto;","tal:l":"text-align-last:left;","tal:c":"text-align-last:center;","tal:r":"text-align-last:right;",td:"text-decoration:|;","td:n":"text-decoration:none;","td:u":"text-decoration:underline;","td:o":"text-decoration:overline;","td:l":"text-decoration:line-through;",te:"text-emphasis:|;","te:n":"text-emphasis:none;",
|
||||
"te:ac":"text-emphasis:accent;","te:dt":"text-emphasis:dot;","te:c":"text-emphasis:circle;","te:ds":"text-emphasis:disc;","te:b":"text-emphasis:before;","te:a":"text-emphasis:after;",th:"text-height:|;","th:a":"text-height:auto;","th:f":"text-height:font-size;","th:t":"text-height:text-size;","th:m":"text-height:max-size;",ti:"text-indent:|;","ti:-":"text-indent:-9999px;",tj:"text-justify:|;","tj:a":"text-justify:auto;","tj:iw":"text-justify:inter-word;","tj:ii":"text-justify:inter-ideograph;","tj:ic":"text-justify:inter-cluster;",
|
||||
"tj:d":"text-justify:distribute;","tj:k":"text-justify:kashida;","tj:t":"text-justify:tibetan;",to:"text-outline:|;","to+":"text-outline:${1:0} ${2:0} ${3:#000};","to:n":"text-outline:none;",tr:"text-replace:|;","tr:n":"text-replace:none;",tt:"text-transform:|;","tt:n":"text-transform:none;","tt:c":"text-transform:capitalize;","tt:u":"text-transform:uppercase;","tt:l":"text-transform:lowercase;",tw:"text-wrap:|;","tw:n":"text-wrap:normal;","tw:no":"text-wrap:none;","tw:u":"text-wrap:unrestricted;",
|
||||
"tw:s":"text-wrap:suppress;",tsh:"text-shadow:${1:hoff} ${2:voff} ${3:blur} ${4:#000};","tsh+":"text-shadow:${1:0} ${2:0} ${3:0} ${4:#000};","tsh:n":"text-shadow:none;",trf:"transform:|;","trf:skx":"transform: skewX(${1:angle});","trf:sky":"transform: skewY(${1:angle});","trf:sc":"transform: scale(${1:x}, ${2:y});","trf:scx":"transform: scaleX(${1:x});","trf:scy":"transform: scaleY(${1:y});","trf:r":"transform: rotate(${1:angle});","trf:t":"transform: translate(${1:x}, ${2:y});","trf:tx":"transform: translateX(${1:x});",
|
||||
"trf:ty":"transform: translateY(${1:y});",trs:"transition:${1:prop} ${2:time};",trsde:"transition-delay:${1:time};",trsdu:"transition-duration:${1:time};",trsp:"transition-property:${1:prop};",trstf:"transition-timing-function:${1:tfunc};",lh:"line-height:|;",whs:"white-space:|;","whs:n":"white-space:normal;","whs:p":"white-space:pre;","whs:nw":"white-space:nowrap;","whs:pw":"white-space:pre-wrap;","whs:pl":"white-space:pre-line;",whsc:"white-space-collapse:|;","whsc:n":"white-space-collapse:normal;",
|
||||
"whsc:k":"white-space-collapse:keep-all;","whsc:l":"white-space-collapse:loose;","whsc:bs":"white-space-collapse:break-strict;","whsc:ba":"white-space-collapse:break-all;",wob:"word-break:|;","wob:n":"word-break:normal;","wob:k":"word-break:keep-all;","wob:l":"word-break:loose;","wob:bs":"word-break:break-strict;","wob:ba":"word-break:break-all;",wos:"word-spacing:|;",wow:"word-wrap:|;","wow:nm":"word-wrap:normal;","wow:n":"word-wrap:none;","wow:u":"word-wrap:unrestricted;","wow:s":"word-wrap:suppress;",
|
||||
lts:"letter-spacing:|;",f:"font:|;","f+":"font:${1:1em} ${2:Arial,sans-serif};",fw:"font-weight:|;","fw:n":"font-weight:normal;","fw:b":"font-weight:bold;","fw:br":"font-weight:bolder;","fw:lr":"font-weight:lighter;",fs:"font-style:|;","fs:n":"font-style:normal;","fs:i":"font-style:italic;","fs:o":"font-style:oblique;",fv:"font-variant:|;","fv:n":"font-variant:normal;","fv:sc":"font-variant:small-caps;",fz:"font-size:|;",fza:"font-size-adjust:|;","fza:n":"font-size-adjust:none;",ff:"font-family:|;",
|
||||
"ff:s":"font-family:serif;","ff:ss":"font-family:sans-serif;","ff:c":"font-family:cursive;","ff:f":"font-family:fantasy;","ff:m":"font-family:monospace;",fef:"font-effect:|;","fef:n":"font-effect:none;","fef:eg":"font-effect:engrave;","fef:eb":"font-effect:emboss;","fef:o":"font-effect:outline;",fem:"font-emphasize:|;",femp:"font-emphasize-position:|;","femp:b":"font-emphasize-position:before;","femp:a":"font-emphasize-position:after;",fems:"font-emphasize-style:|;","fems:n":"font-emphasize-style:none;",
|
||||
"fems:ac":"font-emphasize-style:accent;","fems:dt":"font-emphasize-style:dot;","fems:c":"font-emphasize-style:circle;","fems:ds":"font-emphasize-style:disc;",fsm:"font-smooth:|;","fsm:a":"font-smooth:auto;","fsm:n":"font-smooth:never;","fsm:aw":"font-smooth:always;",fst:"font-stretch:|;","fst:n":"font-stretch:normal;","fst:uc":"font-stretch:ultra-condensed;","fst:ec":"font-stretch:extra-condensed;","fst:c":"font-stretch:condensed;","fst:sc":"font-stretch:semi-condensed;","fst:se":"font-stretch:semi-expanded;",
|
||||
"fst:e":"font-stretch:expanded;","fst:ee":"font-stretch:extra-expanded;","fst:ue":"font-stretch:ultra-expanded;",op:"opacity:|;","op:ie":"filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100);","op:ms":"-ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=100)';",rz:"resize:|;","rz:n":"resize:none;","rz:b":"resize:both;","rz:h":"resize:horizontal;","rz:v":"resize:vertical;",cur:"cursor:|;","cur:a":"cursor:auto;","cur:d":"cursor:default;","cur:c":"cursor:crosshair;","cur:ha":"cursor:hand;",
|
||||
"cur:he":"cursor:help;","cur:m":"cursor:move;","cur:p":"cursor:pointer;","cur:t":"cursor:text;",pgbb:"page-break-before:|;","pgbb:au":"page-break-before:auto;","pgbb:al":"page-break-before:always;","pgbb:l":"page-break-before:left;","pgbb:r":"page-break-before:right;",pgbi:"page-break-inside:|;","pgbi:au":"page-break-inside:auto;","pgbi:av":"page-break-inside:avoid;",pgba:"page-break-after:|;","pgba:au":"page-break-after:auto;","pgba:al":"page-break-after:always;","pgba:l":"page-break-after:left;",
|
||||
"pgba:r":"page-break-after:right;",orp:"orphans:|;",wid:"widows:|;"}},html:{filters:"html",profile:"html",snippets:{c:"<\!-- |${child} --\>","cc:ie6":"<\!--[if lte IE 6]>\n\t${child}|\n<![endif]--\>","cc:ie":"<\!--[if IE]>\n\t${child}|\n<![endif]--\>","cc:noie":"<\!--[if !IE]><\!--\>\n\t${child}|\n<\!--<![endif]--\>","html:4t":'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\n<html lang="${lang}">\n<head>\n\t<meta http-equiv="Content-Type" content="text/html;charset=${charset}">\n\t<title>${1:Document}</title>\n</head>\n<body>\n\t${child}${2}\n</body>\n</html>',
|
||||
"html:4s":'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\n<html lang="${lang}">\n<head>\n\t<meta http-equiv="Content-Type" content="text/html;charset=${charset}">\n\t<title>${1:Document}</title>\n</head>\n<body>\n\t${child}${2}\n</body>\n</html>',"html:xt":'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="${lang}">\n<head>\n\t<meta http-equiv="Content-Type" content="text/html;charset=${charset}" />\n\t<title></title>\n</head>\n<body>\n\t${child}${2}\n</body>\n</html>',
|
||||
"html:xs":'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="${lang}">\n<head>\n\t<meta http-equiv="Content-Type" content="text/html;charset=${charset}" />\n\t<title>${1:Document}</title>\n</head>\n<body>\n\t${child}${2}\n</body>\n</html>',"html:xxs":'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\n<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="${lang}">\n<head>\n\t<meta http-equiv="Content-Type" content="text/html;charset=${charset}" />\n\t<title>${1:Document}</title>\n</head>\n<body>\n\t${child}${2}\n</body>\n</html>',
|
||||
"html:5":'<!doctype html>\n<html lang="${lang}">\n<head>\n\t<meta charset="${charset}">\n\t<title>${1:Document}</title>\n</head>\n<body>\n\t${child}${2}\n</body>\n</html>'},abbreviations:{"!":"html:5",a:'<a href="">',"a:link":'<a href="http://|">',"a:mail":'<a href="mailto:|">',abbr:'<abbr title="">',acronym:'<acronym title="">',base:'<base href="" />',bdo:'<bdo dir="">',"bdo:r":'<bdo dir="rtl">',"bdo:l":'<bdo dir="ltr">',link:'<link rel="stylesheet" href="" />',"link:css":'<link rel="stylesheet" href="${1:style}.css" media="all" />',
|
||||
"link:print":'<link rel="stylesheet" href="${1:print}.css" media="print" />',"link:favicon":'<link rel="shortcut icon" type="image/x-icon" href="${1:favicon.ico}" />',"link:touch":'<link rel="apple-touch-icon" href="${1:favicon.png}" />',"link:rss":'<link rel="alternate" type="application/rss+xml" title="RSS" href="${1:rss.xml}" />',"link:atom":'<link rel="alternate" type="application/atom+xml" title="Atom" href="${1:atom.xml}" />',"meta:utf":'<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />',
|
||||
"meta:win":'<meta http-equiv="Content-Type" content="text/html;charset=windows-1251" />',"meta:compat":'<meta http-equiv="X-UA-Compatible" content="${1:IE=7}" />',style:"<style>",script:"<script>","script:src":'<script src="">',img:'<img src="" alt="" />',iframe:'<iframe src="" frameborder="0">',embed:'<embed src="" type="" />',object:'<object data="" type="">',param:'<param name="" value="" />',map:'<map name="">',area:'<area shape="" coords="" href="" alt="" />',"area:d":'<area shape="default" href="" alt="" />',
|
||||
"area:c":'<area shape="circle" coords="" href="" alt="" />',"area:r":'<area shape="rect" coords="" href="" alt="" />',"area:p":'<area shape="poly" coords="" href="" alt="" />',form:'<form action="">',"form:get":'<form action="" method="get">',"form:post":'<form action="" method="post">',label:'<label for="">',input:'<input type="" />',"input:hidden":'<input type="hidden" name="" />',"input:h":'<input type="hidden" name="" />',"input:text":'<input type="text" name="" id="" />',"input:t":'<input type="text" name="" id="" />',
|
||||
"input:search":'<input type="search" name="" id="" />',"input:email":'<input type="email" name="" id="" />',"input:url":'<input type="url" name="" id="" />',"input:password":'<input type="password" name="" id="" />',"input:p":'<input type="password" name="" id="" />',"input:datetime":'<input type="datetime" name="" id="" />',"input:date":'<input type="date" name="" id="" />',"input:datetime-local":'<input type="datetime-local" name="" id="" />',"input:month":'<input type="month" name="" id="" />',
|
||||
"input:week":'<input type="week" name="" id="" />',"input:time":'<input type="time" name="" id="" />',"input:number":'<input type="number" name="" id="" />',"input:color":'<input type="color" name="" id="" />',"input:checkbox":'<input type="checkbox" name="" id="" />',"input:c":'<input type="checkbox" name="" id="" />',"input:radio":'<input type="radio" name="" id="" />',"input:r":'<input type="radio" name="" id="" />',"input:range":'<input type="range" name="" id="" />',"input:file":'<input type="file" name="" id="" />',
|
||||
"input:f":'<input type="file" name="" id="" />',"input:submit":'<input type="submit" value="" />',"input:s":'<input type="submit" value="" />',"input:image":'<input type="image" src="" alt="" />',"input:i":'<input type="image" src="" alt="" />',"input:reset":'<input type="reset" value="" />',"input:button":'<input type="button" value="" />',"input:b":'<input type="button" value="" />',select:'<select name="" id=""></select>',option:'<option value=""></option>',textarea:'<textarea name="" id="" cols="${1:30}" rows="${2:10}">',
|
||||
"menu:context":'<menu type="context">',"menu:c":'<menu type="context">',"menu:toolbar":'<menu type="toolbar">',"menu:t":'<menu type="toolbar">',video:'<video src="">',audio:'<audio src="">',"html:xml":'<html xmlns="http://www.w3.org/1999/xhtml">',bq:"blockquote",acr:"acronym",fig:"figure",figc:"figcaption",ifr:"iframe",emb:"embed",obj:"object",src:"source",cap:"caption",colg:"colgroup",fst:"fieldset",btn:"button",optg:"optgroup",opt:"option",tarea:"textarea",leg:"legend",sect:"section",art:"article",
|
||||
hdr:"header",ftr:"footer",adr:"address",dlg:"dialog",str:"strong",prog:"progress",fset:"fieldset",datag:"datagrid",datal:"datalist",kg:"keygen",out:"output",det:"details",cmd:"command","ol+":"ol>li","ul+":"ul>li","dl+":"dl>dt+dd","map+":"map>area","table+":"table>tr>td","colgroup+":"colgroup>col","colg+":"colgroup>col","tr+":"tr>td","select+":"select>option","optgroup+":"optgroup>option","optg+":"optgroup>option"}},xml:{"extends":"html",profile:"xml",filters:"html"},xsl:{"extends":"html",profile:"xml",
|
||||
filters:"html, xsl",abbreviations:{tm:'<xsl:template match="" mode="">',tmatch:"tm",tn:'<xsl:template name="">',tname:"tn",call:'<xsl:call-template name=""/>',ap:'<xsl:apply-templates select="" mode=""/>',api:"<xsl:apply-imports/>",imp:'<xsl:import href=""/>',inc:'<xsl:include href=""/>',ch:"<xsl:choose>","xsl:when":'<xsl:when test="">',wh:"xsl:when",ot:"<xsl:otherwise>","if":'<xsl:if test="">',par:'<xsl:param name="">',pare:'<xsl:param name="" select=""/>',"var":'<xsl:variable name="">',vare:'<xsl:variable name="" select=""/>',
|
||||
wp:'<xsl:with-param name="" select=""/>',key:'<xsl:key name="" match="" use=""/>',elem:'<xsl:element name="">',attr:'<xsl:attribute name="">',attrs:'<xsl:attribute-set name="">',cp:'<xsl:copy select=""/>',co:'<xsl:copy-of select=""/>',val:'<xsl:value-of select=""/>',each:'<xsl:for-each select="">',"for":"each",tex:"<xsl:text></xsl:text>",com:"<xsl:comment>",msg:'<xsl:message terminate="no">',fall:"<xsl:fallback>",num:'<xsl:number value=""/>',nam:'<namespace-alias stylesheet-prefix="" result-prefix=""/>',
|
||||
pres:'<xsl:preserve-space elements=""/>',strip:'<xsl:strip-space elements=""/>',proc:'<xsl:processing-instruction name="">',sort:'<xsl:sort select="" order=""/>',"choose+":"xsl:choose>xsl:when+xsl:otherwise"}},haml:{filters:"haml","extends":"html"},scss:{"extends":"css"},sass:{"extends":"css"},less:{"extends":"css"},stylus:{"extends":"css"}},"system")});
|
||||
emmet.define("cm-editor-proxy",function(h,d){var f=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent)||/Mac/.test(navigator.platform),i={"Cmd-E":"expand_abbreviation",Tab:"expand_abbreviation_with_tab","Cmd-D":"match_pair_outward","Shift-Cmd-D":"match_pair_inward","Cmd-T":"matching_pair","Shift-Cmd-A":"wrap_with_abbreviation","Ctrl-Alt-Right":"next_edit_point","Ctrl-Alt-Left":"prev_edit_point","Cmd-L":"select_line","Cmd-Shift-M":"merge_lines","Cmd-/":"toggle_comment",
|
||||
"Cmd-J":"split_join_tag","Cmd-K":"remove_tag","Shift-Cmd-Y":"evaluate_math_expression","Ctrl-Up":"increment_number_by_1","Ctrl-Down":"decrement_number_by_1","Alt-Up":"increment_number_by_01","Alt-Down":"decrement_number_by_01","Ctrl-Alt-Up":"increment_number_by_10","Ctrl-Alt-Down":"decrement_number_by_10","Shift-Cmd-.":"select_next_item","Shift-Cmd-,":"select_previous_item","Cmd-B":"reflect_css_value",Enter:"insert_formatted_line_break_only"},b={"text/html":"html","application/xml":"xml","text/xsl":"xsl",
|
||||
"text/css":"css","text/x-less":"less"};CodeMirror.defineOption?CodeMirror.defineOption("profile","html"):CodeMirror.defaults.profile="html";var c={context:null,getSelectionRange:function(){var a=this.getCaretPos();return{start:a,end:a+this.getSelection().length}},createSelection:function(a,b){a==b?this.context.setCursor(this.context.posFromIndex(a)):this.context.setSelection(this.context.posFromIndex(a),this.context.posFromIndex(b))},getCurrentLineRange:function(){var a=this.context.getCursor(!0);
|
||||
return{start:this.context.indexFromPos({line:a.line,ch:0}),end:this.context.indexFromPos({line:a.line,ch:this.context.getLine(a.line).length})}},getCaretPos:function(){return this.context.indexFromPos(this.context.getCursor(!0))},setCaretPos:function(a){this.createSelection(a,a)},getCurrentLine:function(){return this.context.getLine(this.context.getCursor(!0).line)||""},replaceContent:function(a,b,c,f){d.isUndefined(c)&&(c=d.isUndefined(b)?content.length:b);d.isUndefined(b)&&(b=0);var i=h("utils");
|
||||
f||(a=i.padString(a,i.getLinePaddingFromPosition(this.getContent(),b)));var f=h("tabStops").extract(a,{escape:function(a){return a}}),a=f.text,m=f.tabstops[0];m?(m.start+=b,m.end+=b):m={start:a.length+b,end:a.length+b};var n=this;(this.context.operation||this.context.compoundChange).call(this.context,function(){n.context.replaceRange(a,n.context.posFromIndex(b),n.context.posFromIndex(c));n.createSelection(m.start,m.end)})},getContent:function(){return this.context.getValue()},getSyntax:function(){var a=
|
||||
this.context.getOption("mode");a in b&&(a=b[a]);return h("actionUtils").detectSyntax(this,a)},getProfileName:function(){return this.context.getOption("profile")?this.context.getOption("profile"):h("actionUtils").detectProfile(this)},prompt:function(a){return prompt(a)},getSelection:function(){return this.context.getSelection()||""},getFilePath:function(){return location.href},setupContext:function(a){this.context=a;var b="\t";a.getOption("indentWithTabs")||(b=h("utils").repeatString(" ",a.getOption("indentUnit")));
|
||||
h("resources").setVariable("indentation",b)},addAction:function(a,b){var d="emmet."+a;CodeMirror.commands[d]||(CodeMirror.commands[d]=function(b){c.setupContext(b);var d;if(d=a=="expand_abbreviation_with_tab")if(!(d=c.getSelection()))d=c.getSyntax(),d=!h("resources").hasSyntax(d);if(d)throw CodeMirror.Pass;d=!0;try{var e=h("actions").run(a,c);(a=="next_edit_point"||a=="prev_edit_point")&&b.replaceSelection("");!e&&a=="insert_formatted_line_break_only"&&(d=!1)}catch(f){}if(!d)throw CodeMirror.Pass;
|
||||
});if(b){if(!CodeMirror.defaults.extraKeys)CodeMirror.defaults.extraKeys={};f||(b=b.replace("Cmd","Ctrl"));CodeMirror.defaults.extraKeys[b]=d}}};typeof emmetKeymap!="undefined"&&(i=emmetKeymap);d.each(i,c.addAction);return c});
|
||||
BIN
plugins/emmet/icon.png
Normal file
BIN
plugins/emmet/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
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/jsregex/icon.png
Normal file
BIN
plugins/jsregex/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 617 B |
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}
|
||||
@@ -62,7 +62,7 @@ Class zipIt {
|
||||
foreach($zipFiles as $file) {
|
||||
$canAdd=true;
|
||||
for ($i=0;$i<count($excludeFilesFolders);$i++) {
|
||||
if(strpos($file,$excludeFilesFolders[$i])!==false) {$canAdd=false;};
|
||||
if($excludeFilesFolders[$i] && strpos($file,$excludeFilesFolders[$i])!==false) {$canAdd=false;};
|
||||
}
|
||||
if ($canAdd==true) {
|
||||
$zip->addFile($file,str_replace($docRoot."/","",$file));
|
||||
|
||||
Reference in New Issue
Block a user