liquid_cms 0.3.0.1 → 0.3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.rdoc +5 -1
- data/Gemfile.lock +1 -1
- data/README.rdoc +5 -1
- data/app/helpers/cms/common_helper.rb +1 -0
- data/app/views/cms/pages/_page.html.erb +2 -1
- data/app/views/layouts/cms.html.erb +2 -1
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/LICENSE +2 -2
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/css/csscolors.css +12 -8
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/css/docs.css +123 -29
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/csstest.html +1 -1
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/htmltest.html +1 -1
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/index.html +232 -179
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/js/codemirror.js +211 -65
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/js/editor.js +360 -194
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/js/mirrorframe.js +1 -1
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/js/parsecss.js +11 -7
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/js/parsejavascript.js +14 -5
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/js/parsesparql.js +1 -1
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/js/select.js +140 -87
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/js/stringstream.js +5 -0
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/js/tokenizejavascript.js +1 -1
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/js/undo.js +7 -7
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/manual.html +148 -52
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/story.html +631 -614
- data/lib/generators/liquid_cms/templates/public/cms/stylesheets/styles.css +7 -7
- data/lib/liquid_cms/version.rb +1 -1
- metadata +4 -26
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/contrib/lua/LICENSE +0 -32
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/contrib/lua/css/luacolors.css +0 -63
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/contrib/lua/index.html +0 -68
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/contrib/lua/js/parselua.js +0 -253
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/contrib/php/LICENSE +0 -37
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/contrib/php/css/phpcolors.css +0 -114
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/contrib/php/index.html +0 -292
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/contrib/php/js/parsephp.js +0 -371
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/contrib/php/js/parsephphtmlmixed.js +0 -90
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/contrib/php/js/tokenizephp.js +0 -1006
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/contrib/plsql/LICENSE +0 -22
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/contrib/plsql/css/plsqlcolors.css +0 -57
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/contrib/plsql/index.html +0 -67
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/contrib/plsql/js/parseplsql.js +0 -233
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/contrib/python/LICENSE +0 -32
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/contrib/python/css/pythoncolors.css +0 -58
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/contrib/python/index.html +0 -141
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/contrib/python/js/parsepython.js +0 -542
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/contrib/sql/LICENSE +0 -22
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/contrib/sql/css/sqlcolors.css +0 -57
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/contrib/sql/index.html +0 -56
- data/lib/generators/liquid_cms/templates/public/cms/codemirror/contrib/sql/js/parsesql.js +0 -211
@@ -1,22 +0,0 @@
|
|
1
|
-
Copyright (c) 2010 Peter Raganitsch
|
2
|
-
|
3
|
-
This software is provided 'as-is', without any express or implied
|
4
|
-
warranty. In no event will the authors be held liable for any
|
5
|
-
damages arising from the use of this software.
|
6
|
-
|
7
|
-
Permission is granted to anyone to use this software for any
|
8
|
-
purpose, including commercial applications, and to alter it and
|
9
|
-
redistribute it freely, subject to the following restrictions:
|
10
|
-
|
11
|
-
1. The origin of this software must not be misrepresented; you must
|
12
|
-
not claim that you wrote the original software. If you use this
|
13
|
-
software in a product, an acknowledgment in the product
|
14
|
-
documentation would be appreciated but is not required.
|
15
|
-
|
16
|
-
2. Altered source versions must be plainly marked as such, and must
|
17
|
-
not be misrepresented as being the original software.
|
18
|
-
|
19
|
-
3. This notice may not be removed or altered from any source
|
20
|
-
distribution.
|
21
|
-
|
22
|
-
Peter Raganitsch
|
data/lib/generators/liquid_cms/templates/public/cms/codemirror/contrib/plsql/css/plsqlcolors.css
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
html {
|
2
|
-
cursor: text;
|
3
|
-
}
|
4
|
-
|
5
|
-
.editbox {
|
6
|
-
margin: .4em;
|
7
|
-
padding: 0;
|
8
|
-
font-family: monospace;
|
9
|
-
font-size: 10pt;
|
10
|
-
color: black;
|
11
|
-
}
|
12
|
-
|
13
|
-
.editbox p {
|
14
|
-
margin: 0;
|
15
|
-
}
|
16
|
-
|
17
|
-
span.plsql-keyword {
|
18
|
-
color: blue;
|
19
|
-
}
|
20
|
-
|
21
|
-
span.plsql-var {
|
22
|
-
color: red;
|
23
|
-
}
|
24
|
-
|
25
|
-
span.plsql-comment {
|
26
|
-
color: #AA7700;
|
27
|
-
}
|
28
|
-
|
29
|
-
span.plsql-literal {
|
30
|
-
color: green;
|
31
|
-
}
|
32
|
-
|
33
|
-
span.plsql-operator {
|
34
|
-
color: blue;
|
35
|
-
}
|
36
|
-
|
37
|
-
span.plsql-word {
|
38
|
-
color: black;
|
39
|
-
}
|
40
|
-
|
41
|
-
span.plsql-function {
|
42
|
-
color: darkorange;
|
43
|
-
}
|
44
|
-
|
45
|
-
span.plsql-type {
|
46
|
-
color: purple;
|
47
|
-
}
|
48
|
-
|
49
|
-
span.plsql-separator {
|
50
|
-
color: #666666;
|
51
|
-
}
|
52
|
-
|
53
|
-
span.plsql-number {
|
54
|
-
color: darkcyan;
|
55
|
-
}
|
56
|
-
|
57
|
-
|
@@ -1,67 +0,0 @@
|
|
1
|
-
<html xmlns="http://www.w3.org/1999/xhtml">
|
2
|
-
<head>
|
3
|
-
<script src="../../js/codemirror.js" type="text/javascript"></script>
|
4
|
-
<title>CodeMirror: PLSQL demonstration</title>
|
5
|
-
<link rel="stylesheet" type="text/css" href="../../css/docs.css"/>
|
6
|
-
</head>
|
7
|
-
<body style="padding: 20px;">
|
8
|
-
|
9
|
-
<p>Demonstration of <a href="index.html">CodeMirror</a>'s PLSQL
|
10
|
-
highlighter.</p>
|
11
|
-
|
12
|
-
<p>Written by Peter Raganitsch (<a href="LICENSE">license</a>), based
|
13
|
-
on John Benediktsson <a href="../sql/index.html">SQL parser</a>.</p>
|
14
|
-
|
15
|
-
<div class="border">
|
16
|
-
<textarea id="code" cols="120" rows="50">
|
17
|
-
PROCEDURE generateResult
|
18
|
-
( pRoutineType IN VARCHAR2
|
19
|
-
, pReferenceType IN VARCHAR2
|
20
|
-
, pReferenceId IN NUMBER
|
21
|
-
)
|
22
|
-
IS
|
23
|
-
ROUTINE_NAME CONSTANT VARCHAR2(30) := 'generateResult';
|
24
|
-
--
|
25
|
-
vDisplayAs APEXLIB_V_PAGE_ITEM.DISPLAY_AS %TYPE;
|
26
|
-
vLovQuery APEXLIB_V_PAGE_ITEM.LOV_QUERY %TYPE;
|
27
|
-
vDisplayNullValue APEXLIB_V_PAGE_ITEM.LOV_DISPLAY_NULL%TYPE;
|
28
|
-
vLovNullText APEXLIB_V_PAGE_ITEM.LOV_NULL_TEXT %TYPE;
|
29
|
-
vLovNullValue APEXLIB_V_PAGE_ITEM.LOV_NULL_VALUE %TYPE;
|
30
|
-
vApplicationId APEXLIB_V_PAGE_ITEM.APPLICATION_ID %TYPE;
|
31
|
-
vPageId APEXLIB_V_PAGE_ITEM.PAGE_ID %TYPE;
|
32
|
-
BEGIN
|
33
|
-
----------------------------------------------------------------------------
|
34
|
-
-- Determine which routine to call and pass parameters
|
35
|
-
----------------------------------------------------------------------------
|
36
|
-
CASE pRoutineType
|
37
|
-
WHEN 'LOV'
|
38
|
-
THEN
|
39
|
-
ApexLib_Lov.generateLovResult( pReferenceType, pReferenceId );
|
40
|
-
--
|
41
|
-
WHEN 'COMPUTATION'
|
42
|
-
THEN
|
43
|
-
ApexLib_Computation.generateComputationResult( pReferenceType, pReferenceId );
|
44
|
-
--
|
45
|
-
ELSE
|
46
|
-
Apexlib_Error.raiseImplError('Unsupported routine type "'||pRoutineType||'"!');
|
47
|
-
END CASE;
|
48
|
-
--
|
49
|
-
EXCEPTION WHEN OTHERS THEN
|
50
|
-
HTP.prn('Error: '||SQLERRM);
|
51
|
-
-- RAISE; no raise, because APEX doesn't care anyway.
|
52
|
-
END generateResult;
|
53
|
-
</textarea>
|
54
|
-
</div>
|
55
|
-
|
56
|
-
<script type="text/javascript">
|
57
|
-
var editor = CodeMirror.fromTextArea('code', {
|
58
|
-
height: "450px",
|
59
|
-
parserfile: "../contrib/plsql/js/parseplsql.js",
|
60
|
-
stylesheet: "css/plsqlcolors.css",
|
61
|
-
path: "../../js/",
|
62
|
-
textWrapping: false
|
63
|
-
});
|
64
|
-
</script>
|
65
|
-
|
66
|
-
</body>
|
67
|
-
</html>
|
data/lib/generators/liquid_cms/templates/public/cms/codemirror/contrib/plsql/js/parseplsql.js
DELETED
@@ -1,233 +0,0 @@
|
|
1
|
-
var PlsqlParser = Editor.Parser = (function() {
|
2
|
-
|
3
|
-
function wordRegexp(words) {
|
4
|
-
return new RegExp("^(?:" + words.join("|") + ")$", "i");
|
5
|
-
}
|
6
|
-
|
7
|
-
var functions = wordRegexp([
|
8
|
-
"abs","acos","add_months","ascii","asin","atan","atan2","average",
|
9
|
-
"bfilename",
|
10
|
-
"ceil","chartorowid","chr","concat","convert","cos","cosh","count",
|
11
|
-
"decode","deref","dual","dump","dup_val_on_index",
|
12
|
-
"empty","error","exp",
|
13
|
-
"false","floor","found",
|
14
|
-
"glb","greatest",
|
15
|
-
"hextoraw",
|
16
|
-
"initcap","instr","instrb","isopen",
|
17
|
-
"last_day","least","lenght","lenghtb","ln","lower","lpad","ltrim","lub",
|
18
|
-
"make_ref","max","min","mod","months_between",
|
19
|
-
"new_time","next_day","nextval","nls_charset_decl_len","nls_charset_id","nls_charset_name","nls_initcap","nls_lower",
|
20
|
-
"nls_sort","nls_upper","nlssort","no_data_found","notfound","null","nvl",
|
21
|
-
"others",
|
22
|
-
"power",
|
23
|
-
"rawtohex","reftohex","round","rowcount","rowidtochar","rpad","rtrim",
|
24
|
-
"sign","sin","sinh","soundex","sqlcode","sqlerrm","sqrt","stddev","substr","substrb","sum","sysdate",
|
25
|
-
"tan","tanh","to_char","to_date","to_label","to_multi_byte","to_number","to_single_byte","translate","true","trunc",
|
26
|
-
"uid","upper","user","userenv",
|
27
|
-
"variance","vsize"
|
28
|
-
|
29
|
-
]);
|
30
|
-
|
31
|
-
var keywords = wordRegexp([
|
32
|
-
"abort","accept","access","add","all","alter","and","any","array","arraylen","as","asc","assert","assign","at","attributes","audit",
|
33
|
-
"authorization","avg",
|
34
|
-
"base_table","begin","between","binary_integer","body","boolean","by",
|
35
|
-
"case","cast","char","char_base","check","close","cluster","clusters","colauth","column","comment","commit","compress","connect",
|
36
|
-
"connected","constant","constraint","crash","create","current","currval","cursor",
|
37
|
-
"data_base","database","date","dba","deallocate","debugoff","debugon","decimal","declare","default","definition","delay","delete",
|
38
|
-
"desc","digits","dispose","distinct","do","drop",
|
39
|
-
"else","elsif","enable","end","entry","escape","exception","exception_init","exchange","exclusive","exists","exit","external",
|
40
|
-
"fast","fetch","file","for","force","form","from","function",
|
41
|
-
"generic","goto","grant","group",
|
42
|
-
"having",
|
43
|
-
"identified","if","immediate","in","increment","index","indexes","indicator","initial","initrans","insert","interface","intersect",
|
44
|
-
"into","is",
|
45
|
-
"key",
|
46
|
-
"level","library","like","limited","local","lock","log","logging","long","loop",
|
47
|
-
"master","maxextents","maxtrans","member","minextents","minus","mislabel","mode","modify","multiset",
|
48
|
-
"new","next","no","noaudit","nocompress","nologging","noparallel","not","nowait","number_base",
|
49
|
-
"object","of","off","offline","on","online","only","open","option","or","order","out",
|
50
|
-
"package","parallel","partition","pctfree","pctincrease","pctused","pls_integer","positive","positiven","pragma","primary","prior",
|
51
|
-
"private","privileges","procedure","public",
|
52
|
-
"raise","range","raw","read","rebuild","record","ref","references","refresh","release","rename","replace","resource","restrict","return",
|
53
|
-
"returning","reverse","revoke","rollback","row","rowid","rowlabel","rownum","rows","run",
|
54
|
-
"savepoint","schema","segment","select","separate","session","set","share","snapshot","some","space","split","sql","start","statement",
|
55
|
-
"storage","subtype","successful","synonym",
|
56
|
-
"tabauth","table","tables","tablespace","task","terminate","then","to","trigger","truncate","type",
|
57
|
-
"union","unique","unlimited","unrecoverable","unusable","update","use","using",
|
58
|
-
"validate","value","values","variable","view","views",
|
59
|
-
"when","whenever","where","while","with","work"
|
60
|
-
]);
|
61
|
-
|
62
|
-
var types = wordRegexp([
|
63
|
-
"bfile","blob",
|
64
|
-
"character","clob",
|
65
|
-
"dec",
|
66
|
-
"float",
|
67
|
-
"int","integer",
|
68
|
-
"mlslabel",
|
69
|
-
"natural","naturaln","nchar","nclob","number","numeric","nvarchar2",
|
70
|
-
"real","rowtype",
|
71
|
-
"signtype","smallint","string",
|
72
|
-
"varchar","varchar2"
|
73
|
-
]);
|
74
|
-
|
75
|
-
var operators = wordRegexp([
|
76
|
-
":=", "<", "<=", "==", "!=", "<>", ">", ">=", "like", "rlike", "in", "xor", "between"
|
77
|
-
]);
|
78
|
-
|
79
|
-
var operatorChars = /[*+\-<>=&|:\/]/;
|
80
|
-
|
81
|
-
var tokenizeSql = (function() {
|
82
|
-
function normal(source, setState) {
|
83
|
-
var ch = source.next();
|
84
|
-
if (ch == "@" || ch == "$") {
|
85
|
-
source.nextWhileMatches(/[\w\d]/);
|
86
|
-
return "plsql-var";
|
87
|
-
}
|
88
|
-
else if (ch == "\"" || ch == "'" || ch == "`") {
|
89
|
-
setState(inLiteral(ch));
|
90
|
-
return null;
|
91
|
-
}
|
92
|
-
else if (ch == "," || ch == ";") {
|
93
|
-
return "plsql-separator"
|
94
|
-
}
|
95
|
-
else if (ch == '-') {
|
96
|
-
if (source.peek() == "-") {
|
97
|
-
while (!source.endOfLine()) source.next();
|
98
|
-
return "plsql-comment";
|
99
|
-
}
|
100
|
-
else if (/\d/.test(source.peek())) {
|
101
|
-
source.nextWhileMatches(/\d/);
|
102
|
-
if (source.peek() == '.') {
|
103
|
-
source.next();
|
104
|
-
source.nextWhileMatches(/\d/);
|
105
|
-
}
|
106
|
-
return "plsql-number";
|
107
|
-
}
|
108
|
-
else
|
109
|
-
return "plsql-operator";
|
110
|
-
}
|
111
|
-
else if (operatorChars.test(ch)) {
|
112
|
-
source.nextWhileMatches(operatorChars);
|
113
|
-
return "plsql-operator";
|
114
|
-
}
|
115
|
-
else if (/\d/.test(ch)) {
|
116
|
-
source.nextWhileMatches(/\d/);
|
117
|
-
if (source.peek() == '.') {
|
118
|
-
source.next();
|
119
|
-
source.nextWhileMatches(/\d/);
|
120
|
-
}
|
121
|
-
return "plsql-number";
|
122
|
-
}
|
123
|
-
else if (/[()]/.test(ch)) {
|
124
|
-
return "plsql-punctuation";
|
125
|
-
}
|
126
|
-
else {
|
127
|
-
source.nextWhileMatches(/[_\w\d]/);
|
128
|
-
var word = source.get(), type;
|
129
|
-
if (operators.test(word))
|
130
|
-
type = "plsql-operator";
|
131
|
-
else if (keywords.test(word))
|
132
|
-
type = "plsql-keyword";
|
133
|
-
else if (functions.test(word))
|
134
|
-
type = "plsql-function";
|
135
|
-
else if (types.test(word))
|
136
|
-
type = "plsql-type";
|
137
|
-
else
|
138
|
-
type = "plsql-word";
|
139
|
-
return {style: type, content: word};
|
140
|
-
}
|
141
|
-
}
|
142
|
-
|
143
|
-
function inLiteral(quote) {
|
144
|
-
return function(source, setState) {
|
145
|
-
var escaped = false;
|
146
|
-
while (!source.endOfLine()) {
|
147
|
-
var ch = source.next();
|
148
|
-
if (ch == quote && !escaped) {
|
149
|
-
setState(normal);
|
150
|
-
break;
|
151
|
-
}
|
152
|
-
escaped = !escaped && ch == "\\";
|
153
|
-
}
|
154
|
-
return quote == "`" ? "plsql-word" : "plsql-literal";
|
155
|
-
};
|
156
|
-
}
|
157
|
-
|
158
|
-
return function(source, startState) {
|
159
|
-
return tokenizer(source, startState || normal);
|
160
|
-
};
|
161
|
-
})();
|
162
|
-
|
163
|
-
function indentSql(context) {
|
164
|
-
return function(nextChars) {
|
165
|
-
var firstChar = nextChars && nextChars.charAt(0);
|
166
|
-
var closing = context && firstChar == context.type;
|
167
|
-
if (!context)
|
168
|
-
return 0;
|
169
|
-
else if (context.align)
|
170
|
-
return context.col - (closing ? context.width : 0);
|
171
|
-
else
|
172
|
-
return context.indent + (closing ? 0 : indentUnit);
|
173
|
-
}
|
174
|
-
}
|
175
|
-
|
176
|
-
function parseSql(source) {
|
177
|
-
var tokens = tokenizeSql(source);
|
178
|
-
var context = null, indent = 0, col = 0;
|
179
|
-
function pushContext(type, width, align) {
|
180
|
-
context = {prev: context, indent: indent, col: col, type: type, width: width, align: align};
|
181
|
-
}
|
182
|
-
function popContext() {
|
183
|
-
context = context.prev;
|
184
|
-
}
|
185
|
-
|
186
|
-
var iter = {
|
187
|
-
next: function() {
|
188
|
-
var token = tokens.next();
|
189
|
-
var type = token.style, content = token.content, width = token.value.length;
|
190
|
-
|
191
|
-
if (content == "\n") {
|
192
|
-
token.indentation = indentSql(context);
|
193
|
-
indent = col = 0;
|
194
|
-
if (context && context.align == null) context.align = false;
|
195
|
-
}
|
196
|
-
else if (type == "whitespace" && col == 0) {
|
197
|
-
indent = width;
|
198
|
-
}
|
199
|
-
else if (!context && type != "plsql-comment") {
|
200
|
-
pushContext(";", 0, false);
|
201
|
-
}
|
202
|
-
|
203
|
-
if (content != "\n") col += width;
|
204
|
-
|
205
|
-
if (type == "plsql-punctuation") {
|
206
|
-
if (content == "(")
|
207
|
-
pushContext(")", width);
|
208
|
-
else if (content == ")")
|
209
|
-
popContext();
|
210
|
-
}
|
211
|
-
else if (type == "plsql-separator" && content == ";" && context && !context.prev) {
|
212
|
-
popContext();
|
213
|
-
}
|
214
|
-
|
215
|
-
return token;
|
216
|
-
},
|
217
|
-
|
218
|
-
copy: function() {
|
219
|
-
var _context = context, _indent = indent, _col = col, _tokenState = tokens.state;
|
220
|
-
return function(source) {
|
221
|
-
tokens = tokenizeSql(source, _tokenState);
|
222
|
-
context = _context;
|
223
|
-
indent = _indent;
|
224
|
-
col = _col;
|
225
|
-
return iter;
|
226
|
-
};
|
227
|
-
}
|
228
|
-
};
|
229
|
-
return iter;
|
230
|
-
}
|
231
|
-
|
232
|
-
return {make: parseSql, electricChars: ")"};
|
233
|
-
})();
|
@@ -1,32 +0,0 @@
|
|
1
|
-
Copyright (c) 2009, Timothy Farrell
|
2
|
-
All rights reserved.
|
3
|
-
|
4
|
-
This software is provided for use in connection with the
|
5
|
-
CodeMirror suite of modules and utilities, hosted and maintained
|
6
|
-
at http://marijn.haverbeke.nl/codemirror/.
|
7
|
-
|
8
|
-
Redistribution and use of this software in source and binary forms,
|
9
|
-
with or without modification, are permitted provided that the
|
10
|
-
following conditions are met:
|
11
|
-
|
12
|
-
* Redistributions of source code must retain the above
|
13
|
-
copyright notice, this list of conditions and the
|
14
|
-
following disclaimer.
|
15
|
-
|
16
|
-
* Redistributions in binary form must reproduce the above
|
17
|
-
copyright notice, this list of conditions and the
|
18
|
-
following disclaimer in the documentation and/or other
|
19
|
-
materials provided with the distribution.
|
20
|
-
|
21
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
22
|
-
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
23
|
-
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
24
|
-
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
25
|
-
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
26
|
-
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
27
|
-
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
28
|
-
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
29
|
-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
30
|
-
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
31
|
-
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
32
|
-
POSSIBILITY OF SUCH DAMAGE.
|
data/lib/generators/liquid_cms/templates/public/cms/codemirror/contrib/python/css/pythoncolors.css
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
html {
|
2
|
-
cursor: text;
|
3
|
-
}
|
4
|
-
|
5
|
-
.editbox {
|
6
|
-
padding: .4em;
|
7
|
-
margin: 0;
|
8
|
-
font-family: monospace;
|
9
|
-
font-size: 10pt;
|
10
|
-
line-height: 1.1em;
|
11
|
-
color: black;
|
12
|
-
}
|
13
|
-
|
14
|
-
pre.code, .editbox {
|
15
|
-
color: #666666;
|
16
|
-
}
|
17
|
-
|
18
|
-
.editbox p {
|
19
|
-
margin: 0;
|
20
|
-
}
|
21
|
-
|
22
|
-
span.py-delimiter, span.py-special {
|
23
|
-
color: #666666;
|
24
|
-
}
|
25
|
-
|
26
|
-
span.py-operator {
|
27
|
-
color: #666666;
|
28
|
-
}
|
29
|
-
|
30
|
-
span.py-error {
|
31
|
-
background-color: #660000;
|
32
|
-
color: #FFFFFF;
|
33
|
-
}
|
34
|
-
|
35
|
-
span.py-keyword {
|
36
|
-
color: #770088;
|
37
|
-
font-weight: bold;
|
38
|
-
}
|
39
|
-
|
40
|
-
span.py-literal {
|
41
|
-
color: #228811;
|
42
|
-
}
|
43
|
-
|
44
|
-
span.py-identifier, span.py-func {
|
45
|
-
color: black;
|
46
|
-
}
|
47
|
-
|
48
|
-
span.py-type, span.py-decorator {
|
49
|
-
color: #0000FF;
|
50
|
-
}
|
51
|
-
|
52
|
-
span.py-comment {
|
53
|
-
color: #AA7700;
|
54
|
-
}
|
55
|
-
|
56
|
-
span.py-string, span.py-bytes, span.py-raw, span.py-unicode {
|
57
|
-
color: #AA2222;
|
58
|
-
}
|
@@ -1,141 +0,0 @@
|
|
1
|
-
<html xmlns="http://www.w3.org/1999/xhtml">
|
2
|
-
<head>
|
3
|
-
<script src="../../js/codemirror.js" type="text/javascript"></script>
|
4
|
-
<title>CodeMirror: Python demonstration</title>
|
5
|
-
<style type="text/css">
|
6
|
-
.CodeMirror-line-numbers {
|
7
|
-
width: 2.2em;
|
8
|
-
color: #aaa;
|
9
|
-
background-color: #eee;
|
10
|
-
text-align: right;
|
11
|
-
padding: .4em;
|
12
|
-
margin: 0;
|
13
|
-
font-family: monospace;
|
14
|
-
font-size: 10pt;
|
15
|
-
line-height: 1.1em;
|
16
|
-
}
|
17
|
-
</style>
|
18
|
-
</head>
|
19
|
-
<body style="padding: 20px;">
|
20
|
-
<p>
|
21
|
-
This is a simple demonstration of the Python syntax highlighting module
|
22
|
-
for <a href="index.html">CodeMirror</a>.
|
23
|
-
</p>
|
24
|
-
<p>
|
25
|
-
Features of this parser include:
|
26
|
-
</p>
|
27
|
-
<ul>
|
28
|
-
<li>Token-based syntax highlighting - currently very little lexical analysis happens. Few lexical errors will be detected.</li>
|
29
|
-
<li>Use the normal indentation mode to enforce regular indentation, otherwise the "shift" indentation mode will give you more flexibility.</li>
|
30
|
-
<li>Parser Options:
|
31
|
-
<ul>
|
32
|
-
<li>pythonVersion (Integer) - 2 or 3 to indicate which version of Python to parse. Default = 2</li>
|
33
|
-
<li>strictErrors (Bool) - true to highlight errors that may not be Python errors but cause confusion for this parser. Default = true</li>
|
34
|
-
</ul>
|
35
|
-
</li>
|
36
|
-
</ul>
|
37
|
-
<p>Written by Timothy Farrell (<a href="LICENSE">license</a>). Special
|
38
|
-
thanks to Adam Brand and Marijn Haverbeke for their help in debugging
|
39
|
-
and providing for this parser.</p>
|
40
|
-
|
41
|
-
<div style="border: 1px solid black; padding: 0px;">
|
42
|
-
<textarea id="code" cols="100" rows="20" style="width:100%">
|
43
|
-
# Literals
|
44
|
-
1234
|
45
|
-
0.0e101
|
46
|
-
.123
|
47
|
-
0b01010011100
|
48
|
-
0o01234567
|
49
|
-
0x0987654321abcdef
|
50
|
-
# Error Literals
|
51
|
-
.0b000
|
52
|
-
0.0e
|
53
|
-
0e
|
54
|
-
|
55
|
-
# String Literals
|
56
|
-
'For\''
|
57
|
-
"God\""
|
58
|
-
"""so loved
|
59
|
-
the world"""
|
60
|
-
'''that he gave
|
61
|
-
his only begotten\' '''
|
62
|
-
'that whosoever believeth \
|
63
|
-
in him'
|
64
|
-
''
|
65
|
-
|
66
|
-
# Identifiers
|
67
|
-
__a__
|
68
|
-
a.b
|
69
|
-
a.b.c
|
70
|
-
# Error Identifiers
|
71
|
-
a.
|
72
|
-
|
73
|
-
# Operators
|
74
|
-
+ - * / % & | ^ ~ < >
|
75
|
-
== != <= >= <> << >> // **
|
76
|
-
and or not in is
|
77
|
-
|
78
|
-
# Delimiters
|
79
|
-
() [] {} , : ` = ; @ . # At-signs and periods require context
|
80
|
-
+= -= *= /= %= &= |= ^=
|
81
|
-
//= >>= <<= **=
|
82
|
-
|
83
|
-
# Keywords
|
84
|
-
as assert break class continue def del elif else except
|
85
|
-
finally for from global if import lambda pass raise
|
86
|
-
return try while with yield
|
87
|
-
|
88
|
-
# Python 2 Keywords (otherwise Identifiers)
|
89
|
-
exec print
|
90
|
-
|
91
|
-
# Python 3 Keywords (otherwise Identifiers)
|
92
|
-
nonlocal
|
93
|
-
|
94
|
-
# Types
|
95
|
-
bool classmethod complex dict enumerate float frozenset int list object
|
96
|
-
property reversed set slice staticmethod str super tuple type
|
97
|
-
|
98
|
-
# Python 2 Types (otherwise Identifiers)
|
99
|
-
basestring buffer file long unicode xrange
|
100
|
-
|
101
|
-
# Python 3 Types (otherwise Identifiers)
|
102
|
-
bytearray bytes filter map memoryview open range zip
|
103
|
-
|
104
|
-
# Example Strict Errors
|
105
|
-
def doesNothing():
|
106
|
-
pass # indentUnit is set to 4 but this line is indented 3
|
107
|
-
|
108
|
-
# Some Example code
|
109
|
-
import os
|
110
|
-
from package import ParentClass
|
111
|
-
|
112
|
-
@nonsenseDecorator
|
113
|
-
def doesNothing():
|
114
|
-
pass
|
115
|
-
|
116
|
-
class ExampleClass(ParentClass):
|
117
|
-
@staticmethod
|
118
|
-
def example(inputStr):
|
119
|
-
a = list(inputStr)
|
120
|
-
a.reverse()
|
121
|
-
return ''.join(a)
|
122
|
-
|
123
|
-
def __init__(self, mixin = 'Hello'):
|
124
|
-
self.mixin = mixin
|
125
|
-
|
126
|
-
</textarea>
|
127
|
-
</div>
|
128
|
-
|
129
|
-
<script type="text/javascript">
|
130
|
-
var editor = CodeMirror.fromTextArea('code', {
|
131
|
-
parserfile: ["../contrib/python/js/parsepython.js"],
|
132
|
-
stylesheet: "css/pythoncolors.css",
|
133
|
-
path: "../../js/",
|
134
|
-
lineNumbers: true,
|
135
|
-
textWrapping: false,
|
136
|
-
indentUnit: 4,
|
137
|
-
parserConfig: {'pythonVersion': 2, 'strictErrors': true}
|
138
|
-
});
|
139
|
-
</script>
|
140
|
-
</body>
|
141
|
-
</html>
|