imagine_cms 4.1.4 → 4.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +2 -1
- data/app/assets/images/interface/form_loading.gif +0 -0
- data/app/assets/images/management/btn-top-delete.png +0 -0
- data/app/assets/images/management/btn-top-edit.png +0 -0
- data/app/assets/images/management/btn-top-exterminate.png +0 -0
- data/app/assets/images/management/btn-top-new.png +0 -0
- data/app/assets/images/management/btn-top-preview.png +0 -0
- data/app/assets/images/management/btn-top-properties.png +0 -0
- data/app/assets/javascripts/codemirror/modes-custom/imagine_cms.js +87 -0
- data/app/assets/javascripts/imagine_cms/core.js +510 -0
- data/app/assets/javascripts/imagine_cms/legacy/misc.js +537 -0
- data/app/assets/javascripts/imagine_cms/legacy/rollovers.js +193 -0
- data/app/assets/javascripts/imagine_cms/legacy/slideshow.js +116 -0
- data/app/assets/javascripts/imagine_cms/legacy/textfieldhints.js +55 -0
- data/app/assets/javascripts/imagine_cms.js +14 -1
- data/app/assets/javascripts/imagine_cms_compat.js +26 -0
- data/app/assets/javascripts/jquery-ui.js +16608 -0
- data/app/assets/javascripts/tag-it.js +591 -0
- data/app/assets/stylesheets/imagine_cms.css.scss +26 -10
- data/app/assets/stylesheets/imagine_controls.css.scss +8 -0
- data/app/assets/stylesheets/jquery-ui.css +1225 -0
- data/app/assets/stylesheets/jquery-ui.structure.css +833 -0
- data/app/assets/stylesheets/jquery-ui.theme.css +410 -0
- data/app/assets/stylesheets/jquery.tagit.css +69 -0
- data/app/assets/stylesheets/management.css.scss +7 -0
- data/app/assets/stylesheets/tagit.ui-imagine.css +100 -0
- data/app/controllers/cms/content_controller.rb +28 -45
- data/app/controllers/management/cms_controller.rb +116 -94
- data/app/helpers/cms_application_helper.rb +76 -39
- data/app/models/cms_page.rb +32 -14
- data/app/models/cms_page_object.rb +1 -1
- data/app/models/cms_page_tag.rb +2 -2
- data/app/models/cms_template.rb +1 -1
- data/app/models/user.rb +6 -6
- data/app/models/user_group.rb +1 -1
- data/app/views/cms/content/_photo_gallery.html.erb +12 -12
- data/app/views/cms/content/_search.html.erb +2 -2
- data/app/views/cms/content/_search_result.html.erb +16 -10
- data/app/views/layouts/management.html.erb +18 -17
- data/app/views/management/cms/_edit_page.html.erb +47 -33
- data/app/views/management/cms/_gallery_index.html.erb +4 -4
- data/app/views/management/cms/_image.html.erb +3 -3
- data/app/views/management/cms/_image_details.html.erb +9 -8
- data/app/views/management/cms/_list_page.html.erb +2 -2
- data/app/views/management/cms/_list_page_select.html.erb +1 -1
- data/app/views/management/cms/_page_list.html.erb +69 -48
- data/app/views/management/cms/_page_list_source_folder.html.erb +2 -2
- data/app/views/management/cms/_template_options.html.erb +4 -4
- data/app/views/management/cms/_template_reference.html.erb +13 -15
- data/app/views/management/cms/edit_page_content.html.erb +3 -3
- data/app/views/management/cms/edit_snippet.html.erb +19 -41
- data/app/views/management/cms/edit_template.html.erb +15 -38
- data/app/views/management/cms/pages.html.erb +17 -29
- data/app/views/management/cms/snippets.html.erb +2 -2
- data/app/views/management/cms/templates.html.erb +2 -2
- data/app/views/management/cms/toolbar_edit.html.erb +2 -0
- data/app/views/management/cms/toolbar_preview.html.erb +2 -2
- data/config/initializers/config_file.rb +1 -1
- data/imagine_cms.gemspec +7 -4
- data/lib/extensions/action_controller_extensions.rb +50 -19
- data/lib/imagine_cms/engine.rb +12 -8
- data/lib/imagine_cms/version.rb +1 -1
- data/lib/prototype_legacy_helper/lib/prototype_legacy_helper.rb +2 -2
- data/lib/tasks/imagine_cms_tasks.rake +8 -0
- metadata +69 -91
- data/app/assets/images/management/btn_archive.gif +0 -0
- data/app/assets/images/management/btn_delete.gif +0 -0
- data/app/assets/images/management/btn_duplicate.gif +0 -0
- data/app/assets/images/management/btn_edit.gif +0 -0
- data/app/assets/images/management/btn_new_page.gif +0 -0
- data/app/assets/images/management/btn_preview.gif +0 -0
- data/app/assets/images/management/btn_properties.gif +0 -0
- data/app/assets/images/management/btn_restore.gif +0 -0
- data/app/assets/images/management/btn_top_delete.gif +0 -0
- data/app/assets/images/management/btn_top_duplicate.gif +0 -0
- data/app/assets/images/management/btn_top_edit.gif +0 -0
- data/app/assets/images/management/btn_top_new.gif +0 -0
- data/app/assets/images/management/btn_top_preview.gif +0 -0
- data/app/assets/images/management/btn_top_properties.gif +0 -0
- data/app/assets/javascripts/codepress/codepress.html +0 -36
- data/app/assets/javascripts/codepress/codepress.js +0 -130
- data/app/assets/javascripts/codepress/engines/gecko.js +0 -240
- data/app/assets/javascripts/codepress/engines/khtml.js +0 -0
- data/app/assets/javascripts/codepress/engines/msie.js +0 -263
- data/app/assets/javascripts/codepress/engines/older.js +0 -0
- data/app/assets/javascripts/codepress/engines/opera.js +0 -259
- data/app/assets/javascripts/codepress/languages/css.js +0 -23
- data/app/assets/javascripts/codepress/languages/generic.js +0 -25
- data/app/assets/javascripts/codepress/languages/html.js +0 -63
- data/app/assets/javascripts/codepress/languages/java.js +0 -24
- data/app/assets/javascripts/codepress/languages/javascript.js +0 -30
- data/app/assets/javascripts/codepress/languages/perl.js +0 -27
- data/app/assets/javascripts/codepress/languages/php.js +0 -60
- data/app/assets/javascripts/codepress/languages/ruby.js +0 -26
- data/app/assets/javascripts/codepress/languages/sql.js +0 -30
- data/app/assets/javascripts/codepress/languages/text.js +0 -9
- data/app/assets/javascripts/imagine.js +0 -1393
- data/app/assets/stylesheets/codepress/codepress.css +0 -7
- data/app/assets/stylesheets/codepress/languages/css.css +0 -10
- data/app/assets/stylesheets/codepress/languages/generic.css +0 -9
- data/app/assets/stylesheets/codepress/languages/html.css +0 -18
- data/app/assets/stylesheets/codepress/languages/java.css +0 -7
- data/app/assets/stylesheets/codepress/languages/javascript.css +0 -8
- data/app/assets/stylesheets/codepress/languages/perl.css +0 -11
- data/app/assets/stylesheets/codepress/languages/php.css +0 -12
- data/app/assets/stylesheets/codepress/languages/ruby.css +0 -10
- data/app/assets/stylesheets/codepress/languages/sql.css +0 -10
- data/app/assets/stylesheets/codepress/languages/text.css +0 -5
@@ -1,259 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* CodePress - Real Time Syntax Highlighting Editor written in JavaScript - http://codepress.org/
|
3
|
-
*
|
4
|
-
* Copyright (C) 2007 Fernando M.A.d.S. <fermads@gmail.com>
|
5
|
-
*
|
6
|
-
* Contributors :
|
7
|
-
*
|
8
|
-
* Michael Hurni <michael.hurni@gmail.com>
|
9
|
-
*
|
10
|
-
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
11
|
-
* GNU Lesser General Public License as published by the Free Software Foundation.
|
12
|
-
*
|
13
|
-
* Read the full licence: http://www.opensource.org/licenses/lgpl-license.php
|
14
|
-
*/
|
15
|
-
|
16
|
-
|
17
|
-
CodePress = {
|
18
|
-
scrolling : false,
|
19
|
-
autocomplete : true,
|
20
|
-
|
21
|
-
// set initial vars and start sh
|
22
|
-
initialize : function() {
|
23
|
-
if(typeof(editor)=='undefined' && !arguments[0]) return;
|
24
|
-
chars = '|32|46|62|'; // charcodes that trigger syntax highlighting
|
25
|
-
cc = '\u2009'; // control char
|
26
|
-
editor = document.getElementsByTagName('body')[0];
|
27
|
-
document.designMode = 'on';
|
28
|
-
document.addEventListener('keyup', this.keyHandler, true);
|
29
|
-
window.addEventListener('scroll', function() { if(!CodePress.scrolling) CodePress.syntaxHighlight('scroll') }, false);
|
30
|
-
completeChars = this.getCompleteChars();
|
31
|
-
// CodePress.syntaxHighlight('init');
|
32
|
-
},
|
33
|
-
|
34
|
-
// treat key bindings
|
35
|
-
keyHandler : function(evt) {
|
36
|
-
keyCode = evt.keyCode;
|
37
|
-
charCode = evt.charCode;
|
38
|
-
|
39
|
-
if((evt.ctrlKey || evt.metaKey) && evt.shiftKey && charCode!=90) { // shortcuts = ctrl||appleKey+shift+key!=z(undo)
|
40
|
-
CodePress.shortcuts(charCode?charCode:keyCode);
|
41
|
-
}
|
42
|
-
else if(completeChars.indexOf('|'+String.fromCharCode(charCode)+'|')!=-1 && CodePress.autocomplete) { // auto complete
|
43
|
-
CodePress.complete(String.fromCharCode(charCode));
|
44
|
-
}
|
45
|
-
else if(chars.indexOf('|'+charCode+'|')!=-1||keyCode==13) { // syntax highlighting
|
46
|
-
CodePress.syntaxHighlight('generic');
|
47
|
-
}
|
48
|
-
else if(keyCode==9 || evt.tabKey) { // snippets activation (tab)
|
49
|
-
CodePress.snippets(evt);
|
50
|
-
}
|
51
|
-
else if(keyCode==46||keyCode==8) { // save to history when delete or backspace pressed
|
52
|
-
CodePress.actions.history[CodePress.actions.next()] = editor.innerHTML;
|
53
|
-
}
|
54
|
-
else if((charCode==122||charCode==121||charCode==90) && evt.ctrlKey) { // undo and redo
|
55
|
-
(charCode==121||evt.shiftKey) ? CodePress.actions.redo() : CodePress.actions.undo();
|
56
|
-
evt.preventDefault();
|
57
|
-
}
|
58
|
-
else if(keyCode==86 && evt.ctrlKey) { // paste
|
59
|
-
// TODO: pasted text should be parsed and highlighted
|
60
|
-
}
|
61
|
-
},
|
62
|
-
|
63
|
-
// put cursor back to its original position after every parsing
|
64
|
-
findString : function() {
|
65
|
-
var sel = window.getSelection();
|
66
|
-
var range = window.document.createRange();
|
67
|
-
var span = window.document.getElementsByTagName('span')[0];
|
68
|
-
|
69
|
-
range.selectNode(span);
|
70
|
-
sel.removeAllRanges();
|
71
|
-
sel.addRange(range);
|
72
|
-
span.parentNode.removeChild(span);
|
73
|
-
//if(self.find(cc))
|
74
|
-
//window.getSelection().getRangeAt(0).deleteContents();
|
75
|
-
},
|
76
|
-
|
77
|
-
// split big files, highlighting parts of it
|
78
|
-
split : function(code,flag) {
|
79
|
-
if(flag=='scroll') {
|
80
|
-
this.scrolling = true;
|
81
|
-
return code;
|
82
|
-
}
|
83
|
-
else {
|
84
|
-
this.scrolling = false;
|
85
|
-
mid = code.indexOf('<SPAN>');
|
86
|
-
if(mid-2000<0) {ini=0;end=4000;}
|
87
|
-
else if(mid+2000>code.length) {ini=code.length-4000;end=code.length;}
|
88
|
-
else {ini=mid-2000;end=mid+2000;}
|
89
|
-
code = code.substring(ini,end);
|
90
|
-
return code;
|
91
|
-
}
|
92
|
-
},
|
93
|
-
|
94
|
-
// syntax highlighting parser
|
95
|
-
syntaxHighlight : function(flag) {
|
96
|
-
//if(document.designMode=='off') document.designMode='on'
|
97
|
-
if(flag!='init') {
|
98
|
-
var span = document.createElement('span');
|
99
|
-
window.getSelection().getRangeAt(0).insertNode(span);
|
100
|
-
}
|
101
|
-
|
102
|
-
o = editor.innerHTML;
|
103
|
-
// o = o.replace(/<br>/g,'\r\n');
|
104
|
-
// o = o.replace(/<(b|i|s|u|a|em|tt|ins|big|cite|strong)?>/g,'');
|
105
|
-
//alert(o)
|
106
|
-
o = o.replace(/<(?!span|\/span|br).*?>/gi,'');
|
107
|
-
// alert(o)
|
108
|
-
// x = o;
|
109
|
-
x = z = this.split(o,flag);
|
110
|
-
//alert(z)
|
111
|
-
// x = x.replace(/\r\n/g,'<br>');
|
112
|
-
x = x.replace(/\t/g, ' ');
|
113
|
-
|
114
|
-
|
115
|
-
if(arguments[1]&&arguments[2]) x = x.replace(arguments[1],arguments[2]);
|
116
|
-
|
117
|
-
for(i=0;i<Language.syntax.length;i++)
|
118
|
-
x = x.replace(Language.syntax[i].input,Language.syntax[i].output);
|
119
|
-
|
120
|
-
editor.innerHTML = this.actions.history[this.actions.next()] = (flag=='scroll') ? x : o.split(z).join(x);
|
121
|
-
|
122
|
-
if(flag!='init') this.findString();
|
123
|
-
},
|
124
|
-
|
125
|
-
getLastWord : function() {
|
126
|
-
var rangeAndCaret = CodePress.getRangeAndCaret();
|
127
|
-
var words = rangeAndCaret[0].substring(rangeAndCaret[1]-40,rangeAndCaret[1]).split(/[\s\r\n\);]/);
|
128
|
-
return words[words.length-1].replace(/_/g,'');
|
129
|
-
},
|
130
|
-
|
131
|
-
snippets : function(evt) {
|
132
|
-
var snippets = Language.snippets;
|
133
|
-
var trigger = this.getLastWord();
|
134
|
-
for (var i=0; i<snippets.length; i++) {
|
135
|
-
if(snippets[i].input == trigger) {
|
136
|
-
var content = snippets[i].output.replace(/</g,'<');
|
137
|
-
content = content.replace(/>/g,'>');
|
138
|
-
if(content.indexOf('$0')<0) content += cc;
|
139
|
-
else content = content.replace(/\$0/,cc);
|
140
|
-
content = content.replace(/\n/g,'<br>');
|
141
|
-
var pattern = new RegExp(trigger+cc,'g');
|
142
|
-
evt.preventDefault(); // prevent the tab key from being added
|
143
|
-
this.syntaxHighlight('snippets',pattern,content);
|
144
|
-
}
|
145
|
-
}
|
146
|
-
},
|
147
|
-
|
148
|
-
readOnly : function() {
|
149
|
-
document.designMode = (arguments[0]) ? 'off' : 'on';
|
150
|
-
},
|
151
|
-
|
152
|
-
complete : function(trigger) {
|
153
|
-
window.getSelection().getRangeAt(0).deleteContents();
|
154
|
-
var complete = Language.complete;
|
155
|
-
for (var i=0; i<complete.length; i++) {
|
156
|
-
if(complete[i].input == trigger) {
|
157
|
-
var pattern = new RegExp('\\'+trigger+cc);
|
158
|
-
var content = complete[i].output.replace(/\$0/g,cc);
|
159
|
-
parent.setTimeout(function () { CodePress.syntaxHighlight('complete',pattern,content)},0); // wait for char to appear on screen
|
160
|
-
}
|
161
|
-
}
|
162
|
-
},
|
163
|
-
|
164
|
-
getCompleteChars : function() {
|
165
|
-
var cChars = '';
|
166
|
-
for(var i=0;i<Language.complete.length;i++)
|
167
|
-
cChars += '|'+Language.complete[i].input;
|
168
|
-
return cChars+'|';
|
169
|
-
},
|
170
|
-
|
171
|
-
shortcuts : function() {
|
172
|
-
var cCode = arguments[0];
|
173
|
-
if(cCode==13) cCode = '[enter]';
|
174
|
-
else if(cCode==32) cCode = '[space]';
|
175
|
-
else cCode = '['+String.fromCharCode(charCode).toLowerCase()+']';
|
176
|
-
for(var i=0;i<Language.shortcuts.length;i++)
|
177
|
-
if(Language.shortcuts[i].input == cCode)
|
178
|
-
this.insertCode(Language.shortcuts[i].output,false);
|
179
|
-
},
|
180
|
-
|
181
|
-
getRangeAndCaret : function() {
|
182
|
-
var range = window.getSelection().getRangeAt(0);
|
183
|
-
var range2 = range.cloneRange();
|
184
|
-
var node = range.endContainer;
|
185
|
-
var caret = range.endOffset;
|
186
|
-
range2.selectNode(node);
|
187
|
-
return [range2.toString(),caret];
|
188
|
-
},
|
189
|
-
|
190
|
-
insertCode : function(code,replaceCursorBefore) {
|
191
|
-
var range = window.getSelection().getRangeAt(0);
|
192
|
-
var node = window.document.createTextNode(code);
|
193
|
-
var selct = window.getSelection();
|
194
|
-
var range2 = range.cloneRange();
|
195
|
-
// Insert text at cursor position
|
196
|
-
selct.removeAllRanges();
|
197
|
-
range.deleteContents();
|
198
|
-
range.insertNode(node);
|
199
|
-
// Move the cursor to the end of text
|
200
|
-
range2.selectNode(node);
|
201
|
-
range2.collapse(replaceCursorBefore);
|
202
|
-
selct.removeAllRanges();
|
203
|
-
selct.addRange(range2);
|
204
|
-
},
|
205
|
-
|
206
|
-
// get code from editor
|
207
|
-
getCode : function() {
|
208
|
-
var code = editor.innerHTML;
|
209
|
-
code = code.replace(/<br>/g,'\n');
|
210
|
-
code = code.replace(/\u2009/g,'');
|
211
|
-
code = code.replace(/<.*?>/g,'');
|
212
|
-
code = code.replace(/</g,'<');
|
213
|
-
code = code.replace(/>/g,'>');
|
214
|
-
code = code.replace(/&/gi,'&');
|
215
|
-
return code;
|
216
|
-
},
|
217
|
-
|
218
|
-
// put code inside editor
|
219
|
-
setCode : function() {
|
220
|
-
var code = arguments[0];
|
221
|
-
code = code.replace(/\u2009/gi,'');
|
222
|
-
code = code.replace(/&/gi,'&');
|
223
|
-
code = code.replace(/</g,'<');
|
224
|
-
code = code.replace(/>/g,'>');
|
225
|
-
editor.innerHTML = code;
|
226
|
-
},
|
227
|
-
|
228
|
-
// undo and redo methods
|
229
|
-
actions : {
|
230
|
-
pos : -1, // actual history position
|
231
|
-
history : [], // history vector
|
232
|
-
|
233
|
-
undo : function() {
|
234
|
-
if(editor.innerHTML.indexOf(cc)==-1){
|
235
|
-
window.getSelection().getRangeAt(0).insertNode(document.createTextNode(cc));
|
236
|
-
this.history[this.pos] = editor.innerHTML;
|
237
|
-
}
|
238
|
-
this.pos--;
|
239
|
-
if(typeof(this.history[this.pos])=='undefined') this.pos++;
|
240
|
-
editor.innerHTML = this.history[this.pos];
|
241
|
-
CodePress.findString();
|
242
|
-
},
|
243
|
-
|
244
|
-
redo : function() {
|
245
|
-
this.pos++;
|
246
|
-
if(typeof(this.history[this.pos])=='undefined') this.pos--;
|
247
|
-
editor.innerHTML = this.history[this.pos];
|
248
|
-
CodePress.findString();
|
249
|
-
},
|
250
|
-
|
251
|
-
next : function() { // get next vector position and clean old ones
|
252
|
-
if(this.pos>20) this.history[this.pos-21] = undefined;
|
253
|
-
return ++this.pos;
|
254
|
-
}
|
255
|
-
}
|
256
|
-
}
|
257
|
-
|
258
|
-
Language={};
|
259
|
-
window.addEventListener('load', function() { CodePress.initialize('new'); }, true);
|
@@ -1,23 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* CodePress regular expressions for CSS syntax highlighting
|
3
|
-
*/
|
4
|
-
|
5
|
-
// CSS
|
6
|
-
Language.syntax = [
|
7
|
-
{ input : /(.*?){(.*?)}/g,output : '<b>$1</b>{<u>$2</u>}' }, // tags, ids, classes, values
|
8
|
-
{ input : /([\w-]*?):([^\/])/g,output : '<a>$1</a>:$2' }, // keys
|
9
|
-
{ input : /\((.*?)\)/g,output : '(<s>$1</s>)' }, // parameters
|
10
|
-
{ input : /\/\*(.*?)\*\//g,output : '<i>/*$1*/</i>'} // comments
|
11
|
-
]
|
12
|
-
|
13
|
-
Language.snippets = []
|
14
|
-
|
15
|
-
Language.complete = [
|
16
|
-
{ input : '\'',output : '\'$0\'' },
|
17
|
-
{ input : '"', output : '"$0"' },
|
18
|
-
{ input : '(', output : '\($0\)' },
|
19
|
-
{ input : '[', output : '\[$0\]' },
|
20
|
-
{ input : '{', output : '{\n\t$0\n}' }
|
21
|
-
]
|
22
|
-
|
23
|
-
Language.shortcuts = []
|
@@ -1,25 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* CodePress regular expressions for generic syntax highlighting
|
3
|
-
*/
|
4
|
-
|
5
|
-
// generic languages
|
6
|
-
Language.syntax = [
|
7
|
-
{ input : /\"(.*?)(\"|<br>|<\/P>)/g, output : '<s>"$1$2</s>' }, // strings double quote
|
8
|
-
{ input : /\'(.*?)(\'|<br>|<\/P>)/g, output : '<s>\'$1$2</s>' }, // strings single quote
|
9
|
-
{ input : /\b(abstract|continue|for|new|switch|default|goto|boolean|do|if|private|this|break|double|protected|throw|byte|else|import|public|throws|case|return|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|const|float|while|function|label)\b/g, output : '<b>$1</b>' }, // reserved words
|
10
|
-
{ input : /([\(\){}])/g, output : '<em>$1</em>' }, // special chars;
|
11
|
-
{ input : /([^:]|^)\/\/(.*?)(<br|<\/P)/g, output : '$1<i>//$2</i>$3' }, // comments //
|
12
|
-
{ input : /\/\*(.*?)\*\//g, output : '<i>/*$1*/</i>' } // comments /* */
|
13
|
-
]
|
14
|
-
|
15
|
-
Language.snippets = []
|
16
|
-
|
17
|
-
Language.complete = [
|
18
|
-
{ input : '\'', output : '\'$0\'' },
|
19
|
-
{ input : '"', output : '"$0"' },
|
20
|
-
{ input : '(', output : '\($0\)' },
|
21
|
-
{ input : '[', output : '\[$0\]' },
|
22
|
-
{ input : '{', output : '{\n\t$0\n}' }
|
23
|
-
]
|
24
|
-
|
25
|
-
Language.shortcuts = []
|
@@ -1,63 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* CodePress regular expressions for HTML syntax highlighting
|
3
|
-
*/
|
4
|
-
|
5
|
-
// HTML
|
6
|
-
Language.syntax = [
|
7
|
-
{ input : /(<[^!]*?>)/g, output : '<b>$1</b>' }, // all tags
|
8
|
-
{ input : /(<a .*?>|<\/a>)/g, output : '<a>$1</a>' }, // links
|
9
|
-
{ input : /(<img .*?>)/g, output : '<big>$1</big>' }, // images
|
10
|
-
{ input : /(<\/?(button|textarea|form|input|select|option|label).*?>)/g, output : '<u>$1</u>' }, // forms
|
11
|
-
{ input : /(<style.*?>)(.*?)(<\/style>)/g, output : '<em>$1</em><em>$2</em><em>$3</em>' }, // style tags
|
12
|
-
{ input : /(<script.*?>)(.*?)(<\/script>)/g, output : '<strong>$1</strong><tt>$2</tt><strong>$3</strong>' }, // script tags
|
13
|
-
{ input : /=(".*?")/g, output : '=<s>$1</s>' }, // atributes double quote
|
14
|
-
{ input : /=('.*?')/g, output : '=<s>$1</s>' }, // atributes single quote
|
15
|
-
{ input : /(<!--.*?-->.)/g, output : '<ins>$1</ins>' }, // comments
|
16
|
-
{ input : /(<%.*?%>.)/g, output : '<ins><tt>$1</tt></ins>' }, // erb
|
17
|
-
{ input : /(\#.*?<br>)/g, output : '<ins><i>$1</i></ins>' }, // erb comment
|
18
|
-
{ input : /(\@[\w]+)/g, output : '<ins><b>$1</b></ins>' }, // ruby instance var
|
19
|
-
{ input : /(\:[A-Za-z_][\w]*)/g, output : '<ins><u>$1</u></ins>' }, // ruby symbol
|
20
|
-
{ input : /\b(alert|window|document|break|continue|do|for|new|this|void|case|default|else|function|return|typeof|while|if|label|switch|var|with|catch|boolean|int|try|false|throws|null|true|goto)\b/g, output : '<i>$1</i>' } // script reserved words
|
21
|
-
]
|
22
|
-
|
23
|
-
Language.snippets = [
|
24
|
-
{ input : 'aref', output : '<a href="$0"></a>' },
|
25
|
-
{ input : 'h1', output : '<h1>$0</h1>' },
|
26
|
-
{ input : 'h2', output : '<h2>$0</h2>' },
|
27
|
-
{ input : 'h3', output : '<h3>$0</h3>' },
|
28
|
-
{ input : 'h4', output : '<h4>$0</h4>' },
|
29
|
-
{ input : 'h5', output : '<h5>$0</h5>' },
|
30
|
-
{ input : 'h6', output : '<h6>$0</h6>' },
|
31
|
-
{ input : 'html', output : '<html>\n\t$0\n</html>' },
|
32
|
-
{ input : 'head', output : '<head>\n\t<meta http-equiv="content-type" content="text/html; charset=utf-8" />\n\t<title>$0</title>\n\t\n</head>' },
|
33
|
-
{ input : 'img', output : '<img src="$0" alt="" />' },
|
34
|
-
{ input : 'input', output : '<input name="$0" id="" type="" value="" />' },
|
35
|
-
{ input : 'label', output : '<label for="$0"></label>' },
|
36
|
-
{ input : 'legend', output : '<legend>\n\t$0\n</legend>' },
|
37
|
-
{ input : 'link', output : '<link rel="stylesheet" href="$0" type="text/css" media="screen" charset="utf-8" />' },
|
38
|
-
{ input : 'base', output : '<base href="$0" />' },
|
39
|
-
{ input : 'body', output : '<body>\n\t$0\n</body>' },
|
40
|
-
{ input : 'css', output : '<link rel="stylesheet" href="$0" type="text/css" media="screen" charset="utf-8" />' },
|
41
|
-
{ input : 'div', output : '<div>\n\t$0\n</div>' },
|
42
|
-
{ input : 'divid', output : '<div id="$0">\n\t\n</div>' },
|
43
|
-
{ input : 'dl', output : '<dl>\n\t<dt>\n\t\t$0\n\t</dt>\n\t<dd></dd>\n</dl>' },
|
44
|
-
{ input : 'fieldset', output : '<fieldset>\n\t$0\n</fieldset>' },
|
45
|
-
{ input : 'form', output : '<form action="$0" method="" name="">\n\t\n</form>' },
|
46
|
-
{ input : 'meta', output : '<meta name="$0" content="" />' },
|
47
|
-
{ input : 'p', output : '<p>$0</p>' },
|
48
|
-
{ input : 'script', output : '<script type="text/javascript">\n\t$0\t\n</script>' },
|
49
|
-
{ input : 'scriptsrc', output : '<script src="$0" type="text/javascript"></script>' },
|
50
|
-
{ input : 'span', output : '<span>$0</span>' },
|
51
|
-
{ input : 'table', output : '<table border="$0" cellspacing="" cellpadding="">\n\t<tr><th></th></tr>\n\t<tr><td></td></tr>\n</table>' },
|
52
|
-
{ input : 'style', output : '<style type="text/css" media="screen">\n\t$0\n</style>' }
|
53
|
-
]
|
54
|
-
|
55
|
-
Language.complete = [
|
56
|
-
{ input : '\'',output : '\'$0\'' },
|
57
|
-
{ input : '"', output : '"$0"' },
|
58
|
-
{ input : '(', output : '\($0\)' },
|
59
|
-
{ input : '[', output : '\[$0\]' },
|
60
|
-
{ input : '{', output : '{\n\t$0\n}' }
|
61
|
-
]
|
62
|
-
|
63
|
-
Language.shortcuts = []
|
@@ -1,24 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* CodePress regular expressions for Java syntax highlighting
|
3
|
-
*/
|
4
|
-
|
5
|
-
// Java
|
6
|
-
Language.syntax = [
|
7
|
-
{ input : /\"(.*?)(\"|<br>|<\/P>)/g, output : '<s>"$1$2</s>'}, // strings double quote
|
8
|
-
{ input : /\'(.*?)(\'|<br>|<\/P>)/g, output : '<s>\'$1$2</s>'}, // strings single quote
|
9
|
-
{ input : /\b(abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/g, output : '<b>$1</b>'}, // reserved words
|
10
|
-
{ input : /([^:]|^)\/\/(.*?)(<br|<\/P)/g, output : '$1<i>//$2</i>$3'}, // comments //
|
11
|
-
{ input : /\/\*(.*?)\*\//g, output : '<i>/*$1*/</i>' }// comments /* */
|
12
|
-
]
|
13
|
-
|
14
|
-
Language.snippets = []
|
15
|
-
|
16
|
-
Language.complete = [
|
17
|
-
{ input : '\'',output : '\'$0\'' },
|
18
|
-
{ input : '"', output : '"$0"' },
|
19
|
-
{ input : '(', output : '\($0\)' },
|
20
|
-
{ input : '[', output : '\[$0\]' },
|
21
|
-
{ input : '{', output : '{\n\t$0\n}' }
|
22
|
-
]
|
23
|
-
|
24
|
-
Language.shortcuts = []
|
@@ -1,30 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* CodePress regular expressions for JavaScript syntax highlighting
|
3
|
-
*/
|
4
|
-
|
5
|
-
// JavaScript
|
6
|
-
Language.syntax = [
|
7
|
-
{ input : /\"(.*?)(\"|<br>|<\/P>)/g, output : '<s>"$1$2</s>' }, // strings double quote
|
8
|
-
{ input : /\'(.*?)(\'|<br>|<\/P>)/g, output : '<s>\'$1$2</s>' }, // strings single quote
|
9
|
-
{ input : /\b(break|continue|do|for|new|this|void|case|default|else|function|return|typeof|while|if|label|switch|var|with|catch|boolean|int|try|false|throws|null|true|goto)\b/g, output : '<b>$1</b>' }, // reserved words
|
10
|
-
{ input : /\b(alert|isNaN|parent|Array|parseFloat|parseInt|blur|clearTimeout|prompt|prototype|close|confirm|length|Date|location|Math|document|element|name|self|elements|setTimeout|navigator|status|String|escape|Number|submit|eval|Object|event|onblur|focus|onerror|onfocus|onclick|top|onload|toString|onunload|unescape|open|valueOf|window|onmouseover)\b/g, output : '<u>$1</u>' }, // special words
|
11
|
-
{ input : /([^:]|^)\/\/(.*?)(<br|<\/P)/g, output : '$1<i>//$2</i>$3' }, // comments //
|
12
|
-
{ input : /\/\*(.*?)\*\//g, output : '<i>/*$1*/</i>' } // comments /* */
|
13
|
-
]
|
14
|
-
|
15
|
-
Language.snippets = [
|
16
|
-
{ input : 'dw', output : 'document.write(\'$0\');' },
|
17
|
-
{ input : 'getid', output : 'document.getElementById(\'$0\')' },
|
18
|
-
{ input : 'fun', output : 'function $0(){\n\t\n}' },
|
19
|
-
{ input : 'func', output : 'function $0(){\n\t\n}' }
|
20
|
-
]
|
21
|
-
|
22
|
-
Language.complete = [
|
23
|
-
{ input : '\'',output : '\'$0\'' },
|
24
|
-
{ input : '"', output : '"$0"' },
|
25
|
-
{ input : '(', output : '\($0\)' },
|
26
|
-
{ input : '[', output : '\[$0\]' },
|
27
|
-
{ input : '{', output : '{\n\t$0\n}' }
|
28
|
-
]
|
29
|
-
|
30
|
-
Language.shortcuts = []
|
@@ -1,27 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* CodePress regular expressions for Perl syntax highlighting
|
3
|
-
* By J. Nick Koston
|
4
|
-
*/
|
5
|
-
|
6
|
-
// Perl
|
7
|
-
Language.syntax = [
|
8
|
-
{ input : /\"(.*?)(\"|<br>|<\/P>)/g, output : '<s>"$1$2</s>' }, // strings double quote
|
9
|
-
{ input : /\'(.*?)(\'|<br>|<\/P>)/g, output : '<s>\'$1$2</s>' }, // strings single quote
|
10
|
-
{ input : /([\$\@\%][\w\.]*)/g, output : '<a>$1</a>' }, // vars
|
11
|
-
{ input : /(sub\s+)([\w\.]*)/g, output : '$1<em>$2</em>' }, // functions
|
12
|
-
{ input : /\b(abs|accept|alarm|atan2|bind|binmode|bless|caller|chdir|chmod|chomp|chop|chown|chr|chroot|close|closedir|connect|continue|cos|crypt|dbmclose|dbmopen|defined|delete|die|do|dump|each|else|elsif|endgrent|endhostent|endnetent|endprotoent|endpwent|eof|eval|exec|exists|exit|fcntl|fileno|find|flock|for|foreach|fork|format|formlinegetc|getgrent|getgrgid|getgrnam|gethostbyaddr|gethostbyname|gethostent|getlogin|getnetbyaddr|getnetbyname|getnetent|getpeername|getpgrp|getppid|getpriority|getprotobyname|getprotobynumber|getprotoent|getpwent|getpwnam|getpwuid|getservbyaddr|getservbyname|getservbyport|getservent|getsockname|getsockopt|glob|gmtime|goto|grep|hex|hostname|if|import|index|int|ioctl|join|keys|kill|last|lc|lcfirst|length|link|listen|LoadExternals|local|localtime|log|lstat|map|mkdir|msgctl|msgget|msgrcv|msgsnd|my|next|no|oct|open|opendir|ordpack|package|pipe|pop|pos|print|printf|push|pwd|qq|quotemeta|qw|rand|read|readdir|readlink|recv|redo|ref|rename|require|reset|return|reverse|rewinddir|rindex|rmdir|scalar|seek|seekdir|select|semctl|semget|semop|send|setgrent|sethostent|setnetent|setpgrp|setpriority|setprotoent|setpwent|setservent|setsockopt|shift|shmctl|shmget|shmread|shmwrite|shutdown|sin|sleep|socket|socketpair|sort|splice|split|sprintf|sqrt|srand|stat|stty|study|sub|substr|symlink|syscall|sysopen|sysread|system|syswritetell|telldir|tie|tied|time|times|tr|truncate|uc|ucfirst|umask|undef|unless|unlink|until|unpack|unshift|untie|use|utime|values|vec|waitpid|wantarray|warn|while|write)\b/g, output : '<b>$1</b>' }, // reserved words
|
13
|
-
{ input : /([\(\){}])/g, output : '<u>$1</u>' }, // special chars
|
14
|
-
{ input : /#(.*?)(<br>|<\/P>)/g, output : '<i>#$1</i>$2' } // comments
|
15
|
-
]
|
16
|
-
|
17
|
-
Language.snippets = []
|
18
|
-
|
19
|
-
Language.complete = [
|
20
|
-
{ input : '\'',output : '\'$0\'' },
|
21
|
-
{ input : '"', output : '"$0"' },
|
22
|
-
{ input : '(', output : '\($0\)' },
|
23
|
-
{ input : '[', output : '\[$0\]' },
|
24
|
-
{ input : '{', output : '{\n\t$0\n}' }
|
25
|
-
]
|
26
|
-
|
27
|
-
Language.shortcuts = []
|
@@ -1,60 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* CodePress regular expressions for PHP syntax highlighting
|
3
|
-
*/
|
4
|
-
|
5
|
-
// PHP
|
6
|
-
Language.syntax = [
|
7
|
-
{ input : /(<[^!\?]*?>)/g, output : '<b>$1</b>' }, // all tags
|
8
|
-
{ input : /(<style.*?>)(.*?)(<\/style>)/g, output : '<em>$1</em><em>$2</em><em>$3</em>' }, // style tags
|
9
|
-
{ input : /(<script.*?>)(.*?)(<\/script>)/g, output : '<ins>$1</ins><ins>$2</ins><ins>$3</ins>' }, // script tags
|
10
|
-
{ input : /\"(.*?)(\"|<br>|<\/P>)/g, output : '<s>"$1$2</s>' }, // strings double quote
|
11
|
-
{ input : /\'(.*?)(\'|<br>|<\/P>)/g, output : '<s>\'$1$2</s>'}, // strings single quote
|
12
|
-
{ input : /(<\?)/g, output : '<strong>$1' }, // <?.*
|
13
|
-
{ input : /(\?>)/g, output : '$1</strong>' }, // .*?>
|
14
|
-
{ input : /(<\?php|<\?=|<\?|\?>)/g, output : '<cite>$1</cite>' }, // php tags
|
15
|
-
{ input : /(\$[\w\.]*)/g, output : '<a>$1</a>' }, // vars
|
16
|
-
{ input : /\b(false|true|and|or|xor|__FILE__|exception|__LINE__|array|as|break|case|class|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|for|foreach|function|global|if|include|include_once|isset|list|new|print|require|require_once|return|static|switch|unset|use|while|__FUNCTION__|__CLASS__|__METHOD__|final|php_user_filter|interface|implements|extends|public|private|protected|abstract|clone|try|catch|throw|this)\b/g, output : '<u>$1</u>' }, // reserved words
|
17
|
-
{ input : /([^:])\/\/(.*?)(<br|<\/P)/g, output : '$1<i>//$2</i>$3' }, // php comments //
|
18
|
-
{ input : /\/\*(.*?)\*\//g, output : '<i>/*$1*/</i>' }, // php comments /* */
|
19
|
-
{ input : /(<!--.*?-->.)/g, output : '<big>$1</big>' } // html comments
|
20
|
-
]
|
21
|
-
|
22
|
-
Language.snippets = [
|
23
|
-
{ input : 'if', output : 'if($0){\n\t\n}' },
|
24
|
-
{ input : 'ifelse', output : 'if($0){\n\t\n}\nelse{\n\t\n}' },
|
25
|
-
{ input : 'else', output : '}\nelse {\n\t' },
|
26
|
-
{ input : 'elseif', output : '}\nelseif($0) {\n\t' },
|
27
|
-
{ input : 'do', output : 'do{\n\t$0\n}\nwhile();' },
|
28
|
-
{ input : 'inc', output : 'include_once("$0");' },
|
29
|
-
{ input : 'fun', output : 'function $0(){\n\t\n}' },
|
30
|
-
{ input : 'func', output : 'function $0(){\n\t\n}' },
|
31
|
-
{ input : 'while', output : 'while($0){\n\t\n}' },
|
32
|
-
{ input : 'for', output : 'for($0,,){\n\t\n}' },
|
33
|
-
{ input : 'fore', output : 'foreach($0 as ){\n\t\n}' },
|
34
|
-
{ input : 'foreach', output : 'foreach($0 as ){\n\t\n}' },
|
35
|
-
{ input : 'echo', output : 'echo \'$0\';' },
|
36
|
-
{ input : 'switch', output : 'switch($0) {\n\tcase "": break;\n\tdefault: ;\n}' },
|
37
|
-
{ input : 'case', output : 'case "$0" : break;' },
|
38
|
-
{ input : 'ret0', output : 'return false;' },
|
39
|
-
{ input : 'retf', output : 'return false;' },
|
40
|
-
{ input : 'ret1', output : 'return true;' },
|
41
|
-
{ input : 'rett', output : 'return true;' },
|
42
|
-
{ input : 'ret', output : 'return $0;' },
|
43
|
-
{ input : 'def', output : 'define(\'$0\',\'\');' },
|
44
|
-
{ input : '<?', output : 'php\n$0\n?>' }
|
45
|
-
]
|
46
|
-
|
47
|
-
Language.complete = [
|
48
|
-
{ input : '\'', output : '\'$0\'' },
|
49
|
-
{ input : '"', output : '"$0"' },
|
50
|
-
{ input : '(', output : '\($0\)' },
|
51
|
-
{ input : '[', output : '\[$0\]' },
|
52
|
-
{ input : '{', output : '{\n\t$0\n}' }
|
53
|
-
]
|
54
|
-
|
55
|
-
Language.shortcuts = [
|
56
|
-
{ input : '[space]', output : ' ' },
|
57
|
-
{ input : '[enter]', output : '<br />' } ,
|
58
|
-
{ input : '[j]', output : 'testing' },
|
59
|
-
{ input : '[7]', output : '&' }
|
60
|
-
]
|
@@ -1,26 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* CodePress regular expressions for Perl syntax highlighting
|
3
|
-
*/
|
4
|
-
|
5
|
-
// Ruby
|
6
|
-
Language.syntax = [
|
7
|
-
{ input : /\"(.*?)(\"|<br>|<\/P>)/g, output : '<s>"$1$2</s>' }, // strings double quote
|
8
|
-
{ input : /\'(.*?)(\'|<br>|<\/P>)/g, output : '<s>\'$1$2</s>' }, // strings single quote
|
9
|
-
{ input : /([\$\@\%]+)([\w\.]*)/g, output : '<a>$1$2</a>' }, // vars
|
10
|
-
{ input : /(def\s+)([\w\.]*)/g, output : '$1<em>$2</em>' }, // functions
|
11
|
-
{ input : /\b(alias|and|BEGIN|begin|break|case|class|def|defined|do|else|elsif|END|end|ensure|false|for|if|in|module|next|nil|not|or|redo|rescue|retry|return|self|super|then|true|undef|unless|until|when|while|yield)\b/g, output : '<b>$1</b>' }, // reserved words
|
12
|
-
{ input : /([\(\){}])/g, output : '<u>$1</u>' }, // special chars
|
13
|
-
{ input : /#(.*?)(<br>|<\/P>)/g, output : '<i>#$1</i>$2' } // comments
|
14
|
-
];
|
15
|
-
|
16
|
-
Language.snippets = []
|
17
|
-
|
18
|
-
Language.complete = [
|
19
|
-
{ input : '\'',output : '\'$0\'' },
|
20
|
-
{ input : '"', output : '"$0"' },
|
21
|
-
{ input : '(', output : '\($0\)' },
|
22
|
-
{ input : '[', output : '\[$0\]' },
|
23
|
-
{ input : '{', output : '{\n\t$0\n}' }
|
24
|
-
]
|
25
|
-
|
26
|
-
Language.shortcuts = []
|
@@ -1,30 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* CodePress regular expressions for SQL syntax highlighting
|
3
|
-
* By Merlin Moncure
|
4
|
-
*/
|
5
|
-
|
6
|
-
// SQL
|
7
|
-
Language.syntax = [
|
8
|
-
{ input : /\'(.*?)(\')/g, output : '<s>\'$1$2</s>' }, // strings single quote
|
9
|
-
{ input : /\b(add|after|aggregate|alias|all|and|as|authorization|between|by|cascade|cache|cache|called|case|check|column|comment|constraint|createdb|createuser|cycle|database|default|deferrable|deferred|diagnostics|distinct|domain|each|else|elseif|elsif|encrypted|except|exception|for|foreign|from|from|full|function|get|group|having|if|immediate|immutable|in|increment|initially|increment|index|inherits|inner|input|intersect|into|invoker|is|join|key|language|left|limit|local|loop|match|maxvalue|minvalue|natural|nextval|no|nocreatedb|nocreateuser|not|null|of|offset|oids|on|only|operator|or|order|outer|owner|partial|password|perform|plpgsql|primary|record|references|replace|restrict|return|returns|right|row|rule|schema|security|sequence|session|sql|stable|statistics|table|temp|temporary|then|time|to|transaction|trigger|type|unencrypted|union|unique|user|using|valid|value|values|view|volatile|when|where|with|without|zone)\b/gi, output : '<b>$1</b>' }, // reserved words
|
10
|
-
{ input : /\b(bigint|bigserial|bit|boolean|box|bytea|char|character|cidr|circle|date|decimal|double|float4|float8|inet|int2|int4|int8|integer|interval|line|lseg|macaddr|money|numeric|oid|path|point|polygon|precision|real|refcursor|serial|serial4|serial8|smallint|text|timestamp|varbit|varchar)\b/gi, output : '<u>$1</u>' }, // types
|
11
|
-
{ input : /\b(abort|alter|analyze|begin|checkpoint|close|cluster|comment|commit|copy|create|deallocate|declare|delete|drop|end|execute|explain|fetch|grant|insert|listen|load|lock|move|notify|prepare|reindex|reset|restart|revoke|rollback|select|set|show|start|truncate|unlisten|update)\b/gi, output : '<a>$1</a>' }, // commands
|
12
|
-
{ input : /([^:]|^)\-\-(.*?)(<br|<\/P)/g, output: '$1<i>--$2</i>$3' } // comments //
|
13
|
-
]
|
14
|
-
|
15
|
-
Language.snippets = [
|
16
|
-
{ input : 'select', output : 'select $0 from where ' }
|
17
|
-
]
|
18
|
-
|
19
|
-
Language.complete = [
|
20
|
-
{ input : '\'', output : '\'$0\'' },
|
21
|
-
{ input : '"', output : '"$0"' },
|
22
|
-
{ input : '(', output : '\($0\)' },
|
23
|
-
{ input : '[', output : '\[$0\]' },
|
24
|
-
{ input : '{', output : '{\n\t$0\n}' }
|
25
|
-
]
|
26
|
-
|
27
|
-
Language.shortcuts = []
|
28
|
-
|
29
|
-
|
30
|
-
|