Version Description
- Fixed Upload/Insert media buttons not working in page/post editor
- Removed legacy CSS theme files
Download this release
Release Info
Developer | benjaminprojas |
Plugin | WP Editor |
Version | 1.1.0.1 |
Comparing to | |
See all releases |
Code changes from version 1.1 to 1.1.0.1
- classes/WPEditor.php +2 -1
- classes/WPEditorAdmin.php +1 -0
- extensions/codemirror/codemirror.css +0 -26
- extensions/codemirror/js/mustache.js +58 -0
- extensions/codemirror/themes/cobalt.css +0 -18
- extensions/codemirror/themes/eclipse.css +0 -25
- extensions/codemirror/themes/elegant.css +0 -10
- extensions/codemirror/themes/monokai.css +0 -28
- extensions/codemirror/themes/neat.css +0 -9
- extensions/codemirror/themes/night.css +0 -21
- extensions/codemirror/themes/rubyblue.css +0 -21
- extensions/codemirror/themes/themes.css +168 -0
- js/posts-jquery.js +32 -5
- readme.txt +8 -1
- wpeditor.php +1 -1
classes/WPEditor.php
CHANGED
@@ -209,7 +209,7 @@ class WPEditor {
|
|
209 |
wp_register_style('fancybox', WPEDITOR_URL . '/extensions/fancybox/jquery.fancybox-1.3.4.css', false, WPEDITOR_VERSION_NUMBER);
|
210 |
wp_register_style('codemirror', WPEDITOR_URL . '/extensions/codemirror/codemirror.css', false, WPEDITOR_VERSION_NUMBER);
|
211 |
wp_register_style('codemirror_dialog', WPEDITOR_URL . '/extensions/codemirror/dialog.css', false, WPEDITOR_VERSION_NUMBER);
|
212 |
-
wp_register_style('codemirror_themes', WPEDITOR_URL . '/extensions/codemirror/
|
213 |
}
|
214 |
|
215 |
public function registerDefaultScript() {
|
@@ -225,6 +225,7 @@ class WPEditor {
|
|
225 |
wp_register_script('codemirror_dialog', WPEDITOR_URL . '/extensions/codemirror/js/dialog.js', false, WPEDITOR_VERSION_NUMBER);
|
226 |
wp_register_script('codemirror_search', WPEDITOR_URL . '/extensions/codemirror/js/search.js', false, WPEDITOR_VERSION_NUMBER);
|
227 |
wp_register_script('codemirror_searchcursor', WPEDITOR_URL . '/extensions/codemirror/js/searchcursor.js', false, WPEDITOR_VERSION_NUMBER);
|
|
|
228 |
//wp_register_script('codemirror_foldcode', WPEDITOR_URL . '/extensions/codemirror/js/foldcode.js');
|
229 |
}
|
230 |
|
209 |
wp_register_style('fancybox', WPEDITOR_URL . '/extensions/fancybox/jquery.fancybox-1.3.4.css', false, WPEDITOR_VERSION_NUMBER);
|
210 |
wp_register_style('codemirror', WPEDITOR_URL . '/extensions/codemirror/codemirror.css', false, WPEDITOR_VERSION_NUMBER);
|
211 |
wp_register_style('codemirror_dialog', WPEDITOR_URL . '/extensions/codemirror/dialog.css', false, WPEDITOR_VERSION_NUMBER);
|
212 |
+
wp_register_style('codemirror_themes', WPEDITOR_URL . '/extensions/codemirror/themes/themes.css', false, WPEDITOR_VERSION_NUMBER);
|
213 |
}
|
214 |
|
215 |
public function registerDefaultScript() {
|
225 |
wp_register_script('codemirror_dialog', WPEDITOR_URL . '/extensions/codemirror/js/dialog.js', false, WPEDITOR_VERSION_NUMBER);
|
226 |
wp_register_script('codemirror_search', WPEDITOR_URL . '/extensions/codemirror/js/search.js', false, WPEDITOR_VERSION_NUMBER);
|
227 |
wp_register_script('codemirror_searchcursor', WPEDITOR_URL . '/extensions/codemirror/js/searchcursor.js', false, WPEDITOR_VERSION_NUMBER);
|
228 |
+
wp_register_script('codemirror_mustache', WPEDITOR_URL . '/extensions/codemirror/js/mustache.js', false, WPEDITOR_VERSION_NUMBER);
|
229 |
//wp_register_script('codemirror_foldcode', WPEDITOR_URL . '/extensions/codemirror/js/foldcode.js');
|
230 |
}
|
231 |
|
classes/WPEditorAdmin.php
CHANGED
@@ -50,6 +50,7 @@ class WPEditorAdmin {
|
|
50 |
wp_enqueue_style('codemirror_dialog');
|
51 |
wp_enqueue_style('codemirror_themes');
|
52 |
wp_enqueue_script('codemirror');
|
|
|
53 |
wp_enqueue_script('codemirror_php');
|
54 |
wp_enqueue_script('codemirror_javascript');
|
55 |
wp_enqueue_script('codemirror_css');
|
50 |
wp_enqueue_style('codemirror_dialog');
|
51 |
wp_enqueue_style('codemirror_themes');
|
52 |
wp_enqueue_script('codemirror');
|
53 |
+
wp_enqueue_script('codemirror_mustache');
|
54 |
wp_enqueue_script('codemirror_php');
|
55 |
wp_enqueue_script('codemirror_javascript');
|
56 |
wp_enqueue_script('codemirror_css');
|
extensions/codemirror/codemirror.css
CHANGED
@@ -115,32 +115,6 @@ span.CodeMirror-selected { background: #d9d9d9; }
|
|
115 |
|
116 |
.CodeMirror-searching {background: #ffa;}
|
117 |
|
118 |
-
/* Default theme */
|
119 |
-
|
120 |
-
.cm-s-default span.cm-keyword {color: #708;}
|
121 |
-
.cm-s-default span.cm-atom {color: #219;}
|
122 |
-
.cm-s-default span.cm-number {color: #164;}
|
123 |
-
.cm-s-default span.cm-def {color: #00f;}
|
124 |
-
.cm-s-default span.cm-variable {color: black;}
|
125 |
-
.cm-s-default span.cm-variable-2 {color: #05a;}
|
126 |
-
.cm-s-default span.cm-variable-3 {color: #085;}
|
127 |
-
.cm-s-default span.cm-property {color: black;}
|
128 |
-
.cm-s-default span.cm-operator {color: black;}
|
129 |
-
.cm-s-default span.cm-comment {color: #a50;}
|
130 |
-
.cm-s-default span.cm-string {color: #a11;}
|
131 |
-
.cm-s-default span.cm-string-2 {color: #f50;}
|
132 |
-
.cm-s-default span.cm-meta {color: #555;}
|
133 |
-
.cm-s-default span.cm-error {color: #f00;}
|
134 |
-
.cm-s-default span.cm-qualifier {color: #555;}
|
135 |
-
.cm-s-default span.cm-builtin {color: #30a;}
|
136 |
-
.cm-s-default span.cm-bracket {color: #cc7;}
|
137 |
-
.cm-s-default span.cm-tag {color: #170;}
|
138 |
-
.cm-s-default span.cm-attribute {color: #00c;}
|
139 |
-
.cm-s-default span.cm-header {color: #a0a;}
|
140 |
-
.cm-s-default span.cm-quote {color: #090;}
|
141 |
-
.cm-s-default span.cm-hr {color: #999;}
|
142 |
-
.cm-s-default span.cm-link {color: #00c;}
|
143 |
-
|
144 |
span.cm-header, span.cm-strong {font-weight: bold;}
|
145 |
span.cm-em {font-style: italic;}
|
146 |
span.cm-emstrong {font-style: italic; font-weight: bold;}
|
115 |
|
116 |
.CodeMirror-searching {background: #ffa;}
|
117 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
span.cm-header, span.cm-strong {font-weight: bold;}
|
119 |
span.cm-em {font-style: italic;}
|
120 |
span.cm-emstrong {font-style: italic; font-weight: bold;}
|
extensions/codemirror/js/mustache.js
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
CodeMirror.overlayParser = function(base, overlay, combine) {
|
2 |
+
return {
|
3 |
+
startState: function() {
|
4 |
+
return {
|
5 |
+
base: CodeMirror.startState(base),
|
6 |
+
overlay: CodeMirror.startState(overlay),
|
7 |
+
basePos: 0, baseCur: null,
|
8 |
+
overlayPos: 0, overlayCur: null
|
9 |
+
};
|
10 |
+
},
|
11 |
+
copyState: function(state) {
|
12 |
+
return {
|
13 |
+
base: CodeMirror.copyState(base, state.base),
|
14 |
+
overlay: CodeMirror.copyState(overlay, state.overlay),
|
15 |
+
basePos: state.basePos, baseCur: null,
|
16 |
+
overlayPos: state.overlayPos, overlayCur: null
|
17 |
+
};
|
18 |
+
},
|
19 |
+
|
20 |
+
token: function(stream, state) {
|
21 |
+
if (stream.start == state.basePos) {
|
22 |
+
state.baseCur = base.token(stream, state.base);
|
23 |
+
state.basePos = stream.pos;
|
24 |
+
}
|
25 |
+
if (stream.start == state.overlayPos) {
|
26 |
+
stream.pos = stream.start;
|
27 |
+
state.overlayCur = overlay.token(stream, state.overlay);
|
28 |
+
state.overlayPos = stream.pos;
|
29 |
+
}
|
30 |
+
stream.pos = Math.min(state.basePos, state.overlayPos);
|
31 |
+
if (stream.eol()) state.basePos = state.overlayPos = 0;
|
32 |
+
|
33 |
+
if (state.overlayCur == null) return state.baseCur;
|
34 |
+
if (state.baseCur != null && combine) return state.baseCur + " " + state.overlayCur;
|
35 |
+
else return state.overlayCur;
|
36 |
+
},
|
37 |
+
|
38 |
+
indent: function(state, textAfter) {
|
39 |
+
return base.indent(state.base, textAfter);
|
40 |
+
},
|
41 |
+
electricChars: base.electricChars
|
42 |
+
};
|
43 |
+
};
|
44 |
+
CodeMirror.defineMode("wp_shortcodes", function(config, parserConfig) {
|
45 |
+
var mustacheOverlay = {
|
46 |
+
token: function(stream, state) {
|
47 |
+
if (stream.match("[")) {
|
48 |
+
while ((ch = stream.next()) != null)
|
49 |
+
if (ch == "]") break;
|
50 |
+
//if (ch == "[" && stream.next() == "}") break;
|
51 |
+
return "mustache";
|
52 |
+
}
|
53 |
+
while (stream.next() != null && !stream.match("[", false)) {}
|
54 |
+
return null;
|
55 |
+
}
|
56 |
+
};
|
57 |
+
return CodeMirror.overlayParser(CodeMirror.getMode(config, parserConfig.backdrop || "text/html"), mustacheOverlay);
|
58 |
+
});
|
extensions/codemirror/themes/cobalt.css
DELETED
@@ -1,18 +0,0 @@
|
|
1 |
-
.cm-s-cobalt { background: #002240; color: white; }
|
2 |
-
.cm-s-cobalt span.CodeMirror-selected { background: #b36539 !important; }
|
3 |
-
.cm-s-cobalt .CodeMirror-gutter { background: #002240; border-right: 1px solid #aaa; }
|
4 |
-
.cm-s-cobalt .CodeMirror-gutter-text { color: #d0d0d0; }
|
5 |
-
.cm-s-cobalt .CodeMirror-cursor { border-left: 1px solid white !important; }
|
6 |
-
|
7 |
-
.cm-s-cobalt span.cm-comment { color: #08f; }
|
8 |
-
.cm-s-cobalt span.cm-atom { color: #845dc4; }
|
9 |
-
.cm-s-cobalt span.cm-number, .cm-s-cobalt span.cm-attribute { color: #ff80e1; }
|
10 |
-
.cm-s-cobalt span.cm-keyword { color: #ffee80; }
|
11 |
-
.cm-s-cobalt span.cm-string { color: #3ad900; }
|
12 |
-
.cm-s-cobalt span.cm-meta { color: #ff9d00; }
|
13 |
-
.cm-s-cobalt span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #9effff; }
|
14 |
-
.cm-s-cobalt span.cm-variable-3, .cm-s-cobalt span.cm-def { color: white; }
|
15 |
-
.cm-s-cobalt span.cm-error { color: #9d1e15; }
|
16 |
-
.cm-s-cobalt span.cm-bracket { color: #d8d8d8; }
|
17 |
-
.cm-s-cobalt span.cm-builtin, .cm-s-cobalt span.cm-special { color: #ff9e59; }
|
18 |
-
.cm-s-cobalt span.cm-link { color: #845dc4; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extensions/codemirror/themes/eclipse.css
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
.cm-s-eclipse span.cm-meta {color: #FF1717;}
|
2 |
-
.cm-s-eclipse span.cm-keyword { font-weight: bold; color: #7F0055; }
|
3 |
-
.cm-s-eclipse span.cm-atom {color: #219;}
|
4 |
-
.cm-s-eclipse span.cm-number {color: #164;}
|
5 |
-
.cm-s-eclipse span.cm-def {color: #00f;}
|
6 |
-
.cm-s-eclipse span.cm-variable {color: black;}
|
7 |
-
.cm-s-eclipse span.cm-variable-2 {color: #0000C0;}
|
8 |
-
.cm-s-eclipse span.cm-variable-3 {color: #0000C0;}
|
9 |
-
.cm-s-eclipse span.cm-property {color: black;}
|
10 |
-
.cm-s-eclipse span.cm-operator {color: black;}
|
11 |
-
.cm-s-eclipse span.cm-comment {color: #3F7F5F;}
|
12 |
-
.cm-s-eclipse span.cm-string {color: #2A00FF;}
|
13 |
-
.cm-s-eclipse span.cm-string-2 {color: #f50;}
|
14 |
-
.cm-s-eclipse span.cm-error {color: #f00;}
|
15 |
-
.cm-s-eclipse span.cm-qualifier {color: #555;}
|
16 |
-
.cm-s-eclipse span.cm-builtin {color: #30a;}
|
17 |
-
.cm-s-eclipse span.cm-bracket {color: #cc7;}
|
18 |
-
.cm-s-eclipse span.cm-tag {color: #170;}
|
19 |
-
.cm-s-eclipse span.cm-attribute {color: #00c;}
|
20 |
-
.cm-s-eclipse span.cm-link {color: #219;}
|
21 |
-
|
22 |
-
.cm-s-eclipse .CodeMirror-matchingbracket {
|
23 |
-
border:1px solid grey;
|
24 |
-
color:black !important;;
|
25 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extensions/codemirror/themes/elegant.css
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
.cm-s-elegant span.cm-number, .cm-s-elegant span.cm-string, .cm-s-elegant span.cm-atom {color: #762;}
|
2 |
-
.cm-s-elegant span.cm-comment {color: #262;font-style: italic;}
|
3 |
-
.cm-s-elegant span.cm-meta {color: #555;font-style: italic;}
|
4 |
-
.cm-s-elegant span.cm-variable {color: black;}
|
5 |
-
.cm-s-elegant span.cm-variable-2 {color: #b11;}
|
6 |
-
.cm-s-elegant span.cm-qualifier {color: #555;}
|
7 |
-
.cm-s-elegant span.cm-keyword {color: #730;}
|
8 |
-
.cm-s-elegant span.cm-builtin {color: #30a;}
|
9 |
-
.cm-s-elegant span.cm-error {background-color: #fdd;}
|
10 |
-
.cm-s-elegant span.cm-link {color: #762;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extensions/codemirror/themes/monokai.css
DELETED
@@ -1,28 +0,0 @@
|
|
1 |
-
/* Based on Sublime Text's Monokai theme */
|
2 |
-
|
3 |
-
.cm-s-monokai {background: #272822; color: #f8f8f2;}
|
4 |
-
.cm-s-monokai span.CodeMirror-selected {background: #ffe792 !important;}
|
5 |
-
.cm-s-monokai .CodeMirror-gutter {background: #272822; border-right: 0px;}
|
6 |
-
.cm-s-monokai .CodeMirror-gutter-text {color: #d0d0d0;}
|
7 |
-
.cm-s-monokai .CodeMirror-cursor {border-left: 1px solid #f8f8f0 !important;}
|
8 |
-
|
9 |
-
.cm-s-monokai span.cm-comment {color: #75715e;}
|
10 |
-
.cm-s-monokai span.cm-atom {color: #ae81ff;}
|
11 |
-
.cm-s-monokai span.cm-number {color: #ae81ff;}
|
12 |
-
|
13 |
-
.cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute {color: #a6e22e;}
|
14 |
-
.cm-s-monokai span.cm-keyword {color: #f92672;}
|
15 |
-
.cm-s-monokai span.cm-string {color: #e6db74;}
|
16 |
-
|
17 |
-
.cm-s-monokai span.cm-variable {color: #a6e22e;}
|
18 |
-
.cm-s-monokai span.cm-variable-2 {color: #9effff;}
|
19 |
-
.cm-s-monokai span.cm-def {color: #fd971f;}
|
20 |
-
.cm-s-monokai span.cm-error {background: #f92672; color: #f8f8f0;}
|
21 |
-
.cm-s-monokai span.cm-bracket {color: #f8f8f2;}
|
22 |
-
.cm-s-monokai span.cm-tag {color: #f92672;}
|
23 |
-
.cm-s-monokai span.cm-link {color: #ae81ff;}
|
24 |
-
|
25 |
-
.cm-s-monokai .CodeMirror-matchingbracket {
|
26 |
-
text-decoration: underline;
|
27 |
-
color: white !important;
|
28 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extensions/codemirror/themes/neat.css
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
.cm-s-neat span.cm-comment { color: #a86; }
|
2 |
-
.cm-s-neat span.cm-keyword { font-weight: bold; color: blue; }
|
3 |
-
.cm-s-neat span.cm-string { color: #a22; }
|
4 |
-
.cm-s-neat span.cm-builtin { font-weight: bold; color: #077; }
|
5 |
-
.cm-s-neat span.cm-special { font-weight: bold; color: #0aa; }
|
6 |
-
.cm-s-neat span.cm-variable { color: black; }
|
7 |
-
.cm-s-neat span.cm-number, .cm-s-neat span.cm-atom { color: #3a3; }
|
8 |
-
.cm-s-neat span.cm-meta {color: #555;}
|
9 |
-
.cm-s-neat span.cm-link { color: #3a3; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extensions/codemirror/themes/night.css
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
/* Loosely based on the Midnight Textmate theme */
|
2 |
-
|
3 |
-
.cm-s-night { background: #0a001f; color: #f8f8f8; }
|
4 |
-
.cm-s-night span.CodeMirror-selected { background: #a8f !important; }
|
5 |
-
.cm-s-night .CodeMirror-gutter { background: #0a001f; border-right: 1px solid #aaa; }
|
6 |
-
.cm-s-night .CodeMirror-gutter-text { color: #f8f8f8; }
|
7 |
-
.cm-s-night .CodeMirror-cursor { border-left: 1px solid white !important; }
|
8 |
-
|
9 |
-
.cm-s-night span.cm-comment { color: #6900a1; }
|
10 |
-
.cm-s-night span.cm-atom { color: #845dc4; }
|
11 |
-
.cm-s-night span.cm-number, .cm-s-night span.cm-attribute { color: #ffd500; }
|
12 |
-
.cm-s-night span.cm-keyword { color: #599eff; }
|
13 |
-
.cm-s-night span.cm-string { color: #37f14a; }
|
14 |
-
.cm-s-night span.cm-meta { color: #7678e2; }
|
15 |
-
.cm-s-night span.cm-variable-2, .cm-s-night span.cm-tag { color: #99b2ff; }
|
16 |
-
.cm-s-night span.cm-variable-3, .cm-s-night span.cm-def { color: white; }
|
17 |
-
.cm-s-night span.cm-error { color: #9d1e15; }
|
18 |
-
.cm-s-night span.cm-bracket { color: #8da6ce; }
|
19 |
-
.cm-s-night span.cm-comment { color: #6900a1; }
|
20 |
-
.cm-s-night span.cm-builtin, .cm-s-night span.cm-special { color: #ff9e59; }
|
21 |
-
.cm-s-night span.cm-link { color: #845dc4; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extensions/codemirror/themes/rubyblue.css
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
.cm-s-rubyblue { font:13px/1.4em Trebuchet, Verdana, sans-serif; } /* - customized editor font - */
|
2 |
-
|
3 |
-
.cm-s-rubyblue { background: #112435; color: white; }
|
4 |
-
.cm-s-rubyblue span.CodeMirror-selected { background: #0000FF !important; }
|
5 |
-
.cm-s-rubyblue .CodeMirror-gutter { background: #1F4661; border-right: 7px solid #3E7087; min-width:2.5em; }
|
6 |
-
.cm-s-rubyblue .CodeMirror-gutter-text { color: white; }
|
7 |
-
.cm-s-rubyblue .CodeMirror-cursor { border-left: 1px solid white !important; }
|
8 |
-
|
9 |
-
.cm-s-rubyblue span.cm-comment { color: #999; font-style:italic; }
|
10 |
-
.cm-s-rubyblue span.cm-atom { color: #F4C20B; }
|
11 |
-
.cm-s-rubyblue span.cm-number, .cm-s-rubyblue span.cm-attribute { color: #82C6E0; }
|
12 |
-
.cm-s-rubyblue span.cm-keyword { color: #F0F; }
|
13 |
-
.cm-s-rubyblue span.cm-string { color: #F08047; }
|
14 |
-
.cm-s-rubyblue span.cm-meta { color: #F0F; }
|
15 |
-
.cm-s-rubyblue span.cm-variable-2, .cm-s-rubyblue span.cm-tag { color: #7BD827; }
|
16 |
-
.cm-s-rubyblue span.cm-variable-3, .cm-s-rubyblue span.cm-def { color: white; }
|
17 |
-
.cm-s-rubyblue span.cm-error { color: #AF2018; }
|
18 |
-
.cm-s-rubyblue span.cm-bracket { color: #F0F; }
|
19 |
-
.cm-s-rubyblue span.cm-link { color: #F4C20B; }
|
20 |
-
.cm-s-rubyblue span.CodeMirror-matchingbracket { color:#F0F !important; }
|
21 |
-
.cm-s-rubyblue span.cm-builtin, .cm-s-rubyblue span.cm-special { color: #FF9D00; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extensions/codemirror/themes/themes.css
ADDED
@@ -0,0 +1,168 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/************************************************************
|
2 |
+
* Default
|
3 |
+
************************************************************/
|
4 |
+
.cm-s-default span.cm-keyword {color: #708;}
|
5 |
+
.cm-s-default span.cm-atom {color: #219;}
|
6 |
+
.cm-s-default span.cm-number {color: #164;}
|
7 |
+
.cm-s-default span.cm-def {color: #00f;}
|
8 |
+
.cm-s-default span.cm-variable {color: black;}
|
9 |
+
.cm-s-default span.cm-variable-2 {color: #05a;}
|
10 |
+
.cm-s-default span.cm-variable-3 {color: #085;}
|
11 |
+
.cm-s-default span.cm-property {color: black;}
|
12 |
+
.cm-s-default span.cm-operator {color: black;}
|
13 |
+
.cm-s-default span.cm-comment {color: #a50;}
|
14 |
+
.cm-s-default span.cm-string {color: #a11;}
|
15 |
+
.cm-s-default span.cm-string-2 {color: #f50;}
|
16 |
+
.cm-s-default span.cm-meta {color: #555;}
|
17 |
+
.cm-s-default span.cm-error {color: #f00;}
|
18 |
+
.cm-s-default span.cm-qualifier {color: #555;}
|
19 |
+
.cm-s-default span.cm-builtin {color: #30a;}
|
20 |
+
.cm-s-default span.cm-bracket {color: #cc7;}
|
21 |
+
.cm-s-default span.cm-tag {color: #170;}
|
22 |
+
.cm-s-default span.cm-attribute {color: #00c;}
|
23 |
+
.cm-s-default span.cm-header {color: #a0a;}
|
24 |
+
.cm-s-default span.cm-quote {color: #090;}
|
25 |
+
.cm-s-default span.cm-hr {color: #999;}
|
26 |
+
.cm-s-default span.cm-link {color: #00c;}
|
27 |
+
/*.cm-mustache {color: #611;font-weight:bold;}*/
|
28 |
+
|
29 |
+
/************************************************************
|
30 |
+
* Cobalt
|
31 |
+
************************************************************/
|
32 |
+
.cm-s-cobalt { background: #002240; color: white; }
|
33 |
+
.cm-s-cobalt span.CodeMirror-selected { background: #b36539 !important; }
|
34 |
+
.cm-s-cobalt .CodeMirror-gutter { background: #002240; border-right: 1px solid #aaa; }
|
35 |
+
.cm-s-cobalt .CodeMirror-gutter-text { color: #d0d0d0; }
|
36 |
+
.cm-s-cobalt .CodeMirror-cursor { border-left: 1px solid white !important; }
|
37 |
+
.cm-s-cobalt span.cm-comment { color: #08f; }
|
38 |
+
.cm-s-cobalt span.cm-atom { color: #845dc4; }
|
39 |
+
.cm-s-cobalt span.cm-number, .cm-s-cobalt span.cm-attribute { color: #ff80e1; }
|
40 |
+
.cm-s-cobalt span.cm-keyword { color: #ffee80; }
|
41 |
+
.cm-s-cobalt span.cm-string { color: #3ad900; }
|
42 |
+
.cm-s-cobalt span.cm-meta { color: #ff9d00; }
|
43 |
+
.cm-s-cobalt span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #9effff; }
|
44 |
+
.cm-s-cobalt span.cm-variable-3, .cm-s-cobalt span.cm-def { color: white; }
|
45 |
+
.cm-s-cobalt span.cm-error { color: #9d1e15; }
|
46 |
+
.cm-s-cobalt span.cm-bracket { color: #d8d8d8; }
|
47 |
+
.cm-s-cobalt span.cm-builtin, .cm-s-cobalt span.cm-special { color: #ff9e59; }
|
48 |
+
.cm-s-cobalt span.cm-link { color: #845dc4; }
|
49 |
+
|
50 |
+
/************************************************************
|
51 |
+
* Eclipse
|
52 |
+
************************************************************/
|
53 |
+
.cm-s-eclipse span.cm-meta {color: #FF1717;}
|
54 |
+
.cm-s-eclipse span.cm-keyword { font-weight: bold; color: #7F0055; }
|
55 |
+
.cm-s-eclipse span.cm-atom {color: #219;}
|
56 |
+
.cm-s-eclipse span.cm-number {color: #164;}
|
57 |
+
.cm-s-eclipse span.cm-def {color: #00f;}
|
58 |
+
.cm-s-eclipse span.cm-variable {color: black;}
|
59 |
+
.cm-s-eclipse span.cm-variable-2 {color: #0000C0;}
|
60 |
+
.cm-s-eclipse span.cm-variable-3 {color: #0000C0;}
|
61 |
+
.cm-s-eclipse span.cm-property {color: black;}
|
62 |
+
.cm-s-eclipse span.cm-operator {color: black;}
|
63 |
+
.cm-s-eclipse span.cm-comment {color: #3F7F5F;}
|
64 |
+
.cm-s-eclipse span.cm-string {color: #2A00FF;}
|
65 |
+
.cm-s-eclipse span.cm-string-2 {color: #f50;}
|
66 |
+
.cm-s-eclipse span.cm-error {color: #f00;}
|
67 |
+
.cm-s-eclipse span.cm-qualifier {color: #555;}
|
68 |
+
.cm-s-eclipse span.cm-builtin {color: #30a;}
|
69 |
+
.cm-s-eclipse span.cm-bracket {color: #cc7;}
|
70 |
+
.cm-s-eclipse span.cm-tag {color: #170;}
|
71 |
+
.cm-s-eclipse span.cm-attribute {color: #00c;}
|
72 |
+
.cm-s-eclipse span.cm-link {color: #219;}
|
73 |
+
.cm-s-eclipse .CodeMirror-matchingbracket {border:1px solid grey; color:black !important;}
|
74 |
+
|
75 |
+
/************************************************************
|
76 |
+
* Elegant
|
77 |
+
************************************************************/
|
78 |
+
.cm-s-elegant span.cm-number, .cm-s-elegant span.cm-string, .cm-s-elegant span.cm-atom {color: #762;}
|
79 |
+
.cm-s-elegant span.cm-comment {color: #262;font-style: italic;}
|
80 |
+
.cm-s-elegant span.cm-meta {color: #555;font-style: italic;}
|
81 |
+
.cm-s-elegant span.cm-variable {color: black;}
|
82 |
+
.cm-s-elegant span.cm-variable-2 {color: #b11;}
|
83 |
+
.cm-s-elegant span.cm-qualifier {color: #555;}
|
84 |
+
.cm-s-elegant span.cm-keyword {color: #730;}
|
85 |
+
.cm-s-elegant span.cm-builtin {color: #30a;}
|
86 |
+
.cm-s-elegant span.cm-error {background-color: #fdd;}
|
87 |
+
.cm-s-elegant span.cm-link {color: #762;}
|
88 |
+
|
89 |
+
/************************************************************
|
90 |
+
* Monokai
|
91 |
+
************************************************************/
|
92 |
+
.cm-s-monokai {background: #272822; color: #f8f8f2;}
|
93 |
+
.cm-s-monokai span.CodeMirror-selected {background: #ffe792 !important;color:#00F !important;}
|
94 |
+
.cm-s-monokai .CodeMirror-gutter {background: #272822; border-right: 0px;}
|
95 |
+
.cm-s-monokai .CodeMirror-gutter-text {color: #d0d0d0;}
|
96 |
+
.cm-s-monokai .CodeMirror-cursor {border-left: 1px solid #f8f8f0 !important;}
|
97 |
+
.cm-s-monokai span.cm-comment {color: #75715e;}
|
98 |
+
.cm-s-monokai span.cm-atom {color: #ae81ff;}
|
99 |
+
.cm-s-monokai span.cm-number {color: #ae81ff;}
|
100 |
+
.cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute {color: #a6e22e;}
|
101 |
+
.cm-s-monokai span.cm-keyword {color: #f92672;}
|
102 |
+
.cm-s-monokai span.cm-string {color: #e6db74;}
|
103 |
+
.cm-s-monokai span.cm-variable {color: #a6e22e;}
|
104 |
+
.cm-s-monokai span.cm-variable-2 {color: #9effff;}
|
105 |
+
.cm-s-monokai span.cm-def {color: #fd971f;}
|
106 |
+
.cm-s-monokai span.cm-error {background: #f92672; color: #f8f8f0;}
|
107 |
+
.cm-s-monokai span.cm-bracket {color: #f8f8f2;}
|
108 |
+
.cm-s-monokai span.cm-tag {color: #f92672;}
|
109 |
+
.cm-s-monokai span.cm-link {color: #ae81ff;}
|
110 |
+
.cm-s-monokai .CodeMirror-matchingbracket {text-decoration: underline;color: white !important;}
|
111 |
+
|
112 |
+
/************************************************************
|
113 |
+
* Neat
|
114 |
+
************************************************************/
|
115 |
+
.cm-s-neat span.cm-comment { color: #a86; }
|
116 |
+
.cm-s-neat span.cm-keyword { font-weight: bold; color: blue; }
|
117 |
+
.cm-s-neat span.cm-string { color: #a22; }
|
118 |
+
.cm-s-neat span.cm-builtin { font-weight: bold; color: #077; }
|
119 |
+
.cm-s-neat span.cm-special { font-weight: bold; color: #0aa; }
|
120 |
+
.cm-s-neat span.cm-variable { color: black; }
|
121 |
+
.cm-s-neat span.cm-number, .cm-s-neat span.cm-atom { color: #3a3; }
|
122 |
+
.cm-s-neat span.cm-meta {color: #555;}
|
123 |
+
.cm-s-neat span.cm-link { color: #3a3; }
|
124 |
+
|
125 |
+
/************************************************************
|
126 |
+
* Night
|
127 |
+
************************************************************/
|
128 |
+
.cm-s-night { background: #0a001f; color: #f8f8f8; }
|
129 |
+
.cm-s-night span.CodeMirror-selected { background: #a8f !important; }
|
130 |
+
.cm-s-night .CodeMirror-gutter { background: #0a001f; border-right: 1px solid #aaa; }
|
131 |
+
.cm-s-night .CodeMirror-gutter-text { color: #f8f8f8; }
|
132 |
+
.cm-s-night .CodeMirror-cursor { border-left: 1px solid white !important; }
|
133 |
+
.cm-s-night span.cm-comment { color: #6900a1; }
|
134 |
+
.cm-s-night span.cm-atom { color: #845dc4; }
|
135 |
+
.cm-s-night span.cm-number, .cm-s-night span.cm-attribute { color: #ffd500; }
|
136 |
+
.cm-s-night span.cm-keyword { color: #599eff; }
|
137 |
+
.cm-s-night span.cm-string { color: #37f14a; }
|
138 |
+
.cm-s-night span.cm-meta { color: #7678e2; }
|
139 |
+
.cm-s-night span.cm-variable-2, .cm-s-night span.cm-tag { color: #99b2ff; }
|
140 |
+
.cm-s-night span.cm-variable-3, .cm-s-night span.cm-def { color: white; }
|
141 |
+
.cm-s-night span.cm-error { color: #9d1e15; }
|
142 |
+
.cm-s-night span.cm-bracket { color: #8da6ce; }
|
143 |
+
.cm-s-night span.cm-comment { color: #6900a1; }
|
144 |
+
.cm-s-night span.cm-builtin, .cm-s-night span.cm-special { color: #ff9e59; }
|
145 |
+
.cm-s-night span.cm-link { color: #845dc4; }
|
146 |
+
|
147 |
+
/************************************************************
|
148 |
+
* Ruby Blue
|
149 |
+
************************************************************/
|
150 |
+
.cm-s-rubyblue { font:13px/1.4em Trebuchet, Verdana, sans-serif; }
|
151 |
+
.cm-s-rubyblue { background: #112435; color: white; }
|
152 |
+
.cm-s-rubyblue span.CodeMirror-selected { background: #FFE792 !important;color:#00F !important; }
|
153 |
+
.cm-s-rubyblue .CodeMirror-gutter { background: #1F4661; border-right: 7px solid #3E7087; min-width:2.5em; }
|
154 |
+
.cm-s-rubyblue .CodeMirror-gutter-text { color: white; }
|
155 |
+
.cm-s-rubyblue .CodeMirror-cursor { border-left: 1px solid white !important; }
|
156 |
+
.cm-s-rubyblue span.cm-comment { color: #999; font-style:italic; }
|
157 |
+
.cm-s-rubyblue span.cm-atom { color: #F4C20B; }
|
158 |
+
.cm-s-rubyblue span.cm-number, .cm-s-rubyblue span.cm-attribute { color: #82C6E0; }
|
159 |
+
.cm-s-rubyblue span.cm-keyword { color: #F0F; }
|
160 |
+
.cm-s-rubyblue span.cm-string { color: #F08047; }
|
161 |
+
.cm-s-rubyblue span.cm-meta { color: #F0F; }
|
162 |
+
.cm-s-rubyblue span.cm-variable-2, .cm-s-rubyblue span.cm-tag { color: #7BD827; }
|
163 |
+
.cm-s-rubyblue span.cm-variable-3, .cm-s-rubyblue span.cm-def { color: white; }
|
164 |
+
.cm-s-rubyblue span.cm-error { color: #AF2018; }
|
165 |
+
.cm-s-rubyblue span.cm-bracket { color: #F0F; }
|
166 |
+
.cm-s-rubyblue span.cm-link { color: #F4C20B; }
|
167 |
+
.cm-s-rubyblue span.CodeMirror-matchingbracket { color:#F0F !important; }
|
168 |
+
.cm-s-rubyblue span.cm-builtin, .cm-s-rubyblue span.cm-special { color: #FF9D00; }
|
js/posts-jquery.js
CHANGED
@@ -170,10 +170,6 @@ tags = {};
|
|
170 |
editor_status = 'tmce';
|
171 |
}
|
172 |
})
|
173 |
-
$('#content').keyup(function() {
|
174 |
-
console.log('yep, keyup')
|
175 |
-
editor.save();
|
176 |
-
})
|
177 |
$('#content-html').click(function() {
|
178 |
if(editor_status != 'html') {
|
179 |
postCodeMirror('content');
|
@@ -208,10 +204,41 @@ tags = {};
|
|
208 |
}
|
209 |
return is_tinyMCE_active;
|
210 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
function postCodeMirror(element) {
|
212 |
var activeLine = WPEPosts.activeLine;
|
213 |
editor = CodeMirror.fromTextArea(document.getElementById(element), {
|
214 |
-
mode:
|
215 |
theme: WPEPosts.theme,
|
216 |
lineNumbers: WPEPosts.lineNumbers,
|
217 |
lineWrapping: WPEPosts.lineWrapping,
|
170 |
editor_status = 'tmce';
|
171 |
}
|
172 |
})
|
|
|
|
|
|
|
|
|
173 |
$('#content-html').click(function() {
|
174 |
if(editor_status != 'html') {
|
175 |
postCodeMirror('content');
|
204 |
}
|
205 |
return is_tinyMCE_active;
|
206 |
}
|
207 |
+
$.fn.setContentCursor = function(start, end) {
|
208 |
+
return this.each(function() {
|
209 |
+
if(this.setSelectionRange) {
|
210 |
+
this.focus();
|
211 |
+
this.setSelectionRange(start, end);
|
212 |
+
}
|
213 |
+
else if (this.createTextRange) {
|
214 |
+
var range = this.createTextRange();
|
215 |
+
range.collapse(true);
|
216 |
+
range.moveEnd('character', end);
|
217 |
+
range.moveStart('character', start);
|
218 |
+
range.select();
|
219 |
+
}
|
220 |
+
});
|
221 |
+
};
|
222 |
+
window.original_send_to_editor = window.send_to_editor;
|
223 |
+
window.send_to_editor = function(html){
|
224 |
+
editor.toTextArea();
|
225 |
+
var cursor = editor.getCursor(true);
|
226 |
+
var lines = $('#content').val().substr(0, this.selectionStart).split("\n");
|
227 |
+
var newLength = 0, line = 1, lineArray = [];
|
228 |
+
lineArray[0] = 0;
|
229 |
+
$.each(lines, function(key, value) {
|
230 |
+
newLength = newLength + value.length + 1;
|
231 |
+
lineArray[line] = newLength;
|
232 |
+
line++;
|
233 |
+
})
|
234 |
+
$('#content').setContentCursor(lineArray[cursor.line] + cursor.ch, lineArray[cursor.line] + cursor.ch);
|
235 |
+
window.original_send_to_editor(html);
|
236 |
+
postCodeMirror('content');
|
237 |
+
};
|
238 |
function postCodeMirror(element) {
|
239 |
var activeLine = WPEPosts.activeLine;
|
240 |
editor = CodeMirror.fromTextArea(document.getElementById(element), {
|
241 |
+
mode: 'wp_shortcodes',
|
242 |
theme: WPEPosts.theme,
|
243 |
lineNumbers: WPEPosts.lineNumbers,
|
244 |
lineWrapping: WPEPosts.lineWrapping,
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://wpeditor.net/
|
|
4 |
Tags: plugin editor, theme editor, page editor, post editor, pages, posts, html, codemirror, plugins, themes, editor, fancybox, post.php, post-new.php, ajax, syntax highlighting, html syntax highlighting
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.4.1
|
7 |
-
Stable tag: 1.1
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -69,6 +69,10 @@ Yes! While we don't have a need for further developers at this time, any financi
|
|
69 |
|
70 |
== Changelog ==
|
71 |
|
|
|
|
|
|
|
|
|
72 |
= 1.1 =
|
73 |
* Added syntax highlighter for page/post editor
|
74 |
* Added in monospace font for default theme/plugin/post editor
|
@@ -99,6 +103,9 @@ Yes! While we don't have a need for further developers at this time, any financi
|
|
99 |
|
100 |
== Upgrade Notice ==
|
101 |
|
|
|
|
|
|
|
102 |
= 1.1 =
|
103 |
Added features including support for syntax highlighting in the page/post editor
|
104 |
|
4 |
Tags: plugin editor, theme editor, page editor, post editor, pages, posts, html, codemirror, plugins, themes, editor, fancybox, post.php, post-new.php, ajax, syntax highlighting, html syntax highlighting
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.4.1
|
7 |
+
Stable tag: 1.1.0.1
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
69 |
|
70 |
== Changelog ==
|
71 |
|
72 |
+
= 1.1.0.1 =
|
73 |
+
* Fixed Upload/Insert media buttons not working in page/post editor
|
74 |
+
* Removed legacy CSS theme files
|
75 |
+
|
76 |
= 1.1 =
|
77 |
* Added syntax highlighter for page/post editor
|
78 |
* Added in monospace font for default theme/plugin/post editor
|
103 |
|
104 |
== Upgrade Notice ==
|
105 |
|
106 |
+
= 1.1.0.1 =
|
107 |
+
Fixed media buttons not working in Page/Post editor
|
108 |
+
|
109 |
= 1.1 =
|
110 |
Added features including support for syntax highlighting in the page/post editor
|
111 |
|
wpeditor.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: WP Editor
|
4 |
Plugin URI: http://wpeditor.net
|
5 |
Description: This plugin modifies the default behavior of the WordPress plugin and theme editors.
|
6 |
-
Version: 1.1
|
7 |
Author: Benjamin Rojas
|
8 |
Author URI: http://benjaminrojas.net
|
9 |
Text Domain: wpeditor
|
3 |
Plugin Name: WP Editor
|
4 |
Plugin URI: http://wpeditor.net
|
5 |
Description: This plugin modifies the default behavior of the WordPress plugin and theme editors.
|
6 |
+
Version: 1.1.0.1
|
7 |
Author: Benjamin Rojas
|
8 |
Author URI: http://benjaminrojas.net
|
9 |
Text Domain: wpeditor
|