Version Description
- 08/31/2016
- Feature: add HTML code
- Fix: add htmlentities when showing them in the editor
- Feature: when adding a code, show more explanations as comments
Download this release
Release Info
Developer | diana_burduja |
Plugin | Simple Custom CSS and JS |
Version | 2.6 |
Comparing to | |
See all releases |
Code changes from version 2.10 to 2.6
- assets/ccj_admin.css +5 -8
- assets/ccj_admin.js +0 -35
- assets/codemirror/addon/dialog.css +0 -32
- assets/codemirror/addon/dialog.js +0 -157
- assets/codemirror/addon/jump-to-line.js +0 -49
- assets/codemirror/addon/matchesonscrollbar.css +0 -8
- assets/codemirror/addon/search.js +0 -249
- assets/codemirror/addon/searchcursor.js +0 -189
- custom-css-js.php +3 -4
- includes/admin-addons.php +1 -1
- includes/admin-notices.php +17 -26
- includes/admin-screens.php +12 -70
- readme.txt +3 -22
- screenshot-1.jpg +0 -0
- screenshot-2.jpg +0 -0
- screenshot-3.jpg +0 -0
- screenshot-4.jpg +0 -0
assets/ccj_admin.css
CHANGED
@@ -62,6 +62,7 @@
|
|
62 |
*/
|
63 |
#content {
|
64 |
width: 100%;
|
|
|
65 |
padding-left: 36px;
|
66 |
border-top: 0;
|
67 |
border-bottom: 0;
|
@@ -70,6 +71,7 @@
|
|
70 |
#minor-publishing { display: none; }
|
71 |
#post-body #normal-sortables { min-height: 0px; }
|
72 |
.CodeMirror {
|
|
|
73 |
margin-top: 0px;
|
74 |
border: 1px solid #ddd;
|
75 |
border-bottom: none;
|
@@ -163,10 +165,6 @@ i.ccj-i-fullscreen:before {
|
|
163 |
.radio-group { line-height: 30px; padding-left: 10px; }
|
164 |
.radio-group .dashicons-before:before { margin: 7px 3px 0 3px; }
|
165 |
.options_meta_box select { margin-left: 10px; }
|
166 |
-
#custom-code-options .options_meta_box select {
|
167 |
-
margin-left: 0px;
|
168 |
-
width: 100%;
|
169 |
-
}
|
170 |
|
171 |
|
172 |
|
@@ -358,7 +356,7 @@ height: 3px;
|
|
358 |
color: white;
|
359 |
}
|
360 |
.ccj_only_premium>div {
|
361 |
-
font-family:sans-serif;font-size:13px;text-align: center; border-radius: 5px; float: left; background-color: rgb(51, 51, 51); color: white; width:
|
362 |
}
|
363 |
.ccj_only_premium a {
|
364 |
color: white; text-decoration: none;
|
@@ -370,10 +368,9 @@ height: 3px;
|
|
370 |
.ccj_only_premium-right {
|
371 |
width: 80px;
|
372 |
margin-left: 130px;
|
373 |
-
margin-top: -
|
374 |
}
|
375 |
.ccj_only_premium-right>div {
|
376 |
-
width:
|
377 |
padding: 10px;
|
378 |
-
margin-left: -110px;
|
379 |
}
|
62 |
*/
|
63 |
#content {
|
64 |
width: 100%;
|
65 |
+
height: 352px;
|
66 |
padding-left: 36px;
|
67 |
border-top: 0;
|
68 |
border-bottom: 0;
|
71 |
#minor-publishing { display: none; }
|
72 |
#post-body #normal-sortables { min-height: 0px; }
|
73 |
.CodeMirror {
|
74 |
+
height: 372px !important;
|
75 |
margin-top: 0px;
|
76 |
border: 1px solid #ddd;
|
77 |
border-bottom: none;
|
165 |
.radio-group { line-height: 30px; padding-left: 10px; }
|
166 |
.radio-group .dashicons-before:before { margin: 7px 3px 0 3px; }
|
167 |
.options_meta_box select { margin-left: 10px; }
|
|
|
|
|
|
|
|
|
168 |
|
169 |
|
170 |
|
356 |
color: white;
|
357 |
}
|
358 |
.ccj_only_premium>div {
|
359 |
+
font-family:sans-serif;font-size:13px;text-align: center; border-radius: 5px; float: left; background-color: rgb(51, 51, 51); color: white; width: 147px; padding: 20px 50px;
|
360 |
}
|
361 |
.ccj_only_premium a {
|
362 |
color: white; text-decoration: none;
|
368 |
.ccj_only_premium-right {
|
369 |
width: 80px;
|
370 |
margin-left: 130px;
|
371 |
+
margin-top: -60px;
|
372 |
}
|
373 |
.ccj_only_premium-right>div {
|
374 |
+
width: 100px;
|
375 |
padding: 10px;
|
|
|
376 |
}
|
assets/ccj_admin.js
CHANGED
@@ -1,7 +1,5 @@
|
|
1 |
jQuery(document).ready( function($) {
|
2 |
|
3 |
-
$('.page-title-action').hide();
|
4 |
-
|
5 |
// Initialize the CodeMirror editor
|
6 |
if ( $('#content').length > 0 ) {
|
7 |
var content_mode = $("#content").attr('mode');
|
@@ -21,40 +19,7 @@ jQuery(document).ready( function($) {
|
|
21 |
options['scrollbarStyle'] = "simple";
|
22 |
}
|
23 |
|
24 |
-
|
25 |
-
var cm_width = $('#title').width() + 16;
|
26 |
-
var cm_height = 500;
|
27 |
-
|
28 |
var editor = CodeMirror.fromTextArea(document.getElementById("content"), options);
|
29 |
-
|
30 |
-
editor.setSize(cm_width, cm_height);
|
31 |
-
|
32 |
-
$('.CodeMirror').resizable({
|
33 |
-
resize: function() {
|
34 |
-
editor.setSize($(this).width(), $(this).height());
|
35 |
-
} ,
|
36 |
-
maxWidth: cm_width,
|
37 |
-
minWidth: cm_width,
|
38 |
-
minHeight: 200
|
39 |
-
|
40 |
-
});
|
41 |
-
|
42 |
-
$(window).resize(function () {
|
43 |
-
var cm_width = $('#title').width() + 16;
|
44 |
-
var cm_height = $('.CodeMirror').height();
|
45 |
-
editor.setSize(cm_width, cm_height);
|
46 |
-
});
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
}
|
51 |
-
|
52 |
-
// Make the inactive rows opaque
|
53 |
-
if ( $('.dashicons-star-empty.ccj_row').length > 0 ) {
|
54 |
-
$('.dashicons-star-empty.ccj_row').each(function(){
|
55 |
-
$(this).parent().parent().parent().css('opacity', '0.4');
|
56 |
-
});
|
57 |
-
}
|
58 |
-
|
59 |
});
|
60 |
|
1 |
jQuery(document).ready( function($) {
|
2 |
|
|
|
|
|
3 |
// Initialize the CodeMirror editor
|
4 |
if ( $('#content').length > 0 ) {
|
5 |
var content_mode = $("#content").attr('mode');
|
19 |
options['scrollbarStyle'] = "simple";
|
20 |
}
|
21 |
|
|
|
|
|
|
|
|
|
22 |
var editor = CodeMirror.fromTextArea(document.getElementById("content"), options);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
});
|
25 |
|
assets/codemirror/addon/dialog.css
DELETED
@@ -1,32 +0,0 @@
|
|
1 |
-
.CodeMirror-dialog {
|
2 |
-
position: absolute;
|
3 |
-
left: 0; right: 0;
|
4 |
-
background: inherit;
|
5 |
-
z-index: 15;
|
6 |
-
padding: .1em .8em;
|
7 |
-
overflow: hidden;
|
8 |
-
color: inherit;
|
9 |
-
}
|
10 |
-
|
11 |
-
.CodeMirror-dialog-top {
|
12 |
-
border-bottom: 1px solid #eee;
|
13 |
-
top: 0;
|
14 |
-
}
|
15 |
-
|
16 |
-
.CodeMirror-dialog-bottom {
|
17 |
-
border-top: 1px solid #eee;
|
18 |
-
bottom: 0;
|
19 |
-
}
|
20 |
-
|
21 |
-
.CodeMirror-dialog input {
|
22 |
-
border: none;
|
23 |
-
outline: none;
|
24 |
-
background: transparent;
|
25 |
-
width: 20em;
|
26 |
-
color: inherit;
|
27 |
-
font-family: monospace;
|
28 |
-
}
|
29 |
-
|
30 |
-
.CodeMirror-dialog button {
|
31 |
-
font-size: 70%;
|
32 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/codemirror/addon/dialog.js
DELETED
@@ -1,157 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
// Open simple dialogs on top of an editor. Relies on dialog.css.
|
5 |
-
|
6 |
-
(function(mod) {
|
7 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
8 |
-
mod(require("../../lib/codemirror"));
|
9 |
-
else if (typeof define == "function" && define.amd) // AMD
|
10 |
-
define(["../../lib/codemirror"], mod);
|
11 |
-
else // Plain browser env
|
12 |
-
mod(CodeMirror);
|
13 |
-
})(function(CodeMirror) {
|
14 |
-
function dialogDiv(cm, template, bottom) {
|
15 |
-
var wrap = cm.getWrapperElement();
|
16 |
-
var dialog;
|
17 |
-
dialog = wrap.appendChild(document.createElement("div"));
|
18 |
-
if (bottom)
|
19 |
-
dialog.className = "CodeMirror-dialog CodeMirror-dialog-bottom";
|
20 |
-
else
|
21 |
-
dialog.className = "CodeMirror-dialog CodeMirror-dialog-top";
|
22 |
-
|
23 |
-
if (typeof template == "string") {
|
24 |
-
dialog.innerHTML = template;
|
25 |
-
} else { // Assuming it's a detached DOM element.
|
26 |
-
dialog.appendChild(template);
|
27 |
-
}
|
28 |
-
return dialog;
|
29 |
-
}
|
30 |
-
|
31 |
-
function closeNotification(cm, newVal) {
|
32 |
-
if (cm.state.currentNotificationClose)
|
33 |
-
cm.state.currentNotificationClose();
|
34 |
-
cm.state.currentNotificationClose = newVal;
|
35 |
-
}
|
36 |
-
|
37 |
-
CodeMirror.defineExtension("openDialog", function(template, callback, options) {
|
38 |
-
if (!options) options = {};
|
39 |
-
|
40 |
-
closeNotification(this, null);
|
41 |
-
|
42 |
-
var dialog = dialogDiv(this, template, options.bottom);
|
43 |
-
var closed = false, me = this;
|
44 |
-
function close(newVal) {
|
45 |
-
if (typeof newVal == 'string') {
|
46 |
-
inp.value = newVal;
|
47 |
-
} else {
|
48 |
-
if (closed) return;
|
49 |
-
closed = true;
|
50 |
-
dialog.parentNode.removeChild(dialog);
|
51 |
-
me.focus();
|
52 |
-
|
53 |
-
if (options.onClose) options.onClose(dialog);
|
54 |
-
}
|
55 |
-
}
|
56 |
-
|
57 |
-
var inp = dialog.getElementsByTagName("input")[0], button;
|
58 |
-
if (inp) {
|
59 |
-
inp.focus();
|
60 |
-
|
61 |
-
if (options.value) {
|
62 |
-
inp.value = options.value;
|
63 |
-
if (options.selectValueOnOpen !== false) {
|
64 |
-
inp.select();
|
65 |
-
}
|
66 |
-
}
|
67 |
-
|
68 |
-
if (options.onInput)
|
69 |
-
CodeMirror.on(inp, "input", function(e) { options.onInput(e, inp.value, close);});
|
70 |
-
if (options.onKeyUp)
|
71 |
-
CodeMirror.on(inp, "keyup", function(e) {options.onKeyUp(e, inp.value, close);});
|
72 |
-
|
73 |
-
CodeMirror.on(inp, "keydown", function(e) {
|
74 |
-
if (options && options.onKeyDown && options.onKeyDown(e, inp.value, close)) { return; }
|
75 |
-
if (e.keyCode == 27 || (options.closeOnEnter !== false && e.keyCode == 13)) {
|
76 |
-
inp.blur();
|
77 |
-
CodeMirror.e_stop(e);
|
78 |
-
close();
|
79 |
-
}
|
80 |
-
if (e.keyCode == 13) callback(inp.value, e);
|
81 |
-
});
|
82 |
-
|
83 |
-
if (options.closeOnBlur !== false) CodeMirror.on(inp, "blur", close);
|
84 |
-
} else if (button = dialog.getElementsByTagName("button")[0]) {
|
85 |
-
CodeMirror.on(button, "click", function() {
|
86 |
-
close();
|
87 |
-
me.focus();
|
88 |
-
});
|
89 |
-
|
90 |
-
if (options.closeOnBlur !== false) CodeMirror.on(button, "blur", close);
|
91 |
-
|
92 |
-
button.focus();
|
93 |
-
}
|
94 |
-
return close;
|
95 |
-
});
|
96 |
-
|
97 |
-
CodeMirror.defineExtension("openConfirm", function(template, callbacks, options) {
|
98 |
-
closeNotification(this, null);
|
99 |
-
var dialog = dialogDiv(this, template, options && options.bottom);
|
100 |
-
var buttons = dialog.getElementsByTagName("button");
|
101 |
-
var closed = false, me = this, blurring = 1;
|
102 |
-
function close() {
|
103 |
-
if (closed) return;
|
104 |
-
closed = true;
|
105 |
-
dialog.parentNode.removeChild(dialog);
|
106 |
-
me.focus();
|
107 |
-
}
|
108 |
-
buttons[0].focus();
|
109 |
-
for (var i = 0; i < buttons.length; ++i) {
|
110 |
-
var b = buttons[i];
|
111 |
-
(function(callback) {
|
112 |
-
CodeMirror.on(b, "click", function(e) {
|
113 |
-
CodeMirror.e_preventDefault(e);
|
114 |
-
close();
|
115 |
-
if (callback) callback(me);
|
116 |
-
});
|
117 |
-
})(callbacks[i]);
|
118 |
-
CodeMirror.on(b, "blur", function() {
|
119 |
-
--blurring;
|
120 |
-
setTimeout(function() { if (blurring <= 0) close(); }, 200);
|
121 |
-
});
|
122 |
-
CodeMirror.on(b, "focus", function() { ++blurring; });
|
123 |
-
}
|
124 |
-
});
|
125 |
-
|
126 |
-
/*
|
127 |
-
* openNotification
|
128 |
-
* Opens a notification, that can be closed with an optional timer
|
129 |
-
* (default 5000ms timer) and always closes on click.
|
130 |
-
*
|
131 |
-
* If a notification is opened while another is opened, it will close the
|
132 |
-
* currently opened one and open the new one immediately.
|
133 |
-
*/
|
134 |
-
CodeMirror.defineExtension("openNotification", function(template, options) {
|
135 |
-
closeNotification(this, close);
|
136 |
-
var dialog = dialogDiv(this, template, options && options.bottom);
|
137 |
-
var closed = false, doneTimer;
|
138 |
-
var duration = options && typeof options.duration !== "undefined" ? options.duration : 5000;
|
139 |
-
|
140 |
-
function close() {
|
141 |
-
if (closed) return;
|
142 |
-
closed = true;
|
143 |
-
clearTimeout(doneTimer);
|
144 |
-
dialog.parentNode.removeChild(dialog);
|
145 |
-
}
|
146 |
-
|
147 |
-
CodeMirror.on(dialog, 'click', function(e) {
|
148 |
-
CodeMirror.e_preventDefault(e);
|
149 |
-
close();
|
150 |
-
});
|
151 |
-
|
152 |
-
if (duration)
|
153 |
-
doneTimer = setTimeout(close, duration);
|
154 |
-
|
155 |
-
return close;
|
156 |
-
});
|
157 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/codemirror/addon/jump-to-line.js
DELETED
@@ -1,49 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
// Defines jumpToLine command. Uses dialog.js if present.
|
5 |
-
|
6 |
-
(function(mod) {
|
7 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
8 |
-
mod(require("../../lib/codemirror"), require("../dialog/dialog"));
|
9 |
-
else if (typeof define == "function" && define.amd) // AMD
|
10 |
-
define(["../../lib/codemirror", "../dialog/dialog"], mod);
|
11 |
-
else // Plain browser env
|
12 |
-
mod(CodeMirror);
|
13 |
-
})(function(CodeMirror) {
|
14 |
-
"use strict";
|
15 |
-
|
16 |
-
function dialog(cm, text, shortText, deflt, f) {
|
17 |
-
if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true});
|
18 |
-
else f(prompt(shortText, deflt));
|
19 |
-
}
|
20 |
-
|
21 |
-
var jumpDialog =
|
22 |
-
'Jump to line: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use line:column or scroll% syntax)</span>';
|
23 |
-
|
24 |
-
function interpretLine(cm, string) {
|
25 |
-
var num = Number(string)
|
26 |
-
if (/^[-+]/.test(string)) return cm.getCursor().line + num
|
27 |
-
else return num - 1
|
28 |
-
}
|
29 |
-
|
30 |
-
CodeMirror.commands.jumpToLine = function(cm) {
|
31 |
-
var cur = cm.getCursor();
|
32 |
-
dialog(cm, jumpDialog, "Jump to line:", (cur.line + 1) + ":" + cur.ch, function(posStr) {
|
33 |
-
if (!posStr) return;
|
34 |
-
|
35 |
-
var match;
|
36 |
-
if (match = /^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(posStr)) {
|
37 |
-
cm.setCursor(interpretLine(cm, match[1]), Number(match[2]))
|
38 |
-
} else if (match = /^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(posStr)) {
|
39 |
-
var line = Math.round(cm.lineCount() * Number(match[1]) / 100);
|
40 |
-
if (/^[-+]/.test(match[1])) line = cur.line + line + 1;
|
41 |
-
cm.setCursor(line - 1, cur.ch);
|
42 |
-
} else if (match = /^\s*\:?\s*([\+\-]?\d+)\s*/.exec(posStr)) {
|
43 |
-
cm.setCursor(interpretLine(cm, match[1]), cur.ch);
|
44 |
-
}
|
45 |
-
});
|
46 |
-
};
|
47 |
-
|
48 |
-
CodeMirror.keyMap["default"]["Alt-G"] = "jumpToLine";
|
49 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/codemirror/addon/matchesonscrollbar.css
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
.CodeMirror-search-match {
|
2 |
-
background: gold;
|
3 |
-
border-top: 1px solid orange;
|
4 |
-
border-bottom: 1px solid orange;
|
5 |
-
-moz-box-sizing: border-box;
|
6 |
-
box-sizing: border-box;
|
7 |
-
opacity: .5;
|
8 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/codemirror/addon/search.js
DELETED
@@ -1,249 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
// Define search commands. Depends on dialog.js or another
|
5 |
-
// implementation of the openDialog method.
|
6 |
-
|
7 |
-
// Replace works a little oddly -- it will do the replace on the next
|
8 |
-
// Ctrl-G (or whatever is bound to findNext) press. You prevent a
|
9 |
-
// replace by making sure the match is no longer selected when hitting
|
10 |
-
// Ctrl-G.
|
11 |
-
|
12 |
-
(function(mod) {
|
13 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
14 |
-
mod(require("../../lib/codemirror"), require("./searchcursor"), require("../dialog/dialog"));
|
15 |
-
else if (typeof define == "function" && define.amd) // AMD
|
16 |
-
define(["../../lib/codemirror", "./searchcursor", "../dialog/dialog"], mod);
|
17 |
-
else // Plain browser env
|
18 |
-
mod(CodeMirror);
|
19 |
-
})(function(CodeMirror) {
|
20 |
-
"use strict";
|
21 |
-
|
22 |
-
function searchOverlay(query, caseInsensitive) {
|
23 |
-
if (typeof query == "string")
|
24 |
-
query = new RegExp(query.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), caseInsensitive ? "gi" : "g");
|
25 |
-
else if (!query.global)
|
26 |
-
query = new RegExp(query.source, query.ignoreCase ? "gi" : "g");
|
27 |
-
|
28 |
-
return {token: function(stream) {
|
29 |
-
query.lastIndex = stream.pos;
|
30 |
-
var match = query.exec(stream.string);
|
31 |
-
if (match && match.index == stream.pos) {
|
32 |
-
stream.pos += match[0].length || 1;
|
33 |
-
return "searching";
|
34 |
-
} else if (match) {
|
35 |
-
stream.pos = match.index;
|
36 |
-
} else {
|
37 |
-
stream.skipToEnd();
|
38 |
-
}
|
39 |
-
}};
|
40 |
-
}
|
41 |
-
|
42 |
-
function SearchState() {
|
43 |
-
this.posFrom = this.posTo = this.lastQuery = this.query = null;
|
44 |
-
this.overlay = null;
|
45 |
-
}
|
46 |
-
|
47 |
-
function getSearchState(cm) {
|
48 |
-
return cm.state.search || (cm.state.search = new SearchState());
|
49 |
-
}
|
50 |
-
|
51 |
-
function queryCaseInsensitive(query) {
|
52 |
-
return typeof query == "string" && query == query.toLowerCase();
|
53 |
-
}
|
54 |
-
|
55 |
-
function getSearchCursor(cm, query, pos) {
|
56 |
-
// Heuristic: if the query string is all lowercase, do a case insensitive search.
|
57 |
-
return cm.getSearchCursor(query, pos, queryCaseInsensitive(query));
|
58 |
-
}
|
59 |
-
|
60 |
-
function persistentDialog(cm, text, deflt, onEnter, onKeyDown) {
|
61 |
-
cm.openDialog(text, onEnter, {
|
62 |
-
value: deflt,
|
63 |
-
selectValueOnOpen: true,
|
64 |
-
closeOnEnter: false,
|
65 |
-
onClose: function() { clearSearch(cm); },
|
66 |
-
onKeyDown: onKeyDown
|
67 |
-
});
|
68 |
-
}
|
69 |
-
|
70 |
-
function dialog(cm, text, shortText, deflt, f) {
|
71 |
-
if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true});
|
72 |
-
else f(prompt(shortText, deflt));
|
73 |
-
}
|
74 |
-
|
75 |
-
function confirmDialog(cm, text, shortText, fs) {
|
76 |
-
if (cm.openConfirm) cm.openConfirm(text, fs);
|
77 |
-
else if (confirm(shortText)) fs[0]();
|
78 |
-
}
|
79 |
-
|
80 |
-
function parseString(string) {
|
81 |
-
return string.replace(/\\(.)/g, function(_, ch) {
|
82 |
-
if (ch == "n") return "\n"
|
83 |
-
if (ch == "r") return "\r"
|
84 |
-
return ch
|
85 |
-
})
|
86 |
-
}
|
87 |
-
|
88 |
-
function parseQuery(query) {
|
89 |
-
var isRE = query.match(/^\/(.*)\/([a-z]*)$/);
|
90 |
-
if (isRE) {
|
91 |
-
try { query = new RegExp(isRE[1], isRE[2].indexOf("i") == -1 ? "" : "i"); }
|
92 |
-
catch(e) {} // Not a regular expression after all, do a string search
|
93 |
-
} else {
|
94 |
-
query = parseString(query)
|
95 |
-
}
|
96 |
-
if (typeof query == "string" ? query == "" : query.test(""))
|
97 |
-
query = /x^/;
|
98 |
-
return query;
|
99 |
-
}
|
100 |
-
|
101 |
-
var queryDialog =
|
102 |
-
'Search: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>';
|
103 |
-
|
104 |
-
function startSearch(cm, state, query) {
|
105 |
-
state.queryText = query;
|
106 |
-
state.query = parseQuery(query);
|
107 |
-
cm.removeOverlay(state.overlay, queryCaseInsensitive(state.query));
|
108 |
-
state.overlay = searchOverlay(state.query, queryCaseInsensitive(state.query));
|
109 |
-
cm.addOverlay(state.overlay);
|
110 |
-
if (cm.showMatchesOnScrollbar) {
|
111 |
-
if (state.annotate) { state.annotate.clear(); state.annotate = null; }
|
112 |
-
state.annotate = cm.showMatchesOnScrollbar(state.query, queryCaseInsensitive(state.query));
|
113 |
-
}
|
114 |
-
}
|
115 |
-
|
116 |
-
function doSearch(cm, rev, persistent, immediate) {
|
117 |
-
var state = getSearchState(cm);
|
118 |
-
if (state.query) return findNext(cm, rev);
|
119 |
-
var q = cm.getSelection() || state.lastQuery;
|
120 |
-
if (persistent && cm.openDialog) {
|
121 |
-
var hiding = null
|
122 |
-
var searchNext = function(query, event) {
|
123 |
-
CodeMirror.e_stop(event);
|
124 |
-
if (!query) return;
|
125 |
-
if (query != state.queryText) {
|
126 |
-
startSearch(cm, state, query);
|
127 |
-
state.posFrom = state.posTo = cm.getCursor();
|
128 |
-
}
|
129 |
-
if (hiding) hiding.style.opacity = 1
|
130 |
-
findNext(cm, event.shiftKey, function(_, to) {
|
131 |
-
var dialog
|
132 |
-
if (to.line < 3 && document.querySelector &&
|
133 |
-
(dialog = cm.display.wrapper.querySelector(".CodeMirror-dialog")) &&
|
134 |
-
dialog.getBoundingClientRect().bottom - 4 > cm.cursorCoords(to, "window").top)
|
135 |
-
(hiding = dialog).style.opacity = .4
|
136 |
-
})
|
137 |
-
};
|
138 |
-
persistentDialog(cm, queryDialog, q, searchNext, function(event, query) {
|
139 |
-
var cmd = CodeMirror.keyMap[cm.getOption("keyMap")][CodeMirror.keyName(event)];
|
140 |
-
if (cmd == "findNext" || cmd == "findPrev") {
|
141 |
-
CodeMirror.e_stop(event);
|
142 |
-
startSearch(cm, getSearchState(cm), query);
|
143 |
-
cm.execCommand(cmd);
|
144 |
-
} else if (cmd == "find" || cmd == "findPersistent") {
|
145 |
-
CodeMirror.e_stop(event);
|
146 |
-
searchNext(query, event);
|
147 |
-
}
|
148 |
-
});
|
149 |
-
if (immediate) {
|
150 |
-
startSearch(cm, state, q);
|
151 |
-
findNext(cm, rev);
|
152 |
-
}
|
153 |
-
} else {
|
154 |
-
dialog(cm, queryDialog, "Search for:", q, function(query) {
|
155 |
-
if (query && !state.query) cm.operation(function() {
|
156 |
-
startSearch(cm, state, query);
|
157 |
-
state.posFrom = state.posTo = cm.getCursor();
|
158 |
-
findNext(cm, rev);
|
159 |
-
});
|
160 |
-
});
|
161 |
-
}
|
162 |
-
}
|
163 |
-
|
164 |
-
function findNext(cm, rev, callback) {cm.operation(function() {
|
165 |
-
var state = getSearchState(cm);
|
166 |
-
var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo);
|
167 |
-
if (!cursor.find(rev)) {
|
168 |
-
cursor = getSearchCursor(cm, state.query, rev ? CodeMirror.Pos(cm.lastLine()) : CodeMirror.Pos(cm.firstLine(), 0));
|
169 |
-
if (!cursor.find(rev)) return;
|
170 |
-
}
|
171 |
-
cm.setSelection(cursor.from(), cursor.to());
|
172 |
-
cm.scrollIntoView({from: cursor.from(), to: cursor.to()}, 20);
|
173 |
-
state.posFrom = cursor.from(); state.posTo = cursor.to();
|
174 |
-
if (callback) callback(cursor.from(), cursor.to())
|
175 |
-
});}
|
176 |
-
|
177 |
-
function clearSearch(cm) {cm.operation(function() {
|
178 |
-
var state = getSearchState(cm);
|
179 |
-
state.lastQuery = state.query;
|
180 |
-
if (!state.query) return;
|
181 |
-
state.query = state.queryText = null;
|
182 |
-
cm.removeOverlay(state.overlay);
|
183 |
-
if (state.annotate) { state.annotate.clear(); state.annotate = null; }
|
184 |
-
});}
|
185 |
-
|
186 |
-
var replaceQueryDialog =
|
187 |
-
' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>';
|
188 |
-
var replacementQueryDialog = 'With: <input type="text" style="width: 10em" class="CodeMirror-search-field"/>';
|
189 |
-
var doReplaceConfirm = "Replace? <button>Yes</button> <button>No</button> <button>All</button> <button>Stop</button>";
|
190 |
-
|
191 |
-
function replaceAll(cm, query, text) {
|
192 |
-
cm.operation(function() {
|
193 |
-
for (var cursor = getSearchCursor(cm, query); cursor.findNext();) {
|
194 |
-
if (typeof query != "string") {
|
195 |
-
var match = cm.getRange(cursor.from(), cursor.to()).match(query);
|
196 |
-
cursor.replace(text.replace(/\$(\d)/g, function(_, i) {return match[i];}));
|
197 |
-
} else cursor.replace(text);
|
198 |
-
}
|
199 |
-
});
|
200 |
-
}
|
201 |
-
|
202 |
-
function replace(cm, all) {
|
203 |
-
if (cm.getOption("readOnly")) return;
|
204 |
-
var query = cm.getSelection() || getSearchState(cm).lastQuery;
|
205 |
-
var dialogText = all ? "Replace all:" : "Replace:"
|
206 |
-
dialog(cm, dialogText + replaceQueryDialog, dialogText, query, function(query) {
|
207 |
-
if (!query) return;
|
208 |
-
query = parseQuery(query);
|
209 |
-
dialog(cm, replacementQueryDialog, "Replace with:", "", function(text) {
|
210 |
-
text = parseString(text)
|
211 |
-
if (all) {
|
212 |
-
replaceAll(cm, query, text)
|
213 |
-
} else {
|
214 |
-
clearSearch(cm);
|
215 |
-
var cursor = getSearchCursor(cm, query, cm.getCursor("from"));
|
216 |
-
var advance = function() {
|
217 |
-
var start = cursor.from(), match;
|
218 |
-
if (!(match = cursor.findNext())) {
|
219 |
-
cursor = getSearchCursor(cm, query);
|
220 |
-
if (!(match = cursor.findNext()) ||
|
221 |
-
(start && cursor.from().line == start.line && cursor.from().ch == start.ch)) return;
|
222 |
-
}
|
223 |
-
cm.setSelection(cursor.from(), cursor.to());
|
224 |
-
cm.scrollIntoView({from: cursor.from(), to: cursor.to()});
|
225 |
-
confirmDialog(cm, doReplaceConfirm, "Replace?",
|
226 |
-
[function() {doReplace(match);}, advance,
|
227 |
-
function() {replaceAll(cm, query, text)}]);
|
228 |
-
};
|
229 |
-
var doReplace = function(match) {
|
230 |
-
cursor.replace(typeof query == "string" ? text :
|
231 |
-
text.replace(/\$(\d)/g, function(_, i) {return match[i];}));
|
232 |
-
advance();
|
233 |
-
};
|
234 |
-
advance();
|
235 |
-
}
|
236 |
-
});
|
237 |
-
});
|
238 |
-
}
|
239 |
-
|
240 |
-
CodeMirror.commands.find = function(cm) {clearSearch(cm); doSearch(cm);};
|
241 |
-
CodeMirror.commands.findPersistent = function(cm) {clearSearch(cm); doSearch(cm, false, true);};
|
242 |
-
CodeMirror.commands.findPersistentNext = function(cm) {doSearch(cm, false, true, true);};
|
243 |
-
CodeMirror.commands.findPersistentPrev = function(cm) {doSearch(cm, true, true, true);};
|
244 |
-
CodeMirror.commands.findNext = doSearch;
|
245 |
-
CodeMirror.commands.findPrev = function(cm) {doSearch(cm, true);};
|
246 |
-
CodeMirror.commands.clearSearch = clearSearch;
|
247 |
-
CodeMirror.commands.replace = replace;
|
248 |
-
CodeMirror.commands.replaceAll = function(cm) {replace(cm, true);};
|
249 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/codemirror/addon/searchcursor.js
DELETED
@@ -1,189 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
(function(mod) {
|
5 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
6 |
-
mod(require("../../lib/codemirror"));
|
7 |
-
else if (typeof define == "function" && define.amd) // AMD
|
8 |
-
define(["../../lib/codemirror"], mod);
|
9 |
-
else // Plain browser env
|
10 |
-
mod(CodeMirror);
|
11 |
-
})(function(CodeMirror) {
|
12 |
-
"use strict";
|
13 |
-
var Pos = CodeMirror.Pos;
|
14 |
-
|
15 |
-
function SearchCursor(doc, query, pos, caseFold) {
|
16 |
-
this.atOccurrence = false; this.doc = doc;
|
17 |
-
if (caseFold == null && typeof query == "string") caseFold = false;
|
18 |
-
|
19 |
-
pos = pos ? doc.clipPos(pos) : Pos(0, 0);
|
20 |
-
this.pos = {from: pos, to: pos};
|
21 |
-
|
22 |
-
// The matches method is filled in based on the type of query.
|
23 |
-
// It takes a position and a direction, and returns an object
|
24 |
-
// describing the next occurrence of the query, or null if no
|
25 |
-
// more matches were found.
|
26 |
-
if (typeof query != "string") { // Regexp match
|
27 |
-
if (!query.global) query = new RegExp(query.source, query.ignoreCase ? "ig" : "g");
|
28 |
-
this.matches = function(reverse, pos) {
|
29 |
-
if (reverse) {
|
30 |
-
query.lastIndex = 0;
|
31 |
-
var line = doc.getLine(pos.line).slice(0, pos.ch), cutOff = 0, match, start;
|
32 |
-
for (;;) {
|
33 |
-
query.lastIndex = cutOff;
|
34 |
-
var newMatch = query.exec(line);
|
35 |
-
if (!newMatch) break;
|
36 |
-
match = newMatch;
|
37 |
-
start = match.index;
|
38 |
-
cutOff = match.index + (match[0].length || 1);
|
39 |
-
if (cutOff == line.length) break;
|
40 |
-
}
|
41 |
-
var matchLen = (match && match[0].length) || 0;
|
42 |
-
if (!matchLen) {
|
43 |
-
if (start == 0 && line.length == 0) {match = undefined;}
|
44 |
-
else if (start != doc.getLine(pos.line).length) {
|
45 |
-
matchLen++;
|
46 |
-
}
|
47 |
-
}
|
48 |
-
} else {
|
49 |
-
query.lastIndex = pos.ch;
|
50 |
-
var line = doc.getLine(pos.line), match = query.exec(line);
|
51 |
-
var matchLen = (match && match[0].length) || 0;
|
52 |
-
var start = match && match.index;
|
53 |
-
if (start + matchLen != line.length && !matchLen) matchLen = 1;
|
54 |
-
}
|
55 |
-
if (match && matchLen)
|
56 |
-
return {from: Pos(pos.line, start),
|
57 |
-
to: Pos(pos.line, start + matchLen),
|
58 |
-
match: match};
|
59 |
-
};
|
60 |
-
} else { // String query
|
61 |
-
var origQuery = query;
|
62 |
-
if (caseFold) query = query.toLowerCase();
|
63 |
-
var fold = caseFold ? function(str){return str.toLowerCase();} : function(str){return str;};
|
64 |
-
var target = query.split("\n");
|
65 |
-
// Different methods for single-line and multi-line queries
|
66 |
-
if (target.length == 1) {
|
67 |
-
if (!query.length) {
|
68 |
-
// Empty string would match anything and never progress, so
|
69 |
-
// we define it to match nothing instead.
|
70 |
-
this.matches = function() {};
|
71 |
-
} else {
|
72 |
-
this.matches = function(reverse, pos) {
|
73 |
-
if (reverse) {
|
74 |
-
var orig = doc.getLine(pos.line).slice(0, pos.ch), line = fold(orig);
|
75 |
-
var match = line.lastIndexOf(query);
|
76 |
-
if (match > -1) {
|
77 |
-
match = adjustPos(orig, line, match);
|
78 |
-
return {from: Pos(pos.line, match), to: Pos(pos.line, match + origQuery.length)};
|
79 |
-
}
|
80 |
-
} else {
|
81 |
-
var orig = doc.getLine(pos.line).slice(pos.ch), line = fold(orig);
|
82 |
-
var match = line.indexOf(query);
|
83 |
-
if (match > -1) {
|
84 |
-
match = adjustPos(orig, line, match) + pos.ch;
|
85 |
-
return {from: Pos(pos.line, match), to: Pos(pos.line, match + origQuery.length)};
|
86 |
-
}
|
87 |
-
}
|
88 |
-
};
|
89 |
-
}
|
90 |
-
} else {
|
91 |
-
var origTarget = origQuery.split("\n");
|
92 |
-
this.matches = function(reverse, pos) {
|
93 |
-
var last = target.length - 1;
|
94 |
-
if (reverse) {
|
95 |
-
if (pos.line - (target.length - 1) < doc.firstLine()) return;
|
96 |
-
if (fold(doc.getLine(pos.line).slice(0, origTarget[last].length)) != target[target.length - 1]) return;
|
97 |
-
var to = Pos(pos.line, origTarget[last].length);
|
98 |
-
for (var ln = pos.line - 1, i = last - 1; i >= 1; --i, --ln)
|
99 |
-
if (target[i] != fold(doc.getLine(ln))) return;
|
100 |
-
var line = doc.getLine(ln), cut = line.length - origTarget[0].length;
|
101 |
-
if (fold(line.slice(cut)) != target[0]) return;
|
102 |
-
return {from: Pos(ln, cut), to: to};
|
103 |
-
} else {
|
104 |
-
if (pos.line + (target.length - 1) > doc.lastLine()) return;
|
105 |
-
var line = doc.getLine(pos.line), cut = line.length - origTarget[0].length;
|
106 |
-
if (fold(line.slice(cut)) != target[0]) return;
|
107 |
-
var from = Pos(pos.line, cut);
|
108 |
-
for (var ln = pos.line + 1, i = 1; i < last; ++i, ++ln)
|
109 |
-
if (target[i] != fold(doc.getLine(ln))) return;
|
110 |
-
if (fold(doc.getLine(ln).slice(0, origTarget[last].length)) != target[last]) return;
|
111 |
-
return {from: from, to: Pos(ln, origTarget[last].length)};
|
112 |
-
}
|
113 |
-
};
|
114 |
-
}
|
115 |
-
}
|
116 |
-
}
|
117 |
-
|
118 |
-
SearchCursor.prototype = {
|
119 |
-
findNext: function() {return this.find(false);},
|
120 |
-
findPrevious: function() {return this.find(true);},
|
121 |
-
|
122 |
-
find: function(reverse) {
|
123 |
-
var self = this, pos = this.doc.clipPos(reverse ? this.pos.from : this.pos.to);
|
124 |
-
function savePosAndFail(line) {
|
125 |
-
var pos = Pos(line, 0);
|
126 |
-
self.pos = {from: pos, to: pos};
|
127 |
-
self.atOccurrence = false;
|
128 |
-
return false;
|
129 |
-
}
|
130 |
-
|
131 |
-
for (;;) {
|
132 |
-
if (this.pos = this.matches(reverse, pos)) {
|
133 |
-
this.atOccurrence = true;
|
134 |
-
return this.pos.match || true;
|
135 |
-
}
|
136 |
-
if (reverse) {
|
137 |
-
if (!pos.line) return savePosAndFail(0);
|
138 |
-
pos = Pos(pos.line-1, this.doc.getLine(pos.line-1).length);
|
139 |
-
}
|
140 |
-
else {
|
141 |
-
var maxLine = this.doc.lineCount();
|
142 |
-
if (pos.line == maxLine - 1) return savePosAndFail(maxLine);
|
143 |
-
pos = Pos(pos.line + 1, 0);
|
144 |
-
}
|
145 |
-
}
|
146 |
-
},
|
147 |
-
|
148 |
-
from: function() {if (this.atOccurrence) return this.pos.from;},
|
149 |
-
to: function() {if (this.atOccurrence) return this.pos.to;},
|
150 |
-
|
151 |
-
replace: function(newText, origin) {
|
152 |
-
if (!this.atOccurrence) return;
|
153 |
-
var lines = CodeMirror.splitLines(newText);
|
154 |
-
this.doc.replaceRange(lines, this.pos.from, this.pos.to, origin);
|
155 |
-
this.pos.to = Pos(this.pos.from.line + lines.length - 1,
|
156 |
-
lines[lines.length - 1].length + (lines.length == 1 ? this.pos.from.ch : 0));
|
157 |
-
}
|
158 |
-
};
|
159 |
-
|
160 |
-
// Maps a position in a case-folded line back to a position in the original line
|
161 |
-
// (compensating for codepoints increasing in number during folding)
|
162 |
-
function adjustPos(orig, folded, pos) {
|
163 |
-
if (orig.length == folded.length) return pos;
|
164 |
-
for (var pos1 = Math.min(pos, orig.length);;) {
|
165 |
-
var len1 = orig.slice(0, pos1).toLowerCase().length;
|
166 |
-
if (len1 < pos) ++pos1;
|
167 |
-
else if (len1 > pos) --pos1;
|
168 |
-
else return pos1;
|
169 |
-
}
|
170 |
-
}
|
171 |
-
|
172 |
-
CodeMirror.defineExtension("getSearchCursor", function(query, pos, caseFold) {
|
173 |
-
return new SearchCursor(this.doc, query, pos, caseFold);
|
174 |
-
});
|
175 |
-
CodeMirror.defineDocExtension("getSearchCursor", function(query, pos, caseFold) {
|
176 |
-
return new SearchCursor(this, query, pos, caseFold);
|
177 |
-
});
|
178 |
-
|
179 |
-
CodeMirror.defineExtension("selectMatches", function(query, caseFold) {
|
180 |
-
var ranges = [];
|
181 |
-
var cur = this.getSearchCursor(query, this.getCursor("from"), caseFold);
|
182 |
-
while (cur.findNext()) {
|
183 |
-
if (CodeMirror.cmpPos(cur.to(), this.getCursor("to")) > 0) break;
|
184 |
-
ranges.push({anchor: cur.from(), head: cur.to()});
|
185 |
-
}
|
186 |
-
if (ranges.length)
|
187 |
-
this.setSelections(ranges, 0);
|
188 |
-
});
|
189 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
custom-css-js.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Simple Custom CSS and JS
|
4 |
* Plugin URI: https://wordpress.org/plugins/custom-css-js/
|
5 |
* Description: Easily add Custom CSS or JS to your website with an awesome editor.
|
6 |
-
* Version: 2.
|
7 |
* Author: Diana Burduja
|
8 |
* Author URI: https://www.silkypress.com/
|
9 |
* License: GPL2
|
@@ -15,7 +15,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
15 |
}
|
16 |
|
17 |
if ( ! class_exists( 'CustomCSSandJS' ) ) :
|
18 |
-
define( 'CCJ_VERSION', '2.
|
19 |
/**
|
20 |
* Main CustomCSSandJS Class
|
21 |
*
|
@@ -73,9 +73,9 @@ final class CustomCSSandJS {
|
|
73 |
$this->upload_url = $wp_upload_dir['baseurl'] . '/custom-css-js';
|
74 |
if ( is_admin() ) {
|
75 |
include_once( 'includes/admin-screens.php' );
|
|
|
76 |
include_once( 'includes/admin-addons.php' );
|
77 |
include_once( 'includes/admin-warnings.php' );
|
78 |
-
include_once( 'includes/admin-notices.php' );
|
79 |
}
|
80 |
|
81 |
$this->search_tree = get_option( 'custom-css-js-tree' );
|
@@ -177,7 +177,6 @@ final class CustomCSSandJS {
|
|
177 |
// link the HTML code
|
178 |
if ( strpos( $function, 'html' ) !== false ) {
|
179 |
foreach( $args as $_post_id ) {
|
180 |
-
$_post_id = str_replace('.html', '', $_post_id);
|
181 |
$post = get_post( $_post_id );
|
182 |
echo $post->post_content . PHP_EOL;
|
183 |
}
|
3 |
* Plugin Name: Simple Custom CSS and JS
|
4 |
* Plugin URI: https://wordpress.org/plugins/custom-css-js/
|
5 |
* Description: Easily add Custom CSS or JS to your website with an awesome editor.
|
6 |
+
* Version: 2.6
|
7 |
* Author: Diana Burduja
|
8 |
* Author URI: https://www.silkypress.com/
|
9 |
* License: GPL2
|
15 |
}
|
16 |
|
17 |
if ( ! class_exists( 'CustomCSSandJS' ) ) :
|
18 |
+
define( 'CCJ_VERSION', '2.6' );
|
19 |
/**
|
20 |
* Main CustomCSSandJS Class
|
21 |
*
|
73 |
$this->upload_url = $wp_upload_dir['baseurl'] . '/custom-css-js';
|
74 |
if ( is_admin() ) {
|
75 |
include_once( 'includes/admin-screens.php' );
|
76 |
+
include_once( 'includes/admin-notices.php' );
|
77 |
include_once( 'includes/admin-addons.php' );
|
78 |
include_once( 'includes/admin-warnings.php' );
|
|
|
79 |
}
|
80 |
|
81 |
$this->search_tree = get_option( 'custom-css-js-tree' );
|
177 |
// link the HTML code
|
178 |
if ( strpos( $function, 'html' ) !== false ) {
|
179 |
foreach( $args as $_post_id ) {
|
|
|
180 |
$post = get_post( $_post_id );
|
181 |
echo $post->post_content . PHP_EOL;
|
182 |
}
|
includes/admin-addons.php
CHANGED
@@ -39,7 +39,7 @@ class CustomCSSandJS_Addons {
|
|
39 |
?>
|
40 |
<div class="ccj_only_premium ccj_only_premium-first">
|
41 |
<div>
|
42 |
-
<a href="https://www.silkypress.com/simple-custom-css-js-pro
|
43 |
</div>
|
44 |
</div>
|
45 |
<?php
|
39 |
?>
|
40 |
<div class="ccj_only_premium ccj_only_premium-first">
|
41 |
<div>
|
42 |
+
<a href="https://www.silkypress.com/simple-custom-css-js-pro/" target="_blank">Only available in Premium version</a>
|
43 |
</div>
|
44 |
</div>
|
45 |
<?php
|
includes/admin-notices.php
CHANGED
@@ -17,7 +17,7 @@ class CustomCSSandJS_Notices {
|
|
17 |
var $activation_time = '';
|
18 |
var $version = '';
|
19 |
var $dismiss_notice = '';
|
20 |
-
var $expiration_days =
|
21 |
|
22 |
/**
|
23 |
* Constructor
|
@@ -40,17 +40,10 @@ class CustomCSSandJS_Notices {
|
|
40 |
* Hooked from 'admin_notices'
|
41 |
*/
|
42 |
public function admin_notices() {
|
43 |
-
$screen = get_current_screen();
|
44 |
-
|
45 |
-
if ( !isset($screen->post_type) || $screen->post_type !== 'custom-css-js' )
|
46 |
-
return;
|
47 |
|
48 |
if ( ! $notice = $this->choose_notice() )
|
49 |
return;
|
50 |
|
51 |
-
if ( time() - $this->activation_time <= 3600 )
|
52 |
-
return;
|
53 |
-
|
54 |
$message = $this->get_message( $notice );
|
55 |
|
56 |
$this->print_message( $notice, $message );
|
@@ -88,16 +81,16 @@ class CustomCSSandJS_Notices {
|
|
88 |
switch ( $days_passed ) {
|
89 |
case 1 : return '1_day';
|
90 |
case 2 : return '2_day';
|
91 |
-
case 3 :
|
92 |
-
case 4 :
|
93 |
-
case 5 :
|
94 |
-
case 6 :
|
95 |
-
case 7 :
|
96 |
-
case 8 :
|
97 |
-
case 9 :
|
98 |
-
case 10 :
|
99 |
-
case 11 :
|
100 |
-
case 12 :
|
101 |
}
|
102 |
}
|
103 |
|
@@ -107,30 +100,28 @@ class CustomCSSandJS_Notices {
|
|
107 |
public function get_message( $notice ) {
|
108 |
|
109 |
$message = '';
|
110 |
-
$percentage = '
|
111 |
$product_name = 'Simple Custom CSS and JS PRO';
|
112 |
|
113 |
$expiration_date = $this->activation_time + ( $this->expiration_days * 86400 );
|
114 |
$expiration_date = date( get_option( 'date_format') , $expiration_date );
|
115 |
|
116 |
-
$expiration_period = date('j M', $this->activation_time - 3*86400 ) . ' - ' . date('j M', $this->activation_time + 2*86400 );
|
117 |
-
|
118 |
|
119 |
if ( $notice == '12_days' ) {
|
120 |
-
$link = 'https://www.silkypress.com/simple-custom-css-js-pro
|
121 |
} else {
|
122 |
-
$link = 'https://www.silkypress.com/simple-custom-css-js-pro/?a=' . $this->convert_numbers_letters( $this->activation_time )
|
123 |
}
|
124 |
|
125 |
-
$lower_part = sprintf( '<div style="margin-top: 7px;"><a href="%s" target="_blank">%s</a> | <a href="#" class="dismiss_notice" target="_parent">%s</a></div>', $link, 'Get
|
126 |
|
127 |
switch ( $notice ) {
|
128 |
case '1_day' :
|
129 |
-
$message = '<div>
|
130 |
break;
|
131 |
|
132 |
case '2_day' :
|
133 |
-
$message = '<div><b>Limited offer ending
|
134 |
break;
|
135 |
|
136 |
case '3_day' :
|
17 |
var $activation_time = '';
|
18 |
var $version = '';
|
19 |
var $dismiss_notice = '';
|
20 |
+
var $expiration_days = 3;
|
21 |
|
22 |
/**
|
23 |
* Constructor
|
40 |
* Hooked from 'admin_notices'
|
41 |
*/
|
42 |
public function admin_notices() {
|
|
|
|
|
|
|
|
|
43 |
|
44 |
if ( ! $notice = $this->choose_notice() )
|
45 |
return;
|
46 |
|
|
|
|
|
|
|
47 |
$message = $this->get_message( $notice );
|
48 |
|
49 |
$this->print_message( $notice, $message );
|
81 |
switch ( $days_passed ) {
|
82 |
case 1 : return '1_day';
|
83 |
case 2 : return '2_day';
|
84 |
+
case 3 : return '3_day';
|
85 |
+
case 4 :
|
86 |
+
case 5 :
|
87 |
+
case 6 :
|
88 |
+
case 7 : return '7_day';
|
89 |
+
case 8 :
|
90 |
+
case 9 :
|
91 |
+
case 10 :
|
92 |
+
case 11 :
|
93 |
+
case 12 : return '12_day';
|
94 |
}
|
95 |
}
|
96 |
|
100 |
public function get_message( $notice ) {
|
101 |
|
102 |
$message = '';
|
103 |
+
$percentage = '40';
|
104 |
$product_name = 'Simple Custom CSS and JS PRO';
|
105 |
|
106 |
$expiration_date = $this->activation_time + ( $this->expiration_days * 86400 );
|
107 |
$expiration_date = date( get_option( 'date_format') , $expiration_date );
|
108 |
|
|
|
|
|
109 |
|
110 |
if ( $notice == '12_days' ) {
|
111 |
+
$link = 'https://www.silkypress.com/simple-custom-css-js-pro-offer/';
|
112 |
} else {
|
113 |
+
$link = 'https://www.silkypress.com/simple-custom-css-js-pro-special-offer/?a=' . $this->convert_numbers_letters( $this->activation_time );
|
114 |
}
|
115 |
|
116 |
+
$lower_part = sprintf( '<div style="margin-top: 7px;"><a href="%s" target="_blank">%s</a> | <a href="#" class="dismiss_notice" target="_parent">%s</a></div>', $link, 'Get ' . $product_name, 'Dismiss this notice' );
|
117 |
|
118 |
switch ( $notice ) {
|
119 |
case '1_day' :
|
120 |
+
$message = '<div><b>Limited offer ending on '. $expiration_date .'</b>. '.$percentage.'% Off from '.$product_name.' for our WordPress.org users.</div>' . $lower_part;
|
121 |
break;
|
122 |
|
123 |
case '2_day' :
|
124 |
+
$message = '<div><b>Limited offer ending in 1 day (on '. $expiration_date .')</b>. '.$percentage.'% Off from '.$product_name.' for our WordPress.org users. </div>' . $lower_part;
|
125 |
break;
|
126 |
|
127 |
case '3_day' :
|
includes/admin-screens.php
CHANGED
@@ -118,7 +118,7 @@ class CustomCSSandJS_Admin {
|
|
118 |
$cm = $a . '/codemirror';
|
119 |
$v = CCJ_VERSION;
|
120 |
|
121 |
-
wp_register_script( 'ccj_admin', $a . '/ccj_admin.js', array('jquery'
|
122 |
wp_localize_script( 'ccj_admin', 'CCJ', $this->cm_localize() );
|
123 |
wp_enqueue_script( 'ccj_admin' );
|
124 |
wp_enqueue_style( 'ccj_admin', $a . '/ccj_admin.css', array(), $v );
|
@@ -126,7 +126,6 @@ class CustomCSSandJS_Admin {
|
|
126 |
|
127 |
// Only for the new/edit Code's page
|
128 |
if ( $hook == 'post-new.php' || $hook == 'post.php' ) {
|
129 |
-
wp_enqueue_style( 'jquery-ui', 'https://code.jquery.com/ui/1.12.0/themes/base/jquery-ui.css', array(), $v );
|
130 |
wp_enqueue_script( 'ccj_codemirror', $cm . '/codemirror-compressed.js', array( 'jquery' ), $v, false);
|
131 |
wp_enqueue_style( 'ccj_codemirror', $cm . '/codemirror-compressed.css', array(), $v );
|
132 |
wp_enqueue_script( 'ccj_admin_url_rules', $a . '/ccj_admin-url_rules.js', array('jquery'), $v, false );
|
@@ -140,16 +139,6 @@ class CustomCSSandJS_Admin {
|
|
140 |
wp_enqueue_script('cm-css', $cmm . 'css/css.js', array('ccj_codemirror'), $v, false);
|
141 |
wp_enqueue_script('cm-htmlmixed', $cmm . 'htmlmixed/htmlmixed.js', array('ccj_codemirror'), $v, false);
|
142 |
|
143 |
-
$cma = $cm . '/addon/';
|
144 |
-
wp_enqueue_script('cm-dialog', $cma . 'dialog.js', array('ccj_codemirror'), $v, false);
|
145 |
-
wp_enqueue_script('cm-search', $cma . 'search.js', array('ccj_codemirror'), $v, false);
|
146 |
-
wp_enqueue_script('cm-searchcursor', $cma . 'searchcursor.js',array('ccj_codemirror'), $v, false);
|
147 |
-
wp_enqueue_script('cm-jump-to-line', $cma . 'jump-to-line.js', array('ccj_codemirror'), $v, false);
|
148 |
-
wp_enqueue_style('cm-matchesonscrollbar', $cma . 'matchesonscrollbar.css', array(), $v );
|
149 |
-
wp_enqueue_style('cm-dialog', $cma . 'dialog.css', array(), $v );
|
150 |
-
wp_enqueue_style('cm-matchesonscrollbar', $cma . 'matchesonscrollbar.css', array(), $v );
|
151 |
-
|
152 |
-
|
153 |
}
|
154 |
}
|
155 |
|
@@ -309,7 +298,7 @@ class CustomCSSandJS_Admin {
|
|
309 |
if ( $this->is_active( $post_id ) ) {
|
310 |
echo '<span class="dashicons dashicons-star-filled" title="The code is active. Click to inactivate it"></span>';
|
311 |
} else {
|
312 |
-
echo '<span class="dashicons dashicons-star-empty
|
313 |
}
|
314 |
echo '</a>';
|
315 |
|
@@ -576,10 +565,11 @@ End of comment */ ' . PHP_EOL . PHP_EOL;
|
|
576 |
foreach( $meta as $_key => $a ) {
|
577 |
$close_div = false;
|
578 |
|
579 |
-
if (
|
580 |
-
|
581 |
-
|
582 |
-
|
|
|
583 |
$close_div = true;
|
584 |
$output .= '<div class="ccj_opaque">';
|
585 |
}
|
@@ -611,7 +601,7 @@ End of comment */ ' . PHP_EOL . PHP_EOL;
|
|
611 |
|
612 |
<div class="ccj_only_premium ccj_only_premium-right">
|
613 |
<div>
|
614 |
-
<a href="https://www.silkypress.com/simple-custom-css-js-pro
|
615 |
</div>
|
616 |
</div>
|
617 |
|
@@ -694,25 +684,7 @@ End of comment */ ' . PHP_EOL . PHP_EOL;
|
|
694 |
'dashicon' => 'editor-contract',
|
695 |
'disabled' => true,
|
696 |
),
|
697 |
-
|
698 |
-
'title' => 'Priority',
|
699 |
-
'type' => 'select',
|
700 |
-
'default' => 5,
|
701 |
-
'dashicon' => 'sort',
|
702 |
-
'values' => array(
|
703 |
-
1 => '1 (highest)',
|
704 |
-
2 => '2',
|
705 |
-
3 => '3',
|
706 |
-
4 => '4',
|
707 |
-
5 => '5',
|
708 |
-
6 => '6',
|
709 |
-
7 => '7',
|
710 |
-
8 => '8',
|
711 |
-
9 => '9',
|
712 |
-
10 => '10 (lowest)',
|
713 |
-
),
|
714 |
-
'disabled' => true,
|
715 |
-
),
|
716 |
);
|
717 |
|
718 |
return $options;
|
@@ -775,26 +747,6 @@ End of comment */ ' . PHP_EOL . PHP_EOL;
|
|
775 |
),
|
776 |
'disabled' => true,
|
777 |
),
|
778 |
-
'priority' => array(
|
779 |
-
'title' => 'Priority',
|
780 |
-
'type' => 'select',
|
781 |
-
'default' => 5,
|
782 |
-
'dashicon' => 'sort',
|
783 |
-
'values' => array(
|
784 |
-
1 => '1 (highest)',
|
785 |
-
2 => '2',
|
786 |
-
3 => '3',
|
787 |
-
4 => '4',
|
788 |
-
5 => '5',
|
789 |
-
6 => '6',
|
790 |
-
7 => '7',
|
791 |
-
8 => '8',
|
792 |
-
9 => '9',
|
793 |
-
10 => '10 (lowest)',
|
794 |
-
),
|
795 |
-
'disabled' => true,
|
796 |
-
),
|
797 |
-
|
798 |
);
|
799 |
|
800 |
return $options;
|
@@ -1028,21 +980,11 @@ End of comment */ ' . PHP_EOL . PHP_EOL;
|
|
1028 |
$output .= '<label class="'.$dashicons.'" for="'.$name.'"> '.$a['title'].'</label>';
|
1029 |
$output .= '</div>' . PHP_EOL;
|
1030 |
}
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
if ( $a['type'] == 'select' ) {
|
1035 |
-
$output .= '<div class="radio-group">' . PHP_EOL;
|
1036 |
-
$output .= '<select name="'.$name.'" id="'.$name.'">' . PHP_EOL;
|
1037 |
-
foreach( $a['values'] as $__key => $__value ) {
|
1038 |
-
$selected = ( isset($options[$_key]) && $options[$_key] == $__key) ? ' selected="selected"' : '';
|
1039 |
-
$output .= '<option value="'.$__key.'"'.$selected.'>' . $__value . '</option>' . PHP_EOL;
|
1040 |
-
}
|
1041 |
-
$output .= '</select>' . PHP_EOL;
|
1042 |
-
$output .= '</div>' . PHP_EOL;
|
1043 |
}
|
1044 |
|
1045 |
-
|
1046 |
return $output;
|
1047 |
|
1048 |
}
|
118 |
$cm = $a . '/codemirror';
|
119 |
$v = CCJ_VERSION;
|
120 |
|
121 |
+
wp_register_script( 'ccj_admin', $a . '/ccj_admin.js', array('jquery'), $v, false );
|
122 |
wp_localize_script( 'ccj_admin', 'CCJ', $this->cm_localize() );
|
123 |
wp_enqueue_script( 'ccj_admin' );
|
124 |
wp_enqueue_style( 'ccj_admin', $a . '/ccj_admin.css', array(), $v );
|
126 |
|
127 |
// Only for the new/edit Code's page
|
128 |
if ( $hook == 'post-new.php' || $hook == 'post.php' ) {
|
|
|
129 |
wp_enqueue_script( 'ccj_codemirror', $cm . '/codemirror-compressed.js', array( 'jquery' ), $v, false);
|
130 |
wp_enqueue_style( 'ccj_codemirror', $cm . '/codemirror-compressed.css', array(), $v );
|
131 |
wp_enqueue_script( 'ccj_admin_url_rules', $a . '/ccj_admin-url_rules.js', array('jquery'), $v, false );
|
139 |
wp_enqueue_script('cm-css', $cmm . 'css/css.js', array('ccj_codemirror'), $v, false);
|
140 |
wp_enqueue_script('cm-htmlmixed', $cmm . 'htmlmixed/htmlmixed.js', array('ccj_codemirror'), $v, false);
|
141 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
}
|
143 |
}
|
144 |
|
298 |
if ( $this->is_active( $post_id ) ) {
|
299 |
echo '<span class="dashicons dashicons-star-filled" title="The code is active. Click to inactivate it"></span>';
|
300 |
} else {
|
301 |
+
echo '<span class="dashicons dashicons-star-empty" title="The code is inactive. Click to activate it"></span>';
|
302 |
}
|
303 |
echo '</a>';
|
304 |
|
565 |
foreach( $meta as $_key => $a ) {
|
566 |
$close_div = false;
|
567 |
|
568 |
+
if ( $_key == 'preprocessor' ) {
|
569 |
+
$output .= '<div class="ccj_opaque">';
|
570 |
+
}
|
571 |
+
|
572 |
+
if ( $_key == 'linking' && $options['language'] == 'html' ) {
|
573 |
$close_div = true;
|
574 |
$output .= '<div class="ccj_opaque">';
|
575 |
}
|
601 |
|
602 |
<div class="ccj_only_premium ccj_only_premium-right">
|
603 |
<div>
|
604 |
+
<a href="https://www.silkypress.com/simple-custom-css-js-pro/" target="_blank">Only available in Premium version</a>
|
605 |
</div>
|
606 |
</div>
|
607 |
|
684 |
'dashicon' => 'editor-contract',
|
685 |
'disabled' => true,
|
686 |
),
|
687 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
688 |
);
|
689 |
|
690 |
return $options;
|
747 |
),
|
748 |
'disabled' => true,
|
749 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
750 |
);
|
751 |
|
752 |
return $options;
|
980 |
$output .= '<label class="'.$dashicons.'" for="'.$name.'"> '.$a['title'].'</label>';
|
981 |
$output .= '</div>' . PHP_EOL;
|
982 |
}
|
983 |
+
|
984 |
+
if ( $_key == 'minify' ) {
|
985 |
+
$output .= '</div>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
986 |
}
|
987 |
|
|
|
988 |
return $output;
|
989 |
|
990 |
}
|
readme.txt
CHANGED
@@ -5,8 +5,8 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=diana
|
|
5 |
Email: diana@burduja.eu
|
6 |
Tags: CSS, JS, javascript, custom CSS, custom JS, custom style, site css, add style, customize theme, custom code, external css, css3, style, styles, stylesheet, theme, editor, design, admin
|
7 |
Requires at least: 3.0.1
|
8 |
-
Tested up to: 4.
|
9 |
-
Stable tag: 2.
|
10 |
License: GPLv3
|
11 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
12 |
|
@@ -48,7 +48,7 @@ Yes.
|
|
48 |
The CSS and JS are independent of the theme and they will persist through a theme change. This is particularly useful if you apply CSS and JS for modifying a plugin's output.
|
49 |
|
50 |
* **Can I use a CSS preprocesor like LESS or Sass?**
|
51 |
-
For the moment only plain CSS is supported, but you can check out the [Pro version](https://www.silkypress.com/simple-custom-css-js-pro
|
52 |
|
53 |
* **Can I upload images for use with my CSS?**
|
54 |
Yes. You can upload an image to your Media Library, then refer to it by its direct URL from within the CSS stylesheet. For example:
|
@@ -115,25 +115,6 @@ $. Add/Edit HTML
|
|
115 |
|
116 |
== Changelog ==
|
117 |
|
118 |
-
= 2.10 =
|
119 |
-
* 02/05/2016
|
120 |
-
* Feature: circumvent external file caching by adding a GET parameter
|
121 |
-
* Add special offer for Simple Custom CSS and JS pro
|
122 |
-
|
123 |
-
= 2.9 =
|
124 |
-
* 12/05/2016
|
125 |
-
* Compatibility with WP4.7. The "custom HTML code" was not showing up anymore
|
126 |
-
|
127 |
-
= 2.8 =
|
128 |
-
* 10/09/2016
|
129 |
-
* Feature: add search within the editor accessible with Ctrl+F
|
130 |
-
* Feature: make the inactive rows opaque
|
131 |
-
|
132 |
-
= 2.7 =
|
133 |
-
* 09/04/2016
|
134 |
-
* Fix: there was a space in the htmlmixed.%20js url
|
135 |
-
* Feature: make the editor resizable
|
136 |
-
|
137 |
= 2.6 =
|
138 |
* 08/31/2016
|
139 |
* Feature: add HTML code
|
5 |
Email: diana@burduja.eu
|
6 |
Tags: CSS, JS, javascript, custom CSS, custom JS, custom style, site css, add style, customize theme, custom code, external css, css3, style, styles, stylesheet, theme, editor, design, admin
|
7 |
Requires at least: 3.0.1
|
8 |
+
Tested up to: 4.6
|
9 |
+
Stable tag: 2.6
|
10 |
License: GPLv3
|
11 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
12 |
|
48 |
The CSS and JS are independent of the theme and they will persist through a theme change. This is particularly useful if you apply CSS and JS for modifying a plugin's output.
|
49 |
|
50 |
* **Can I use a CSS preprocesor like LESS or Sass?**
|
51 |
+
For the moment only plain CSS is supported, but you can check out the [Pro version](https://www.silkypress.com/simple-custom-css-js-pro/) in case you need a CSS preprocessor.
|
52 |
|
53 |
* **Can I upload images for use with my CSS?**
|
54 |
Yes. You can upload an image to your Media Library, then refer to it by its direct URL from within the CSS stylesheet. For example:
|
115 |
|
116 |
== Changelog ==
|
117 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
= 2.6 =
|
119 |
* 08/31/2016
|
120 |
* Feature: add HTML code
|
screenshot-1.jpg
DELETED
Binary file
|
screenshot-2.jpg
DELETED
Binary file
|
screenshot-3.jpg
DELETED
Binary file
|
screenshot-4.jpg
DELETED
Binary file
|