Merge remote-tracking branch 'upstream/3.1' into HOR-1087
This commit is contained in:
@@ -142,7 +142,6 @@ $docuroot = explode ( PATH_SEP , $_SERVER['DOCUMENT_ROOT'] );
|
|||||||
G::LoadSystem('form');
|
G::LoadSystem('form');
|
||||||
G::LoadSystem('menu');
|
G::LoadSystem('menu');
|
||||||
G::LoadSystem("xmlMenu");
|
G::LoadSystem("xmlMenu");
|
||||||
G::LoadSystem('dvEditor');
|
|
||||||
G::LoadSystem('table');
|
G::LoadSystem('table');
|
||||||
G::LoadSystem('pagedTable');
|
G::LoadSystem('pagedTable');
|
||||||
G::LoadSystem('tree');
|
G::LoadSystem('tree');
|
||||||
|
|||||||
@@ -1,136 +0,0 @@
|
|||||||
function DVEditor(where,body,oHiddenInput,height,mode,editorId)
|
|
||||||
{
|
|
||||||
var me=this;
|
|
||||||
var hiddenInput=oHiddenInput;
|
|
||||||
var iframe=$dce("iframe");
|
|
||||||
//NOTE: className no funciona en FIREFOX
|
|
||||||
iframe.style.width="100%";
|
|
||||||
iframe.style.height=height;
|
|
||||||
iframe.style.margin="0px";
|
|
||||||
iframe.style.padding="0px";
|
|
||||||
iframe.style.border="none";
|
|
||||||
where.appendChild(iframe);
|
|
||||||
var head=document.childNodes[0].childNodes[0];
|
|
||||||
var header='';
|
|
||||||
if (iframe.contentWindow) {
|
|
||||||
var doc = iframe.contentWindow.document;
|
|
||||||
} else {
|
|
||||||
var doc = iframe.contentDocument;
|
|
||||||
}
|
|
||||||
var _header = $dce("head");// head.cloneNode(true);
|
|
||||||
for (var i=0;i<head.childNodes.length;i++) {
|
|
||||||
try {
|
|
||||||
if ((head.childNodes[i].tagName==='LINK')&&
|
|
||||||
(head.childNodes[i].type="text/css")) {
|
|
||||||
_header.appendChild(head.childNodes[i].cloneNode(true));
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
header=_header.innerHTML;
|
|
||||||
//alert(header);
|
|
||||||
doc.open();
|
|
||||||
doc.write('<html><head>'+header+'</head><body style="height:100%;padding:0px;margin:0px;border:none;background-color:ThreeDHighlight;cursor:text;">'+body+'</body></html>');
|
|
||||||
doc.close();
|
|
||||||
doc.designMode="on";
|
|
||||||
if (mode=="edit") {
|
|
||||||
doc.contentEditable=true;
|
|
||||||
} else {
|
|
||||||
doc.contentEditable=false;
|
|
||||||
}
|
|
||||||
this.doc=doc;
|
|
||||||
|
|
||||||
me.insertHTML = function (html)
|
|
||||||
{
|
|
||||||
var cmd = 'inserthtml';
|
|
||||||
var bool = false;
|
|
||||||
var value = html;
|
|
||||||
try {
|
|
||||||
doc.execCommand(cmd,bool,value);
|
|
||||||
} catch (e) {
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
|
|
||||||
me.command = function()
|
|
||||||
{
|
|
||||||
var cmd = this.getAttribute('name');
|
|
||||||
var bool = false;
|
|
||||||
var value = this.getAttribute('cmdValue') || null;
|
|
||||||
if (value == 'promptUser') {
|
|
||||||
value = prompt(
|
|
||||||
(typeof(G_STRINGS[this.getAttribute('promptText')])!=='undefined')?
|
|
||||||
G_STRINGS[this.getAttribute('promptText')]:
|
|
||||||
this.getAttribute('promptText')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
if (editorId) {
|
|
||||||
if (window.ActiveXObject && cmd == 'hilitecolor') {
|
|
||||||
doc.selection.createRange().pasteHTML('<span style ="background-color:' + value + '">' +doc.selection.createRange().text +'</span>');
|
|
||||||
} else {
|
|
||||||
eval("window._editor" +editorId+".doc.execCommand(cmd,bool,value);");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
doc.execCommand(cmd,bool,value);
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
|
|
||||||
me.loadToolBar = function(uri)
|
|
||||||
{
|
|
||||||
var tb=WebResource(uri);
|
|
||||||
if(editorId){ // for multi-edhtmleditor
|
|
||||||
tb.innerHTML = tb.innerHTML.replace(/DVEditorMap/g, "DVEditorMap" + editorId);
|
|
||||||
}
|
|
||||||
iframe.parentNode.insertBefore(tb,iframe);
|
|
||||||
me.setToolBar(tb);
|
|
||||||
};
|
|
||||||
|
|
||||||
me.setToolBar = function(toolbar)
|
|
||||||
{
|
|
||||||
var buttons=toolbar.getElementsByTagName('area');
|
|
||||||
for (var b=0;b<buttons.length;b++) {
|
|
||||||
buttons[b].onclick=me.command;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
me.getHTML = function()
|
|
||||||
{
|
|
||||||
var body='';
|
|
||||||
try {
|
|
||||||
body=doc.getElementsByTagName('body')[0];
|
|
||||||
body=body.innerHTML;
|
|
||||||
} catch (e) {
|
|
||||||
}
|
|
||||||
return body;
|
|
||||||
};
|
|
||||||
me.setHTML = function(html)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
body=doc.getElementsByTagName('body')[0];
|
|
||||||
body.innerHTML=html;
|
|
||||||
} catch (e) {
|
|
||||||
}
|
|
||||||
return body;
|
|
||||||
};
|
|
||||||
|
|
||||||
me.refreshHidden = function()
|
|
||||||
{
|
|
||||||
if(hiddenInput)
|
|
||||||
{
|
|
||||||
var html=me.getHTML();
|
|
||||||
var raiseOnChange=hiddenInput.value!==html;
|
|
||||||
hiddenInput.value=html;
|
|
||||||
if (raiseOnChange && hiddenInput.onchange) hiddenInput.onchange();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
me.syncHidden = function(name)
|
|
||||||
{
|
|
||||||
me.refreshHidden();
|
|
||||||
setTimeout(name+".syncHidden('"+name+"')",500);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
<div style="background-color:ButtonFace;">
|
|
||||||
<img src='/js/dveditor/core/toolbars/complete3lines.png' usemap='#DVEditorMap' alt='' style='border-style:none' />
|
|
||||||
<map class="dvtoolbar" id='DVEditorMap' name='DVEditorMap'>
|
|
||||||
<area shape='rect' href="#" coords='0,24,24,48' name='fontname' cmdValue='promptUser' promptText='Font name?' value='font-family'/>
|
|
||||||
<area shape='rect' href="#" coords='96,48,120,72' name='inserthtml' cmdValue='promptUser' promptText='Valid HTML snippet' value='html'/>
|
|
||||||
<area shape='rect' href="#" coords='0,48,24,72' name='insertparagraph'/>
|
|
||||||
<area shape='rect' href="#" coords='48,48,72,72' name='insertorderedlist'/>
|
|
||||||
<area shape='rect' href="#" coords='72,48,96,72' name='insertunorderedlist'/>
|
|
||||||
<area shape='rect' href="#" coords='216,0,240,24' name='justifyleft'/>
|
|
||||||
<area shape='rect' href="#" coords='240,0,264,24' name='justifycenter'/>
|
|
||||||
<area shape='rect' href="#" coords='264,0,288,24' name='justifyright'/>
|
|
||||||
<area shape='rect' href="#" coords='288,0,312,24' name='justifyfull'/>
|
|
||||||
<area shape='rect' href="#" coords='72,0,96,24' name='bold'/>
|
|
||||||
<area shape='rect' href="#" coords='96,0,120,24' name='italic'/>
|
|
||||||
<area shape='rect' href="#" coords='120,0,144,24' name='underline'/>
|
|
||||||
<area shape='rect' href="#" coords='24,0,48,24' name='cut'/>
|
|
||||||
<area shape='rect' href="#" coords='0,0,24,24' name='copy'/>
|
|
||||||
<area shape='rect' href="#" coords='48,0,72,24' name='paste'/>
|
|
||||||
<area shape='rect' href="#" coords='264,24,288,48' name='undo'/>
|
|
||||||
<area shape='rect' href="#" coords='288,24,312,48' name='redo'/>
|
|
||||||
<area shape='rect' href="#" coords='120,24,144,48' name='backcolor' cmdValue='promptUser' promptText='Background color?' value='bgcolor'/>
|
|
||||||
<area shape='rect' href="#" coords='144,24,168,48' name='hilitecolor' cmdValue='promptUser' promptText='Hilite color?' value='hilite'/>
|
|
||||||
<area shape='rect' href="#" coords='48,24,72,48' name='increasefontsize'/>
|
|
||||||
<area shape='rect' href="#" coords='72,24,96,48' name='decreasefontsize'/>
|
|
||||||
<area shape='rect' href="#" coords='168,24,192,48' name='formatblock' cmdValue='promptUser' promptText='Which block?' value='formatblock'/>
|
|
||||||
<area shape='rect' href="#" coords='24,24,48,48' name='FontSize' cmdValue='promptUser' promptText='Font size?' value='font-size'/>
|
|
||||||
<area shape='rect' href="#" coords='192,0,216,24' name='superscript'/>
|
|
||||||
<area shape='rect' href="#" coords='168,0,192,24' name='subscript'/>
|
|
||||||
<area shape='rect' href="#" coords='144,0,168,24' name='strikethrough'/>
|
|
||||||
<area shape='rect' href="#" coords='144,48,168,72' name='createLink' cmdValue='promptUser' promptText='URL of link?' value='<a>'/>
|
|
||||||
<area shape='rect' href="#" coords='24,48,48,72' name='inserthorizontalrule'/>
|
|
||||||
<area shape='rect' href="#" coords='192,24,216,48' name='insertimage' cmdValue='promptUser' promptText='Image URI?' value='<img />'/>
|
|
||||||
<area shape='rect' href="#" coords='96,24,120,48' name='forecolor' cmdValue='promptUser' promptText='Text color?' value='fgcolor'/>
|
|
||||||
<area shape='rect' href="#" coords='240,24,264,48' name='outdent'/>
|
|
||||||
<area shape='rect' href="#" coords='216,24,240,48' name='indent'/>
|
|
||||||
<area shape='rect' href="#" coords='120,48,144,72' name='delete'/>
|
|
||||||
<area shape='rect' href="#" coords='168,48,192,72' name='unlink'/>
|
|
||||||
</map>
|
|
||||||
</div>
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 8.0 KiB |
@@ -1,16 +0,0 @@
|
|||||||
<div style="background-color:ButtonFace;">
|
|
||||||
<img src='/js/dveditor/core/toolbars/smallToolBar.png' usemap='#DVEditorMap' alt='' style='border-style:none' />
|
|
||||||
<map class="dvtoolbar" id='DVEditorMap' name='DVEditorMap'>
|
|
||||||
<area shape='rect' coords='72,0,96,24' title='Justify left' name='justifyleft'/>
|
|
||||||
<area shape='rect' coords='96,0,120,24' title='Justify center' name='justifycenter'/>
|
|
||||||
<area shape='rect' coords='120,0,144,24'title='Justify right' name='justifyright'/>
|
|
||||||
<area shape='rect' coords='144,0,168,24'title='Justifyfull' name='justifyfull'/>
|
|
||||||
<area shape='rect' coords='0,0,24,24' title='Bold' name='bold'/>
|
|
||||||
<area shape='rect' coords='24,0,48,24' title='Italic' name='italic'/>
|
|
||||||
<area shape='rect' coords='48,0,72,24' title='Under line' name='underline'/>
|
|
||||||
<!-- <area shape='rect' coords='168,0,192,24' name='cut'/>
|
|
||||||
<area shape='rect' coords='192,0,216,24' name='copy'/>
|
|
||||||
<area shape='rect' coords='216,0,240,24' name='paste'/>-->
|
|
||||||
<area shape='rect' coords='240,0,264,24' name='createLink' cmdValue='promptUser' promptText='ID_URL_OF_LINK' value='<a>'/>
|
|
||||||
</map>
|
|
||||||
</div>
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 4.6 KiB |
@@ -1,39 +0,0 @@
|
|||||||
<div style="background-color:ButtonFace;">
|
|
||||||
<img src='/js/dveditor/core/toolbars/toolbar2lines.png' usemap='#DVEditorMap' alt='' style='border-style:none' />
|
|
||||||
<map class="dvtoolbar" id='DVEditorMap' name='DVEditorMap'>
|
|
||||||
<area shape='rect' href="#" coords='312,0,336,24' name='fontname' cmdValue='promptUser' promptText='ID_FONT_NAME' value='font-family'/>
|
|
||||||
<area shape='rect' href="#" coords='264,24,288,48' name='inserthtml' cmdValue='promptUser' promptText='ID_INSERT_HTML' value='html'/>
|
|
||||||
<area shape='rect' href="#" coords='192,24,216,48' name='insertparagraph'/>
|
|
||||||
<area shape='rect' href="#" coords='120,24,144,48' name='insertorderedlist'/>
|
|
||||||
<area shape='rect' href="#" coords='144,24,168,48' name='insertunorderedlist'/>
|
|
||||||
<area shape='rect' href="#" coords='72,0,96,24' name='justifyleft'/>
|
|
||||||
<area shape='rect' href="#" coords='96,0,120,24' name='justifycenter'/>
|
|
||||||
<area shape='rect' href="#" coords='120,0,144,24' name='justifyright'/>
|
|
||||||
<area shape='rect' href="#" coords='144,0,168,24' name='justifyfull'/>
|
|
||||||
<area shape='rect' href="#" coords='0,0,24,24' name='bold'/>
|
|
||||||
<area shape='rect' href="#" coords='24,0,48,24' name='italic'/>
|
|
||||||
<area shape='rect' href="#" coords='48,0,72,24' name='underline'/>
|
|
||||||
<area shape='rect' href="#" coords='168,0,192,24' name='cut'/>
|
|
||||||
<area shape='rect' href="#" coords='192,0,216,24' name='copy'/>
|
|
||||||
<area shape='rect' href="#" coords='216,0,240,24' name='paste'/>
|
|
||||||
<area shape='rect' href="#" coords='264,0,288,24' name='undo'/>
|
|
||||||
<area shape='rect' href="#" coords='288,0,312,24' name='redo'/>
|
|
||||||
<area shape='rect' href="#" coords='360,24,384,48' name='backcolor' cmdValue='promptUser' promptText='ID_BACKGROUND_COLOR' value='bgcolor'/>
|
|
||||||
<area shape='rect' href="#" coords='384,0,408,24' name='hilitecolor' cmdValue='promptUser' promptText='ID_HILITE_COLOR' value='hilite'/>
|
|
||||||
<area shape='rect' href="#" coords='336,0,360,24' name='increasefontsize'/>
|
|
||||||
<area shape='rect' href="#" coords='336,24,360,48' name='decreasefontsize'/>
|
|
||||||
<area shape='rect' href="#" coords='384,24,408,48' name='formatblock' cmdValue='promptUser' promptText='ID_WHICH_BLOCK' value='formatblock'/>
|
|
||||||
<area shape='rect' href="#" coords='312,24,336,48' name='FontSize' cmdValue='promptUser' promptText='ID_FONT_SIZE' value='font-size'/>
|
|
||||||
<area shape='rect' href="#" coords='0,24,24,48' name='superscript'/>
|
|
||||||
<area shape='rect' href="#" coords='24,24,48,48' name='subscript'/>
|
|
||||||
<area shape='rect' href="#" coords='48,24,72,48' name='strikethrough'/>
|
|
||||||
<area shape='rect' href="#" coords='240,0,264,24' name='createLink' cmdValue='promptUser' promptText='ID_URL_OF_LINK' value='<a>'/>
|
|
||||||
<area shape='rect' href="#" coords='216,24,240,48' name='inserthorizontalrule'/>
|
|
||||||
<area shape='rect' href="#" coords='288,24,312,48' name='insertimage' cmdValue='promptUser' promptText='ID_IMAGE_URI' value='<img />'/>
|
|
||||||
<area shape='rect' href="#" coords='360,0,384,24' name='forecolor' cmdValue='promptUser' promptText='ID_FONT_COLOR' value='fgcolor'/>
|
|
||||||
<area shape='rect' href="#" coords='96,24,120,48' name='outdent'/>
|
|
||||||
<area shape='rect' href="#" coords='72,24,96,48' name='indent'/>
|
|
||||||
<area shape='rect' href="#" coords='168,24,192,48' name='delete'/>
|
|
||||||
<area shape='rect' href="#" coords='240,24,264,48' name='unlink'/>
|
|
||||||
</map>
|
|
||||||
</div>
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 7.7 KiB |
@@ -1,19 +0,0 @@
|
|||||||
Syntax highlighting with language autodetection.
|
|
||||||
|
|
||||||
URL: http://softwaremaniacs.org/soft/highlight/en/
|
|
||||||
|
|
||||||
Original author and current maintainer:
|
|
||||||
Ivan Sagalaev <Maniac@SoftwareManiacs.Org>
|
|
||||||
|
|
||||||
Contributors:
|
|
||||||
|
|
||||||
- Peter Leonov <gojpeg@gmail.com>
|
|
||||||
- Victor Karamzin <Victor.Karamzin@enterra-inc.com>
|
|
||||||
- Vsevolod Solovyov <vsevolod.solovyov@gmail.com>
|
|
||||||
- Anton Kovalyov <anton@kovalyov.net>
|
|
||||||
- Nikita Ledyaev <lenikita@yandex.ru>
|
|
||||||
- Konstantin Evdokimenko <qewerty@gmail.com>
|
|
||||||
- Dmitri Roudakov <dmitri@roudakov.ru>
|
|
||||||
- Yuri Ivanov <ivanov@supersoft.ru>
|
|
||||||
- Vladimir Ermakov <vooon341@mail.ru>
|
|
||||||
- Vladimir Gubarkov <xonixx@gmail.com>
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
Подсветка синтаксиса с автоопределением языка.
|
|
||||||
|
|
||||||
URL: http://softwaremaniacs.org/soft/highlight/
|
|
||||||
|
|
||||||
Первоначальный автор и ведущий проекта:
|
|
||||||
Иван Сагалаев <Maniac@SoftwareManiacs.Org>
|
|
||||||
|
|
||||||
Внесли свой вклад:
|
|
||||||
|
|
||||||
- Петр Леонов <gojpeg@gmail.com>
|
|
||||||
- Виктор Карамзин <Victor.Karamzin@enterra-inc.com>
|
|
||||||
- Всеволод Соловьёв <vsevolod.solovyov@gmail.com>
|
|
||||||
- Антон Ковалёв <anton@kovalyov.net>
|
|
||||||
- Никита Ледяев <lenikita@yandex.ru>
|
|
||||||
- Константин Евдокименко <qewerty@gmail.com>
|
|
||||||
- Дмитрий Рудаков <dmitri@roudakov.ru>
|
|
||||||
- Юрий Иванов <ivanov@supersoft.ru>
|
|
||||||
- Владимир Ермаков <vooon341@mail.ru>
|
|
||||||
- Владимир Губарьков <xonixx@gmail.com>
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
Copyright (c) 2006, Ivan Sagalaev
|
|
||||||
All rights reserved.
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are met:
|
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer.
|
|
||||||
* Redistributions in binary form must reproduce the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer in the
|
|
||||||
documentation and/or other materials provided with the distribution.
|
|
||||||
* Neither the name of highlight.js nor the names of its contributors
|
|
||||||
may be used to endorse or promote products derived from this software
|
|
||||||
without specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
|
|
||||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
||||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
|
|
||||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
||||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
||||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
||||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
<!-- saved from url=(0013)about:internet -->
|
|
||||||
<!-- ^^^ This is for IE not to show security warning for local files,
|
|
||||||
see http://www.microsoft.com/technet/prodtechnol/winxppro/maintain/sp2brows.mspx-->
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Highlighted code export
|
|
||||||
Copyright (c) Vladimir Gubarkov <xonixx@gmail.com>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Highlited code export</title>
|
|
||||||
<link rel="stylesheet" href="sample.css">
|
|
||||||
<style type="text/css">
|
|
||||||
#t1, #t2 { width: 100%;}
|
|
||||||
tr { vertical-align: top; }
|
|
||||||
address { margin-top: 4em; }
|
|
||||||
</style>
|
|
||||||
<script type="text/javascript" src="highlight.js"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script type="text/javascript">
|
|
||||||
injectScripts(ALL_LANGUAGES); // all
|
|
||||||
|
|
||||||
String.prototype.escape = function() {
|
|
||||||
return this.replace(/&/gm, '&').replace(/</gm, '<').replace(/>/gm, '>');
|
|
||||||
}
|
|
||||||
|
|
||||||
function doIt() {
|
|
||||||
var viewDiv = document.getElementById("highlight-view");
|
|
||||||
var t1 = document.getElementById("t1");
|
|
||||||
var t2 = document.getElementById("t2");
|
|
||||||
var selector = document.getElementById("langSelector");
|
|
||||||
var selectedLang = selector.options[selector.selectedIndex].value.toLowerCase();
|
|
||||||
initHighlighting.called = false;
|
|
||||||
if(selectedLang) {
|
|
||||||
viewDiv.innerHTML = '<pre><code class="'+selectedLang+'">'+t1.value.escape()+"</code></pre>";
|
|
||||||
initHighlighting(selectedLang);
|
|
||||||
} else { // try auto
|
|
||||||
viewDiv.innerHTML = '<pre><code>' + t1.value.escape() + "</code></pre>";
|
|
||||||
initHighlighting();
|
|
||||||
}
|
|
||||||
t2.value = viewDiv.innerHTML;
|
|
||||||
}
|
|
||||||
|
|
||||||
function copyToBuffer(textToCopy) {
|
|
||||||
if (window.clipboardData) { // IE
|
|
||||||
window.clipboardData.setData("Text", textToCopy);
|
|
||||||
} else if (window.netscape) { // FF
|
|
||||||
// from http://developer.mozilla.org/en/docs/Using_the_Clipboard
|
|
||||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
|
||||||
var gClipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"].getService(Components.interfaces.nsIClipboardHelper);
|
|
||||||
gClipboardHelper.copyString(textToCopy);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
var langSelectorHtml = '<label>Language <select id="langSelector">';
|
|
||||||
langSelectorHtml += '<option value="">Auto</option>';
|
|
||||||
for (var lang in LANGUAGES) {
|
|
||||||
langSelectorHtml += '<option value=\"'+lang+'\">'+lang.charAt(0).toUpperCase()+lang.substr(1)+'</option>';
|
|
||||||
}
|
|
||||||
langSelectorHtml += '</select></label>';
|
|
||||||
document.write(langSelectorHtml);
|
|
||||||
</script>
|
|
||||||
<table width="100%">
|
|
||||||
<tr>
|
|
||||||
<td><textarea rows="20" cols="50" id="t1"></textarea></td>
|
|
||||||
<td><textarea rows="20" cols="50" id="t2"></textarea></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Write a code snippet</td>
|
|
||||||
<td>Get HTML to paste anywhere (for actual styles and colors see sample.css)</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<table width="98%">
|
|
||||||
<tr>
|
|
||||||
<td><input type="button" value="Export →" onclick="doIt()"/></td>
|
|
||||||
<td align="right"><input type="button" value="Copy to buffer" onclick="copyToBuffer(document.getElementById('t2').value);"/></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<div id="highlight-view"></div>
|
|
||||||
<address>
|
|
||||||
Export script: <a href="mailto:xonixx@gmail.com">Vladimir Gubarkov</a><br>
|
|
||||||
Highlighting: <a href="http://softwaremaniacs.org/soft/highlight/">highlight.js</a>
|
|
||||||
</address>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,429 +0,0 @@
|
|||||||
/*
|
|
||||||
Syntax highlighting with language autodetection.
|
|
||||||
http://softwaremaniacs.org/soft/highlight/
|
|
||||||
*/
|
|
||||||
|
|
||||||
var DEFAULT_LANGUAGES = ['python', 'ruby', 'perl', 'php', 'css', 'xml', 'html', 'django', 'javascript', 'java', 'cpp', 'sql', 'smalltalk'];
|
|
||||||
var ALL_LANGUAGES = (DEFAULT_LANGUAGES.join(',') + ',' + ['1c', 'axapta', 'delphi', 'rib', 'rsl', 'vbscript'].join(',')).split(',');
|
|
||||||
var LANGUAGE_GROUPS = {
|
|
||||||
'xml': 'www',
|
|
||||||
'html': 'www',
|
|
||||||
'css': 'www',
|
|
||||||
'django': 'www',
|
|
||||||
'python': 'dynamic',
|
|
||||||
'perl': 'dynamic',
|
|
||||||
'php': 'dynamic',
|
|
||||||
'ruby': 'dynamic',
|
|
||||||
'cpp': 'static',
|
|
||||||
'java': 'static',
|
|
||||||
'delphi': 'static'
|
|
||||||
}
|
|
||||||
|
|
||||||
var IDENT_RE = '[a-zA-Z][a-zA-Z0-9_]*';
|
|
||||||
var UNDERSCORE_IDENT_RE = '[a-zA-Z_][a-zA-Z0-9_]*';
|
|
||||||
var NUMBER_RE = '\\b\\d+(\\.\\d+)?';
|
|
||||||
var C_NUMBER_RE = '\\b(0x[A-Za-z0-9]+|\\d+(\\.\\d+)?)';
|
|
||||||
|
|
||||||
// Common modes
|
|
||||||
var APOS_STRING_MODE = {
|
|
||||||
className: 'string',
|
|
||||||
begin: '\'', end: '\'',
|
|
||||||
illegal: '\\n',
|
|
||||||
contains: ['escape'],
|
|
||||||
relevance: 0
|
|
||||||
}
|
|
||||||
var QUOTE_STRING_MODE = {
|
|
||||||
className: 'string',
|
|
||||||
begin: '"', end: '"',
|
|
||||||
illegal: '\\n',
|
|
||||||
contains: ['escape'],
|
|
||||||
relevance: 0
|
|
||||||
}
|
|
||||||
var BACKSLASH_ESCAPE = {
|
|
||||||
className: 'escape',
|
|
||||||
begin: '\\\\.', end: '^',
|
|
||||||
relevance: 0
|
|
||||||
}
|
|
||||||
var C_LINE_COMMENT_MODE = {
|
|
||||||
className: 'comment',
|
|
||||||
begin: '//', end: '$',
|
|
||||||
relevance: 0
|
|
||||||
}
|
|
||||||
var C_BLOCK_COMMENT_MODE = {
|
|
||||||
className: 'comment',
|
|
||||||
begin: '/\\*', end: '\\*/'
|
|
||||||
}
|
|
||||||
var HASH_COMMENT_MODE = {
|
|
||||||
className: 'comment',
|
|
||||||
begin: '#', end: '$'
|
|
||||||
}
|
|
||||||
var C_NUMBER_MODE = {
|
|
||||||
className: 'number',
|
|
||||||
begin: C_NUMBER_RE, end: '^',
|
|
||||||
relevance: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
var LANGUAGES = {}
|
|
||||||
var selected_languages = {};
|
|
||||||
|
|
||||||
function Highlighter(language_name, value) {
|
|
||||||
function subMode(lexem) {
|
|
||||||
if (!modes[modes.length - 1].contains)
|
|
||||||
return null;
|
|
||||||
for (var i in modes[modes.length - 1].contains) {
|
|
||||||
var className = modes[modes.length - 1].contains[i];
|
|
||||||
for (var key in language.modes)
|
|
||||||
if (language.modes[key].className == className && language.modes[key].beginRe.test(lexem))
|
|
||||||
return language.modes[key];
|
|
||||||
}//for
|
|
||||||
return null;
|
|
||||||
}//subMode
|
|
||||||
|
|
||||||
function endOfMode(mode_index, lexem) {
|
|
||||||
if (modes[mode_index].end && modes[mode_index].endRe.test(lexem))
|
|
||||||
return 1;
|
|
||||||
if (modes[mode_index].endsWithParent) {
|
|
||||||
var level = endOfMode(mode_index - 1, lexem);
|
|
||||||
return level ? level + 1 : 0;
|
|
||||||
}//if
|
|
||||||
return 0;
|
|
||||||
}//endOfMode
|
|
||||||
|
|
||||||
function isIllegal(lexem) {
|
|
||||||
if (!modes[modes.length - 1].illegalRe)
|
|
||||||
return false;
|
|
||||||
return modes[modes.length - 1].illegalRe.test(lexem);
|
|
||||||
}//isIllegal
|
|
||||||
|
|
||||||
function eatModeChunk(value, index) {
|
|
||||||
if (!modes[modes.length - 1].terminators) {
|
|
||||||
var terminators = [];
|
|
||||||
|
|
||||||
if (modes[modes.length - 1].contains)
|
|
||||||
for (var key in language.modes) {
|
|
||||||
if (contains(modes[modes.length - 1].contains, language.modes[key].className) &&
|
|
||||||
!contains(terminators, language.modes[key].begin))
|
|
||||||
terminators[terminators.length] = language.modes[key].begin;
|
|
||||||
}//for
|
|
||||||
|
|
||||||
var mode_index = modes.length - 1;
|
|
||||||
do {
|
|
||||||
if (modes[mode_index].end && !contains(terminators, modes[mode_index].end))
|
|
||||||
terminators[terminators.length] = modes[mode_index].end;
|
|
||||||
mode_index--;
|
|
||||||
} while (modes[mode_index + 1].endsWithParent);
|
|
||||||
|
|
||||||
if (modes[modes.length - 1].illegal)
|
|
||||||
if (!contains(terminators, modes[modes.length - 1].illegal))
|
|
||||||
terminators[terminators.length] = modes[modes.length - 1].illegal;
|
|
||||||
|
|
||||||
var terminator_re = '(' + terminators[0];
|
|
||||||
for (var i = 0; i < terminators.length; i++)
|
|
||||||
terminator_re += '|' + terminators[i];
|
|
||||||
terminator_re += ')';
|
|
||||||
modes[modes.length - 1].terminators = langRe(language, terminator_re);
|
|
||||||
}//if
|
|
||||||
value = value.substr(index);
|
|
||||||
var match = modes[modes.length - 1].terminators.exec(value);
|
|
||||||
if (!match)
|
|
||||||
return [value, '', true];
|
|
||||||
if (match.index == 0)
|
|
||||||
return ['', match[0], false];
|
|
||||||
else
|
|
||||||
return [value.substr(0, match.index), match[0], false];
|
|
||||||
}//eatModeChunk
|
|
||||||
|
|
||||||
function escape(value) {
|
|
||||||
return value.replace(/&/gm, '&').replace(/</gm, '<').replace(/>/gm, '>');
|
|
||||||
}//escape
|
|
||||||
|
|
||||||
function keywordMatch(mode, match) {
|
|
||||||
var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0]
|
|
||||||
for (var className in mode.keywordGroups) {
|
|
||||||
var value = mode.keywordGroups[className].hasOwnProperty(match_str);
|
|
||||||
if (value)
|
|
||||||
return [className, value];
|
|
||||||
}//for
|
|
||||||
return false;
|
|
||||||
}//keywordMatch
|
|
||||||
|
|
||||||
function processKeywords(buffer) {
|
|
||||||
var mode = modes[modes.length - 1];
|
|
||||||
if (!mode.keywords || !mode.lexems)
|
|
||||||
return escape(buffer);
|
|
||||||
if (!mode.lexemsRe) {
|
|
||||||
var lexems = [];
|
|
||||||
for (var key in mode.lexems)
|
|
||||||
if (!contains(lexems, mode.lexems[key]))
|
|
||||||
lexems[lexems.length] = mode.lexems[key];
|
|
||||||
var lexems_re = '(' + lexems[0];
|
|
||||||
for (var i = 1; i < lexems.length; i++)
|
|
||||||
lexems_re += '|' + lexems[i];
|
|
||||||
lexems_re += ')';
|
|
||||||
mode.lexemsRe = langRe(language, lexems_re, true);
|
|
||||||
}//if
|
|
||||||
var result = '';
|
|
||||||
var last_index = 0;
|
|
||||||
mode.lexemsRe.lastIndex = 0;
|
|
||||||
var match = mode.lexemsRe.exec(buffer);
|
|
||||||
while (match) {
|
|
||||||
result += escape(buffer.substr(last_index, match.index - last_index));
|
|
||||||
keyword_match = keywordMatch(mode, match);
|
|
||||||
if (keyword_match) {
|
|
||||||
keyword_count += keyword_match[1];
|
|
||||||
result += '<span class="'+ keyword_match[0] +'">' + escape(match[0]) + '</span>';
|
|
||||||
} else {
|
|
||||||
result += escape(match[0]);
|
|
||||||
}//if
|
|
||||||
last_index = mode.lexemsRe.lastIndex;
|
|
||||||
match = mode.lexemsRe.exec(buffer);
|
|
||||||
}//while
|
|
||||||
result += escape(buffer.substr(last_index, buffer.length - last_index));
|
|
||||||
return result;
|
|
||||||
}//processKeywords
|
|
||||||
|
|
||||||
function processModeInfo(buffer, lexem, end) {
|
|
||||||
if (end) {
|
|
||||||
result += processKeywords(modes[modes.length - 1].buffer + buffer);
|
|
||||||
return;
|
|
||||||
}//if
|
|
||||||
if (isIllegal(lexem))
|
|
||||||
throw 'Illegal';
|
|
||||||
var new_mode = subMode(lexem);
|
|
||||||
if (new_mode) {
|
|
||||||
modes[modes.length - 1].buffer += buffer;
|
|
||||||
result += processKeywords(modes[modes.length - 1].buffer);
|
|
||||||
if (new_mode.excludeBegin) {
|
|
||||||
result += lexem + '<span class="' + new_mode.className + '">';
|
|
||||||
new_mode.buffer = '';
|
|
||||||
} else {
|
|
||||||
result += '<span class="' + new_mode.className + '">';
|
|
||||||
new_mode.buffer = lexem;
|
|
||||||
}//if
|
|
||||||
modes[modes.length] = new_mode;
|
|
||||||
relevance += modes[modes.length - 1].relevance != undefined ? modes[modes.length - 1].relevance : 1;
|
|
||||||
return;
|
|
||||||
}//if
|
|
||||||
var end_level = endOfMode(modes.length - 1, lexem);
|
|
||||||
if (end_level) {
|
|
||||||
modes[modes.length - 1].buffer += buffer;
|
|
||||||
if (modes[modes.length - 1].excludeEnd) {
|
|
||||||
result += processKeywords(modes[modes.length - 1].buffer) + '</span>' + lexem;
|
|
||||||
} else {
|
|
||||||
result += processKeywords(modes[modes.length - 1].buffer + lexem) + '</span>';
|
|
||||||
}
|
|
||||||
while (end_level > 1) {
|
|
||||||
result += '</span>';
|
|
||||||
end_level--;
|
|
||||||
modes.length--;
|
|
||||||
}//while
|
|
||||||
modes.length--;
|
|
||||||
modes[modes.length - 1].buffer = '';
|
|
||||||
return;
|
|
||||||
}//if
|
|
||||||
}//processModeInfo
|
|
||||||
|
|
||||||
function highlight(value) {
|
|
||||||
var index = 0;
|
|
||||||
language.defaultMode.buffer = '';
|
|
||||||
do {
|
|
||||||
var mode_info = eatModeChunk(value, index);
|
|
||||||
processModeInfo(mode_info[0], mode_info[1], mode_info[2]);
|
|
||||||
index += mode_info[0].length + mode_info[1].length;
|
|
||||||
} while (!mode_info[2]);
|
|
||||||
if(modes.length > 1)
|
|
||||||
throw 'Illegal';
|
|
||||||
}//highlight
|
|
||||||
|
|
||||||
this.language_name = language_name;
|
|
||||||
var language = LANGUAGES[language_name];
|
|
||||||
var modes = [language.defaultMode];
|
|
||||||
var relevance = 0;
|
|
||||||
var keyword_count = 0;
|
|
||||||
var result = '';
|
|
||||||
try {
|
|
||||||
highlight(value);
|
|
||||||
this.relevance = relevance;
|
|
||||||
this.keyword_count = keyword_count;
|
|
||||||
this.result = result;
|
|
||||||
} catch (e) {
|
|
||||||
if (e == 'Illegal') {
|
|
||||||
this.relevance = 0;
|
|
||||||
this.keyword_count = 0;
|
|
||||||
this.result = escape(value);
|
|
||||||
} else {
|
|
||||||
throw e;
|
|
||||||
}//if
|
|
||||||
}//try
|
|
||||||
}//Highlighter
|
|
||||||
|
|
||||||
function contains(array, item) {
|
|
||||||
if (!array)
|
|
||||||
return false;
|
|
||||||
for (var key in array)
|
|
||||||
if (array[key] == item)
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}//contains
|
|
||||||
|
|
||||||
function blockText(block) {
|
|
||||||
var result = '';
|
|
||||||
for (var i = 0; i < block.childNodes.length; i++)
|
|
||||||
if (block.childNodes[i].nodeType == 3)
|
|
||||||
result += block.childNodes[i].nodeValue;
|
|
||||||
else if (block.childNodes[i].nodeName == 'BR')
|
|
||||||
result += '\n';
|
|
||||||
else
|
|
||||||
throw 'Complex markup';
|
|
||||||
return result;
|
|
||||||
}//blockText
|
|
||||||
|
|
||||||
function initHighlight(block) {
|
|
||||||
if (block.className.search(/\bno\-highlight\b/) != -1)
|
|
||||||
return;
|
|
||||||
try {
|
|
||||||
blockText(block);
|
|
||||||
} catch (e) {
|
|
||||||
if (e == 'Complex markup')
|
|
||||||
return;
|
|
||||||
}//try
|
|
||||||
var classes = block.className.split(/\s+/);
|
|
||||||
for (var i = 0; i < classes.length; i++) {
|
|
||||||
if (LANGUAGES[classes[i]]) {
|
|
||||||
highlightLanguage(block, classes[i]);
|
|
||||||
return;
|
|
||||||
}//if
|
|
||||||
}//for
|
|
||||||
highlightAuto(block);
|
|
||||||
}//initHighlight
|
|
||||||
|
|
||||||
function highlightLanguage(block, language) {
|
|
||||||
var highlight = new Highlighter(language, blockText(block));
|
|
||||||
// See these 4 lines? This is IE's notion of "block.innerHTML = result". Love this browser :-/
|
|
||||||
var container = $dce('div');
|
|
||||||
container.innerHTML = '<pre><code class="' + block.className + '">' + highlight.result + '</code></pre>';
|
|
||||||
var environment = block.parentNode.parentNode;
|
|
||||||
environment.replaceChild(container.firstChild, block.parentNode);
|
|
||||||
}//highlightLanguage
|
|
||||||
|
|
||||||
function highlightAuto(block) {
|
|
||||||
var result = null;
|
|
||||||
var language = '';
|
|
||||||
var max_relevance = 2;
|
|
||||||
var relevance = 0;
|
|
||||||
var block_text = blockText(block);
|
|
||||||
for (var key in selected_languages) {
|
|
||||||
var highlight = new Highlighter(key, block_text);
|
|
||||||
relevance = highlight.keyword_count + highlight.relevance;
|
|
||||||
if (relevance > max_relevance) {
|
|
||||||
max_relevance = relevance;
|
|
||||||
result = highlight;
|
|
||||||
}//if
|
|
||||||
}//for
|
|
||||||
|
|
||||||
if(result) {
|
|
||||||
// See these 4 lines? This is IE's notion of "block.innerHTML = result". Love this browser :-/
|
|
||||||
var container = $dce('div');
|
|
||||||
container.innerHTML = '<pre><code class="' + result.language_name + '">' + result.result + '</code></pre>';
|
|
||||||
var environment = block.parentNode.parentNode;
|
|
||||||
environment.replaceChild(container.firstChild, block.parentNode);
|
|
||||||
}//if
|
|
||||||
}//highlightAuto
|
|
||||||
|
|
||||||
function langRe(language, value, global) {
|
|
||||||
var mode = 'm' + (language.case_insensitive ? 'i' : '') + (global ? 'g' : '');
|
|
||||||
return new RegExp(value, mode);
|
|
||||||
}//re
|
|
||||||
|
|
||||||
function compileRes() {
|
|
||||||
for (var i in LANGUAGES) {
|
|
||||||
var language = LANGUAGES[i];
|
|
||||||
for (var key in language.modes) {
|
|
||||||
if (language.modes[key].begin)
|
|
||||||
language.modes[key].beginRe = langRe(language, '^' + language.modes[key].begin);
|
|
||||||
if (language.modes[key].end)
|
|
||||||
language.modes[key].endRe = langRe(language, '^' + language.modes[key].end);
|
|
||||||
if (language.modes[key].illegal)
|
|
||||||
language.modes[key].illegalRe = langRe(language, '^(?:' + language.modes[key].illegal + ')');
|
|
||||||
language.defaultMode.illegalRe = langRe(language, '^(?:' + language.defaultMode.illegal + ')');
|
|
||||||
}//for
|
|
||||||
}//for
|
|
||||||
}//compileRes
|
|
||||||
|
|
||||||
function compileKeywords() {
|
|
||||||
|
|
||||||
function compileModeKeywords(mode) {
|
|
||||||
if (!mode.keywordGroups) {
|
|
||||||
for (var key in mode.keywords) {
|
|
||||||
if (mode.keywords[key] instanceof Object)
|
|
||||||
mode.keywordGroups = mode.keywords;
|
|
||||||
else
|
|
||||||
mode.keywordGroups = {'keyword': mode.keywords};
|
|
||||||
break;
|
|
||||||
}//for
|
|
||||||
}//if
|
|
||||||
}//compileModeKeywords
|
|
||||||
|
|
||||||
for (var i in LANGUAGES) {
|
|
||||||
var language = LANGUAGES[i];
|
|
||||||
compileModeKeywords(language.defaultMode);
|
|
||||||
for (var key in language.modes) {
|
|
||||||
compileModeKeywords(language.modes[key]);
|
|
||||||
}//for
|
|
||||||
}//for
|
|
||||||
}//compileKeywords
|
|
||||||
|
|
||||||
function initHighlighting() {
|
|
||||||
if (initHighlighting.called)
|
|
||||||
return;
|
|
||||||
initHighlighting.called = true;
|
|
||||||
compileRes();
|
|
||||||
compileKeywords();
|
|
||||||
if (arguments.length) {
|
|
||||||
for (var i = 0; i < arguments.length; i++) {
|
|
||||||
if (LANGUAGES[arguments[i]]) {
|
|
||||||
selected_languages[arguments[i]] = LANGUAGES[arguments[i]];
|
|
||||||
}//if
|
|
||||||
}//for
|
|
||||||
} else
|
|
||||||
selected_languages = LANGUAGES;
|
|
||||||
var pres = document.getElementsByTagName('pre');
|
|
||||||
for (var i = 0; i < pres.length; i++) {
|
|
||||||
if (pres[i].firstChild && pres[i].firstChild.nodeName == 'CODE')
|
|
||||||
initHighlight(pres[i].firstChild);
|
|
||||||
}//for
|
|
||||||
}//initHighlighting
|
|
||||||
|
|
||||||
function injectScripts(languages) {
|
|
||||||
var scripts = document.getElementsByTagName('SCRIPT');
|
|
||||||
for (var i=0; i < scripts.length; i++) {
|
|
||||||
if (scripts[i].src.match(/highlight\.js(\?.+)?$/)) {
|
|
||||||
var path = scripts[i].src.replace(/highlight\.js(\?.+)?$/, '');
|
|
||||||
break;
|
|
||||||
}//if
|
|
||||||
}//for
|
|
||||||
if (languages.length == 0) {
|
|
||||||
languages = DEFAULT_LANGUAGES;
|
|
||||||
}//if
|
|
||||||
var injected = {}
|
|
||||||
for (var i=0; i < languages.length; i++) {
|
|
||||||
var filename = LANGUAGE_GROUPS[languages[i]] ? LANGUAGE_GROUPS[languages[i]] : languages[i];
|
|
||||||
if (!injected[filename]) {
|
|
||||||
document.write('<script type="text/javascript" src="' + path + 'languages/' + filename + '.js"></script>');
|
|
||||||
injected[filename] = true;
|
|
||||||
}//if
|
|
||||||
}//for
|
|
||||||
}//injectScripts
|
|
||||||
|
|
||||||
function initHighlightingOnLoad() {
|
|
||||||
var original_arguments = arguments;
|
|
||||||
injectScripts(arguments);
|
|
||||||
var handler = function(){initHighlighting.apply(null, original_arguments)};
|
|
||||||
if (window.addEventListener) {
|
|
||||||
window.addEventListener('DOMContentLoaded', handler, false);
|
|
||||||
window.addEventListener('load', handler, false);
|
|
||||||
} else if (window.attachEvent)
|
|
||||||
window.attachEvent('onload', handler);
|
|
||||||
else
|
|
||||||
window.onload = handler;
|
|
||||||
}//initHighlightingOnLoad
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
var IDENT_RE_RU = '[a-zA-Zа-яА-Я][a-zA-Z0-9_а-яА-Я]*';
|
|
||||||
var NUMBER_RE = '\\b\\d+(\\.\\d+)?';
|
|
||||||
|
|
||||||
var OneS_KEYWORDS = {'процедура':1,'функция':1,'экспорт':1,'перем':1,'конецфункции':1,'конецпроцедуры':1,'если':1,'тогда':1,'иначе':1,'иначеесли':1,'конецесли':1,'попытка':1,'исключение':1,'конецпопытки':1,'ложь':1,'истина':1,'неопределено':1,'и':1,'или':1,'не':1,'null':1,'для':1,'каждого':1,'из':1,'по':1,'цикл':1,'конеццикла':1};
|
|
||||||
|
|
||||||
LANGUAGES['1c'] = {
|
|
||||||
defaultMode: {
|
|
||||||
lexems: [IDENT_RE_RU],
|
|
||||||
contains: ['comment', 'string', 'function', 'preprocessor', 'number'],
|
|
||||||
keywords: OneS_KEYWORDS
|
|
||||||
},
|
|
||||||
case_insensitive: true,
|
|
||||||
modes: [
|
|
||||||
C_LINE_COMMENT_MODE,
|
|
||||||
{
|
|
||||||
className: 'string',
|
|
||||||
begin: '"', end: '"',
|
|
||||||
contains: ['dquote'],
|
|
||||||
relevance: 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'string',
|
|
||||||
begin: '"', end: '$',
|
|
||||||
contains: ['dquote']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'string',
|
|
||||||
begin: '\\|', end: '$',
|
|
||||||
contains: ['dquote']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'string',
|
|
||||||
begin: '\\|', end: '"',
|
|
||||||
contains: ['dquote']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'dquote',
|
|
||||||
begin: '""', end: '^'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'number',
|
|
||||||
begin: NUMBER_RE, end: '^',
|
|
||||||
relevance: 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'title',
|
|
||||||
lexems: [IDENT_RE_RU],
|
|
||||||
begin: IDENT_RE_RU, end: '^'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'params',
|
|
||||||
begin: '\\(', end: '\\)',
|
|
||||||
lexems: [IDENT_RE_RU],
|
|
||||||
keywords: {'знач':1},
|
|
||||||
contains: ['string']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'function',
|
|
||||||
begin: '(процедура|функция)', end: '$',
|
|
||||||
lexems: [IDENT_RE_RU],
|
|
||||||
keywords: {'процедура': 1, 'экспорт':1, 'функция': 1},
|
|
||||||
contains: ['title','tail','comment'],
|
|
||||||
relevance: 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'tail',
|
|
||||||
begin: '^', endsWithParent: true,
|
|
||||||
lexems: [IDENT_RE_RU],
|
|
||||||
contains: ['params', 'export']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'export',
|
|
||||||
begin: 'экспорт', endsWithParent: true,
|
|
||||||
lexems: [IDENT_RE_RU],
|
|
||||||
keywords: {'экспорт': 1},
|
|
||||||
contains: ['comment']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'preprocessor',
|
|
||||||
begin: '#', end: '$',
|
|
||||||
lexems: [IDENT_RE_RU]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};//1c
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
/*
|
|
||||||
|
|
||||||
Axapta definition (с) Dmitri Roudakov <dmitri@roudakov.ru>
|
|
||||||
|
|
||||||
*/
|
|
||||||
LANGUAGES.axapta = {
|
|
||||||
defaultMode: {
|
|
||||||
lexems: [UNDERSCORE_IDENT_RE],
|
|
||||||
contains: ['comment', 'string', 'class', 'number', 'preprocessor'],
|
|
||||||
keywords: {'false': 1, 'int': 1, 'abstract': 1, 'private': 1, 'char': 1, 'interface': 1, 'boolean': 1, 'static': 1, 'null': 1, 'if': 1, 'for': 1, 'true': 1, 'while': 1, 'long': 1, 'throw': 1, 'finally': 1, 'protected': 1, 'extends': 1, 'final': 1, 'implements': 1, 'return': 1, 'void': 1, 'enum': 1, 'else': 1, 'break': 1, 'new': 1, 'catch': 1, 'byte': 1, 'super': 1, 'class': 1, 'case': 1, 'short': 1, 'default': 1, 'double': 1, 'public': 1, 'try': 1, 'this': 1, 'switch': 1, 'continue': 1,
|
|
||||||
'reverse':1, 'firstfast':1,'firstonly':1,'forupdate':1,'nofetch':1, 'sum':1, 'avg':1, 'minof':1, 'maxof':1, 'count':1, 'order':1, 'group':1, 'by':1, 'asc':1, 'desc':1, 'index':1, 'hint':1, 'like':1,
|
|
||||||
'dispaly':1, 'edit':1, 'client':1, 'server':1, 'ttsbegin':1, 'ttscommit':1,
|
|
||||||
'str':1, 'real':1, 'date':1, 'container':1, 'anytype':1, 'common':1, 'div':1,'mod':1
|
|
||||||
}
|
|
||||||
},
|
|
||||||
modes: [
|
|
||||||
{
|
|
||||||
className: 'class',
|
|
||||||
lexems: [UNDERSCORE_IDENT_RE],
|
|
||||||
begin: '(class |interface )', end: '{',
|
|
||||||
illegal: ':',
|
|
||||||
keywords: {'class': 1, 'interface': 1},
|
|
||||||
contains: ['inheritance', 'title']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'inheritance',
|
|
||||||
begin: '(implements|extends)', end: '^',
|
|
||||||
lexems: [IDENT_RE],
|
|
||||||
keywords: {'extends': 1, 'implements': 1},
|
|
||||||
relevance: 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'title',
|
|
||||||
begin: UNDERSCORE_IDENT_RE, end: '^'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'params',
|
|
||||||
begin: '\\(', end: '\\)',
|
|
||||||
contains: ['string', 'annotation']
|
|
||||||
},
|
|
||||||
C_NUMBER_MODE,
|
|
||||||
APOS_STRING_MODE,
|
|
||||||
QUOTE_STRING_MODE,
|
|
||||||
BACKSLASH_ESCAPE,
|
|
||||||
C_LINE_COMMENT_MODE,
|
|
||||||
C_BLOCK_COMMENT_MODE,
|
|
||||||
{
|
|
||||||
className: 'preprocessor',
|
|
||||||
begin: '#', end: '$'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};//axapta
|
|
||||||
@@ -1,319 +0,0 @@
|
|||||||
LANGUAGES.python = {
|
|
||||||
defaultMode: {
|
|
||||||
lexems: [UNDERSCORE_IDENT_RE],
|
|
||||||
illegal: '(</|->)',
|
|
||||||
contains: ['comment', 'string', 'function', 'class', 'number', 'decorator'],
|
|
||||||
keywords: {'and': 1, 'elif': 1, 'is': 1, 'global': 1, 'as': 1, 'in': 1, 'if': 1, 'from': 1, 'raise': 1, 'for': 1, 'except': 1, 'finally': 1, 'print': 1, 'import': 1, 'pass': 1, 'None': 1, 'return': 1, 'exec': 1, 'else': 1, 'break': 1, 'not': 1, 'with': 1, 'class': 1, 'assert': 1, 'yield': 1, 'try': 1, 'while': 1, 'continue': 1, 'del': 1, 'or': 1, 'def': 1, 'lambda': 1}
|
|
||||||
},
|
|
||||||
modes: [
|
|
||||||
{
|
|
||||||
className: 'function',
|
|
||||||
lexems: [UNDERSCORE_IDENT_RE],
|
|
||||||
begin: '\\bdef ', end: ':',
|
|
||||||
illegal: '$',
|
|
||||||
keywords: {'def': 1},
|
|
||||||
contains: ['title', 'params'],
|
|
||||||
relevance: 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'class',
|
|
||||||
lexems: [UNDERSCORE_IDENT_RE],
|
|
||||||
begin: '\\bclass ', end: ':',
|
|
||||||
illegal: '[${]',
|
|
||||||
keywords: {'class': 1},
|
|
||||||
contains: ['title', 'params',],
|
|
||||||
relevance: 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'title',
|
|
||||||
begin: UNDERSCORE_IDENT_RE, end: '^'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'params',
|
|
||||||
begin: '\\(', end: '\\)',
|
|
||||||
contains: ['string']
|
|
||||||
},
|
|
||||||
HASH_COMMENT_MODE,
|
|
||||||
C_NUMBER_MODE,
|
|
||||||
{
|
|
||||||
className: 'string',
|
|
||||||
begin: '\'\'\'', end: '\'\'\'',
|
|
||||||
relevance: 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'string',
|
|
||||||
begin: '"""', end: '"""',
|
|
||||||
relevance: 10
|
|
||||||
},
|
|
||||||
APOS_STRING_MODE,
|
|
||||||
QUOTE_STRING_MODE,
|
|
||||||
BACKSLASH_ESCAPE,
|
|
||||||
{
|
|
||||||
className: 'string',
|
|
||||||
begin: 'r\'', end: '\'',
|
|
||||||
relevance: 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'string',
|
|
||||||
begin: 'r"', end: '"',
|
|
||||||
relevance: 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'string',
|
|
||||||
begin: 'u\'', end: '(^|[^\\\\])\'',
|
|
||||||
relevance: 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'string',
|
|
||||||
begin: 'u"', end: '(^|[^\\\\])"',
|
|
||||||
relevance: 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'string',
|
|
||||||
begin: 'ur\'', end: '\'',
|
|
||||||
relevance: 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'string',
|
|
||||||
begin: 'ur"', end: '"',
|
|
||||||
relevance: 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'decorator',
|
|
||||||
begin: '@', end: '$'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};//python
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
Perl definition (с) Peter Leonov <gojpeg@gmail.com>
|
|
||||||
Test you perl code here: http://wiki.cmsbuilder.ru/Highlite_test
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
var PERL_NUMBER_RE = '(\\b0[0-7]+)|(\\b0x[0-9a-fA-F]+)|(\\b[1-9]\\d*(\\.\\d+)?)|0\\b';
|
|
||||||
var PERL_KEYWORDS = {'getpwent': 1, 'getservent': 1, 'quotemeta': 1, 'msgrcv': 1, 'scalar': 1, 'kill': 1, 'dbmclose': 1, 'undef': 1, 'lc': 1, 'ma': 1, 'syswrite': 1, 'tr': 1, 'send': 1, 'umask': 1, 'sysopen': 1, 'shmwrite': 1, 'vec': 1, 'qx': 1, 'utime': 1, 'local': 1, 'oct': 1, 'semctl': 1, 'localtime': 1, 'readpipe': 1, 'do': 1, 'return': 1, 'format': 1, 'read': 1, 'sprintf': 1, 'dbmopen': 1, 'pop': 1, 'getpgrp': 1, 'not': 1, 'getpwnam': 1, 'rewinddir': 1, 'qq': 1, 'fileno': 1, 'qw': 1, 'endprotoent': 1, 'wait': 1, 'sethostent': 1, 'bless': 1, 's': 1, 'opendir': 1, 'continue': 1, 'each': 1, 'sleep': 1, 'endgrent': 1, 'shutdown': 1, 'dump': 1, 'chomp': 1, 'connect': 1, 'getsockname': 1, 'die': 1, 'socketpair': 1, 'close': 1, 'flock': 1, 'exists': 1, 'index': 1, 'shmget': 1, 'sub': 1, 'for': 1, 'endpwent': 1, 'redo': 1, 'lstat': 1, 'msgctl': 1, 'setpgrp': 1, 'abs': 1, 'exit': 1, 'select': 1, 'print': 1, 'ref': 1, 'gethostbyaddr': 1, 'unshift': 1, 'fcntl': 1, 'syscall': 1, 'goto': 1, 'getnetbyaddr': 1, 'join': 1, 'gmtime': 1, 'symlink': 1, 'semget': 1, 'splice': 1, 'x': 1, 'getpeername': 1, 'recv': 1, 'log': 1, 'setsockopt': 1, 'cos': 1, 'last': 1, 'reverse': 1, 'gethostbyname': 1, 'getgrnam': 1, 'study': 1, 'formline': 1, 'endhostent': 1, 'times': 1, 'chop': 1, 'length': 1, 'gethostent': 1, 'getnetent': 1, 'pack': 1, 'getprotoent': 1, 'getservbyname': 1, 'rand': 1, 'mkdir': 1, 'pos': 1, 'chmod': 1, 'y': 1, 'substr': 1, 'endnetent': 1, 'printf': 1, 'next': 1, 'open': 1, 'msgsnd': 1, 'readdir': 1, 'use': 1, 'unlink': 1, 'getsockopt': 1, 'getpriority': 1, 'rindex': 1, 'wantarray': 1, 'hex': 1, 'system': 1, 'getservbyport': 1, 'endservent': 1, 'int': 1, 'chr': 1, 'untie': 1, 'rmdir': 1, 'prototype': 1, 'tell': 1, 'listen': 1, 'fork': 1, 'shmread': 1, 'ucfirst': 1, 'setprotoent': 1, 'else': 1, 'sysseek': 1, 'link': 1, 'getgrgid': 1, 'shmctl': 1, 'waitpid': 1, 'unpack': 1, 'getnetbyname': 1, 'reset': 1, 'chdir': 1, 'grep': 1, 'split': 1, 'require': 1, 'caller': 1, 'lcfirst': 1, 'until': 1, 'warn': 1, 'while': 1, 'values': 1, 'shift': 1, 'telldir': 1, 'getpwuid': 1, 'my': 1, 'getprotobynumber': 1, 'delete': 1, 'and': 1, 'sort': 1, 'uc': 1, 'defined': 1, 'srand': 1, 'accept': 1, 'package': 1, 'seekdir': 1, 'getprotobyname': 1, 'semop': 1, 'our': 1, 'rename': 1, 'seek': 1, 'if': 1, 'q': 1, 'chroot': 1, 'sysread': 1, 'setpwent': 1, 'no': 1, 'crypt': 1, 'getc': 1, 'chown': 1, 'sqrt': 1, 'write': 1, 'setnetent': 1, 'setpriority': 1, 'foreach': 1, 'tie': 1, 'sin': 1, 'msgget': 1, 'map': 1, 'stat': 1, 'getlogin': 1, 'unless': 1, 'elsif': 1, 'truncate': 1, 'exec': 1, 'keys': 1, 'glob': 1, 'tied': 1, 'closedir': 1, 'ioctl': 1, 'socket': 1, 'readlink': 1, 'eval': 1, 'xor': 1, 'readline': 1, 'binmode': 1, 'setservent': 1, 'eof': 1, 'ord': 1, 'bind': 1, 'alarm': 1, 'pipe': 1, 'atan2': 1, 'getgrent': 1, 'exp': 1, 'time': 1, 'push': 1, 'setgrent': 1, 'gt': 1, 'lt': 1, 'or': 1, 'ne': 1, 'm': 1};
|
|
||||||
|
|
||||||
LANGUAGES.perl = {
|
|
||||||
defaultMode: {
|
|
||||||
lexems: [IDENT_RE],
|
|
||||||
contains: ['comment', 'string', 'number', 'regexp', 'sub', 'variable', 'operator', 'pod', 'identifier'],
|
|
||||||
keywords: PERL_KEYWORDS
|
|
||||||
},
|
|
||||||
modes: [
|
|
||||||
|
|
||||||
// variables
|
|
||||||
{
|
|
||||||
className: 'variable',
|
|
||||||
begin: '\\$\\d', end: '^',
|
|
||||||
relevance: 5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'variable',
|
|
||||||
begin: '[\\$\\%\\@\\*](\\^\\w\\b|#\\w+|[^\\s\\w{]|{\\w+}|\\w+)', end: '^'
|
|
||||||
},
|
|
||||||
|
|
||||||
// numbers and strings
|
|
||||||
{
|
|
||||||
className: 'number',
|
|
||||||
begin: PERL_NUMBER_RE, end: '^',
|
|
||||||
relevance: 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'string',
|
|
||||||
begin: 'q[qwxr]?\\(', end: '[^\\\\]\\)',
|
|
||||||
relevance: 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'string',
|
|
||||||
begin: 'qw\\s+q', end: 'q',
|
|
||||||
relevance: 10
|
|
||||||
},
|
|
||||||
APOS_STRING_MODE,
|
|
||||||
QUOTE_STRING_MODE,
|
|
||||||
BACKSLASH_ESCAPE,
|
|
||||||
{
|
|
||||||
className: 'string',
|
|
||||||
begin: '`', end: '`',
|
|
||||||
contains: ['escape']
|
|
||||||
},
|
|
||||||
|
|
||||||
// regexps
|
|
||||||
{
|
|
||||||
className: 'regexp',
|
|
||||||
begin: '(s|tr|y)(/.*?[^\\\\]/|//)(.*?[^\\\\]/|/)[a-z]*', end: '^',
|
|
||||||
relevance: 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'regexp',
|
|
||||||
begin: '(m|qr)?//[cgimosxe]*', end: '^',
|
|
||||||
relevance: 0 // allows empty "//" which is a common comment delimiter in other languages
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'regexp',
|
|
||||||
begin: '(m|qr)?/.*?[^\\\\/]/[cgimosxe]*', end: '^'
|
|
||||||
},
|
|
||||||
|
|
||||||
// bareword context
|
|
||||||
{
|
|
||||||
className: 'string',
|
|
||||||
begin: '{\\w+}', end: '^',
|
|
||||||
relevance: 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'string',
|
|
||||||
begin: '\-?\\w+\\s*\\=\\>', end: '^',
|
|
||||||
relevance: 5
|
|
||||||
},
|
|
||||||
|
|
||||||
// subroutines
|
|
||||||
{
|
|
||||||
className: 'sub',
|
|
||||||
begin: '\\bsub\\b', end: '(\\s*\\(.*?\\))?[;{]',
|
|
||||||
lexems: [IDENT_RE],
|
|
||||||
keywords: {'sub':1},
|
|
||||||
contains: ['identifier'],
|
|
||||||
relevance: 10
|
|
||||||
},
|
|
||||||
|
|
||||||
// operators
|
|
||||||
{
|
|
||||||
className: 'operator',
|
|
||||||
begin: '-\\w\\b', end: '^'
|
|
||||||
},
|
|
||||||
|
|
||||||
// comments
|
|
||||||
HASH_COMMENT_MODE,
|
|
||||||
|
|
||||||
// pod
|
|
||||||
{
|
|
||||||
className: 'pod',
|
|
||||||
begin: '\\=\\w', end: '\\=cut'
|
|
||||||
},
|
|
||||||
|
|
||||||
// identifiers
|
|
||||||
{
|
|
||||||
className: 'identifier',
|
|
||||||
begin: '\\b[a-zA-Z]\\w*\\b', end: '^',
|
|
||||||
lexems: [IDENT_RE],
|
|
||||||
keywords: PERL_KEYWORDS,
|
|
||||||
relevance: 0
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};//perl
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
PHP5 definition (с) Victor Karamzin <Victor.Karamzin@enterra-inc.com>
|
|
||||||
|
|
||||||
*/
|
|
||||||
PHP5_KEYWORDS = {'and': 1, 'include_once': 1, 'list': 1, 'abstract': 1, 'global': 1, 'private': 1, 'echo': 1, 'interface': 1, 'as': 1, 'static': 1, 'endswitch': 1, 'array': 1, 'null': 1, 'if': 1, 'endwhile': 1, 'or': 1, 'const': 1, 'for': 1, 'endforeach': 1, 'self': 1, 'var': 1, 'while': 1, 'isset': 1, 'public': 1, 'protected': 1, 'exit': 1, 'foreach': 1, 'throw': 1, 'elseif': 1, 'extends': 1, 'include': 1, '__FILE__': 1, 'empty': 1, 'require_once': 1, 'function': 1, 'do': 1, 'xor': 1, 'return': 1, 'implements': 1, 'parent': 1, 'clone': 1, 'use': 1, '__CLASS__': 1, '__LINE__': 1, 'else': 1, 'break': 1, 'print': 1, 'eval': 1, 'new': 1, 'catch': 1, '__METHOD__': 1, 'class': 1, 'case': 1, 'exception': 1, 'php_user_filter': 1, 'default': 1, 'die': 1, 'require': 1, '__FUNCTION__': 1, 'enddeclare': 1, 'final': 1, 'try': 1, 'this': 1, 'switch': 1, 'continue': 1, 'endfor': 1, 'endif': 1, 'declare': 1, 'unset': 1};
|
|
||||||
|
|
||||||
PHP_IDENTIFIER_RE = '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*';
|
|
||||||
|
|
||||||
LANGUAGES.php = {
|
|
||||||
defaultMode: {
|
|
||||||
lexems: [IDENT_RE],
|
|
||||||
contains: ['comment', 'number', 'string', 'variable'],
|
|
||||||
keywords: PHP5_KEYWORDS
|
|
||||||
},
|
|
||||||
case_insensitive: true,
|
|
||||||
modes: [
|
|
||||||
C_LINE_COMMENT_MODE,
|
|
||||||
HASH_COMMENT_MODE,
|
|
||||||
{
|
|
||||||
className: 'comment',
|
|
||||||
begin: '/\\*', end: '\\*/',
|
|
||||||
contains: ['phpdoc']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'phpdoc',
|
|
||||||
begin: '\\s@[A-Za-z]+', end: '^',
|
|
||||||
relevance: 10
|
|
||||||
},
|
|
||||||
C_NUMBER_MODE,
|
|
||||||
APOS_STRING_MODE,
|
|
||||||
QUOTE_STRING_MODE,
|
|
||||||
BACKSLASH_ESCAPE,
|
|
||||||
{
|
|
||||||
className: 'variable',
|
|
||||||
begin: '\\$' + PHP_IDENTIFIER_RE, end: '^'
|
|
||||||
},
|
|
||||||
]
|
|
||||||
};//php
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
Ruby definition (с) Anton Kovalyov <anton@kovalyov.net>
|
|
||||||
|
|
||||||
*/
|
|
||||||
LANGUAGES.ruby = {
|
|
||||||
defaultMode: {
|
|
||||||
lexems: [UNDERSCORE_IDENT_RE],
|
|
||||||
contains: ['comment', 'string', 'class', 'function', 'symbol'],
|
|
||||||
keywords: {'and': 1, 'false': 1, 'then': 1, 'defined': 1, 'module': 1, 'in': 1, 'return': 1, 'redo': 1, 'if': 1, 'BEGIN': 1, 'retry': 1, 'end': 1, 'for': 1, 'true': 1, 'self': 1, 'when': 1, 'next': 1, 'until': 1, 'do': 1, 'begin': 1, 'unless': 1, 'END': 1, 'rescue': 1, 'nil': 1, 'else': 1, 'break': 1, 'undef': 1, 'not': 1, 'super': 1, 'class': 1, 'case': 1, 'require': 1, 'yield': 1, 'alias': 1, 'while': 1, 'ensure': 1, 'elsif': 1, 'or': 1, 'def': 1}
|
|
||||||
},
|
|
||||||
modes: [
|
|
||||||
HASH_COMMENT_MODE,
|
|
||||||
{
|
|
||||||
className: 'comment',
|
|
||||||
begin: '^\\=begin', end: '^\\=end',
|
|
||||||
relevance: 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'string',
|
|
||||||
begin: '\'', end: '(^|[^\\\\])\'',
|
|
||||||
contains: ['subst'],
|
|
||||||
relevance: 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'string',
|
|
||||||
begin: '"', end: '(^|[^\\\\])"',
|
|
||||||
contains: ['subst'],
|
|
||||||
relevance: 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'subst',
|
|
||||||
begin: '#\\{', end: '\}',
|
|
||||||
contains: ['string'],
|
|
||||||
relevance: 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'function',
|
|
||||||
lexems: [IDENT_RE],
|
|
||||||
begin: '\\bdef ', end: '$',
|
|
||||||
illegal: '[{\\:]',
|
|
||||||
keywords: {'def': 1},
|
|
||||||
contains: ['title', 'comment'],
|
|
||||||
relevance: 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'class',
|
|
||||||
lexems: [IDENT_RE],
|
|
||||||
begin: '\\bclass ', end: '$',
|
|
||||||
illegal: '[{\\:]',
|
|
||||||
contains: ['title', 'comment'],
|
|
||||||
keywords: {'class': 1}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'symbol',
|
|
||||||
begin: ':' + UNDERSCORE_IDENT_RE, end: '^'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'title',
|
|
||||||
begin: IDENT_RE + "\\s*<\\s*" + IDENT_RE, end: '^'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'title',
|
|
||||||
begin: 'self.' + IDENT_RE, end: '^'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'title',
|
|
||||||
begin: IDENT_RE, end: '^'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};//ruby
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
LANGUAGES.javascript = {
|
|
||||||
defaultMode: {
|
|
||||||
lexems: [UNDERSCORE_IDENT_RE],
|
|
||||||
contains: ['string', 'comment', 'number', 'regexp', 'function'],
|
|
||||||
keywords: {
|
|
||||||
'keyword': {'in': 1, 'if': 1, 'for': 1, 'while': 1, 'finally': 1, 'var': 1, 'new': 1, 'function': 1, 'do': 1, 'return': 1, 'void': 1, 'else': 1, 'break': 1, 'catch': 1, 'instanceof': 1, 'with': 1, 'throw': 1, 'case': 1, 'default': 1, 'try': 1, 'this': 1, 'switch': 1, 'continue': 1, 'typeof': 1, 'delete': 1},
|
|
||||||
'literal': {'true': 1, 'false': 1, 'null': 1}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
modes: [
|
|
||||||
C_LINE_COMMENT_MODE,
|
|
||||||
C_BLOCK_COMMENT_MODE,
|
|
||||||
C_NUMBER_MODE,
|
|
||||||
APOS_STRING_MODE,
|
|
||||||
QUOTE_STRING_MODE,
|
|
||||||
BACKSLASH_ESCAPE,
|
|
||||||
{
|
|
||||||
className: 'regexp',
|
|
||||||
begin: '/.*?[^\\\\/]/[gim]*', end: '^'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'function',
|
|
||||||
begin: 'function ', end: '{',
|
|
||||||
lexems: [UNDERSCORE_IDENT_RE],
|
|
||||||
keywords: {'function': 1},
|
|
||||||
contains: ['title', 'params']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'title',
|
|
||||||
begin: UNDERSCORE_IDENT_RE, end: '^'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'params',
|
|
||||||
begin: '\\(', end: '\\)',
|
|
||||||
contains: ['string', 'comment']
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};//javascript
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
/*
|
|
||||||
|
|
||||||
RenderMan Interface Bytestream (c) Konstantin Evdokimenko <qewerty@gmail.com>
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
LANGUAGES.rib = {
|
|
||||||
defaultMode: {
|
|
||||||
lexems: [UNDERSCORE_IDENT_RE],
|
|
||||||
illegal: '</',
|
|
||||||
contains: ['comment', 'string', 'number'],
|
|
||||||
keywords: {
|
|
||||||
'keyword': {'ReadArchive': 1, 'FrameBegin': 1, 'FrameEnd': 1, 'WorldBegin': 1, 'WorldEnd': 1,
|
|
||||||
'Attribute': 1, 'Display': 1, 'Option': 1, 'Format': 1, 'ShadingRate': 1,
|
|
||||||
'PixelFilter': 1, 'PixelSamples': 1, 'Projection': 1, 'Scale': 1, 'ConcatTransform': 1,
|
|
||||||
'Transform': 1, 'Translate': 1, 'Rotate': 1,
|
|
||||||
'Surface': 1, 'Displacement': 1, 'Atmosphere': 1,
|
|
||||||
'Interior': 1, 'Exterior': 1},
|
|
||||||
'commands': {'WorldBegin': 1, 'WorldEnd': 1, 'FrameBegin': 1, 'FrameEnd': 1,
|
|
||||||
'ReadArchive': 1, 'ShadingRate': 1}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
modes: [
|
|
||||||
HASH_COMMENT_MODE,
|
|
||||||
C_NUMBER_MODE,
|
|
||||||
APOS_STRING_MODE,
|
|
||||||
QUOTE_STRING_MODE,
|
|
||||||
BACKSLASH_ESCAPE
|
|
||||||
]
|
|
||||||
};//rib
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
|
|
||||||
RenderMan Shading Language (c) Konstantin Evdokimenko <qewerty@gmail.com>
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
LANGUAGES.rsl = {
|
|
||||||
defaultMode: {
|
|
||||||
lexems: [UNDERSCORE_IDENT_RE],
|
|
||||||
illegal: '</',
|
|
||||||
contains: ['comment', 'string', 'number', 'preprocessor',
|
|
||||||
'shader', 'shading'],
|
|
||||||
keywords: {
|
|
||||||
'keyword': {'float': 1, 'color': 1, 'point': 1, 'normal': 1, 'vector': 1,
|
|
||||||
'matrix': 1, 'while': 1, 'for': 1, 'if': 1, 'do': 1,
|
|
||||||
'return': 1, 'else': 1, 'break': 1, 'extern': 1, 'continue': 1},
|
|
||||||
'built_in': {'smoothstep': 1, 'calculatenormal': 1, 'faceforward': 1,
|
|
||||||
'normalize': 1, 'ambient': 1, 'diffuse': 1, 'specular': 1,
|
|
||||||
'visibility': 1}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
modes: [
|
|
||||||
{
|
|
||||||
className: 'shader',
|
|
||||||
begin: 'surface |displacement |light |volume |imager ', end: '\\(',
|
|
||||||
lexems: [IDENT_RE],
|
|
||||||
keywords: {'surface': 1, 'displacement': 1, 'light': 1, 'volume': 1, 'imager': 1}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'shading',
|
|
||||||
begin: 'illuminate|illuminance|gather', end: '\\(',
|
|
||||||
lexems: [IDENT_RE],
|
|
||||||
keywords: {'illuminate': 1, 'illuminance': 1, 'gather': 1}
|
|
||||||
},
|
|
||||||
C_LINE_COMMENT_MODE,
|
|
||||||
C_BLOCK_COMMENT_MODE,
|
|
||||||
C_NUMBER_MODE,
|
|
||||||
QUOTE_STRING_MODE,
|
|
||||||
APOS_STRING_MODE,
|
|
||||||
BACKSLASH_ESCAPE,
|
|
||||||
{
|
|
||||||
className: 'preprocessor',
|
|
||||||
begin: '#', end: '$'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};//rsl
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
/*
|
|
||||||
|
|
||||||
Smalltalk definition (c) Vladimir Gubarkov <xonixx@gmail.com>
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
var SMALLTALK_KEYWORDS = {'self': 1, 'super': 1, 'nil': 1, 'true': 1, 'false': 1, 'thisContext': 1}; // only 6
|
|
||||||
var VAR_IDENT_RE = '[a-z][a-zA-Z0-9_]*';
|
|
||||||
|
|
||||||
LANGUAGES.smalltalk = {
|
|
||||||
defaultMode: {
|
|
||||||
lexems: [UNDERSCORE_IDENT_RE],
|
|
||||||
contains: ['comment', 'string', 'class', 'method',
|
|
||||||
'number', 'symbol', 'char', 'localvars', 'array'],
|
|
||||||
keywords: SMALLTALK_KEYWORDS
|
|
||||||
},
|
|
||||||
modes: [
|
|
||||||
{
|
|
||||||
className: 'class',
|
|
||||||
begin: '\\b[A-Z][A-Za-z0-9_]*', end: '^',
|
|
||||||
relevance: 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'symbol',
|
|
||||||
begin: '#' + UNDERSCORE_IDENT_RE, end: '^'
|
|
||||||
},
|
|
||||||
C_NUMBER_MODE,
|
|
||||||
APOS_STRING_MODE,
|
|
||||||
{
|
|
||||||
className: 'comment',
|
|
||||||
begin: '"', end: '"',
|
|
||||||
relevance: 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'method',
|
|
||||||
begin: VAR_IDENT_RE+':', end:'^'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'char',
|
|
||||||
begin: '\\$.{1}', end: '^'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'localvars',
|
|
||||||
begin: '\\|\\s*(('+VAR_IDENT_RE+')\\s*)+\\|', end: '^',
|
|
||||||
relevance: 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'array',
|
|
||||||
begin: '\\#\\(', end: '\\)',
|
|
||||||
contains: ['string', 'char', 'number', 'symbol']
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};//smalltalk
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
SQL_KEYWORDS = {'all': 1, 'partial': 1, 'global': 1, 'month': 1, 'current_timestamp': 1, 'using': 1, 'go': 1, 'revoke': 1, 'smallint': 1, 'indicator': 1, 'end-exec': 1, 'disconnect': 1, 'zone': 1, 'with': 1, 'character': 1, 'assertion': 1, 'to': 1, 'add': 1, 'current_user': 1, 'usage': 1, 'input': 1, 'local': 1, 'alter': 1, 'match': 1, 'collate': 1, 'real': 1, 'then': 1, 'rollback': 1, 'get': 1, 'read': 1, 'timestamp': 1, 'session_user': 1, 'not': 1, 'integer': 1, 'bit': 1, 'unique': 1, 'day': 1, 'minute': 1, 'desc': 1, 'insert': 1, 'execute': 1, 'like': 1, 'level': 1, 'decimal': 1, 'drop': 1, 'continue': 1, 'isolation': 1, 'found': 1, 'where': 1, 'constraints': 1, 'domain': 1, 'right': 1, 'national': 1, 'some': 1, 'module': 1, 'transaction': 1, 'relative': 1, 'second': 1, 'connect': 1, 'escape': 1, 'close': 1, 'system_user': 1, 'for': 1, 'deferred': 1, 'section': 1, 'cast': 1, 'current': 1, 'sqlstate': 1, 'allocate': 1, 'intersect': 1, 'deallocate': 1, 'numeric': 1, 'public': 1, 'preserve': 1, 'full': 1, 'goto': 1, 'initially': 1, 'asc': 1, 'no': 1, 'key': 1, 'output': 1, 'collation': 1, 'group': 1, 'by': 1, 'union': 1, 'session': 1, 'both': 1, 'last': 1, 'language': 1, 'constraint': 1, 'column': 1, 'of': 1, 'space': 1, 'foreign': 1, 'deferrable': 1, 'prior': 1, 'connection': 1, 'unknown': 1, 'action': 1, 'commit': 1, 'view': 1, 'or': 1, 'first': 1, 'into': 1, 'float': 1, 'year': 1, 'primary': 1, 'cascaded': 1, 'except': 1, 'restrict': 1, 'set': 1, 'references': 1, 'names': 1, 'table': 1, 'outer': 1, 'open': 1, 'select': 1, 'size': 1, 'are': 1, 'rows': 1, 'from': 1, 'prepare': 1, 'distinct': 1, 'leading': 1, 'create': 1, 'only': 1, 'next': 1, 'inner': 1, 'authorization': 1, 'schema': 1, 'corresponding': 1, 'option': 1, 'declare': 1, 'precision': 1, 'immediate': 1, 'else': 1, 'timezone_minute': 1, 'external': 1, 'varying': 1, 'translation': 1, 'true': 1, 'case': 1, 'exception': 1, 'join': 1, 'hour': 1, 'default': 1, 'double': 1, 'scroll': 1, 'value': 1, 'cursor': 1, 'descriptor': 1, 'values': 1, 'dec': 1, 'fetch': 1, 'procedure': 1, 'delete': 1, 'and': 1, 'false': 1, 'int': 1, 'is': 1, 'describe': 1, 'char': 1, 'as': 1, 'at': 1, 'in': 1, 'varchar': 1, 'null': 1, 'trailing': 1, 'any': 1, 'absolute': 1, 'current_time': 1, 'end': 1, 'grant': 1, 'privileges': 1, 'when': 1, 'cross': 1, 'check': 1, 'write': 1, 'current_date': 1, 'pad': 1, 'begin': 1, 'temporary': 1, 'exec': 1, 'time': 1, 'update': 1, 'catalog': 1, 'user': 1, 'sql': 1, 'date': 1, 'on': 1, 'identity': 1, 'timezone_hour': 1, 'natural': 1, 'whenever': 1, 'interval': 1, 'work': 1, 'order': 1, 'cascade': 1, 'diagnostics': 1, 'nchar': 1, 'having': 1, 'left': 1};
|
|
||||||
|
|
||||||
LANGUAGES.sql =
|
|
||||||
{
|
|
||||||
case_insensitive: true,
|
|
||||||
defaultMode:
|
|
||||||
{
|
|
||||||
lexems: [IDENT_RE],
|
|
||||||
contains: ['string', 'number', 'comment'],
|
|
||||||
keywords: {
|
|
||||||
'keyword': SQL_KEYWORDS,
|
|
||||||
'aggregate': {'count': 1, 'sum': 1, 'min': 1, 'max': 1, 'avg': 1}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
modes: [
|
|
||||||
C_NUMBER_MODE,
|
|
||||||
C_BLOCK_COMMENT_MODE,
|
|
||||||
{
|
|
||||||
className: 'comment',
|
|
||||||
begin: '--', end: '$'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'string',
|
|
||||||
begin: '\'', end: '\'',
|
|
||||||
contains: ['escape', 'squote'],
|
|
||||||
relevance: 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'squote',
|
|
||||||
begin: '\'\'', end: '^'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'string',
|
|
||||||
begin: '"', end: '"',
|
|
||||||
contains: [ 'escape', 'dquote'],
|
|
||||||
relevance: 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'dquote',
|
|
||||||
begin: '""', end: '^'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'string',
|
|
||||||
begin: '`', end: '`',
|
|
||||||
contains: ['escape']
|
|
||||||
},
|
|
||||||
BACKSLASH_ESCAPE
|
|
||||||
]
|
|
||||||
};//sql
|
|
||||||
@@ -1,158 +0,0 @@
|
|||||||
LANGUAGES.cpp = {
|
|
||||||
defaultMode: {
|
|
||||||
lexems: [UNDERSCORE_IDENT_RE],
|
|
||||||
illegal: '</',
|
|
||||||
contains: ['comment', 'string', 'number', 'preprocessor'],
|
|
||||||
keywords: {'false': 1, 'int': 1, 'float': 1, 'while': 1, 'private': 1, 'char': 1, 'catch': 1, 'export': 1, 'virtual': 1, 'operator': 2, 'sizeof': 2, 'dynamic_cast': 2, 'typedef': 2, 'const_cast': 2, 'const': 1, 'struct': 1, 'for': 1, 'static_cast': 2, 'union': 1, 'namespace': 1, 'unsigned': 1, 'long': 1, 'throw': 1, 'volatile': 2, 'static': 1, 'protected': 1, 'bool': 1, 'template': 1, 'mutable': 1, 'if': 1, 'public': 1, 'friend': 2, 'do': 1, 'return': 1, 'goto': 1, 'auto': 1, 'void': 2, 'enum': 1, 'else': 1, 'break': 1, 'new': 1, 'extern': 1, 'using': 1, 'true': 1, 'class': 1, 'asm': 1, 'case': 1, 'typeid': 1, 'short': 1, 'reinterpret_cast': 2, 'default': 1, 'double': 1, 'register': 1, 'explicit': 1, 'signed': 1, 'typename': 1, 'try': 1, 'this': 1, 'switch': 1, 'continue': 1, 'wchar_t': 1, 'inline': 1, 'delete': 1}
|
|
||||||
},
|
|
||||||
modes: [
|
|
||||||
C_LINE_COMMENT_MODE,
|
|
||||||
C_BLOCK_COMMENT_MODE,
|
|
||||||
C_NUMBER_MODE,
|
|
||||||
QUOTE_STRING_MODE,
|
|
||||||
BACKSLASH_ESCAPE,
|
|
||||||
{
|
|
||||||
className: 'string',
|
|
||||||
begin: '\'', end: '[^\\\\]\'',
|
|
||||||
illegal: '[^\\\\][^\']'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'preprocessor',
|
|
||||||
begin: '#', end: '$'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};//cpp
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
Java definition (с) Vsevolod Solovyov <vsevolod.solovyov@gmail.com>
|
|
||||||
|
|
||||||
*/
|
|
||||||
LANGUAGES.java = {
|
|
||||||
defaultMode: {
|
|
||||||
lexems: [UNDERSCORE_IDENT_RE],
|
|
||||||
contains: ['comment', 'string', 'class', 'number', 'javadoc', 'annotation'],
|
|
||||||
keywords: {'false': 1, 'synchronized': 1, 'int': 1, 'abstract': 1, 'float': 1, 'private': 1, 'char': 1, 'interface': 1, 'boolean': 1, 'static': 1, 'null': 1, 'if': 1, 'const': 1, 'for': 1, 'true': 1, 'while': 1, 'long': 1, 'throw': 1, 'strictfp': 1, 'finally': 1, 'protected': 1, 'extends': 1, 'import': 1, 'native': 1, 'final': 1, 'implements': 1, 'return': 1, 'void': 1, 'enum': 1, 'else': 1, 'break': 1, 'transient': 1, 'new': 1, 'catch': 1, 'instanceof': 1, 'byte': 1, 'super': 1, 'class': 1, 'volatile': 1, 'case': 1, 'assert': 1, 'short': 1, 'package': 1, 'default': 1, 'double': 1, 'public': 1, 'try': 1, 'this': 1, 'switch': 1, 'continue': 1, 'throws': 1}
|
|
||||||
},
|
|
||||||
modes: [
|
|
||||||
{
|
|
||||||
className: 'class',
|
|
||||||
lexems: [UNDERSCORE_IDENT_RE],
|
|
||||||
begin: '(class |interface )', end: '{',
|
|
||||||
illegal: ':',
|
|
||||||
keywords: {'class': 1, 'interface': 1},
|
|
||||||
contains: ['inheritance', 'title']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'inheritance',
|
|
||||||
begin: '(implements|extends)', end: '^',
|
|
||||||
lexems: [IDENT_RE],
|
|
||||||
keywords: {'extends': 1, 'implements': 1},
|
|
||||||
relevance: 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'title',
|
|
||||||
begin: UNDERSCORE_IDENT_RE, end: '^'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'params',
|
|
||||||
begin: '\\(', end: '\\)',
|
|
||||||
contains: ['string', 'annotation']
|
|
||||||
},
|
|
||||||
C_NUMBER_MODE,
|
|
||||||
APOS_STRING_MODE,
|
|
||||||
QUOTE_STRING_MODE,
|
|
||||||
BACKSLASH_ESCAPE,
|
|
||||||
C_LINE_COMMENT_MODE,
|
|
||||||
{
|
|
||||||
className: 'javadoc',
|
|
||||||
begin: '/\\*\\*', end: '\\*/',
|
|
||||||
relevance: 10
|
|
||||||
},
|
|
||||||
C_BLOCK_COMMENT_MODE,
|
|
||||||
{
|
|
||||||
className: 'annotation',
|
|
||||||
begin: '@[A-Za-z]+', end: '^'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};//java
|
|
||||||
|
|
||||||
|
|
||||||
var DELPHI_KEYWORDS = {'and': 1, 'safecall': 1, 'cdecl': 1, 'then': 1, 'string': 1, 'exports': 1, 'library': 1, 'not': 1, 'pascal': 1, 'set': 1, 'virtual': 1, 'file': 1, 'in': 1, 'array': 1, 'label': 1, 'packed': 1, 'end.': 1, 'index': 1, 'while': 1, 'const': 1, 'raise': 1, 'for': 1, 'to': 1, 'implementation': 1, 'with': 1, 'except': 1, 'overload': 1, 'destructor': 1, 'downto': 1, 'finally': 1, 'program': 1, 'exit': 1, 'unit': 1, 'inherited': 1, 'override': 1, 'if': 1, 'type': 1, 'until': 1, 'function': 1, 'do': 1, 'begin': 1, 'repeat': 1, 'goto': 1, 'nil': 1, 'far': 1, 'initialization': 1, 'object': 1, 'else': 1, 'var': 1, 'uses': 1, 'external': 1, 'resourcestring': 1, 'interface': 1, 'end': 1, 'finalization': 1, 'class': 1, 'asm': 1, 'mod': 1, 'case': 1, 'on': 1, 'shr': 1, 'shl': 1, 'of': 1, 'register': 1, 'xorwrite': 1, 'threadvar': 1, 'try': 1, 'record': 1, 'near': 1, 'stored': 1, 'constructor': 1, 'stdcall': 1, 'inline': 1, 'div': 1, 'out': 1, 'or': 1, 'procedure': 1};
|
|
||||||
var DELPHI_CLASS_KEYWORDS = {'safecall': 1, 'stdcall': 1, 'pascal': 1, 'stored': 1, 'const': 1, 'implementation': 1, 'finalization': 1, 'except': 1, 'to': 1, 'finally': 1, 'program': 1, 'inherited': 1, 'override': 1, 'then': 1, 'exports': 1, 'string': 1, 'read': 1, 'not': 1, 'mod': 1, 'shr': 1, 'try': 1, 'div': 1, 'shl': 1, 'set': 1, 'library': 1, 'message': 1, 'packed': 1, 'index': 1, 'for': 1, 'near': 1, 'overload': 1, 'label': 1, 'downto': 1, 'exit': 1, 'public': 1, 'goto': 1, 'interface': 1, 'asm': 1, 'on': 1, 'of': 1, 'constructor': 1, 'or': 1, 'private': 1, 'array': 1, 'unit': 1, 'raise': 1, 'destructor': 1, 'var': 1, 'type': 1, 'until': 1, 'function': 1, 'else': 1, 'external': 1, 'with': 1, 'case': 1, 'default': 1, 'record': 1, 'while': 1, 'protected': 1, 'property': 1, 'procedure': 1, 'published': 1, 'and': 1, 'cdecl': 1, 'do': 1, 'threadvar': 1, 'file': 1, 'in': 1, 'if': 1, 'end': 1, 'virtual': 1, 'write': 1, 'far': 1, 'out': 1, 'begin': 1, 'repeat': 1, 'nil': 1, 'initialization': 1, 'object': 1, 'uses': 1, 'resourcestring': 1, 'class': 1, 'register': 1, 'xorwrite': 1, 'inline': 1};
|
|
||||||
|
|
||||||
LANGUAGES.delphi = {
|
|
||||||
defaultMode: {
|
|
||||||
lexems: [IDENT_RE],
|
|
||||||
illegal: '("|\\$[G-Zg-z]|\\/\\*|</)',
|
|
||||||
contains: ['comment', 'string', 'number', 'function', 'class'],
|
|
||||||
keywords: DELPHI_KEYWORDS
|
|
||||||
},
|
|
||||||
case_insensitive: true,
|
|
||||||
modes: [
|
|
||||||
{
|
|
||||||
className: 'comment',
|
|
||||||
begin: '{', end: '}'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'comment',
|
|
||||||
begin: '\\(\\*', end: '\\*\\)',
|
|
||||||
relevance: 10
|
|
||||||
},
|
|
||||||
C_LINE_COMMENT_MODE,
|
|
||||||
{
|
|
||||||
className: 'number',
|
|
||||||
begin: NUMBER_RE, end: '^',
|
|
||||||
relevance: 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'string',
|
|
||||||
begin: '\'', end: '\'',
|
|
||||||
contains: ['quote'],
|
|
||||||
relevance: 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'string',
|
|
||||||
begin: '(#\\d+)+', end: '^'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'quote',
|
|
||||||
begin: '\'\'', end: '^'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'function',
|
|
||||||
begin: 'function', end: '[:;]',
|
|
||||||
lexems: [IDENT_RE],
|
|
||||||
keywords: {'function': 1},
|
|
||||||
contains: ['title', 'params', 'comment'],
|
|
||||||
relevance: 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'function',
|
|
||||||
begin: '(procedure|constructor|destructor)', end: ';',
|
|
||||||
lexems: [IDENT_RE],
|
|
||||||
keywords: {'constructor': 1, 'destructor': 1, 'procedure': 1},
|
|
||||||
contains: ['title', 'params', 'comment'],
|
|
||||||
relevance: 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'title',
|
|
||||||
begin: IDENT_RE, end: '^'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'params',
|
|
||||||
begin: '\\(', end: '\\)',
|
|
||||||
lexems: [IDENT_RE],
|
|
||||||
keywords: DELPHI_KEYWORDS,
|
|
||||||
contains: ['string']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'class',
|
|
||||||
begin: '=\\s*class', end: 'end;',
|
|
||||||
lexems: [IDENT_RE],
|
|
||||||
keywords: DELPHI_CLASS_KEYWORDS,
|
|
||||||
contains: ['string', 'comment', 'function']
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};//delphi
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
/*
|
|
||||||
|
|
||||||
VBScript definition (c) Nikita Ledyaev <lenikita@yandex.ru>
|
|
||||||
|
|
||||||
*/
|
|
||||||
LANGUAGES.vbscript = {
|
|
||||||
defaultMode: {
|
|
||||||
lexems: [IDENT_RE],
|
|
||||||
contains: ['string', 'comment', 'number', 'built_in'],
|
|
||||||
keywords: {
|
|
||||||
'keyword': {'call' : 1,'class' : 1,'const' : 1,'dim' : 1,'do' : 1,'loop' : 1,'erase' : 1,'execute' : 1,'executeglobal' : 1,'exit' : 1,'for' : 1,'each' : 1,'next' : 1,'function' : 1,'if' : 1,'then' : 1,'else' : 1,'on' : 1, 'error' : 1,'option' : 1, 'explicit' : 1,'private' : 1,'property' : 1,'let' : 1,'get' : 1,'public' : 1,'randomize' : 1,'redim' : 1,'rem' : 1,'select' : 1,'case' : 1,'set' : 1,'stop' : 1,'sub' : 1,'while' : 1,'wend' : 1,'with' : 1, 'end' : 1, 'to' : 1},
|
|
||||||
'built_in': {'lcase': 1, 'month': 1, 'vartype': 1, 'instrrev': 1, 'ubound': 1, 'setlocale': 1, 'getobject': 1, 'rgb': 1, 'getref': 1, 'string': 1, 'weekdayname': 1, 'rnd': 1, 'dateadd': 1, 'monthname': 1, 'now': 1, 'day': 1, 'minute': 1, 'isarray': 1, 'cbool': 1, 'round': 1, 'formatcurrency': 1, 'conversions': 1, 'csng': 1, 'timevalue': 1, 'second': 1, 'year': 1, 'space': 1, 'abs': 1, 'clng': 1, 'timeserial': 1, 'fixs': 1, 'len': 1, 'asc': 1, 'isempty': 1, 'maths': 1, 'dateserial': 1, 'atn': 1, 'timer': 1, 'isobject': 1, 'filter': 1, 'weekday': 1, 'datevalue': 1, 'ccur': 1, 'isdate': 1, 'instr': 1, 'datediff': 1, 'formatdatetime': 1, 'replace': 1, 'isnull': 1, 'right': 1, 'sgn': 1, 'array': 1, 'snumeric': 1, 'log': 1, 'cdbl': 1, 'hex': 1, 'chr': 1, 'lbound': 1, 'msgbox': 1, 'ucase': 1, 'getlocale': 1, 'cos': 1, 'cdate': 1, 'cbyte': 1, 'rtrim': 1, 'join': 1, 'hour': 1, 'oct': 1, 'typename': 1, 'trim': 1, 'strcomp': 1, 'int': 1, 'createobject': 1, 'loadpicture': 1, 'tan': 1, 'formatnumber': 1, 'mid': 1, 'scriptenginebuildversion': 1, 'scriptengine': 1, 'split': 1, 'scriptengineminorversion': 1, 'cint': 1, 'sin': 1, 'datepart': 1, 'ltrim': 1, 'sqr': 1, 'scriptenginemajorversion': 1, 'time': 1, 'derived': 1, 'eval': 1, 'date': 1, 'formatpercent': 1, 'exp': 1, 'inputbox': 1, 'left': 1}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
case_insensitive: true,
|
|
||||||
modes: [
|
|
||||||
QUOTE_STRING_MODE,
|
|
||||||
BACKSLASH_ESCAPE,
|
|
||||||
{
|
|
||||||
className: 'comment',
|
|
||||||
begin: '\'', end: '$'
|
|
||||||
},
|
|
||||||
C_NUMBER_MODE
|
|
||||||
]
|
|
||||||
};//vbscript
|
|
||||||
@@ -1,186 +0,0 @@
|
|||||||
var XML_COMMENT = {
|
|
||||||
className: 'comment',
|
|
||||||
begin: '<!--', end: '-->'
|
|
||||||
};
|
|
||||||
var XML_ATTR = {
|
|
||||||
className: 'attribute',
|
|
||||||
begin: ' [a-zA-Z]+=', end: '^',
|
|
||||||
contains: ['value']
|
|
||||||
};
|
|
||||||
var XML_VALUE = {
|
|
||||||
className: 'value',
|
|
||||||
begin: '"', end: '"'
|
|
||||||
};
|
|
||||||
|
|
||||||
LANGUAGES.xml = {
|
|
||||||
defaultMode: {
|
|
||||||
contains: ['pi', 'comment', 'cdata', 'tag']
|
|
||||||
},
|
|
||||||
case_insensitive: true,
|
|
||||||
modes: [
|
|
||||||
{
|
|
||||||
className: 'pi',
|
|
||||||
begin: '<\\?', end: '\\?>',
|
|
||||||
relevance: 10
|
|
||||||
},
|
|
||||||
XML_COMMENT,
|
|
||||||
{
|
|
||||||
className: 'cdata',
|
|
||||||
begin: '<\\!\\[CDATA\\[', end: '\\]\\]>'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'tag',
|
|
||||||
begin: '</?', end: '>',
|
|
||||||
contains: ['title', 'tag_internal'],
|
|
||||||
relevance: 1.5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'title',
|
|
||||||
begin: '[A-Za-z]+', end: '^',
|
|
||||||
relevance: 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'tag_internal',
|
|
||||||
begin: '^', endsWithParent: true,
|
|
||||||
contains: ['attribute'],
|
|
||||||
relevance: 0,
|
|
||||||
illegal: '[\\+\\.]'
|
|
||||||
},
|
|
||||||
XML_ATTR,
|
|
||||||
XML_VALUE
|
|
||||||
]
|
|
||||||
};//xml
|
|
||||||
|
|
||||||
var HTML_TAGS = {'code': 1, 'kbd': 1, 'font': 1, 'noscript': 1, 'style': 1, 'img': 1, 'title': 1, 'menu': 1, 'tt': 1, 'tr': 1, 'param': 1, 'li': 1, 'tfoot': 1, 'th': 1, 'input': 1, 'td': 1, 'dl': 1, 'blockquote': 1, 'fieldset': 1, 'big': 1, 'dd': 1, 'abbr': 1, 'optgroup': 1, 'dt': 1, 'button': 1, 'isindex': 1, 'p': 1, 'small': 1, 'div': 1, 'dir': 1, 'em': 1, 'frame': 1, 'meta': 1, 'sub': 1, 'bdo': 1, 'label': 1, 'acronym': 1, 'sup': 1, 'body': 1, 'xml': 1, 'basefont': 1, 'base': 1, 'br': 1, 'address': 1, 'strong': 1, 'legend': 1, 'ol': 1, 'script': 1, 'caption': 1, 's': 1, 'col': 1, 'h2': 1, 'h3': 1, 'h1': 1, 'h6': 1, 'h4': 1, 'h5': 1, 'table': 1, 'select': 1, 'noframes': 1, 'span': 1, 'area': 1, 'dfn': 1, 'strike': 1, 'cite': 1, 'thead': 1, 'head': 1, 'option': 1, 'form': 1, 'hr': 1, 'var': 1, 'link': 1, 'b': 1, 'colgroup': 1, 'ul': 1, 'applet': 1, 'del': 1, 'iframe': 1, 'pre': 1, 'frameset': 1, 'ins': 1, 'tbody': 1, 'html': 1, 'samp': 1, 'map': 1, 'object': 1, 'a': 1, 'xmlns': 1, 'center': 1, 'textarea': 1, 'i': 1, 'q': 1, 'u': 1};
|
|
||||||
var HTML_DOCTYPE = {
|
|
||||||
className: 'doctype',
|
|
||||||
begin: '<!DOCTYPE', end: '>',
|
|
||||||
relevance: 10
|
|
||||||
};
|
|
||||||
var HTML_ATTR = {
|
|
||||||
className: 'attribute',
|
|
||||||
begin: ' [a-zA-Z]+', end: '^'
|
|
||||||
};
|
|
||||||
var HTML_VALUE = {
|
|
||||||
className: 'value',
|
|
||||||
begin: '[a-zA-Z0-9]+', end: '^'
|
|
||||||
};
|
|
||||||
|
|
||||||
LANGUAGES.html = {
|
|
||||||
defaultMode: {
|
|
||||||
contains: ['tag', 'comment', 'doctype']
|
|
||||||
},
|
|
||||||
case_insensitive: true,
|
|
||||||
modes: [
|
|
||||||
XML_COMMENT,
|
|
||||||
HTML_DOCTYPE,
|
|
||||||
{
|
|
||||||
className: 'tag',
|
|
||||||
lexems: [IDENT_RE],
|
|
||||||
keywords: HTML_TAGS,
|
|
||||||
begin: '<[A-Za-z/]', end: '>',
|
|
||||||
contains: ['attribute'],
|
|
||||||
illegal: '[\\+\\.]'
|
|
||||||
},
|
|
||||||
XML_ATTR,
|
|
||||||
HTML_ATTR,
|
|
||||||
XML_VALUE,
|
|
||||||
HTML_VALUE
|
|
||||||
]
|
|
||||||
};//html
|
|
||||||
|
|
||||||
LANGUAGES.css = {
|
|
||||||
defaultMode: {
|
|
||||||
contains: ['id', 'class', 'attr_selector', 'rules', 'comment'],
|
|
||||||
keywords: HTML_TAGS,
|
|
||||||
lexems: [IDENT_RE],
|
|
||||||
illegal: '='
|
|
||||||
},
|
|
||||||
case_insensitive: true,
|
|
||||||
modes: [
|
|
||||||
{
|
|
||||||
className: 'id',
|
|
||||||
begin: '\\#[A-Za-z0-9_-]+', end: '^'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'class',
|
|
||||||
begin: '\\.[A-Za-z0-9_-]+', end: '^',
|
|
||||||
relevance: 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'attr_selector',
|
|
||||||
begin: '\\[', end: '\\]',
|
|
||||||
illegal: '$'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'rules',
|
|
||||||
begin: '{', end: '}',
|
|
||||||
lexems: ['[A-Za-z-]+'],
|
|
||||||
keywords: {'play-during': 1, 'counter-reset': 1, 'counter-increment': 1, 'min-height': 1, 'quotes': 1, 'border-top': 1, 'pitch': 1, 'font': 1, 'pause': 1, 'list-style-image': 1, 'border-width': 1, 'cue': 1, 'outline-width': 1, 'border-left': 1, 'elevation': 1, 'richness': 1, 'speech-rate': 1, 'border-bottom': 1, 'border-spacing': 1, 'background': 1, 'list-style-type': 1, 'text-align': 1, 'page-break-inside': 1, 'orphans': 1, 'page-break-before': 1, 'text-transform': 1, 'line-height': 1, 'padding-left': 1, 'font-size': 1, 'right': 1, 'word-spacing': 1, 'padding-top': 1, 'outline-style': 1, 'bottom': 1, 'content': 1, 'border-right-style': 1, 'padding-right': 1, 'border-left-style': 1, 'voice-family': 1, 'background-color': 1, 'border-bottom-color': 1, 'outline-color': 1, 'unicode-bidi': 1, 'max-width': 1, 'font-family': 1, 'caption-side': 1, 'border-right-width': 1, 'pause-before': 1, 'border-top-style': 1, 'color': 1, 'border-collapse': 1, 'border-bottom-width': 1, 'float': 1, 'height': 1, 'max-height': 1, 'margin-right': 1, 'border-top-width': 1, 'speak': 1, 'speak-header': 1, 'top': 1, 'cue-before': 1, 'min-width': 1, 'width': 1, 'font-variant': 1, 'border-top-color': 1, 'background-position': 1, 'empty-cells': 1, 'direction': 1, 'border-right': 1, 'visibility': 1, 'padding': 1, 'border-style': 1, 'background-attachment': 1, 'overflow': 1, 'border-bottom-style': 1, 'cursor': 1, 'margin': 1, 'display': 1, 'border-left-width': 1, 'letter-spacing': 1, 'vertical-align': 1, 'clip': 1, 'border-color': 1, 'list-style': 1, 'padding-bottom': 1, 'pause-after': 1, 'speak-numeral': 1, 'margin-left': 1, 'widows': 1, 'border': 1, 'font-style': 1, 'border-left-color': 1, 'pitch-range': 1, 'background-repeat': 1, 'table-layout': 1, 'margin-bottom': 1, 'speak-punctuation': 1, 'font-weight': 1, 'border-right-color': 1, 'page-break-after': 1, 'position': 1, 'white-space': 1, 'text-indent': 1, 'background-image': 1, 'volume': 1, 'stress': 1, 'outline': 1, 'clear': 1, 'z-index': 1, 'text-decoration': 1, 'margin-top': 1, 'azimuth': 1, 'cue-after': 1, 'left': 1, 'list-style-position': 1},
|
|
||||||
contains: ['comment', 'value']
|
|
||||||
},
|
|
||||||
C_BLOCK_COMMENT_MODE,
|
|
||||||
{
|
|
||||||
className: 'value',
|
|
||||||
begin: ':', end: ';', endsWithParent: true,
|
|
||||||
excludeBegin: true, excludeEnd: true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};//css
|
|
||||||
|
|
||||||
LANGUAGES.django = {
|
|
||||||
defaultMode: {
|
|
||||||
contains: ['tag', 'comment', 'doctype', 'template_comment', 'template_tag', 'variable']
|
|
||||||
},
|
|
||||||
case_insensitive: true,
|
|
||||||
modes: [
|
|
||||||
XML_COMMENT,
|
|
||||||
HTML_DOCTYPE,
|
|
||||||
{
|
|
||||||
className: 'tag',
|
|
||||||
lexems: [IDENT_RE],
|
|
||||||
keywords: HTML_TAGS,
|
|
||||||
begin: '<[A-Za-z/]', end: '>',
|
|
||||||
contains: ['attribute', 'template_comment', 'template_tag', 'variable']
|
|
||||||
},
|
|
||||||
XML_ATTR,
|
|
||||||
HTML_ATTR,
|
|
||||||
{
|
|
||||||
className: 'value',
|
|
||||||
begin: '"', end: '"',
|
|
||||||
contains: ['template_comment', 'template_tag', 'variable']
|
|
||||||
},
|
|
||||||
HTML_VALUE,
|
|
||||||
{
|
|
||||||
className: 'template_comment',
|
|
||||||
begin: '\\{\\%\\s*comment\\s*\\%\\}', end: '\\{\\%\\s*endcomment\\s*\\%\\}'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'template_comment',
|
|
||||||
begin: '\\{#', end: '#\\}'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'template_tag',
|
|
||||||
begin: '\\{\\%', end: '\\%\\}',
|
|
||||||
lexems: [IDENT_RE],
|
|
||||||
keywords: {'comment': 1, 'endcomment': 1, 'load': 1, 'templatetag': 1, 'ifchanged': 1, 'endifchanged': 1, 'if': 1, 'endif': 1, 'firstof': 1, 'for': 1, 'endfor': 1, 'in': 1, 'ifnotequal': 1, 'endifnotequal': 1, 'widthratio': 1, 'extends': 1, 'include': 1, 'spaceless': 1, 'endspaceless': 1, 'regroup': 1, 'by': 1, 'as': 1, 'ifequal': 1, 'endifequal': 1, 'ssi': 1, 'now': 1, 'with': 1, 'cycle': 1, 'url': 1, 'filter': 1, 'endfilter': 1, 'debug': 1, 'block': 1, 'endblock': 1, 'else': 1},
|
|
||||||
contains: ['filter']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'variable',
|
|
||||||
begin: '\\{\\{', end: '\\}\\}',
|
|
||||||
contains: ['filter']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'filter',
|
|
||||||
begin: '\\|[A-Za-z]+\\:?', end: '^', excludeEnd: true,
|
|
||||||
lexems: [IDENT_RE],
|
|
||||||
keywords: {'truncatewords': 1, 'removetags': 1, 'linebreaksbr': 1, 'yesno': 1, 'get_digit': 1, 'timesince': 1, 'random': 1, 'striptags': 1, 'filesizeformat': 1, 'escape': 1, 'linebreaks': 1, 'length_is': 1, 'ljust': 1, 'rjust': 1, 'cut': 1, 'urlize': 1, 'fix_ampersands': 1, 'title': 1, 'floatformat': 1, 'capfirst': 1, 'pprint': 1, 'divisibleby': 1, 'add': 1, 'make_list': 1, 'unordered_list': 1, 'urlencode': 1, 'timeuntil': 1, 'urlizetrunc': 1, 'wordcount': 1, 'stringformat': 1, 'linenumbers': 1, 'slice': 1, 'date': 1, 'dictsort': 1, 'dictsortreversed': 1, 'default_if_none': 1, 'pluralize': 1, 'lower': 1, 'join': 1, 'center': 1, 'default': 1, 'truncatewords_html': 1, 'upper': 1, 'length': 1, 'phone2numeric': 1, 'wordwrap': 1, 'time': 1, 'addslashes': 1, 'slugify': 1, 'first': 1},
|
|
||||||
contains: ['argument']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
className: 'argument',
|
|
||||||
begin: '"', end: '"'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};//django
|
|
||||||
@@ -1,310 +0,0 @@
|
|||||||
# Highlight.js
|
|
||||||
|
|
||||||
Highlight.js highlights syntax in code examples on blogs, forums and
|
|
||||||
in fact on any web pages. It's very easy to use because it works
|
|
||||||
automatically: finds blocks of code, detects a language, highlights it.
|
|
||||||
|
|
||||||
Autodetection can be fine tuned when it fails by itself (see "Heuristics").
|
|
||||||
|
|
||||||
## Installation and usage
|
|
||||||
|
|
||||||
The script is installed by linking to a single file and making a single
|
|
||||||
initialization call:
|
|
||||||
|
|
||||||
<script type="text/javascript" src="highlight.js"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
initHighlightingOnLoad();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
Autodetection can work a bit slow if it includes too many languages and code
|
|
||||||
blocks are large. To speed up highlighting in this case you can pass to the
|
|
||||||
initialization function only those languages that you actually use on your pages:
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
initHighlightingOnLoad('html', 'css');
|
|
||||||
</script>
|
|
||||||
|
|
||||||
When called this way highlight.js will dynamically load appropriate language
|
|
||||||
files and thus will also weigh less than with the default set that includes all
|
|
||||||
languages implemented.
|
|
||||||
|
|
||||||
Then the script looks in your page for fragments `<pre><code>...</code></pre>`
|
|
||||||
that are used traditionally to mark up code examples. Their content is
|
|
||||||
marked up by logical pieces with defined class names. The classes are
|
|
||||||
used to actually style the code elements:
|
|
||||||
|
|
||||||
.comment {
|
|
||||||
color: gray;
|
|
||||||
}
|
|
||||||
|
|
||||||
.keyword {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.python .string {
|
|
||||||
color: blue;
|
|
||||||
}
|
|
||||||
|
|
||||||
.html .atribute .value {
|
|
||||||
color: green;
|
|
||||||
}
|
|
||||||
|
|
||||||
You can use included sample.css as a starting point for you own style.
|
|
||||||
|
|
||||||
A full list of available classes is below ("Languages").
|
|
||||||
|
|
||||||
### WordPress plugin
|
|
||||||
|
|
||||||
Generally installing highlight.js in a [WordPress][wp] blog is no different
|
|
||||||
than for any other web page. However it can also be installed as a plugin.
|
|
||||||
This is useful if your blog is located on a shared hosting and you don't
|
|
||||||
have a permission to edit template and style files. Or it may be more convenient
|
|
||||||
to you this way.
|
|
||||||
|
|
||||||
To install the plugin copy the whole directory with highlight.js to the
|
|
||||||
WordPress plugins directory. After this you can activate and deactivate it
|
|
||||||
from the Plugins panel. There is also a page "highlight.js" under the Options
|
|
||||||
menu where you can set a list of languages and style rules. Insanely convenient :-)
|
|
||||||
|
|
||||||
[wp]: http://wordpress.org/
|
|
||||||
|
|
||||||
|
|
||||||
## Export
|
|
||||||
|
|
||||||
File export.html contains a little program that shows and allows to copy and paste
|
|
||||||
an HTML code generated by the highlighter for any code snippet. This can be useful
|
|
||||||
in situations when one can't use the script itself on a site.
|
|
||||||
|
|
||||||
|
|
||||||
## Languages
|
|
||||||
|
|
||||||
This is a full list of available classes corresponding to languages'
|
|
||||||
syntactic structures.
|
|
||||||
|
|
||||||
Python:
|
|
||||||
|
|
||||||
keyword keyword
|
|
||||||
number number
|
|
||||||
string string (of any type)
|
|
||||||
comment comment
|
|
||||||
decorator @-decorator for functions
|
|
||||||
function function header "def some_name(...):"
|
|
||||||
class class header "class SomeName(...):"
|
|
||||||
title name of a function or a class inside a header
|
|
||||||
params everything inside parentheses in a function's or class' header
|
|
||||||
|
|
||||||
Ruby:
|
|
||||||
|
|
||||||
keyword keyword
|
|
||||||
string string
|
|
||||||
subst in-string substitution (#{...})
|
|
||||||
comment comment
|
|
||||||
function function header "def some_name(...):"
|
|
||||||
class class header "class SomeName(...):"
|
|
||||||
title name of a function or a class inside a header
|
|
||||||
symbol symbol
|
|
||||||
|
|
||||||
Perl:
|
|
||||||
|
|
||||||
keyword keyword
|
|
||||||
comment comment
|
|
||||||
number number
|
|
||||||
string string
|
|
||||||
regexp regular expression
|
|
||||||
sub subroutine header (from "sub" till "{")
|
|
||||||
variable variable starting with "$", "%", "@"
|
|
||||||
operator operator
|
|
||||||
pod plain old doc
|
|
||||||
|
|
||||||
PHP:
|
|
||||||
|
|
||||||
keyword keyword
|
|
||||||
number number
|
|
||||||
string string (of any type)
|
|
||||||
comment comment
|
|
||||||
phpdoc phpdoc params in comments
|
|
||||||
variable variable starting with "$"
|
|
||||||
|
|
||||||
XML:
|
|
||||||
|
|
||||||
tag any tag from "<" till ">"
|
|
||||||
comment comment
|
|
||||||
pi processing instruction (<?php ... ?>)
|
|
||||||
cdata CDATA section
|
|
||||||
attribute attribute
|
|
||||||
value attribute's value
|
|
||||||
|
|
||||||
HTML:
|
|
||||||
|
|
||||||
keyword HTML tag
|
|
||||||
tag any tag from "<" till ">"
|
|
||||||
comment comment
|
|
||||||
doctype <!DOCTYPE ... > declaration
|
|
||||||
attribute tag's attribute with or without value
|
|
||||||
value attribute's value
|
|
||||||
|
|
||||||
CSS:
|
|
||||||
|
|
||||||
keyword HTML tag when in selectors, CSS keyword when in rules
|
|
||||||
id #some_name in selectors
|
|
||||||
class .some_name in selectors
|
|
||||||
attr_selector attribute selector (square brackets in a[href^=http://])
|
|
||||||
comment comment
|
|
||||||
rules everything from "{" till "}"
|
|
||||||
value property's value inside a rule, from ":" till ";" or
|
|
||||||
till the end of rule block
|
|
||||||
|
|
||||||
Django:
|
|
||||||
|
|
||||||
keyword HTML tag in HTML, default tags and default filters in templates
|
|
||||||
tag any tag from "<" till ">"
|
|
||||||
comment comment
|
|
||||||
doctype <!DOCTYPE ... > declaration
|
|
||||||
attribute tag's attribute with or withou value
|
|
||||||
value attribute's value
|
|
||||||
template_tag template tag {% .. %}
|
|
||||||
variable template variable {{ .. }}
|
|
||||||
template_comment template comment, both {# .. #} and {% comment %}
|
|
||||||
filter filter from "|" till the next filter or the end of tag
|
|
||||||
argument filter argument
|
|
||||||
|
|
||||||
Javascript:
|
|
||||||
|
|
||||||
keyword keyword
|
|
||||||
comment comment
|
|
||||||
number number
|
|
||||||
literal special literal: "true", "false" and "null"
|
|
||||||
string string
|
|
||||||
regexp regular expression
|
|
||||||
function header of a function
|
|
||||||
title name of a function inside a header
|
|
||||||
params everything inside parentheses in a function's header
|
|
||||||
|
|
||||||
VBScript:
|
|
||||||
|
|
||||||
keyword keyword
|
|
||||||
number number
|
|
||||||
string string
|
|
||||||
comment comment
|
|
||||||
built_in built-in function
|
|
||||||
|
|
||||||
Delphi:
|
|
||||||
|
|
||||||
keyword keyword
|
|
||||||
comment comment (of any type)
|
|
||||||
number number
|
|
||||||
string string
|
|
||||||
function header of a function, procedure, constructor and destructor
|
|
||||||
title name of a function, procedure, constructor or destructor
|
|
||||||
inside a header
|
|
||||||
params everything inside parentheses in a function's header
|
|
||||||
class class' body from "= class" till "end;"
|
|
||||||
|
|
||||||
Java:
|
|
||||||
|
|
||||||
keyword keyword
|
|
||||||
number number
|
|
||||||
string string
|
|
||||||
comment commment
|
|
||||||
annotaion annotation
|
|
||||||
javadoc javadoc comment
|
|
||||||
class class header from "class" till "{"
|
|
||||||
title class name inside a header
|
|
||||||
params everything in parentheses inside a class header
|
|
||||||
inheritance keywords "extends" and "implements" inside class header
|
|
||||||
|
|
||||||
C++:
|
|
||||||
|
|
||||||
keyword keyword
|
|
||||||
number number
|
|
||||||
string string and character
|
|
||||||
comment comment
|
|
||||||
preprocessor preprocessor directive
|
|
||||||
|
|
||||||
RenderMan (RSL):
|
|
||||||
|
|
||||||
keyword keyword
|
|
||||||
number number
|
|
||||||
string string
|
|
||||||
comment comment
|
|
||||||
preprocessor preprocessor directive
|
|
||||||
shader sahder keywords
|
|
||||||
shading shading keywords
|
|
||||||
built_in built-in function
|
|
||||||
|
|
||||||
RenderMan (RIB):
|
|
||||||
|
|
||||||
keyword keyword
|
|
||||||
number number
|
|
||||||
string string
|
|
||||||
comment comment
|
|
||||||
commands command
|
|
||||||
|
|
||||||
SQL:
|
|
||||||
|
|
||||||
keyword keyword (mostly SQL'92 and SQL'99)
|
|
||||||
number number
|
|
||||||
string string (of any type: "..", '..', `..`)
|
|
||||||
comment comment
|
|
||||||
aggregate aggregate function
|
|
||||||
|
|
||||||
Smalltalk:
|
|
||||||
|
|
||||||
keyword keyword
|
|
||||||
number number
|
|
||||||
string string
|
|
||||||
comment commment
|
|
||||||
symbol symbol
|
|
||||||
array array
|
|
||||||
class name of a class
|
|
||||||
char char
|
|
||||||
localvars block of local variables
|
|
||||||
|
|
||||||
Axapta:
|
|
||||||
|
|
||||||
keyword keyword
|
|
||||||
number number
|
|
||||||
string string
|
|
||||||
comment commment
|
|
||||||
class class header from "class" till "{"
|
|
||||||
title class name inside a header
|
|
||||||
params everything in parentheses inside a class header
|
|
||||||
inheritance keywords "extends" and "implements" inside class header
|
|
||||||
preprocessor preprocessor directive
|
|
||||||
|
|
||||||
1C:
|
|
||||||
|
|
||||||
keyword keyword
|
|
||||||
number number
|
|
||||||
string string
|
|
||||||
comment commment
|
|
||||||
function header of function or procudure
|
|
||||||
title function name inside a header
|
|
||||||
params everything in parentheses inside a function header
|
|
||||||
preprocessor preprocessor directive
|
|
||||||
|
|
||||||
## Heuristics
|
|
||||||
|
|
||||||
Autodetection of a code's language is done with a simple heuristics:
|
|
||||||
the program tries to highlight a fragment with all available languages and
|
|
||||||
counts all syntactic structures that it finds along the way. The language
|
|
||||||
with greatest count wins.
|
|
||||||
|
|
||||||
This means that in short fragments the probability of an error is high
|
|
||||||
(and it really happens sometimes). In this cases you can set the fragment's
|
|
||||||
language explicitly by assigning a class to the `<code>` element:
|
|
||||||
|
|
||||||
<pre><code class="html">...</code></pre>
|
|
||||||
|
|
||||||
To disable highlighting of a fragment altogether use "no-highlight" class:
|
|
||||||
|
|
||||||
<pre><code class="no-highlight">...</code></pre>
|
|
||||||
|
|
||||||
## Contacts
|
|
||||||
|
|
||||||
Version: 3.5
|
|
||||||
URL: http://softwaremaniacs.org/soft/highlight/en/
|
|
||||||
Author: Ivan Sagalaev (Maniac@SoftwareManiacs.Org)
|
|
||||||
|
|
||||||
For the license terms see LICENSE files.
|
|
||||||
For the list of contributors see AUTHORS.en.txt file.
|
|
||||||
@@ -1,316 +0,0 @@
|
|||||||
# Highlight.js
|
|
||||||
|
|
||||||
Highlight.js нужен для подсветки синтаксиса в примерах кода в блогах,
|
|
||||||
форумах и вообще на любых веб-страницах. Пользоваться им очень просто,
|
|
||||||
потому что работает он автоматически: сам находит блоки кода, сам
|
|
||||||
определяет язык, сам подсвечивает.
|
|
||||||
|
|
||||||
Автоопределением языка можно управлять, когда оно не справляется само (см.
|
|
||||||
дальше "Эвристика").
|
|
||||||
|
|
||||||
## Подключение и использование
|
|
||||||
|
|
||||||
Скрипт подключается одним файлом и одним вызовом инициализирующей
|
|
||||||
функции:
|
|
||||||
|
|
||||||
<script type="text/javascript" src="highlight.js"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
initHighlightingOnLoad();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
Автоматическое определение языков может работать довольно медленно, когда
|
|
||||||
в него включено много языков, а фрагменты кода обширны. Чтобы ускорить
|
|
||||||
процесс, можно перечислить в вызове инициализирующей функции только те
|
|
||||||
языки, которые используются в тексте:
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
initHighlightingOnLoad('html', 'css');
|
|
||||||
</script>
|
|
||||||
|
|
||||||
При вызов таким образом highlight.js динамически подгружает соответствующие
|
|
||||||
языковые файлы и таким образом весит меньше, чем с набором по умолчанию,
|
|
||||||
который включает все реализованные языки.
|
|
||||||
|
|
||||||
Дальше скрипт ищет на странице конструкции `<pre><code>...</code></pre>`,
|
|
||||||
которые традиционно используются для написания кода, и код в них
|
|
||||||
размечается на куски, помеченные разными значениями классов. Классам
|
|
||||||
этим затем надо задать в стилях нужные цвета например так:
|
|
||||||
|
|
||||||
.comment {
|
|
||||||
color: gray;
|
|
||||||
}
|
|
||||||
|
|
||||||
.keyword {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.python .string {
|
|
||||||
color: blue;
|
|
||||||
}
|
|
||||||
|
|
||||||
.html .atribute .value {
|
|
||||||
color: green;
|
|
||||||
}
|
|
||||||
|
|
||||||
Можно использовать sample.css из комплекта как стартовую точку для собственного
|
|
||||||
стиля.
|
|
||||||
|
|
||||||
Полный список классов для разных языков приведен ниже ("Языки").
|
|
||||||
|
|
||||||
### Плагин к WordPress
|
|
||||||
|
|
||||||
Вообще, подключение highlight.js к блогу на [WordPress][wp] ничем не отличается
|
|
||||||
от подключения куда-либо еще. Однако он может быть подключен к блогу и как плагин.
|
|
||||||
Это удобно, если блог находится на общественном сервере, где вы не можете
|
|
||||||
свободно редактировать файлы, или просто если вы привыкли пользоваться плагинами.
|
|
||||||
|
|
||||||
Для установки плагина надо скопировать всю директорию с файлами highlight.js в
|
|
||||||
директорию плагинов WordPress. После этого в панели плагинов его можно
|
|
||||||
будет включать и отключать. В меню Options также добавляется страничка
|
|
||||||
highlight.js, где можно настраивать список языков и CSS-стили. Удобно до одурения :-).
|
|
||||||
|
|
||||||
[wp]: http://wordpress.org/
|
|
||||||
|
|
||||||
|
|
||||||
## Экспорт
|
|
||||||
|
|
||||||
В файле export.html находится небольшая программка, которая показывает и дает
|
|
||||||
скопировать непосредственно HTML-код подсветки для любого заданного фрагмента кода.
|
|
||||||
Это может понадобится например на сайте, на котором нельзя подключить сам скрипт
|
|
||||||
highlight.js.
|
|
||||||
|
|
||||||
|
|
||||||
## Языки
|
|
||||||
|
|
||||||
В списке приведены все языки, которые знает библиотека с классами,
|
|
||||||
соответствующими различным синтаксическим частям.
|
|
||||||
|
|
||||||
Python:
|
|
||||||
|
|
||||||
keyword ключевое слово языка
|
|
||||||
number число
|
|
||||||
string строка (любого типа)
|
|
||||||
comment комментарий
|
|
||||||
decorator @-декоратор функции
|
|
||||||
function заголовок функции "def some_name(...):"
|
|
||||||
class заголовок класса "class SomeName(...):"
|
|
||||||
title название функции или класса внутри заголовка
|
|
||||||
params все, что в скобках внутри заголовка функции или класса
|
|
||||||
|
|
||||||
Ruby:
|
|
||||||
|
|
||||||
keyword ключевое слово языка
|
|
||||||
string строка
|
|
||||||
subst внутристроковая подстановка (#{...})
|
|
||||||
comment комментарий
|
|
||||||
function заголовок функции "def ..."
|
|
||||||
class заголовок класса "class ..."
|
|
||||||
title название функции или класса внутри заголовка
|
|
||||||
symbol символ
|
|
||||||
|
|
||||||
Perl:
|
|
||||||
|
|
||||||
keyword ключевое слово языка
|
|
||||||
comment комментарий
|
|
||||||
number число
|
|
||||||
string строка
|
|
||||||
regexp регулярное выражение
|
|
||||||
sub заголовок процедуры (от "sub" до "{")
|
|
||||||
variable переменная, начинающаяся с "$", "%", "@"
|
|
||||||
operator оператор
|
|
||||||
pod документация (plain old doc)
|
|
||||||
|
|
||||||
PHP:
|
|
||||||
|
|
||||||
keyword ключевое слово языка
|
|
||||||
number число
|
|
||||||
string строка (любого типа)
|
|
||||||
comment комментарий
|
|
||||||
phpdoc параметры phpdoc в комментарии
|
|
||||||
variable переменная, начинающаяся с "$"
|
|
||||||
|
|
||||||
XML:
|
|
||||||
|
|
||||||
tag любой открывающий или закрывающий тег от "<" до ">"
|
|
||||||
comment комментарий
|
|
||||||
pi инструкции обработки (<?php ... ?>)
|
|
||||||
cdata раздел CDATA
|
|
||||||
attribute атрибут
|
|
||||||
value значение атрибута
|
|
||||||
|
|
||||||
HTML:
|
|
||||||
|
|
||||||
keyword тег языка HTML
|
|
||||||
tag любой открывающий или закрывающий тег от "<" до ">"
|
|
||||||
comment комментарий
|
|
||||||
doctype объявление <!DOCTYPE ... >
|
|
||||||
attribute атрибут внутри тега со значением или без
|
|
||||||
value значение атрибута
|
|
||||||
|
|
||||||
CSS:
|
|
||||||
|
|
||||||
keyword тег языка HTML в селекторах или свойство CSS в правилах
|
|
||||||
id #some_name в селекторах
|
|
||||||
class .some_name в селекторах
|
|
||||||
attr_selector селектор атрибутов (квадатные скобоки в a[href^=http://])
|
|
||||||
comment комментарий
|
|
||||||
rules все от "{" до "}"
|
|
||||||
value значение свойства внутри правила, все от ":" до ";" или
|
|
||||||
до конца блока правил
|
|
||||||
|
|
||||||
Django:
|
|
||||||
|
|
||||||
keyword тег HTML в HTML, встроенные шаблонные теги и фильтры в шаблонах
|
|
||||||
tag любой открывающий или закрывающий тег от "<" до ">"
|
|
||||||
comment комментарий
|
|
||||||
doctype объявление <!DOCTYPE ... >
|
|
||||||
attribute атрибут внутри тега со значением или без
|
|
||||||
value значение атрибута
|
|
||||||
template_tag шаблонный тег {% .. %}
|
|
||||||
variable шаблонная переменная {{ .. }}
|
|
||||||
template_comment шаблонный комментарий, и {# .. #}, и {% comment %}
|
|
||||||
filter фильтр от "|" до следующего фильтра или до конца тега
|
|
||||||
argument аргумент фильтра
|
|
||||||
|
|
||||||
Javascript:
|
|
||||||
|
|
||||||
keyword ключевое слово языка
|
|
||||||
comment комментарий
|
|
||||||
number число
|
|
||||||
literal специальное слово: "true", "false" и "null"
|
|
||||||
string строка
|
|
||||||
regexp регулярное выражение
|
|
||||||
function заголовок функции
|
|
||||||
title название функции внутри заголовка
|
|
||||||
params все, что в скобках внутри заголовка функции
|
|
||||||
|
|
||||||
VBScript:
|
|
||||||
|
|
||||||
keyword ключевое слово языка
|
|
||||||
comment комментарий
|
|
||||||
number число
|
|
||||||
string строка
|
|
||||||
built_in встроенная функция
|
|
||||||
|
|
||||||
Delphi:
|
|
||||||
|
|
||||||
keyword ключевое слово языка
|
|
||||||
comment комментарий (любого типа)
|
|
||||||
number число
|
|
||||||
string строка
|
|
||||||
function заголовок функции, процедуры, конструктора или деструктора
|
|
||||||
title название функции, процедуры, конструктора или деструктора
|
|
||||||
внутри заголовка
|
|
||||||
params все, что в скобках внутри заголовка функций
|
|
||||||
class тело класса от "= class" до "end;"
|
|
||||||
|
|
||||||
Java:
|
|
||||||
|
|
||||||
keyword ключевое слово языка
|
|
||||||
number число
|
|
||||||
string строка
|
|
||||||
comment комментарий
|
|
||||||
annotaion аннотация
|
|
||||||
javadoc javadoc-комментарии
|
|
||||||
class заголовок класса от "class" до "{"
|
|
||||||
title название класса внутри заголовка
|
|
||||||
params все, что в скобках внутри заголовка класса
|
|
||||||
inheritance слова "extends" и "implements" внутри заголовка класса
|
|
||||||
|
|
||||||
C++:
|
|
||||||
|
|
||||||
keyword ключевое слово языка
|
|
||||||
number число
|
|
||||||
string строка и одиночный символ
|
|
||||||
comment комментарий
|
|
||||||
preprocessor директива препроцессора
|
|
||||||
|
|
||||||
RenderMan (RSL):
|
|
||||||
|
|
||||||
keyword ключевое слово языка
|
|
||||||
number число
|
|
||||||
string строка
|
|
||||||
comment комментарий
|
|
||||||
preprocessor директива препроцессора
|
|
||||||
shader ключевое слово шейдеров
|
|
||||||
shading ключевое слово затенений
|
|
||||||
built_in встроенная функция
|
|
||||||
|
|
||||||
RenderMan (RIB):
|
|
||||||
|
|
||||||
keyword ключевое слово языка
|
|
||||||
number число
|
|
||||||
string строка
|
|
||||||
comment комментарий
|
|
||||||
commands команда
|
|
||||||
|
|
||||||
SQL:
|
|
||||||
|
|
||||||
keyword ключевое слово (в основном из SQL'92 и SQL'99)
|
|
||||||
number число
|
|
||||||
string строка (любого типа: "..", '..', `..`)
|
|
||||||
comment комментарий
|
|
||||||
aggregate агрегатная функция
|
|
||||||
|
|
||||||
Smalltalk:
|
|
||||||
|
|
||||||
keyword ключевое слово
|
|
||||||
number число
|
|
||||||
string строка
|
|
||||||
comment комментарий
|
|
||||||
symbol символ
|
|
||||||
array массив
|
|
||||||
class имя класса
|
|
||||||
char буква
|
|
||||||
localvars блок локальных переменных
|
|
||||||
|
|
||||||
Axapta:
|
|
||||||
|
|
||||||
keyword ключевое слово языка
|
|
||||||
number число
|
|
||||||
string строка
|
|
||||||
comment комментарий
|
|
||||||
class заголовок класса от "class" до "{"
|
|
||||||
title название класса внутри заголовка
|
|
||||||
params все, что в скобках внутри заголовка класса
|
|
||||||
inheritance слова "extends" и "implements" внутри заголовка класса
|
|
||||||
preprocessor директива препроцессора
|
|
||||||
|
|
||||||
1С:
|
|
||||||
|
|
||||||
keyword ключевое слово языка
|
|
||||||
number число
|
|
||||||
string строка
|
|
||||||
comment комментарий
|
|
||||||
function заголовок функции или процедуры
|
|
||||||
title название функции внутри заголовка
|
|
||||||
params все, что в скобках внутри заголовка функции
|
|
||||||
preprocessor директива препроцессора
|
|
||||||
|
|
||||||
|
|
||||||
## Эвристика
|
|
||||||
|
|
||||||
Определение языка, на котором написан фрагмент, делается с помощью
|
|
||||||
довольно простой эвристики: программа пытается расцветить фрагмент всеми
|
|
||||||
языками подряд, и для каждого языка считает количество подошедших
|
|
||||||
синтаксически конструкций и ключевых слов. Для какого языка нашлось больше,
|
|
||||||
тот и выбирается.
|
|
||||||
|
|
||||||
Это означает, что в коротких фрагментах высока вероятность ошибки, что
|
|
||||||
периодически и случается. Чтобы указать язык фрагмента явно, надо написать
|
|
||||||
его название в виде класса к элементу `<code>`:
|
|
||||||
|
|
||||||
<pre><code class="html">...</code></pre>
|
|
||||||
|
|
||||||
Чтобы запретить расцветку фрагмента вообще, используется класс "no-highlight":
|
|
||||||
|
|
||||||
<pre><code class="no-highlight">...</code></pre>
|
|
||||||
|
|
||||||
## Координаты
|
|
||||||
|
|
||||||
Версия: 3.5
|
|
||||||
URL: http://softwaremaniacs.org/soft/highlight/
|
|
||||||
Автор: Иван Сагалаев (Maniac@SoftwareManiacs.Org)
|
|
||||||
|
|
||||||
Лицензионное соглашение читайте в файле LICENSE.
|
|
||||||
Список соавторов читайте в файле AUTHORS.ru.txt
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
/*
|
|
||||||
You can use this file as is or as a starting point for you own styling
|
|
||||||
*/
|
|
||||||
|
|
||||||
pre code[class]:after {
|
|
||||||
content: 'highlight: ' attr(class);
|
|
||||||
display: block; text-align: right;
|
|
||||||
font-size: smaller;
|
|
||||||
color: #CCC; background: white;
|
|
||||||
border-top: solid 1px;
|
|
||||||
padding-top: 0.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
pre code {
|
|
||||||
display: block;
|
|
||||||
background: #F0F0F0;
|
|
||||||
}
|
|
||||||
|
|
||||||
pre code,
|
|
||||||
.ruby .subst {
|
|
||||||
color: black;
|
|
||||||
}
|
|
||||||
|
|
||||||
.string,
|
|
||||||
.function .title,
|
|
||||||
.class .title,
|
|
||||||
.tag .attribute .value,
|
|
||||||
.css .rules .value,
|
|
||||||
.preprocessor,
|
|
||||||
.ruby .symbol,
|
|
||||||
.built_in,
|
|
||||||
.sql .aggregate,
|
|
||||||
.django .template_tag,
|
|
||||||
.django .variable,
|
|
||||||
.smalltalk .class {
|
|
||||||
color: #800;
|
|
||||||
}
|
|
||||||
|
|
||||||
.comment,
|
|
||||||
.java .annotation,
|
|
||||||
.template_comment {
|
|
||||||
color: #888;
|
|
||||||
}
|
|
||||||
|
|
||||||
.number,
|
|
||||||
.regexp,
|
|
||||||
.javascript .literal,
|
|
||||||
.smalltalk .symbol,
|
|
||||||
.smalltalk .char {
|
|
||||||
color: #080;
|
|
||||||
}
|
|
||||||
|
|
||||||
.javadoc,
|
|
||||||
.ruby .string,
|
|
||||||
.python .decorator,
|
|
||||||
.django .filter .argument,
|
|
||||||
.smalltalk .localvars,
|
|
||||||
.smalltalk .array,
|
|
||||||
.css .attr_selector,
|
|
||||||
.xml .pi {
|
|
||||||
color: #88F;
|
|
||||||
}
|
|
||||||
|
|
||||||
.keyword,
|
|
||||||
.css .id,
|
|
||||||
.phpdoc,
|
|
||||||
.function .title,
|
|
||||||
.class .title,
|
|
||||||
.vbscript .built_in,
|
|
||||||
.sql .aggregate,
|
|
||||||
.rsl .built_in,
|
|
||||||
.smalltalk .class,
|
|
||||||
.xml .tag .title {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
@@ -1,620 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<head>
|
|
||||||
<title>Highlight</title>
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="sample.css">
|
|
||||||
|
|
||||||
<script type="text/javascript" src="highlight.js"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
initHighlightingOnLoad('1c', 'axapta', 'cpp', 'delphi', 'xml', 'html', 'css', 'django', 'java', 'javascript', 'perl', 'php', 'python', 'rib', 'rsl', 'ruby', 'smalltalk', 'sql', 'vbscript');
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<p>Some Python code:
|
|
||||||
|
|
||||||
<pre><code>@requires_authorization
|
|
||||||
def somefunc(param1, param2):
|
|
||||||
'''A docstring'''
|
|
||||||
if param1 > param2: # interesting
|
|
||||||
print 'Gre\'ater'
|
|
||||||
print ''
|
|
||||||
return param2 - param1 + 1
|
|
||||||
|
|
||||||
class SomeClass:<br> pass
|
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<p>Short sample of Ruby:
|
|
||||||
|
|
||||||
<pre><code># Ruby support for highlight.js
|
|
||||||
|
|
||||||
class CategoriesController < ApplicationController
|
|
||||||
layout "core"
|
|
||||||
|
|
||||||
before_filter :login_required
|
|
||||||
before_filter :xhr_required, :only => [:create, :update]
|
|
||||||
before_filter :admin_privileges_required, :except => [:show]
|
|
||||||
|
|
||||||
=begin
|
|
||||||
This method creates a category. Very difficult to understand, huh?
|
|
||||||
=end
|
|
||||||
|
|
||||||
def create
|
|
||||||
@category = Category.create(params[:category])
|
|
||||||
flash[:notice] = "Category #{@category + "..."} was successfully created"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<p>A bit of Perl:
|
|
||||||
|
|
||||||
<pre><code># loads object
|
|
||||||
sub load
|
|
||||||
{
|
|
||||||
my $c = shift;
|
|
||||||
my $id = shift;
|
|
||||||
|
|
||||||
my $flds = $c->db_load($id,@_) || do { Carp::carp "Can`t load (class: $c, id: $id): '$!'"; return undef };
|
|
||||||
|
|
||||||
my $o = $c->_perl_new();
|
|
||||||
|
|
||||||
$id12 = $id;
|
|
||||||
$o->{'ID'} = $id12 + 123;
|
|
||||||
|
|
||||||
$o->{'PAPA'} = $flds->{'PAPA'};
|
|
||||||
#$o->{'SHCUT'} = $flds->{'SHCUT'};
|
|
||||||
|
|
||||||
my $p = $o->props;
|
|
||||||
|
|
||||||
#if($o->{'SHCUT'})
|
|
||||||
#{
|
|
||||||
# $flds = $o->db_load($o->{'SHCUT'},@_);
|
|
||||||
#}
|
|
||||||
|
|
||||||
my $vt;
|
|
||||||
for my $key (keys %$p)
|
|
||||||
{
|
|
||||||
if(${$vt.'::property'})
|
|
||||||
{
|
|
||||||
$o->{$key . '_real'} = $flds->{$key};
|
|
||||||
tie $o->{$key}, 'CMSBuilder::Property', $o, $key;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$o->{$key} = $flds->{$key};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$o->save if delete $o->{'_save_after_load'};
|
|
||||||
|
|
||||||
return $o;
|
|
||||||
}
|
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<p>A chunk of PHP:
|
|
||||||
|
|
||||||
<pre><code>require_once 'Zend.php';
|
|
||||||
require_once 'Zend/Uri/Exception.php';
|
|
||||||
require_once 'Zend/Uri/Http.php';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Zend_Uri_Mailto
|
|
||||||
*/
|
|
||||||
require_once 'Zend/Uri/Mailto.php';
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @category Zend
|
|
||||||
* @package Zend_Uri
|
|
||||||
* @copyright Copyright (c) 2006 Zend Technologies USA Inc. (http://www.zend.com)
|
|
||||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
|
||||||
*/
|
|
||||||
abstract class Zend_Uri
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Scheme of this URI (http, ftp, etc.)
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $_scheme = "";
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return a string representation of this URI.
|
|
||||||
*
|
|
||||||
* @see getUri()
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function __toString()
|
|
||||||
{
|
|
||||||
return $this->getUri();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static public function check($uri)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
$uri = self::factory($uri);
|
|
||||||
} catch (Exception $e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $uri->valid();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new Zend_Uri object for a URI. If building a new URI, then $uri should contain
|
|
||||||
* only the scheme (http, ftp, etc). Otherwise, supply $uri with the complete URI.
|
|
||||||
*
|
|
||||||
* @param string $uri
|
|
||||||
* @throws Zend_Uri_Exception
|
|
||||||
* @return Zend_Uri
|
|
||||||
*/
|
|
||||||
static public function factory($uri = 'http')
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Separate the scheme from the scheme-specific parts
|
|
||||||
* @link http://www.faqs.org/rfcs/rfc2396.html
|
|
||||||
*/
|
|
||||||
$uri = explode(':', $uri, 2);
|
|
||||||
$scheme = strtolower($uri[0]);
|
|
||||||
$schemeSpecify = isset($uri[1]) ? $uri[1] : '';
|
|
||||||
|
|
||||||
if (!strlen($scheme)) {
|
|
||||||
throw new Zend_Uri_Exception('An empty string was supplied for the scheme');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Security check: $scheme is used to load a class file, so only alphanumerics are allowed.
|
|
||||||
if (!ctype_alnum($scheme)) {
|
|
||||||
throw new Zend_Uri_Exception('Illegal scheme supplied, only alphanumeric characters are permitted');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<p>A custom XML document:
|
|
||||||
|
|
||||||
<pre><code><?xml version="1.0"?>
|
|
||||||
<response value="ok">
|
|
||||||
<text>Ok</text>
|
|
||||||
<comment/>
|
|
||||||
<description><![CDATA[
|
|
||||||
CDATA is <not> magical.
|
|
||||||
]]></description>
|
|
||||||
</response>
|
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<p>Some HTML code:
|
|
||||||
|
|
||||||
<pre><code><head>
|
|
||||||
<title>Title</title>
|
|
||||||
<body>
|
|
||||||
<p class="something">Something</p>
|
|
||||||
<p class=something>Something</p>
|
|
||||||
<!-- comment -->
|
|
||||||
<p class>Something</p>
|
|
||||||
<p class="something" title="p">Something</p>
|
|
||||||
</body>
|
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<p>HTML with Django templates:
|
|
||||||
|
|
||||||
<pre><code>{% if articles|length %}
|
|
||||||
{% for article in articles %}
|
|
||||||
|
|
||||||
{# Striped table #}
|
|
||||||
<tr class="{% cycle odd,even %}">
|
|
||||||
<td>{{ article|default:"Hi... "|escape }}</td>
|
|
||||||
<td>{{ article.date|date:"d.m.Y" }}</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
{% endfor %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% comment %}
|
|
||||||
Comments may be long and
|
|
||||||
multiline.
|
|
||||||
{% endcomment %}
|
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<p>Some CSS code:
|
|
||||||
|
|
||||||
<pre><code>body,
|
|
||||||
html {
|
|
||||||
font: Tahoma, Arial, san-serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
#content {
|
|
||||||
width: 100%; /* комментарий */
|
|
||||||
height: 100%
|
|
||||||
}
|
|
||||||
|
|
||||||
p[lang=ru] {
|
|
||||||
color: red;
|
|
||||||
}
|
|
||||||
</pre></code>
|
|
||||||
|
|
||||||
<p>Javascript here too (right from the source, mind you):
|
|
||||||
|
|
||||||
<pre><code>function initHighlight(block) {
|
|
||||||
if (block.className.search(/\bno\-highlight\b/) != -1)
|
|
||||||
return false;
|
|
||||||
try {
|
|
||||||
blockText(block);
|
|
||||||
} catch (e) {
|
|
||||||
if (e == 'Complex markup')
|
|
||||||
return;
|
|
||||||
}//try
|
|
||||||
var classes = block.className.split(/\s+/);
|
|
||||||
for (var i = 0; i < classes.length; i++) {
|
|
||||||
if (LANGUAGES[classes[i]]) {
|
|
||||||
highlightLanguage(block, classes[i]);
|
|
||||||
return;
|
|
||||||
}//if
|
|
||||||
}//for
|
|
||||||
highlightAuto(block);
|
|
||||||
}//initHighlight</code></pre>
|
|
||||||
|
|
||||||
<p>VBScript
|
|
||||||
|
|
||||||
<pre><code>' creating configuration storage and initializing with default values
|
|
||||||
Set cfg = CreateObject("Scripting.Dictionary")
|
|
||||||
cfg.add "dest", ""
|
|
||||||
cfg.add "dest_gz", ""
|
|
||||||
cfg.add "gzip_exe", ""
|
|
||||||
cfg.add "perl_exe", ""
|
|
||||||
cfg.add "uncompressed_postfix", ""
|
|
||||||
|
|
||||||
' reading ini file
|
|
||||||
for i = 0 to ubound(ini_strings)
|
|
||||||
s = trim(ini_strings(i))
|
|
||||||
|
|
||||||
' skipping empty strings and comments
|
|
||||||
if mid(s, 1, 1) <> "#" and len(s) > 0 then
|
|
||||||
' obtaining key and value
|
|
||||||
parts = split(s, "=", -1, 1)
|
|
||||||
|
|
||||||
if ubound(parts)+1 = 2 then
|
|
||||||
parts(0) = trim(parts(0))
|
|
||||||
parts(1) = trim(parts(1))
|
|
||||||
|
|
||||||
' reading configuration and filenames
|
|
||||||
select case lcase(parts(0))
|
|
||||||
case "dest" cfg.item("dest") = parts(1)
|
|
||||||
case "dest_gz" cfg.item("dest_gz") = parts(1)
|
|
||||||
case "gzip_exe" cfg.item("gzip_exe") = parts(1)
|
|
||||||
case "perl_exe" cfg.item("perl_exe") = parts(1)
|
|
||||||
case "uncompressed_postfix" cfg.item("uncompressed_postfix") = parts(1)
|
|
||||||
case "f"
|
|
||||||
options = split(parts(1), "|", -1, 1)
|
|
||||||
if ubound(options)+1 = 2 then
|
|
||||||
' 0: filename, 1: options
|
|
||||||
ff.add trim(options(0)), trim(options(1))
|
|
||||||
end if
|
|
||||||
end select
|
|
||||||
end if
|
|
||||||
end if
|
|
||||||
next</code></pre>
|
|
||||||
|
|
||||||
<P>Delphi code
|
|
||||||
|
|
||||||
<pre><code>TList=Class(TObject)
|
|
||||||
Private
|
|
||||||
Some: String;
|
|
||||||
Public
|
|
||||||
Procedure Inside;
|
|
||||||
End;{TList}
|
|
||||||
|
|
||||||
Procedure CopyFile(InFileName,var OutFileName:String);
|
|
||||||
Const
|
|
||||||
BufSize=4096; (* Huh? *)
|
|
||||||
Var
|
|
||||||
InFile,OutFile:TStream;
|
|
||||||
Buffer:Array[1..BufSize] Of Byte;
|
|
||||||
ReadBufSize:Integer;
|
|
||||||
Begin
|
|
||||||
InFile:=Nil;
|
|
||||||
OutFile:=Nil;
|
|
||||||
Try
|
|
||||||
InFile:=TFileStream.Create(InFileName,fmOpenRead);
|
|
||||||
OutFile:=TFileStream.Create(OutFileName,fmCreate);
|
|
||||||
Repeat
|
|
||||||
ReadBufSize:=InFile.Read(Buffer,BufSize);
|
|
||||||
OutFile.Write(Buffer,ReadBufSize);
|
|
||||||
Until ReadBufSize<>BufSize;
|
|
||||||
Log('File '''+InFileName+''' copied'#13#10);
|
|
||||||
Finally
|
|
||||||
InFile.Free;
|
|
||||||
OutFile.Free;
|
|
||||||
End;{Try}
|
|
||||||
End;{CopyFile}
|
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<p>From Java world:
|
|
||||||
|
|
||||||
<pre><code>package l2f.gameserver.model;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Mother class of all character objects of the world (PC, NPC...)<BR><BR>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public abstract class L2Character extends L2Object
|
|
||||||
{
|
|
||||||
protected static final Logger _log = Logger.getLogger(L2Character.class.getName());
|
|
||||||
|
|
||||||
public static final Short ABNORMAL_EFFECT_BLEEDING = 0x0001; // not sure
|
|
||||||
public static final Short ABNORMAL_EFFECT_POISON = 0x0002;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Cancel the AI.<BR><BR>
|
|
||||||
*/
|
|
||||||
public void detachAI()
|
|
||||||
{
|
|
||||||
_ai = null;
|
|
||||||
//jbf = null;
|
|
||||||
if (1 > 5)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void moveTo(int x, int y, int z)
|
|
||||||
{
|
|
||||||
moveTo(x, y, z, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Task of AI notification */
|
|
||||||
@SuppressWarnings( { "nls", "unqualified-field-access", "boxing" })
|
|
||||||
public class NotifyAITask implements Runnable
|
|
||||||
{
|
|
||||||
private final CtrlEvent _evt;
|
|
||||||
|
|
||||||
public NotifyAITask(CtrlEvent evt)
|
|
||||||
{
|
|
||||||
this._evt = evt;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
getAI().notifyEvent(_evt, null, null);
|
|
||||||
}
|
|
||||||
catch (Throwable t)
|
|
||||||
{
|
|
||||||
_log.warning("Exception " + t);
|
|
||||||
t.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final int HP_REGEN_FLAG = 1;
|
|
||||||
private static final int MP_REGEN_FLAG = 2;
|
|
||||||
private static final int CP_REGEN_FLAG = 4;
|
|
||||||
|
|
||||||
/** The table containing the List of all stacked effect in progress for each Stack group Identifier */
|
|
||||||
private ConcurrentHashMap<String, Short> _stackedEffects = null;
|
|
||||||
}
|
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<p>C++:
|
|
||||||
|
|
||||||
<pre><code>#include <iostream>
|
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
|
||||||
|
|
||||||
/* An annoying "Hello World" example */
|
|
||||||
for (unsigned i = 0; i < 0xFFFF; i++)
|
|
||||||
cout << "Hello, World!" << endl;
|
|
||||||
|
|
||||||
char c = '\n'; // just a test
|
|
||||||
char *s = "\\\\"; // another test
|
|
||||||
}
|
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<p>Bet you didn't expect to see a highlighted RenderMan (both RenderMan
|
|
||||||
Shading Language and RenderMan Interface Bytestream):</p>
|
|
||||||
|
|
||||||
<pre><code>#define TEST_DEFINE 3.14
|
|
||||||
/* plastic surface shader
|
|
||||||
*
|
|
||||||
* Pixie is:
|
|
||||||
* (c) Copyright 1999-2003 Okan Arikan. All rights reserved.
|
|
||||||
*/
|
|
||||||
|
|
||||||
surface plastic (float Ka = 1, Kd = 0.5, Ks = 0.5, roughness = 0.1;
|
|
||||||
color specularcolor = 1;) {
|
|
||||||
normal Nf = faceforward (normalize(N),I);
|
|
||||||
Ci = Cs * (Ka*ambient() + Kd*diffuse(Nf)) + specularcolor * Ks*specular(Nf,-normalize(I),roughness);
|
|
||||||
Oi = Os;
|
|
||||||
Ci *= Oi;
|
|
||||||
}
|
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<pre><code>FrameBegin 0
|
|
||||||
Display "Scene" "framebuffer" "rgb"
|
|
||||||
Option "searchpath" "shader" "+&:/home/kew"
|
|
||||||
Option "trace" "int maxdepth" [4]
|
|
||||||
Attribute "visibility" "trace" [1]
|
|
||||||
Attribute "irradiance" "maxerror" [0.1]
|
|
||||||
Attribute "visibility" "transmission" "opaque"
|
|
||||||
Format 640 480 1.0
|
|
||||||
ShadingRate 2
|
|
||||||
PixelFilter "catmull-rom" 1 1
|
|
||||||
PixelSamples 4 4
|
|
||||||
Projection "perspective" "fov" 49.5502811377
|
|
||||||
Scale 1 1 -1
|
|
||||||
ConcatTransform [-0.105581186712 -0.336664259434 0.935686826706 0.0
|
|
||||||
|
|
||||||
0.994097530842 -0.0121211335063 0.107810914516 0.0
|
|
||||||
|
|
||||||
-0.0249544940889 0.941546678543 0.335956931114 0.0
|
|
||||||
|
|
||||||
0.103667020798 -1.30126297474 -6.22769546509 1.0]
|
|
||||||
|
|
||||||
WorldBegin
|
|
||||||
|
|
||||||
ReadArchive "/home/qewerty/blends/my/instances/Lamp.002_Light/instance.rib"
|
|
||||||
Surface "plastic"
|
|
||||||
ReadArchive "/home/qewerty/blends/my/instances/Cube.004_Mesh/instance.rib"
|
|
||||||
# ReadArchive "/home/qewerty/blends/my/instances/Sphere.010_Mesh/instance.rib"
|
|
||||||
# ReadArchive "/home/qewerty/blends/my/instances/Sphere.009_Mesh/instance.rib"
|
|
||||||
ReadArchive "/home/qewerty/blends/my/instances/Sphere.006_Mesh/instance.rib"
|
|
||||||
|
|
||||||
WorldEnd
|
|
||||||
FrameEnd
|
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<p>SQL:
|
|
||||||
|
|
||||||
<pre><code>BEGIN;
|
|
||||||
CREATE TABLE "cicero_topic" (
|
|
||||||
"id" serial NOT NULL PRIMARY KEY,
|
|
||||||
"forum_id" integer NOT NULL,
|
|
||||||
"subject" varchar(255) NOT NULL,
|
|
||||||
"created" timestamp with time zone NOT NULL
|
|
||||||
);
|
|
||||||
ALTER TABLE "cicero_topic"
|
|
||||||
ADD CONSTRAINT forum_id_refs_id_4be56999
|
|
||||||
FOREIGN KEY ("forum_id")
|
|
||||||
REFERENCES "cicero_forum" ("id")
|
|
||||||
DEFERRABLE INITIALLY DEFERRED;
|
|
||||||
|
|
||||||
-- Initials
|
|
||||||
insert into "cicero_forum" ("slug", "name", "group", "ordering") values ('test', 'Тест''овый форум', 'Тест', 0);
|
|
||||||
|
|
||||||
-- Indices
|
|
||||||
CREATE INDEX "cicero_topic_forum_id" ON "cicero_topic" ("forum_id");
|
|
||||||
|
|
||||||
-- Test
|
|
||||||
select count(*) from cicero_forum;
|
|
||||||
|
|
||||||
COMMIT;
|
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<p>Good old classic SmallTalk:
|
|
||||||
|
|
||||||
<pre><code>Object>>method: num
|
|
||||||
"comment 123"
|
|
||||||
| var1 var2 |
|
|
||||||
(1 to: num) do: [:i | |var| ^i].
|
|
||||||
Klass with: var1.
|
|
||||||
Klass new.
|
|
||||||
arr := #('123' 123.345 #hello Transcript var $@).
|
|
||||||
arr := #().
|
|
||||||
var2 = arr at: 3.
|
|
||||||
^ self abc
|
|
||||||
|
|
||||||
heapExample
|
|
||||||
"HeapTest new heapExample"
|
|
||||||
"Create a sorted collection of numbers, remove the elements
|
|
||||||
sequentially and add new objects randomly.
|
|
||||||
Note: This is the kind of benchmark a heap is designed for."
|
|
||||||
| n rnd array time sorted |
|
|
||||||
n := 5000.
|
|
||||||
"# of elements to sort"
|
|
||||||
rnd := Random new.
|
|
||||||
array := (1 to: n)
|
|
||||||
collect: [:i | rnd next].
|
|
||||||
"First, the heap version"
|
|
||||||
time := Time
|
|
||||||
millisecondsToRun: [sorted := Heap withAll: array.
|
|
||||||
1
|
|
||||||
to: n
|
|
||||||
do: [:i |
|
|
||||||
sorted removeFirst.
|
|
||||||
sorted add: rnd next]].
|
|
||||||
Transcript cr; show: 'Time for Heap: ' , time printString , ' msecs'.
|
|
||||||
"The quicksort version"
|
|
||||||
time := Time
|
|
||||||
millisecondsToRun: [sorted := SortedCollection withAll: array.
|
|
||||||
1
|
|
||||||
to: n
|
|
||||||
do: [:i |
|
|
||||||
sorted removeFirst.
|
|
||||||
sorted add: rnd next]].
|
|
||||||
Transcript cr; show: 'Time for SortedCollection: ' , time printString , ' msecs'
|
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<p>Axapta:
|
|
||||||
|
|
||||||
<pre><code>class ExchRateLoadBatch extends RunBaseBatch
|
|
||||||
{
|
|
||||||
ExchRateLoad rbc;
|
|
||||||
container currencies;
|
|
||||||
boolean actual;
|
|
||||||
boolean overwrite;
|
|
||||||
date beg;
|
|
||||||
date end;
|
|
||||||
|
|
||||||
#define.CurrentVersion(5)
|
|
||||||
|
|
||||||
#localmacro.CurrentList
|
|
||||||
currencies,
|
|
||||||
actual,
|
|
||||||
beg,
|
|
||||||
end
|
|
||||||
#endmacro
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean unpack(container packedClass)
|
|
||||||
{
|
|
||||||
container base;
|
|
||||||
boolean ret;
|
|
||||||
Integer version = runbase::getVersion(packedClass);
|
|
||||||
|
|
||||||
switch (version)
|
|
||||||
{
|
|
||||||
case #CurrentVersion:
|
|
||||||
[version, #CurrentList] = packedClass;
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<p>And this is a russian enterpise system "1С":
|
|
||||||
|
|
||||||
<pre><code class="1c">
|
|
||||||
#Если Клиент Тогда
|
|
||||||
Перем СимвольныйКодКаталога = "ля-ля-ля"; //комментарий
|
|
||||||
Функция Сообщить(Знач ТекстСообщения, ТекстСообщения2) Экспорт //комментарий к функции
|
|
||||||
x=ТекстСообщения+ТекстСообщения2+"
|
|
||||||
|строка1
|
|
||||||
|строка2
|
|
||||||
|строка3";
|
|
||||||
КонецФункции
|
|
||||||
#КонецЕсли
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// ОБРАБОТЧИКИ СОБЫТИЙ
|
|
||||||
//
|
|
||||||
|
|
||||||
// Процедура ПриНачалеРаботыСистемы
|
|
||||||
//
|
|
||||||
Процедура ПриНачалеРаботыСистемы()
|
|
||||||
|
|
||||||
Обработки.Помощник.ПолучитьФорму("Форма").Открыть();
|
|
||||||
|
|
||||||
КонецПроцедуры
|
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<p>Explicit Python highlight:
|
|
||||||
|
|
||||||
<pre><code class="python">for x in [1, 2, 3]:
|
|
||||||
count(x)
|
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<p>Disabled highlighting:
|
|
||||||
|
|
||||||
<pre><code class="no-highlight"><div id="contents">
|
|
||||||
<p>Hello, World!
|
|
||||||
</div>
|
|
||||||
</code></pre>
|
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*
|
|
||||||
Plugin Name: highlight.js
|
|
||||||
Plugin URI: http://softwaremaniacs.org/soft/highlight/
|
|
||||||
Description: Syntax highlighting with language autodetection
|
|
||||||
Version: 3.5
|
|
||||||
Author: Ivan Sagalaev
|
|
||||||
Author URI: http://softwaremaniacs.org/about/
|
|
||||||
*/
|
|
||||||
|
|
||||||
add_option('hljs_languages', '');
|
|
||||||
if (!get_option('hljs_script_path')) {
|
|
||||||
$components = explode('/', dirname(__FILE__));
|
|
||||||
$l = sizeof($components);
|
|
||||||
$script_path = get_settings('home') . '/' . $components[$l - 3] . '/' . $components[$l - 2] . '/' . $components[$l - 1];
|
|
||||||
add_option('hljs_script_path', $script_path . '/highlight.js');
|
|
||||||
}
|
|
||||||
add_option('hljs_css', '');
|
|
||||||
|
|
||||||
function init_highlighting_on_load() {
|
|
||||||
$languages_str = get_option('hljs_languages');
|
|
||||||
if ($languages_str) {
|
|
||||||
$languages = explode(',', $languages_str);
|
|
||||||
foreach ($languages as $i => $language) {
|
|
||||||
$languages[$i] = '\'' . trim($language) . '\'';
|
|
||||||
}
|
|
||||||
$languages_str = implode(', ', $languages);
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<script type="text/javascript" src="<?php echo get_option('hljs_script_path');?>"></script>
|
|
||||||
<script type="text/javascript">initHighlightingOnLoad(<?php echo $languages_str; ?>);</script>
|
|
||||||
<?php
|
|
||||||
$css = get_option('hljs_css');
|
|
||||||
if ($css) {?>
|
|
||||||
<style type="text/css">
|
|
||||||
<?php echo $css ?>
|
|
||||||
</style>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
}
|
|
||||||
add_action('wp_head', 'init_highlighting_on_load');
|
|
||||||
|
|
||||||
function add_hljs_subpanel() {
|
|
||||||
if (function_exists('add_options_page')) {
|
|
||||||
add_options_page('highlight.js options', 'highlight.js', 0, __FILE__, 'hljs_subpanel');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
add_action('admin_menu', 'add_hljs_subpanel');
|
|
||||||
|
|
||||||
function hljs_subpanel() {
|
|
||||||
if (isset($_POST['hljs_script_path'])) {
|
|
||||||
update_option('hljs_languages', $_POST['hljs_languages']);
|
|
||||||
update_option('hljs_script_path', $_POST['hljs_script_path']);
|
|
||||||
update_option('hljs_css', $_POST['hljs_css']);
|
|
||||||
?><div class="updated"><p><strong>Options updated.</strong></p></div><?php
|
|
||||||
} ?>
|
|
||||||
<div class="wrap">
|
|
||||||
<form method="post">
|
|
||||||
<h2>highlight.js options</h2>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<p><label for="id_hljs_languages">Highlight Languages:</label> <input type="text" name="hljs_languages" id="id_hljs_languages" value="<?php echo get_option('hljs_languages'); ?>" /></p>
|
|
||||||
<p><small>List here languages that you want to highlight on your blog like this: php, html, css. Empty string means "all known languages". For the list
|
|
||||||
of supported languages refer to <a href="http://softwaremaniacs.org/soft/highlight/">highlight.js homepage</a>.</small></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<p><label for="id_hljs_script_path">Path to highlight.js:</label> <input type="text" name="hljs_script_path" id="id_hljs_script_path" value="<?php echo get_option('hljs_script_path'); ?>" /></p>
|
|
||||||
<p><small>Let's you place the script in a convenient place</small></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<p><label for="id_hljs_css">Custom CSS:</label></p>
|
|
||||||
<p><textarea name="hljs_css" id="id_hljs_css" rows="20" cols="70"><?php echo get_option('hljs_css'); ?></textarea></p>
|
|
||||||
<p><small>Normally styling of code snippets goes into site's main CSS files. But you can
|
|
||||||
write it here if you can't access site's CSS or just like it this way.</small></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="submit">
|
|
||||||
<input type="submit" name="info_update" value="Update options »" />
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div><?php
|
|
||||||
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
@@ -1,148 +0,0 @@
|
|||||||
/* PACKAGE : json.js 2007-03-21
|
|
||||||
*/
|
|
||||||
if (!Object.prototype.toJSONString) {
|
|
||||||
Array.prototype.toJSONString = function () {
|
|
||||||
var a = ['['],
|
|
||||||
b,
|
|
||||||
i,
|
|
||||||
l = this.length,
|
|
||||||
v;
|
|
||||||
function p(s) {
|
|
||||||
if (b) {
|
|
||||||
a.push(',');
|
|
||||||
}
|
|
||||||
a.push(s);
|
|
||||||
b = true;
|
|
||||||
}
|
|
||||||
for (i = 0; i < l; i += 1) {
|
|
||||||
v = this[i];
|
|
||||||
switch (typeof v) {
|
|
||||||
case 'undefined':
|
|
||||||
case 'function':
|
|
||||||
case 'unknown':
|
|
||||||
break;
|
|
||||||
case 'object':
|
|
||||||
if (v) {
|
|
||||||
if (typeof v.toJSONString === 'function') {
|
|
||||||
p(v.toJSONString());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
p("null");
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
p(v.toJSONString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
a.push(']');
|
|
||||||
return a.join('');
|
|
||||||
};
|
|
||||||
Boolean.prototype.toJSONString = function () {
|
|
||||||
return String(this);
|
|
||||||
};
|
|
||||||
Date.prototype.toJSONString = function () {
|
|
||||||
function f(n) {
|
|
||||||
return n < 10 ? '0' + n : n;
|
|
||||||
}
|
|
||||||
return '"' + this.getFullYear() + '-' +
|
|
||||||
f(this.getMonth() + 1) + '-' +
|
|
||||||
f(this.getDate()) + 'T' +
|
|
||||||
f(this.getHours()) + ':' +
|
|
||||||
f(this.getMinutes()) + ':' +
|
|
||||||
f(this.getSeconds()) + '"';
|
|
||||||
};
|
|
||||||
Number.prototype.toJSONString = function () {
|
|
||||||
return isFinite(this) ? String(this) : "null";
|
|
||||||
};
|
|
||||||
Object.prototype.toJSONString = function () {
|
|
||||||
var a = ['{'],
|
|
||||||
b,
|
|
||||||
k,
|
|
||||||
v;
|
|
||||||
function p(s) {
|
|
||||||
if (b) {
|
|
||||||
a.push(',');
|
|
||||||
}
|
|
||||||
a.push(k.toJSONString(), ':', s);
|
|
||||||
b = true;
|
|
||||||
}
|
|
||||||
for (k in this) {
|
|
||||||
if (this.hasOwnProperty(k)) {
|
|
||||||
v = this[k];
|
|
||||||
switch (typeof v) {
|
|
||||||
case 'undefined':
|
|
||||||
case 'function':
|
|
||||||
case 'unknown':
|
|
||||||
break;
|
|
||||||
case 'object':
|
|
||||||
if (v) {
|
|
||||||
if (typeof v.toJSONString === 'function') {
|
|
||||||
p(v.toJSONString());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
p("null");
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
p(v.toJSONString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
a.push('}');
|
|
||||||
return a.join('');
|
|
||||||
};
|
|
||||||
|
|
||||||
(function (s) {
|
|
||||||
var m = {
|
|
||||||
'\b': '\\b',
|
|
||||||
'\t': '\\t',
|
|
||||||
'\n': '\\n',
|
|
||||||
'\f': '\\f',
|
|
||||||
'\r': '\\r',
|
|
||||||
'"' : '\\"',
|
|
||||||
'\\': '\\\\'
|
|
||||||
};
|
|
||||||
s.parseJSON = function (filter) {
|
|
||||||
try {
|
|
||||||
if (/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.
|
|
||||||
test(this)) {
|
|
||||||
var j = eval('(' + this + ')');
|
|
||||||
if (typeof filter === 'function') {
|
|
||||||
|
|
||||||
function walk(k, v) {
|
|
||||||
if (v && typeof v === 'object') {
|
|
||||||
for (var i in v) {
|
|
||||||
if (v.hasOwnProperty(i)) {
|
|
||||||
v[i] = walk(i, v[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return filter(k, v);
|
|
||||||
}
|
|
||||||
|
|
||||||
j = walk('', j);
|
|
||||||
}
|
|
||||||
return j;
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
}
|
|
||||||
throw new SyntaxError("parseJSON");
|
|
||||||
};
|
|
||||||
|
|
||||||
s.toJSONString = function () {
|
|
||||||
if (/["\\\x00-\x1f]/.test(this)) {
|
|
||||||
return '"' + this.replace(/([\x00-\x1f\\"])/g, function(a, b) {
|
|
||||||
var c = m[b];
|
|
||||||
if (c) {
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
c = b.charCodeAt();
|
|
||||||
return '\\u00' +
|
|
||||||
Math.floor(c / 16).toString(16) +
|
|
||||||
(c % 16).toString(16);
|
|
||||||
}) + '"';
|
|
||||||
}
|
|
||||||
return '"' + this + '"';
|
|
||||||
};
|
|
||||||
})(String.prototype);
|
|
||||||
}
|
|
||||||
@@ -1,248 +0,0 @@
|
|||||||
/*
|
|
||||||
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
|
|
||||||
* Digest Algorithm, as defined in RFC 1321.
|
|
||||||
* Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
|
|
||||||
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
|
|
||||||
* Distributed under the BSD License
|
|
||||||
* See http://pajhome.org.uk/crypt/md5 for more info.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Configurable variables. You may need to tweak these to be compatible with
|
|
||||||
* the server-side, but the defaults work in most cases.
|
|
||||||
*/
|
|
||||||
var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */
|
|
||||||
var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */
|
|
||||||
var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* These are the functions you'll usually want to call
|
|
||||||
* They take string arguments and return either hex or base-64 encoded strings
|
|
||||||
*/
|
|
||||||
var hex_md5 = md5 = function(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));}
|
|
||||||
function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));}
|
|
||||||
function str_md5(s){ return binl2str(core_md5(str2binl(s), s.length * chrsz));}
|
|
||||||
function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); }
|
|
||||||
function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); }
|
|
||||||
function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); }
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Calculate the MD5 of an array of little-endian words, and a bit length
|
|
||||||
*/
|
|
||||||
function core_md5(x, len)
|
|
||||||
{
|
|
||||||
/* append padding */
|
|
||||||
x[len >> 5] |= 0x80 << ((len) % 32);
|
|
||||||
x[(((len + 64) >>> 9) << 4) + 14] = len;
|
|
||||||
|
|
||||||
var a = 1732584193;
|
|
||||||
var b = -271733879;
|
|
||||||
var c = -1732584194;
|
|
||||||
var d = 271733878;
|
|
||||||
|
|
||||||
for(var i = 0; i < x.length; i += 16)
|
|
||||||
{
|
|
||||||
var olda = a;
|
|
||||||
var oldb = b;
|
|
||||||
var oldc = c;
|
|
||||||
var oldd = d;
|
|
||||||
|
|
||||||
a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
|
|
||||||
d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
|
|
||||||
c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);
|
|
||||||
b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
|
|
||||||
a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
|
|
||||||
d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);
|
|
||||||
c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
|
|
||||||
b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
|
|
||||||
a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);
|
|
||||||
d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
|
|
||||||
c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
|
|
||||||
b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
|
|
||||||
a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);
|
|
||||||
d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
|
|
||||||
c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
|
|
||||||
b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);
|
|
||||||
|
|
||||||
a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
|
|
||||||
d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
|
|
||||||
c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);
|
|
||||||
b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
|
|
||||||
a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
|
|
||||||
d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);
|
|
||||||
c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
|
|
||||||
b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
|
|
||||||
a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);
|
|
||||||
d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
|
|
||||||
c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
|
|
||||||
b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);
|
|
||||||
a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
|
|
||||||
d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
|
|
||||||
c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);
|
|
||||||
b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
|
|
||||||
|
|
||||||
a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
|
|
||||||
d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
|
|
||||||
c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);
|
|
||||||
b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
|
|
||||||
a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
|
|
||||||
d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);
|
|
||||||
c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
|
|
||||||
b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
|
|
||||||
a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);
|
|
||||||
d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
|
|
||||||
c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
|
|
||||||
b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);
|
|
||||||
a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
|
|
||||||
d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
|
|
||||||
c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);
|
|
||||||
b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
|
|
||||||
|
|
||||||
a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
|
|
||||||
d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);
|
|
||||||
c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
|
|
||||||
b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
|
|
||||||
a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);
|
|
||||||
d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
|
|
||||||
c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
|
|
||||||
b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
|
|
||||||
a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);
|
|
||||||
d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
|
|
||||||
c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
|
|
||||||
b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);
|
|
||||||
a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
|
|
||||||
d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
|
|
||||||
c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);
|
|
||||||
b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
|
|
||||||
|
|
||||||
a = safe_add(a, olda);
|
|
||||||
b = safe_add(b, oldb);
|
|
||||||
c = safe_add(c, oldc);
|
|
||||||
d = safe_add(d, oldd);
|
|
||||||
}
|
|
||||||
return Array(a, b, c, d);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* These functions implement the four basic operations the algorithm uses.
|
|
||||||
*/
|
|
||||||
function md5_cmn(q, a, b, x, s, t)
|
|
||||||
{
|
|
||||||
return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
|
|
||||||
}
|
|
||||||
function md5_ff(a, b, c, d, x, s, t)
|
|
||||||
{
|
|
||||||
return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
|
|
||||||
}
|
|
||||||
function md5_gg(a, b, c, d, x, s, t)
|
|
||||||
{
|
|
||||||
return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
|
|
||||||
}
|
|
||||||
function md5_hh(a, b, c, d, x, s, t)
|
|
||||||
{
|
|
||||||
return md5_cmn(b ^ c ^ d, a, b, x, s, t);
|
|
||||||
}
|
|
||||||
function md5_ii(a, b, c, d, x, s, t)
|
|
||||||
{
|
|
||||||
return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Calculate the HMAC-MD5, of a key and some data
|
|
||||||
*/
|
|
||||||
function core_hmac_md5(key, data)
|
|
||||||
{
|
|
||||||
var bkey = str2binl(key);
|
|
||||||
if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);
|
|
||||||
|
|
||||||
var ipad = Array(16), opad = Array(16);
|
|
||||||
for(var i = 0; i < 16; i++)
|
|
||||||
{
|
|
||||||
ipad[i] = bkey[i] ^ 0x36363636;
|
|
||||||
opad[i] = bkey[i] ^ 0x5C5C5C5C;
|
|
||||||
}
|
|
||||||
|
|
||||||
var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);
|
|
||||||
return core_md5(opad.concat(hash), 512 + 128);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
|
|
||||||
* to work around bugs in some JS interpreters.
|
|
||||||
*/
|
|
||||||
function safe_add(x, y)
|
|
||||||
{
|
|
||||||
var lsw = (x & 0xFFFF) + (y & 0xFFFF);
|
|
||||||
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
|
|
||||||
return (msw << 16) | (lsw & 0xFFFF);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Bitwise rotate a 32-bit number to the left.
|
|
||||||
*/
|
|
||||||
function bit_rol(num, cnt)
|
|
||||||
{
|
|
||||||
return (num << cnt) | (num >>> (32 - cnt));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Convert a string to an array of little-endian words
|
|
||||||
* If chrsz is ASCII, characters >255 have their hi-byte silently ignored.
|
|
||||||
*/
|
|
||||||
function str2binl(str)
|
|
||||||
{
|
|
||||||
var bin = new Array();
|
|
||||||
var mask = (1 << chrsz) - 1;
|
|
||||||
for(var i = 0; i < str.length * chrsz; i += chrsz)
|
|
||||||
bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32);
|
|
||||||
return bin;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Convert an array of little-endian words to a string
|
|
||||||
*/
|
|
||||||
function binl2str(bin)
|
|
||||||
{
|
|
||||||
var str = "";
|
|
||||||
var mask = (1 << chrsz) - 1;
|
|
||||||
for(var i = 0; i < bin.length * 32; i += chrsz)
|
|
||||||
str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask);
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Convert an array of little-endian words to a hex string.
|
|
||||||
*/
|
|
||||||
function binl2hex(binarray)
|
|
||||||
{
|
|
||||||
var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
|
|
||||||
var str = "";
|
|
||||||
for(var i = 0; i < binarray.length * 4; i++)
|
|
||||||
{
|
|
||||||
str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +
|
|
||||||
hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);
|
|
||||||
}
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Convert an array of little-endian words to a base-64 string
|
|
||||||
*/
|
|
||||||
function binl2b64(binarray)
|
|
||||||
{
|
|
||||||
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
||||||
var str = "";
|
|
||||||
for(var i = 0; i < binarray.length * 4; i += 3)
|
|
||||||
{
|
|
||||||
var triplet = (((binarray[i >> 2] >> 8 * ( i %4)) & 0xFF) << 16)
|
|
||||||
| (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 )
|
|
||||||
| ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF);
|
|
||||||
for(var j = 0; j < 4; j++)
|
|
||||||
{
|
|
||||||
if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
|
|
||||||
else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
@@ -77,12 +77,10 @@ class Bootstrap
|
|||||||
self::registerClass("DBRecordSet", PATH_GULLIVER . "class.dbrecordset.php");
|
self::registerClass("DBRecordSet", PATH_GULLIVER . "class.dbrecordset.php");
|
||||||
self::registerClass("DBSession", PATH_GULLIVER . "class.dbsession.php");
|
self::registerClass("DBSession", PATH_GULLIVER . "class.dbsession.php");
|
||||||
self::registerClass("DBTable", PATH_GULLIVER . "class.dbtable.php");
|
self::registerClass("DBTable", PATH_GULLIVER . "class.dbtable.php");
|
||||||
self::registerClass("XmlForm_Field_HTML", PATH_GULLIVER . "class.dvEditor.php");
|
|
||||||
self::registerClass("dynaFormHandler", PATH_GULLIVER . "class.dynaformhandler.php");
|
self::registerClass("dynaFormHandler", PATH_GULLIVER . "class.dynaformhandler.php");
|
||||||
self::registerClass("G_Error", PATH_GULLIVER . "class.error.php");
|
self::registerClass("G_Error", PATH_GULLIVER . "class.error.php");
|
||||||
self::registerClass("filterForm", PATH_GULLIVER . "class.filterForm.php");
|
self::registerClass("filterForm", PATH_GULLIVER . "class.filterForm.php");
|
||||||
self::registerClass("Form", PATH_GULLIVER . "class.form.php");
|
self::registerClass("Form", PATH_GULLIVER . "class.form.php");
|
||||||
self::registerClass("functionTest", PATH_GULLIVER . "class.functionTest.php");
|
|
||||||
self::registerClass("G", PATH_GULLIVER . "class.g.php");
|
self::registerClass("G", PATH_GULLIVER . "class.g.php");
|
||||||
self::registerClass("headPublisher", PATH_GULLIVER . "class.headPublisher.php");
|
self::registerClass("headPublisher", PATH_GULLIVER . "class.headPublisher.php");
|
||||||
self::registerClass("Helper", PATH_GULLIVER . "class.helper.php");
|
self::registerClass("Helper", PATH_GULLIVER . "class.helper.php");
|
||||||
@@ -107,9 +105,7 @@ class Bootstrap
|
|||||||
self::registerClass("Table", PATH_GULLIVER . "class.table.php");
|
self::registerClass("Table", PATH_GULLIVER . "class.table.php");
|
||||||
self::registerClass("TemplatePowerParser", PATH_GULLIVER . "class.templatePower.php");
|
self::registerClass("TemplatePowerParser", PATH_GULLIVER . "class.templatePower.php");
|
||||||
self::registerClass("TemplatePower", PATH_GULLIVER . "class.templatePower.php");
|
self::registerClass("TemplatePower", PATH_GULLIVER . "class.templatePower.php");
|
||||||
self::registerClass("testTools", PATH_GULLIVER . "class.testTools.php");
|
|
||||||
self::registerClass("Tree", PATH_GULLIVER . "class.tree.php");
|
self::registerClass("Tree", PATH_GULLIVER . "class.tree.php");
|
||||||
self::registerClass("unitTest", PATH_GULLIVER . "class.unitTest.php");
|
|
||||||
self::registerClass("WebResource", PATH_GULLIVER . "class.webResource.php");
|
self::registerClass("WebResource", PATH_GULLIVER . "class.webResource.php");
|
||||||
self::registerClass("XmlForm_Field_WYSIWYG_EDITOR", PATH_GULLIVER . "class.wysiwygEditor.php");
|
self::registerClass("XmlForm_Field_WYSIWYG_EDITOR", PATH_GULLIVER . "class.wysiwygEditor.php");
|
||||||
self::registerClass("Xml_Node", PATH_GULLIVER . "class.xmlDocument.php");
|
self::registerClass("Xml_Node", PATH_GULLIVER . "class.xmlDocument.php");
|
||||||
@@ -162,8 +158,6 @@ class Bootstrap
|
|||||||
self::registerClass("XmlForm_Field_DVEditor", PATH_GULLIVER . "class.xmlformExtension.php");
|
self::registerClass("XmlForm_Field_DVEditor", PATH_GULLIVER . "class.xmlformExtension.php");
|
||||||
self::registerClass("XmlForm_Field_FastSearch", PATH_GULLIVER . "class.xmlformExtension.php");
|
self::registerClass("XmlForm_Field_FastSearch", PATH_GULLIVER . "class.xmlformExtension.php");
|
||||||
self::registerClass("xmlformTemplate", PATH_GULLIVER . "class.xmlformTemplate.php");
|
self::registerClass("xmlformTemplate", PATH_GULLIVER . "class.xmlformTemplate.php");
|
||||||
self::registerClass("ymlDomain", PATH_GULLIVER . "class.ymlDomain.php");
|
|
||||||
self::registerClass("ymlTestCases", PATH_GULLIVER . "class.ymlTestCases.php");
|
|
||||||
|
|
||||||
// ProcessMaker classes
|
// ProcessMaker classes
|
||||||
self::registerClass("InvalidIndexSearchTextException", PATH_CLASSES . "class.AppSolr.php");
|
self::registerClass("InvalidIndexSearchTextException", PATH_CLASSES . "class.AppSolr.php");
|
||||||
|
|||||||
@@ -1,88 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* class.dvEditor.php
|
|
||||||
*
|
|
||||||
* @package gulliver.system
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2011 Colosa Inc.
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
//XmlForm_Field_DVEditor
|
|
||||||
/**
|
|
||||||
* XmlForm_Field_HTML class definition
|
|
||||||
* It is useful to see dynaforms how are built
|
|
||||||
*
|
|
||||||
* @package gulliver.system
|
|
||||||
* @author
|
|
||||||
*
|
|
||||||
* @copyright (C) 2002 by Colosa Development Team.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
class XmlForm_Field_HTML extends XmlForm_Field
|
|
||||||
{
|
|
||||||
public $toolbarSet = 'smallToolBar';
|
|
||||||
public $width = '100%';
|
|
||||||
public $height = '200';
|
|
||||||
public $defaultValue = '<br/>';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* render function is drawing the dynaform
|
|
||||||
*
|
|
||||||
* @author
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @param string $value
|
|
||||||
* @param string $owner
|
|
||||||
* @return string
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public function render($value = null, $owner = null)
|
|
||||||
{
|
|
||||||
$value = ($value == '') ? '<br/>' : $value;
|
|
||||||
$html = "<div style='width:" . $this->width . ";'>";
|
|
||||||
$html .= "<input id='form[" . $this->name . "]' name='form[" . $this->name . "]' type='hidden' value=' " . htmlentities( $value, ENT_QUOTES, 'UTF-8' ) . "' />";
|
|
||||||
$html .= "</div>";
|
|
||||||
return $html;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* attachEvents function is putting its events
|
|
||||||
*
|
|
||||||
* @author
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @param string $element
|
|
||||||
* @return string
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public function attachEvents ($element)
|
|
||||||
{
|
|
||||||
$html = 'window._editor' . $this->name . '=new DVEditor(getField("' . $this->name . '").parentNode,getField("' . $this->name . '").value,element,"' . $this->height . '","' . $this->mode . '");';
|
|
||||||
if ($this->mode == "edit") {
|
|
||||||
$html .= 'window._editor' . $this->name . '.loadToolBar("/js/dveditor/core/toolbars/' . $this->toolbarSet . '.html");';
|
|
||||||
}
|
|
||||||
$html .= 'window._editor' . $this->name . '.syncHidden("window._editor' . $this->name . '");';
|
|
||||||
return $html;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* class.functionTest.php
|
|
||||||
*
|
|
||||||
* @package gulliver.system
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2011 Colosa Inc.
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @package gulliver.system
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
class functionTest
|
|
||||||
{
|
|
||||||
public $dbc;
|
|
||||||
public $times;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Starts functionTest with a database connection
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @param string $dbc
|
|
||||||
* @return void
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public function functionTest ($dbc)
|
|
||||||
{
|
|
||||||
$this->dbc = $dbc;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* this function is a sample
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @param string $testCase
|
|
||||||
* @param string $testDomain
|
|
||||||
* @param string $limeTestObject
|
|
||||||
* @return ok
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public function sample ($testCase, &$testDomain, &$limeTestObject)
|
|
||||||
{
|
|
||||||
return "OK";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,199 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* class.testTools.php
|
|
||||||
*
|
|
||||||
* @package gulliver.system
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2011 Colosa Inc.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @package gulliver.system
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
G::LoadSystem( 'ymlDomain' );
|
|
||||||
G::LoadSystem( 'ymlTestCases' );
|
|
||||||
G::LoadSystem( 'unitTest' );
|
|
||||||
|
|
||||||
class testTools
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* importDB
|
|
||||||
*
|
|
||||||
* @param string $host
|
|
||||||
* @param string $user
|
|
||||||
* @param string $password
|
|
||||||
* @param string $database
|
|
||||||
* @param string $importFile
|
|
||||||
*
|
|
||||||
* @return none
|
|
||||||
*/
|
|
||||||
function importDB ($host, $user, $password, $database, $importFile)
|
|
||||||
{
|
|
||||||
exec( "mysql -h " . $host . " --user=" . $user . " --password=" . $password . " $database < $importFile" );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* importLocalDB
|
|
||||||
*
|
|
||||||
* @param string $importFile
|
|
||||||
*
|
|
||||||
* @return none
|
|
||||||
*/
|
|
||||||
function importLocalDB ($importFile)
|
|
||||||
{
|
|
||||||
self::importDB( DB_HOST, DB_USER, DB_PASS, DB_NAME, $importFile );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* callMethod
|
|
||||||
*
|
|
||||||
* @param string $methodFile
|
|
||||||
* @param string $GET
|
|
||||||
* @param string $POST
|
|
||||||
* @param string $SESSION
|
|
||||||
*
|
|
||||||
* @return none
|
|
||||||
*/
|
|
||||||
function callMethod ($methodFile, $GET, $POST, $SESSION)
|
|
||||||
{
|
|
||||||
//TODO $_SERVER
|
|
||||||
self::arrayDelete( $_GET );
|
|
||||||
self::arrayDelete( $_POST );
|
|
||||||
self::arrayDelete( $_SESSION );
|
|
||||||
self::arrayAppend( $_GET, $GET );
|
|
||||||
self::arrayAppend( $_POST, $POST );
|
|
||||||
self::arrayAppend( $_SESSION, $SESSION );
|
|
||||||
include (PATH_CORE . 'methods/' . $methodFile);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* arrayAppend
|
|
||||||
*
|
|
||||||
* @param string &$to
|
|
||||||
* @param string $appendFrom
|
|
||||||
*
|
|
||||||
* @return boolean true
|
|
||||||
*/
|
|
||||||
function arrayAppend (&$to, $appendFrom)
|
|
||||||
{
|
|
||||||
foreach ($appendFrom as $appendItem) {
|
|
||||||
$to[] = $appendItem;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* arrayDelete
|
|
||||||
*
|
|
||||||
* @param array &$array
|
|
||||||
*
|
|
||||||
* @return boolean true
|
|
||||||
*/
|
|
||||||
function arrayDelete (&$array)
|
|
||||||
{
|
|
||||||
foreach ($array as $key => $value) {
|
|
||||||
unset( $array[$key] );
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* replaceVariables
|
|
||||||
*
|
|
||||||
* @param string $Fields
|
|
||||||
* @param array $ExternalVariables
|
|
||||||
*
|
|
||||||
* @return array $Fields
|
|
||||||
*/
|
|
||||||
//@@
|
|
||||||
function replaceVariables ($Fields, $ExternalVariables = array())
|
|
||||||
{
|
|
||||||
//TODO: Verify dependencies between fields
|
|
||||||
foreach ($Fields as $key => $field) {
|
|
||||||
if (is_string( $field )) {
|
|
||||||
$mergedValues = G::array_merges( $Fields, $ExternalVariables );
|
|
||||||
$Fields[$key] = G::ReplaceDataField( $field, $mergedValues );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $Fields;
|
|
||||||
}
|
|
||||||
|
|
||||||
// EXTRA TOOLS
|
|
||||||
/**
|
|
||||||
* findValue
|
|
||||||
*
|
|
||||||
* @param string $value
|
|
||||||
* @param object &$obj
|
|
||||||
*
|
|
||||||
* @return (boolean | string) ((true | false) | $value)
|
|
||||||
*/
|
|
||||||
function findValue ($value, &$obj)
|
|
||||||
{
|
|
||||||
if (is_array( $obj )) {
|
|
||||||
foreach ($obj as $key => $val) {
|
|
||||||
if ($res = self::findValue( $value, $obj[$key] )) {
|
|
||||||
if ($res == true) {
|
|
||||||
return $key;
|
|
||||||
} else {
|
|
||||||
return $key . '.' . $res;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
} elseif (is_object( $obj )) {
|
|
||||||
foreach ($obj as $key => $val) {
|
|
||||||
if ($res = self::findValue( $value, $obj->$key )) {
|
|
||||||
if ($res == true) {
|
|
||||||
return $key;
|
|
||||||
} else {
|
|
||||||
return $key . '.' . $res;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
return $obj == $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Some extra global functions */
|
|
||||||
/**
|
|
||||||
* domain
|
|
||||||
*
|
|
||||||
* @param string $location *
|
|
||||||
* @return object $result
|
|
||||||
*/
|
|
||||||
|
|
||||||
function domain ($location)
|
|
||||||
{
|
|
||||||
global $testDomain;
|
|
||||||
$result = $testDomain->get( $location );
|
|
||||||
if (count( $result ) == 0) {
|
|
||||||
trigger_error( "'$location' is an empty domain.", E_USER_WARNING );
|
|
||||||
}
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* class.unitTest.php
|
|
||||||
*
|
|
||||||
* @package gulliver.system
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2011 Colosa Inc.
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @package gulliver.system
|
|
||||||
*/
|
|
||||||
|
|
||||||
class unitTest
|
|
||||||
{
|
|
||||||
var $dbc;
|
|
||||||
var $times;
|
|
||||||
var $yml;
|
|
||||||
var $domain;
|
|
||||||
var $testLime;
|
|
||||||
|
|
||||||
function unitTest ($ymlFile, &$testLime, &$testDomain)
|
|
||||||
{
|
|
||||||
if (! isset( $testDomain )) {
|
|
||||||
$testDomain = new ymlDomain();
|
|
||||||
}
|
|
||||||
$this->domain = & $testDomain;
|
|
||||||
$this->testLime = & $testLime;
|
|
||||||
$this->yml = new ymlTestCases( $ymlFile, $this->domain, $this->testLime );
|
|
||||||
}
|
|
||||||
//Load a Test (group of unitary tests) defined in the Yml file.
|
|
||||||
function load ($testName, $fields = array())
|
|
||||||
{
|
|
||||||
$this->yml->load( $testName, $fields );
|
|
||||||
}
|
|
||||||
//Run one single unit test from the loaded Test
|
|
||||||
function runSingle ($fields = array())
|
|
||||||
{
|
|
||||||
return $this->yml->runSingle( $this, $fields );
|
|
||||||
}
|
|
||||||
//Run a group of unit tests from the loaded Test
|
|
||||||
function runMultiple ($fields = array(), $count = -1, $start = 0)
|
|
||||||
{
|
|
||||||
return $this->yml->runMultiple( $this, $fields, $count, $start );
|
|
||||||
}
|
|
||||||
//Run all the unit tests from the loaded Test
|
|
||||||
function runAll ($fields = array())
|
|
||||||
{
|
|
||||||
return $this->yml->runMultiple( $this, $fields, - 1, 0 );
|
|
||||||
}
|
|
||||||
//A sample of "Function" to run a unit test.
|
|
||||||
function sampleTestFunction ($testCase, &$Fields)
|
|
||||||
{
|
|
||||||
$result = ($Fields['APP_UID'] != '') ? "OK" : "FALSE";
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,296 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* class.ymlDomain.php
|
|
||||||
*
|
|
||||||
* @package gulliver.system
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2011 Colosa Inc.
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @package gulliver.system
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
require_once (PATH_THIRDPARTY . 'lime/yaml.class.php');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ymlDomain class
|
|
||||||
*
|
|
||||||
* @copyright (C) 2002 by Colosa Development Team.
|
|
||||||
* @package gulliver.system
|
|
||||||
*/
|
|
||||||
|
|
||||||
class ymlDomain
|
|
||||||
{
|
|
||||||
public $global;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* function ymlDomain
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function ymlDomain ()
|
|
||||||
{
|
|
||||||
$this->global = sfYAML::Load( PATH_FIXTURES . 'domain.yml' );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* function addDomain
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @param string $domainName
|
|
||||||
* @return boolean
|
|
||||||
*/
|
|
||||||
public function addDomain ($domainName)
|
|
||||||
{
|
|
||||||
$keys = $this->name2keys( $domainName );
|
|
||||||
$currDomain = & $this->global;
|
|
||||||
$i = 0;
|
|
||||||
for ($i = 0; $i < count( $keys ); $i ++) {
|
|
||||||
if (is_array( $currDomain )) {
|
|
||||||
if (! isset( $currDomain[$keys[$i]] )) {
|
|
||||||
$currDomain[$keys[$i]] = array ();
|
|
||||||
}
|
|
||||||
$currDomain = & $currDomain[$keys[$i]];
|
|
||||||
} else {
|
|
||||||
trigger_error( "Operation not possible: Subdomain is not present $domainName", E_USER_ERROR );
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* function addDomainValue
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @param string $domainName
|
|
||||||
* @param string $value
|
|
||||||
* @return boolean
|
|
||||||
*/
|
|
||||||
public function addDomainValue ($domainName, $value)
|
|
||||||
{
|
|
||||||
$keys = $this->name2keys( $domainName );
|
|
||||||
$currDomain = & $this->global;
|
|
||||||
$i = 0;
|
|
||||||
for ($i = 0; $i < count( $keys ); $i ++) {
|
|
||||||
if (is_array( $currDomain )) {
|
|
||||||
$currDomain = & $currDomain[$keys[$i]];
|
|
||||||
} else {
|
|
||||||
trigger_error( "Operation not possible: Subdomain is not present $domainName", E_USER_ERROR );
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$currDomain[] = $value;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* function exists
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @param string $domainName
|
|
||||||
* @return boolean
|
|
||||||
*/
|
|
||||||
public function exists ($domainName)
|
|
||||||
{
|
|
||||||
$keys = $this->name2keys( $domainName );
|
|
||||||
$currDomain = & $this->global;
|
|
||||||
$i = 0;
|
|
||||||
for ($i = 0; $i < count( $keys ); $i ++) {
|
|
||||||
if (is_array( $currDomain ) && isset( $currDomain[$keys[$i]] )) {
|
|
||||||
$currDomain = & $currDomain[$keys[$i]];
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* function get
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @param string $resource
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function get ($resource)
|
|
||||||
{
|
|
||||||
if (is_array( $result = $this->load( $resource ) )) {
|
|
||||||
//Get one value per each $item
|
|
||||||
//Ex. *.first.name.es => Returns an array with all of the defined firstNames.
|
|
||||||
// first.name.es => Returns an array with one firstName.
|
|
||||||
// *.name.es => Returns an array with one value per each sub domain of name.es.
|
|
||||||
// For example: if name.es has the subdomains:
|
|
||||||
// first.name.es and last.name.es, it returns an array of
|
|
||||||
// two elements: one firstName and one lastName.
|
|
||||||
foreach ($result as $key => $item) {
|
|
||||||
if (is_array( $item )) {
|
|
||||||
$subResult = $this->plainArray( $item );
|
|
||||||
$result[$key] = $subResult[array_rand( $subResult, 1 )];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $result;
|
|
||||||
} else {
|
|
||||||
return array ('');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* function name2keys
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @param string $resource
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function name2keys ($resource)
|
|
||||||
{
|
|
||||||
if (strpos( $resource, '.' ) !== false) {
|
|
||||||
$revKeys = explode( '.', $resource );
|
|
||||||
$keys = array ();
|
|
||||||
for ($i = count( $revKeys ) - 1; $i >= 0; $i --) {
|
|
||||||
$keys[] = $revKeys[$i];
|
|
||||||
}
|
|
||||||
} elseif (strpos( $resource, '/' ) !== false) {
|
|
||||||
$rootKeys = explode( '/', $resource );
|
|
||||||
unset( $rootKeys[0] );
|
|
||||||
$keys = array_values( $rootKeys );
|
|
||||||
} else {
|
|
||||||
$keys = array ($resource );
|
|
||||||
}
|
|
||||||
return $keys;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* function load
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @param string $resource
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function load ($resource)
|
|
||||||
{
|
|
||||||
$keys = $this->name2keys( $resource );
|
|
||||||
//Find in global variable
|
|
||||||
if (count( $this->getNode( $keys[0], $this->global ) ) > 0) {
|
|
||||||
return $this->find( $keys, $this->global );
|
|
||||||
} else {
|
|
||||||
if (file_exists( PATH_FIXTURES . $keys[0] . '.yml' )) {
|
|
||||||
$local = sfYAML::Load( PATH_FIXTURES . $keys[0] . '.yml' );
|
|
||||||
unset( $keys[0] );
|
|
||||||
$keys = array_values( $keys );
|
|
||||||
return $this->find( $keys, $local );
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* function find
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @param string $nodesKey
|
|
||||||
* @param string $where
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function find ($nodesKey, $where)
|
|
||||||
{
|
|
||||||
if (count( $nodesKey ) == 1) {
|
|
||||||
return $this->getNode( $nodesKey[0], $where );
|
|
||||||
} elseif (count( $nodesKey ) > 1) {
|
|
||||||
$routes = $this->getNode( $nodesKey[0], $where );
|
|
||||||
$result = array ();
|
|
||||||
unset( $nodesKey[0] );
|
|
||||||
$nodesKey = array_values( $nodesKey );
|
|
||||||
foreach ($routes as $route) {
|
|
||||||
if (is_array( $route )) {
|
|
||||||
$subResult = $this->find( $nodesKey, $route );
|
|
||||||
$this->arrayAppend( $result, $subResult );
|
|
||||||
} else {
|
|
||||||
$result[] = $route;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $result;
|
|
||||||
} else {
|
|
||||||
return array ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* function getNode
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @param string $nodesKey
|
|
||||||
* @param string $from
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function getNode ($nodeKey, $from)
|
|
||||||
{
|
|
||||||
if ($nodeKey === '*') {
|
|
||||||
return array_values( $from );
|
|
||||||
} elseif (array_key_exists( $nodeKey, $from )) {
|
|
||||||
return array ($from[$nodeKey] );
|
|
||||||
} else {
|
|
||||||
return array ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* function plainArray
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @param array $array
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function plainArray ($array)
|
|
||||||
{
|
|
||||||
$result = array ();
|
|
||||||
foreach ($array as $item) {
|
|
||||||
if (is_array( $item )) {
|
|
||||||
$appResult = $this->plainArray( $item );
|
|
||||||
$this->arrayAppend( $result, $appResult );
|
|
||||||
} else {
|
|
||||||
$result[] = $item;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* function arrayAppend
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @param string $to
|
|
||||||
* @param string $appendFrom
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function arrayAppend (&$to, $appendFrom)
|
|
||||||
{
|
|
||||||
foreach ($appendFrom as $appendItem) {
|
|
||||||
$to[] = $appendItem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,275 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* class.ymlTestCases.php
|
|
||||||
*
|
|
||||||
* @package gulliver.system
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2011 Colosa Inc.
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/* Dependencies: class.ymlDomain.php; class.testTools.php
|
|
||||||
* +----------------------------+
|
|
||||||
* | STRUCTURE for ymlTestFile. |
|
|
||||||
* +----------------------------+
|
|
||||||
* TestCasesGroup1:
|
|
||||||
* - Un caso de prueba.
|
|
||||||
* Input:
|
|
||||||
* FIELD_A: "Value_Field_A"
|
|
||||||
* FIELD_B[]: "Domain_Field_A"
|
|
||||||
* Output:
|
|
||||||
* Type: "TypeOfResult" Type of data that should be the result.
|
|
||||||
* Value: "a:0{}" This node must contain a value that will be serialized compared with the test result.
|
|
||||||
* - Another test case.
|
|
||||||
* ...
|
|
||||||
* TestCasesGroup2:
|
|
||||||
* ...
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @package gulliver.system
|
|
||||||
*/
|
|
||||||
class ymlTestCases
|
|
||||||
{
|
|
||||||
public $testCaseFile;
|
|
||||||
public $testCases = array ();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* function TestCases
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @param string $testCaseFile
|
|
||||||
* @param string $testDomain
|
|
||||||
* @param string $testLime
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function ymlTestCases ($testCaseFile, &$testDomain, &$testLime)
|
|
||||||
{
|
|
||||||
$this->testDomain = & $testDomain;
|
|
||||||
$this->testLime = & $testLime;
|
|
||||||
if (basename( $testCaseFile ) === $testCaseFile) {
|
|
||||||
$testCaseFile = PATH_FIXTURES . $testCaseFile;
|
|
||||||
}
|
|
||||||
$this->testCaseFile = $testCaseFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* function load
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @param string $inputTestCasesIndex
|
|
||||||
* @param array $fields
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function load ($inputTestCasesIndex = 'TestCases', $fields = array())
|
|
||||||
{
|
|
||||||
$testCases = array ();
|
|
||||||
$input = sfYAML::Load( /*PATH_FIXTURES .*/ $this->testCaseFile );
|
|
||||||
foreach ($input[$inputTestCasesIndex] as $preTestCase) {
|
|
||||||
$testFunctionInputs = array ();
|
|
||||||
foreach ($preTestCase['Input'] as $inputArgument => $value) {
|
|
||||||
if (substr( $inputArgument, - 2, 2 ) === '[]') {
|
|
||||||
//DOMAIN
|
|
||||||
$inputArgument = substr( $inputArgument, 0, strlen( $inputArgument ) - 2 );
|
|
||||||
if (! isset( $testFunctionInputs[$inputArgument] )) {
|
|
||||||
$testFunctionInputs[$inputArgument] = array ();
|
|
||||||
}
|
|
||||||
//var_dump($this->testDomain->global,$this->testDomain->get( $value ), $value );
|
|
||||||
ymlDomain::arrayAppend( $testFunctionInputs[$inputArgument], $this->testDomain->get( $value ) );
|
|
||||||
} else {
|
|
||||||
//SPECIFIC VALUE
|
|
||||||
if (! isset( $testFunctionInputs[$inputArgument] )) {
|
|
||||||
$testFunctionInputs[$inputArgument] = array ();
|
|
||||||
}
|
|
||||||
ymlDomain::arrayAppend( $testFunctionInputs[$inputArgument], array ($value) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* Start Block: "Explode" all the posible test cases defined in the yml
|
|
||||||
* using domains and single values
|
|
||||||
*/
|
|
||||||
//Initialize $index key values for the first test case (5.2 array_fill_keys(array_keys($testFunctionInputs),0))
|
|
||||||
$index = array_combine( array_keys( $testFunctionInputs ), array_fill( 0, count( $testFunctionInputs ), 0 ) );
|
|
||||||
//array_product()
|
|
||||||
$prod = 1;
|
|
||||||
foreach ($testFunctionInputs as $values) {
|
|
||||||
$prod *= count( $values );
|
|
||||||
}
|
|
||||||
$lastCase = ($prod == 0);
|
|
||||||
while (! $lastCase) {
|
|
||||||
//foreach($index as $v) echo($v);echo("\n");
|
|
||||||
/* Put in $aux one test case */
|
|
||||||
$aux = array ();
|
|
||||||
foreach ($testFunctionInputs as $key => $values) {
|
|
||||||
$aux[$key] = $values[$index[$key]];
|
|
||||||
}
|
|
||||||
/* CREATE TEST CASE: Put $aux test case in $testCases array */
|
|
||||||
$i = count( $testCases );
|
|
||||||
$testCases[$i] = $preTestCase;
|
|
||||||
$testCases[$i]['Input'] = $aux;
|
|
||||||
/* Increse the $index key values to the next test case */
|
|
||||||
$lastCase = true;
|
|
||||||
foreach ($testFunctionInputs as $key => $values) {
|
|
||||||
$index[$key] ++;
|
|
||||||
if ($index[$key] >= count( $values )) {
|
|
||||||
$index[$key] = 0;
|
|
||||||
} else {
|
|
||||||
$lastCase = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*End Block */
|
|
||||||
}
|
|
||||||
/* Start Block: Replace @@ tags variables */
|
|
||||||
foreach ($testCases as $key => $testCase) {
|
|
||||||
$testCases[$key] = testTools::replaceVariables( $testCases[$key] );
|
|
||||||
$testCases[$key]['Input'] = testTools::replaceVariables( $testCases[$key]['Input'], $fields );
|
|
||||||
if (isset( $testCase['Output'] )) {
|
|
||||||
if (isset( $testCase['Output']['Value'] )) {
|
|
||||||
/*$testCases[$key]['Output']['Value'] =
|
|
||||||
unserialize($testCases[$key]['Output']['Value']);*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* End Block */
|
|
||||||
$this->testCases = $testCases;
|
|
||||||
return $testCases;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* function load
|
|
||||||
* Increase the number of "planned" tests.
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @param int $count
|
|
||||||
* @param int $start
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function addToPlan ($count = -1, $start = 0)
|
|
||||||
{
|
|
||||||
foreach ($this->testCases as $testCase) {
|
|
||||||
if (($start == 0) && ($count != 0)) {
|
|
||||||
if (isset( $testCase['TODO'] )) {
|
|
||||||
$this->testLime->plan ++;
|
|
||||||
} else {
|
|
||||||
if (isset( $testCase['Output'] )) {
|
|
||||||
if (isset( $testCase['Output']['Type'] ) || isset( $testCase['Output']['Value'] )) {
|
|
||||||
$this->testLime->plan ++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$start --;
|
|
||||||
if ($count > 0) {
|
|
||||||
$count --;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* function run
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @param object $testerObject
|
|
||||||
* @param array $fields
|
|
||||||
* @param int $count
|
|
||||||
* @param int $start
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function run (&$testerObject, $fields = array(), $count = -1, $start = 0)
|
|
||||||
{
|
|
||||||
$results = array ();
|
|
||||||
//$this->addToPlan( $count, $start );
|
|
||||||
$functions = get_class_methods( get_class( $testerObject ) );
|
|
||||||
foreach ($functions as $id => $fn) {
|
|
||||||
$functions[$id] = strtolower( $fn );
|
|
||||||
}
|
|
||||||
foreach ($this->testCases as $index => $testCase) {
|
|
||||||
if (($start == 0) && ($count != 0)) {
|
|
||||||
if (isset( $testCase['TODO'] )) {
|
|
||||||
$this->testLime->todo( $testCase['TODO'] );
|
|
||||||
} else {
|
|
||||||
if (isset( $testCase['Function'] )) {
|
|
||||||
if (array_search( strtolower( $testCase['Function'] ), $functions ) !== false) {
|
|
||||||
$testCase['Input'] = G::array_merges( $testCase['Input'], $fields );
|
|
||||||
$result = eval( 'return $testerObject->' . $testCase['Function'] . '($testCase, $testCase["Input"]);' );
|
|
||||||
$results[] = $result;
|
|
||||||
/* Start Block: Test the $result */
|
|
||||||
if (isset( $testCase['Output'] )) {
|
|
||||||
if (isset( $testCase['Output']['Value'] )) {
|
|
||||||
//$this->testLime->is( $result, $testCase['Output']['Value'], $testCase['Title'] );
|
|
||||||
$this->testLime->todo( ($testCase['Output']['Type']) );
|
|
||||||
$this->testLime->diag( "/processmaker/trunk/gulliver/system/class.ymlTestCases.php at line 204" );
|
|
||||||
} elseif (isset( $testCase['Output']['Type'] )) {
|
|
||||||
// $this->testLime->isa_ok( $result, $testCase['Output']['Type'], $testCase['Title'] );
|
|
||||||
$this->testLime->todo( ($testCase['Output']['Type']) );
|
|
||||||
$this->testLime->diag( "/processmaker/trunk/gulliver/system/class.ymlTestCases.php at line 204" );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* End Block */
|
|
||||||
} else {
|
|
||||||
$this->testLime->fail( 'Case #' . $index . ': Test function (Function) is not present in tester object.' );
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$this->testLime->fail( 'Case #' . $index . ' doesn\'t have a test function (Function) defined.' );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$start --;
|
|
||||||
if ($count > 0) {
|
|
||||||
$count --;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $results;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* function runSingle
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @param object $testerObject
|
|
||||||
* @param array $fields
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function runSingle (&$testerObject, $fields = array())
|
|
||||||
{
|
|
||||||
$results = $this->run( $testerObject, $fields, 1, 0 );
|
|
||||||
return $results[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* function runMultiple
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @param object $testerObject
|
|
||||||
* @param array $fields
|
|
||||||
* @param int $count
|
|
||||||
* @param int $start
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function runMultiple (&$testerObject, $fields = array(), $count = -1, $start = 0)
|
|
||||||
{
|
|
||||||
return $this->run( $testerObject, $fields, $count, $start );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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
@@ -1,304 +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;
|
|
||||||
chars = '|32|46|62|'; // charcodes that trigger syntax highlighting
|
|
||||||
cc = '\u2009'; // carret char
|
|
||||||
editor = document.getElementsByTagName('pre')[0];
|
|
||||||
editor.contentEditable = 'true';
|
|
||||||
document.getElementsByTagName('body')[0].onfocus = function() {editor.focus();}
|
|
||||||
document.attachEvent('onkeydown', this.metaHandler);
|
|
||||||
document.attachEvent('onkeypress', this.keyHandler);
|
|
||||||
window.attachEvent('onscroll', function() { if(!CodePress.scrolling) setTimeout(function(){CodePress.syntaxHighlight('scroll')},1)});
|
|
||||||
completeChars = this.getCompleteChars();
|
|
||||||
completeEndingChars = this.getCompleteEndingChars();
|
|
||||||
setTimeout(function() { window.scroll(0,0) },50); // scroll IE to top
|
|
||||||
},
|
|
||||||
|
|
||||||
// treat key bindings
|
|
||||||
keyHandler : function(evt) {
|
|
||||||
charCode = evt.keyCode;
|
|
||||||
fromChar = String.fromCharCode(charCode);
|
|
||||||
|
|
||||||
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||charCode==13) { // syntax highlighting
|
|
||||||
CodePress.syntaxHighlight('generic');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
metaHandler : function(evt) {
|
|
||||||
keyCode = evt.keyCode;
|
|
||||||
|
|
||||||
if(keyCode==9 || evt.tabKey) {
|
|
||||||
CodePress.snippets();
|
|
||||||
}
|
|
||||||
else if((keyCode==122||keyCode==121||keyCode==90) && evt.ctrlKey) { // undo and redo
|
|
||||||
(keyCode==121||evt.shiftKey) ? CodePress.actions.redo() : CodePress.actions.undo();
|
|
||||||
evt.returnValue = false;
|
|
||||||
}
|
|
||||||
else if(keyCode==34||keyCode==33) { // handle page up/down for IE
|
|
||||||
self.scrollBy(0, (keyCode==34) ? 200 : -200);
|
|
||||||
evt.returnValue = false;
|
|
||||||
}
|
|
||||||
else if(keyCode==46||keyCode==8) { // save to history when delete or backspace pressed
|
|
||||||
CodePress.actions.history[CodePress.actions.next()] = editor.innerHTML;
|
|
||||||
}
|
|
||||||
else if((evt.ctrlKey || evt.metaKey) && evt.shiftKey && keyCode!=90) { // shortcuts = ctrl||appleKey+shift+key!=z(undo)
|
|
||||||
CodePress.shortcuts(keyCode);
|
|
||||||
evt.returnValue = false;
|
|
||||||
}
|
|
||||||
else if(keyCode==86 && evt.ctrlKey) { // handle paste
|
|
||||||
window.clipboardData.setData('Text',window.clipboardData.getData('Text').replace(/\t/g,'\u2008'));
|
|
||||||
top.setTimeout(function(){CodePress.syntaxHighlight('paste');},10);
|
|
||||||
}
|
|
||||||
else if(keyCode==67 && evt.ctrlKey) { // handle cut
|
|
||||||
// window.clipboardData.setData('Text',x[0]);
|
|
||||||
// code = window.clipboardData.getData('Text');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// put cursor back to its original position after every parsing
|
|
||||||
|
|
||||||
|
|
||||||
findString : function() {
|
|
||||||
range = self.document.body.createTextRange();
|
|
||||||
if(range.findText(cc)){
|
|
||||||
range.select();
|
|
||||||
range.text = '';
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// 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.substring(code.indexOf('<P>'),code.lastIndexOf('</P>')+4);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// syntax highlighting parser
|
|
||||||
syntaxHighlight : function(flag) {
|
|
||||||
if(flag!='init') document.selection.createRange().text = cc;
|
|
||||||
o = editor.innerHTML;
|
|
||||||
if(flag=='paste') { // fix pasted text
|
|
||||||
o = o.replace(/<BR>/g,'\r\n');
|
|
||||||
o = o.replace(/\u2008/g,'\t');
|
|
||||||
}
|
|
||||||
o = o.replace(/<P>/g,'\n');
|
|
||||||
o = o.replace(/<\/P>/g,'\r');
|
|
||||||
o = o.replace(/<.*?>/g,'');
|
|
||||||
o = o.replace(/ /g,'');
|
|
||||||
o = '<PRE><P>'+o+'</P></PRE>';
|
|
||||||
o = o.replace(/\n\r/g,'<P></P>');
|
|
||||||
o = o.replace(/\n/g,'<P>');
|
|
||||||
o = o.replace(/\r/g,'<\/P>');
|
|
||||||
o = o.replace(/<P>(<P>)+/,'<P>');
|
|
||||||
o = o.replace(/<\/P>(<\/P>)+/,'</P>');
|
|
||||||
o = o.replace(/<P><\/P>/g,'<P><BR/></P>');
|
|
||||||
x = z = this.split(o,flag);
|
|
||||||
|
|
||||||
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.replace(z,x);
|
|
||||||
if(flag!='init') this.findString();
|
|
||||||
},
|
|
||||||
|
|
||||||
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,'</P><P>');
|
|
||||||
var pattern = new RegExp(trigger+cc,"gi");
|
|
||||||
this.syntaxHighlight('snippets',pattern,content);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
readOnly : function() {
|
|
||||||
editor.contentEditable = (arguments[0]) ? 'false' : 'true';
|
|
||||||
},
|
|
||||||
|
|
||||||
complete : function(trigger) {
|
|
||||||
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);
|
|
||||||
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 = document.selection.createRange();
|
|
||||||
try {
|
|
||||||
range.moveEnd('character', 1)
|
|
||||||
}
|
|
||||||
catch(e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
var next_character = range.text
|
|
||||||
range.moveEnd('character', -1)
|
|
||||||
if(next_character != trigger ) return false;
|
|
||||||
else {
|
|
||||||
range.moveEnd('character', 1)
|
|
||||||
range.text=''
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
shortcuts : function() {
|
|
||||||
var cCode = arguments[0];
|
|
||||||
if(cCode==13) cCode = '[enter]';
|
|
||||||
else if(cCode==32) cCode = '[space]';
|
|
||||||
else cCode = '['+String.fromCharCode(keyCode).toLowerCase()+']';
|
|
||||||
for(var i=0;i<Language.shortcuts.length;i++)
|
|
||||||
if(Language.shortcuts[i].input == cCode)
|
|
||||||
this.insertCode(Language.shortcuts[i].output,false);
|
|
||||||
},
|
|
||||||
|
|
||||||
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();
|
|
||||||
},
|
|
||||||
|
|
||||||
getRangeAndCaret : function() {
|
|
||||||
var range = document.selection.createRange();
|
|
||||||
var caret = Math.abs(range.moveStart('character', -1000000)+1);
|
|
||||||
range = this.getCode();
|
|
||||||
range = range.replace(/\n\r/gi,' ');
|
|
||||||
range = range.replace(/\n/gi,'');
|
|
||||||
return [range.toString(),caret];
|
|
||||||
},
|
|
||||||
|
|
||||||
insertCode : function(code,replaceCursorBefore) {
|
|
||||||
var repdeb = '';
|
|
||||||
var repfin = '';
|
|
||||||
|
|
||||||
if(replaceCursorBefore) { repfin = code; }
|
|
||||||
else { repdeb = code; }
|
|
||||||
|
|
||||||
if(typeof document.selection != 'undefined') {
|
|
||||||
var range = document.selection.createRange();
|
|
||||||
range.text = repdeb + repfin;
|
|
||||||
range = document.selection.createRange();
|
|
||||||
range.move('character', -repfin.length);
|
|
||||||
range.select();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// get code from editor
|
|
||||||
getCode : function() {
|
|
||||||
var code = editor.innerHTML;
|
|
||||||
code = code.replace(/<br>/g,'\n');
|
|
||||||
code = code.replace(/<\/p>/gi,'\r');
|
|
||||||
code = code.replace(/<p>/i,''); // IE first line fix
|
|
||||||
code = code.replace(/<p>/gi,'\n');
|
|
||||||
code = code.replace(/ /gi,'');
|
|
||||||
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 = '<pre>'+code+'</pre>';
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
// undo and redo methods
|
|
||||||
actions : {
|
|
||||||
pos : -1, // actual history position
|
|
||||||
history : [], // history vector
|
|
||||||
|
|
||||||
undo : function() {
|
|
||||||
if(editor.innerHTML.indexOf(cc)==-1){
|
|
||||||
document.selection.createRange().text = 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.attachEvent('onload', function() { CodePress.initialize('new');});
|
|
||||||
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
@@ -1,443 +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>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
body {color:#000;background-color:white;font:15px georgia, "Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif; letter-spacing:0.01em;margin:15px;}
|
|
||||||
p {margin:0 0 15px 0;}
|
|
||||||
a,a:visited {color:#7f0055;}
|
|
||||||
select {background:#ffffe1;}
|
|
||||||
button {margin-top:5px;}
|
|
||||||
button.actions {width:171px;font-family:arial;}
|
|
||||||
h1 {color:#7f0055;margin:0;padding:0;font-size:42px;font-weight:normal;}
|
|
||||||
h1 a {text-decoration:none;}
|
|
||||||
h2 {margin:0;}
|
|
||||||
h2 a {text-decoration:none;font-weight:normal;font-size:22px;color:black !important;}
|
|
||||||
h3 {font-size:20px;font-weight:normal;padding:0;margin:25px 0 5px 0;color:#7f0055;font-weight:bold;border-bottom:2px dotted #d8d8d8;}
|
|
||||||
h4 {font-size:18px;font-weight:normal;z-index:0;}
|
|
||||||
code {color:#0080c0;font-size:13px;font-weight:bold;}
|
|
||||||
ol, ul {padding:5px 0 5px 25px;margin:0;}
|
|
||||||
ol li, ul li {margin:8px 0 8px 0;}
|
|
||||||
|
|
||||||
#logo {text-align:center;background-color:#d6d6d6;padding:10px;-moz-border-radius:5px;border:1px solid silver;}
|
|
||||||
#container {width:700px;margin:20px auto;padding:25px;border:3px solid #d9d9d9;-moz-border-radius:10px;background:#f8f8f8;}
|
|
||||||
#languages {margin:5px 0;}
|
|
||||||
|
|
||||||
#menu {width:100%;background:#7f0055;-moz-border-radius:4px;}
|
|
||||||
#menu a {font:bold 17px georgia;color:white;padding:4px;display:block;border-left:1px solid white;text-align:center;text-decoration:none;}
|
|
||||||
#menu a:hover {background:#b9669e;}
|
|
||||||
|
|
||||||
.hidden-code {display:none;}
|
|
||||||
.copycode {border:1px dotted gray;padding:10px;background:white;font-family:monospace;color:gray}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<div id="container">
|
|
||||||
|
|
||||||
<div id="logo">
|
|
||||||
<h1><a href="http://codepress.org/">CodePress</a></h1>
|
|
||||||
<h2><a href="http://codepress.org/">Online Real Time Syntax Highlighting Editor</a></h2>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<br />
|
|
||||||
|
|
||||||
<table cellpadding="0" cellspacing="0" id="menu">
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<a href="http://www.codepress.org/index.php">Home/Download</a>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<a href="http://www.codepress.org/install.php"> Install </a>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<a href="http://www.codepress.org/to-do.php"> To-do </a>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<a href="http://www.codepress.org/about.php" id="about"> About </a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<h4>
|
|
||||||
CodePress is web-based source code editor with syntax highlighting written in JavaScript that colors text in real time while it's being typed in the browser.
|
|
||||||
</h4>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Go to <strong><a href="http://codepress.org/">http://codepress.org/</a></strong> for updates.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h3>Demo</h3>
|
|
||||||
<div id="languages">
|
|
||||||
<em>choose example in:</em>
|
|
||||||
<button onclick="cp1.edit('cp-php','php')">PHP</button>
|
|
||||||
<button onclick="cp1.edit('cp-javascript','javascript')">JavaScript</button>
|
|
||||||
<button onclick="cp1.edit('cp-java','java')">Java</button>
|
|
||||||
<button onclick="cp1.edit('cp-perl','perl')">Perl</button>
|
|
||||||
<button onclick="cp1.edit('cp-sql','sql')">SQL</button>
|
|
||||||
<button onclick="cp1.edit('cp-html','html')">HTML</button>
|
|
||||||
<button onclick="cp1.edit('cp-css','css')">CSS</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<textarea id="cp1" class="codepress php" style="width:700px;height:300px;" wrap="off">
|
|
||||||
<?php
|
|
||||||
// Very simple implementation of server side script
|
|
||||||
|
|
||||||
if(isset($_GET['file'])) {
|
|
||||||
$file = basename($_GET['file']);
|
|
||||||
$full_file = $path['server'].'/'.$path['webdocs'].'/'.$path['files']."/".$file;
|
|
||||||
if(file_exists($full_file)) {
|
|
||||||
$code = file_get_contents($full_file);
|
|
||||||
$code = preg_replace("/>/","&gt;",$code);
|
|
||||||
$code = preg_replace("/</","&lt;",$code);
|
|
||||||
$language = getLanguage($file);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
<!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>
|
|
||||||
<link type="text/css" href="languages/codepress-<?=$language?>.css" rel="stylesheet" id="cp-lang-style" />
|
|
||||||
<script type="text/javascript" src="codepress.js"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
CodePress.language = '<?=$language?>';
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body id="ffedt"><pre id="ieedt"><?=$code?></pre></body>
|
|
||||||
</html>
|
|
||||||
</textarea>
|
|
||||||
|
|
||||||
<br /><br />
|
|
||||||
|
|
||||||
<textarea id="codepress2" class="codepress javascript linenumbers-off" style="width:700px;height:200px;" wrap="off">
|
|
||||||
//set language
|
|
||||||
this.setLanguage = function() {
|
|
||||||
if(arguments[0]) {
|
|
||||||
language = (typeof(Content.languages[arguments[0]])!='undefined') ? arguments[0] : this.setLanguage();
|
|
||||||
cpLanguage.innerHTML = Content.languages[language].name;
|
|
||||||
if(cpBody.document.designMode=='on') cpBody.document.designMode = 'off';
|
|
||||||
CodePress.loadScript(cpBody.document, '../languages/'+language+'.js', function () { cpBody.CodePress.syntaxHighlight('init'); })
|
|
||||||
cpBody.document.getElementById('cp-lang-style').href = '../languages/'+language+'.css';
|
|
||||||
this.hideMenu();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
var extension = filename.replace(/.*\.([^\.]+)$/,'$1');
|
|
||||||
var aux = false;
|
|
||||||
for(lang in Content.languages) {
|
|
||||||
extensions = ','+Content.languages[lang].extensions+',';
|
|
||||||
if(extensions.match(','+extension+',')) aux = lang;
|
|
||||||
}
|
|
||||||
language = (aux) ? aux : 'generic';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</textarea>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<button class="actions" onclick="alert(codepress2.getCode())">get code from editor</button>
|
|
||||||
<button class="actions" onclick="codepress2.toggleEditor()">turn on/off CodePress</button>
|
|
||||||
<button class="actions" onclick="codepress2.toggleLineNumbers()">show/hide line numbers</button>
|
|
||||||
<button class="actions" onclick="codepress2.toggleAutoComplete()">turn on/off auto-complete</button>
|
|
||||||
<button class="actions" onclick="codepress2.toggleReadOnly()">turn on/off read only</button>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h3>Installation</h3>
|
|
||||||
<ol>
|
|
||||||
<li>
|
|
||||||
<p>
|
|
||||||
<a href="http://codepress.org/">Download</a> and uncompress CodePress under a directory inside your webserver.<br>
|
|
||||||
Example:<strong> http://yourserver/codepress/</strong><br />
|
|
||||||
Since CodePress is pure JavaScript and HTML, you can also test it without a webserver.
|
|
||||||
</p>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<p>
|
|
||||||
Insert CodePress script somewhere in your page inside the <code><head></code> or above the <code></body></code> tag.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p class="copycode">
|
|
||||||
<script src="/codepress/codepress.js" type="text/javascript"></script>
|
|
||||||
</p>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<p>
|
|
||||||
Add the <code><textarea></code> tag to the place on your page you want CodePress to appear. CodePress will inherit the width and height of your textarea.
|
|
||||||
When the page loads, it will automatically replace your textarea with a CodePress window.
|
|
||||||
</p>
|
|
||||||
<p class="copycode">
|
|
||||||
<textarea id="myCpWindow" class="codepress javascript linenumbers-off"><br />
|
|
||||||
// your code here<br />
|
|
||||||
</textarea>
|
|
||||||
</p>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
The <code>javascript</code> portion of the class="" means that the language being edited is JavaScript.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
The <code>codepress</code> portion of the class="" is mandatory and indicates a textarea to be replaced for a CodePress window.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
Other class options are <code>linenumbers-off</code>, <code>autocomplete-off</code> and <code>readonly-on</code>.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
Careful not to use the same id for two different CodePress windows (<code><textarea id="<strong>xx</strong>"...></code>)
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ol>
|
|
||||||
|
|
||||||
<h3>You also can...</h3>
|
|
||||||
<ol>
|
|
||||||
<li>
|
|
||||||
Open/edit code from a different textarea.<br />
|
|
||||||
Example: <code>textarea_id.edit('other_textarea_id','language')</code><br>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
Get code from CodePress window.<br />
|
|
||||||
Example: <code>textarea_id.getCode()</code><br>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
Turn on/off CodePress editor and return to the regular textarea.<br />
|
|
||||||
Example: <code>textarea_id.toggleEditor()</code><br>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
Turn on/off line numbers.<br />
|
|
||||||
Example: <code>textarea_id.toggleLineNumbers()</code><br>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
Turn on/off read only.<br />
|
|
||||||
Example: <code>textarea_id.toggleReadOnly()</code><br>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
Turn on/off auto-complete.<br />
|
|
||||||
Example: <code>textarea_id.toggleAutoComplete()</code><br>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ol>
|
|
||||||
|
|
||||||
<!-- p>
|
|
||||||
You may want to use [id].getCode() to get the content code from CodePress window and save it to your server since CodePress only edit files and do not save them.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
You may also want to open files from server. You'll have to write a server side script and replace the JavaScript call on codepress.js from codepress.html to codepress.php (if your server side language is PHP, of course).
|
|
||||||
</p -->
|
|
||||||
|
|
||||||
<h3>License</h3>
|
|
||||||
<p>
|
|
||||||
CodePress is distributed under the <a href="http://www.opensource.org/licenses/lgpl-license.php">LGPL</a>. If your software is <a href="http://www.gnu.org/philosophy/license-list.html#GPLCompatibleLicenses">compatible</a> with this licence or it is under <a href="http://creativecommons.org/">Creative Commons</a>, you can use it as you want. Just keep the credits somewhere around.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
|
|
||||||
</div><!--/container-->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- hidden codes for loading -->
|
|
||||||
<textarea id="cp-php" class="hidden-code">
|
|
||||||
<?php
|
|
||||||
// Very simple implementation of server side script
|
|
||||||
|
|
||||||
if(isset($_GET['file'])) {
|
|
||||||
$file = basename($_GET['file']);
|
|
||||||
$full_file = $path['server'].'/'.$path['webdocs'].'/'.$path['files']."/".$file;
|
|
||||||
if(file_exists($full_file)) {
|
|
||||||
$code = file_get_contents($full_file);
|
|
||||||
$code = preg_replace("/>/","&gt;",$code);
|
|
||||||
$code = preg_replace("/</","&lt;",$code);
|
|
||||||
$language = getLanguage($file);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
<!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>
|
|
||||||
<link type="text/css" href="languages/codepress-<?=$language?>.css" rel="stylesheet" id="cp-lang-style" />
|
|
||||||
<script type="text/javascript" src="codepress.js"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
CodePress.language = '<?=$language?>';
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body id="ffedt"><pre id="ieedt"><?=$code?></pre></body>
|
|
||||||
</html>
|
|
||||||
</textarea>
|
|
||||||
|
|
||||||
<textarea id="cp-javascript" class="hidden-code">
|
|
||||||
CodePress = function(obj) {
|
|
||||||
var self = document.createElement('iframe');
|
|
||||||
self.textarea = obj;
|
|
||||||
self.textarea.disabled = true;
|
|
||||||
self.style.height = self.textarea.clientHeight +'px';
|
|
||||||
self.style.width = self.textarea.clientWidth +'px';
|
|
||||||
|
|
||||||
self.initialize = function() {
|
|
||||||
self.editor = self.contentWindow.CodePress;
|
|
||||||
self.editor.body = self.contentWindow.document.getElementsByTagName('body')[0];
|
|
||||||
self.editor.setCode(self.textarea.value);
|
|
||||||
self.editor.syntaxHighlight('init');
|
|
||||||
}
|
|
||||||
|
|
||||||
self.edit = function(id,language) {
|
|
||||||
self.language = (language) ? language : self.textarea.className.replace(/ ?codepress ?/,'');
|
|
||||||
self.src = cpPath+'modules/codepress.html?engine='+self.getEngine()+'&language='+self.language;
|
|
||||||
if(self.attachEvent) self.attachEvent('onload',self.initialize);
|
|
||||||
else self.addEventListener('load',self.initialize,false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</textarea>
|
|
||||||
|
|
||||||
<textarea id="cp-autoit" class="hidden-code">
|
|
||||||
#include
|
|
||||||
IsNumber(15)
|
|
||||||
@Macro
|
|
||||||
;comment
|
|
||||||
$var = "string"
|
|
||||||
</textarea>
|
|
||||||
|
|
||||||
<textarea id="cp-java" class="hidden-code">
|
|
||||||
import java.io.FileFilter;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.PrintWriter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Project ECCO - File manager class
|
|
||||||
* @author Fernando M.A.d.S.
|
|
||||||
*/
|
|
||||||
public class FileManager extends HttpServlet {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
private static String login = "feanndor"; // session var should come here
|
|
||||||
private static String usersPath = System.getProperty("user.dir")+File.separator+"htdocs"+File.separator+"ecco"+File.separator+"users"+File.separator;
|
|
||||||
private static File dir = new File(usersPath+login+File.separator);
|
|
||||||
static boolean existDirectories = false;
|
|
||||||
static int isDirectory = 0;
|
|
||||||
|
|
||||||
public FileFilter filterFiles(File dir) {
|
|
||||||
return (new FileFilter() {
|
|
||||||
public boolean accept(File pathname) {
|
|
||||||
return !(pathname.isDirectory());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</textarea>
|
|
||||||
|
|
||||||
<textarea id="cp-perl" class="hidden-code">
|
|
||||||
#!/usr/bin/perl
|
|
||||||
# The first line of the script envokes Perl
|
|
||||||
|
|
||||||
# Scalar variables
|
|
||||||
$var1 = "Hello World";
|
|
||||||
$var2 = 14.6;
|
|
||||||
|
|
||||||
# Array variables
|
|
||||||
@arr1 = ("zero","one","two","three","four");
|
|
||||||
|
|
||||||
# Hash variable, or associative array
|
|
||||||
%hash1 = ("one","Monday","two", "Tuesday","three", "Wednesday","four","Thursday");
|
|
||||||
|
|
||||||
# Some simple printing
|
|
||||||
print $var1;
|
|
||||||
|
|
||||||
# Subroutine
|
|
||||||
sub test() {
|
|
||||||
print "ok";
|
|
||||||
}
|
|
||||||
</textarea>
|
|
||||||
|
|
||||||
<textarea id="cp-sql" class="hidden-code">
|
|
||||||
--
|
|
||||||
-- simple select example
|
|
||||||
--
|
|
||||||
SELECT * FROM books
|
|
||||||
WHERE price > 100.00 and price < 150.00
|
|
||||||
ORDER BY title
|
|
||||||
|
|
||||||
SELECT books.title, count(*) AS Authors
|
|
||||||
FROM books
|
|
||||||
JOIN book_authors
|
|
||||||
ON books.book_number = book_authors.book_number
|
|
||||||
GROUP BY books.title
|
|
||||||
|
|
||||||
-- insert, update and delete examples
|
|
||||||
|
|
||||||
INSERT INTO my_table (field1, field2, field3) VALUES ('test', 'N', NULL);
|
|
||||||
|
|
||||||
BEGIN WORK;
|
|
||||||
UPDATE inventory SET quantity = quantity - 3 WHERE item = 'pants';
|
|
||||||
COMMIT;
|
|
||||||
</textarea>
|
|
||||||
|
|
||||||
<textarea id="cp-html" class="hidden-code">
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>CodePress - Online Real Time Syntax Highlighting Editor</title>
|
|
||||||
|
|
||||||
<style type="text/css">
|
|
||||||
@import url(styles.css);
|
|
||||||
</style>
|
|
||||||
<script type="text/javascript">
|
|
||||||
function getCode() {
|
|
||||||
alert(textWithoutHighlighting);
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="logo">
|
|
||||||
<h1><a href="http://codepress.org/">CodePress</a></h1>
|
|
||||||
<h2>Online Real Time Syntax Highlighting Editor</h2>
|
|
||||||
<img src="testimage.gif" />
|
|
||||||
</div>
|
|
||||||
<div id="languages">
|
|
||||||
<em>choose language:</em>
|
|
||||||
<button onclick="edit('codepress.php',this)" id="default">PHP</button>
|
|
||||||
<button onclick="edit('FileManager.java',this)">Java</button>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
</textarea>
|
|
||||||
|
|
||||||
<textarea id="cp-css" class="hidden-code">
|
|
||||||
/* CSS comment */
|
|
||||||
|
|
||||||
body {
|
|
||||||
color:#000;
|
|
||||||
background-color:white;
|
|
||||||
font:15px Georgia, "Lucida Grande", Arial, sans-serif;
|
|
||||||
letter-spacing:0.01em;
|
|
||||||
margin:15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
margin:0 0 15px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
a,a:visited {
|
|
||||||
color:#7f0055;
|
|
||||||
}
|
|
||||||
|
|
||||||
select {
|
|
||||||
background:#ffffe1;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
color:#7f0055;
|
|
||||||
margin:0;
|
|
||||||
padding:0;
|
|
||||||
font-size:42px;
|
|
||||||
}
|
|
||||||
</textarea>
|
|
||||||
|
|
||||||
|
|
||||||
<script src="codepress.js" type="text/javascript"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
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;}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
/**
|
|
||||||
* CodePress regular expressions for AutoIt syntax highlighting
|
|
||||||
* @author: James Brooks, Michael HURNI
|
|
||||||
*/
|
|
||||||
|
|
||||||
// AutoIt
|
|
||||||
Language.syntax = [
|
|
||||||
{ input : /({|}|\(|\))/g, output : '<b>$1</b>' }, // Brackets
|
|
||||||
{ input : /(\*|\+|-)/g, output : '<b>$1</b>' }, // Operator
|
|
||||||
{ input : /\"(.*?)(\"|<br>|<\/P>)/g, output : "<s>\"$1$2</s>" }, // strings double
|
|
||||||
{ input : /\'(.*?)(\'|<br>|<\/P>)/g, output : '<s>\'$1$2</s>' }, // strings single
|
|
||||||
{ input : /\b([\d]+)\b/g, output : '<ins>$1</ins>' }, // Numbers
|
|
||||||
{ input : /#(.*?)(<br>|<\/P>)/g, output : '<i>#$1</i>$2' }, // Directives and Includes
|
|
||||||
{ input : /(\$[\w\.]*)/g, output : '<var>$1</var>' }, // vars
|
|
||||||
{ input : /(_[\w\.]*)/g, output : '<a>$1</a>' }, // underscored word
|
|
||||||
{ input : /(\@[\w\.]*)/g, output : '<em>$1</em>' }, // Macros
|
|
||||||
{ input : /\b(Abs|ACos|AdlibDisable|AdlibEnable|Asc|AscW|ASin|Assign|ATan|AutoItSetOption|AutoItWinGetTitle|AutoItWinSetTitle|Beep|Binary|BinaryLen|BinaryMid|BinaryToString|BitAND|BitNOT|BitOR|BitSHIFT|BitXOR|BlockInput|Break|Call|CDTray|Ceiling|Chr|ChrW|ClipGet|ClipPut|ConsoleRead|ConsoleWrite|ConsoleWriteError|ControlClick|ControlCommand|ControlDisable|ControlEnable|ControlFocus|ControlGetFocus|ControlGetHandle|ControlGetPos|ControlGetText|ControlHide|ControlListView|ControlMove|ControlSend|ControlSetText|ControlShow|Cos|Dec|DirCopy|DirCreate|DirGetSize|DirMove|DirRemove|DllCall|DllCall|DllClose|DllOpen|DllStructCreate|DllStructGetData|DllStructGetPtr|DllStructGetSize|DllStructSetData|DriveGetDrive|DriveGetFileSystem|DriveGetLabel|DriveGetSerial|DriveGetType|DriveMapAdd|DriveMapDel|DriveMapGet|DriveSetLabel|DriveSpaceFree|DriveSpaceTotal|DriveStatus|EnvGet|EnvSet|EnvUpdate|Eval|Execute|Exp|FileChangeDir|FileClose|FileCopy|FileCreateNTFS|FileCreateShortcut|FileDelete|FileExists|FileFindFirstFile|FileFindNextFile|FileGetAttrib|FileGetLongName|FileGetShortcut|FileGetShortName|FileGetSize|FileGetTime|FileGetVersion|FileInstall|FileMove|FileOpen|FileOpenDialog|FileRead|FileReadLine|FileRecycle|FileRecycleEmpty|FileSaveDialog|FileSelectFolder|FileSetAttrib|FileSetTime|FileWrite|FileWriteLine|Floor|FtpSetProxy|GuiCreate|GuiCtrlCreateAvi|GuiCtrlCreateButton|GuiCtrlCreateCheckbox|GuiCtrlCreateCombo|GuiCtrlCreateContextMenu|GuiCtrlCreateDate|GuiCtrlCreateDummy|GuiCtrlCreateEdit|GuiCtrlCreateGraphic|GuiCtrlCreateGroup|GuiCtrlCreateIcon|GuiCtrlCreateInput|GuiCtrlCreateLabel|GuiCtrlCreateList|GuiCtrlCreateListView|GuiCtrlCreateListViewItem|GuiCtrlCreateMenu|GuiCtrlCreateMenuItem|GuiCtrlCreateMonthCal|GuiCtrlCreateObj|GuiCtrlCreatePic|GuiCtrlCreateProgress|GuiCtrlCreateRadio|GuiCtrlCreateSlider|GuiCtrlCreateTab|GuiCtrlCreateTabItem|GuiCtrlCreateUpdown|GuiCtrlDelete|GuiCtrlGetHandle|GuiCtrlGetState|GuiCtrlRead|GuiCtrlRecvMsg|GuiCtrlSentMsg|GuiCtrlSendToDummy|GuiCtrlSetBkColor|GuiCtrlSetColor|GuiCtrlSetCursor|GuiCtrlSetData|GuiCtrlSetFont|GuiCtrlSetGraphic|GuiCtrlSetImage|GuiCtrlSetLimit|GuiCtrlSetOnEvent|GuiCtrlSetPos|GuiCtrlResizing|GuiCtrlSetState|GuiCtrlSetTip|GuiDelete|GuiGetCursorInfo|GuiGetMsg|GuiGetStyle|GuiRegisterMsg|GuiSetBkColor|GuiSetCoord|GuiSetCursor|GuiSetFont|GuiSetHelp|GuiSetIcon|GuiSetOnEvent|GuiSetStat|GuiSetStyle|GuiStartGroup|GuiSwitch|Hex|HotKeySet|HttpSetProxy|HWnd|InetGet|InetGetSize|IniDelete|IniRead|IniReadSection|IniReadSectionNames|IniRenameSection|IniWrite|IniWriteSection|InputBox|Int|IsAdmin|IsArray|IsBinary|IsBool|IsDeclared|IsDllStruct|IsFloat|IsHWnd|IsInt|IsKeyword|IsNumber|IsObj|IsString|Log|MemGetStats|Mod|MouseClick|MouseClickDrag|MouseDown|MouseGetCursor|MouseGetPos|MouseMove|MouseUp|MouseWheel|MsgBox|Number|ObjCreate|ObjEvent|ObjGet|ObjName|Ping|PixelCheckSum|PixelGetColor|PixelSearch|ProcessClose|ProcessExists|ProcessList|ProcessSetPriority|ProcessWait|ProcessWaitClose|ProgressOff|ProcessOn|ProgressSet|Random|RegDelete|RegEnumKey|RegEnumVal|RegRead|RegWrite|Round|Run|RunAsSet|RunWait|Send|SetError|SetExtended|ShellExecute|ShellExecuteWait|Shutdown|Sin|Sleep|SoundPlay|SoundSetWaveVolume|SplashImageOn|SplashOff|SplashTextOn|Sqrt|SRandom|StatusbarGetText|StderrRead|StdinWrite|StdoutRead|String|StringAddCR|StringCompare|StringFormat|StringInStr|StringIsAlNum|StringIsAlpha|StringIsASCII|StringIsDigit|StringIsFloat|StringIsInt|StringIsLower|StringIsSpace|StringIsUpper|StringIsXDigit|StringLeft|StringLen|StringLower|StringMid|StringRegExp|StringRegExpReplace|StringReplace|StringRight|StringSplit|StringStripCR|StringStripWS|StringToBinary|StringTrimLeft|StringTrimRight|StringUpper|Tan|TCPAccept|TCPCloseSocket|TCPConnect|TCPListen|TCPNameToIP|TCPrecv|TCPSend|TCPShutdown|TCPStartup|TimerDiff|TimerInit|ToolTip|TrayCreateItem|TrayCreateMenu|TrayGetMenu|TrayGetMsg|TrayItemDelete|TrayItemGetHandle|TrayItemGetState|TrayItemGetText|TrayItemSetOnEvent|TrayItemSetState|TrayItemSetText|TraySetClick|TraySetIcon|TraySetOnEvent|TraySetPauseIcon|TraySetState|TraySetToolTip|TrayTip|UBound|UDPBind|UDPCloseSocket|UDPOpen|UDPRecv|UDPSend|WinActivate|WinActive|WinClose|WinExists|WinFlash|WinGetCaretPos|WinGetClassList|WinGetClientSize|WinGetHandle|WinGetPos|WinGetProcess|WinGetState|WinGetText|WinGetTitle|WinKill|WinList|WinMenuSelectItem|WinMinimizeAll|WinMinimizeAllUndo|WinMove|WinSetOnTop|WinSetState|WinSetTitle|WinSetTrans|WinWait|WinWaitActive|WinWaitClose|WinWaitNotActive)\b/g, output : '<u>$1</u>' } ,// reserved words
|
|
||||||
{ input : /\B;(.*?)(<br>|<\/P>)/g, output : '<cite>;$1</cite>$2' }, // comments
|
|
||||||
{ input : /#CS(.*?)#CE/g, output : '<cite>#CS$1#CE</cite>' } // Block 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 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 : '&' }
|
|
||||||
]
|
|
||||||
10
gulliver/thirdparty/codepress/languages/ruby.css
vendored
10
gulliver/thirdparty/codepress/languages/ruby.css
vendored
@@ -1,10 +0,0 @@
|
|||||||
/*
|
|
||||||
* CodePress color styles for Ruby syntax highlighting
|
|
||||||
*/
|
|
||||||
|
|
||||||
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 */
|
|
||||||
26
gulliver/thirdparty/codepress/languages/ruby.js
vendored
26
gulliver/thirdparty/codepress/languages/ruby.js
vendored
@@ -1,26 +0,0 @@
|
|||||||
/*
|
|
||||||
* CodePress regular expressions for Perl syntax highlighting
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Ruby
|
|
||||||
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$2</a>' }, // vars
|
|
||||||
{ input : /(def\s+)([\w\.]*)/g, output : '$1<em>$2</em>' }, // functions
|
|
||||||
{ 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
|
|
||||||
{ 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 = []
|
|
||||||
10
gulliver/thirdparty/codepress/languages/sql.css
vendored
10
gulliver/thirdparty/codepress/languages/sql.css
vendored
@@ -1,10 +0,0 @@
|
|||||||
/*
|
|
||||||
* CodePress color styles for SQL syntax highlighting
|
|
||||||
* By Merlin Moncure
|
|
||||||
*/
|
|
||||||
|
|
||||||
b {color:#0000FF;font-style:normal;font-weight:bold;} /* reserved words */
|
|
||||||
u {color:#FF0000;font-style:normal;} /* types */
|
|
||||||
a {color:#CD6600;font-style:normal;font-weight:bold;} /* commands */
|
|
||||||
i, i b, i u, i a, i s {color:#A9A9A9;font-weight:normal;font-style:italic;} /* comments */
|
|
||||||
s, s b, s u, s a, s i {color:#2A00FF;font-weight:normal;} /* strings */
|
|
||||||
30
gulliver/thirdparty/codepress/languages/sql.js
vendored
30
gulliver/thirdparty/codepress/languages/sql.js
vendored
@@ -1,30 +0,0 @@
|
|||||||
/*
|
|
||||||
* CodePress regular expressions for SQL syntax highlighting
|
|
||||||
* By Merlin Moncure
|
|
||||||
*/
|
|
||||||
|
|
||||||
// SQL
|
|
||||||
Language.syntax = [
|
|
||||||
{ input : /\'(.*?)(\')/g, output : '<s>\'$1$2</s>' }, // strings single quote
|
|
||||||
{ 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|like|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
|
|
||||||
{ 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
|
|
||||||
{ 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
|
|
||||||
{ input : /([^:]|^)\-\-(.*?)(<br|<\/P)/g, output: '$1<i>--$2</i>$3' } // comments //
|
|
||||||
]
|
|
||||||
|
|
||||||
Language.snippets = [
|
|
||||||
{ input : 'select', output : 'select $0 from where ' }
|
|
||||||
]
|
|
||||||
|
|
||||||
Language.complete = [
|
|
||||||
{ input : '\'', output : '\'$0\'' },
|
|
||||||
{ input : '"', output : '"$0"' },
|
|
||||||
{ input : '(', output : '\($0\)' },
|
|
||||||
{ input : '[', output : '\[$0\]' },
|
|
||||||
{ input : '{', output : '{\n\t$0\n}' }
|
|
||||||
]
|
|
||||||
|
|
||||||
Language.shortcuts = []
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
/*
|
|
||||||
* CodePress color styles for Text syntax highlighting
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* do nothing as expected */
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
/*
|
|
||||||
* CodePress regular expressions for Text syntax highlighting
|
|
||||||
*/
|
|
||||||
|
|
||||||
// plain text
|
|
||||||
Language.syntax = []
|
|
||||||
Language.snippets = []
|
|
||||||
Language.complete = []
|
|
||||||
Language.shortcuts = []
|
|
||||||
@@ -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/vbscript.js
vendored
117
gulliver/thirdparty/codepress/languages/vbscript.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 HTML syntax highlighting
|
|
||||||
*/
|
|
||||||
|
|
||||||
b {color:#000080;} /* tags */
|
|
||||||
ins, ins b, ins s, ins em {color:gray;} /* comments */
|
|
||||||
s, s b {color:red;} /* 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 */
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
/*
|
|
||||||
* @author David Callizaya
|
|
||||||
* 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 : /<(\/?([a-z_]\w*))/ig, output : '<<a>$1</a>' }, // 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 : /type(\s*)=(\s*)("(?:xmlform|grid|text|currency|percentage|password|textarea|title|subtitle|button|submit|reset|dropdown|yesno|listbox|checkbox|checkgroup|radiogroup|date|hidden|link|file|javascript)")/ig, output : 'type$1=$2<u>$3</u>' }, // atributes double quote
|
|
||||||
{ input : /type(\s*)=(\s*)('(?:xmlform|grid|text|currency|percentage|password|textarea|title|subtitle|button|submit|reset|dropdown|yesno|listbox|checkbox|checkgroup|radiogroup|date|hidden|link|file|javascript)')/ig, output : 'type$1=$2<u>$3</u>' }, // atributes single quote
|
|
||||||
{ input : /type(\s*)=(\s*)(".*?")/ig, output : 'type$1=$2<s>$3</s>' }, // Invalid type of field in double quote
|
|
||||||
{ input : /type(\s*)=(\s*)('.*?')/ig, output : 'type$1=$2<s>$3</s>' }, // Invalid type of field in single quote
|
|
||||||
{ input : /=(".*?")/g, output : '=<u>$1</u>' }, // atributes double quote
|
|
||||||
{ input : /=('.*?')/g, output : '=<u>$1</u>' }, // atributes single quote
|
|
||||||
{ input : /(<!--.*?-->.)/g, output : '<ins>$1</ins>' }, // comments
|
|
||||||
{ input : /(<!\[CDATA\[.*?\]\]>.)/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 = []
|
|
||||||
15
gulliver/thirdparty/codepress/languages/xsl.css
vendored
15
gulliver/thirdparty/codepress/languages/xsl.css
vendored
@@ -1,15 +0,0 @@
|
|||||||
/*
|
|
||||||
* CodePress color styles for HTML syntax highlighting
|
|
||||||
* By RJ Bruneel
|
|
||||||
*/
|
|
||||||
|
|
||||||
b {color:#000080;} /* tags */
|
|
||||||
ins, ins b, ins s, ins em {color:gray;} /* comments */
|
|
||||||
s, s b {color:#7777e4;} /* attribute values */
|
|
||||||
a {color:#E67300;} /* links */
|
|
||||||
u {color:#CC66CC;} /* 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 */
|
|
||||||
xsl {color:green;} /* xsl */
|
|
||||||
103
gulliver/thirdparty/codepress/languages/xsl.js
vendored
103
gulliver/thirdparty/codepress/languages/xsl.js
vendored
@@ -1,103 +0,0 @@
|
|||||||
/*
|
|
||||||
* CodePress regular expressions for XSL syntax highlighting
|
|
||||||
* By RJ Bruneel
|
|
||||||
*/
|
|
||||||
|
|
||||||
Language.syntax = [ // XSL
|
|
||||||
{
|
|
||||||
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 : /(<xsl.*?>|<\/xsl.*?>)/g,
|
|
||||||
output : '<xsl>$1</xsl>' // xsl
|
|
||||||
},{
|
|
||||||
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" width="" height="" alt="" border="0" />' },
|
|
||||||
{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 : 'b', output : '<b>$0</b>' },
|
|
||||||
{input : 'li', output : '<li>$0</li>' },
|
|
||||||
{input : 'ul', output : '<ul>$0</ul>' },
|
|
||||||
{input : 'ol', output : '<ol>$0</ol>' },
|
|
||||||
{input : 'strong', output : '<strong>$0</strong>' },
|
|
||||||
{input : 'br', output : '<br />' },
|
|
||||||
{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>' },
|
|
||||||
{input : 'xsl:stylesheet', output : '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">' },
|
|
||||||
{input : 'xsl:template', output : '<xsl:template>$0</xsl:template>' },
|
|
||||||
{input : 'xsl:for-each', output : '<xsl:for-each select="$0"></xsl:for-each>' },
|
|
||||||
{input : 'xsl:choose', output : '<xsl:choose>$0<\xsl:choose>' },
|
|
||||||
{input : 'xsl:param', output : '<xsl:param name="$0" />' },
|
|
||||||
{input : 'xsl:variable', output : '<xsl:variable name="$0"></xsl:variable>' },
|
|
||||||
{input : 'xsl:if', output : '<xsl:if test="$0"></xsl:if>' },
|
|
||||||
{input : 'xsl:when', output : '<xsl:when test="$0"></xsl:when>' },
|
|
||||||
{input : 'xsl:otherwise', output : '<xsl:otherwise>$0</xsl:otherwise>' },
|
|
||||||
{input : 'xsl:attribute', output : '<xsl:attribute name="$0"></xsl:attribute>' },
|
|
||||||
{input : 'xsl:value-of', output : '<xsl:value-of select="$0"/>' },
|
|
||||||
{input : 'xsl:with-param', output : '<xsl:with-param name="$0" select="" />' },
|
|
||||||
{input : 'xsl:call-template', output : '<xsl:call-template name="$0">' }
|
|
||||||
|
|
||||||
];
|
|
||||||
|
|
||||||
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 = [];
|
|
||||||
458
gulliver/thirdparty/codepress/license.txt
vendored
458
gulliver/thirdparty/codepress/license.txt
vendored
@@ -1,458 +0,0 @@
|
|||||||
GNU LESSER GENERAL PUBLIC LICENSE
|
|
||||||
Version 2.1, February 1999
|
|
||||||
|
|
||||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
|
||||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
[This is the first released version of the Lesser GPL. It also counts
|
|
||||||
as the successor of the GNU Library Public License, version 2, hence
|
|
||||||
the version number 2.1.]
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The licenses for most software are designed to take away your
|
|
||||||
freedom to share and change it. By contrast, the GNU General Public
|
|
||||||
Licenses are intended to guarantee your freedom to share and change
|
|
||||||
free software--to make sure the software is free for all its users.
|
|
||||||
|
|
||||||
This license, the Lesser General Public License, applies to some
|
|
||||||
specially designated software packages--typically libraries--of the
|
|
||||||
Free Software Foundation and other authors who decide to use it. You
|
|
||||||
can use it too, but we suggest you first think carefully about whether
|
|
||||||
this license or the ordinary General Public License is the better
|
|
||||||
strategy to use in any particular case, based on the explanations below.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom of use,
|
|
||||||
not price. Our General Public Licenses are designed to make sure that
|
|
||||||
you have the freedom to distribute copies of free software (and charge
|
|
||||||
for this service if you wish); that you receive source code or can get
|
|
||||||
it if you want it; that you can change the software and use pieces of
|
|
||||||
it in new free programs; and that you are informed that you can do
|
|
||||||
these things.
|
|
||||||
|
|
||||||
To protect your rights, we need to make restrictions that forbid
|
|
||||||
distributors to deny you these rights or to ask you to surrender these
|
|
||||||
rights. These restrictions translate to certain responsibilities for
|
|
||||||
you if you distribute copies of the library or if you modify it.
|
|
||||||
|
|
||||||
For example, if you distribute copies of the library, whether gratis
|
|
||||||
or for a fee, you must give the recipients all the rights that we gave
|
|
||||||
you. You must make sure that they, too, receive or can get the source
|
|
||||||
code. If you link other code with the library, you must provide
|
|
||||||
complete object files to the recipients, so that they can relink them
|
|
||||||
with the library after making changes to the library and recompiling
|
|
||||||
it. And you must show them these terms so they know their rights.
|
|
||||||
|
|
||||||
We protect your rights with a two-step method: (1) we copyright the
|
|
||||||
library, and (2) we offer you this license, which gives you legal
|
|
||||||
permission to copy, distribute and/or modify the library.
|
|
||||||
|
|
||||||
To protect each distributor, we want to make it very clear that
|
|
||||||
there is no warranty for the free library. Also, if the library is
|
|
||||||
modified by someone else and passed on, the recipients should know
|
|
||||||
that what they have is not the original version, so that the original
|
|
||||||
author's reputation will not be affected by problems that might be
|
|
||||||
introduced by others.
|
|
||||||
|
|
||||||
Finally, software patents pose a constant threat to the existence of
|
|
||||||
any free program. We wish to make sure that a company cannot
|
|
||||||
effectively restrict the users of a free program by obtaining a
|
|
||||||
restrictive license from a patent holder. Therefore, we insist that
|
|
||||||
any patent license obtained for a version of the library must be
|
|
||||||
consistent with the full freedom of use specified in this license.
|
|
||||||
|
|
||||||
Most GNU software, including some libraries, is covered by the
|
|
||||||
ordinary GNU General Public License. This license, the GNU Lesser
|
|
||||||
General Public License, applies to certain designated libraries, and
|
|
||||||
is quite different from the ordinary General Public License. We use
|
|
||||||
this license for certain libraries in order to permit linking those
|
|
||||||
libraries into non-free programs.
|
|
||||||
|
|
||||||
When a program is linked with a library, whether statically or using
|
|
||||||
a shared library, the combination of the two is legally speaking a
|
|
||||||
combined work, a derivative of the original library. The ordinary
|
|
||||||
General Public License therefore permits such linking only if the
|
|
||||||
entire combination fits its criteria of freedom. The Lesser General
|
|
||||||
Public License permits more lax criteria for linking other code with
|
|
||||||
the library.
|
|
||||||
|
|
||||||
We call this license the "Lesser" General Public License because it
|
|
||||||
does Less to protect the user's freedom than the ordinary General
|
|
||||||
Public License. It also provides other free software developers Less
|
|
||||||
of an advantage over competing non-free programs. These disadvantages
|
|
||||||
are the reason we use the ordinary General Public License for many
|
|
||||||
libraries. However, the Lesser license provides advantages in certain
|
|
||||||
special circumstances.
|
|
||||||
|
|
||||||
For example, on rare occasions, there may be a special need to
|
|
||||||
encourage the widest possible use of a certain library, so that it becomes
|
|
||||||
a de-facto standard. To achieve this, non-free programs must be
|
|
||||||
allowed to use the library. A more frequent case is that a free
|
|
||||||
library does the same job as widely used non-free libraries. In this
|
|
||||||
case, there is little to gain by limiting the free library to free
|
|
||||||
software only, so we use the Lesser General Public License.
|
|
||||||
|
|
||||||
In other cases, permission to use a particular library in non-free
|
|
||||||
programs enables a greater number of people to use a large body of
|
|
||||||
free software. For example, permission to use the GNU C Library in
|
|
||||||
non-free programs enables many more people to use the whole GNU
|
|
||||||
operating system, as well as its variant, the GNU/Linux operating
|
|
||||||
system.
|
|
||||||
|
|
||||||
Although the Lesser General Public License is Less protective of the
|
|
||||||
users' freedom, it does ensure that the user of a program that is
|
|
||||||
linked with the Library has the freedom and the wherewithal to run
|
|
||||||
that program using a modified version of the Library.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow. Pay close attention to the difference between a
|
|
||||||
"work based on the library" and a "work that uses the library". The
|
|
||||||
former contains code derived from the library, whereas the latter must
|
|
||||||
be combined with the library in order to run.
|
|
||||||
|
|
||||||
GNU LESSER GENERAL PUBLIC LICENSE
|
|
||||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
|
||||||
|
|
||||||
0. This License Agreement applies to any software library or other
|
|
||||||
program which contains a notice placed by the copyright holder or
|
|
||||||
other authorized party saying it may be distributed under the terms of
|
|
||||||
this Lesser General Public License (also called "this License").
|
|
||||||
Each licensee is addressed as "you".
|
|
||||||
|
|
||||||
A "library" means a collection of software functions and/or data
|
|
||||||
prepared so as to be conveniently linked with application programs
|
|
||||||
(which use some of those functions and data) to form executables.
|
|
||||||
|
|
||||||
The "Library", below, refers to any such software library or work
|
|
||||||
which has been distributed under these terms. A "work based on the
|
|
||||||
Library" means either the Library or any derivative work under
|
|
||||||
copyright law: that is to say, a work containing the Library or a
|
|
||||||
portion of it, either verbatim or with modifications and/or translated
|
|
||||||
straightforwardly into another language. (Hereinafter, translation is
|
|
||||||
included without limitation in the term "modification".)
|
|
||||||
|
|
||||||
"Source code" for a work means the preferred form of the work for
|
|
||||||
making modifications to it. For a library, complete source code means
|
|
||||||
all the source code for all modules it contains, plus any associated
|
|
||||||
interface definition files, plus the scripts used to control compilation
|
|
||||||
and installation of the library.
|
|
||||||
|
|
||||||
Activities other than copying, distribution and modification are not
|
|
||||||
covered by this License; they are outside its scope. The act of
|
|
||||||
running a program using the Library is not restricted, and output from
|
|
||||||
such a program is covered only if its contents constitute a work based
|
|
||||||
on the Library (independent of the use of the Library in a tool for
|
|
||||||
writing it). Whether that is true depends on what the Library does
|
|
||||||
and what the program that uses the Library does.
|
|
||||||
|
|
||||||
1. You may copy and distribute verbatim copies of the Library's
|
|
||||||
complete source code as you receive it, in any medium, provided that
|
|
||||||
you conspicuously and appropriately publish on each copy an
|
|
||||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
|
||||||
all the notices that refer to this License and to the absence of any
|
|
||||||
warranty; and distribute a copy of this License along with the
|
|
||||||
Library.
|
|
||||||
|
|
||||||
You may charge a fee for the physical act of transferring a copy,
|
|
||||||
and you may at your option offer warranty protection in exchange for a
|
|
||||||
fee.
|
|
||||||
|
|
||||||
2. You may modify your copy or copies of the Library or any portion
|
|
||||||
of it, thus forming a work based on the Library, and copy and
|
|
||||||
distribute such modifications or work under the terms of Section 1
|
|
||||||
above, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The modified work must itself be a software library.
|
|
||||||
|
|
||||||
b) You must cause the files modified to carry prominent notices
|
|
||||||
stating that you changed the files and the date of any change.
|
|
||||||
|
|
||||||
c) You must cause the whole of the work to be licensed at no
|
|
||||||
charge to all third parties under the terms of this License.
|
|
||||||
|
|
||||||
d) If a facility in the modified Library refers to a function or a
|
|
||||||
table of data to be supplied by an application program that uses
|
|
||||||
the facility, other than as an argument passed when the facility
|
|
||||||
is invoked, then you must make a good faith effort to ensure that,
|
|
||||||
in the event an application does not supply such function or
|
|
||||||
table, the facility still operates, and performs whatever part of
|
|
||||||
its purpose remains meaningful.
|
|
||||||
|
|
||||||
(For example, a function in a library to compute square roots has
|
|
||||||
a purpose that is entirely well-defined independent of the
|
|
||||||
application. Therefore, Subsection 2d requires that any
|
|
||||||
application-supplied function or table used by this function must
|
|
||||||
be optional: if the application does not supply it, the square
|
|
||||||
root function must still compute square roots.)
|
|
||||||
|
|
||||||
These requirements apply to the modified work as a whole. If
|
|
||||||
identifiable sections of that work are not derived from the Library,
|
|
||||||
and can be reasonably considered independent and separate works in
|
|
||||||
themselves, then this License, and its terms, do not apply to those
|
|
||||||
sections when you distribute them as separate works. But when you
|
|
||||||
distribute the same sections as part of a whole which is a work based
|
|
||||||
on the Library, the distribution of the whole must be on the terms of
|
|
||||||
this License, whose permissions for other licensees extend to the
|
|
||||||
entire whole, and thus to each and every part regardless of who wrote
|
|
||||||
it.
|
|
||||||
|
|
||||||
Thus, it is not the intent of this section to claim rights or contest
|
|
||||||
your rights to work written entirely by you; rather, the intent is to
|
|
||||||
exercise the right to control the distribution of derivative or
|
|
||||||
collective works based on the Library.
|
|
||||||
|
|
||||||
In addition, mere aggregation of another work not based on the Library
|
|
||||||
with the Library (or with a work based on the Library) on a volume of
|
|
||||||
a storage or distribution medium does not bring the other work under
|
|
||||||
the scope of this License.
|
|
||||||
|
|
||||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
|
||||||
License instead of this License to a given copy of the Library. To do
|
|
||||||
this, you must alter all the notices that refer to this License, so
|
|
||||||
that they refer to the ordinary GNU General Public License, version 2,
|
|
||||||
instead of to this License. (If a newer version than version 2 of the
|
|
||||||
ordinary GNU General Public License has appeared, then you can specify
|
|
||||||
that version instead if you wish.) Do not make any other change in
|
|
||||||
these notices.
|
|
||||||
|
|
||||||
Once this change is made in a given copy, it is irreversible for
|
|
||||||
that copy, so the ordinary GNU General Public License applies to all
|
|
||||||
subsequent copies and derivative works made from that copy.
|
|
||||||
|
|
||||||
This option is useful when you wish to copy part of the code of
|
|
||||||
the Library into a program that is not a library.
|
|
||||||
|
|
||||||
4. You may copy and distribute the Library (or a portion or
|
|
||||||
derivative of it, under Section 2) in object code or executable form
|
|
||||||
under the terms of Sections 1 and 2 above provided that you accompany
|
|
||||||
it with the complete corresponding machine-readable source code, which
|
|
||||||
must be distributed under the terms of Sections 1 and 2 above on a
|
|
||||||
medium customarily used for software interchange.
|
|
||||||
|
|
||||||
If distribution of object code is made by offering access to copy
|
|
||||||
from a designated place, then offering equivalent access to copy the
|
|
||||||
source code from the same place satisfies the requirement to
|
|
||||||
distribute the source code, even though third parties are not
|
|
||||||
compelled to copy the source along with the object code.
|
|
||||||
|
|
||||||
5. A program that contains no derivative of any portion of the
|
|
||||||
Library, but is designed to work with the Library by being compiled or
|
|
||||||
linked with it, is called a "work that uses the Library". Such a
|
|
||||||
work, in isolation, is not a derivative work of the Library, and
|
|
||||||
therefore falls outside the scope of this License.
|
|
||||||
|
|
||||||
However, linking a "work that uses the Library" with the Library
|
|
||||||
creates an executable that is a derivative of the Library (because it
|
|
||||||
contains portions of the Library), rather than a "work that uses the
|
|
||||||
library". The executable is therefore covered by this License.
|
|
||||||
Section 6 states terms for distribution of such executables.
|
|
||||||
|
|
||||||
When a "work that uses the Library" uses material from a header file
|
|
||||||
that is part of the Library, the object code for the work may be a
|
|
||||||
derivative work of the Library even though the source code is not.
|
|
||||||
Whether this is true is especially significant if the work can be
|
|
||||||
linked without the Library, or if the work is itself a library. The
|
|
||||||
threshold for this to be true is not precisely defined by law.
|
|
||||||
|
|
||||||
If such an object file uses only numerical parameters, data
|
|
||||||
structure layouts and accessors, and small macros and small inline
|
|
||||||
functions (ten lines or less in length), then the use of the object
|
|
||||||
file is unrestricted, regardless of whether it is legally a derivative
|
|
||||||
work. (Executables containing this object code plus portions of the
|
|
||||||
Library will still fall under Section 6.)
|
|
||||||
|
|
||||||
Otherwise, if the work is a derivative of the Library, you may
|
|
||||||
distribute the object code for the work under the terms of Section 6.
|
|
||||||
Any executables containing that work also fall under Section 6,
|
|
||||||
whether or not they are linked directly with the Library itself.
|
|
||||||
|
|
||||||
6. As an exception to the Sections above, you may also combine or
|
|
||||||
link a "work that uses the Library" with the Library to produce a
|
|
||||||
work containing portions of the Library, and distribute that work
|
|
||||||
under terms of your choice, provided that the terms permit
|
|
||||||
modification of the work for the customer's own use and reverse
|
|
||||||
engineering for debugging such modifications.
|
|
||||||
|
|
||||||
You must give prominent notice with each copy of the work that the
|
|
||||||
Library is used in it and that the Library and its use are covered by
|
|
||||||
this License. You must supply a copy of this License. If the work
|
|
||||||
during execution displays copyright notices, you must include the
|
|
||||||
copyright notice for the Library among them, as well as a reference
|
|
||||||
directing the user to the copy of this License. Also, you must do one
|
|
||||||
of these things:
|
|
||||||
|
|
||||||
a) Accompany the work with the complete corresponding
|
|
||||||
machine-readable source code for the Library including whatever
|
|
||||||
changes were used in the work (which must be distributed under
|
|
||||||
Sections 1 and 2 above); and, if the work is an executable linked
|
|
||||||
with the Library, with the complete machine-readable "work that
|
|
||||||
uses the Library", as object code and/or source code, so that the
|
|
||||||
user can modify the Library and then relink to produce a modified
|
|
||||||
executable containing the modified Library. (It is understood
|
|
||||||
that the user who changes the contents of definitions files in the
|
|
||||||
Library will not necessarily be able to recompile the application
|
|
||||||
to use the modified definitions.)
|
|
||||||
|
|
||||||
b) Use a suitable shared library mechanism for linking with the
|
|
||||||
Library. A suitable mechanism is one that (1) uses at run time a
|
|
||||||
copy of the library already present on the user's computer system,
|
|
||||||
rather than copying library functions into the executable, and (2)
|
|
||||||
will operate properly with a modified version of the library, if
|
|
||||||
the user installs one, as long as the modified version is
|
|
||||||
interface-compatible with the version that the work was made with.
|
|
||||||
|
|
||||||
c) Accompany the work with a written offer, valid for at
|
|
||||||
least three years, to give the same user the materials
|
|
||||||
specified in Subsection 6a, above, for a charge no more
|
|
||||||
than the cost of performing this distribution.
|
|
||||||
|
|
||||||
d) If distribution of the work is made by offering access to copy
|
|
||||||
from a designated place, offer equivalent access to copy the above
|
|
||||||
specified materials from the same place.
|
|
||||||
|
|
||||||
e) Verify that the user has already received a copy of these
|
|
||||||
materials or that you have already sent this user a copy.
|
|
||||||
|
|
||||||
For an executable, the required form of the "work that uses the
|
|
||||||
Library" must include any data and utility programs needed for
|
|
||||||
reproducing the executable from it. However, as a special exception,
|
|
||||||
the materials to be distributed need not include anything that is
|
|
||||||
normally distributed (in either source or binary form) with the major
|
|
||||||
components (compiler, kernel, and so on) of the operating system on
|
|
||||||
which the executable runs, unless that component itself accompanies
|
|
||||||
the executable.
|
|
||||||
|
|
||||||
It may happen that this requirement contradicts the license
|
|
||||||
restrictions of other proprietary libraries that do not normally
|
|
||||||
accompany the operating system. Such a contradiction means you cannot
|
|
||||||
use both them and the Library together in an executable that you
|
|
||||||
distribute.
|
|
||||||
|
|
||||||
7. You may place library facilities that are a work based on the
|
|
||||||
Library side-by-side in a single library together with other library
|
|
||||||
facilities not covered by this License, and distribute such a combined
|
|
||||||
library, provided that the separate distribution of the work based on
|
|
||||||
the Library and of the other library facilities is otherwise
|
|
||||||
permitted, and provided that you do these two things:
|
|
||||||
|
|
||||||
a) Accompany the combined library with a copy of the same work
|
|
||||||
based on the Library, uncombined with any other library
|
|
||||||
facilities. This must be distributed under the terms of the
|
|
||||||
Sections above.
|
|
||||||
|
|
||||||
b) Give prominent notice with the combined library of the fact
|
|
||||||
that part of it is a work based on the Library, and explaining
|
|
||||||
where to find the accompanying uncombined form of the same work.
|
|
||||||
|
|
||||||
8. You may not copy, modify, sublicense, link with, or distribute
|
|
||||||
the Library except as expressly provided under this License. Any
|
|
||||||
attempt otherwise to copy, modify, sublicense, link with, or
|
|
||||||
distribute the Library is void, and will automatically terminate your
|
|
||||||
rights under this License. However, parties who have received copies,
|
|
||||||
or rights, from you under this License will not have their licenses
|
|
||||||
terminated so long as such parties remain in full compliance.
|
|
||||||
|
|
||||||
9. You are not required to accept this License, since you have not
|
|
||||||
signed it. However, nothing else grants you permission to modify or
|
|
||||||
distribute the Library or its derivative works. These actions are
|
|
||||||
prohibited by law if you do not accept this License. Therefore, by
|
|
||||||
modifying or distributing the Library (or any work based on the
|
|
||||||
Library), you indicate your acceptance of this License to do so, and
|
|
||||||
all its terms and conditions for copying, distributing or modifying
|
|
||||||
the Library or works based on it.
|
|
||||||
|
|
||||||
10. Each time you redistribute the Library (or any work based on the
|
|
||||||
Library), the recipient automatically receives a license from the
|
|
||||||
original licensor to copy, distribute, link with or modify the Library
|
|
||||||
subject to these terms and conditions. You may not impose any further
|
|
||||||
restrictions on the recipients' exercise of the rights granted herein.
|
|
||||||
You are not responsible for enforcing compliance by third parties with
|
|
||||||
this License.
|
|
||||||
|
|
||||||
11. If, as a consequence of a court judgment or allegation of patent
|
|
||||||
infringement or for any other reason (not limited to patent issues),
|
|
||||||
conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot
|
|
||||||
distribute so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you
|
|
||||||
may not distribute the Library at all. For example, if a patent
|
|
||||||
license would not permit royalty-free redistribution of the Library by
|
|
||||||
all those who receive copies directly or indirectly through you, then
|
|
||||||
the only way you could satisfy both it and this License would be to
|
|
||||||
refrain entirely from distribution of the Library.
|
|
||||||
|
|
||||||
If any portion of this section is held invalid or unenforceable under any
|
|
||||||
particular circumstance, the balance of the section is intended to apply,
|
|
||||||
and the section as a whole is intended to apply in other circumstances.
|
|
||||||
|
|
||||||
It is not the purpose of this section to induce you to infringe any
|
|
||||||
patents or other property right claims or to contest validity of any
|
|
||||||
such claims; this section has the sole purpose of protecting the
|
|
||||||
integrity of the free software distribution system which is
|
|
||||||
implemented by public license practices. Many people have made
|
|
||||||
generous contributions to the wide range of software distributed
|
|
||||||
through that system in reliance on consistent application of that
|
|
||||||
system; it is up to the author/donor to decide if he or she is willing
|
|
||||||
to distribute software through any other system and a licensee cannot
|
|
||||||
impose that choice.
|
|
||||||
|
|
||||||
This section is intended to make thoroughly clear what is believed to
|
|
||||||
be a consequence of the rest of this License.
|
|
||||||
|
|
||||||
12. If the distribution and/or use of the Library is restricted in
|
|
||||||
certain countries either by patents or by copyrighted interfaces, the
|
|
||||||
original copyright holder who places the Library under this License may add
|
|
||||||
an explicit geographical distribution limitation excluding those countries,
|
|
||||||
so that distribution is permitted only in or among countries not thus
|
|
||||||
excluded. In such case, this License incorporates the limitation as if
|
|
||||||
written in the body of this License.
|
|
||||||
|
|
||||||
13. The Free Software Foundation may publish revised and/or new
|
|
||||||
versions of the Lesser General Public License from time to time.
|
|
||||||
Such new versions will be similar in spirit to the present version,
|
|
||||||
but may differ in detail to address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the Library
|
|
||||||
specifies a version number of this License which applies to it and
|
|
||||||
"any later version", you have the option of following the terms and
|
|
||||||
conditions either of that version or of any later version published by
|
|
||||||
the Free Software Foundation. If the Library does not specify a
|
|
||||||
license version number, you may choose any version ever published by
|
|
||||||
the Free Software Foundation.
|
|
||||||
|
|
||||||
14. If you wish to incorporate parts of the Library into other free
|
|
||||||
programs whose distribution conditions are incompatible with these,
|
|
||||||
write to the author to ask for permission. For software which is
|
|
||||||
copyrighted by the Free Software Foundation, write to the Free
|
|
||||||
Software Foundation; we sometimes make exceptions for this. Our
|
|
||||||
decision will be guided by the two goals of preserving the free status
|
|
||||||
of all derivatives of our free software and of promoting the sharing
|
|
||||||
and reuse of software generally.
|
|
||||||
|
|
||||||
NO WARRANTY
|
|
||||||
|
|
||||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
|
||||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
|
||||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
|
||||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
|
||||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
|
||||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
|
||||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
|
||||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
|
||||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
|
||||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
|
||||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
|
||||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
|
||||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
|
||||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
|
||||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
|
||||||
DAMAGES.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
@@ -1,172 +0,0 @@
|
|||||||
<?xml version="1.0"?>
|
|
||||||
<dynaForm name="labels.xml" basedir="">xml destinado para los lenguages de los labels
|
|
||||||
<ID_AUTHOR>
|
|
||||||
<es>Autor</es>
|
|
||||||
<en>Author</en>
|
|
||||||
<po>Autor</po>
|
|
||||||
</ID_AUTHOR>
|
|
||||||
<ID_RPT_TYPE>
|
|
||||||
<es>Tipo</es>
|
|
||||||
<en>Type</en>
|
|
||||||
<po>Type</po>
|
|
||||||
</ID_RPT_TYPE>
|
|
||||||
<ID_UID>
|
|
||||||
<es>UID</es>
|
|
||||||
<en>UID</en>
|
|
||||||
<po>UID</po>
|
|
||||||
</ID_UID>
|
|
||||||
<ID_YES>
|
|
||||||
<es>Si</es>
|
|
||||||
<en>Yes</en>
|
|
||||||
<po>Si</po>
|
|
||||||
</ID_YES>
|
|
||||||
<ID_NOPE>
|
|
||||||
<es>No</es>
|
|
||||||
<en>No</en>
|
|
||||||
<po>No</po>
|
|
||||||
</ID_NOPE>
|
|
||||||
<ID_ROLE>
|
|
||||||
<es>Rol</es>
|
|
||||||
<en>Role</en>
|
|
||||||
<po>Rol</po>
|
|
||||||
</ID_ROLE>
|
|
||||||
<ID_UP>
|
|
||||||
<es>Subir</es>
|
|
||||||
<en>Up</en>
|
|
||||||
<po>Subir</po>
|
|
||||||
</ID_UP>
|
|
||||||
<ID_DOWN>
|
|
||||||
<es>Bajar</es>
|
|
||||||
<en>Down</en>
|
|
||||||
<po>Bajar</po>
|
|
||||||
</ID_DOWN>
|
|
||||||
<ID_CITY >
|
|
||||||
<es>Ciudad</es>
|
|
||||||
<en>City</en>
|
|
||||||
<po>Ciudad</po>
|
|
||||||
</ID_CITY>
|
|
||||||
<ID_USER_INACTIVE >
|
|
||||||
<es>El usuario se encuentra inactivo</es>
|
|
||||||
<en>The user is currently inactive</en>
|
|
||||||
<po>Usuario eu inactivo</po>
|
|
||||||
</ID_USER_INACTIVE>
|
|
||||||
<ID_WRONG_PASS >
|
|
||||||
<es>Contraseña incorrecta para el usuario</es>
|
|
||||||
<en>Incorrect Password for the user</en>
|
|
||||||
<po>Senha incorrecta do usurio</po>
|
|
||||||
</ID_WRONG_PASS>
|
|
||||||
<ID_USER_NOT_REGISTERED >
|
|
||||||
<es>El usuario no esta registrado en el sistema</es>
|
|
||||||
<en>The User is not registered in the system</en>
|
|
||||||
<po></po>
|
|
||||||
</ID_USER_NOT_REGISTERED>
|
|
||||||
<ID_NEW_PASS_SAME_OLD_PASS >
|
|
||||||
<es>La contraseña y la confirmacion deben ser iguales</es>
|
|
||||||
<en>The New Password and the Confirm Password must be equals</en>
|
|
||||||
<po></po>
|
|
||||||
</ID_NEW_PASS_SAME_OLD_PASS>
|
|
||||||
<ID_WRONG_OLD_PASS >
|
|
||||||
<es>Contraseña antigua incorrecta para el usuario</es>
|
|
||||||
<en>Incorrect Old Password for the user</en>
|
|
||||||
<po></po>
|
|
||||||
</ID_WRONG_OLD_PASS>
|
|
||||||
<ID_CANT_REMOVE_USER >
|
|
||||||
<es>Ud. no puede eliminar un usuario que tiene tramites</es>
|
|
||||||
<en>You can't remove a user with one or more Applications</en>
|
|
||||||
<po>voce no pode remover</po>
|
|
||||||
</ID_CANT_REMOVE_USER>
|
|
||||||
<ID_USER_HAVENT_RIGHTS_SYSTEM >
|
|
||||||
<es>El usuario no tiene derecho de ingresar al sistema</es>
|
|
||||||
<en>User haven't rights to login this system</en>
|
|
||||||
<po></po>
|
|
||||||
</ID_USER_HAVENT_RIGHTS_SYSTEM>
|
|
||||||
<ID_USER_HAVENT_RIGHTS_PAGE >
|
|
||||||
<es>El usuario no tiene derechos para ingresar a esta opcion</es>
|
|
||||||
<en>User haven't rights in this page</en>
|
|
||||||
<po></po>
|
|
||||||
</ID_USER_HAVENT_RIGHTS_PAGE>
|
|
||||||
<ID_USER_HAVENT_RIGHTS_APPLICATION >
|
|
||||||
<es>El usuario no tiene derecho para iniciar un nuevo Tramite</es>
|
|
||||||
<en>User haven't rights to start a New Application</en>
|
|
||||||
<po></po>
|
|
||||||
</ID_USER_HAVENT_RIGHTS_APPLICATION>
|
|
||||||
<ID_USER_ID_EXIST >
|
|
||||||
<es>Ya existe un usuario con el mismo Identificador de usuario</es>
|
|
||||||
<en>There is another user with the same User ID.</en>
|
|
||||||
<po></po>
|
|
||||||
</ID_USER_ID_EXIST>
|
|
||||||
<ID_PASS_CHANGED >
|
|
||||||
<es>Contraseña de inicio, cambiada correctamente</es>
|
|
||||||
<en>Password changed succesfully</en>
|
|
||||||
<po></po>
|
|
||||||
</ID_PASS_CHANGED>
|
|
||||||
<ID_PASS_RESET >
|
|
||||||
<es>Contraseña de inicio, reiniciada correctamente</es>
|
|
||||||
<en>Password reseted succesfully</en>
|
|
||||||
<po></po>
|
|
||||||
</ID_PASS_RESET>
|
|
||||||
<ID_NEW_EMPLOYEE_CREATED >
|
|
||||||
<es>Nuevo Empleado creado satisfactoriamente</es>
|
|
||||||
<en>New Employee created successfully</en>
|
|
||||||
<po></po>
|
|
||||||
</ID_NEW_EMPLOYEE_CREATED>
|
|
||||||
<ID_NEW_CLIENT_CREATED >
|
|
||||||
<es>Nuevo Cliente creado satisfactoriamente</es>
|
|
||||||
<en>New Client created successfully</en>
|
|
||||||
<po>Noivo cliente creado</po>
|
|
||||||
</ID_NEW_CLIENT_CREATED>
|
|
||||||
|
|
||||||
<ID_PAGE>
|
|
||||||
<es>Página</es>
|
|
||||||
<en>Page</en>
|
|
||||||
<po>Page</po>
|
|
||||||
</ID_PAGE>
|
|
||||||
|
|
||||||
<ID_OF>
|
|
||||||
<es>de</es>
|
|
||||||
<en>of</en>
|
|
||||||
<po>do</po>
|
|
||||||
</ID_OF>
|
|
||||||
|
|
||||||
<ID_NAME>
|
|
||||||
<es>Nombre</es>
|
|
||||||
<en>Name</en>
|
|
||||||
<po>Nome</po>
|
|
||||||
</ID_NAME>
|
|
||||||
|
|
||||||
<ID_SERVER_NAME>
|
|
||||||
<es>Nombre Servidor</es>
|
|
||||||
<en>Server Name</en>
|
|
||||||
<po>Nome Server</po>
|
|
||||||
</ID_SERVER_NAME>
|
|
||||||
|
|
||||||
<ID_PROVIDER>
|
|
||||||
<es>Proveedor</es>
|
|
||||||
<en>Provider</en>
|
|
||||||
<po>Proveedor</po>
|
|
||||||
</ID_PROVIDER>
|
|
||||||
|
|
||||||
<ID_ROLES >
|
|
||||||
<es>Roles</es>
|
|
||||||
<en>Roles</en>
|
|
||||||
<po>Roles</po>
|
|
||||||
</ID_ROLES>
|
|
||||||
|
|
||||||
<ID_PERMISSIONS >
|
|
||||||
<es>Permisos</es>
|
|
||||||
<en>Permissions</en>
|
|
||||||
<po>Permisos</po>
|
|
||||||
</ID_PERMISSIONS>
|
|
||||||
|
|
||||||
<ID_DELETE >
|
|
||||||
<es>Borrar</es>
|
|
||||||
<en>Delete</en>
|
|
||||||
<po>Supressão</po>
|
|
||||||
</ID_DELETE>
|
|
||||||
|
|
||||||
<ID_NO_RECORDS_FOUND>
|
|
||||||
<es>Sin registros</es>
|
|
||||||
<en>Records not found</en>
|
|
||||||
<po>UID_NO_RECORDS_FOUND</po>
|
|
||||||
</ID_NO_RECORDS_FOUND>
|
|
||||||
</dynaForm>
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
<dynaForm name="menus.xml" basedir="">xml destinado para los lenguajes de los menus
|
|
||||||
<ID_MY_INFO >
|
|
||||||
<es>Mis datos</es>
|
|
||||||
<en>My info</en>
|
|
||||||
<po></po>
|
|
||||||
</ID_MY_INFO>
|
|
||||||
<ID_USERS >
|
|
||||||
<es>Usuarios</es>
|
|
||||||
<en>Users</en>
|
|
||||||
<po></po>
|
|
||||||
</ID_USERS>
|
|
||||||
|
|
||||||
<ID_ADD_USERS >
|
|
||||||
<es>Añadir Usuarios</es>
|
|
||||||
<en>Add Users</en>
|
|
||||||
<po>Adicionar Usuarios</po>
|
|
||||||
</ID_ADD_USERS>
|
|
||||||
|
|
||||||
|
|
||||||
<ID_NEW_APPLICATION >
|
|
||||||
<es>Añadir Nueva Applicación (sistema)</es>
|
|
||||||
<en>Add New Application</en>
|
|
||||||
<po>Inserir Novo Application</po>
|
|
||||||
</ID_NEW_APPLICATION>
|
|
||||||
|
|
||||||
<ID_NEW_AUTH_SOURCE >
|
|
||||||
<es>Añadir Fuente de Autenticación</es>
|
|
||||||
<en>New Authentication Source</en>
|
|
||||||
<po>Inserir Authentication</po>
|
|
||||||
</ID_NEW_AUTH_SOURCE>
|
|
||||||
|
|
||||||
<ID_EDIT >
|
|
||||||
<es>Editar</es>
|
|
||||||
<en>Edit</en>
|
|
||||||
<po>Editar</po>
|
|
||||||
</ID_EDIT>
|
|
||||||
|
|
||||||
<ID_TEST >
|
|
||||||
<es>Probar Conexión</es>
|
|
||||||
<en>Test Conectivity</en>
|
|
||||||
<po>Testar Conexion</po>
|
|
||||||
</ID_TEST>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<xxx >
|
|
||||||
<es></es>
|
|
||||||
<en></en>
|
|
||||||
<po></po>
|
|
||||||
</xxx>
|
|
||||||
|
|
||||||
<xxx >
|
|
||||||
<es></es>
|
|
||||||
<en></en>
|
|
||||||
<po></po>
|
|
||||||
</xxx>
|
|
||||||
|
|
||||||
<xxx >
|
|
||||||
<es></es>
|
|
||||||
<en></en>
|
|
||||||
<po></po>
|
|
||||||
</xxx>
|
|
||||||
|
|
||||||
</dynaForm>
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
The User "$USER" is currently inactive
|
|
||||||
Incorrect Password for the user "$USER"
|
|
||||||
The User "$USER" is not registered in the system
|
|
||||||
The New Password and the Confirm Password must be equals
|
|
||||||
Incorrect Old Password for the user "$USER"
|
|
||||||
You can't remove a user with one or more Applications
|
|
||||||
There is another user with the same User ID.
|
|
||||||
Password changed succesfully
|
|
||||||
Password reseted succesfully
|
|
||||||
New User created successfully
|
|
||||||
Applications
|
|
||||||
Roles from Application $STR_APP.
|
|
||||||
Permissions from Application $STR_APP.
|
|
||||||
Permissions from Role $STR_ROL in Application $STR_APP
|
|
||||||
There is another role with the same Code.
|
|
||||||
There is another application with the same Code.
|
|
||||||
There is another permission with the same Code.
|
|
||||||
User haven't rights to login this system.
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
El usuario "$USER" se encuentra inactivo
|
|
||||||
Clave de ingreso incorrecto para el usuario "$USER"
|
|
||||||
El usuario "$USER" no esta registrado en el sistema
|
|
||||||
El password nuevo y el de confirmacion deben ser iguales
|
|
||||||
Password antiguo incorrecto para el usuario "$USER"
|
|
||||||
Ud. no puede eliminar un usuario que tiene tramites
|
|
||||||
Ya existe un usuario con el mismo Identificador de usuario
|
|
||||||
Clave de inicio, cambiada correctamente
|
|
||||||
Clave de inicio, reiniciada correctamente
|
|
||||||
Nuevo Empleado creado satisfactoriamente
|
|
||||||
Aplicaciones
|
|
||||||
Roles de la Aplicación $STR_APP
|
|
||||||
Permisos de la Aplicación $STR_APP
|
|
||||||
Permisos del Rol $STR_APP en la Aplicación $STR_APP
|
|
||||||
Ya existe un Rol con el mismo código
|
|
||||||
Ya existe una Applicatión con el mismo código
|
|
||||||
Ya existe un Permiso con el mismo código
|
|
||||||
El usuario no tiene derechos para ejecutar esta aplicación
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
El usuario "$USER" se encuentra inactivo
|
|
||||||
Clave de ingreso incorrecto para el usuario "$USER"
|
|
||||||
El usuario "$USER" no esta registrado en el sistema
|
|
||||||
El password nuevo y el de confirmacion deben ser iguales
|
|
||||||
Password antiguo incorrecto para el usuario "$USER"
|
|
||||||
Ud. no puede eliminar un usuario que tiene tramites
|
|
||||||
Ya existe un usuario con el mismo Identificador de usuario
|
|
||||||
Clave de inicio, cambiada correctamente
|
|
||||||
Clave de inicio, reiniciada correctamente
|
|
||||||
Nuevo Usuario creado satisfactoriamente
|
|
||||||
Applicaciones
|
|
||||||
Roles de la Aplicacion $STR_APP
|
|
||||||
Permisos de la Aplicaciones $STR_APP
|
|
||||||
Permisos del Rol $STR_ROL en $STR_APP
|
|
||||||
Ya existe un Rol con el mismo Codigo
|
|
||||||
Ya existe una Aplicacion con el mismo Codigo
|
|
||||||
Ya existe un Permiso con el mismo Codigo
|
|
||||||
El usuario no tiene derechos para ejecutar esta aplicacion
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
%??.name=myApp.cnt basedir=content//files generic Mis tr<74>mites
|
|
||||||
|
|
||||||
%es.title
|
|
||||||
Administraci<EFBFBD>n de usuarios
|
|
||||||
%es.body.header
|
|
||||||
<center class=subtitle>.<center>
|
|
||||||
%es.body
|
|
||||||
|
|
||||||
%es.body.footer
|
|
||||||
<center><center>
|
|
||||||
%en.title
|
|
||||||
User Manager
|
|
||||||
%en.body.header
|
|
||||||
<center class=subtitle>.<center>
|
|
||||||
%en.body
|
|
||||||
|
|
||||||
%en.body.footer
|
|
||||||
<center><center>
|
|
||||||
%po.title
|
|
||||||
User Administrator
|
|
||||||
%en.body.header
|
|
||||||
<center class=subtitle>.<center>
|
|
||||||
%en.body
|
|
||||||
|
|
||||||
%en.body.footer
|
|
||||||
<center><center>
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000001','PM_LOGIN','2007-08-03 12:24:36','2007-08-03 12:24:36',1,'00000000000000000000000000000002');
|
|
||||||
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000002','PM_SETUP','2007-08-03 12:24:36','2007-08-03 12:24:36',1,'00000000000000000000000000000002');
|
|
||||||
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000003','PM_USERS','2007-08-03 12:24:36','2007-08-03 12:24:36',1,'00000000000000000000000000000002');
|
|
||||||
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000004','PM_FACTORY','2007-08-03 12:24:36','2007-08-03 12:24:36',1,'00000000000000000000000000000002');
|
|
||||||
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000005','PM_CASES','2007-08-03 12:24:36','2007-08-03 12:24:36',1,'00000000000000000000000000000002');
|
|
||||||
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000006','PM_ALLCASES','2008-04-30 00:00:00','2008-04-30 00:00:00',1,'00000000000000000000000000000002');
|
|
||||||
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000008','PM_REPORTS','2008-05-12 00:00:00','2008-05-12 00:00:00',0,'00000000000000000000000000000002');
|
|
||||||
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000007','PM_REASSIGNCASE','2008-05-02 18:16:29','2008-05-02 18:16:29',1,'00000000000000000000000000000002');
|
|
||||||
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000009','PM_SUPERVISOR','0000-00-00 00:00:00','0000-00-00 00:00:00',1,'00000000000000000000000000000002');
|
|
||||||
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000010','PM_SETUP_ADVANCE','0000-00-00 00:00:00','0000-00-00 00:00:00',1,'00000000000000000000000000000002');
|
|
||||||
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000011','PM_DASHBOARD','2009-02-18 00:00:00','2009-02-18 00:00:00',1,'00000000000000000000000000000002');
|
|
||||||
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000012','PM_WEBDAV','2009-08-21 00:00:00','2009-08-21 00:00:00',1,'00000000000000000000000000000002');
|
|
||||||
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000013','PM_DELETECASE','2009-10-12 00:00:00','0000-00-00 00:00:00',0,'00000000000000000000000000000002');
|
|
||||||
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000014','PM_EDITPERSONALINFO','2009-10-12 00:00:00','0000-00-00 00:00:00',1,'00000000000000000000000000000002');
|
|
||||||
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000015','PM_FOLDERS_VIEW','2009-10-12 00:00:00','0000-00-00 00:00:00',1,'00000000000000000000000000000002');
|
|
||||||
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000016','PM_FOLDERS_ADD_FOLDER','2009-10-12 00:00:00','0000-00-00 00:00:00',1,'00000000000000000000000000000002');
|
|
||||||
INSERT INTO RBAC_PERMISSIONS VALUES ('00000000000000000000000000000017','PM_FOLDERS_ADD_FILE','2009-10-12 00:00:00','0000-00-00 00:00:00',1,'00000000000000000000000000000002');
|
|
||||||
|
|
||||||
INSERT INTO RBAC_ROLES VALUES ('00000000000000000000000000000001','','00000000000000000000000000000001','RBAC_ADMIN','2007-07-31 19:10:22','2007-08-03 12:24:36',1);
|
|
||||||
INSERT INTO RBAC_ROLES VALUES ('00000000000000000000000000000002','','00000000000000000000000000000002','PROCESSMAKER_ADMIN','2007-07-31 19:10:22','2007-08-03 12:24:36',1);
|
|
||||||
INSERT INTO RBAC_ROLES VALUES ('00000000000000000000000000000003','','00000000000000000000000000000002','PROCESSMAKER_OPERATOR','2007-07-31 19:10:22','2007-08-03 12:24:36',1);
|
|
||||||
INSERT INTO RBAC_ROLES VALUES ('00000000000000000000000000000004','','00000000000000000000000000000002','PROCESSMAKER_MANAGER', '2010-03-29 09:14:15', '2010-03-29 09:19:53', 1);
|
|
||||||
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000001');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000002');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000003');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000004');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000005');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000006');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000007');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000008');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000009');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000010');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000011');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000012');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000013');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000014');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000015');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000016');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000002','00000000000000000000000000000017');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000003','00000000000000000000000000000001');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000003','00000000000000000000000000000005');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000001');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000003');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000005');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000006');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000007');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000008');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000009');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000011');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000013');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000014');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000015');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000016');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000017');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000018');
|
|
||||||
INSERT INTO RBAC_ROLES_PERMISSIONS VALUES ('00000000000000000000000000000004', '00000000000000000000000000000019');
|
|
||||||
|
|
||||||
INSERT INTO RBAC_SYSTEMS VALUES ('00000000000000000000000000000001','RBAC','2007-07-31 19:10:22','2007-08-03 12:24:36',1);
|
|
||||||
INSERT INTO RBAC_SYSTEMS VALUES ('00000000000000000000000000000002','PROCESSMAKER','2007-07-31 19:10:22','2007-08-03 12:24:36',1);
|
|
||||||
|
|
||||||
INSERT INTO RBAC_USERS VALUES ('00000000000000000000000000000001','admin','21232f297a57a5a743894a0e4a801fc3','Administrator','','admin@processmaker.com','2020-01-01','2007-08-03 12:24:36','2008-02-13 07:24:07',1,'MYSQL','00000000000000000000000000000000','','','','');
|
|
||||||
|
|
||||||
INSERT INTO RBAC_USERS_ROLES VALUES ('00000000000000000000000000000001','00000000000000000000000000000002');
|
|
||||||
@@ -1,361 +0,0 @@
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
|
||||||
/* PERMISSIONS */
|
|
||||||
/* ---------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
|
|
||||||
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'RBAC_PERMISSIONS')
|
|
||||||
BEGIN
|
|
||||||
DECLARE @reftable_1 nvarchar(60), @constraintname_1 nvarchar(60)
|
|
||||||
DECLARE refcursor CURSOR FOR
|
|
||||||
select reftables.name tablename, cons.name constraintname
|
|
||||||
from sysobjects tables,
|
|
||||||
sysobjects reftables,
|
|
||||||
sysobjects cons,
|
|
||||||
sysreferences ref
|
|
||||||
where tables.id = ref.rkeyid
|
|
||||||
and cons.id = ref.constid
|
|
||||||
and reftables.id = ref.fkeyid
|
|
||||||
and tables.name = 'RBAC_PERMISSIONS'
|
|
||||||
OPEN refcursor
|
|
||||||
FETCH NEXT from refcursor into @reftable_1, @constraintname_1
|
|
||||||
while @@FETCH_STATUS = 0
|
|
||||||
BEGIN
|
|
||||||
exec ('alter table '+@reftable_1+' drop constraint '+@constraintname_1)
|
|
||||||
FETCH NEXT from refcursor into @reftable_1, @constraintname_1
|
|
||||||
END
|
|
||||||
CLOSE refcursor
|
|
||||||
DEALLOCATE refcursor
|
|
||||||
DROP TABLE [RBAC_PERMISSIONS]
|
|
||||||
END
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE [RBAC_PERMISSIONS]
|
|
||||||
(
|
|
||||||
[PER_UID] VARCHAR(32) default '' NOT NULL,
|
|
||||||
[PER_CODE] VARCHAR(64) default '' NOT NULL,
|
|
||||||
[PER_CREATE_DATE] CHAR(19) default '0000-00-00 00:00:00' NOT NULL,
|
|
||||||
[PER_UPDATE_DATE] CHAR(19) default '0000-00-00 00:00:00' NOT NULL,
|
|
||||||
[PER_STATUS] INT default 1 NOT NULL,
|
|
||||||
[PER_SYSTEM] VARCHAR(32) default '00000000000000000000000000000002' NOT NULL,
|
|
||||||
CONSTRAINT RBAC_PERMISSIONS_PK PRIMARY KEY ([PER_UID])
|
|
||||||
);
|
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
|
||||||
/* ROLES */
|
|
||||||
/* ---------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
|
|
||||||
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'RBAC_ROLES')
|
|
||||||
BEGIN
|
|
||||||
DECLARE @reftable_2 nvarchar(60), @constraintname_2 nvarchar(60)
|
|
||||||
DECLARE refcursor CURSOR FOR
|
|
||||||
select reftables.name tablename, cons.name constraintname
|
|
||||||
from sysobjects tables,
|
|
||||||
sysobjects reftables,
|
|
||||||
sysobjects cons,
|
|
||||||
sysreferences ref
|
|
||||||
where tables.id = ref.rkeyid
|
|
||||||
and cons.id = ref.constid
|
|
||||||
and reftables.id = ref.fkeyid
|
|
||||||
and tables.name = 'ROLES'
|
|
||||||
OPEN refcursor
|
|
||||||
FETCH NEXT from refcursor into @reftable_2, @constraintname_2
|
|
||||||
while @@FETCH_STATUS = 0
|
|
||||||
BEGIN
|
|
||||||
exec ('alter table '+@reftable_2+' drop constraint '+@constraintname_2)
|
|
||||||
FETCH NEXT from refcursor into @reftable_2, @constraintname_2
|
|
||||||
END
|
|
||||||
CLOSE refcursor
|
|
||||||
DEALLOCATE refcursor
|
|
||||||
DROP TABLE [RBAC_ROLES]
|
|
||||||
END
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE [RBAC_ROLES]
|
|
||||||
(
|
|
||||||
[ROL_UID] VARCHAR(32) default '' NOT NULL,
|
|
||||||
[ROL_PARENT] VARCHAR(32) default '' NOT NULL,
|
|
||||||
[ROL_SYSTEM] VARCHAR(32) default '' NOT NULL,
|
|
||||||
[ROL_CODE] VARCHAR(32) default '' NOT NULL,
|
|
||||||
[ROL_CREATE_DATE] CHAR(19) default '0000-00-00 00:00:00' NOT NULL,
|
|
||||||
[ROL_UPDATE_DATE] CHAR(19) default '0000-00-00 00:00:00' NOT NULL,
|
|
||||||
[ROL_STATUS] INT default 1 NOT NULL,
|
|
||||||
CONSTRAINT RBAC_ROLES_PK PRIMARY KEY ([ROL_UID])
|
|
||||||
);
|
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
|
||||||
/* ROLES_PERMISSIONS */
|
|
||||||
/* ---------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
|
|
||||||
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'RBAC_ROLES_PERMISSIONS')
|
|
||||||
BEGIN
|
|
||||||
DECLARE @reftable_3 nvarchar(60), @constraintname_3 nvarchar(60)
|
|
||||||
DECLARE refcursor CURSOR FOR
|
|
||||||
select reftables.name tablename, cons.name constraintname
|
|
||||||
from sysobjects tables,
|
|
||||||
sysobjects reftables,
|
|
||||||
sysobjects cons,
|
|
||||||
sysreferences ref
|
|
||||||
where tables.id = ref.rkeyid
|
|
||||||
and cons.id = ref.constid
|
|
||||||
and reftables.id = ref.fkeyid
|
|
||||||
and tables.name = 'RBAC_ROLES_PERMISSIONS'
|
|
||||||
OPEN refcursor
|
|
||||||
FETCH NEXT from refcursor into @reftable_3, @constraintname_3
|
|
||||||
while @@FETCH_STATUS = 0
|
|
||||||
BEGIN
|
|
||||||
exec ('alter table '+@reftable_3+' drop constraint '+@constraintname_3)
|
|
||||||
FETCH NEXT from refcursor into @reftable_3, @constraintname_3
|
|
||||||
END
|
|
||||||
CLOSE refcursor
|
|
||||||
DEALLOCATE refcursor
|
|
||||||
DROP TABLE [RBAC_ROLES_PERMISSIONS]
|
|
||||||
END
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE [RBAC_ROLES_PERMISSIONS]
|
|
||||||
(
|
|
||||||
[ROL_UID] VARCHAR(32) default '' NOT NULL,
|
|
||||||
[PER_UID] VARCHAR(32) default '' NOT NULL,
|
|
||||||
CONSTRAINT RBAC_ROLES_PERMISSIONS_PK PRIMARY KEY ([ROL_UID],[PER_UID])
|
|
||||||
);
|
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
|
||||||
/* SYSTEMS */
|
|
||||||
/* ---------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
|
|
||||||
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'RBAC_SYSTEMS')
|
|
||||||
BEGIN
|
|
||||||
DECLARE @reftable_4 nvarchar(60), @constraintname_4 nvarchar(60)
|
|
||||||
DECLARE refcursor CURSOR FOR
|
|
||||||
select reftables.name tablename, cons.name constraintname
|
|
||||||
from sysobjects tables,
|
|
||||||
sysobjects reftables,
|
|
||||||
sysobjects cons,
|
|
||||||
sysreferences ref
|
|
||||||
where tables.id = ref.rkeyid
|
|
||||||
and cons.id = ref.constid
|
|
||||||
and reftables.id = ref.fkeyid
|
|
||||||
and tables.name = 'RBAC_SYSTEMS'
|
|
||||||
OPEN refcursor
|
|
||||||
FETCH NEXT from refcursor into @reftable_4, @constraintname_4
|
|
||||||
while @@FETCH_STATUS = 0
|
|
||||||
BEGIN
|
|
||||||
exec ('alter table '+@reftable_4+' drop constraint '+@constraintname_4)
|
|
||||||
FETCH NEXT from refcursor into @reftable_4, @constraintname_4
|
|
||||||
END
|
|
||||||
CLOSE refcursor
|
|
||||||
DEALLOCATE refcursor
|
|
||||||
DROP TABLE [RBAC_SYSTEMS]
|
|
||||||
END
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE [RBAC_SYSTEMS]
|
|
||||||
(
|
|
||||||
[SYS_UID] VARCHAR(32) default '' NOT NULL,
|
|
||||||
[SYS_CODE] VARCHAR(32) default '' NOT NULL,
|
|
||||||
[SYS_CREATE_DATE] CHAR(19) default '0000-00-00 00:00:00' NOT NULL,
|
|
||||||
[SYS_UPDATE_DATE] CHAR(19) default '0000-00-00 00:00:00' NOT NULL,
|
|
||||||
[SYS_STATUS] INT default 0 NOT NULL,
|
|
||||||
CONSTRAINT RBAC_SYSTEMS_PK PRIMARY KEY ([SYS_UID])
|
|
||||||
);
|
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
|
||||||
/* RBAC_USERS */
|
|
||||||
/* ---------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
|
|
||||||
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'RBAC_USERS')
|
|
||||||
BEGIN
|
|
||||||
DECLARE @reftable_5 nvarchar(60), @constraintname_5 nvarchar(60)
|
|
||||||
DECLARE refcursor CURSOR FOR
|
|
||||||
select reftables.name tablename, cons.name constraintname
|
|
||||||
from sysobjects tables,
|
|
||||||
sysobjects reftables,
|
|
||||||
sysobjects cons,
|
|
||||||
sysreferences ref
|
|
||||||
where tables.id = ref.rkeyid
|
|
||||||
and cons.id = ref.constid
|
|
||||||
and reftables.id = ref.fkeyid
|
|
||||||
and tables.name = 'RBAC_USERS'
|
|
||||||
OPEN refcursor
|
|
||||||
FETCH NEXT from refcursor into @reftable_5, @constraintname_5
|
|
||||||
while @@FETCH_STATUS = 0
|
|
||||||
BEGIN
|
|
||||||
exec ('alter table '+@reftable_5+' drop constraint '+@constraintname_5)
|
|
||||||
FETCH NEXT from refcursor into @reftable_5, @constraintname_5
|
|
||||||
END
|
|
||||||
CLOSE refcursor
|
|
||||||
DEALLOCATE refcursor
|
|
||||||
DROP TABLE [RBAC_USERS]
|
|
||||||
END
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE [RBAC_USERS]
|
|
||||||
(
|
|
||||||
[USR_UID] VARCHAR(32) default '' NOT NULL,
|
|
||||||
[USR_USERNAME] VARCHAR(100) default '' NOT NULL,
|
|
||||||
[USR_PASSWORD] VARCHAR(32) default '' NOT NULL,
|
|
||||||
[USR_FIRSTNAME] VARCHAR(50) default '' NOT NULL,
|
|
||||||
[USR_LASTNAME] VARCHAR(50) default '' NOT NULL,
|
|
||||||
[USR_EMAIL] VARCHAR(100) default '' NOT NULL,
|
|
||||||
[USR_DUE_DATE] CHAR(19) default '0000-00-00' NOT NULL,
|
|
||||||
[USR_CREATE_DATE] CHAR(19) default '0000-00-00 00:00:00' NOT NULL,
|
|
||||||
[USR_UPDATE_DATE] CHAR(19) default '0000-00-00 00:00:00' NOT NULL,
|
|
||||||
[USR_STATUS] INT default 1 NOT NULL,
|
|
||||||
[USR_AUTH_TYPE] VARCHAR(32) default '' NOT NULL,
|
|
||||||
[UID_AUTH_SOURCE] VARCHAR(32) default '' NOT NULL,
|
|
||||||
[USR_AUTH_USER_DN] VARCHAR(MAX) NULL,
|
|
||||||
[USR_AUTH_SUPERVISOR_DN] VARCHAR(255) default '' NOT NULL,
|
|
||||||
CONSTRAINT RBAC_USERS_PK PRIMARY KEY ([USR_UID])
|
|
||||||
);
|
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
|
||||||
/* USERS_ROLES */
|
|
||||||
/* ---------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
|
|
||||||
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'RBAC_USERS_ROLES')
|
|
||||||
BEGIN
|
|
||||||
DECLARE @reftable_6 nvarchar(60), @constraintname_6 nvarchar(60)
|
|
||||||
DECLARE refcursor CURSOR FOR
|
|
||||||
select reftables.name tablename, cons.name constraintname
|
|
||||||
from sysobjects tables,
|
|
||||||
sysobjects reftables,
|
|
||||||
sysobjects cons,
|
|
||||||
sysreferences ref
|
|
||||||
where tables.id = ref.rkeyid
|
|
||||||
and cons.id = ref.constid
|
|
||||||
and reftables.id = ref.fkeyid
|
|
||||||
and tables.name = 'RBAC_USERS_ROLES'
|
|
||||||
OPEN refcursor
|
|
||||||
FETCH NEXT from refcursor into @reftable_6, @constraintname_6
|
|
||||||
while @@FETCH_STATUS = 0
|
|
||||||
BEGIN
|
|
||||||
exec ('alter table '+@reftable_6+' drop constraint '+@constraintname_6)
|
|
||||||
FETCH NEXT from refcursor into @reftable_6, @constraintname_6
|
|
||||||
END
|
|
||||||
CLOSE refcursor
|
|
||||||
DEALLOCATE refcursor
|
|
||||||
DROP TABLE [RBAC_USERS_ROLES]
|
|
||||||
END
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE [RBAC_USERS_ROLES]
|
|
||||||
(
|
|
||||||
[USR_UID] VARCHAR(32) default '' NOT NULL,
|
|
||||||
[ROL_UID] VARCHAR(32) default '' NOT NULL,
|
|
||||||
CONSTRAINT RBAC_USERS_ROLES_PK PRIMARY KEY ([USR_UID],[ROL_UID])
|
|
||||||
);
|
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
|
||||||
/* AUTHENTICATION_SOURCE */
|
|
||||||
/* ---------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
|
|
||||||
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'RBAC_AUTHENTICATION_SOURCE')
|
|
||||||
BEGIN
|
|
||||||
DECLARE @reftable_7 nvarchar(60), @constraintname_7 nvarchar(60)
|
|
||||||
DECLARE refcursor CURSOR FOR
|
|
||||||
select reftables.name tablename, cons.name constraintname
|
|
||||||
from sysobjects tables,
|
|
||||||
sysobjects reftables,
|
|
||||||
sysobjects cons,
|
|
||||||
sysreferences ref
|
|
||||||
where tables.id = ref.rkeyid
|
|
||||||
and cons.id = ref.constid
|
|
||||||
and reftables.id = ref.fkeyid
|
|
||||||
and tables.name = 'RBAC_AUTHENTICATION_SOURCE'
|
|
||||||
OPEN refcursor
|
|
||||||
FETCH NEXT from refcursor into @reftable_7, @constraintname_7
|
|
||||||
while @@FETCH_STATUS = 0
|
|
||||||
BEGIN
|
|
||||||
exec ('alter table '+@reftable_7+' drop constraint '+@constraintname_7)
|
|
||||||
FETCH NEXT from refcursor into @reftable_7, @constraintname_7
|
|
||||||
END
|
|
||||||
CLOSE refcursor
|
|
||||||
DEALLOCATE refcursor
|
|
||||||
DROP TABLE [RBAC_AUTHENTICATION_SOURCE]
|
|
||||||
END
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE [RBAC_AUTHENTICATION_SOURCE]
|
|
||||||
(
|
|
||||||
[AUTH_SOURCE_UID] VARCHAR(32) default '' NOT NULL,
|
|
||||||
[AUTH_SOURCE_NAME] VARCHAR(50) default '' NOT NULL,
|
|
||||||
[AUTH_SOURCE_PROVIDER] VARCHAR(20) default '' NOT NULL,
|
|
||||||
[AUTH_SOURCE_SERVER_NAME] VARCHAR(50) default '' NOT NULL,
|
|
||||||
[AUTH_SOURCE_PORT] INT default 389 NULL,
|
|
||||||
[AUTH_SOURCE_ENABLED_TLS] INT default 0 NULL,
|
|
||||||
[AUTH_SOURCE_VERSION] VARCHAR(16) default '3' NOT NULL,
|
|
||||||
[AUTH_SOURCE_BASE_DN] VARCHAR(128) default '' NOT NULL,
|
|
||||||
[AUTH_ANONYMOUS] INT default 0 NULL,
|
|
||||||
[AUTH_SOURCE_SEARCH_USER] VARCHAR(128) default '' NOT NULL,
|
|
||||||
[AUTH_SOURCE_PASSWORD] VARCHAR(32) default '' NOT NULL,
|
|
||||||
[AUTH_SOURCE_ATTRIBUTES] VARCHAR(255) default '' NOT NULL,
|
|
||||||
[AUTH_SOURCE_OBJECT_CLASSES] VARCHAR(255) default '' NOT NULL,
|
|
||||||
[AUTH_SOURCE_DATA] TEXT NULL,
|
|
||||||
CONSTRAINT RBAC_AUTHENTICATION_SOURCE_PK PRIMARY KEY ([AUTH_SOURCE_UID])
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
|
||||||
/* USERS */
|
|
||||||
/* ---------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
|
|
||||||
IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'RBAC_USERS')
|
|
||||||
BEGIN
|
|
||||||
DECLARE @reftable_8 nvarchar(60), @constraintname_8 nvarchar(60)
|
|
||||||
DECLARE refcursor CURSOR FOR
|
|
||||||
select reftables.name tablename, cons.name constraintname
|
|
||||||
from sysobjects tables,
|
|
||||||
sysobjects reftables,
|
|
||||||
sysobjects cons,
|
|
||||||
sysreferences ref
|
|
||||||
where tables.id = ref.rkeyid
|
|
||||||
and cons.id = ref.constid
|
|
||||||
and reftables.id = ref.fkeyid
|
|
||||||
and tables.name = 'RBAC_USERS'
|
|
||||||
OPEN refcursor
|
|
||||||
FETCH NEXT from refcursor into @reftable_8, @constraintname_8
|
|
||||||
while @@FETCH_STATUS = 0
|
|
||||||
BEGIN
|
|
||||||
exec ('alter table '+@reftable_8+' drop constraint '+@constraintname_8)
|
|
||||||
FETCH NEXT from refcursor into @reftable_8, @constraintname_8
|
|
||||||
END
|
|
||||||
CLOSE refcursor
|
|
||||||
DEALLOCATE refcursor
|
|
||||||
DROP TABLE [RBAC_USERS]
|
|
||||||
END
|
|
||||||
|
|
||||||
CREATE TABLE [RBAC_USERS]
|
|
||||||
(
|
|
||||||
[USR_UID] VARCHAR(32) default '' NOT NULL,
|
|
||||||
[USR_USERNAME] VARCHAR(100) default '' NOT NULL,
|
|
||||||
[USR_PASSWORD] VARCHAR(32) default '' NOT NULL,
|
|
||||||
[USR_FIRSTNAME] VARCHAR(50) default '' NOT NULL,
|
|
||||||
[USR_LASTNAME] VARCHAR(50) default '' NOT NULL,
|
|
||||||
[USR_EMAIL] VARCHAR(100) default '' NOT NULL,
|
|
||||||
[USR_DUE_DATE] CHAR(19) default '0000-00-00' NOT NULL,
|
|
||||||
[USR_CREATE_DATE] CHAR(19) default '0000-00-00 00:00:00' NOT NULL,
|
|
||||||
[USR_UPDATE_DATE] CHAR(19) default '0000-00-00 00:00:00' NOT NULL,
|
|
||||||
[USR_STATUS] INT default 1 NOT NULL,
|
|
||||||
|
|
||||||
[USR_AUTH_TYPE] VARCHAR(32) NOT NULL DEFAULT ('MSSQL'),
|
|
||||||
[UID_AUTH_SOURCE] VARCHAR(32) NOT NULL DEFAULT ('00000000000000000000000000000000'),
|
|
||||||
[USR_AUTH_USER_DN] VARCHAR(255) NOT NULL,
|
|
||||||
[USR_AUTH_SUPERVISOR_DN] VARCHAR(255) NULL,
|
|
||||||
|
|
||||||
[USR_REPLACED_BY] varchar(32) NULL,
|
|
||||||
[USR_REPORTS_TO] varchar(32) NULL,
|
|
||||||
|
|
||||||
|
|
||||||
CONSTRAINT RBAC_USERS_PK PRIMARY KEY ([USR_UID])
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# Sqlfile -> Database map
|
|
||||||
schema.sql=rbac
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
-- foreach ($databaseName in $databaseNames)
|
|
||||||
-- drop database $databaseName;
|
|
||||||
-- create database $databaseName;
|
|
||||||
-- end
|
|
||||||
@@ -1,127 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------
|
|
||||||
PERMISSIONS
|
|
||||||
----------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
DROP TABLE "RBAC_PERMISSIONS" CASCADE CONSTRAINTS;
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE "RBAC_PERMISSIONS"
|
|
||||||
(
|
|
||||||
"PER_UID" VARCHAR2(32) default '' NOT NULL,
|
|
||||||
"PER_CODE" VARCHAR2(64) default '' NOT NULL,
|
|
||||||
"PER_CREATE_DATE" DATE default '0000-00-00 00:00:00' NOT NULL,
|
|
||||||
"PER_UPDATE_DATE" DATE default '0000-00-00 00:00:00' NOT NULL,
|
|
||||||
"PER_STATUS" NUMBER default 1 NOT NULL
|
|
||||||
);
|
|
||||||
|
|
||||||
ALTER TABLE "RBAC_PERMISSIONS"
|
|
||||||
ADD CONSTRAINT "PERMISSIONS_PK"
|
|
||||||
PRIMARY KEY ("PER_UID");
|
|
||||||
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------
|
|
||||||
ROLES
|
|
||||||
----------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
DROP TABLE "RBAC_ROLES" CASCADE CONSTRAINTS;
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE "RBAC_ROLES"
|
|
||||||
(
|
|
||||||
"ROL_UID" VARCHAR2(32) default '' NOT NULL,
|
|
||||||
"ROL_PARENT" VARCHAR2(32) default '' NOT NULL,
|
|
||||||
"ROL_SYSTEM" VARCHAR2(32) default '' NOT NULL,
|
|
||||||
"ROL_CODE" VARCHAR2(32) default '' NOT NULL,
|
|
||||||
"ROL_CREATE_DATE" DATE default '0000-00-00 00:00:00' NOT NULL,
|
|
||||||
"ROL_UPDATE_DATE" DATE default '0000-00-00 00:00:00' NOT NULL,
|
|
||||||
"ROL_STATUS" NUMBER default 1 NOT NULL
|
|
||||||
);
|
|
||||||
|
|
||||||
ALTER TABLE "RBAC_ROLES"
|
|
||||||
ADD CONSTRAINT "ROLES_PK"
|
|
||||||
PRIMARY KEY ("ROL_UID");
|
|
||||||
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------
|
|
||||||
ROLES_PERMISSIONS
|
|
||||||
----------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
DROP TABLE "RBAC_ROLES_PERMISSIONS" CASCADE CONSTRAINTS;
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE "RBAC_ROLES_PERMISSIONS"
|
|
||||||
(
|
|
||||||
"ROL_UID" VARCHAR2(32) default '' NOT NULL,
|
|
||||||
"PER_UID" VARCHAR2(32) default '' NOT NULL
|
|
||||||
);
|
|
||||||
|
|
||||||
ALTER TABLE "RBAC_ROLES_PERMISSIONS"
|
|
||||||
ADD CONSTRAINT "RBAC_ROLES_PERMISSIONS_PK"
|
|
||||||
PRIMARY KEY ("ROL_UID","PER_UID");
|
|
||||||
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------
|
|
||||||
SYSTEMS
|
|
||||||
----------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
DROP TABLE "RBAC_SYSTEMS" CASCADE CONSTRAINTS;
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE "RBAC_SYSTEMS"
|
|
||||||
(
|
|
||||||
"SYS_UID" VARCHAR2(32) default '' NOT NULL,
|
|
||||||
"SYS_CODE" VARCHAR2(32) default '' NOT NULL,
|
|
||||||
"SYS_CREATE_DATE" DATE default '0000-00-00 00:00:00' NOT NULL,
|
|
||||||
"SYS_UPDATE_DATE" DATE default '0000-00-00 00:00:00' NOT NULL,
|
|
||||||
"SYS_STATUS" NUMBER default 0 NOT NULL
|
|
||||||
);
|
|
||||||
|
|
||||||
ALTER TABLE "RBAC_SYSTEMS"
|
|
||||||
ADD CONSTRAINT "SYSTEMS_PK"
|
|
||||||
PRIMARY KEY ("SYS_UID");
|
|
||||||
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------
|
|
||||||
USERS
|
|
||||||
----------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
DROP TABLE "RBAC_USERS" CASCADE CONSTRAINTS;
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE "RBAC_USERS"
|
|
||||||
(
|
|
||||||
"USR_UID" VARCHAR2(32) default '' NOT NULL,
|
|
||||||
"USR_USERNAME" VARCHAR2(100) default '' NOT NULL,
|
|
||||||
"USR_PASSWORD" VARCHAR2(32) default '' NOT NULL,
|
|
||||||
"USR_FIRSTNAME" VARCHAR2(50) default '' NOT NULL,
|
|
||||||
"USR_LASTNAME" VARCHAR2(50) default '' NOT NULL,
|
|
||||||
"USR_EMAIL" VARCHAR2(100) default '' NOT NULL,
|
|
||||||
"USR_DUE_DATE" DATE default '0000-00-00' NOT NULL,
|
|
||||||
"USR_CREATE_DATE" DATE default '0000-00-00 00:00:00' NOT NULL,
|
|
||||||
"USR_UPDATE_DATE" DATE default '0000-00-00 00:00:00' NOT NULL,
|
|
||||||
"USR_STATUS" NUMBER default 1 NOT NULL
|
|
||||||
);
|
|
||||||
|
|
||||||
ALTER TABLE "RBAC_USERS"
|
|
||||||
ADD CONSTRAINT "USERS_PK"
|
|
||||||
PRIMARY KEY ("USR_UID");
|
|
||||||
|
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------
|
|
||||||
USERS_ROLES
|
|
||||||
----------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
DROP TABLE "RBAC_USERS_ROLES" CASCADE CONSTRAINTS;
|
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE "RBAC_USERS_ROLES"
|
|
||||||
(
|
|
||||||
"USR_UID" VARCHAR2(32) default '' NOT NULL,
|
|
||||||
"ROL_UID" VARCHAR2(32) default '' NOT NULL
|
|
||||||
);
|
|
||||||
|
|
||||||
ALTER TABLE "RBAC_USERS_ROLES"
|
|
||||||
ADD CONSTRAINT "USERS_ROLES_PK"
|
|
||||||
PRIMARY KEY ("USR_UID","ROL_UID");
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# Sqlfile -> Database map
|
|
||||||
schema.sql=rbac
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
drop database rbac;
|
|
||||||
create database rbac;
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# Sqlfile -> Database map
|
|
||||||
schema.sql=rbac
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* dbmodule_processmaker.php
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
$DB_INDEX++;
|
|
||||||
$DB_MODULE[$DB_INDEX]['name'] = 'ProcessMaker';
|
|
||||||
$DB_MODULE[$DB_INDEX]['type'] = 'multiple';
|
|
||||||
$DB_MODULE[$DB_INDEX]['path'] = '/shared/workflow_data/sites/';
|
|
||||||
?>
|
|
||||||
@@ -1,118 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* inc.application.php
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
class App
|
|
||||||
{
|
|
||||||
function ForceLogin()
|
|
||||||
{
|
|
||||||
global $HTTP_SESSION_VARS;
|
|
||||||
global $G_MAIN_MENU;
|
|
||||||
global $G_SUB_MENU;
|
|
||||||
if( $HTTP_SESSION_VARS['LOGGED_IN'] == false)
|
|
||||||
{
|
|
||||||
header( "location: /sys/" . SYS_LANG . "/" . SYS_SKIN . "/login/login.html" );
|
|
||||||
die();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$cmptype = $HTTP_SESSION_VARS['USER_TYPE'];
|
|
||||||
switch( $cmptype )
|
|
||||||
{
|
|
||||||
case 'BUYER':
|
|
||||||
$G_MAIN_MENU = "buyer";
|
|
||||||
$G_SUB_MENU = "";
|
|
||||||
break;
|
|
||||||
case 'PROVIDER':
|
|
||||||
$G_MAIN_MENU = "provider";
|
|
||||||
$G_SUB_MENU = "";
|
|
||||||
break;
|
|
||||||
case 'REINSURANCE':
|
|
||||||
$G_MAIN_MENU = "reinsurance";
|
|
||||||
$G_SUB_MENU = "";
|
|
||||||
break;
|
|
||||||
case 'ADMIN':
|
|
||||||
$G_MAIN_MENU = "admin";
|
|
||||||
$G_SUB_MENU = "";
|
|
||||||
break;
|
|
||||||
case '':
|
|
||||||
header( "location: /sys/" . SYS_LANG . "/" . SYS_SKIN . "/login/login.html" );
|
|
||||||
die();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$G_MAIN_MENU = "default";
|
|
||||||
$G_SUB_MENU = "";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function GetPartnerStatus()
|
|
||||||
{
|
|
||||||
global $HTTP_SESSION_VARS;
|
|
||||||
$slipid = $HTTP_SESSION_VARS['CURRENT_SLIP'];
|
|
||||||
$partnerid = $HTTP_SESSION_VARS['CURRENT_PARTNER'];
|
|
||||||
|
|
||||||
$mdbc = new DBConnection();
|
|
||||||
G::LoadClass( "slip" );
|
|
||||||
$slip = new Slip;
|
|
||||||
$slip->SetTo( $mdbc );
|
|
||||||
$slip->Load( $slipid );
|
|
||||||
$partner = $slip->GetPartner( $partnerid );
|
|
||||||
|
|
||||||
$res = $partner->Fields['SLP_PARTNER_STATUS'];
|
|
||||||
unset( $partner );
|
|
||||||
unset( $slip );
|
|
||||||
unset( $mdbc );
|
|
||||||
return $res;
|
|
||||||
}
|
|
||||||
|
|
||||||
function SetPartnerStatus( $intStatus = 0 )
|
|
||||||
{
|
|
||||||
global $HTTP_SESSION_VARS;
|
|
||||||
$slipid = $HTTP_SESSION_VARS['CURRENT_SLIP'];
|
|
||||||
$partnerid = $HTTP_SESSION_VARS['CURRENT_PARTNER'];
|
|
||||||
|
|
||||||
$mdbc = new DBConnection();
|
|
||||||
G::LoadClass( "slip" );
|
|
||||||
$slip = new Slip;
|
|
||||||
$slip->SetTo( $mdbc );
|
|
||||||
$slip->Load( $slipid );
|
|
||||||
$partner = $slip->GetPartner( $partnerid );
|
|
||||||
|
|
||||||
$partner->Fields = NULL;
|
|
||||||
$partner->Fields['UID_SLIP'] = $slipid;
|
|
||||||
$partner->Fields['UID_REINSURANCE'] = $partnerid;
|
|
||||||
$partner->Fields['SLP_PARTNER_STATUS'] = $intStatus;
|
|
||||||
$partner->Fields['SLP_PARTNER_UPDATED'] = G::CurDate();
|
|
||||||
$partner->Save();
|
|
||||||
|
|
||||||
unset( $partner );
|
|
||||||
unset( $slip );
|
|
||||||
unset( $mdbc );
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -1,224 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* inc.dynaForms.php
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
class Node {
|
|
||||||
var $name = "";
|
|
||||||
var $attribute = NULL;
|
|
||||||
var $value = NULL;
|
|
||||||
var $children = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
$header = "";
|
|
||||||
$tree = NULL;
|
|
||||||
|
|
||||||
function read_config_file(){
|
|
||||||
global $home;
|
|
||||||
$directory = PATH_DYNAFORM;
|
|
||||||
$car = substr ($directory, strlen ($directory)-1, 1);
|
|
||||||
if ($car=='/' ) $directory = substr( $directory, 0, strlen($directory)- 1 );
|
|
||||||
$home = $directory;
|
|
||||||
|
|
||||||
global $showlang;
|
|
||||||
$showlang = "es,en";
|
|
||||||
}
|
|
||||||
|
|
||||||
function parseNodo1 ( $token ) {
|
|
||||||
//parse de <name atr=1 attr=2 ... > en un nuevo nodo.
|
|
||||||
$nodo = new Node;
|
|
||||||
$nodo->children = NULL;
|
|
||||||
$tok = ""; $n = 0;
|
|
||||||
for ($i=0; $i<strlen ($token); $i++) {
|
|
||||||
$car = $token[$i];
|
|
||||||
if ($car == ' ' || $car == "=") {
|
|
||||||
if (strlen($tok) > 0 ) { $tokens [$n++] = $tok; $tok = ""; }
|
|
||||||
if ($car == '=' ) { $tokens [$n++] = $car; }
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$tok .= $car;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (strlen($tok) > 0 ) { $tokens [$n++] = $tok; $tok = ""; }
|
|
||||||
|
|
||||||
//asignar los valores para el nombre del nodo y sus attributos
|
|
||||||
$nodo->name = trim($tokens[0]);
|
|
||||||
for ($i=1; $i< $n; $i++ ) {
|
|
||||||
$aux = $tokens[$i+2];
|
|
||||||
if ($aux[0] == $aux[strlen($aux)-1] || $aux[0] == '"') $aux = substr ($aux,1,strlen($aux)-2);
|
|
||||||
$key = $tokens[$i]; $val = "true";
|
|
||||||
if ($tokens[$i+1]== "=") {$val = $aux; $i+=2;}
|
|
||||||
// $nodo->attribute = array_merge ( $nodo->attribute, array ( $key => $val ) );
|
|
||||||
$nodo->attribute[$key] = $val;
|
|
||||||
}
|
|
||||||
return $nodo;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getTag () {
|
|
||||||
global $buffer;
|
|
||||||
global $bufIndex;
|
|
||||||
global $size;
|
|
||||||
global $header;
|
|
||||||
global $tree;
|
|
||||||
$token = "";
|
|
||||||
|
|
||||||
//PRIMER BUCLE buscar tag >
|
|
||||||
while ($bufIndex <= $size && $car !='>') {
|
|
||||||
$token .= $car;
|
|
||||||
$car = $buffer [$bufIndex++];
|
|
||||||
}
|
|
||||||
if ($token[0] == "?") {
|
|
||||||
$header = $token;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$nodo = parseNodo1 ($token);
|
|
||||||
|
|
||||||
//SEGUNDO BUCLE buscar VALUE
|
|
||||||
$car = $buffer [$bufIndex++]; $token = "";
|
|
||||||
while ($bufIndex <= $size && $car !='<') {
|
|
||||||
$token .= $car;
|
|
||||||
$car = $buffer [$bufIndex++];
|
|
||||||
}
|
|
||||||
$nodo->value = trim($token);
|
|
||||||
|
|
||||||
|
|
||||||
//TERCER BUCLE buscar </tag>
|
|
||||||
$res = 0;
|
|
||||||
while ($res == 0) {
|
|
||||||
if ($car != "<") while ( ($car = trim( $buffer [$bufIndex++] )) == "");
|
|
||||||
if ($car=="<") {
|
|
||||||
$res = 0;
|
|
||||||
$car = $buffer [$bufIndex++];
|
|
||||||
//ADDCHILD nodo recien creado
|
|
||||||
if ($car != "/") {
|
|
||||||
$bufIndex --;
|
|
||||||
$n = count($nodo->children);
|
|
||||||
$nodo->children[$n] = getTag ();
|
|
||||||
} else $res = 1;
|
|
||||||
}
|
|
||||||
else die ("se esperaba '<' y se encontro $car");
|
|
||||||
}
|
|
||||||
|
|
||||||
//se supone que se ha leido "</" y continuamos con el nombre
|
|
||||||
$token = "";
|
|
||||||
$car = $buffer [$bufIndex++];
|
|
||||||
while ($bufIndex <= $size && $car !='>') {
|
|
||||||
$token .= $car;
|
|
||||||
$car = $buffer [$bufIndex++];
|
|
||||||
}
|
|
||||||
if ( strcmp ($nodo->name, trim($token)) != 0) die ("no corresponde fin de tag </$token> con <" . $nodo->name. ">");
|
|
||||||
|
|
||||||
return $nodo;
|
|
||||||
}
|
|
||||||
|
|
||||||
function parseFile ($filename) {
|
|
||||||
global $tree;
|
|
||||||
global $buffer;
|
|
||||||
global $bufIndex;
|
|
||||||
global $size;
|
|
||||||
|
|
||||||
if (strlen($filename) <= 0) die ("invalid filename");
|
|
||||||
|
|
||||||
if ( ! file_exists ( $filename) ) die ("This file $filename does not exist");
|
|
||||||
if ( ! is_file ( $filename) ) die ("$filename is not a file");
|
|
||||||
|
|
||||||
$size = filesize ($filename);
|
|
||||||
$fp = fopen ($filename, "rb");
|
|
||||||
$i = 0;
|
|
||||||
|
|
||||||
$aux = fread($fp, $size);
|
|
||||||
$buffer = "";
|
|
||||||
for ($i = 0; $i < $size; $i++) {
|
|
||||||
if (!($aux[$i] == "\n" || $aux[$i] == "\r" || $aux[$i] == "\t")) $buffer .= $aux[$i];
|
|
||||||
}
|
|
||||||
fclose ($fp);
|
|
||||||
$bufIndex = 0;
|
|
||||||
|
|
||||||
$size = strlen ($buffer);
|
|
||||||
|
|
||||||
while ( $bufIndex <= $size ) {
|
|
||||||
$car = $buffer [$bufIndex++];
|
|
||||||
if ($car == '<' )
|
|
||||||
$tree = getTag();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function saveXml(){
|
|
||||||
global $tree;
|
|
||||||
global $header;
|
|
||||||
global $filename;
|
|
||||||
global $HTTP_POST_VARS;
|
|
||||||
global $curDir;
|
|
||||||
global $onlyName;
|
|
||||||
|
|
||||||
//crear el archivo Xml
|
|
||||||
// print "$filename <br>";
|
|
||||||
|
|
||||||
$fp = fopen ($filename, "w+");
|
|
||||||
fputs ($fp,"<$header>\n");
|
|
||||||
|
|
||||||
$aux = explode ( '/', $filename);
|
|
||||||
$onlyName = $aux[count($aux)-1];
|
|
||||||
$curDir = $HTTP_POST_VARS['curDir'];
|
|
||||||
|
|
||||||
fputs ($fp,"<dynaForm name=\"$onlyName\" basedir=\"$curDir\">$tree->value\n");
|
|
||||||
|
|
||||||
for ($i = 0; $i < count($tree->children); $i++) {
|
|
||||||
$nodo = $tree->children[$i];
|
|
||||||
|
|
||||||
fputs ($fp,"<$nodo->name ");
|
|
||||||
if ( is_array ($nodo->attribute) )
|
|
||||||
foreach ( $nodo->attribute as $attr=>$attrValue )
|
|
||||||
fputs ($fp,"$attr=\"$attrValue\" ");
|
|
||||||
fputs ($fp,">\n");
|
|
||||||
|
|
||||||
//si es un dropdown-SQL la sentencia select va como valor del nodo
|
|
||||||
if (strlen ($nodo->value) > 0) {
|
|
||||||
fputs ($fp,"$nodo->value\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
for ($j = 0; $j < count($nodo->children); $j++) {
|
|
||||||
$lang = $nodo->children[$j];
|
|
||||||
fputs ($fp, " <$lang->name>$lang->value");
|
|
||||||
|
|
||||||
//si tiene etiquetas del tipo option
|
|
||||||
if (is_array($lang->children)) {
|
|
||||||
fputs ($fp, "\n");
|
|
||||||
for ($k = 0; $k < count($lang->children); $k++) {
|
|
||||||
$option = $lang->children[$k];
|
|
||||||
fputs ($fp, "<option name=\"" . $option->attribute['name'] . "\">$option->value</option>\n");
|
|
||||||
}
|
|
||||||
} //if tiene etiquetas del tipo opcion.
|
|
||||||
fputs ($fp, "</$lang->name>\n");
|
|
||||||
|
|
||||||
} //for j
|
|
||||||
fputs ($fp,"</$nodo->name>\n");
|
|
||||||
|
|
||||||
} //for i
|
|
||||||
fputs ($fp,"</dynaForm>\n");
|
|
||||||
fclose ($fp);
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* backApp.php
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
global $G_TMP_MENU;
|
|
||||||
global $G_BACK_PAGE;
|
|
||||||
|
|
||||||
$G_TMP_MENU->AddRawOption( $G_BACK_PAGE);
|
|
||||||
|
|
||||||
switch ( SYS_LANG ) {
|
|
||||||
case "es" :
|
|
||||||
$G_TMP_MENU->Labels = Array (
|
|
||||||
"Retornar al trámite"
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
default :
|
|
||||||
$G_TMP_MENU->Labels = Array (
|
|
||||||
"Back to Application"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* cancel.php
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
global $G_TMP_MENU;
|
|
||||||
global $G_BACK_PAGE;
|
|
||||||
|
|
||||||
$G_TMP_MENU->AddRawOption( $G_BACK_PAGE);
|
|
||||||
|
|
||||||
switch ( SYS_LANG ) {
|
|
||||||
case "es" :
|
|
||||||
$G_TMP_MENU->Labels = Array (
|
|
||||||
"Cancelar"
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case "po" :
|
|
||||||
$G_TMP_MENU->Labels = Array (
|
|
||||||
"Cancelar"
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
default :
|
|
||||||
$G_TMP_MENU->Labels = Array (
|
|
||||||
"Cancel"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user