Merged in luisfernandosl/processmaker/HOR-1090-31 (pull request #4349)
HOR-1090
This commit is contained in:
21
gulliver/thirdparty/codepress/codepress.css
vendored
21
gulliver/thirdparty/codepress/codepress.css
vendored
@@ -1,21 +0,0 @@
|
||||
body {
|
||||
margin-top:13px;
|
||||
_margin-top:14px;
|
||||
background:white;
|
||||
margin-left:32px;
|
||||
font-family:monospace;
|
||||
font-size:13px;
|
||||
white-space:pre;
|
||||
background-image:url("images/line-numbers.png");
|
||||
background-repeat:repeat-y;
|
||||
background-position:0 3px;
|
||||
line-height:16px;
|
||||
height:100%;
|
||||
}
|
||||
pre {margin:0;}
|
||||
html>body{background-position:0 2px;}
|
||||
P {margin:0;padding:0;border:0;outline:0;display:block;white-space:pre;}
|
||||
b, i, s, u, a, em, tt, ins, big, cite, strong, var, dfn {text-decoration:none;font-weight:normal;font-style:normal;font-size:13px;}
|
||||
|
||||
body.hide-line-numbers {background:white;margin-left:16px;}
|
||||
body.show-line-numbers {background-image:url("images/line-numbers.png");margin-left:32px;}
|
||||
35
gulliver/thirdparty/codepress/codepress.html
vendored
35
gulliver/thirdparty/codepress/codepress.html
vendored
@@ -1,35 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>CodePress - Real Time Syntax Highlighting Editor written in JavaScript</title>
|
||||
<meta name="description" content="CodePress - source code editor window" />
|
||||
|
||||
<script type="text/javascript">
|
||||
var language = 'generic';
|
||||
var engine = 'older';
|
||||
var ua = navigator.userAgent;
|
||||
var ts = (new Date).getTime(); // timestamp to avoid cache
|
||||
var lh = location.href;
|
||||
|
||||
if(ua.match('MSIE')) engine = 'msie';
|
||||
else if(ua.match('KHTML')) engine = 'khtml';
|
||||
else if(ua.match('Opera')) engine = 'opera';
|
||||
else if(ua.match('Gecko')) engine = 'gecko';
|
||||
|
||||
if(lh.match('language=')) language = lh.replace(/.*language=(.*?)(&.*)?$/,'$1');
|
||||
|
||||
document.write('<link type="text/css" href="codepress.css?ts='+ts+'" rel="stylesheet" />');
|
||||
document.write('<link type="text/css" href="languages/'+language+'.css?ts='+ts+'" rel="stylesheet" id="cp-lang-style" />');
|
||||
document.write('<scr'+'ipt type="text/javascript" src="engines/'+engine+'.js?ts='+ts+'"></scr'+'ipt>');
|
||||
document.write('<scr'+'ipt type="text/javascript" src="languages/'+language+'.js?ts='+ts+'"></scr'+'ipt>');
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<script type="text/javascript">
|
||||
if(engine == "msie" || engine == "gecko") document.write('<body><pre> </pre></body>');
|
||||
else if(engine == "opera") document.write('<body></body>');
|
||||
// else if(engine == "khtml") document.write('<body> </body>');
|
||||
</script>
|
||||
|
||||
</html>
|
||||
153
gulliver/thirdparty/codepress/codepress.js
vendored
153
gulliver/thirdparty/codepress/codepress.js
vendored
@@ -1,153 +0,0 @@
|
||||
/*
|
||||
* CodePress - Real Time Syntax Highlighting Editor written in JavaScript - http://codepress.org/
|
||||
*
|
||||
* Copyright (C) 2006 Fernando M.A.d.S. <fermads@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||
* GNU Lesser General Public License as published by the Free Software Foundation.
|
||||
*
|
||||
* Read the full licence: http://www.opensource.org/licenses/lgpl-license.php
|
||||
*/
|
||||
if (typeof(CodePress)==="undefined")
|
||||
{
|
||||
CodePress = function(obj,language) {
|
||||
var self = $dce('iframe');
|
||||
self.textarea = obj;
|
||||
self.textarea.disabled = true;
|
||||
self.textarea.style.overflow = 'hidden';
|
||||
self.style.height = self.textarea.clientHeight +'px';
|
||||
self.style.width = self.textarea.clientWidth +'px';
|
||||
self.textarea.style.overflow = 'auto';
|
||||
self.style.border = '1px solid gray';
|
||||
self.frameBorder = 0; // remove IE internal iframe border
|
||||
self.style.visibility = 'hidden';
|
||||
self.style.position = 'absolute';
|
||||
self.options = self.textarea.className;
|
||||
self.language=language;
|
||||
|
||||
self.initialize = function() {
|
||||
self.editor = self.contentWindow.CodePress;
|
||||
self.editor.body = self.contentWindow.document.getElementsByTagName('body')[0];
|
||||
self.editor.setCode(self.textarea.value);
|
||||
self.setOptions();
|
||||
self.editor.syntaxHighlight('init');
|
||||
self.textarea.style.display = 'none';
|
||||
self.style.position = 'static';
|
||||
self.style.visibility = 'visible';
|
||||
self.style.display = 'inline';
|
||||
}
|
||||
|
||||
// obj can by a textarea id or a string (code)
|
||||
self.edit = function(obj,language) {
|
||||
//if(obj) self.textarea.value = $(obj) ? $(obj).value : obj;
|
||||
if(obj) self.textarea.value = document.getElementById(obj) ? document.getElementById(obj).value : obj;
|
||||
if(!self.textarea.disabled) return;
|
||||
self.language = language ? language : self.getLanguage();
|
||||
|
||||
self.src = CodePress.path+'codepress.html?language='+self.language+'&ts='+(new Date).getTime();
|
||||
if(self.attachEvent) self.attachEvent('onload',self.initialize);
|
||||
else self.addEventListener('load',self.initialize,false);
|
||||
}
|
||||
|
||||
self.getLanguage = function() {
|
||||
for (language in CodePress.languages)
|
||||
if(self.options.match('\\b'+language+'\\b'))
|
||||
return CodePress.languages[language] ? language : 'generic';
|
||||
}
|
||||
|
||||
self.setOptions = function() {
|
||||
if(self.options.match('autocomplete-off')) self.toggleAutoComplete();
|
||||
if(self.options.match('readonly-on')) self.toggleReadOnly();
|
||||
if(self.options.match('linenumbers-off')) self.toggleLineNumbers();
|
||||
}
|
||||
|
||||
self.getCode = function() {
|
||||
return self.textarea.disabled ? self.editor.getCode() : self.textarea.value;
|
||||
}
|
||||
|
||||
/* Modified by David Callizaya
|
||||
* Refresh the highlighting after set the code.
|
||||
**/
|
||||
self.setCode = function(code) {
|
||||
self.textarea.disabled ? self.editor.setCode(code) : self.textarea.value = code;
|
||||
self.editor.innerHTML = '<pre>'+code+'</pre>';
|
||||
self.editor.syntaxHighlight('init');
|
||||
}
|
||||
|
||||
self.toggleAutoComplete = function() {
|
||||
self.editor.autocomplete = (self.editor.autocomplete) ? false : true;
|
||||
}
|
||||
|
||||
self.toggleReadOnly = function() {
|
||||
self.textarea.readOnly = (self.textarea.readOnly) ? false : true;
|
||||
if(self.style.display != 'none') // prevent exception on FF + iframe with display:none
|
||||
self.editor.readOnly(self.textarea.readOnly ? true : false);
|
||||
}
|
||||
|
||||
self.toggleLineNumbers = function() {
|
||||
var cn = self.editor.body.className;
|
||||
self.editor.body.className = (cn==''||cn=='show-line-numbers') ? 'hide-line-numbers' : 'show-line-numbers';
|
||||
}
|
||||
|
||||
self.toggleEditor = function() {
|
||||
if(self.textarea.disabled) {
|
||||
self.textarea.value = self.getCode();
|
||||
self.textarea.disabled = false;
|
||||
self.style.display = 'none';
|
||||
self.textarea.style.display = 'inline';
|
||||
}
|
||||
else {
|
||||
self.textarea.disabled = true;
|
||||
self.setCode(self.textarea.value);
|
||||
self.editor.syntaxHighlight('init');
|
||||
self.style.display = 'inline';
|
||||
self.textarea.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
self.edit();
|
||||
return self;
|
||||
}
|
||||
|
||||
CodePress.languages = {
|
||||
csharp : 'C#',
|
||||
css : 'CSS',
|
||||
generic : 'Generic',
|
||||
html : 'HTML',
|
||||
java : 'Java',
|
||||
javascript : 'JavaScript',
|
||||
perl : 'Perl',
|
||||
ruby : 'Ruby',
|
||||
php : 'PHP',
|
||||
text : 'Text',
|
||||
sql : 'SQL',
|
||||
vbscript : 'VBScript'
|
||||
}
|
||||
|
||||
|
||||
CodePress.run = function() {
|
||||
s = document.getElementsByTagName('script');
|
||||
CodePress.path="/codepress/"
|
||||
for(var i=0,n=s.length;i<n;i++) {
|
||||
if(s[i].src.match('codepress.js')) {
|
||||
CodePress.path = s[i].src.replace('codepress.js','');
|
||||
}
|
||||
}
|
||||
/*t = document.getElementsByTagName('textarea');
|
||||
for(var i=0,n=t.length;i<n;i++) {
|
||||
if(t[i].className.match('codepress')) {
|
||||
id = t[i].id;
|
||||
t[i].id = id+'_cp';
|
||||
eval(id+' = new CodePress(t[i])');
|
||||
t[i].parentNode.insertBefore(eval(id), t[i]);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
if(window.attachEvent) window.attachEvent('onload',CodePress.run);
|
||||
else window.addEventListener('DOMContentLoaded',CodePress.run,false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// alert("ImHn");
|
||||
}
|
||||
293
gulliver/thirdparty/codepress/engines/gecko.js
vendored
293
gulliver/thirdparty/codepress/engines/gecko.js
vendored
@@ -1,293 +0,0 @@
|
||||
/*
|
||||
* CodePress - Real Time Syntax Highlighting Editor written in JavaScript - http://codepress.org/
|
||||
*
|
||||
* Copyright (C) 2007 Fernando M.A.d.S. <fermads@gmail.com>
|
||||
*
|
||||
* Developers:
|
||||
* Fernando M.A.d.S. <fermads@gmail.com>
|
||||
* Michael Hurni <michael.hurni@gmail.com>
|
||||
* Contributors:
|
||||
* Martin D. Kirk
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||
* GNU Lesser General Public License as published by the Free Software Foundation.
|
||||
*
|
||||
* Read the full licence: http://www.opensource.org/licenses/lgpl-license.php
|
||||
*/
|
||||
|
||||
CodePress = {
|
||||
scrolling : false,
|
||||
autocomplete : true,
|
||||
|
||||
// set initial vars and start sh
|
||||
initialize : function() {
|
||||
if(typeof(editor)=='undefined' && !arguments[0]) return;
|
||||
body = document.getElementsByTagName('body')[0];
|
||||
body.innerHTML = body.innerHTML.replace(/\n/g,"");
|
||||
chars = '|32|46|62|8|'; // charcodes that trigger syntax highlighting
|
||||
cc = '\u2009'; // carret char
|
||||
editor = document.getElementsByTagName('pre')[0];
|
||||
document.designMode = 'on';
|
||||
document.addEventListener('keypress', this.keyHandler, true);
|
||||
window.addEventListener('scroll', function() { if(!CodePress.scrolling) CodePress.syntaxHighlight('scroll') }, false);
|
||||
completeChars = this.getCompleteChars();
|
||||
completeEndingChars = this.getCompleteEndingChars();
|
||||
},
|
||||
|
||||
// treat key bindings
|
||||
keyHandler : function(evt) {
|
||||
keyCode = evt.keyCode;
|
||||
charCode = evt.charCode;
|
||||
fromChar = String.fromCharCode(charCode);
|
||||
|
||||
if((evt.ctrlKey || evt.metaKey) && evt.shiftKey && charCode!=90) { // shortcuts = ctrl||appleKey+shift+key!=z(undo)
|
||||
CodePress.shortcuts(charCode?charCode:keyCode);
|
||||
}
|
||||
else if( (completeEndingChars.indexOf('|'+fromChar+'|')!= -1 || completeChars.indexOf('|'+fromChar+'|')!=-1) && CodePress.autocomplete) { // auto complete
|
||||
if(!CodePress.completeEnding(fromChar))
|
||||
CodePress.complete(fromChar);
|
||||
}
|
||||
else if(chars.indexOf('|'+charCode+'|')!=-1||keyCode==13) { // syntax highlighting
|
||||
top.setTimeout(function(){CodePress.syntaxHighlight('generic');},100);
|
||||
}
|
||||
else if(keyCode==9 || evt.tabKey) { // snippets activation (tab)
|
||||
CodePress.snippets(evt);
|
||||
}
|
||||
else if(keyCode==46||keyCode==8) { // save to history when delete or backspace pressed
|
||||
CodePress.actions.history[CodePress.actions.next()] = editor.innerHTML;
|
||||
}
|
||||
else if((charCode==122||charCode==121||charCode==90) && evt.ctrlKey) { // undo and redo
|
||||
(charCode==121||evt.shiftKey) ? CodePress.actions.redo() : CodePress.actions.undo();
|
||||
evt.preventDefault();
|
||||
}
|
||||
else if(charCode==118 && evt.ctrlKey) { // handle paste
|
||||
top.setTimeout(function(){CodePress.syntaxHighlight('generic');},100);
|
||||
}
|
||||
else if(charCode==99 && evt.ctrlKey) { // handle cut
|
||||
//alert(window.getSelection().getRangeAt(0).toString().replace(/\t/g,'FFF'));
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
// put cursor back to its original position after every parsing
|
||||
findString : function() {
|
||||
if(self.find(cc))
|
||||
window.getSelection().getRangeAt(0).deleteContents();
|
||||
},
|
||||
|
||||
// split big files, highlighting parts of it
|
||||
split : function(code,flag) {
|
||||
if(flag=='scroll') {
|
||||
this.scrolling = true;
|
||||
return code;
|
||||
}
|
||||
else {
|
||||
this.scrolling = false;
|
||||
mid = code.indexOf(cc);
|
||||
if(mid-2000<0) {ini=0;end=4000;}
|
||||
else if(mid+2000>code.length) {ini=code.length-4000;end=code.length;}
|
||||
else {ini=mid-2000;end=mid+2000;}
|
||||
code = code.substring(ini,end);
|
||||
return code;
|
||||
}
|
||||
},
|
||||
|
||||
getEditor : function() {
|
||||
if(!document.getElementsByTagName('pre')[0]) {
|
||||
body = document.getElementsByTagName('body')[0];
|
||||
if(!body.innerHTML) return body;
|
||||
if(body.innerHTML=="<br>") body.innerHTML = "<pre> </pre>";
|
||||
else body.innerHTML = "<pre>"+body.innerHTML+"</pre>";
|
||||
}
|
||||
return body;//document.getElementsByTagName('pre')[0];
|
||||
},
|
||||
|
||||
// syntax highlighting parser
|
||||
syntaxHighlight : function(flag) {
|
||||
//if(document.designMode=='off') document.designMode='on'
|
||||
if(flag != 'init') { window.getSelection().getRangeAt(0).insertNode(document.createTextNode(cc));}
|
||||
editor = CodePress.getEditor();
|
||||
o = editor.innerHTML;
|
||||
o = o.replace(/<br>/g,'\n');
|
||||
o = o.replace(/<.*?>/g,'');
|
||||
x = z = this.split(o,flag);
|
||||
x = x.replace(/\n/g,'<br>');
|
||||
|
||||
if(arguments[1]&&arguments[2]) x = x.replace(arguments[1],arguments[2]);
|
||||
|
||||
for(i=0;i<Language.syntax.length;i++)
|
||||
x = x.replace(Language.syntax[i].input,Language.syntax[i].output);
|
||||
|
||||
editor.innerHTML = this.actions.history[this.actions.next()] = (flag=='scroll') ? x : o.split(z).join(x);
|
||||
if(flag!='init') this.findString();
|
||||
},
|
||||
|
||||
getLastWord : function() {
|
||||
var rangeAndCaret = CodePress.getRangeAndCaret();
|
||||
words = rangeAndCaret[0].substring(rangeAndCaret[1]-40,rangeAndCaret[1]);
|
||||
words = words.replace(/[\s\n\r\);\W]/g,'\n').split('\n');
|
||||
return words[words.length-1].replace(/[\W]/gi,'').toLowerCase();
|
||||
},
|
||||
|
||||
snippets : function(evt) {
|
||||
var snippets = Language.snippets;
|
||||
var trigger = this.getLastWord();
|
||||
for (var i=0; i<snippets.length; i++) {
|
||||
if(snippets[i].input == trigger) {
|
||||
var content = snippets[i].output.replace(/</g,'<');
|
||||
content = content.replace(/>/g,'>');
|
||||
if(content.indexOf('$0')<0) content += cc;
|
||||
else content = content.replace(/\$0/,cc);
|
||||
content = content.replace(/\n/g,'<br>');
|
||||
var pattern = new RegExp(trigger+cc,'gi');
|
||||
evt.preventDefault(); // prevent the tab key from being added
|
||||
this.syntaxHighlight('snippets',pattern,content);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
readOnly : function() {
|
||||
document.designMode = (arguments[0]) ? 'off' : 'on';
|
||||
},
|
||||
|
||||
complete : function(trigger) {
|
||||
window.getSelection().getRangeAt(0).deleteContents();
|
||||
var complete = Language.complete;
|
||||
for (var i=0; i<complete.length; i++) {
|
||||
if(complete[i].input == trigger) {
|
||||
var pattern = new RegExp('\\'+trigger+cc);
|
||||
var content = complete[i].output.replace(/\$0/g,cc);
|
||||
parent.setTimeout(function () { CodePress.syntaxHighlight('complete',pattern,content)},0); // wait for char to appear on screen
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
getCompleteChars : function() {
|
||||
var cChars = '';
|
||||
for(var i=0;i<Language.complete.length;i++)
|
||||
cChars += '|'+Language.complete[i].input;
|
||||
return cChars+'|';
|
||||
},
|
||||
|
||||
getCompleteEndingChars : function() {
|
||||
var cChars = '';
|
||||
for(var i=0;i<Language.complete.length;i++)
|
||||
cChars += '|'+Language.complete[i].output.charAt(Language.complete[i].output.length-1);
|
||||
return cChars+'|';
|
||||
},
|
||||
|
||||
completeEnding : function(trigger) {
|
||||
var range = window.getSelection().getRangeAt(0);
|
||||
try {
|
||||
range.setEnd(range.endContainer, range.endOffset+1)
|
||||
}
|
||||
catch(e) {
|
||||
return false;
|
||||
}
|
||||
var next_character = range.toString()
|
||||
range.setEnd(range.endContainer, range.endOffset-1)
|
||||
if(next_character != trigger) return false;
|
||||
else {
|
||||
range.setEnd(range.endContainer, range.endOffset+1)
|
||||
range.deleteContents();
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
shortcuts : function() {
|
||||
var cCode = arguments[0];
|
||||
if(cCode==13) cCode = '[enter]';
|
||||
else if(cCode==32) cCode = '[space]';
|
||||
else cCode = '['+String.fromCharCode(charCode).toLowerCase()+']';
|
||||
for(var i=0;i<Language.shortcuts.length;i++)
|
||||
if(Language.shortcuts[i].input == cCode)
|
||||
this.insertCode(Language.shortcuts[i].output,false);
|
||||
},
|
||||
|
||||
getRangeAndCaret : function() {
|
||||
var range = window.getSelection().getRangeAt(0);
|
||||
var range2 = range.cloneRange();
|
||||
var node = range.endContainer;
|
||||
var caret = range.endOffset;
|
||||
range2.selectNode(node);
|
||||
return [range2.toString(),caret];
|
||||
},
|
||||
|
||||
insertCode : function(code,replaceCursorBefore) {
|
||||
var range = window.getSelection().getRangeAt(0);
|
||||
var node = window.document.createTextNode(code);
|
||||
var selct = window.getSelection();
|
||||
var range2 = range.cloneRange();
|
||||
// Insert text at cursor position
|
||||
selct.removeAllRanges();
|
||||
range.deleteContents();
|
||||
range.insertNode(node);
|
||||
// Move the cursor to the end of text
|
||||
range2.selectNode(node);
|
||||
range2.collapse(replaceCursorBefore);
|
||||
selct.removeAllRanges();
|
||||
selct.addRange(range2);
|
||||
},
|
||||
|
||||
// get code from editor
|
||||
getCode : function() {
|
||||
if(!document.getElementsByTagName('pre')[0] || editor.innerHTML == '')
|
||||
editor = CodePress.getEditor();
|
||||
var code = editor.innerHTML;
|
||||
code = code.replace(/<br>/g,'\n');
|
||||
code = code.replace(/\u2009/g,'');
|
||||
code = code.replace(/<.*?>/g,'');
|
||||
code = code.replace(/</g,'<');
|
||||
code = code.replace(/>/g,'>');
|
||||
code = code.replace(/&/gi,'&');
|
||||
return code;
|
||||
},
|
||||
|
||||
// put code inside editor
|
||||
setCode : function() {
|
||||
var code = arguments[0];
|
||||
code = code.replace(/\u2009/gi,'');
|
||||
code = code.replace(/&/gi,'&');
|
||||
code = code.replace(/</g,'<');
|
||||
code = code.replace(/>/g,'>');
|
||||
editor.innerHTML = code;
|
||||
if (code == '')
|
||||
document.getElementsByTagName('body')[0].innerHTML = '';
|
||||
},
|
||||
|
||||
// undo and redo methods
|
||||
actions : {
|
||||
pos : -1, // actual history position
|
||||
history : [], // history vector
|
||||
|
||||
undo : function() {
|
||||
editor = CodePress.getEditor();
|
||||
if(editor.innerHTML.indexOf(cc)==-1){
|
||||
if(editor.innerHTML != " ")
|
||||
window.getSelection().getRangeAt(0).insertNode(document.createTextNode(cc));
|
||||
this.history[this.pos] = editor.innerHTML;
|
||||
}
|
||||
this.pos --;
|
||||
if(typeof(this.history[this.pos])=='undefined') this.pos ++;
|
||||
editor.innerHTML = this.history[this.pos];
|
||||
if(editor.innerHTML.indexOf(cc)>-1) editor.innerHTML+=cc;
|
||||
CodePress.findString();
|
||||
},
|
||||
|
||||
redo : function() {
|
||||
// editor = CodePress.getEditor();
|
||||
this.pos++;
|
||||
if(typeof(this.history[this.pos])=='undefined') this.pos--;
|
||||
editor.innerHTML = this.history[this.pos];
|
||||
CodePress.findString();
|
||||
},
|
||||
|
||||
next : function() { // get next vector position and clean old ones
|
||||
if(this.pos>20) this.history[this.pos-21] = undefined;
|
||||
return ++this.pos;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Language={};
|
||||
window.addEventListener('load', function() { CodePress.initialize('new'); }, true);
|
||||
304
gulliver/thirdparty/codepress/engines/msie.js
vendored
304
gulliver/thirdparty/codepress/engines/msie.js
vendored
File diff suppressed because it is too large
Load Diff
260
gulliver/thirdparty/codepress/engines/opera.js
vendored
260
gulliver/thirdparty/codepress/engines/opera.js
vendored
@@ -1,260 +0,0 @@
|
||||
/*
|
||||
* CodePress - Real Time Syntax Highlighting Editor written in JavaScript - http://codepress.org/
|
||||
*
|
||||
* Copyright (C) 2007 Fernando M.A.d.S. <fermads@gmail.com>
|
||||
*
|
||||
* Contributors :
|
||||
*
|
||||
* Michael Hurni <michael.hurni@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under the terms of the
|
||||
* GNU Lesser General Public License as published by the Free Software Foundation.
|
||||
*
|
||||
* Read the full licence: http://www.opensource.org/licenses/lgpl-license.php
|
||||
*/
|
||||
|
||||
|
||||
CodePress = {
|
||||
scrolling : false,
|
||||
autocomplete : true,
|
||||
|
||||
// set initial vars and start sh
|
||||
initialize : function() {
|
||||
if(typeof(editor)=='undefined' && !arguments[0]) return;
|
||||
chars = '|32|46|62|'; // charcodes that trigger syntax highlighting
|
||||
cc = '\u2009'; // control char
|
||||
editor = document.getElementsByTagName('body')[0];
|
||||
document.designMode = 'on';
|
||||
document.addEventListener('keyup', this.keyHandler, true);
|
||||
window.addEventListener('scroll', function() { if(!CodePress.scrolling) CodePress.syntaxHighlight('scroll') }, false);
|
||||
completeChars = this.getCompleteChars();
|
||||
// CodePress.syntaxHighlight('init');
|
||||
},
|
||||
|
||||
// treat key bindings
|
||||
keyHandler : function(evt) {
|
||||
keyCode = evt.keyCode;
|
||||
charCode = evt.charCode;
|
||||
|
||||
if((evt.ctrlKey || evt.metaKey) && evt.shiftKey && charCode!=90) { // shortcuts = ctrl||appleKey+shift+key!=z(undo)
|
||||
CodePress.shortcuts(charCode?charCode:keyCode);
|
||||
}
|
||||
else if(completeChars.indexOf('|'+String.fromCharCode(charCode)+'|')!=-1 && CodePress.autocomplete) { // auto complete
|
||||
CodePress.complete(String.fromCharCode(charCode));
|
||||
}
|
||||
else if(chars.indexOf('|'+charCode+'|')!=-1||keyCode==13) { // syntax highlighting
|
||||
CodePress.syntaxHighlight('generic');
|
||||
}
|
||||
else if(keyCode==9 || evt.tabKey) { // snippets activation (tab)
|
||||
CodePress.snippets(evt);
|
||||
}
|
||||
else if(keyCode==46||keyCode==8) { // save to history when delete or backspace pressed
|
||||
CodePress.actions.history[CodePress.actions.next()] = editor.innerHTML;
|
||||
}
|
||||
else if((charCode==122||charCode==121||charCode==90) && evt.ctrlKey) { // undo and redo
|
||||
(charCode==121||evt.shiftKey) ? CodePress.actions.redo() : CodePress.actions.undo();
|
||||
evt.preventDefault();
|
||||
}
|
||||
else if(keyCode==86 && evt.ctrlKey) { // paste
|
||||
// TODO: pasted text should be parsed and highlighted
|
||||
}
|
||||
},
|
||||
|
||||
// put cursor back to its original position after every parsing
|
||||
findString : function() {
|
||||
var sel = window.getSelection();
|
||||
var range = window.document.createRange();
|
||||
var span = window.document.getElementsByTagName('span')[0];
|
||||
|
||||
range.selectNode(span);
|
||||
sel.removeAllRanges();
|
||||
sel.addRange(range);
|
||||
span.parentNode.removeChild(span);
|
||||
//if(self.find(cc))
|
||||
//window.getSelection().getRangeAt(0).deleteContents();
|
||||
},
|
||||
|
||||
// split big files, highlighting parts of it
|
||||
split : function(code,flag) {
|
||||
if(flag=='scroll') {
|
||||
this.scrolling = true;
|
||||
return code;
|
||||
}
|
||||
else {
|
||||
this.scrolling = false;
|
||||
mid = code.indexOf('<SPAN>');
|
||||
if(mid-2000<0) {ini=0;end=4000;}
|
||||
else if(mid+2000>code.length) {ini=code.length-4000;end=code.length;}
|
||||
else {ini=mid-2000;end=mid+2000;}
|
||||
code = code.substring(ini,end);
|
||||
return code;
|
||||
}
|
||||
},
|
||||
|
||||
// syntax highlighting parser
|
||||
syntaxHighlight : function(flag) {
|
||||
//if(document.designMode=='off') document.designMode='on'
|
||||
if(flag!='init') {
|
||||
var span = $dce('span');
|
||||
window.getSelection().getRangeAt(0).insertNode(span);
|
||||
}
|
||||
|
||||
o = editor.innerHTML;
|
||||
// o = o.replace(/<br>/g,'\r\n');
|
||||
// o = o.replace(/<(b|i|s|u|a|em|tt|ins|big|cite|strong)?>/g,'');
|
||||
//alert(o)
|
||||
o = o.replace(/<(?!span|\/span|br).*?>/gi,'');
|
||||
// alert(o)
|
||||
// x = o;
|
||||
x = z = this.split(o,flag);
|
||||
//alert(z)
|
||||
// x = x.replace(/\r\n/g,'<br>');
|
||||
x = x.replace(/\t/g, ' ');
|
||||
|
||||
|
||||
if(arguments[1]&&arguments[2]) x = x.replace(arguments[1],arguments[2]);
|
||||
|
||||
for(i=0;i<Language.syntax.length;i++)
|
||||
x = x.replace(Language.syntax[i].input,Language.syntax[i].output);
|
||||
|
||||
editor.innerHTML = this.actions.history[this.actions.next()] = (flag=='scroll') ? x : o.split(z).join(x);
|
||||
|
||||
if(flag!='init') this.findString();
|
||||
},
|
||||
|
||||
getLastWord : function() {
|
||||
var rangeAndCaret = CodePress.getRangeAndCaret();
|
||||
words = rangeAndCaret[0].substring(rangeAndCaret[1]-40,rangeAndCaret[1]);
|
||||
words = words.replace(/[\s\n\r\);\W]/g,'\n').split('\n');
|
||||
return words[words.length-1].replace(/[\W]/gi,'').toLowerCase();
|
||||
},
|
||||
|
||||
snippets : function(evt) {
|
||||
var snippets = Language.snippets;
|
||||
var trigger = this.getLastWord();
|
||||
for (var i=0; i<snippets.length; i++) {
|
||||
if(snippets[i].input == trigger) {
|
||||
var content = snippets[i].output.replace(/</g,'<');
|
||||
content = content.replace(/>/g,'>');
|
||||
if(content.indexOf('$0')<0) content += cc;
|
||||
else content = content.replace(/\$0/,cc);
|
||||
content = content.replace(/\n/g,'<br>');
|
||||
var pattern = new RegExp(trigger+cc,'gi');
|
||||
evt.preventDefault(); // prevent the tab key from being added
|
||||
this.syntaxHighlight('snippets',pattern,content);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
readOnly : function() {
|
||||
document.designMode = (arguments[0]) ? 'off' : 'on';
|
||||
},
|
||||
|
||||
complete : function(trigger) {
|
||||
window.getSelection().getRangeAt(0).deleteContents();
|
||||
var complete = Language.complete;
|
||||
for (var i=0; i<complete.length; i++) {
|
||||
if(complete[i].input == trigger) {
|
||||
var pattern = new RegExp('\\'+trigger+cc);
|
||||
var content = complete[i].output.replace(/\$0/g,cc);
|
||||
parent.setTimeout(function () { CodePress.syntaxHighlight('complete',pattern,content)},0); // wait for char to appear on screen
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
getCompleteChars : function() {
|
||||
var cChars = '';
|
||||
for(var i=0;i<Language.complete.length;i++)
|
||||
cChars += '|'+Language.complete[i].input;
|
||||
return cChars+'|';
|
||||
},
|
||||
|
||||
shortcuts : function() {
|
||||
var cCode = arguments[0];
|
||||
if(cCode==13) cCode = '[enter]';
|
||||
else if(cCode==32) cCode = '[space]';
|
||||
else cCode = '['+String.fromCharCode(charCode).toLowerCase()+']';
|
||||
for(var i=0;i<Language.shortcuts.length;i++)
|
||||
if(Language.shortcuts[i].input == cCode)
|
||||
this.insertCode(Language.shortcuts[i].output,false);
|
||||
},
|
||||
|
||||
getRangeAndCaret : function() {
|
||||
var range = window.getSelection().getRangeAt(0);
|
||||
var range2 = range.cloneRange();
|
||||
var node = range.endContainer;
|
||||
var caret = range.endOffset;
|
||||
range2.selectNode(node);
|
||||
return [range2.toString(),caret];
|
||||
},
|
||||
|
||||
insertCode : function(code,replaceCursorBefore) {
|
||||
var range = window.getSelection().getRangeAt(0);
|
||||
var node = window.document.createTextNode(code);
|
||||
var selct = window.getSelection();
|
||||
var range2 = range.cloneRange();
|
||||
// Insert text at cursor position
|
||||
selct.removeAllRanges();
|
||||
range.deleteContents();
|
||||
range.insertNode(node);
|
||||
// Move the cursor to the end of text
|
||||
range2.selectNode(node);
|
||||
range2.collapse(replaceCursorBefore);
|
||||
selct.removeAllRanges();
|
||||
selct.addRange(range2);
|
||||
},
|
||||
|
||||
// get code from editor
|
||||
getCode : function() {
|
||||
var code = editor.innerHTML;
|
||||
code = code.replace(/<br>/g,'\n');
|
||||
code = code.replace(/\u2009/g,'');
|
||||
code = code.replace(/<.*?>/g,'');
|
||||
code = code.replace(/</g,'<');
|
||||
code = code.replace(/>/g,'>');
|
||||
code = code.replace(/&/gi,'&');
|
||||
return code;
|
||||
},
|
||||
|
||||
// put code inside editor
|
||||
setCode : function() {
|
||||
var code = arguments[0];
|
||||
code = code.replace(/\u2009/gi,'');
|
||||
code = code.replace(/&/gi,'&');
|
||||
code = code.replace(/</g,'<');
|
||||
code = code.replace(/>/g,'>');
|
||||
editor.innerHTML = code;
|
||||
},
|
||||
|
||||
// undo and redo methods
|
||||
actions : {
|
||||
pos : -1, // actual history position
|
||||
history : [], // history vector
|
||||
|
||||
undo : function() {
|
||||
if(editor.innerHTML.indexOf(cc)==-1){
|
||||
window.getSelection().getRangeAt(0).insertNode(document.createTextNode(cc));
|
||||
this.history[this.pos] = editor.innerHTML;
|
||||
}
|
||||
this.pos--;
|
||||
if(typeof(this.history[this.pos])=='undefined') this.pos++;
|
||||
editor.innerHTML = this.history[this.pos];
|
||||
CodePress.findString();
|
||||
},
|
||||
|
||||
redo : function() {
|
||||
this.pos++;
|
||||
if(typeof(this.history[this.pos])=='undefined') this.pos--;
|
||||
editor.innerHTML = this.history[this.pos];
|
||||
CodePress.findString();
|
||||
},
|
||||
|
||||
next : function() { // get next vector position and clean old ones
|
||||
if(this.pos>20) this.history[this.pos-21] = undefined;
|
||||
return ++this.pos;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Language={};
|
||||
window.addEventListener('load', function() { CodePress.initialize('new'); }, true);
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 16 KiB |
443
gulliver/thirdparty/codepress/index.html
vendored
443
gulliver/thirdparty/codepress/index.html
vendored
File diff suppressed because it is too large
Load Diff
71
gulliver/thirdparty/codepress/languages/asp.css
vendored
71
gulliver/thirdparty/codepress/languages/asp.css
vendored
@@ -1,71 +0,0 @@
|
||||
/*
|
||||
* CodePress color styles for ASP-VB syntax highlighting
|
||||
* By Martin D. Kirk
|
||||
*/
|
||||
/* tags */
|
||||
|
||||
b {
|
||||
color:#000080;
|
||||
}
|
||||
/* comments */
|
||||
big, big b, big em, big ins, big s, strong i, strong i b, strong i s, strong i u, strong i a, strong i a u, strong i s u {
|
||||
color:gray;
|
||||
font-weight:normal;
|
||||
}
|
||||
/* ASP comments */
|
||||
strong dfn, strong dfn a,strong dfn var, strong dfn a u, strong dfn u{
|
||||
color:gray;
|
||||
font-weight:normal;
|
||||
}
|
||||
/* attributes */
|
||||
s, s b, span s u, span s cite, strong span s {
|
||||
color:#5656fa ;
|
||||
font-weight:normal;
|
||||
}
|
||||
/* strings */
|
||||
strong s,strong s b, strong s u, strong s cite {
|
||||
color:#009900;
|
||||
font-weight:normal;
|
||||
}
|
||||
strong ins{
|
||||
color:#000000;
|
||||
font-weight:bold;
|
||||
}
|
||||
/* Syntax */
|
||||
strong a, strong a u {
|
||||
color:#0000FF;
|
||||
font-weight:;
|
||||
}
|
||||
/* Native Keywords */
|
||||
strong u {
|
||||
color:#990099;
|
||||
font-weight:bold;
|
||||
}
|
||||
/* Numbers */
|
||||
strong var{
|
||||
color:#FF0000;
|
||||
}
|
||||
/* ASP Language */
|
||||
span{
|
||||
color:#990000;
|
||||
font-weight:bold;
|
||||
}
|
||||
strong i,strong a i, strong u i {
|
||||
color:#009999;
|
||||
}
|
||||
/* style */
|
||||
em {
|
||||
color:#800080;
|
||||
font-style:normal;
|
||||
}
|
||||
/* script */
|
||||
ins {
|
||||
color:#800000;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
/* <?php and ?> */
|
||||
cite, s cite {
|
||||
color:red;
|
||||
font-weight:bold;
|
||||
}
|
||||
117
gulliver/thirdparty/codepress/languages/asp.js
vendored
117
gulliver/thirdparty/codepress/languages/asp.js
vendored
@@ -1,117 +0,0 @@
|
||||
/*
|
||||
* CodePress regular expressions for ASP-vbscript syntax highlighting
|
||||
*/
|
||||
|
||||
// ASP VBScript
|
||||
Language.syntax = [
|
||||
// all tags
|
||||
{ input : /(<[^!%|!%@]*?>)/g, output : '<b>$1</b>' },
|
||||
// style tags
|
||||
{ input : /(<style.*?>)(.*?)(<\/style>)/g, output : '<em>$1</em><em>$2</em><em>$3</em>' },
|
||||
// script tags
|
||||
{ input : /(<script.*?>)(.*?)(<\/script>)/g, output : '<ins>$1</ins><ins>$2</ins><ins>$3</ins>' },
|
||||
// strings "" and attributes
|
||||
{ input : /\"(.*?)(\"|<br>|<\/P>)/g, output : '<s>"$1$2</s>' },
|
||||
// ASP Comment
|
||||
{ input : /\'(.*?)(\'|<br>|<\/P>)/g, output : '<dfn>\'$1$2</dfn>'},
|
||||
// <%.*
|
||||
{ input : /(<%)/g, output : '<strong>$1' },
|
||||
// .*%>
|
||||
{ input : /(%>)/g, output : '$1</strong>' },
|
||||
// <%@...%>
|
||||
{ input : /(<%@)(.+?)(%>)/gi, output : '$1<span>$2</span>$3' },
|
||||
//Numbers
|
||||
{ input : /\b([\d]+)\b/g, output : '<var>$1</var>' },
|
||||
// Reserved Words 1 (Blue)
|
||||
{ input : /\b(And|As|ByRef|ByVal|Call|Case|Class|Const|Dim|Do|Each|Else|ElseIf|Empty|End|Eqv|Exit|False|For|Function)\b/gi, output : '<a>$1</a>' },
|
||||
{ input : /\b(Get|GoTo|If|Imp|In|Is|Let|Loop|Me|Mod|Enum|New|Next|Not|Nothing|Null|On|Option|Or|Private|Public|ReDim|Rem)\b/gi, output : '<a>$1</a>' },
|
||||
{ input : /\b(Resume|Select|Set|Stop|Sub|Then|To|True|Until|Wend|While|With|Xor|Execute|Randomize|Erase|ExecuteGlobal|Explicit|step)\b/gi, output : '<a>$1</a>' },
|
||||
// Reserved Words 2 (Purple)
|
||||
{ input : /\b(Abandon|Abs|AbsolutePage|AbsolutePosition|ActiveCommand|ActiveConnection|ActualSize|AddHeader|AddNew|AppendChunk)\b/gi, output : '<u>$1</u>' },
|
||||
{ input : /\b(AppendToLog|Application|Array|Asc|Atn|Attributes|BeginTrans|BinaryRead|BinaryWrite|BOF|Bookmark|Boolean|Buffer|Byte)\b/gi, output : '<u>$1</u>' },
|
||||
{ input : /\b(CacheControl|CacheSize|Cancel|CancelBatch|CancelUpdate|CBool|CByte|CCur|CDate|CDbl|Charset|Chr|CInt|Clear)\b/gi, output : '<u>$1</u>' },
|
||||
{ input : /\b(ClientCertificate|CLng|Clone|Close|CodePage|CommandText|CommandType|CommandTimeout|CommitTrans|CompareBookmarks|ConnectionString|ConnectionTimeout)\b/gi, output : '<u>$1</u>' },
|
||||
{ input : /\b(Contents|ContentType|Cookies|Cos|CreateObject|CreateParameter|CSng|CStr|CursorLocation|CursorType|DataMember|DataSource|Date|DateAdd|DateDiff)\b/gi, output : '<u>$1</u>' },
|
||||
{ input : /\b(DatePart|DateSerial|DateValue|Day|DefaultDatabase|DefinedSize|Delete|Description|Double|EditMode|Eof|EOF|err|Error)\b/gi, output : '<u>$1</u>' },
|
||||
{ input : /\b(Exp|Expires|ExpiresAbsolute|Filter|Find|Fix|Flush|Form|FormatCurrency|FormatDateTime|FormatNumber|FormatPercent)\b/gi, output : '<u>$1</u>' },
|
||||
{ input : /\b(GetChunk|GetLastError|GetRows|GetString|Global|HelpContext|HelpFile|Hex|Hour|HTMLEncode|IgnoreCase|Index|InStr|InStrRev)\b/gi, output : '<u>$1</u>' },
|
||||
{ input : /\b(Int|Integer|IsArray|IsClientConnected|IsDate|IsolationLevel|Join|LBound|LCase|LCID|Left|Len|Lock|LockType|Log|Long|LTrim)\b/gi, output : '<u>$1</u>' },
|
||||
{ input : /\b(MapPath|MarshalOptions|MaxRecords|Mid|Minute|Mode|Month|MonthName|Move|MoveFirst|MoveLast|MoveNext|MovePrevious|Name|NextRecordset)\b/gi, output : '<u>$1</u>' },
|
||||
{ input : /\b(Now|Number|NumericScale|ObjectContext|Oct|Open|OpenSchema|OriginalValue|PageCount|PageSize|Pattern|PICS|Precision|Prepared|Property)\b/gi, output : '<u>$1</u>' },
|
||||
{ input : /\b(Provider|QueryString|RecordCount|Redirect|RegExp|Remove|RemoveAll|Replace|Requery|Request|Response|Resync|Right|Rnd)\b/gi, output : '<u>$1</u>' },
|
||||
{ input : /\b(RollbackTrans|RTrim|Save|ScriptTimeout|Second|Seek|Server|ServerVariables|Session|SessionID|SetAbort|SetComplete|Sgn)\b/gi, output : '<u>$1</u>' },
|
||||
{ input : /\b(Sin|Size|Sort|Source|Space|Split|Sqr|State|StaticObjects|Status|StayInSync|StrComp|String|StrReverse|Supports|Tan|Time)\b/gi, output : '<u>$1</u>' },
|
||||
{ input : /\b(Timeout|Timer|TimeSerial|TimeValue|TotalBytes|Transfer|Trim|Type|Type|UBound|UCase|UnderlyingValue|UnLock|Update|UpdateBatch)\b/gi, output : '<u>$1</u>' },
|
||||
{ input : /\b(URLEncode|Value|Value|Version|Weekday|WeekdayName|Write|Year)\b/gi, output : '<u>$1</u>' },
|
||||
// Reserved Words 3 (Turquis)
|
||||
{ input : /\b(vbBlack|vbRed|vbGreen|vbYellow|vbBlue|vbMagenta|vbCyan|vbWhite|vbBinaryCompare|vbTextCompare)\b/gi, output : '<i>$1</i>' },
|
||||
{ input : /\b(vbSunday|vbMonday|vbTuesday|vbWednesday|vbThursday|vbFriday|vbSaturday|vbUseSystemDayOfWeek)\b/gi, output : '<i>$1</i>' },
|
||||
{ input : /\b(vbFirstJan1|vbFirstFourDays|vbFirstFullWeek|vbGeneralDate|vbLongDate|vbShortDate|vbLongTime|vbShortTime)\b/gi, output : '<i>$1</i>' },
|
||||
{ input : /\b(vbObjectError|vbCr|VbCrLf|vbFormFeed|vbLf|vbNewLine|vbNullChar|vbNullString|vbTab|vbVerticalTab|vbUseDefault|vbTrue)\b/gi, output : '<i>$1</i>' },
|
||||
{ input : /\b(vbFalse|vbEmpty|vbNull|vbInteger|vbLong|vbSingle|vbDouble|vbCurrency|vbDate|vbString|vbObject|vbError|vbBoolean|vbVariant)\b/gi, output : '<i>$1</i>' },
|
||||
{ input : /\b(vbDataObject|vbDecimal|vbByte|vbArray)\b/gi, output : '<i>$1</i>' },
|
||||
// html comments
|
||||
{ input : /(<!--.*?-->.)/g, output : '<big>$1</big>' }
|
||||
]
|
||||
|
||||
Language.Functions = [
|
||||
// Output at index 0, must be the desired tagname surrounding a $1
|
||||
// Name is the index from the regex that marks the functionname
|
||||
{input : /(function|sub)([ ]*?)(\w+)([ ]*?\()/gi , output : '<ins>$1</ins>', name : '$3'}
|
||||
]
|
||||
|
||||
Language.snippets = [
|
||||
//Conditional
|
||||
{ input : 'if', output : 'If $0 Then\n\t\nEnd If' },
|
||||
{ input : 'ifelse', output : 'If $0 Then\n\t\n\nElse\n\t\nEnd If' },
|
||||
{ input : 'case', output : 'Select Case $0\n\tCase ?\n\tCase Else\nEnd Select'},
|
||||
//Response
|
||||
{ input : 'rw', output : 'Response.Write( $0 )' },
|
||||
{ input : 'resc', output : 'Response.Cookies( $0 )' },
|
||||
{ input : 'resb', output : 'Response.Buffer'},
|
||||
{ input : 'resflu', output : 'Response.Flush()'},
|
||||
{ input : 'resend', output : 'Response.End'},
|
||||
//Request
|
||||
{ input : 'reqc', output : 'Request.Cookies( $0 )' },
|
||||
{ input : 'rq', output : 'Request.Querystring("$0")' },
|
||||
{ input : 'rf', output : 'Request.Form("$0")' },
|
||||
//FSO
|
||||
{ input : 'fso', output : 'Set fso = Server.CreateObject("Scripting.FileSystemObject")\n$0' },
|
||||
{ input : 'setfo', output : 'Set fo = fso.getFolder($0)' },
|
||||
{ input : 'setfi', output : 'Set fi = fso.getFile($0)' },
|
||||
{ input : 'twr', output : 'Set f = fso.CreateTextFile($0,true)\'overwrite\nf.WriteLine()\nf.Close'},
|
||||
{ input : 'tre', output : 'Set f = fso.OpenTextFile($0, 1)\nf.ReadAll\nf.Close'},
|
||||
//Server
|
||||
{ input : 'mapp', output : 'Server.Mappath($0)' },
|
||||
//Loops
|
||||
{ input : 'foreach', output : 'For Each $0 in ?\n\t\nNext' },
|
||||
{ input : 'for', output : 'For $0 to ? step ?\n\t\nNext' },
|
||||
{ input : 'do', output : 'Do While($0)\n\t\nLoop' },
|
||||
{ input : 'untilrs', output : 'do until rs.eof\n\t\nrs.movenext\nloop' },
|
||||
//ADO
|
||||
{ input : 'adorec', output : 'Set rs = Server.CreateObject("ADODB.Recordset")' },
|
||||
{ input : 'adocon', output : 'Set Conn = Server.CreateObject("ADODB.Connection")' },
|
||||
{ input : 'adostr', output : 'Set oStr = Server.CreateObject("ADODB.Stream")' },
|
||||
//Http Request
|
||||
{ input : 'xmlhttp', output : 'Set xmlHttp = Server.CreateObject("Microsoft.XMLHTTP")\nxmlHttp.open("GET", $0, false)\nxmlHttp.send()\n?=xmlHttp.responseText' },
|
||||
{ input : 'xmldoc', output : 'Set xmldoc = Server.CreateObject("Microsoft.XMLDOM")\nxmldoc.async=false\nxmldoc.load(request)'},
|
||||
//Functions
|
||||
{ input : 'func', output : 'Function $0()\n\t\n\nEnd Function'},
|
||||
{ input : 'sub', output : 'Sub $0()\n\t\nEnd Sub'}
|
||||
|
||||
]
|
||||
|
||||
Language.complete = [
|
||||
//{ input : '\'', output : '\'$0\'' },
|
||||
{ input : '"', output : '"$0"' },
|
||||
{ input : '(', output : '\($0\)' },
|
||||
{ input : '[', output : '\[$0\]' },
|
||||
{ input : '{', output : '{\n\t$0\n}' }
|
||||
]
|
||||
|
||||
Language.shortcuts = [
|
||||
{ input : '[space]', output : ' ' },
|
||||
{ input : '[enter]', output : '<br />' } ,
|
||||
{ input : '[j]', output : 'testing' },
|
||||
{ input : '[7]', output : '&' }
|
||||
]
|
||||
@@ -1,13 +0,0 @@
|
||||
/**
|
||||
* CodePress color styles for AutoIt syntax highlighting
|
||||
*/
|
||||
|
||||
u {font-style:normal;color:#000090;font-weight:bold;font-family:Monospace;}
|
||||
var {color:#AA0000;font-weight:bold;font-style:normal;}
|
||||
em {color:#FF33FF;}
|
||||
ins {color:#AC00A9;}
|
||||
i {color:#F000FF;}
|
||||
b {color:#FF0000;}
|
||||
a {color:#0080FF;font-weight:bold;}
|
||||
s, s u, s b {color:#9999CC;font-weight:normal;}
|
||||
cite, cite *{color:#009933;font-weight:normal;}
|
||||
File diff suppressed because one or more lines are too long
@@ -1,9 +0,0 @@
|
||||
/*
|
||||
* CodePress color styles for Java syntax highlighting
|
||||
* By Edwin de Jonge
|
||||
*/
|
||||
|
||||
b {color:#7F0055;font-weight:bold;font-style:normal;} /* reserved words */
|
||||
a {color:#2A0088;font-weight:bold;font-style:normal;} /* types */
|
||||
i, i b, i s {color:#3F7F5F;font-weight:bold;} /* comments */
|
||||
s, s b {color:#2A00FF;font-weight:normal;} /* strings */
|
||||
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* CodePress regular expressions for C# syntax highlighting
|
||||
* By Edwin de Jonge
|
||||
*/
|
||||
|
||||
Language.syntax = [ // C#
|
||||
{ input : /\"(.*?)(\"|<br>|<\/P>)/g, output : '<s>"$1$2</s>' }, // strings double quote
|
||||
{ input : /\'(.?)(\'|<br>|<\/P>)/g, output : '<s>\'$1$2</s>' }, // strings single quote
|
||||
{ input : /\b(abstract|as|base|break|case|catch|checked|continue|default|delegate|do|else|event|explicit|extern|false|finally|fixed|for|foreach|get|goto|if|implicit|in|interface|internal|is|lock|namespace|new|null|object|operator|out|override|params|partial|private|protected|public|readonly|ref|return|set|sealed|sizeof|static|stackalloc|switch|this|throw|true|try|typeof|unchecked|unsafe|using|value|virtual|while)\b/g, output : '<b>$1</b>' }, // reserved words
|
||||
{ input : /\b(bool|byte|char|class|double|float|int|interface|long|string|struct|void)\b/g, output : '<a>$1</a>' }, // types
|
||||
{ input : /([^:]|^)\/\/(.*?)(<br|<\/P)/g, output : '$1<i>//$2</i>$3' }, // comments //
|
||||
{ input : /\/\*(.*?)\*\//g, output : '<i>/*$1*/</i>' } // comments /* */
|
||||
];
|
||||
|
||||
Language.snippets = [];
|
||||
|
||||
Language.complete = [ // Auto complete only for 1 character
|
||||
{input : '\'',output : '\'$0\'' },
|
||||
{input : '"', output : '"$0"' },
|
||||
{input : '(', output : '\($0\)' },
|
||||
{input : '[', output : '\[$0\]' },
|
||||
{input : '{', output : '{\n\t$0\n}' }
|
||||
];
|
||||
|
||||
Language.shortcuts = [];
|
||||
10
gulliver/thirdparty/codepress/languages/css.css
vendored
10
gulliver/thirdparty/codepress/languages/css.css
vendored
@@ -1,10 +0,0 @@
|
||||
/*
|
||||
* CodePress color styles for CSS syntax highlighting
|
||||
*/
|
||||
|
||||
b, b a, b u {color:#000080;} /* tags, ids, classes */
|
||||
i, i b, i s, i a, i u {color:gray;} /* comments */
|
||||
s, s b {color:#a0a0dd;} /* parameters */
|
||||
a {color:#0000ff;} /* keys */
|
||||
u {color:red;} /* values */
|
||||
|
||||
23
gulliver/thirdparty/codepress/languages/css.js
vendored
23
gulliver/thirdparty/codepress/languages/css.js
vendored
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
* CodePress regular expressions for CSS syntax highlighting
|
||||
*/
|
||||
|
||||
// CSS
|
||||
Language.syntax = [
|
||||
{ input : /(.*?){(.*?)}/g,output : '<b>$1</b>{<u>$2</u>}' }, // tags, ids, classes, values
|
||||
{ input : /([\w-]*?):([^\/])/g,output : '<a>$1</a>:$2' }, // keys
|
||||
{ input : /\((.*?)\)/g,output : '(<s>$1</s>)' }, // parameters
|
||||
{ input : /\/\*(.*?)\*\//g,output : '<i>/*$1*/</i>'} // comments
|
||||
]
|
||||
|
||||
Language.snippets = []
|
||||
|
||||
Language.complete = [
|
||||
{ input : '\'',output : '\'$0\'' },
|
||||
{ input : '"', output : '"$0"' },
|
||||
{ input : '(', output : '\($0\)' },
|
||||
{ input : '[', output : '\[$0\]' },
|
||||
{ input : '{', output : '{\n\t$0\n}' }
|
||||
]
|
||||
|
||||
Language.shortcuts = []
|
||||
@@ -1,9 +0,0 @@
|
||||
/*
|
||||
* CodePress color styles for generic syntax highlighting
|
||||
*/
|
||||
|
||||
b {color:#7F0055;font-weight:bold;} /* reserved words */
|
||||
u {color:darkblue;font-weight:bold;} /* special words */
|
||||
i, i b, i s, i u, i em {color:green;font-weight:normal;} /* comments */
|
||||
s, s b, s em {color:#2A00FF;font-weight:normal;} /* strings */
|
||||
em {font-weight:bold;} /* special chars */
|
||||
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* CodePress regular expressions for generic syntax highlighting
|
||||
*/
|
||||
|
||||
// generic languages
|
||||
Language.syntax = [
|
||||
{ input : /\"(.*?)(\"|<br>|<\/P>)/g, output : '<s>"$1$2</s>' }, // strings double quote
|
||||
{ input : /\'(.*?)(\'|<br>|<\/P>)/g, output : '<s>\'$1$2</s>' }, // strings single quote
|
||||
{ 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
|
||||
{ input : /([\(\){}])/g, output : '<em>$1</em>' }, // special chars;
|
||||
{ input : /([^:]|^)\/\/(.*?)(<br|<\/P)/g, output : '$1<i>//$2</i>$3' }, // comments //
|
||||
{ input : /\/\*(.*?)\*\//g, output : '<i>/*$1*/</i>' } // comments /* */
|
||||
]
|
||||
|
||||
Language.snippets = []
|
||||
|
||||
Language.complete = [
|
||||
{ input : '\'', output : '\'$0\'' },
|
||||
{ input : '"', output : '"$0"' },
|
||||
{ input : '(', output : '\($0\)' },
|
||||
{ input : '[', output : '\[$0\]' },
|
||||
{ input : '{', output : '{\n\t$0\n}' }
|
||||
]
|
||||
|
||||
Language.shortcuts = []
|
||||
13
gulliver/thirdparty/codepress/languages/html.css
vendored
13
gulliver/thirdparty/codepress/languages/html.css
vendored
@@ -1,13 +0,0 @@
|
||||
/*
|
||||
* CodePress color styles for HTML syntax highlighting
|
||||
*/
|
||||
|
||||
b {color:#000080;} /* tags */
|
||||
ins, ins b, ins s, ins em {color:gray;} /* comments */
|
||||
s, s b {color:#7777e4;} /* attribute values */
|
||||
a {color:green;} /* links */
|
||||
u {color:#E67300;} /* forms */
|
||||
big {color:#db0000;} /* images */
|
||||
em, em b {color:#800080;} /* style */
|
||||
strong {color:#800000;} /* script */
|
||||
tt i {color:darkblue;font-weight:bold;} /* script reserved words */
|
||||
59
gulliver/thirdparty/codepress/languages/html.js
vendored
59
gulliver/thirdparty/codepress/languages/html.js
vendored
@@ -1,59 +0,0 @@
|
||||
/*
|
||||
* CodePress regular expressions for HTML syntax highlighting
|
||||
*/
|
||||
|
||||
// HTML
|
||||
Language.syntax = [
|
||||
{ input : /(<[^!]*?>)/g, output : '<b>$1</b>' }, // all tags
|
||||
{ input : /(<a .*?>|<\/a>)/g, output : '<a>$1</a>' }, // links
|
||||
{ input : /(<img .*?>)/g, output : '<big>$1</big>' }, // images
|
||||
{ input : /(<\/?(button|textarea|form|input|select|option|label).*?>)/g, output : '<u>$1</u>' }, // forms
|
||||
{ input : /(<style.*?>)(.*?)(<\/style>)/g, output : '<em>$1</em><em>$2</em><em>$3</em>' }, // style tags
|
||||
{ input : /(<script.*?>)(.*?)(<\/script>)/g, output : '<strong>$1</strong><tt>$2</tt><strong>$3</strong>' }, // script tags
|
||||
{ input : /=(".*?")/g, output : '=<s>$1</s>' }, // atributes double quote
|
||||
{ input : /=('.*?')/g, output : '=<s>$1</s>' }, // atributes single quote
|
||||
{ input : /(<!--.*?-->.)/g, output : '<ins>$1</ins>' }, // comments
|
||||
{ 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
|
||||
]
|
||||
|
||||
Language.snippets = [
|
||||
{ input : 'aref', output : '<a href="$0"></a>' },
|
||||
{ input : 'h1', output : '<h1>$0</h1>' },
|
||||
{ input : 'h2', output : '<h2>$0</h2>' },
|
||||
{ input : 'h3', output : '<h3>$0</h3>' },
|
||||
{ input : 'h4', output : '<h4>$0</h4>' },
|
||||
{ input : 'h5', output : '<h5>$0</h5>' },
|
||||
{ input : 'h6', output : '<h6>$0</h6>' },
|
||||
{ input : 'html', output : '<html>\n\t$0\n</html>' },
|
||||
{ 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>' },
|
||||
{ input : 'img', output : '<img src="$0" alt="" />' },
|
||||
{ input : 'input', output : '<input name="$0" id="" type="" value="" />' },
|
||||
{ input : 'label', output : '<label for="$0"></label>' },
|
||||
{ input : 'legend', output : '<legend>\n\t$0\n</legend>' },
|
||||
{ input : 'link', output : '<link rel="stylesheet" href="$0" type="text/css" media="screen" charset="utf-8" />' },
|
||||
{ input : 'base', output : '<base href="$0" />' },
|
||||
{ input : 'body', output : '<body>\n\t$0\n</body>' },
|
||||
{ input : 'css', output : '<link rel="stylesheet" href="$0" type="text/css" media="screen" charset="utf-8" />' },
|
||||
{ input : 'div', output : '<div>\n\t$0\n</div>' },
|
||||
{ input : 'divid', output : '<div id="$0">\n\t\n</div>' },
|
||||
{ input : 'dl', output : '<dl>\n\t<dt>\n\t\t$0\n\t</dt>\n\t<dd></dd>\n</dl>' },
|
||||
{ input : 'fieldset', output : '<fieldset>\n\t$0\n</fieldset>' },
|
||||
{ input : 'form', output : '<form action="$0" method="" name="">\n\t\n</form>' },
|
||||
{ input : 'meta', output : '<meta name="$0" content="" />' },
|
||||
{ input : 'p', output : '<p>$0</p>' },
|
||||
{ input : 'script', output : '<script type="text/javascript" language="javascript" charset="utf-8">\n\t$0\t\n</script>' },
|
||||
{ input : 'scriptsrc', output : '<script src="$0" type="text/javascript" language="javascript" charset="utf-8"></script>' },
|
||||
{ input : 'span', output : '<span>$0</span>' },
|
||||
{ input : 'table', output : '<table border="$0" cellspacing="" cellpadding="">\n\t<tr><th></th></tr>\n\t<tr><td></td></tr>\n</table>' },
|
||||
{ input : 'style', output : '<style type="text/css" media="screen">\n\t$0\n</style>' }
|
||||
]
|
||||
|
||||
Language.complete = [
|
||||
{ input : '\'',output : '\'$0\'' },
|
||||
{ input : '"', output : '"$0"' },
|
||||
{ input : '(', output : '\($0\)' },
|
||||
{ input : '[', output : '\[$0\]' },
|
||||
{ input : '{', output : '{\n\t$0\n}' }
|
||||
]
|
||||
|
||||
Language.shortcuts = []
|
||||
@@ -1,7 +0,0 @@
|
||||
/*
|
||||
* CodePress color styles for Java syntax highlighting
|
||||
*/
|
||||
|
||||
b {color:#7F0055;font-weight:bold;font-style:normal;} /* reserved words */
|
||||
i, i b, i s {color:#3F7F5F;font-weight:bold;} /* comments */
|
||||
s, s b {color:#2A00FF;font-weight:normal;} /* strings */
|
||||
24
gulliver/thirdparty/codepress/languages/java.js
vendored
24
gulliver/thirdparty/codepress/languages/java.js
vendored
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
* CodePress regular expressions for Java syntax highlighting
|
||||
*/
|
||||
|
||||
// Java
|
||||
Language.syntax = [
|
||||
{ input : /\"(.*?)(\"|<br>|<\/P>)/g, output : '<s>"$1$2</s>'}, // strings double quote
|
||||
{ input : /\'(.*?)(\'|<br>|<\/P>)/g, output : '<s>\'$1$2</s>'}, // strings single quote
|
||||
{ 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
|
||||
{ input : /([^:]|^)\/\/(.*?)(<br|<\/P)/g, output : '$1<i>//$2</i>$3'}, // comments //
|
||||
{ input : /\/\*(.*?)\*\//g, output : '<i>/*$1*/</i>' }// comments /* */
|
||||
]
|
||||
|
||||
Language.snippets = []
|
||||
|
||||
Language.complete = [
|
||||
{ input : '\'',output : '\'$0\'' },
|
||||
{ input : '"', output : '"$0"' },
|
||||
{ input : '(', output : '\($0\)' },
|
||||
{ input : '[', output : '\[$0\]' },
|
||||
{ input : '{', output : '{\n\t$0\n}' }
|
||||
]
|
||||
|
||||
Language.shortcuts = []
|
||||
@@ -1,8 +0,0 @@
|
||||
/*
|
||||
* CodePress color styles for JavaScript syntax highlighting
|
||||
*/
|
||||
|
||||
b {color:#7F0055;font-weight:bold;} /* reserved words */
|
||||
u {color:darkblue;font-weight:bold;} /* special words */
|
||||
i, i b, i s, i u {color:green;font-weight:normal;} /* comments */
|
||||
s, s b, s u {color:#2A00FF;font-weight:normal;} /* strings */
|
||||
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* CodePress regular expressions for JavaScript syntax highlighting
|
||||
*/
|
||||
|
||||
// JavaScript
|
||||
Language.syntax = [
|
||||
{ input : /\"(.*?)(\"|<br>|<\/P>)/g, output : '<s>"$1$2</s>' }, // strings double quote
|
||||
{ input : /\'(.*?)(\'|<br>|<\/P>)/g, output : '<s>\'$1$2</s>' }, // strings single quote
|
||||
{ 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
|
||||
{ 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
|
||||
{ input : /([^:]|^)\/\/(.*?)(<br|<\/P)/g, output : '$1<i>//$2</i>$3' }, // comments //
|
||||
{ input : /\/\*(.*?)\*\//g, output : '<i>/*$1*/</i>' } // comments /* */
|
||||
]
|
||||
|
||||
Language.snippets = [
|
||||
{ input : 'dw', output : 'document.write(\'$0\');' },
|
||||
{ input : 'getid', output : 'document.getElementById(\'$0\')' },
|
||||
{ input : 'fun', output : 'function $0(){\n\t\n}' },
|
||||
{ input : 'func', output : 'function $0(){\n\t\n}' }
|
||||
]
|
||||
|
||||
Language.complete = [
|
||||
{ input : '\'',output : '\'$0\'' },
|
||||
{ input : '"', output : '"$0"' },
|
||||
{ input : '(', output : '\($0\)' },
|
||||
{ input : '[', output : '\[$0\]' },
|
||||
{ input : '{', output : '{\n\t$0\n}' }
|
||||
]
|
||||
|
||||
Language.shortcuts = []
|
||||
11
gulliver/thirdparty/codepress/languages/perl.css
vendored
11
gulliver/thirdparty/codepress/languages/perl.css
vendored
@@ -1,11 +0,0 @@
|
||||
/*
|
||||
* CodePress color styles for Perl syntax highlighting
|
||||
* By J. Nick Koston
|
||||
*/
|
||||
|
||||
b {color:#7F0055;font-weight:bold;} /* reserved words */
|
||||
i, i b, i s, i em, i a, i u {color:gray;font-weight:normal;} /* comments */
|
||||
s, s b, s a, s em, s u {color:#2A00FF;font-weight:normal;} /* strings */
|
||||
a {color:#006700;font-weight:bold;} /* variables */
|
||||
em {color:darkblue;font-weight:bold;} /* functions */
|
||||
u {font-weight:bold;} /* special chars */
|
||||
27
gulliver/thirdparty/codepress/languages/perl.js
vendored
27
gulliver/thirdparty/codepress/languages/perl.js
vendored
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
* CodePress regular expressions for Perl syntax highlighting
|
||||
* By J. Nick Koston
|
||||
*/
|
||||
|
||||
// Perl
|
||||
Language.syntax = [
|
||||
{ input : /\"(.*?)(\"|<br>|<\/P>)/g, output : '<s>"$1$2</s>' }, // strings double quote
|
||||
{ input : /\'(.*?)(\'|<br>|<\/P>)/g, output : '<s>\'$1$2</s>' }, // strings single quote
|
||||
{ input : /([\$\@\%][\w\.]*)/g, output : '<a>$1</a>' }, // vars
|
||||
{ input : /(sub\s+)([\w\.]*)/g, output : '$1<em>$2</em>' }, // functions
|
||||
{ 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
|
||||
{ input : /([\(\){}])/g, output : '<u>$1</u>' }, // special chars
|
||||
{ input : /#(.*?)(<br>|<\/P>)/g, output : '<i>#$1</i>$2' } // comments
|
||||
]
|
||||
|
||||
Language.snippets = []
|
||||
|
||||
Language.complete = [
|
||||
{ input : '\'',output : '\'$0\'' },
|
||||
{ input : '"', output : '"$0"' },
|
||||
{ input : '(', output : '\($0\)' },
|
||||
{ input : '[', output : '\[$0\]' },
|
||||
{ input : '{', output : '{\n\t$0\n}' }
|
||||
]
|
||||
|
||||
Language.shortcuts = []
|
||||
12
gulliver/thirdparty/codepress/languages/php.css
vendored
12
gulliver/thirdparty/codepress/languages/php.css
vendored
@@ -1,12 +0,0 @@
|
||||
/*
|
||||
* CodePress color styles for PHP syntax highlighting
|
||||
*/
|
||||
|
||||
b {color:#000080;} /* tags */
|
||||
big, big b, big em, big ins, big s, strong i, strong i b, strong i s, strong i u, strong i a, strong i a u, strong i s u {color:gray;font-weight:normal;} /* comments */
|
||||
s, s b, strong s u, strong s cite {color:#5656fa;font-weight:normal;} /* attributes and strings */
|
||||
strong a, strong a u {color:#006700;font-weight:bold;} /* variables */
|
||||
em {color:#800080;font-style:normal;} /* style */
|
||||
ins {color:#800000;} /* script */
|
||||
strong u {color:#7F0055;font-weight:bold;} /* reserved words */
|
||||
cite, s cite {color:red;font-weight:bold;} /* <?php and ?> */
|
||||
61
gulliver/thirdparty/codepress/languages/php.js
vendored
61
gulliver/thirdparty/codepress/languages/php.js
vendored
@@ -1,61 +0,0 @@
|
||||
/*
|
||||
* CodePress regular expressions for PHP syntax highlighting
|
||||
*/
|
||||
|
||||
// PHP
|
||||
Language.syntax = [
|
||||
{ input : /(<[^!\?]*?>)/g, output : '<b>$1</b>' }, // all tags
|
||||
{ input : /(<style.*?>)(.*?)(<\/style>)/g, output : '<em>$1</em><em>$2</em><em>$3</em>' }, // style tags
|
||||
{ input : /(<script.*?>)(.*?)(<\/script>)/g, output : '<ins>$1</ins><ins>$2</ins><ins>$3</ins>' }, // script tags
|
||||
{ input : /\"(.*?)(\"|<br>|<\/P>)/g, output : '<s>"$1$2</s>' }, // strings double quote
|
||||
{ input : /\'(.*?)(\'|<br>|<\/P>)/g, output : '<s>\'$1$2</s>'}, // strings single quote
|
||||
{ input : /(<\?)/g, output : '<strong>$1' }, // <?.*
|
||||
{ input : /(\?>)/g, output : '$1</strong>' }, // .*?>
|
||||
{ input : /(<\?php|<\?=|<\?|\?>)/g, output : '<cite>$1</cite>' }, // php tags
|
||||
{ input : /(\$[\w\.]*)/g, output : '<a>$1</a>' }, // vars
|
||||
{ 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
|
||||
{ input : /([^:])\/\/(.*?)(<br|<\/P)/g, output : '$1<i>//$2</i>$3' }, // php comments //
|
||||
{ input : /([^:])#(.*?)(<br|<\/P)/g, output : '$1<i>#$2</i>$3' }, // php comments #
|
||||
{ input : /\/\*(.*?)\*\//g, output : '<i>/*$1*/</i>' }, // php comments /* */
|
||||
{ input : /(<!--.*?-->.)/g, output : '<big>$1</big>' } // html comments
|
||||
]
|
||||
|
||||
Language.snippets = [
|
||||
{ input : 'if', output : 'if($0){\n\t\n}' },
|
||||
{ input : 'ifelse', output : 'if($0){\n\t\n}\nelse{\n\t\n}' },
|
||||
{ input : 'else', output : '}\nelse {\n\t' },
|
||||
{ input : 'elseif', output : '}\nelseif($0) {\n\t' },
|
||||
{ input : 'do', output : 'do{\n\t$0\n}\nwhile();' },
|
||||
{ input : 'inc', output : 'include_once("$0");' },
|
||||
{ input : 'fun', output : 'function $0(){\n\t\n}' },
|
||||
{ input : 'func', output : 'function $0(){\n\t\n}' },
|
||||
{ input : 'while', output : 'while($0){\n\t\n}' },
|
||||
{ input : 'for', output : 'for($0,,){\n\t\n}' },
|
||||
{ input : 'fore', output : 'foreach($0 as ){\n\t\n}' },
|
||||
{ input : 'foreach', output : 'foreach($0 as ){\n\t\n}' },
|
||||
{ input : 'echo', output : 'echo \'$0\';' },
|
||||
{ input : 'switch', output : 'switch($0) {\n\tcase "": break;\n\tdefault: ;\n}' },
|
||||
{ input : 'case', output : 'case "$0" : break;' },
|
||||
{ input : 'ret0', output : 'return false;' },
|
||||
{ input : 'retf', output : 'return false;' },
|
||||
{ input : 'ret1', output : 'return true;' },
|
||||
{ input : 'rett', output : 'return true;' },
|
||||
{ input : 'ret', output : 'return $0;' },
|
||||
{ input : 'def', output : 'define(\'$0\',\'\');' },
|
||||
{ input : '<?', output : 'php\n$0\n?>' }
|
||||
]
|
||||
|
||||
Language.complete = [
|
||||
{ input : '\'', output : '\'$0\'' },
|
||||
{ input : '"', output : '"$0"' },
|
||||
{ input : '(', output : '\($0\)' },
|
||||
{ input : '[', output : '\[$0\]' },
|
||||
{ input : '{', output : '{\n\t$0\n}' }
|
||||
]
|
||||
|
||||
Language.shortcuts = [
|
||||
{ input : '[space]', output : ' ' },
|
||||
{ input : '[enter]', output : '<br />' } ,
|
||||
{ input : '[j]', output : 'testing' },
|
||||
{ input : '[7]', output : '&' }
|
||||
]
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user