added site files
This commit is contained in:
parent
a6f70a6c78
commit
329148c253
253 changed files with 30486 additions and 0 deletions
43
EnlighterJS/Source/Dom/MooTools/Dom.js
Normal file
43
EnlighterJS/Source/Dom/MooTools/Dom.js
Normal file
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
---
|
||||
description: EnlighterJS DOM Abstraction Layer (MooTools)
|
||||
|
||||
license: MIT-style X11 License
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Dom]
|
||||
...
|
||||
*/
|
||||
EJS.Dom = {
|
||||
/**
|
||||
* Selects a single DOM Eement by given css selector
|
||||
* @param sel
|
||||
* @returns
|
||||
*/
|
||||
getElement: function(sel){
|
||||
return document.getElement(sel);
|
||||
},
|
||||
|
||||
/**
|
||||
* Selects a collection of DOM Eöements by given css selector
|
||||
* @param sel
|
||||
* @returns
|
||||
*/
|
||||
getElements: function(sel){
|
||||
return document.getElements(sel);
|
||||
},
|
||||
|
||||
/**
|
||||
* Selects an Element by it's ID
|
||||
* @param elementID
|
||||
* @returns DOM Element
|
||||
*/
|
||||
id: function(elementID){
|
||||
return document.id(elementID);
|
||||
}
|
||||
};
|
16
EnlighterJS/Source/Dom/MooTools/Element.js
Normal file
16
EnlighterJS/Source/Dom/MooTools/Element.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
---
|
||||
description: EnlighterJS DOM Abstraction Layer (MooTools) - Just an Alias for MooTools Element
|
||||
|
||||
license: MIT-style X11 License
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Dom.Element]
|
||||
...
|
||||
*/
|
||||
EJS.Dom.Element = Element;
|
333
EnlighterJS/Source/EnlighterJS.js
Normal file
333
EnlighterJS/Source/EnlighterJS.js
Normal file
|
@ -0,0 +1,333 @@
|
|||
/*
|
||||
---
|
||||
name: EnlighterJS
|
||||
description: Syntax Highlighter based on the famous Lighter.js
|
||||
|
||||
license: MIT-style X11 License
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS]
|
||||
...
|
||||
*/
|
||||
var EJS = window.EnlighterJS = new Class({
|
||||
|
||||
Implements : Options,
|
||||
|
||||
options : {
|
||||
language : 'generic',
|
||||
theme : 'Enlighter',
|
||||
renderer: 'Block',
|
||||
indent : -1,
|
||||
forceTheme: false,
|
||||
rawButton: true,
|
||||
windowButton: true,
|
||||
infoButton: true,
|
||||
ampersandCleanup: true,
|
||||
rawcodeDoubleclick: false
|
||||
},
|
||||
|
||||
// used renderer instance
|
||||
renderer: null,
|
||||
|
||||
// used codeblock to highlight
|
||||
originalCodeblock: null,
|
||||
|
||||
// used container to store highlighted code
|
||||
container: null,
|
||||
|
||||
// lightning active ?
|
||||
isRendered: false,
|
||||
|
||||
// language alias manager
|
||||
languageManager: null,
|
||||
|
||||
// toggle raw code
|
||||
rawContentContainer: null,
|
||||
|
||||
// rendered output span/ou/ul container
|
||||
output: null,
|
||||
|
||||
// input/output filter
|
||||
textFilter: null,
|
||||
|
||||
// cached code input
|
||||
rawCode: null,
|
||||
|
||||
/**
|
||||
* @constructs
|
||||
* @param {Element} originalCodeblock An Element containing code to highlight
|
||||
* @param {Object} options The options object.
|
||||
* @param {Element} container (optional) The output container - if not defined, the output will be injected after the originalCodeblock
|
||||
*/
|
||||
initialize : function(originalCodeblock, opt, container) {
|
||||
this.setOptions(opt);
|
||||
|
||||
// create new language alias manager instance
|
||||
this.languageManager = new EJS.LanguageManager(this.options);
|
||||
|
||||
// create new coe filter instance
|
||||
this.textFilter = new EJS.TextFilter(this.options);
|
||||
|
||||
// initialize renderer
|
||||
if (this.options.renderer == 'Inline'){
|
||||
this.renderer = new EJS.Renderer.InlineRenderer(this.options, this.textFilter);
|
||||
}else{
|
||||
this.renderer = new EJS.Renderer.BlockRenderer(this.options, this.textFilter);
|
||||
}
|
||||
|
||||
// store codeblock element
|
||||
this.originalCodeblock = EJS.Dom.id(originalCodeblock);
|
||||
|
||||
// store/create container
|
||||
if (container){
|
||||
this.container = EJS.Dom.id(container);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Takes a codeblock and highlights the code inside of it using the
|
||||
* stored parser/compilers. It reads the class name to figure out what
|
||||
* language and theme to use for highlighting.
|
||||
*
|
||||
* @return {EnlighterJS} The current EnlighterJS instance.
|
||||
*/
|
||||
enlight : function(enabled){
|
||||
// show highlighted sourcecode ?
|
||||
if (enabled){
|
||||
// get element language
|
||||
var rawLanguageName = this.originalCodeblock.get('data-enlighter-language');
|
||||
|
||||
// ignore higlighting ?
|
||||
if (rawLanguageName == 'no-highlight'){
|
||||
return;
|
||||
}
|
||||
|
||||
// hide original codeblock
|
||||
this.originalCodeblock.setStyle('display', 'none');
|
||||
|
||||
// EnlighterJS exists so just toggle display.
|
||||
if (this.isRendered) {
|
||||
this.container.setStyle('display', 'inherit');
|
||||
return this;
|
||||
}
|
||||
|
||||
// get language name - use alias manager to check language string and validate
|
||||
var languageName = this.languageManager.getLanguage(rawLanguageName);
|
||||
|
||||
// get theme name - use options as fallback
|
||||
var themeName = (this.options.forceTheme ? null : this.originalCodeblock.get('data-enlighter-theme')) || this.options.theme || 'Enlighter';
|
||||
|
||||
// special lines to highlight ?
|
||||
var specialLines = new EJS.SpecialLineHighlighter(this.originalCodeblock.get('data-enlighter-highlight'), this.originalCodeblock.get('data-enlighter-lineoffset'));
|
||||
|
||||
// Load language parser
|
||||
var language = new EJS.Language[languageName](this.getRawCode(true));
|
||||
|
||||
// compile tokens -> generate output
|
||||
this.output = this.renderer.render(language, specialLines, {
|
||||
lineOffset: (this.originalCodeblock.get('data-enlighter-lineoffset') || null),
|
||||
lineNumbers: this.originalCodeblock.get('data-enlighter-linenumbers')
|
||||
});
|
||||
|
||||
// set class and id attributes.
|
||||
this.output.addClass(themeName.toLowerCase() + 'EnlighterJS').addClass('EnlighterJS');
|
||||
|
||||
// add wrapper ?
|
||||
if (this.options.renderer == 'Block'){
|
||||
// grab content into specific container or after original code block ?
|
||||
if (!this.container) {
|
||||
this.container = new EJS.Dom.Element('div');
|
||||
|
||||
// put the highlighted code wrapper behind the original
|
||||
this.container.inject(this.originalCodeblock, 'after');
|
||||
}
|
||||
|
||||
// add wrapper class
|
||||
this.container.addClass('EnlighterJSWrapper').addClass(themeName.toLowerCase() + 'EnlighterJSWrapper');
|
||||
|
||||
// add the highlighted code
|
||||
this.container.grab(this.output);
|
||||
|
||||
// create raw content container
|
||||
this.rawContentContainer = new EJS.Dom.Element('pre', {
|
||||
text: this.getRawCode(false),
|
||||
styles: {
|
||||
'display': 'none'
|
||||
}
|
||||
});
|
||||
|
||||
// add raw content container
|
||||
this.container.grab(this.rawContentContainer);
|
||||
|
||||
// show raw code on double-click ?
|
||||
if (this.options.rawcodeDoubleclick){
|
||||
this.container.addEvent('dblclick', function(){
|
||||
this.toggleRawCode();
|
||||
}.bind(this));
|
||||
}
|
||||
|
||||
// toolbar ?
|
||||
if (this.options.rawButton || this.options.windowButton || this.options.infoButton){
|
||||
this.container.grab(new EJS.UI.Toolbar(this));
|
||||
}
|
||||
|
||||
// normal handling
|
||||
}else{
|
||||
// grab content into specific container or after original code block ?
|
||||
if (this.container) {
|
||||
this.container.grab(this.output);
|
||||
|
||||
// just put the highlighted code behind the original
|
||||
}else{
|
||||
this.output.inject(this.originalCodeblock, 'after');
|
||||
this.container = this.output;
|
||||
}
|
||||
}
|
||||
|
||||
// set render flag
|
||||
this.isRendered = true;
|
||||
|
||||
// disable highlighting
|
||||
}else{
|
||||
// already highlighted ?
|
||||
if (this.isRendered) {
|
||||
this.originalCodeblock.setStyle('display', 'inherit');
|
||||
this.container.setStyle('display', 'none');
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Disable highlighting and remove generated DOM
|
||||
*/
|
||||
dispose: function(){
|
||||
// already highlighted ?
|
||||
if (!this.isRendered) {
|
||||
return;
|
||||
}
|
||||
|
||||
// restore original codeblock
|
||||
this.originalCodeblock.setStyle('display', null);
|
||||
|
||||
// hide highlighted code
|
||||
this.container.setStyle('display', 'none');
|
||||
this.rawContentContainer.setStyle('display', 'none');
|
||||
|
||||
// drop dom
|
||||
this.container.dispose();
|
||||
this.rawContentContainer.dispose();
|
||||
this.container = null;
|
||||
this.rawContentContainer = null;
|
||||
|
||||
// reset flag
|
||||
this.isRendered = false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Extracts the raw code from given codeblock
|
||||
* @return {String} The plain-text code (raw)
|
||||
*/
|
||||
getRawCode: function(reindent){
|
||||
|
||||
// cached version available ?
|
||||
var code = this.rawCode;
|
||||
|
||||
if (code==null) {
|
||||
// get the raw content
|
||||
code = this.originalCodeblock.get('html');
|
||||
|
||||
// remove empty lines at the beginning+end of the codeblock
|
||||
code = code.replace(/(^\s*\n|\n\s*$)/gi, '');
|
||||
|
||||
// apply input filter
|
||||
code = this.textFilter.filterInput(code);
|
||||
|
||||
// cleanup ampersand ?
|
||||
if (this.options.ampersandCleanup === true) {
|
||||
code = code.replace(/&/gim, '&');
|
||||
}
|
||||
|
||||
// replace html escaped chars
|
||||
code = code.replace(/</gim, '<').replace(/>/gim, '>').replace(/ /gim, ' ');
|
||||
|
||||
// cache it
|
||||
this.rawCode = code;
|
||||
}
|
||||
|
||||
// replace tabs with spaces ?
|
||||
if (reindent === true){
|
||||
// get indent option value
|
||||
var newIndent = this.options.indent.toInt();
|
||||
|
||||
// re-indent code if specified
|
||||
if (newIndent > -1){
|
||||
// match all tabs
|
||||
code = code.replace(/(\t*)/gim, function(match, p1, offset, string){
|
||||
// replace n tabs with n*newIndent spaces
|
||||
return (new Array(newIndent * p1.length + 1)).join(' ');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return code;
|
||||
},
|
||||
|
||||
/**
|
||||
* Hide/Show the RAW Code Container/Toggle Highlighted Code
|
||||
*/
|
||||
toggleRawCode: function(show){
|
||||
// initialization required!
|
||||
if (this.output == null){
|
||||
return;
|
||||
}
|
||||
|
||||
// argument set ?
|
||||
if (typeof(show)!='boolean'){
|
||||
show = (this.rawContentContainer.getStyle('display') == 'none');
|
||||
}
|
||||
|
||||
// toggle container visibility
|
||||
if (show){
|
||||
this.output.setStyle('display', 'none');
|
||||
this.rawContentContainer.setStyle('display', 'block');
|
||||
}else{
|
||||
this.output.setStyle('display', 'block');
|
||||
this.rawContentContainer.setStyle('display', 'none');
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Takes a codeblock and highlights the code inside. The original codeblock is set to invisible
|
||||
* @DEPRECATED since v2.0 - this method will be removed in the future
|
||||
*
|
||||
* @return {EnlighterJS} The current EnlighterJS instance.
|
||||
*/
|
||||
light : function(){
|
||||
return this.enlight(true);
|
||||
},
|
||||
|
||||
/**
|
||||
* Unlights a codeblock by hiding the enlighter element if present and re-displaying the original code.
|
||||
* @DEPRECATED since v2.0 - this method will be removed in the future
|
||||
*
|
||||
* @return {EnlighterJS} The current EnlighterJS instance.
|
||||
*/
|
||||
unlight : function() {
|
||||
return this.enlight(false);
|
||||
}
|
||||
});
|
||||
|
||||
// register namespaces
|
||||
EJS.Language = {};
|
||||
EJS.Tokenizer = {};
|
||||
EJS.Renderer = {};
|
||||
EJS.Util = {};
|
||||
EJS.UI = {};
|
||||
|
114
EnlighterJS/Source/Language/Assembly.js
Normal file
114
EnlighterJS/Source/Language/Assembly.js
Normal file
|
@ -0,0 +1,114 @@
|
|||
/*
|
||||
---
|
||||
description: ASM General Assembly Language
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Language.asm]
|
||||
...
|
||||
*/
|
||||
EJS.Language.asm = new Class({
|
||||
Extends : EJS.Language.generic,
|
||||
|
||||
setupLanguage: function(){
|
||||
|
||||
this.patterns = {
|
||||
// comments start with a semicolon (only single line comments available)
|
||||
'singleLineComments': {
|
||||
pattern: /(;.*)$/gm,
|
||||
alias: 'co1'
|
||||
},
|
||||
|
||||
// controls - used e.g. in KEIL
|
||||
'controls': {
|
||||
pattern: /(\$.*)$/gm,
|
||||
alias: 'co2'
|
||||
},
|
||||
|
||||
// "strings" may used in some assemblers for char constants
|
||||
'strings': {
|
||||
pattern: this.common.strings,
|
||||
alias: 'st0'
|
||||
},
|
||||
|
||||
// general instructions (followed after a label or at a new line)
|
||||
'instruction':{
|
||||
pattern: /(^|:)\s*?(\w+)\s+/gm,
|
||||
alias: 'kw3'
|
||||
},
|
||||
|
||||
// labels (jump targets)
|
||||
'label': {
|
||||
pattern: /^\s*?([A-Z\?_][A-Z0-9\?_]+:)\s*?/gim,
|
||||
alias: 'kw1'
|
||||
},
|
||||
|
||||
// indirect addresses starts with @
|
||||
'indirect': {
|
||||
pattern: /@\w+/gi,
|
||||
alias: 'kw4'
|
||||
},
|
||||
|
||||
// immediate data
|
||||
'immediate': {
|
||||
pattern: /#\w+/gi,
|
||||
alias: 'kw4'
|
||||
},
|
||||
|
||||
// Hexadecimal (two notations): 0aH (8051 asm)
|
||||
'hex': {
|
||||
pattern: /[A-F0-9][A-F0-9$]+?H/gi,
|
||||
alias: 'nu0'
|
||||
},
|
||||
|
||||
// Decimal: \d+ (8051 asm)
|
||||
'integer': {
|
||||
pattern: /\d[\d$]+?D/gi,
|
||||
alias: 'nu0'
|
||||
},
|
||||
|
||||
// Binary: 0b00001010, 0b11111111 (8051 asm)
|
||||
'binary': {
|
||||
pattern: /[01][01$]+?B/gi,
|
||||
alias: 'nu0'
|
||||
},
|
||||
|
||||
// Octals: 1767q (8051 asm)
|
||||
'octals': {
|
||||
pattern: /[0-7][0-7$]+?(?:Q|O)/gi,
|
||||
alias: 'nu0'
|
||||
},
|
||||
|
||||
// Hexadecimal (two notations): 0x0a, $0a, 0xff, $ff (generic)
|
||||
'hex2': {
|
||||
pattern: /(0x[A-F0-9]+|\$[A-F0-9]+)/gi,
|
||||
alias: 'nu0'
|
||||
},
|
||||
|
||||
// Binary: 0b00001010, 0b11111111 (generic)
|
||||
'binary2': {
|
||||
pattern: /(0b[01]+)/g,
|
||||
alias: 'nu0'
|
||||
},
|
||||
|
||||
// Decimal: \d+ (generic)
|
||||
'integer2': {
|
||||
pattern: /\b(\d+)/g,
|
||||
alias: 'nu0'
|
||||
},
|
||||
|
||||
// e.g. LOW(), HIGH() ..
|
||||
'functions': {
|
||||
pattern: this.common.functionCalls,
|
||||
alias: 'me0'
|
||||
},
|
||||
|
||||
};
|
||||
}
|
||||
});
|
89
EnlighterJS/Source/Language/AvrAssembly.js
Normal file
89
EnlighterJS/Source/Language/AvrAssembly.js
Normal file
|
@ -0,0 +1,89 @@
|
|||
/*
|
||||
---
|
||||
description: ATMEL AVR Assembly Language
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Language.avrasm]
|
||||
...
|
||||
*/
|
||||
EJS.Language.avrasm = new Class({
|
||||
Extends : EJS.Language.generic,
|
||||
|
||||
setupLanguage: function(){
|
||||
|
||||
this.patterns = {
|
||||
'singleLineComments': {
|
||||
pattern: /(;.*)$/gm,
|
||||
alias: 'co1'
|
||||
},
|
||||
|
||||
// available directives: BYTE,CSEG,DB,DEF,DEVICE,DSEG,DW,ENDMACRO,EQU,ESEG,EXIT,INCLUDE,LIST,LISTMAC,MACRO,NOLIST,ORG,SET
|
||||
'directives': {
|
||||
pattern: /^\s*?\.(\w+)\s+/gm,
|
||||
alias: 'kw1'
|
||||
},
|
||||
|
||||
'register': {
|
||||
pattern: /\b(r\d{1,2})/gi,
|
||||
alias: 'kw1'
|
||||
},
|
||||
|
||||
'macroparam': {
|
||||
pattern: /(@[0-9])/gi,
|
||||
alias: 'kw4'
|
||||
},
|
||||
|
||||
'label': {
|
||||
pattern: /^\s*?(\w+:)\s*?/gm,
|
||||
alias: 'kw3'
|
||||
},
|
||||
|
||||
'instruction':{
|
||||
pattern: /(^|:)\s*?(\w+)\s+/gm,
|
||||
alias: 'kw3'
|
||||
},
|
||||
|
||||
'strings': {
|
||||
pattern: this.common.strings,
|
||||
alias: 'st0'
|
||||
},
|
||||
|
||||
// Hexadecimal (two notations): 0x0a, $0a, 0xff, $ff
|
||||
'hex': {
|
||||
pattern: /(0x[A-F0-9]+|\$[A-F0-9]+)/gi,
|
||||
alias: 'nu0'
|
||||
},
|
||||
|
||||
// Binary: 0b00001010, 0b11111111
|
||||
'binary': {
|
||||
pattern: /(0b[01]+)/g,
|
||||
alias: 'nu0'
|
||||
},
|
||||
|
||||
// Decimal: \d+
|
||||
'integer': {
|
||||
pattern: /\b(\d+)/g,
|
||||
alias: 'nu0'
|
||||
},
|
||||
|
||||
// e.g. LOW(), HIGH() ..
|
||||
'functions': {
|
||||
pattern: this.common.functionCalls,
|
||||
alias: 'me0'
|
||||
},
|
||||
|
||||
// io register alias e.g. DDRA, PORTB, TIMSK
|
||||
'ioregister': {
|
||||
pattern: /\b[A-Z]{2,}[0-9]?[0-9]?\b/g,
|
||||
alias: 'kw4'
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
52
EnlighterJS/Source/Language/CSharp.js
Normal file
52
EnlighterJS/Source/Language/CSharp.js
Normal file
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
---
|
||||
description: C# Language
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Joshua Maag
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Language.csharp]
|
||||
...
|
||||
*/
|
||||
EJS.Language.csharp = new Class ({
|
||||
|
||||
Extends: EJS.Language.generic,
|
||||
|
||||
setupLanguage: function(){
|
||||
this.keywords = {
|
||||
reserved: {
|
||||
csv: "as, base, break, case, catch, checked, continue, default, do, else, event, explicit, false, finally, fixed, for, foreach, goto, if, implicit, internal, is, lock, namespace, new, null, operator, params, private, protected, public, ref, return, sizeof, stackalloc, switch, this, throw, true, try, typeof, unchecked, using, void, while",
|
||||
alias: 'kw1'
|
||||
},
|
||||
keywords: {
|
||||
csv: "abstract, async, class, const, delegate, dynamic, event, extern, in, interface, out, override, readonly, sealed, static, unsafe, virtual, volatile",
|
||||
alias: 'kw3'
|
||||
},
|
||||
primitives: {
|
||||
csv: "bool, byte, char, decimal, double, enum, float, int, long, sbyte, short, struct, uint, ulong, ushort, object, string",
|
||||
alias: 'kw2'
|
||||
},
|
||||
internal: {
|
||||
csv: "System",
|
||||
alias: 'kw4'
|
||||
}
|
||||
};
|
||||
|
||||
this.patterns = {
|
||||
'slashComments': { pattern: this.common.slashComments, alias: 'co1'},
|
||||
'multiComments': { pattern: this.common.multiComments, alias: 'co2'},
|
||||
'chars': { pattern: this.common.singleQuotedString, alias: 'st0' },
|
||||
'strings': { pattern: this.common.doubleQuotedString, alias: 'st1' },
|
||||
'numbers': { pattern: /\b((([0-9]+)?\.)?[0-9_]+([e][-+]?[0-9]+)?|0x[A-F0-9]+|0b[0-1_]+)\b/gim, alias: 'nu0' },
|
||||
'brackets': { pattern: this.common.brackets, alias: 'br0' },
|
||||
'functionCalls': { pattern: this.common.functionCalls, alias: 'me0'},
|
||||
'methodCalls': { pattern: this.common.methodCalls, alias: 'me1'}
|
||||
};
|
||||
|
||||
}
|
||||
});
|
49
EnlighterJS/Source/Language/Cpp.js
Normal file
49
EnlighterJS/Source/Language/Cpp.js
Normal file
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
---
|
||||
description: C/C++ Language
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Language.cpp]
|
||||
...
|
||||
*/
|
||||
EJS.Language.cpp = new Class({
|
||||
|
||||
Extends: EJS.Language.generic,
|
||||
|
||||
setupLanguage: function() {
|
||||
this.keywords = {
|
||||
cpp: {
|
||||
csv: "and,and_eq,asm,auto,bitand,bitor,bool,break,case,catch,char,class,compl,const,const_cast,continue,default,delete,do,double,dynamic_cast,else,enum,explicit,export,extern,false,float,for,friend,goto,if,inline,int,long,mutable,namespace,new,not,not_eq,operator,or,or_eq,private,protected,public,register,reinterpret_cast,return,short,signed,sizeof,static,static_cast,struct,switch,template,this,throw,true,try,typedef,typeid,typename,union,unsigned,using,virtual,void,volatile,wchar_t,while,xor,xor_eq",
|
||||
alias: 'kw1'
|
||||
},
|
||||
cppX11: {
|
||||
csv: "alignas,alignof,char16_t,char32_t,constexpr,decltype,noexcept,nullptr,static_assert,thread_local",
|
||||
alias: 'kw4'
|
||||
},
|
||||
directives: {
|
||||
csv: "__LINE__,__FILE__,__DATE__,__TIME__,__cplusplus",
|
||||
alias: 'kw2'
|
||||
}
|
||||
};
|
||||
|
||||
this.patterns = {
|
||||
'slashComments': { pattern: this.common.slashComments, alias: 'co1'},
|
||||
'multiComments': { pattern: this.common.multiComments, alias: 'co2'},
|
||||
'chars': { pattern: this.common.singleQuotedString, alias: 'st0' },
|
||||
'strings': { pattern: this.common.doubleQuotedString, alias: 'st1' },
|
||||
'annotation': { pattern: /@[\W\w_][\w\d_]+/gm, alias: 'st1' },
|
||||
'numbers': { pattern: /\b((([0-9]+)?\.)?[0-9_]+([e][-+]?[0-9]+)?|0x[A-F0-9]+|0b[0-1_]+)\b/gim, alias: 'nu0' },
|
||||
'properties': { pattern: this.common.properties, alias: 'me0' },
|
||||
'brackets': { pattern: this.common.brackets, alias: 'br0' },
|
||||
'functionCalls': { pattern: this.common.functionCalls, alias: 'de1'},
|
||||
'directives': { pattern: /#.*$/gm, alias: 'kw2'}
|
||||
};
|
||||
}
|
||||
});
|
40
EnlighterJS/Source/Language/Css.js
Normal file
40
EnlighterJS/Source/Language/Css.js
Normal file
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
---
|
||||
description: CSS (Cascading Style Sheets)
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
- Jose Prado
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Language.css]
|
||||
...
|
||||
*/
|
||||
EnlighterJS.Language.css = new Class({
|
||||
|
||||
Extends: EnlighterJS.Language.generic,
|
||||
|
||||
setupLanguage: function() {
|
||||
|
||||
this.keywords = {
|
||||
};
|
||||
|
||||
this.patterns = {
|
||||
'comments2': { pattern: /\/\*![\s\S]*?\*\//gm, alias: 'co2'},
|
||||
'comments': { pattern: this.common.multiComments, alias: 'co1'},
|
||||
'strings': { pattern: this.common.strings, alias: 'st0' },
|
||||
'selectors': { pattern: /(?:^|}|\/)\s*([^\\/{@]+)\s*\{/gi, alias: 'kw1' },
|
||||
'directives': { pattern: /(@[a-z]+)\s+/gi, alias: 'kw2' },
|
||||
'rules': { pattern: /([\w-]+)\s*:/g, alias: 'kw3' },
|
||||
'uri': { pattern: /url\s*\([^\)]*\)/gi, alias: 'kw4' },
|
||||
'units': { pattern: /\b(\d+[\.\d+-]?\s*(%|[a-z]{1,3})?)/gi, alias: 'nu0' },
|
||||
'hexColors': { pattern: /(#[A-F0-9]{3}([A-F0-9]{3})?)\b/gi, alias: 'nu0' },
|
||||
'brackets': { pattern: this.common.brackets, alias: 'br0'},
|
||||
'symbols': { pattern: /,|\.|;|:|>/g, alias: 'sy0'}
|
||||
};
|
||||
}
|
||||
});
|
30
EnlighterJS/Source/Language/Cython.js
Normal file
30
EnlighterJS/Source/Language/Cython.js
Normal file
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
---
|
||||
description: Cython language
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
- Devyn Collier Johnson
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Language.cython]
|
||||
...
|
||||
*/
|
||||
EJS.Language.cython = new Class({
|
||||
|
||||
Extends: EJS.Language.python,
|
||||
|
||||
setupLanguage: function() {
|
||||
// run origin language setup
|
||||
this.parent();
|
||||
|
||||
// append cython extension keywords
|
||||
this.keywords.reserved.csv += ', __all__, include, cimport, pyximport, cythonize, cdef, cpdef, ctypedef, property, IF, ELIF, ELSE, DEF';
|
||||
this.keywords.functions.csv += ', __dealloc__, __get__, __init__, fopen';
|
||||
this.keywords.classes.csv += ', PyErr_Fetch, PyErr_Occurred, PyErr_WarnEx, char, double, extern, namespace, public, struct, void, union, unsigned, enum';
|
||||
}
|
||||
});
|
46
EnlighterJS/Source/Language/Diff.js
Normal file
46
EnlighterJS/Source/Language/Diff.js
Normal file
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
---
|
||||
description: DIFF Highlighting
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Language.diff]
|
||||
...
|
||||
*/
|
||||
EJS.Language.diff = new Class({
|
||||
Extends : EJS.Language.generic,
|
||||
|
||||
setupLanguage: function(){
|
||||
this.keywords = {
|
||||
};
|
||||
|
||||
this.patterns = {
|
||||
|
||||
'comments' : {
|
||||
pattern : /^((---|\+\+\+) .*)/gm,
|
||||
alias : 'co1'
|
||||
},
|
||||
|
||||
'stats' : {
|
||||
pattern : /^(@@.*@@\s*)/gm,
|
||||
alias : 'nu0'
|
||||
},
|
||||
|
||||
'add' : {
|
||||
pattern : /^(\+.*)/gm,
|
||||
alias : 're0'
|
||||
},
|
||||
|
||||
'del' : {
|
||||
pattern : /^(-.*)/gm,
|
||||
alias : 'st0'
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
184
EnlighterJS/Source/Language/Generic.js
Normal file
184
EnlighterJS/Source/Language/Generic.js
Normal file
|
@ -0,0 +1,184 @@
|
|||
/*
|
||||
---
|
||||
description: Code parsing engine for EnlighterJS
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Jose Prado
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Language.generic]
|
||||
...
|
||||
*/
|
||||
EJS.Language.generic = new Class({
|
||||
|
||||
tokenizerType : 'Standard',
|
||||
tokenizer : null,
|
||||
code : null,
|
||||
|
||||
patterns : {},
|
||||
keywords : {},
|
||||
|
||||
delimiters : {
|
||||
start: null,
|
||||
end: null
|
||||
},
|
||||
|
||||
|
||||
// commonly used Regex Patterns
|
||||
common : {
|
||||
// Matches a C style single-line comment.
|
||||
slashComments : /(?:^|[^\\])\/\/.*$/gm,
|
||||
|
||||
// Matches a Perl style single-line comment.
|
||||
poundComments : /#.*$/gm,
|
||||
|
||||
// Matches a C style multi-line comment
|
||||
multiComments : /\/\*[\s\S]*?\*\//gm,
|
||||
|
||||
// Matches a string enclosed by single quotes. Legacy.
|
||||
aposStrings : /'[^'\\]*(?:\\.[^'\\]*)*'/gm,
|
||||
|
||||
// Matches a string enclosed by double quotes. Legacy.
|
||||
quotedStrings : /"[^"\\]*(?:\\.[^"\\]*)*"/gm,
|
||||
|
||||
// Matches a string enclosed by single quotes across multiple lines.
|
||||
multiLineSingleQuotedStrings : /'[^'\\]*(?:\\.[^'\\]*)*'/gm,
|
||||
|
||||
// Matches a string enclosed by double quotes across multiple lines.
|
||||
multiLineDoubleQuotedStrings : /"[^"\\]*(?:\\.[^"\\]*)*"/gm,
|
||||
|
||||
// Matches both.
|
||||
multiLineStrings : /'[^'\\]*(?:\\.[^'\\]*)*'|"[^"\\]*(?:\\.[^"\\]*)*"/gm,
|
||||
|
||||
// Matches a string enclosed by single quotes.
|
||||
singleQuotedString : /'[^'\\\r\n]*(?:\\.[^'\\\r\n]*)*'/gm,
|
||||
|
||||
// Matches a string enclosed by double quotes.
|
||||
doubleQuotedString : /"[^"\\\r\n]*(?:\\.[^"\\\r\n]*)*"/gm,
|
||||
|
||||
// Matches both.
|
||||
strings : /'[^'\\\r\n]*(?:\\.[^'\\\r\n]*)*'|"[^"\\\r\n]*(?:\\.[^"\\\r\n]*)*"/gm,
|
||||
|
||||
// Matches a property: .property style.
|
||||
properties : /\.([\w]+)\s*/gi,
|
||||
|
||||
// Matches a method call: .methodName() style.
|
||||
methodCalls : /\.([\w]+)\s*\(/gm,
|
||||
|
||||
// Matches a function call: functionName() style.
|
||||
functionCalls : /\b([\w]+)\s*\(/gm,
|
||||
|
||||
// Matches any of the common brackets.
|
||||
brackets : /\{|}|\(|\)|\[|]/g,
|
||||
|
||||
// Matches integers, decimals, hexadecimals.
|
||||
numbers : /\b((?:(\d+)?\.)?[0-9]+|0x[0-9A-F]+)\b/gi
|
||||
},
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @constructs
|
||||
* @param {Object}
|
||||
* options
|
||||
*/
|
||||
initialize : function(code){
|
||||
// initialize language options
|
||||
this.setupLanguage();
|
||||
|
||||
this.rules = [];
|
||||
this.code = code;
|
||||
|
||||
// create new tokenizer
|
||||
this.tokenizer = new EnlighterJS.Tokenizer[this.tokenizerType]();
|
||||
|
||||
// Add delimiter rules.
|
||||
if (this.delimiters.start){
|
||||
this.rules.push({
|
||||
pattern: this.delimiters.start,
|
||||
alias: 'de1'
|
||||
});
|
||||
}
|
||||
|
||||
if (this.delimiters.end){
|
||||
this.rules.push({
|
||||
pattern: this.delimiters.end,
|
||||
alias: 'de2'
|
||||
});
|
||||
}
|
||||
|
||||
// Set Keyword Rules from this.keywords object.
|
||||
Object.each(this.keywords, function(keywordSet, ruleName){
|
||||
// keyword set contains elements ?
|
||||
if (keywordSet.csv != ''){
|
||||
this.rules.push({
|
||||
pattern: this.csvToRegExp(keywordSet.csv, keywordSet.mod || "g"),
|
||||
alias: keywordSet.alias
|
||||
});
|
||||
}
|
||||
}, this);
|
||||
|
||||
// Set Rules from this.patterns object.
|
||||
Object.each(this.patterns, function(regex, ruleName){
|
||||
// add new rule entry
|
||||
this.rules.push(regex);
|
||||
}, this);
|
||||
},
|
||||
|
||||
getRuleByName: function(name){
|
||||
//return this.rulesN[name];
|
||||
},
|
||||
|
||||
// override this method to setup language params
|
||||
setupLanguage: function(){
|
||||
// generic highlighting
|
||||
this.patterns = {
|
||||
strings: { pattern: this.common.strings, alias: 'st0'},
|
||||
fn : { pattern: this.common.functionCalls, alias: 'kw1'},
|
||||
me : { pattern: this.common.methodCalls, alias: 'kw2'},
|
||||
brackets: { pattern: this.common.brackets, alias: 'br0' },
|
||||
numbers: { pattern: this.common.numbers, alias: 'nu0'},
|
||||
comment0: { pattern: this.common.slashComments, alias: 'co1'},
|
||||
comment1: { pattern: this.common.poundComments, alias: 'co1'},
|
||||
comment3: { pattern: this.common.multiComments, alias: 'co2'},
|
||||
};
|
||||
},
|
||||
|
||||
getTokens : function(){
|
||||
return this.tokenizer.getTokens(this, this.code);
|
||||
},
|
||||
|
||||
getRules : function(){
|
||||
return this.rules;
|
||||
},
|
||||
|
||||
csvToRegExp : function(csv, mod){
|
||||
return new RegExp('\\b(' + csv.replace(/,\s*/g, '|') + ')\\b', mod);
|
||||
},
|
||||
|
||||
delimToRegExp : function(beg, esc, end, mod, suffix){
|
||||
beg = beg.escapeRegExp();
|
||||
if (esc){
|
||||
esc = esc.escapeRegExp();
|
||||
}
|
||||
end = (end) ? end.escapeRegExp() : beg;
|
||||
var pat = (esc) ? beg + "[^" + end + esc + '\\n]*(?:' + esc + '.[^' + end + esc + '\\n]*)*' + end : beg + "[^" + end + '\\n]*' + end;
|
||||
|
||||
return new RegExp(pat + (suffix || ''), mod || '');
|
||||
},
|
||||
|
||||
strictRegExp : function(){
|
||||
var regex = '(';
|
||||
for (var i = 0; i < arguments.length; i++){
|
||||
regex += arguments[i].escapeRegExp();
|
||||
regex += (i < arguments.length - 1) ? '|' : '';
|
||||
}
|
||||
regex += ')';
|
||||
return new RegExp(regex, "gim");
|
||||
}
|
||||
});
|
58
EnlighterJS/Source/Language/Ini.js
Normal file
58
EnlighterJS/Source/Language/Ini.js
Normal file
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
---
|
||||
description: Ini/Conf/Property Highlighting
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Language.ini]
|
||||
...
|
||||
*/
|
||||
EJS.Language.ini = new Class({
|
||||
Extends : EJS.Language.generic,
|
||||
|
||||
setupLanguage: function(){
|
||||
this.keywords = {
|
||||
};
|
||||
|
||||
this.patterns = {
|
||||
'singleLineComments': {
|
||||
pattern: /(;.*)$/gm,
|
||||
alias: 'co1'
|
||||
},
|
||||
|
||||
'section': {
|
||||
pattern: /^\s*?(\[.*\])\s*?$/gm,
|
||||
alias: 'kw4'
|
||||
},
|
||||
|
||||
'directive': {
|
||||
pattern: /^\s*?[a-z0-9\._-]+\s*?=/gim,
|
||||
alias: 'kw1'
|
||||
},
|
||||
|
||||
'boolean': {
|
||||
pattern: /\b(true|false|on|off|yes|no)\b/gim,
|
||||
alias: 'kw2'
|
||||
},
|
||||
|
||||
'strings': {
|
||||
pattern: this.common.doubleQuotedString,
|
||||
alias: 'st1'
|
||||
},
|
||||
'numbers': {
|
||||
pattern: /\b((([0-9]+)?\.)?[0-9_]+([e][-+]?[0-9]+)?|0x[A-F0-9]+|0b[0-1_]+)[a-z]*?\b/gim,
|
||||
alias: 'nu0'
|
||||
},
|
||||
'brackets': {
|
||||
pattern: this.common.brackets,
|
||||
alias: 'br0'
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
55
EnlighterJS/Source/Language/Java.js
Normal file
55
EnlighterJS/Source/Language/Java.js
Normal file
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
---
|
||||
description: Java language
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Italo Maia
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Language.java]
|
||||
...
|
||||
*/
|
||||
EJS.Language.java = new Class ({
|
||||
|
||||
Extends: EJS.Language.generic,
|
||||
|
||||
setupLanguage: function(code)
|
||||
{
|
||||
this.keywords = {
|
||||
reserved: {
|
||||
csv: "continue, for, new, switch, assert, default, goto, synchronized, do, if, this, break, throw, else, throws, case, instanceof, return, transient, catch, try, final, finally, strictfp, volatile, const, native, super, while",
|
||||
alias: 'kw1'
|
||||
},
|
||||
keywords: {
|
||||
csv: "abstract, package, private, implements, protected, public, import, extends, interface, static, void, class",
|
||||
alias: 'kw3'
|
||||
},
|
||||
primitives: {
|
||||
csv: "byte, short, int, long, float, double, boolean, char, String",
|
||||
alias: 'kw2'
|
||||
},
|
||||
internal: {
|
||||
csv: "System",
|
||||
alias: 'kw4'
|
||||
}
|
||||
},
|
||||
|
||||
this.patterns = {
|
||||
'slashComments': { pattern: this.common.slashComments, alias: 'co1'},
|
||||
'multiComments': { pattern: this.common.multiComments, alias: 'co2'},
|
||||
'chars': { pattern: this.common.singleQuotedString, alias: 'st0' },
|
||||
'strings': { pattern: this.common.doubleQuotedString, alias: 'st1' },
|
||||
'annotation': { pattern: /@[\W\w_][\w\d_]+/gm, alias: 'st1' },
|
||||
'numbers': { pattern: /\b((([0-9]+)?\.)?[0-9_]+([e][-+]?[0-9]+)?|0x[A-F0-9]+|0b[0-1_]+)\b/gim, alias: 'nu0' },
|
||||
'properties': { pattern: this.common.properties, alias: 'me0' },
|
||||
'brackets': { pattern: this.common.brackets, alias: 'br0' },
|
||||
'functionCalls': { pattern: this.common.functionCalls, alias: 'kw1'}
|
||||
};
|
||||
|
||||
}
|
||||
});
|
78
EnlighterJS/Source/Language/Javascript.js
Normal file
78
EnlighterJS/Source/Language/Javascript.js
Normal file
|
@ -0,0 +1,78 @@
|
|||
/*
|
||||
---
|
||||
description: JavaScript language
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Jose Prado
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Language.javascript]
|
||||
...
|
||||
*/
|
||||
EJS.Language.javascript = new Class({
|
||||
|
||||
Extends: EJS.Language.generic,
|
||||
|
||||
setupLanguage: function()
|
||||
{
|
||||
this.keywords = {
|
||||
commonKeywords: {
|
||||
csv: "as, break, case, catch, continue, delete, do, else, eval, finally, for, if, in, is, instanceof, return, switch, this, throw, try, typeof, void, while, write, with",
|
||||
alias: 'kw1'
|
||||
},
|
||||
langKeywords: {
|
||||
csv: "class, const, default, debugger, export, extends, false, function, import, namespace, new, null, package, private, protected, public, super, true, use, var",
|
||||
alias: 'kw2'
|
||||
},
|
||||
windowKeywords: {
|
||||
csv: "alert, confirm, open, print, prompt",
|
||||
alias: 'kw3'
|
||||
}
|
||||
};
|
||||
|
||||
this.patterns = {
|
||||
'slashComments': {
|
||||
pattern: this.common.slashComments,
|
||||
alias: 'co1'
|
||||
},
|
||||
'multiComments': {
|
||||
pattern: this.common.multiComments,
|
||||
alias: 'co2'
|
||||
},
|
||||
'strings': {
|
||||
pattern: this.common.strings,
|
||||
alias: 'st0'
|
||||
},
|
||||
'methodCalls': {
|
||||
pattern: this.common.properties,
|
||||
alias: 'me0'
|
||||
},
|
||||
'brackets': {
|
||||
pattern: this.common.brackets,
|
||||
alias: 'br0'
|
||||
},
|
||||
'numbers': {
|
||||
pattern: /\b((([0-9]+)?\.)?[0-9_]+([e][-+]?[0-9]+)?|0x[A-F0-9]+)\b/gi,
|
||||
alias: 'nu0'
|
||||
},
|
||||
'regex': {
|
||||
pattern: this.delimToRegExp("/", "\\", "/", "g", "[gimy]*"),
|
||||
alias: 're0'
|
||||
},
|
||||
'symbols': {
|
||||
pattern: /\+|-|\*|\/|%|!|@|&|\||\^|\<|\>|=|,|\.|;|\?|:/g,
|
||||
alias: 'sy0'
|
||||
}
|
||||
};
|
||||
|
||||
this.delimiters = {
|
||||
start: this.strictRegExp('<script type="text/javascript">', '<script language="javascript">'),
|
||||
end: this.strictRegExp('<\/script>')
|
||||
};
|
||||
|
||||
}
|
||||
});
|
56
EnlighterJS/Source/Language/Json.js
Normal file
56
EnlighterJS/Source/Language/Json.js
Normal file
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
---
|
||||
description: JSON Object Highlighting
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Language.json]
|
||||
...
|
||||
*/
|
||||
EJS.Language.json = new Class({
|
||||
|
||||
Extends: EJS.Language.generic,
|
||||
|
||||
setupLanguage: function()
|
||||
{
|
||||
this.keywords = {
|
||||
values: {
|
||||
csv: "true, false, null",
|
||||
alias: 'kw2'
|
||||
}
|
||||
};
|
||||
|
||||
this.patterns = {
|
||||
'keys': {
|
||||
pattern: /("[^"\\\r\n]+?")\s*?:/gi,
|
||||
alias: 'kw1'
|
||||
},
|
||||
'strings': {
|
||||
pattern: this.common.strings,
|
||||
alias: 'st0'
|
||||
},
|
||||
'brackets': {
|
||||
pattern: this.common.brackets,
|
||||
alias: 'br0'
|
||||
},
|
||||
'numbers': {
|
||||
pattern: /\b((([0-9]+)?\.)?[0-9_]+([e][-+]?[0-9]+)?|0x[A-F0-9]+)\b/gi,
|
||||
alias: 'nu0'
|
||||
},
|
||||
'symbols': {
|
||||
pattern: /,|:/g,
|
||||
alias: 'sy0'
|
||||
}
|
||||
};
|
||||
|
||||
this.delimiters = {
|
||||
|
||||
};
|
||||
}
|
||||
});
|
52
EnlighterJS/Source/Language/Less.js
Normal file
52
EnlighterJS/Source/Language/Less.js
Normal file
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
---
|
||||
description: LESS (Cascading Style Sheets)
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Language.less]
|
||||
...
|
||||
*/
|
||||
EnlighterJS.Language.less = new Class({
|
||||
|
||||
Extends: EnlighterJS.Language.css,
|
||||
|
||||
setupLanguage: function() {
|
||||
this.parent();
|
||||
|
||||
this.keywords = Object.merge(this.keywords, {
|
||||
|
||||
});
|
||||
|
||||
this.patterns = Object.merge(this.patterns, {
|
||||
'vars': {
|
||||
pattern: /(@[\w_-]+:?)/gi,
|
||||
alias: 'kw4'
|
||||
},
|
||||
/*
|
||||
'fn': {
|
||||
pattern: /\b(\.?[\w_-]+)\s*\(/gm,
|
||||
alias: ''
|
||||
},
|
||||
'include': {
|
||||
pattern: /(\.[\w_-]+)\s*;/gm,
|
||||
alias: 'me0'
|
||||
},*/
|
||||
'symbols': {
|
||||
pattern: /,|\.|;|:|>|\+|\-|\*|\//g,
|
||||
alias: 'sy0'
|
||||
},
|
||||
'singleComments': {
|
||||
pattern: this.common.slashComments,
|
||||
alias: 'co1'
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
});
|
82
EnlighterJS/Source/Language/Lua.js
Normal file
82
EnlighterJS/Source/Language/Lua.js
Normal file
|
@ -0,0 +1,82 @@
|
|||
/*
|
||||
---
|
||||
description: LUA http://www.lua.org/
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Language.lua]
|
||||
...
|
||||
*/
|
||||
EJS.Language.lua = new Class({
|
||||
Extends : EJS.Language.generic,
|
||||
|
||||
setupLanguage: function(){
|
||||
this.keywords = {
|
||||
'reserved': {
|
||||
'csv': 'and,break,do,else,elseif,end,for,function,if,in,local,or,repeat,return,not,then,until,while',
|
||||
'alias': 'kw1'
|
||||
},
|
||||
'values': {
|
||||
'csv': 'false,nil,true',
|
||||
'alias': 'kw2'
|
||||
}
|
||||
};
|
||||
|
||||
this.patterns = {
|
||||
|
||||
'multiLineComments': {
|
||||
pattern: /--\[\[[\s\S]*?]]/g,
|
||||
alias: 'co1'
|
||||
},
|
||||
|
||||
'singleLineComments': {
|
||||
pattern: /(--.*)$/gm,
|
||||
alias: 'co1'
|
||||
},
|
||||
|
||||
'specialComments': {
|
||||
pattern: /---\[\[[\s\S]*?(]])/g,
|
||||
alias: 'co1'
|
||||
},
|
||||
|
||||
// single and double quoted strings
|
||||
'strings': {
|
||||
pattern: this.common.strings,
|
||||
alias: 'st0'
|
||||
},
|
||||
|
||||
// multi line strings
|
||||
'mlstring': {
|
||||
pattern: /(\[(=*)\[[\S\s]*?]\2])/g,
|
||||
alias: 'st1'
|
||||
},
|
||||
|
||||
'brackets': {
|
||||
pattern: this.common.brackets,
|
||||
alias: 'br0'
|
||||
},
|
||||
|
||||
'numbers': {
|
||||
pattern: /\b((([0-9]+)?\.)?[0-9_]+([e][-+]?[0-9]+)?)/gim,
|
||||
alias: 'nu0'
|
||||
},
|
||||
|
||||
'functionCalls': {
|
||||
pattern: this.common.functionCalls,
|
||||
alias: 'me0'
|
||||
},
|
||||
|
||||
'methodCalls': {
|
||||
pattern: this.common.methodCalls,
|
||||
alias: 'me1'
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
});
|
35
EnlighterJS/Source/Language/Markdown.js
Normal file
35
EnlighterJS/Source/Language/Markdown.js
Normal file
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
---
|
||||
description: Markdown language
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Jose Prado
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Language.markdown]
|
||||
...
|
||||
*/
|
||||
EJS.Language.markdown = new Class ({
|
||||
|
||||
Extends: EJS.Language.generic,
|
||||
|
||||
setupLanguage: function(code){
|
||||
this.patterns = {
|
||||
'header1': { pattern: /^(.+)\n=+\n/gim, alias: 'st1' },
|
||||
'header2': { pattern: /^(.+)\n-+\n/gim, alias: 'st2' },
|
||||
'header3': { pattern: /[#]{1,6}.*/gim, alias: 'st0' },
|
||||
'ul': { pattern: /^\*\s*.*/gim, alias: 'kw1' },
|
||||
'ol': { pattern: /^\d+\..*/gim, alias: 'kw1' },
|
||||
'italics': { pattern: /\*.*?\*/g, alias: 'kw3' },
|
||||
'bold': { pattern: /\*\*.*?\*\*/g, alias: 'kw3' },
|
||||
'url': { pattern: /\[[^\]]*\]\([^\)]*\)/g, alias: 'kw4' }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
});
|
56
EnlighterJS/Source/Language/Matlab.js
Normal file
56
EnlighterJS/Source/Language/Matlab.js
Normal file
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
---
|
||||
description: Octave/Matlab Language
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Language.matlab]
|
||||
...
|
||||
*/
|
||||
EJS.Language.matlab = new Class({
|
||||
|
||||
Extends: EJS.Language.generic,
|
||||
|
||||
setupLanguage: function() {
|
||||
this.keywords = {
|
||||
// keywords: https://www.gnu.org/software/octave/doc/interpreter/Keywords.html
|
||||
kw: {
|
||||
csv: "__FILE__,__LINE__,break,case,catch,classdef,continue,do,else,elseif,end,end_try_catch,end_unwind_protect,endclassdef,endenumeration,endevents,endfor,endfunction,endif,endmethods,endparfor,endproperties,endswitch,endwhile,enumeration,events,for,function,global,if,methods,otherwise,parfor,persistent,properties,return,static,switch,try,until,unwind_protect,unwind_protect_cleanup,while",
|
||||
alias: 'kw1',
|
||||
mod: 'gi'
|
||||
},
|
||||
const: {
|
||||
csv: 'true, false',
|
||||
alias: 'kw3',
|
||||
mod: 'gi'
|
||||
}
|
||||
};
|
||||
|
||||
this.patterns = {
|
||||
'lineComments': { pattern: /%.*$/gm, alias: 'co1'},
|
||||
'blockComments': { pattern: /%%.*$/gm, alias: 'co2'},
|
||||
|
||||
'fn' : { pattern: this.common.functionCalls, alias: 'me0'},
|
||||
'fn2' : { pattern: /\b([\w]+)\s*;/gm, alias: 'me0'},
|
||||
'me' : { pattern: this.common.methodCalls, alias: 'me1'},
|
||||
|
||||
'brackets': { pattern: this.common.brackets, alias: 'br0' },
|
||||
|
||||
'strings': {pattern: this.common.singleQuotedString, alias: 'st0'},
|
||||
|
||||
'numbers': { pattern: this.common.numbers, alias: 'nu0' },
|
||||
|
||||
'fhandle': { pattern: /(@[\w]+)\s*/gm, alias: 'kw3' },
|
||||
|
||||
'symbols': { pattern: /\+|-|\*|\/|%|!|@|&|\||\^|<|>|=|,|\.|;|\?|:|\[|]/g, alias: 'sy0' },
|
||||
|
||||
'classdef': { pattern: /classdef\s+(\w+(?:\s*<\s*\w+)?)\s*$/gim, alias: 'kw4'}
|
||||
};
|
||||
}
|
||||
});
|
96
EnlighterJS/Source/Language/Nsis.js
Normal file
96
EnlighterJS/Source/Language/Nsis.js
Normal file
|
@ -0,0 +1,96 @@
|
|||
/*
|
||||
---
|
||||
description: Nullsoft Scriptable Install System (NSIS)
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Jan T. Sott
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Language.nsis]
|
||||
...
|
||||
*/
|
||||
EJS.Language.nsis = new Class({
|
||||
|
||||
Extends : EJS.Language.generic,
|
||||
|
||||
setupLanguage : function(){
|
||||
/** Set of keywords in CSV form. Add multiple keyword hashes for differentiate keyword sets. */
|
||||
|
||||
this.keywords = {
|
||||
commands : {
|
||||
csv : "Function, PageEx, Section, SectionGroup, SubSection, Abort, AddBrandingImage, AddSize, AllowRootDirInstall, AllowSkipFiles, AutoCloseWindow, BGFont, BGGradient, BrandingText, BringToFront, Call, CallInstDLL, Caption, ChangeUI, CheckBitmap, ClearErrors, CompletedText, ComponentText, CopyFiles, CRCCheck, CreateDirectory, CreateFont, CreateShortCut, Delete, DeleteINISec, DeleteINIStr, DeleteRegKey, DeleteRegValue, DetailPrint, DetailsButtonText, DirText, DirVar, DirVerify, EnableWindow, EnumRegKey, EnumRegValue, Exch, Exec, ExecShell, ExecWait, ExpandEnvStrings, File, FileBufSize, FileClose, FileErrorText, FileOpen, FileRead, FileReadByte, FileReadUTF16LE, FileReadWord, FileSeek, FileWrite, FileWriteByte, FileWriteUTF16LE, FileWriteWord, FindClose, FindFirst, FindNext, FindWindow, FlushINI, FunctionEnd, GetCurInstType, GetCurrentAddress, GetDlgItem, GetDLLVersion, GetDLLVersionLocal, GetErrorLevel, GetFileTime, GetFileTimeLocal, GetFullPathName, GetFunctionAddress, GetInstDirError, GetLabelAddress, GetTempFileName, Goto, HideWindow, Icon, IfAbort, IfErrors, IfFileExists, IfRebootFlag, IfSilent, InitPluginsDir, InstallButtonText, InstallColors, InstallDir, InstallDirRegKey, InstProgressFlags, InstType, InstTypeGetText, InstTypeSetText, IntCmp, IntCmpU, IntFmt, IntOp, IsWindow, LangString, LicenseBkColor, LicenseData, LicenseForceSelection, LicenseLangString, LicenseText, LoadLanguageFile, LockWindow, LogSet, LogText, ManifestDPIAware, ManifestSupportedOS, MessageBox, MiscButtonText, Name, Nop, OutFile, Page, PageCallbacks, PageExEnd, Pop, Push, Quit, ReadEnvStr, ReadINIStr, ReadRegDWORD, ReadRegStr, Reboot, RegDLL, Rename, RequestExecutionLevel, ReserveFile, Return, RMDir, SearchPath, SectionEnd, SectionGetFlags, SectionGetInstTypes, SectionGetSize, SectionGetText, SectionGroupEnd, SectionIn, SectionSetFlags, SectionSetInstTypes, SectionSetSize, SectionSetText, SendMessage, SetAutoClose, SetBrandingImage, SetCompress, SetCompressor, SetCompressorDictSize, SetCtlColors, SetCurInstType, SetDatablockOptimize, SetDateSave, SetDetailsPrint, SetDetailsView, SetErrorLevel, SetErrors, SetFileAttributes, SetFont, SetOutPath, SetOverwrite, SetPluginUnload, SetRebootFlag, SetRegView, SetShellVarContext, SetSilent, ShowInstDetails, ShowUninstDetails, ShowWindow, SilentInstall, SilentUnInstall, Sleep, SpaceTexts, StrCmp, StrCmpS, StrCpy, StrLen, SubCaption, SubSectionEnd, Unicode, UninstallButtonText, UninstallCaption, UninstallIcon, UninstallSubCaption, UninstallText, UninstPage, UnRegDLL, Var, VIAddVersionKey, VIFileVersion, VIProductVersion, WindowIcon, WriteINIStr, WriteRegBin, WriteRegDWORD, WriteRegExpandStr, WriteRegStr, WriteUninstaller, XPStyle",
|
||||
alias : 'kw1'
|
||||
},
|
||||
states : {
|
||||
csv : "admin, all, auto, both, colored, false, force, hide, highest, lastused, leave, listonly, none, normal, notset, off, on, open, print, show, silent, silentlog, smooth, textonly, true, user",
|
||||
alias : 'kw2'
|
||||
},
|
||||
statics : {
|
||||
csv : "ARCHIVE, FILE_ATTRIBUTE_ARCHIVE, FILE_ATTRIBUTE_NORMAL, FILE_ATTRIBUTE_OFFLINE, FILE_ATTRIBUTE_READONLY, FILE_ATTRIBUTE_SYSTEM, FILE_ATTRIBUTE_TEMPORARY, HKCR, HKCU, HKDD, HKEY_CLASSES_ROOT, HKEY_CURRENT_CONFIG, HKEY_CURRENT_USER, HKEY_DYN_DATA, HKEY_LOCAL_MACHINE, HKEY_PERFORMANCE_DATA, HKEY_USERS, HKLM, HKPD, HKU, IDABORT, IDCANCEL, IDIGNORE, IDNO, IDOK, IDRETRY, IDYES, MB_ABORTRETRYIGNORE, MB_DEFBUTTON1, MB_DEFBUTTON2, MB_DEFBUTTON3, MB_DEFBUTTON4, MB_ICONEXCLAMATION, MB_ICONINFORMATION, MB_ICONQUESTION, MB_ICONSTOP, MB_OK, MB_OKCANCEL, MB_RETRYCANCEL, MB_RIGHT, MB_RTLREADING, MB_SETFOREGROUND, MB_TOPMOST, MB_USERICON, MB_YESNO, NORMAL, OFFLINE, READONLY, SHCTX, SHELL_CONTEXT, SYSTEM, TEMPORARY",
|
||||
alias : 'kw3'
|
||||
}
|
||||
};
|
||||
|
||||
/** Set of RegEx patterns to match */
|
||||
this.patterns = {
|
||||
'brackets' : {
|
||||
pattern : this.common.brackets,
|
||||
alias : 'br0'
|
||||
},
|
||||
'commentMultiline' : {
|
||||
pattern : this.common.multiComments,
|
||||
alias : 'co2'
|
||||
},
|
||||
'commentPound' : {
|
||||
pattern : this.common.poundComments,
|
||||
alias : 'co1'
|
||||
},
|
||||
'commentSemicolon' : {
|
||||
pattern : /;.*$/gm,
|
||||
alias : 'co1'
|
||||
},
|
||||
'compilerFlags' : {
|
||||
pattern : /(!(addincludedir|addplugindir|appendfile|cd|define|delfile|echo|else|endif|error|execute|finalize|getdllversionsystem|ifdef|ifmacrodef|ifmacrondef|ifndef|if|include|insertmacro|macroend|macro|makensis|packhdr|searchparse|searchreplace|tempfile|undef|verbose|warning))/g,
|
||||
alias : 'kw2'
|
||||
},
|
||||
'defines' : {
|
||||
pattern : /[\$]\{{1,2}[0-9a-zA-Z_][\w]*[\}]/gim,
|
||||
alias : 'kw4'
|
||||
},
|
||||
'jumps' : {
|
||||
pattern : /([(\+|\-)]([0-9]+))/g,
|
||||
alias : 'nu0'
|
||||
},
|
||||
'langStrings' : {
|
||||
pattern : /[\$]\({1,2}[0-9a-zA-Z_][\w]*[\)]/gim,
|
||||
alias : 'kw3'
|
||||
},
|
||||
'escapeChars' : {
|
||||
pattern : /([\$]\\(n|r|t|[\$]))/g,
|
||||
alias : 'kw4'
|
||||
},
|
||||
'numbers' : {
|
||||
pattern : /\b((([0-9]+)?\.)?[0-9_]+([e][\-+]?[0-9]+)?|0x[A-F0-9]+)\b/gi,
|
||||
alias : 'nu0'
|
||||
},
|
||||
'pluginCommands' : {
|
||||
pattern : /(([0-9a-zA-Z_]+)[:{2}]([0-9a-zA-Z_]+))/g,
|
||||
alias : 'kw2'
|
||||
},
|
||||
'strings' : {
|
||||
pattern : this.common.strings,
|
||||
alias : 'st0'
|
||||
},
|
||||
'variables' : {
|
||||
pattern : /[\$]{1,2}[0-9a-zA-Z_][\w]*/gim,
|
||||
alias : 'kw4'
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
});
|
76
EnlighterJS/Source/Language/Php.js
Normal file
76
EnlighterJS/Source/Language/Php.js
Normal file
|
@ -0,0 +1,76 @@
|
|||
/*
|
||||
---
|
||||
description: PHP language
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Language.php]
|
||||
...
|
||||
*/
|
||||
EnlighterJS.Language.php = new Class({
|
||||
|
||||
Extends: EnlighterJS.Language.generic,
|
||||
tokenizerType : 'Standard',
|
||||
|
||||
setupLanguage: function(){
|
||||
|
||||
this.keywords = {
|
||||
// http://php.net/manual/en/reserved.keywords.php
|
||||
keywords: {
|
||||
csv: '__halt_compiler,abstract,and,as,break,callable,case,catch,class,clone,const,continue,declare,default,do,else,elseif,enddeclare,endfor,endforeach,endif,endswitch,endwhile,extends,final,finally,function,global,goto,implements,instanceof,insteadof,interface,namespace,new,or,private,protected,public,static,throw,trait,try,use,var,xor,yield',
|
||||
alias: 'kw1'
|
||||
},
|
||||
|
||||
// http://php.net/manual/en/reserved.other-reserved-words.php
|
||||
reserved: {
|
||||
csv: 'int,float,bool,string,true,false,null,resource,object,mixed,numeric',
|
||||
alias: 'kw4',
|
||||
mod: 'gi'
|
||||
}
|
||||
};
|
||||
|
||||
this.patterns = {
|
||||
'keywordsFn': {
|
||||
pattern: /(require_once|include_once|array|die|exit|echo|print|empty|eval|include|isset|list|require|unset|if|switch|while|foreach|for|return)(?:\s*\(|\s+)?/gi,
|
||||
alias: 'kw1'
|
||||
},
|
||||
inherit: {
|
||||
pattern: /(self|parent|\$this)/gi,
|
||||
alias: 'kw4'
|
||||
},
|
||||
|
||||
'slashComments': { pattern: this.common.slashComments, alias: 'co1' },
|
||||
'multiComments': { pattern: this.common.multiComments, alias: 'co2' },
|
||||
|
||||
'dqStrings': { pattern: this.common.multiLineDoubleQuotedStrings, alias: 'st0' },
|
||||
'sqStrings': { pattern: this.common.multiLineSingleQuotedStrings, alias: 'st1' },
|
||||
|
||||
'heredocs': { pattern: /(<<<\s*?('?)([A-Z0-9]+)\2[^\n]*?\n[\s\S]*?\n\3(?![A-Z0-9\s]))/gim, alias: 'st1' },
|
||||
|
||||
'numbers': { pattern: /\b((([0-9]+)?\.)?[0-9_]+([e][\-+]?[0-9]+)?|0x[A-F0-9]+)\b/gi, alias: 'nu0' },
|
||||
|
||||
'variables': { pattern: /\$[A-Z_][\w]*/gim, alias: 'kw3' },
|
||||
|
||||
'functions': { pattern: this.common.functionCalls, alias: 'me0' },
|
||||
'methods': { pattern: /(?:->|::)([\w]+)/gim, alias: 'me1' },
|
||||
|
||||
'constants': { pattern: /\b[A-Z][A-Z0-9_]+[A-Z]\b/g, alias: 'kw4' },
|
||||
'lconstants': { pattern: /\b__[A-Z][A-Z0-9_]+__\b/g, alias: 're0' },
|
||||
|
||||
'brackets': { pattern: this.common.brackets, alias: 'br0' },
|
||||
'symbols': { pattern: /!|@|&|<|>|=|=>|-|\+/g, alias: 'sy0' }
|
||||
};
|
||||
|
||||
// Delimiters
|
||||
this.delimiters = {
|
||||
start: this.strictRegExp('<?php'),
|
||||
end: this.strictRegExp('?>')
|
||||
};
|
||||
}
|
||||
});
|
106
EnlighterJS/Source/Language/Python.js
Normal file
106
EnlighterJS/Source/Language/Python.js
Normal file
|
@ -0,0 +1,106 @@
|
|||
/*
|
||||
---
|
||||
description: Python language
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Italo Maia
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Language.python]
|
||||
...
|
||||
*/
|
||||
EJS.Language.python = new Class({
|
||||
|
||||
Extends: EJS.Language.generic,
|
||||
|
||||
setupLanguage: function()
|
||||
{
|
||||
this.keywords = {
|
||||
reserved:{
|
||||
csv:"and, del, from, not, while, as, elif, global, or, with, assert, else, if, pass, yield, break, except, import, print, class, exec, in, raise, continue, finally, is, return, def, for, lambda, try",
|
||||
alias:'kw1'
|
||||
},
|
||||
functions:{
|
||||
csv:"__import__, abs, all, any, apply, bin, callable, chr, cmp, coerce, compile, delattr, dir, divmod, eval, execfile, filter, format, getattr, globals, hasattr, hash, hex, id, input, intern, isinstance, issubclass, iter, len, locals, map, max, min, next, oct, open, ord, pow, print, range, raw_input, reduce, reload, repr, round, setattr, sorted, sum, unichr, vars, zip",
|
||||
alias:'kw2'
|
||||
},
|
||||
classes:{
|
||||
csv:"ArithmeticError, AssertionError, AttributeError, BaseException, BufferError, BytesWarning, DeprecationWarning, EOFError, EnvironmentError, Exception, FloatingPointError, FutureWarning, GeneratorExit, IOError, ImportError, ImportWarning, IndentationError, IndexError, KeyError, KeyboardInterrupt, LookupError, MemoryError, NameError, NotImplementedError, OSError, OverflowError, PendingDeprecationWarning, ReferenceError, RuntimeError, RuntimeWarning, StandardError, StopIteration, SyntaxError, SyntaxWarning, SystemError, SystemExit, TabError, TypeError, UnboundLocalError, UnicodeDecodeError, UnicodeEncodeError, UnicodeError, UnicodeTranslateError, UnicodeWarning, UserWarning, ValueError, Warning, ZeroDivisionError, basestring, bool, buffer, bytearray, bytes, classmethod, complex, dict, enumerate, file, float, frozenset, int, list, long, object, property, reversed, set, slice, staticmethod, str, super, tuple, type, unicode, xrange",
|
||||
alias:'kw2'
|
||||
}
|
||||
},
|
||||
|
||||
this.patterns = {
|
||||
'poundComments': {
|
||||
pattern: this.common.poundComments,
|
||||
alias:'co1'
|
||||
},
|
||||
/*
|
||||
'multiComments': {
|
||||
pattern: /^=begin[\s\S]*?^=end/gm,
|
||||
alias: 'co2'
|
||||
},*/
|
||||
'multiStringComments1': {
|
||||
pattern: /"""[\s\S]*?"""/gm,
|
||||
alias: 'co2'
|
||||
},
|
||||
'multiStringComments2': {
|
||||
pattern: /'''[\s\S]*?'''/gm,
|
||||
alias: 'co2'
|
||||
},
|
||||
'strings': {
|
||||
pattern: this.common.strings,
|
||||
alias: 'st0'
|
||||
},
|
||||
'tickStrings': {
|
||||
pattern: this.delimToRegExp("`","\\","`","gm"),
|
||||
alias: 'st0'
|
||||
},
|
||||
'delimString': {
|
||||
pattern: /(%[q|Q|x]?(\W)[^\2\\\n]*(?:\\.[^\2\\]*)*(\2|\)|\]|\}))/gm,
|
||||
alias: 'st1'
|
||||
},
|
||||
'heredoc': {
|
||||
pattern: /(<<(\'?)([A-Z0-9]+)\2[^\n]*?\n[\s\S]*\n\3(?![\w]))/gim,
|
||||
alias: 'st2'
|
||||
},
|
||||
'variables': {
|
||||
pattern: /(@[A-Za-z_][\w]*|@@[A-Za-z_][\w]*|\$(?:\-[\S]|[\w]+)|\b[A-Z][\w]*)/g,
|
||||
alias: 'kw3'
|
||||
},
|
||||
'rubySymbols': {
|
||||
pattern: /[^:](:[\w]+)/g,
|
||||
alias: 'kw4'
|
||||
},
|
||||
'constants': {
|
||||
pattern: /\b[A-Z][\w]*/g,
|
||||
alias: 'kw3'
|
||||
},
|
||||
'numbers': {
|
||||
pattern: /\b((([0-9]+)?\.)?[0-9_]+([e][-+]?[0-9]+)?|0x[A-F0-9]+|0b[0-1_]+)\b/gim,
|
||||
alias: 'nu0'
|
||||
},
|
||||
'properties': {
|
||||
pattern: this.common.properties,
|
||||
alias: 'me0'
|
||||
},
|
||||
'brackets': {
|
||||
pattern: this.common.brackets,
|
||||
alias: 'br0'
|
||||
},
|
||||
'delimRegex': {
|
||||
pattern: /(%r(\W)[^\2\\\n]*(?:\\.[^\2\\\n]*?)*(\2|\)|\]|\})[iomx]*)/gm,
|
||||
alias: 're0'
|
||||
},
|
||||
'literalRegex': {
|
||||
pattern: this.delimToRegExp("/","\\","/","g","[iomx]*"),
|
||||
alias: 're0'
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
});
|
41
EnlighterJS/Source/Language/RAW.js
Normal file
41
EnlighterJS/Source/Language/RAW.js
Normal file
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
---
|
||||
description: RAW Code
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Language.raw]
|
||||
...
|
||||
*/
|
||||
EJS.Language.raw = new Class({
|
||||
|
||||
Extends: EJS.Language.generic,
|
||||
|
||||
initialize: function(code) {
|
||||
this.code = code;
|
||||
},
|
||||
|
||||
getTokens: function(){
|
||||
// create token object
|
||||
var token = (function(text, alias, index){
|
||||
return {
|
||||
text: text,
|
||||
alias: alias,
|
||||
index: index,
|
||||
length: text.length,
|
||||
end: text.length + index
|
||||
}
|
||||
});
|
||||
|
||||
// raw means "no-highlight" - return a single, unknown token with the given sourcecode
|
||||
return [
|
||||
token(this.code, '', 0)
|
||||
];
|
||||
}
|
||||
});
|
62
EnlighterJS/Source/Language/Ruby.js
Normal file
62
EnlighterJS/Source/Language/Ruby.js
Normal file
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
---
|
||||
description: Ruby language
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Jose Prado
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Language.ruby]
|
||||
...
|
||||
*/
|
||||
EJS.Language.ruby = new Class ({
|
||||
|
||||
Extends: EJS.Language.generic,
|
||||
|
||||
setupLanguage: function()
|
||||
{
|
||||
this.keywords = {
|
||||
reserved: {
|
||||
csv: "__FILE__, __LINE__, 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",
|
||||
alias: 'kw1'
|
||||
},
|
||||
functions: {
|
||||
csv: "abort, at_exit, autoload, binding, block_given, callcc, caller, catch, chomp, chop, eval, exec, exit, exit!, fail, fork, format, gets, global_variables, gsub, lambda, proc, load, local_variables, loop, open, p, print, proc, putc, puts, raise, fail, rand, readline, readlines, require, scan, select, set_trace_func, sleep, split, sprintf, format, srand, syscall, system, sub, test, throw, trace_var, trap, untrace_var",
|
||||
alias: 'kw2'
|
||||
},
|
||||
classes: {
|
||||
csv: "Abbrev, ArgumentError, Array, Base64, Benchmark, Benchmark::Tms, Bignum, Binding, CGI, Cookie, HtmlExtension, QueryExtension, Session, FileStore, MemoryStore, Class, Comparable, Complex, ConditionVariable, Continuation, Data, Date, DateTime, Dir, EOFError, Enumerable, Errno, Exception, FalseClass, File, Constants, Stat, FileTest, FileUtils, CopyContext_, DryRun, NoWrite, Verbose, Find, Fixnum, Float, FloatDomainError, GC, Generator, Hash, IO, IOError, Iconv, Failure, IllegalSequence, InvalidCharacter, OutOfRange, IndexError, Integer, Interrupt, Kernel, LoadError, LocalJumpError, Logger, Application, LogDevice, Severity, ShiftingError, Marshal, MatchData, Math, Matrix, Method, Module, Mutex, NameError, NilClass, NoMemoryError, NoMethodError, NotImplementedError, Numeric, Object, ObjectSpace, Observable, Pathname, Precision, Proc, Process, GID, Status, Sys, UID, Queue, Range, RangeError, Regexp, RegexpError, RuntimeError, ScriptError, SecurityError, Set, Shellwords, Signal, SignalException, Singleton, SingletonClassMethods, SizedQueue, SortedSet, StandardError, String, StringScanner, StringScanner::Error, Struct, Symbol, SyncEnumerator, SyntaxError, SystemCallError, SystemExit, SystemStackError, Tempfile, Test, Unit, Thread, ThreadError, ThreadGroup, ThreadsWait, Time, TrueClass, TypeError, UnboundMethod, Vector, YAML, ZeroDivisionError, Zlib, BufError, DataError, Deflate, Error, GzipFile, CRCError, Error, LengthError, NoFooter, GzipReader, GzipWriter, Inflate, MemError, NeedDict, StreamEnd, StreamError, VersionError, ZStream, fatal",
|
||||
alias: 'kw2'
|
||||
}
|
||||
},
|
||||
|
||||
this.patterns = {
|
||||
'poundComments': { pattern: this.common.poundComments, alias: 'co1' },
|
||||
'multiComments': { pattern: /^=begin[\s\S]*?^=end/gm, alias: 'co2' },
|
||||
|
||||
'strings': { pattern: this.common.strings, alias: 'st0' },
|
||||
'tickStrings': { pattern: this.delimToRegExp("`", "\\", "`", "gm"), alias: 'st0' },
|
||||
'delimString': { pattern: /(%[q|Q|x]?(\W)[^\2\\\n]*(?:\\.[^\2\\]*)*(\2|\)|\]|\}))/gm, alias: 'st1' },
|
||||
'heredoc': { pattern: /(<<(\'?)([A-Z0-9]+)\2[^\n]*?\n[\s\S]*\n\3(?![\w]))/gim, alias: 'st2' },
|
||||
|
||||
//'instanceVar': { pattern: /@[A-Z_][\w]*/gi, alias: 'kw3' },
|
||||
//'classVar': { pattern: /@@[A-Z_][\w]*/gi, alias: 'kw3' },
|
||||
//'globalVar': { pattern: /\$(?:\-[\S]|[\w]+)/gi, alias: 'kw3' },
|
||||
'variables': { pattern: /(@[A-Za-z_][\w]*|@@[A-Za-z_][\w]*|\$(?:\-[\S]|[\w]+)|\b[A-Z][\w]*)/g, alias: 'kw3' },
|
||||
'rubySymbols': { pattern: /[^:](:[\w]+)/g, alias: 'kw4' },
|
||||
'constants': { pattern: /\b[A-Z][\w]*/g, alias: 'kw3' },
|
||||
|
||||
'numbers': { pattern: /\b((([0-9]+)?\.)?[0-9_]+([e][-+]?[0-9]+)?|0x[A-F0-9]+|0b[0-1_]+)\b/gim, alias: 'nu0' },
|
||||
'properties': { pattern: this.common.properties, alias: 'me0' },
|
||||
'brackets': { pattern: this.common.brackets, alias: 'br0' },
|
||||
|
||||
'delimRegex': { pattern: /(%r(\W)[^\2\\\n]*(?:\\.[^\2\\\n]*?)*(\2|\)|\]|\})[iomx]*)/gm, alias: 're0' },
|
||||
'literalRegex': { pattern: this.delimToRegExp("/", "\\", "/", "g", "[iomx]*"), alias: 're0' }
|
||||
};
|
||||
|
||||
}
|
||||
});
|
65
EnlighterJS/Source/Language/Rust.js
Normal file
65
EnlighterJS/Source/Language/Rust.js
Normal file
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
---
|
||||
description: Rust Language https://doc.rust-lang.org
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Language.rust]
|
||||
...
|
||||
*/
|
||||
EJS.Language.rust = new Class({
|
||||
|
||||
Extends: EJS.Language.generic,
|
||||
|
||||
setupLanguage: function() {
|
||||
this.keywords = {
|
||||
// keywords: https://doc.rust-lang.org/syntax/parse/token/keywords/enum.Keyword.html
|
||||
kw: {
|
||||
csv: "As,Break,Crate,Else,Enum,Extern,False,Fn,For,If,Impl,In,Let,Loop,Match,Mod,Move,Mut,Pub,Ref,Return,Static,SelfValue,SelfType,Struct,Super,True,Trait,Type,Unsafe,Use,Virtual,While,Continue,Box,Const,Where,Proc,Alignof,Become,Offsetof,Priv,Pure,Sizeof,Typeof,Unsized,Yield,Do,Abstract,Final,Override,Macro",
|
||||
alias: 'kw1',
|
||||
mod: 'gi'
|
||||
}
|
||||
};
|
||||
|
||||
this.patterns = {
|
||||
'slashComments': { pattern: this.common.slashComments, alias: 'co1'},
|
||||
'multiComments': { pattern: this.common.multiComments, alias: 'co1'},
|
||||
|
||||
'slashDocComments': { pattern: /(?:^|[^\\])\/\/[\/!].*$/gm, alias: 'co2'},
|
||||
'multiDocComments': { pattern: /\/\*[\*!][\s\S]*?\*\//gm, alias: 'co2'},
|
||||
|
||||
'chars': { pattern: /'.'/gm, alias: 'st0' },
|
||||
'rawStrings': { pattern: /r((#+)".*?"\2)/gm, alias: 'st1' },
|
||||
'strings': { pattern: /("(?:\\.|\\\s*\n|\\s*\r\n|[^\\"])*")/g, alias: 'st1' },
|
||||
|
||||
'directives': { pattern: /^\s*#.*$/gm, alias: 'sy0'},
|
||||
'brackets': { pattern: this.common.brackets, alias: 'br0' },
|
||||
|
||||
// https://doc.rust-lang.org/stable/reference.html#integer-literals
|
||||
'intLiteral': { pattern: /\b([0-9_]+|0o[0-9_]+|0x[A-F0-9_]+|0b[0-1_]+)(u8|i8|u16|i16|u32|i32|u64|i64|isize|usize)?\b/gim, alias: 'nu0' },
|
||||
|
||||
// https://doc.rust-lang.org/stable/reference.html#floating-point-literals
|
||||
'floatLiteral': { pattern: /\b([0-9_]+\.?[0-9_]+?(e\+[0-9_]+)?)(?:f32|f64)?\b/gim, alias: 'nu0' },
|
||||
|
||||
// method definitions
|
||||
'methodDefs': {pattern: /fn\s+([\w]+)\s*(<\w+\s*>)?\(/gm, alias: 'kw2'},
|
||||
|
||||
// method/function calls
|
||||
'funCalls': {pattern: /\b\.?([\w]+)\s*(\(|::)/gm, alias: 'kw3'},
|
||||
|
||||
// macro calls
|
||||
'macro': {pattern: /\b([\w]+)!/gm, alias: 'kw4'},
|
||||
|
||||
'symbols': {
|
||||
pattern: /\+|-|\*|\/|%|!|@|&|\||\^|<|<<|>>|>|=|,|\.|;|\?|:|self/g,
|
||||
alias: 'sy0'
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
59
EnlighterJS/Source/Language/Shell.js
Normal file
59
EnlighterJS/Source/Language/Shell.js
Normal file
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
---
|
||||
description: Shell/Bash Scripting
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Language.shell]
|
||||
...
|
||||
*/
|
||||
EJS.Language.shell = new Class ({
|
||||
|
||||
Extends: EJS.Language.generic,
|
||||
|
||||
setupLanguage: function(){
|
||||
this.keywords = {
|
||||
keywords: {
|
||||
csv: 'if, fi, then, elif, else, for, do, done, until, while, break, continue, case, esac, return, function, in, eq, ne, gt, lt, ge, le',
|
||||
alias: 'kw1'
|
||||
}
|
||||
};
|
||||
|
||||
this.patterns = {
|
||||
'comments': {
|
||||
pattern: /((?:^\s*|\s+)#.*$)/gm,
|
||||
alias: 'co1'
|
||||
},
|
||||
'strings': {
|
||||
pattern: this.common.strings,
|
||||
alias: 'st0'
|
||||
},
|
||||
'backticks': {
|
||||
pattern: /`.*?`/gm,
|
||||
alias: 'st1'
|
||||
},
|
||||
'cases': {
|
||||
pattern: /^\s*\w+\)\s*$/gm,
|
||||
alias: 'kw2'
|
||||
},
|
||||
'def': {
|
||||
pattern: /^(\s*\w+)=/gm,
|
||||
alias: 'kw4'
|
||||
},
|
||||
'vars': {
|
||||
pattern: /(\$\w+)\b/gim,
|
||||
alias: 'kw4'
|
||||
},
|
||||
'functions': {
|
||||
pattern: /^\s*\w+\(\)\s*\{/gm,
|
||||
alias: 'kw3'
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
48
EnlighterJS/Source/Language/Sql.js
Normal file
48
EnlighterJS/Source/Language/Sql.js
Normal file
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
---
|
||||
description: SQL Language
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Jose Prado
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Language.sql]
|
||||
...
|
||||
*/
|
||||
EJS.Language.sql = new Class ({
|
||||
|
||||
Extends: EJS.Language.generic,
|
||||
|
||||
setupLanguage: function(){
|
||||
this.keywords = {
|
||||
keywords: {
|
||||
csv: 'savepoint, start, absolute, action, add, after, alter, as, asc, at, authorization, begin, bigint, binary, bit, by, cascade, char, character, check, checkpoint, close, collate, column, commit, committed, connect, connection, constraint, contains, continue, create, cube, current, current_date, current_time, cursor, database, date, deallocate, dec, decimal, declare, default, delete, desc, distinct, double, drop, dynamic, else, end, end-exec, escape, except, exec, execute, false, fetch, first, float, for, force, foreign, forward, free, from, full, function, global, goto, grant, group, grouping, having, hour, ignore, index, inner, insensitive, insert, instead, int, integer, intersect, into, is, isolation, key, last, level, load, local, max, min, minute, modify, move, name, national, nchar, next, no, numeric, of, off, on, only, open, option, order, out, output, partial, password, precision, prepare, primary, prior, privileges, procedure, public, read, real, references, relative, repeatable, restrict, return, returns, revoke, rollback, rollup, rows, rule, schema, scroll, second, section, select, sequence, serializable, set, size, smallint, static, statistics, table, temp, temporary, then, time, timestamp, to, top, transaction, translation, trigger, true, truncate, uncommitted, union, unique, update, values, varchar, varying, view, when, where, with, work',
|
||||
alias: 'kw1',
|
||||
mod: 'gi'
|
||||
},
|
||||
functions: {
|
||||
csv: 'abs, avg, case, cast, coalesce, convert, count, current_timestamp, current_user, day, isnull, left, lower, month, nullif, replace, right, session_user, space, substring, sum, system_user, upper, user, year',
|
||||
alias: 'kw2',
|
||||
mod: 'gi'
|
||||
},
|
||||
operators: {
|
||||
csv: 'all, and, any, between, cross, in, join, like, not, null, or, outer, some, if',
|
||||
alias: 'kw3',
|
||||
mod: 'gi'
|
||||
}
|
||||
},
|
||||
|
||||
this.patterns = {
|
||||
'singleLineComments': {pattern: /--(.*)$/gm, alias: 'co1'},
|
||||
'multiLineComments': {pattern: this.common.multiComments, alias: 'co2'},
|
||||
'multiLineStrings': {pattern: this.common.multiLineStrings, alias: 'st0'},
|
||||
'numbers': {pattern: this.common.numbers, alias: 'nu0'},
|
||||
'columns': {pattern: /`[^`\\]*(?:\\.[^`\\]*)*`/gm, alias: 'kw4'}
|
||||
};
|
||||
}
|
||||
});
|
55
EnlighterJS/Source/Language/Squirrel.js
Normal file
55
EnlighterJS/Source/Language/Squirrel.js
Normal file
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
---
|
||||
description: Squirrel Language http://www.squirrel-lang.org/
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
- Devyn Collier Johnson
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Language.squirrel]
|
||||
...
|
||||
*/
|
||||
EJS.Language.squirrel = new Class({
|
||||
|
||||
Extends: EJS.Language.generic,
|
||||
|
||||
setupLanguage: function() {
|
||||
this.keywords = {
|
||||
reserved: {
|
||||
csv: "base,break,case,catch,class,clone,constructor,continue,const,default,delete,else,enum,extends,false,for,foreach,function,if,in,instanceof,local,null,resume,return,static,switch,this,throw,true,try,typeof,while,yield",
|
||||
alias: 'kw1'
|
||||
},
|
||||
};
|
||||
|
||||
this.patterns = {
|
||||
'slashComments': { pattern: this.common.slashComments, alias: 'co1'},
|
||||
|
||||
'poundComments': { pattern: this.common.poundComments, alias: 'co1'},
|
||||
|
||||
'multiComments': { pattern: this.common.multiComments, alias: 'co2'},
|
||||
|
||||
'strings': { pattern: this.common.doubleQuotedString, alias: 'st0' },
|
||||
|
||||
//'annotation': { pattern: /@[\W\w_][\w\d_]+/gm, alias: 'st1' },
|
||||
|
||||
// int, float, octals, hex
|
||||
'numbers': { pattern: /\b((([0-9]+)?\.)?[0-9_]+([e][-+]?[0-9]+)?|0x[A-F0-9]+)\b/gim, alias: 'nu0' },
|
||||
|
||||
// chars are handled as numbers
|
||||
'charnumber': { pattern: this.common.singleQuotedString, alias: 'nu0' },
|
||||
|
||||
'brackets': { pattern: this.common.brackets, alias: 'br0' },
|
||||
|
||||
'functionCalls': { pattern: this.common.functionCalls, alias: 'me0'},
|
||||
|
||||
'methodCalls': { pattern: this.common.methodCalls, alias: 'me1'},
|
||||
|
||||
'properties': { pattern: this.common.properties, alias: 'me1' }
|
||||
};
|
||||
}
|
||||
});
|
92
EnlighterJS/Source/Language/Template.mylang.js
Normal file
92
EnlighterJS/Source/Language/Template.mylang.js
Normal file
|
@ -0,0 +1,92 @@
|
|||
/*
|
||||
---
|
||||
description: Template to build custom languages for EnlighterJS.
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Language.mylang]
|
||||
...
|
||||
*/
|
||||
// your language is identified by it`s (lowercase!) classname - for example "mylang" is used
|
||||
// you can try out this example using Development.html - it is not included in regular builds!
|
||||
EnlighterJS.Language.mylang = new Class({
|
||||
|
||||
// every language have to extend the generic language or in case it's a superset the origin language
|
||||
Extends : EnlighterJS.Language.generic,
|
||||
|
||||
// override the setupLanguage() method to configure your language-patterns
|
||||
setupLanguage: function(){
|
||||
// a set of keywords-groups to highlight
|
||||
// you can define multiple keyword-groups within, each containg a list of comma seperated keywords ("csv") and an alias with the matching css-class to highlight
|
||||
// keep these lists AS SMALL AS POSSIBLE - use regex if possible
|
||||
this.keywords = {
|
||||
langElements : {
|
||||
csv : 'if, else, endif, elseif, then',
|
||||
alias : 'kw1'
|
||||
},
|
||||
output: {
|
||||
csv: 'echo',
|
||||
alias: 'kw3'
|
||||
}
|
||||
};
|
||||
|
||||
// a set of patterns used to match your language
|
||||
// some generic patterns are already defined into EnlighterJS.Language.generic - you can access them with this.common
|
||||
// like keywords, each pattern requires an alias with the matching css-class
|
||||
// the tokenizer will take respect to the list ordering (priority)
|
||||
this.patterns = {
|
||||
// mylang uses slash-style-comments
|
||||
'slashComments' : {
|
||||
pattern : this.common.slashComments,
|
||||
alias : 'co1'
|
||||
},
|
||||
|
||||
// single and double quoted strings are used
|
||||
'chars' : {
|
||||
pattern : this.common.singleQuotedString,
|
||||
alias : 'st0'
|
||||
},
|
||||
'strings' : {
|
||||
pattern : this.common.doubleQuotedString,
|
||||
alias : 'st0'
|
||||
},
|
||||
|
||||
// annotations starting with an @
|
||||
'annotation' : {
|
||||
pattern : /@[\W\w_][\w\d_]+/gm,
|
||||
alias : 'st1'
|
||||
},
|
||||
|
||||
// special regex pattern is used to match numbers
|
||||
'numbers' : {
|
||||
pattern : /\b((([0-9]+)?\.)?[0-9_]+([e][-+]?[0-9]+)?|0x[A-F0-9]+|0b[0-1_]+)\b/gim,
|
||||
alias : 'nu0'
|
||||
},
|
||||
|
||||
// standard function calls are used
|
||||
'functionCalls' : {
|
||||
pattern : this.common.functionCalls,
|
||||
alias : 'de1'
|
||||
},
|
||||
|
||||
// directives starting with an hash
|
||||
'directives' : {
|
||||
pattern : /#.*$/gm,
|
||||
alias : 'kw2'
|
||||
}
|
||||
};
|
||||
|
||||
// maybe "mylang" is a scripting language and uses start/stop "tags"
|
||||
// to handle arbitrary strings, use this.strictRegExp to escape these sequences
|
||||
this.delimiters = {
|
||||
start : this.strictRegExp('<!##'),
|
||||
end : this.strictRegExp('##!>')
|
||||
};
|
||||
}
|
||||
});
|
65
EnlighterJS/Source/Language/Vhdl.js
Normal file
65
EnlighterJS/Source/Language/Vhdl.js
Normal file
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
---
|
||||
description: VHDL Language
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Language.vhdl]
|
||||
...
|
||||
*/
|
||||
EJS.Language.vhdl = new Class ({
|
||||
|
||||
Extends: EJS.Language.generic,
|
||||
|
||||
setupLanguage: function(){
|
||||
this.keywords = {
|
||||
keywords: {
|
||||
csv: 'abs,access,after,alias,all,and,architecture,array,assert,attribute,begin,block,body,buffer,bus,case,component,configuration,constant,disconnect,downto,else,elsif,end,entity,exit,file,for,function,generate,generic,group,guarded,if,impure,in,inertial,inout,is,label,library,linkage,literal,loop,map,mod,nand,new,next,nor,not,null,of,on,open,or,others,out,package,port,postponed,procedure,process,pure,range,record,register,reject,rem,report,return,rol,ror,select,severity,signal,shared,sla,sll,sra,srl,subtype,then,to,transport,type,unaffected,units,until,use,variable,wait,when,while,with,xnor,xor',
|
||||
alias: 'kw1',
|
||||
mod: 'gi'
|
||||
},
|
||||
operators: {
|
||||
csv: 'abs,not,mod,rem,sll,srl,sla,sra,rol,ror,and,or,nand,nor,xor,xnor',
|
||||
alias: 'sy0'
|
||||
}
|
||||
};
|
||||
|
||||
this.patterns = {
|
||||
'comments': {
|
||||
pattern: /((?:^\s*|\s+)--.*$)/gm,
|
||||
alias: 'co1'
|
||||
},
|
||||
|
||||
'uses': {
|
||||
pattern: /^\s*(?:use|library)\s*(\S+);/gim,
|
||||
alias: 'kw4'
|
||||
},
|
||||
'functions': {
|
||||
pattern: this.common.functionCalls,
|
||||
alias: 'kw2'
|
||||
},
|
||||
operators: {
|
||||
pattern: /\*\*|\*|\/|\+|\-|&|=|\/=|<|<=|>|>=/g,
|
||||
alias: 'sy0'
|
||||
},
|
||||
'strings': {
|
||||
pattern: this.common.strings,
|
||||
alias: 'st1'
|
||||
},
|
||||
'numbers': {
|
||||
pattern: this.common.numbers,
|
||||
alias: 'nu0'
|
||||
},
|
||||
'brackets': {
|
||||
pattern: this.common.brackets,
|
||||
alias: 'br0'
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
48
EnlighterJS/Source/Language/Xml.js
Normal file
48
EnlighterJS/Source/Language/Xml.js
Normal file
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
---
|
||||
description: XML/HTML language
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Jose Prado
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Language.xml]
|
||||
...
|
||||
*/
|
||||
EnlighterJS.Language.xml = new Class({
|
||||
|
||||
Extends : EnlighterJS.Language.generic,
|
||||
tokenizerType : 'Xml',
|
||||
|
||||
setupLanguage: function(){
|
||||
// Common HTML patterns
|
||||
this.patterns = {
|
||||
'comments' : {
|
||||
pattern : /(?:<|<)!--[\s\S]*?--(?:>|>)/gim,
|
||||
alias : 'co2'
|
||||
},
|
||||
'cdata' : {
|
||||
pattern : /(?:<|<)!\[CDATA\[[\s\S]*?]](?:>|>)/gim,
|
||||
alias : 'st1'
|
||||
},
|
||||
'closingTags' : {
|
||||
pattern : /(?:<|<)\/[A-Z:_][A-Z0-9:.-]*?(?:>|>)/gi,
|
||||
alias : 'kw1'
|
||||
},
|
||||
'doctype' : {
|
||||
pattern : /(?:<|<)!DOCTYPE[\s\S]+?(?:>|>)/gim,
|
||||
alias : 'st2'
|
||||
},
|
||||
'version' : {
|
||||
pattern : /(?:<|<)\?xml[\s\S]+?\?(?:>|>)/gim,
|
||||
alias : 'kw2'
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
});
|
85
EnlighterJS/Source/LanguageManager.js
Normal file
85
EnlighterJS/Source/LanguageManager.js
Normal file
|
@ -0,0 +1,85 @@
|
|||
/*
|
||||
---
|
||||
description: defines a key/value object with language aliases e.g. javascript -> js
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.LanguageManager]
|
||||
...
|
||||
*/
|
||||
EJS.LanguageManager = new Class({
|
||||
|
||||
Implements : Options,
|
||||
|
||||
options: {
|
||||
'language': 'generic'
|
||||
},
|
||||
|
||||
/**
|
||||
* @constructs
|
||||
* @param {Object} options The options object.
|
||||
*/
|
||||
initialize : function(options) {
|
||||
this.setOptions(options);
|
||||
},
|
||||
|
||||
// map of language aliases
|
||||
languageAliases: {
|
||||
'standard': 'generic',
|
||||
'js': 'javascript',
|
||||
'md': 'markdown',
|
||||
'c++': 'cpp',
|
||||
'c': 'cpp',
|
||||
'styles': 'css',
|
||||
'bash': 'shell',
|
||||
'py': 'python',
|
||||
'html': 'xml',
|
||||
'jquery': 'javascript',
|
||||
'mootools': 'javascript',
|
||||
'ext.js': 'javascript',
|
||||
'c#': 'csharp',
|
||||
'conf': 'ini'
|
||||
},
|
||||
|
||||
// get language name, process aliases and default languages
|
||||
getLanguage: function(languageName){
|
||||
// get default language
|
||||
var defaultLanguage = (this.options.language != null ? this.options.language.trim().toLowerCase() : '');
|
||||
|
||||
// alias available ?
|
||||
if (this.languageAliases[defaultLanguage]){
|
||||
defaultLanguage = this.languageAliases[defaultLanguage];
|
||||
}
|
||||
|
||||
// default language class available ?
|
||||
if (defaultLanguage.trim() == '' || !EJS.Language[defaultLanguage]){
|
||||
defaultLanguage = 'generic';
|
||||
}
|
||||
|
||||
// valid string ?
|
||||
if (languageName == null || languageName.trim() == ''){
|
||||
return defaultLanguage;
|
||||
}
|
||||
|
||||
// "clean" languge name
|
||||
languageName = languageName.trim().toLowerCase();
|
||||
|
||||
// alias available ?
|
||||
if (this.languageAliases[languageName]){
|
||||
languageName = this.languageAliases[languageName];
|
||||
}
|
||||
|
||||
// language class available ?
|
||||
if (EJS.Language[languageName]){
|
||||
return languageName;
|
||||
}else{
|
||||
return defaultLanguage;
|
||||
}
|
||||
}
|
||||
});
|
79
EnlighterJS/Source/Native/Element.EnlighterJS.js
Normal file
79
EnlighterJS/Source/Native/Element.EnlighterJS.js
Normal file
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
---
|
||||
description: Extends MooTools.Element with the `enlight()` shortcut. Also adds `light()` and `unlight()` for backward compatibility with Lighter.js
|
||||
|
||||
license: MIT-style X11 License
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [Element.enlight]
|
||||
...
|
||||
*/
|
||||
|
||||
Element.implement({
|
||||
/**
|
||||
* Highlights an element/Removes Element highlighting
|
||||
*
|
||||
* @param {Object, Boolean} [options] EnlighterJS options Object or Boolean value to enable/disable highlighting
|
||||
* @returns {Element} The current Element instance.
|
||||
*/
|
||||
enlight: function(options){
|
||||
// mixed input check - options available ?
|
||||
options = (typeof(options) == "undefined") ? {} : options;
|
||||
|
||||
// convert "true" to empty Object!
|
||||
options = (options===true) ? {} : options;
|
||||
|
||||
// enlighter instance already available ?
|
||||
var enlighter = this.retrieve('EnlighterInstance');
|
||||
|
||||
// dispose element ?
|
||||
if (options === 'dispose' && enlighter){
|
||||
enlighter.dispose();
|
||||
this.eliminate('EnligterInstance');
|
||||
return this;
|
||||
}
|
||||
|
||||
// hide highlighted sourcecode ?
|
||||
if (options === false){
|
||||
if (enlighter !== null) {
|
||||
enlighter.enlight(false);
|
||||
}
|
||||
// highlight sourcecode and use options
|
||||
}else{
|
||||
// create new enlighter instance
|
||||
if (enlighter === null) {
|
||||
enlighter = new EJS(this, options, null);
|
||||
this.store('EnlighterInstance', enlighter);
|
||||
}
|
||||
enlighter.enlight(options);
|
||||
}
|
||||
|
||||
// element instance
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Highlights an element
|
||||
* @DEPRECATED since v2.0 - this method will be removed in the future
|
||||
* @param {Object} [options] EnlighterJS Options Object
|
||||
* @returns {Element} The current Element instance.
|
||||
*/
|
||||
light : function(options) {
|
||||
return this.enlight(options);
|
||||
},
|
||||
|
||||
/**
|
||||
* Removes/hides Element highlighting
|
||||
* @DEPRECATED since v2.0 - this method will be removed in the future
|
||||
* @returns {Element} The current Element instance.
|
||||
*/
|
||||
unlight : function(){
|
||||
return this.enlight(false);
|
||||
}
|
||||
});
|
||||
|
120
EnlighterJS/Source/Renderer/BlockRenderer.js
Normal file
120
EnlighterJS/Source/Renderer/BlockRenderer.js
Normal file
|
@ -0,0 +1,120 @@
|
|||
/*
|
||||
---
|
||||
description: Renders the generated Tokens into li-elements, grabbed into a outer ul/ol-container.
|
||||
|
||||
license: MIT-style X11
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Renderer.BlockRenderer]
|
||||
...
|
||||
*/
|
||||
EJS.Renderer.BlockRenderer = new Class({
|
||||
Implements: Options,
|
||||
|
||||
options : {
|
||||
hover : 'hoverEnabled',
|
||||
oddClassname: 'odd',
|
||||
evenClassname: 'even',
|
||||
showLinenumbers: true
|
||||
},
|
||||
|
||||
textFilter: null,
|
||||
|
||||
initialize : function(options, textFilter){
|
||||
this.setOptions(options);
|
||||
this.textFilter = textFilter;
|
||||
},
|
||||
|
||||
/**
|
||||
* Renders the generated Tokens
|
||||
*
|
||||
* @param {Language} language The Language used when parsing.
|
||||
* @param {SpecialLineHighlighter} specialLines Instance to define the lines to highlight
|
||||
* @return {Element} The renderer output
|
||||
*/
|
||||
render : function(language, specialLines, localOptions){
|
||||
// elememt shortcut
|
||||
var _el = EJS.Dom.Element;
|
||||
|
||||
// create new outer container element - use ol tag if lineNumbers are enabled. element attribute settings are priorized
|
||||
var container = null;
|
||||
if (localOptions.lineNumbers != null){
|
||||
container = new _el((localOptions.lineNumbers.toLowerCase() === 'true') ? 'ol' : 'ul');
|
||||
}else{
|
||||
container = new _el(this.options.showLinenumbers ? 'ol' : 'ul');
|
||||
}
|
||||
|
||||
// add "start" attribute ?
|
||||
if ((localOptions.lineNumbers || this.options.showLinenumbers) && localOptions.lineOffset && localOptions.lineOffset.toInt() > 1){
|
||||
container.set('start', localOptions.lineOffset);
|
||||
}
|
||||
|
||||
// line number count
|
||||
var lineCounter = 1;
|
||||
|
||||
var tokens = language.getTokens();
|
||||
|
||||
var odd = ' ' + this.options.oddClassname || '';
|
||||
var even = ' ' + this.options.evenClassname || '';
|
||||
|
||||
// current line element
|
||||
var currentLine = new _el('li', {
|
||||
'class': (specialLines.isSpecialLine(lineCounter) ? 'specialline' : '') + odd
|
||||
});
|
||||
|
||||
// output filter
|
||||
var addFragment = (function(className, text){
|
||||
currentLine.grab(new _el('span', {
|
||||
'class': className,
|
||||
'text': this.textFilter.filterOutput(text)
|
||||
}));
|
||||
}.bind(this));
|
||||
|
||||
// generate output based on ordered list of tokens
|
||||
Array.each(tokens, function(token){
|
||||
// split the token into lines
|
||||
var lines = token.text.split('\n');
|
||||
|
||||
// linebreaks found ?
|
||||
if (lines.length > 1){
|
||||
// just add the first line
|
||||
addFragment(token.alias, lines.shift());
|
||||
|
||||
// generate element for each line
|
||||
Array.each(lines, function(line, lineNumber){
|
||||
// grab old line into output container
|
||||
container.grab(currentLine);
|
||||
|
||||
// new line
|
||||
lineCounter++;
|
||||
|
||||
// create new line, add special line classes; add odd/even classes
|
||||
currentLine = new _el('li', {
|
||||
'class': (specialLines.isSpecialLine(lineCounter) ? 'specialline' : '') + (lineCounter%2==0 ? even: odd)
|
||||
});
|
||||
|
||||
// create new token-element
|
||||
addFragment(token.alias, line);
|
||||
});
|
||||
}else{
|
||||
addFragment(token.alias, token.text);
|
||||
}
|
||||
});
|
||||
|
||||
// grab last line into container
|
||||
container.grab(currentLine);
|
||||
|
||||
// highlight lines ?
|
||||
if (this.options.hover && this.options.hover != "NULL"){
|
||||
// add hover enable class
|
||||
container.addClass(this.options.hover);
|
||||
}
|
||||
|
||||
return container;
|
||||
}
|
||||
});
|
52
EnlighterJS/Source/Renderer/InlineRenderer.js
Normal file
52
EnlighterJS/Source/Renderer/InlineRenderer.js
Normal file
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
---
|
||||
description: Compiles an array of tokens into inline elements, grabbed into a outer container.
|
||||
|
||||
license: MIT-style X11
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Renderer.InlineRenderer]
|
||||
...
|
||||
*/
|
||||
EJS.Renderer.InlineRenderer = new Class({
|
||||
Implements: Options,
|
||||
|
||||
options : {
|
||||
inlineContainerTag : 'span'
|
||||
},
|
||||
|
||||
textFilter: null,
|
||||
|
||||
initialize : function(options, textFilter){
|
||||
this.setOptions(options);
|
||||
this.textFilter = textFilter;
|
||||
},
|
||||
|
||||
/**
|
||||
* Renders the generated Tokens
|
||||
*
|
||||
* @param {Language} language The Language used when parsing.
|
||||
* @param {SpecialLineHighlighter} specialLines Instance to define the lines to highlight
|
||||
* @return {Element} The renderer output
|
||||
*/
|
||||
render : function(language, specialLines, localOptions){
|
||||
// create output container element
|
||||
var container = new EJS.Dom.Element(this.options.inlineContainerTag);
|
||||
|
||||
// generate output based on ordered list of tokens
|
||||
language.getTokens().each(function(token, index){
|
||||
// create new inline element which contains the token - htmlspecialchars get escaped by mootools setText !
|
||||
container.grab(new EJS.Dom.Element('span', {
|
||||
'class': token.alias,
|
||||
'text': this.textFilter.filterOutput(token.text)
|
||||
}));
|
||||
}, this);
|
||||
|
||||
return container;
|
||||
}
|
||||
});
|
72
EnlighterJS/Source/SpecialLineHighlighter.js
Normal file
72
EnlighterJS/Source/SpecialLineHighlighter.js
Normal file
|
@ -0,0 +1,72 @@
|
|||
/*
|
||||
---
|
||||
name: Special Line Highlighter
|
||||
description: Highlights special lines
|
||||
|
||||
license: MIT-style X11 License
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.SpecialLineHighlighter]
|
||||
...
|
||||
*/
|
||||
EJS.SpecialLineHighlighter = new Class({
|
||||
|
||||
// storage of line numbers to highlight
|
||||
specialLines: {},
|
||||
|
||||
/**
|
||||
* @constructs
|
||||
* @param {String} html attribute content "highlight" - scheme 4,5,6,10-12,19
|
||||
*/
|
||||
initialize : function(lineNumberString, lineOffsetString){
|
||||
// special lines given ?
|
||||
if (lineNumberString == null || lineNumberString.length == 0){
|
||||
return;
|
||||
}
|
||||
|
||||
// line offset available ?
|
||||
var lineOffset = (lineOffsetString != null && lineOffsetString.toInt() > 1 ? lineOffsetString.toInt()-1 : 0);
|
||||
|
||||
// split attribute string into segments
|
||||
var segments = lineNumberString.split(',');
|
||||
|
||||
// iterate over segments
|
||||
segments.each(function(item, index){
|
||||
// pattern xxxx-yyyy
|
||||
var parts = item.match(/([0-9]+)-([0-9]+)/);
|
||||
|
||||
// single line or line-range
|
||||
if (parts!=null){
|
||||
// 2 items required
|
||||
var start = parts[1].toInt()-lineOffset;
|
||||
var stop = parts[2].toInt()-lineOffset;
|
||||
|
||||
// valid range ?
|
||||
if (stop > start){
|
||||
// add lines to storage
|
||||
for (var i=start;i<=stop;i++){
|
||||
this.specialLines['l' + i] = true;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
// add line to storage
|
||||
this.specialLines['l' + (item.toInt()-lineOffset)] = true;
|
||||
}
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
/**
|
||||
* Check if the given linenumber is a special line
|
||||
* @param Integer lineNumber
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isSpecialLine: function(lineNumber){
|
||||
return (this.specialLines['l' + lineNumber] || false);
|
||||
}
|
||||
|
||||
});
|
58
EnlighterJS/Source/TextFilter.js
Normal file
58
EnlighterJS/Source/TextFilter.js
Normal file
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
---
|
||||
description: Filters the RAW Code from given pre tags
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.TextFilter]
|
||||
...
|
||||
*/
|
||||
EJS.TextFilter = new Class({
|
||||
|
||||
Implements: Options,
|
||||
|
||||
options: {
|
||||
cryptex: {
|
||||
enabled: false,
|
||||
email: 'protected.email@example.tld'
|
||||
}
|
||||
},
|
||||
|
||||
initialize: function (options) {
|
||||
this.setOptions(options);
|
||||
},
|
||||
/**
|
||||
* Apply Filter to text fragments output)
|
||||
* @param textFragment
|
||||
*/
|
||||
filterOutput: function(textFragment){
|
||||
return textFragment;
|
||||
},
|
||||
|
||||
/**
|
||||
* Apply filter to the input chain (text block)
|
||||
* @param text
|
||||
* @returns {*}
|
||||
*/
|
||||
filterInput: function(text){
|
||||
|
||||
// apply cryptex email address filter ?
|
||||
if (this.options.cryptex.enabled===true){
|
||||
text = text.replace(/<!--CTX!--><span (rel="([a-f0-9]+)")?[\s\S]*?<!--\/CTX!-->/gim, function(match, m1, m2, offset, string){
|
||||
if (m2 && m2.length>2 && typeof window.Cryptex != 'undefined') {
|
||||
return window.Cryptex.decode(m2);
|
||||
}else{
|
||||
return this.options.cryptex.email;
|
||||
}
|
||||
}.bind(this));
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
});
|
143
EnlighterJS/Source/Themes/Atomic.css
Normal file
143
EnlighterJS/Source/Themes/Atomic.css
Normal file
|
@ -0,0 +1,143 @@
|
|||
/*
|
||||
---
|
||||
description: Dracula - Inspired by ATOM default Theme
|
||||
|
||||
license: MIT-style X11
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
styles:
|
||||
base:
|
||||
font-family: "Inconsolata", "Consolas", "Source Code Pro", "Courier New", Courier, monospace;
|
||||
font-size: 17px
|
||||
color: '#cfd5e0'
|
||||
line:
|
||||
font-family: "Inconsolata", "Consolas", "Source Code Pro", "Courier New", Courier, monospace;
|
||||
font-size: 12px
|
||||
line-height: 19px
|
||||
color: '#cfd5e0'
|
||||
raw:
|
||||
font-family: "Inconsolata", "Consolas", "Source Code Pro", "Courier New", Courier, monospace;
|
||||
font-size: 17px
|
||||
line-height: 22px
|
||||
color: '#cfd5e0'
|
||||
background-color: '#272b33'
|
||||
hover:
|
||||
background-color: '#2e353e'
|
||||
specialline:
|
||||
background-color: '#282e36'
|
||||
...
|
||||
*/
|
||||
|
||||
.atomicEnlighterJS, .atomicEnlighterJSWrapper, .atomicEnlighterJSTabPane{
|
||||
font-family: "Inconsolata", "Consolas", "Source Code Pro", "Courier New", Courier, monospace;
|
||||
}
|
||||
|
||||
/* Inline specific styles */
|
||||
span.atomicEnlighterJS{
|
||||
background-color: #272b32;
|
||||
padding: 3px 5px 3px 5px;
|
||||
}
|
||||
|
||||
/* LIST specific styles (BLOCK) */
|
||||
ol.atomicEnlighterJS, ul.atomicEnlighterJS, .atomicEnlighterJSWrapper pre{
|
||||
font-size: 12px;
|
||||
background-color: #272b33;
|
||||
}
|
||||
.atomicEnlighterJSWrapper pre{
|
||||
font-size: 17px;
|
||||
line-height: 22px;
|
||||
color: #cfd5e0;
|
||||
}
|
||||
|
||||
/* line styles */
|
||||
ol.atomicEnlighterJS li, ul.atomicEnlighterJS li{
|
||||
border: solid 0px #ffffff;
|
||||
line-height: 19px;
|
||||
color: #2b333a;
|
||||
background-color: transparent;
|
||||
padding: 0px 10px 0px 10px;
|
||||
}
|
||||
ol.atomicEnlighterJS li{
|
||||
list-style: decimal inside;
|
||||
color: #596174;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
/* default symbol styles */
|
||||
.atomicEnlighterJS span{
|
||||
font-size: 17px;
|
||||
color: #cfd5e0;
|
||||
}
|
||||
/* Symbol Styles */
|
||||
/* Delimiter e.g. <?php ?> */
|
||||
.atomicEnlighterJS .de1 { color: #9b0d5c; font-weight: bold; }
|
||||
.atomicEnlighterJS .de2 { color: #9b0d5c; font-weight: bold; }
|
||||
|
||||
/* Laanguage Kewords */
|
||||
.atomicEnlighterJS .kw1 { color: #d171dd; font-weight: bold; }
|
||||
.atomicEnlighterJS .kw2 { color: #d19252; border-bottom: dotted 1px #d19252;}
|
||||
.atomicEnlighterJS .kw3 { color: #4284ae; }
|
||||
.atomicEnlighterJS .kw4 { color: #ae42a0; }
|
||||
|
||||
/* Comments */
|
||||
.atomicEnlighterJS .co1 { color: #6b7c8b; }
|
||||
.atomicEnlighterJS .co2 { color: #5b7c9c; }
|
||||
|
||||
/* Strings */
|
||||
.atomicEnlighterJS .st0 { color: #7cc379; }
|
||||
.atomicEnlighterJS .st1 { color: #7cc379; }
|
||||
.atomicEnlighterJS .st2 { color: #5e860f; }
|
||||
|
||||
/* Numbers */
|
||||
.atomicEnlighterJS .nu0 { color: #D19A66; }
|
||||
|
||||
.atomicEnlighterJS .me0 { color: #4284ae; }
|
||||
.atomicEnlighterJS .me1 { color: #4284ae; }
|
||||
|
||||
/* Brackets */
|
||||
.atomicEnlighterJS .br0 { color: #6b7c8b; font-weight: bold; }
|
||||
|
||||
/* Symbols */
|
||||
.atomicEnlighterJS .sy0 { }
|
||||
|
||||
/* Escape Sequences */
|
||||
.atomicEnlighterJS .es0 { }
|
||||
|
||||
/* Regular Expression outside Strings */
|
||||
.atomicEnlighterJS .re0 { color: #d2901d}
|
||||
|
||||
/* hover effect */
|
||||
ol.atomicEnlighterJS.hoverEnabled li:hover, ul.atomicEnlighterJS.hoverEnabled li:hover {
|
||||
background-color: #2e353e;
|
||||
}
|
||||
/* special line highlight color */
|
||||
ol.atomicEnlighterJS li.specialline, ul.atomicEnlighterJS li.specialline {
|
||||
background-color: #282e36;
|
||||
}
|
||||
|
||||
/* Tab Pane */
|
||||
.atomicEnlighterJSTabPane .controls{
|
||||
background-color: #121518;
|
||||
padding: 5px 0px 0px 0px;
|
||||
}
|
||||
.atomicEnlighterJSTabPane .controls ul{
|
||||
margin-left: 10px;
|
||||
}
|
||||
.atomicEnlighterJSTabPane .controls li{
|
||||
border-radius: 0px;
|
||||
background-color: transparent;
|
||||
line-height: 25px;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #f0f0f0;
|
||||
border-radius: 5px 5px 0px 0px;
|
||||
text-transform: lowercase;
|
||||
}
|
||||
.atomicEnlighterJSTabPane .controls li:hover {
|
||||
|
||||
}
|
||||
.atomicEnlighterJSTabPane .controls li.selected{
|
||||
background-color: #272b33;
|
||||
}
|
194
EnlighterJS/Source/Themes/Base.css
Normal file
194
EnlighterJS/Source/Themes/Base.css
Normal file
|
@ -0,0 +1,194 @@
|
|||
/*
|
||||
---
|
||||
description: EnlighterJS Theme-Base - All Themes are derived from these styles! Don't edit this file if you wan't to change styles! Use a derived theme!
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
...
|
||||
*/
|
||||
/* Font Classes
|
||||
----------------------------------------------------------------------------------- */
|
||||
/* BASE Styles
|
||||
----------------------------------------------------------------------------------- */
|
||||
.EnlighterJS,
|
||||
.EnlighterJSWrapper {
|
||||
font-family: "Source Code Pro", "Liberation Mono", "Courier New", Courier, monospace;
|
||||
font-size: 10px;
|
||||
line-height: 16px;
|
||||
overflow: auto;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
/* Wrapper/Container - contains all elements of an instance */
|
||||
.EnlighterJSWrapper {
|
||||
position: relative;
|
||||
/* RAW Styles */
|
||||
/* Show Toolbar on Mouseover */
|
||||
}
|
||||
.EnlighterJSWrapper pre {
|
||||
font-family: inherit;
|
||||
background-color: #ffffff;
|
||||
padding: 5px 5px 5px 10px;
|
||||
margin: 0px 0px 20px 0px;
|
||||
line-height: 18px;
|
||||
font-size: 12px;
|
||||
color: #444444;
|
||||
border: none;
|
||||
border-radius: 0px;
|
||||
clear: none;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
.EnlighterJSWrapper:hover .EnlighterJSToolbar {
|
||||
display: block;
|
||||
}
|
||||
/* Highlighted Object (List or Span)
|
||||
----------------------------------------------------------------------------------- */
|
||||
.EnlighterJS {
|
||||
/* Inline specific styles */
|
||||
/* LIST specific styles */
|
||||
/* Line Number Styles */
|
||||
/* default symbol style */
|
||||
}
|
||||
span.EnlighterJS {
|
||||
padding: 3px 5px 1px 5px;
|
||||
border: solid 1px #e0e0e0;
|
||||
color: #333333;
|
||||
background-color: #f7f7f7;
|
||||
margin: 0px 2px 0px 2px;
|
||||
}
|
||||
ol.EnlighterJS,
|
||||
ul.EnlighterJS {
|
||||
display: block;
|
||||
font-size: 10px;
|
||||
background-color: #f2f2f2;
|
||||
color: #939393;
|
||||
margin: 0px 0px 20px 0px;
|
||||
padding: 0px;
|
||||
text-indent: 0px;
|
||||
list-style: none;
|
||||
/* line styles */
|
||||
}
|
||||
ol.EnlighterJS li,
|
||||
ul.EnlighterJS li {
|
||||
margin: 0px;
|
||||
background-color: #ffffff;
|
||||
border: solid 0px #ffffff;
|
||||
padding: 0px 5px 0px 14px;
|
||||
line-height: 14px;
|
||||
color: #939393;
|
||||
list-style: none;
|
||||
font-size: inherit;
|
||||
/* special line highlight color */
|
||||
/* top+bottom offsets */
|
||||
}
|
||||
ol.EnlighterJS li .specialline,
|
||||
ul.EnlighterJS li .specialline {
|
||||
background-color: #F4F8FC;
|
||||
}
|
||||
ol.EnlighterJS li:FIRST-CHILD,
|
||||
ul.EnlighterJS li:FIRST-CHILD {
|
||||
padding-top: 5px;
|
||||
}
|
||||
ol.EnlighterJS li:LAST-CHILD,
|
||||
ul.EnlighterJS li:LAST-CHILD {
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
ol.EnlighterJS li:AFTER,
|
||||
ul.EnlighterJS li:AFTER {
|
||||
content: ' ';
|
||||
}
|
||||
ol.EnlighterJS li {
|
||||
list-style: decimal-leading-zero outside;
|
||||
margin-left: 40px;
|
||||
padding-left: 20px;
|
||||
}
|
||||
.EnlighterJS span {
|
||||
color: #000000;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
line-height: inherit;
|
||||
font-size: 12px;
|
||||
font-family: inherit;
|
||||
}
|
||||
/* TAB Panel - containing "buttons" to switch between multiple codeblocks
|
||||
----------------------------------------------------------------------------------- */
|
||||
.EnlighterJSTabPane {
|
||||
/* Button List */
|
||||
}
|
||||
.EnlighterJSTabPane .controls ul {
|
||||
margin: 0px 0px 0px 40px;
|
||||
padding: 0px;
|
||||
}
|
||||
.EnlighterJSTabPane .controls li {
|
||||
display: inline-block;
|
||||
list-style: none;
|
||||
padding: 3px 10px 3px 10px;
|
||||
margin: 0px 5px 0px 5px;
|
||||
background-color: #f2f2f2;
|
||||
border-radius: 5px;
|
||||
font-size: 12px;
|
||||
color: #000000;
|
||||
font-family: inherit;
|
||||
cursor: pointer;
|
||||
}
|
||||
.EnlighterJSTabPane .controls .pane {
|
||||
padding: 5px 0px 0px 0px;
|
||||
clear: left;
|
||||
}
|
||||
/* Toolbar - containing buttons
|
||||
----------------------------------------------------------------------------------- */
|
||||
.EnlighterJSToolbar {
|
||||
position: absolute;
|
||||
display: none;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
height: 40px;
|
||||
width: auto;
|
||||
padding: 15px;
|
||||
/* Button Container */
|
||||
}
|
||||
.EnlighterJSToolbar > a {
|
||||
float: right;
|
||||
display: block;
|
||||
border-radius: 3px;
|
||||
z-index: 10;
|
||||
background-color: #ffffff;
|
||||
color: #717171;
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
padding: 0px;
|
||||
border: solid 1px #e0e0e0;
|
||||
margin: 0px 0px 0px 8px;
|
||||
text-decoration: none;
|
||||
width: 23px;
|
||||
height: 23px;
|
||||
background-position: 0px 0px;
|
||||
background-size: contain;
|
||||
font-family: inherit;
|
||||
/* Show Toolbar on MouseOver */
|
||||
/* CLear Float Layout */
|
||||
}
|
||||
.EnlighterJSToolbar > a:HOVER {
|
||||
text-decoration: none;
|
||||
border-color: #b0b0b0;
|
||||
}
|
||||
.EnlighterJSToolbar > a .clear {
|
||||
clear: right;
|
||||
content: ' ';
|
||||
display: block;
|
||||
}
|
||||
/* Button Icons */
|
||||
.EnlighterJSWindowButton {
|
||||
background-image: url("data:image/gif;base64,R0lGODlhLgAuAKIAADtJcYuWq6Wxw/L7/9Xz/+z6/////wAAACwAAAAALgAuAAAD02i63P4wykmrvTjrzbv/YCiOZCacaKquace+sOAKRG3feH7Oee/vnJNveANuhLWAcslsOpkYJOFJrQaitGSAyFVibUou0XuRhgmFtHrNXpMt5i26TWe/K/FaHQCoF+4UeXNtfH6AE4J7fXWHEol0hYxXZVlTcoqGk3CVZ5hsA6CNEY98paanoAOiEKSnrnypqw+PhIt0sg60bJG3mnicl5C2bbgNumu8xL6BKZ3CmVgozrXQHNN+vR3X2HbLGNvcasURVuVQ1ubmJevs7e7v8PHy7QkAOw==");
|
||||
}
|
||||
.EnlighterJSRawButton {
|
||||
background-image: url("data:image/gif;base64,R0lGODlhLgAuALMAADtJcez6/////7e3t6urq52dnXt7e3p6enFxcW1tbWdnZ2VlZQAAAAAAAAAAAAAAACwAAAAALgAuAAAE4lDISau9OOvNu/9gKI5kaZ6Zoa5sy6KTK7uwNN9qLahB7/+/gjCH4gGPPWGBeDICntBoj0AdGpqGXnQLmFaXV5MRCaQSrKfDgXwcuL/qA0nNBroHcPV8Xe/rR3R9dX8iCAiCdYYkhohsiiOMjUiPhYeSR5QhkVycUj2ZIJudnT6gH5GXP6YeCQmpQK0kra8/sSOzAaNdbLYiuLp1vSG4tAHCIAoKxT3JJMnLAc0jz8vSItS6nD7WIQsLWtlbPt4k3tDkI+bL6CLqxezd3vLz9PX05fb5+gs6/f7/AAMKHEgQQwQAOw==");
|
||||
}
|
||||
.EnlighterJSInfoButton {
|
||||
background-image: url("data:image/gif;base64,R0lGODlhLgAuALMAAL7C0MvO2aSqvbG2xjtJcUhVelVhhGJtjYmSqtjb4/Lz9m96l3yGoJaes+Xn7P///ywAAAAALgAuAAAEqvDJSau9OOvNu/9gKI5kaZ5o6ilB675wkKhSQNx4rhMN/Qi7IG7gQwiFAd/hGPQ9doeFdDpl+BI7pwagM2gzwJz1e1noBOSLQQdIW3Yz98Smo9oRzjATt3A29jloPmaAN0Q+BYU3cSoOOzEvTnQ4BXIUejd9lhJGOT2bD0s5h5uPoFg6oA9cOQWQLg4+mIBtNISKjClrigROvASaKpOFeKrGx8jJysvMzcgRADs=");
|
||||
}
|
215
EnlighterJS/Source/Themes/Base.less
Normal file
215
EnlighterJS/Source/Themes/Base.less
Normal file
|
@ -0,0 +1,215 @@
|
|||
/*
|
||||
---
|
||||
description: EnlighterJS Theme-Base - All Themes are derived from these styles! Don't edit this file if you wan't to change styles! Use a derived theme!
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
...
|
||||
*/
|
||||
|
||||
/* Font Classes
|
||||
----------------------------------------------------------------------------------- */
|
||||
@font_SourceCodePro: "Source Code Pro", "Liberation Mono", "Courier New", Courier, monospace;
|
||||
@font_Consolas: Consolas, @font_SourceCodePro;
|
||||
|
||||
/* BASE Styles
|
||||
----------------------------------------------------------------------------------- */
|
||||
.EnlighterJS, .EnlighterJSWrapper {
|
||||
font-family: @font_SourceCodePro;
|
||||
font-size: 10px;
|
||||
line-height: 16px;
|
||||
overflow: auto;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
/* Wrapper/Container - contains all elements of an instance */
|
||||
.EnlighterJSWrapper {
|
||||
position: relative;
|
||||
|
||||
/* RAW Styles */
|
||||
pre {
|
||||
font-family: inherit;
|
||||
background-color: #ffffff;
|
||||
padding: 5px 5px 5px 10px;
|
||||
margin: 0px 0px 20px 0px;
|
||||
line-height: 18px;
|
||||
font-size: 12px;
|
||||
color: #444444;
|
||||
border: none;
|
||||
border-radius: 0px;
|
||||
clear: none;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
/* Show Toolbar on Mouseover */
|
||||
&:hover .EnlighterJSToolbar {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
/* Highlighted Object (List or Span)
|
||||
----------------------------------------------------------------------------------- */
|
||||
.EnlighterJS{
|
||||
/* Inline specific styles */
|
||||
span& {
|
||||
padding: 3px 5px 1px 5px;
|
||||
border: solid 1px #e0e0e0;
|
||||
color: #333333;
|
||||
background-color: #f7f7f7;
|
||||
margin: 0px 2px 0px 2px;
|
||||
}
|
||||
|
||||
/* LIST specific styles */
|
||||
ol&, ul& {
|
||||
display: block;
|
||||
color: #939393;
|
||||
font-size: 10px;
|
||||
background-color: #f2f2f2;
|
||||
color: #939393;
|
||||
margin: 0px 0px 20px 0px;
|
||||
padding: 0px;
|
||||
text-indent: 0px;
|
||||
list-style: none;
|
||||
|
||||
/* line styles */
|
||||
li{
|
||||
margin: 0px;
|
||||
background-color: #ffffff;
|
||||
border: solid 0px #ffffff;
|
||||
padding: 0px 5px 0px 14px;
|
||||
line-height: 14px;
|
||||
color: #939393;
|
||||
list-style: none;
|
||||
font-size: inherit;
|
||||
|
||||
/* special line highlight color */
|
||||
.specialline {
|
||||
background-color: #F4F8FC;
|
||||
}
|
||||
|
||||
/* top+bottom offsets */
|
||||
&:FIRST-CHILD {
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
&:LAST-CHILD {
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
&:AFTER {
|
||||
content: ' ';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Line Number Styles */
|
||||
ol& li {
|
||||
list-style: decimal-leading-zero outside;
|
||||
margin-left: 40px;
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
/* default symbol style */
|
||||
span {
|
||||
color: #000000;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
line-height: inherit;
|
||||
font-size: 12px;
|
||||
font-family: inherit;
|
||||
}
|
||||
}
|
||||
|
||||
/* TAB Panel - containing "buttons" to switch between multiple codeblocks
|
||||
----------------------------------------------------------------------------------- */
|
||||
.EnlighterJSTabPane{
|
||||
/* Button List */
|
||||
.controls{
|
||||
ul {
|
||||
margin: 0px 0px 0px 40px;
|
||||
padding: 0px;
|
||||
}
|
||||
li {
|
||||
display: inline-block;
|
||||
list-style: none;
|
||||
padding: 3px 10px 3px 10px;
|
||||
margin: 0px 5px 0px 5px;
|
||||
background-color: #f2f2f2;
|
||||
border-radius: 5px;
|
||||
font-size: 12px;
|
||||
color: #000000;
|
||||
font-family: inherit;
|
||||
cursor: pointer;
|
||||
}
|
||||
.pane {
|
||||
padding: 5px 0px 0px 0px;
|
||||
clear: left;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Toolbar - containing buttons
|
||||
----------------------------------------------------------------------------------- */
|
||||
.EnlighterJSToolbar {
|
||||
position: absolute;
|
||||
display: none;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
height: 40px;
|
||||
width: auto;
|
||||
padding: 15px;
|
||||
|
||||
/* Button Container */
|
||||
> a {
|
||||
float: right;
|
||||
display: block;
|
||||
border-radius: 3px;
|
||||
z-index: 10;
|
||||
background-color: #ffffff;
|
||||
color: #717171;
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
padding: 0px;
|
||||
border: solid 1px #e0e0e0;
|
||||
margin: 0px 0px 0px 8px;
|
||||
text-decoration: none;
|
||||
width: 23px;
|
||||
height: 23px;
|
||||
background-position: 0px 0px;
|
||||
background-size: contain;
|
||||
font-family: inherit;
|
||||
|
||||
/* Show Toolbar on MouseOver */
|
||||
&:HOVER {
|
||||
text-decoration: none;
|
||||
border-color: #b0b0b0;
|
||||
}
|
||||
|
||||
/* CLear Float Layout */
|
||||
.clear {
|
||||
clear: right;
|
||||
content: ' ';
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Button Icons */
|
||||
.EnlighterJSWindowButton {
|
||||
background-image: data-uri('new_window1.gif');
|
||||
}
|
||||
.EnlighterJSRawButton {
|
||||
background-image: data-uri('raw_code1.gif');
|
||||
}
|
||||
.EnlighterJSInfoButton {
|
||||
background-image: data-uri('info.gif');
|
||||
}
|
||||
|
||||
|
147
EnlighterJS/Source/Themes/Beyond.css
Normal file
147
EnlighterJS/Source/Themes/Beyond.css
Normal file
|
@ -0,0 +1,147 @@
|
|||
/*
|
||||
---
|
||||
description: Beyond-Technology Theme - Inspired by GitHub & Bootstrap colors;
|
||||
|
||||
license: MIT-style X11
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
styles:
|
||||
base:
|
||||
font-family: "Source Code Pro", "Courier New", Courier, monospace
|
||||
font-size: 12px
|
||||
color: '#000000'
|
||||
line:
|
||||
font-family: "Source Code Pro", "Courier New", Courier, monospace
|
||||
font-size: 11px
|
||||
line-height: 18px
|
||||
color: '#aaaaaa'
|
||||
raw:
|
||||
font-family: "Source Code Pro", "Courier New", Courier, monospace
|
||||
font-size: 13px
|
||||
line-height: 20px
|
||||
color: '#333333'
|
||||
background-color: '#f7f7fa'
|
||||
hover:
|
||||
background-color: '#ffffe0'
|
||||
specialline:
|
||||
background-color: '#fff0f0'
|
||||
...
|
||||
*/
|
||||
|
||||
/* Inline specific styles */
|
||||
span.beyondEnlighterJS{
|
||||
border-radius: 3px;
|
||||
background-color: #f7f7fa;
|
||||
border: dotted 1px #e2e2e8;
|
||||
}
|
||||
|
||||
/* LIST specific styles */
|
||||
ol.beyondEnlighterJS, ul.beyondEnlighterJS, .beyondEnlighterJSWrapper pre{
|
||||
font-size: 11px;
|
||||
color: #333333;
|
||||
background-color: #f7f7fa;
|
||||
border-radius: 5px;
|
||||
border: solid 2px #e2e2e8;
|
||||
padding: 10px 10px 10px 5px;
|
||||
}
|
||||
|
||||
/* line styles */
|
||||
ol.beyondEnlighterJS li, ul.beyondEnlighterJS li{
|
||||
border: solid 0px #ffffff;
|
||||
padding: 1px 5px 1px 10px;
|
||||
line-height: 18px;
|
||||
color: #aaaaaa;
|
||||
background-color: #f7f7fa;
|
||||
margin-left: 0px;
|
||||
}
|
||||
ol.beyondEnlighterJS li:FIRST-CHILD, ol.beyondEnlighterJS li:LAST-CHILD{
|
||||
padding-top: 0px;
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
|
||||
ol.beyondEnlighterJS li{
|
||||
list-style: decimal inside;
|
||||
border-left: 0px solid #e0e0e0;
|
||||
padding: 1px 5px 1px 15px;
|
||||
}
|
||||
|
||||
|
||||
/* special line highlight color */
|
||||
ol.beyondEnlighterJS li.specialline, ul.beyondEnlighterJS li.specialline {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
/* hover effect */
|
||||
ol.beyondEnlighterJS.hoverEnabled li:hover, ul.beyondEnlighterJS.hoverEnabled li:hover {
|
||||
background-color: #ffffff;
|
||||
border: solid 0px #ffffff;
|
||||
color: #444444;
|
||||
}
|
||||
|
||||
.beyondEnlighterJS span{
|
||||
font-size: 13px;
|
||||
color: #2f3235;
|
||||
}
|
||||
|
||||
/* symbol styles */
|
||||
.beyondEnlighterJS .de1 { color: #CF6A4C; }
|
||||
.beyondEnlighterJS .de2 { color: #CF6A4C; }
|
||||
.beyondEnlighterJS .kw1 { color: #286491; }
|
||||
.beyondEnlighterJS .kw2 { color: #4da0d2; }
|
||||
.beyondEnlighterJS .kw3 { color: #445588; }
|
||||
.beyondEnlighterJS .kw4 { color: #990073; }
|
||||
.beyondEnlighterJS .co1 { color: #8181a1; }
|
||||
.beyondEnlighterJS .co2 { color: #8181a1; }
|
||||
.beyondEnlighterJS .st0 { color: #dd1144; }
|
||||
.beyondEnlighterJS .st1 { color: #dd1144; }
|
||||
.beyondEnlighterJS .st2 { color: #049595; }
|
||||
.beyondEnlighterJS .nu0 { color: #009999; }
|
||||
.beyondEnlighterJS .me0 { color: #0086b3; }
|
||||
.beyondEnlighterJS .me1 { color: #0086b3; }
|
||||
.beyondEnlighterJS .br0 { color: #777; }
|
||||
.beyondEnlighterJS .sy0 { color: #777; }
|
||||
.beyondEnlighterJS .es0 { color: #777; }
|
||||
.beyondEnlighterJS .re0 { color: #009926; }
|
||||
|
||||
/* Tab Panel */
|
||||
.beyondEnlighterJSTabPane .controls{
|
||||
background-color: transparent;
|
||||
padding: 5px 5px 0px 5px;
|
||||
}
|
||||
.beyondEnlighterJSTabPane .controls ul{
|
||||
margin-left: 20px;
|
||||
}
|
||||
.beyondEnlighterJSTabPane .controls li {
|
||||
border-radius: 5px 5px 0px 0px;
|
||||
border: solid 2px #e2e2e8;
|
||||
border-bottom-width: 0px;
|
||||
font-size: 12px;
|
||||
color: #286491;
|
||||
font-weight: bold;
|
||||
background-color: #ffffff;
|
||||
cursor: pointer;
|
||||
}
|
||||
.beyondEnlighterJSTabPane .controls li:hover {
|
||||
background-color: transparent;
|
||||
}
|
||||
.beyondEnlighterJSTabPane .controls .selected,.beyondEnlighterJSTabPane .controls .selected:hover{
|
||||
background-color: #e2e2e8;
|
||||
border-color: #d8d8dd;
|
||||
color: #505050;
|
||||
}
|
||||
.beyondEnlighterJSTabPane .beyondEnlighterJS, .beyondEnlighterJSTabPane pre{
|
||||
border-radius: 8px;
|
||||
}
|
||||
.beyondEnlighterJSTabPane .pane{
|
||||
padding: 0px;
|
||||
}
|
||||
/* Raw Code Pane */
|
||||
.beyondEnlighterJSWrapper pre{
|
||||
background-color: #f7f7fa;
|
||||
font-size: 13px;
|
||||
color: #333333;
|
||||
line-height: 20px;
|
||||
padding: 15px;
|
||||
}
|
144
EnlighterJS/Source/Themes/Classic.css
Normal file
144
EnlighterJS/Source/Themes/Classic.css
Normal file
|
@ -0,0 +1,144 @@
|
|||
/*
|
||||
---
|
||||
description: SyntaxHighlighter inspired theme.
|
||||
|
||||
license: MIT Style X11 License
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
styles:
|
||||
base:
|
||||
font-family: "Source Code Pro", "Courier New", Courier, monospace
|
||||
font-size: 15px
|
||||
color: '#000000'
|
||||
background-color: '#f8f8f8'
|
||||
line:
|
||||
font-family: "Source Code Pro", "Courier New", Courier, monospace
|
||||
font-size: 14px
|
||||
line-height: 20px
|
||||
color: '#505050'
|
||||
odd: '#ffffff'
|
||||
even: '#f8f8f8'
|
||||
raw:
|
||||
font-family: "Source Code Pro", "Courier New", Courier, monospace
|
||||
font-size: 15px
|
||||
line-height: 20px
|
||||
color: '#000000'
|
||||
background-color: '#ffffff'
|
||||
hover:
|
||||
background-color: '#ddf0dd'
|
||||
specialline:
|
||||
background-color: '#edf9ec'
|
||||
...
|
||||
*/
|
||||
|
||||
/* line number background */
|
||||
ol.classicEnlighterJS, ul.classicEnlighterJS{
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
/* borders on top&botton */
|
||||
.classicEnlighterJS, .classicEnlighterJSWrapper pre{
|
||||
border: 1px solid #e8e8e2;
|
||||
}
|
||||
|
||||
ol.classicEnlighterJS li, ul.classicEnlighterJS li{
|
||||
border: none;
|
||||
border-left: solid 4px #52ce52;
|
||||
line-height: 20px;
|
||||
color: #505050;
|
||||
font-size: 14px;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
ol.classicEnlighterJS li.even, ul.classicEnlighterJS li.even{
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
/* inlline container style */
|
||||
span.classicEnlighterJS{
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* hover color */
|
||||
ol.classicEnlighterJS.hoverEnabled li:hover, ul.classicEnlighterJS.hoverEnabled li:hover{
|
||||
border: none;
|
||||
border-left: solid 4px #52ce52;
|
||||
background-color: #ddf0dd;
|
||||
}
|
||||
|
||||
/* special line highlight color */
|
||||
ol.classicEnlighterJS li.specialline, ul.classicEnlighterJS li.specialline {
|
||||
background-color: #edf9ec;
|
||||
border-left-color: #3fa03f;
|
||||
}
|
||||
|
||||
/* non leading zero */
|
||||
ol.classicEnlighterJS li {
|
||||
color: #000000;
|
||||
list-style-type: decimal;
|
||||
}
|
||||
.classicEnlighterJS span{
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
/** Symbol styles */
|
||||
.classicEnlighterJS .de2 { background-color: #e0e010; font-weight: bold; }
|
||||
.classicEnlighterJS .kw1 { color: #066da1; font-weight: bold; }
|
||||
.classicEnlighterJS .kw2 { color: #404247; font-weight: bold; }
|
||||
.classicEnlighterJS .kw3 { color: #404247;}
|
||||
.classicEnlighterJS .kw4 { color: #d53aa9; }
|
||||
.classicEnlighterJS .co1 { color: #888888; }
|
||||
.classicEnlighterJS .co2 { color: #888888; }
|
||||
.classicEnlighterJS .st0 { color: #2d47e6; }
|
||||
.classicEnlighterJS .st1 { color: #2d47e6; }
|
||||
.classicEnlighterJS .st2 { color: #d53aa9; font-weight: bold; }
|
||||
.classicEnlighterJS .nu0 { color: #d53aa9; }
|
||||
.classicEnlighterJS .me0 { color: #404247; }
|
||||
.classicEnlighterJS .me1 { color: #404247; }
|
||||
.classicEnlighterJS .br0 { color: #444444; }
|
||||
.classicEnlighterJS .sy0 { color: #444444; }
|
||||
.classicEnlighterJS .es0 { color: #444444; }
|
||||
.classicEnlighterJS .re0 { color: #009926; }
|
||||
|
||||
/* Raw Code Pane */
|
||||
.classicEnlighterJSWrapper pre{
|
||||
background-color: #ffffff;
|
||||
font-size: 15px;
|
||||
color: #000000;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
/* Button Styles */
|
||||
.classicEnlighterJSWrapper .EnlighterJSToolbar > a{
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
/* Tab Styles */
|
||||
.classicEnlighterJSTabPane .controls{
|
||||
background-color: #f8f8f8;
|
||||
height: 31px;
|
||||
border: 1px solid #e8e8e2;
|
||||
border-bottom-width: 0px;
|
||||
}
|
||||
.classicEnlighterJSTabPane .controls ul{
|
||||
margin: 0px 0px 0px 35px;
|
||||
}
|
||||
.classicEnlighterJSTabPane .controls li{
|
||||
border-radius: 0px;
|
||||
font-size: 15px;
|
||||
background-color: transparent;
|
||||
line-height: 20px;
|
||||
padding: 5px 10px 5px 10px;
|
||||
}
|
||||
.classicEnlighterJSTabPane .controls li.selected, .classicEnlighterJSTabPane .controls li.selected:hover{
|
||||
background-color: #52ce52;
|
||||
color: #f9f9f9;
|
||||
font-weight: bold;
|
||||
}
|
||||
.classicEnlighterJSTabPane .pane{
|
||||
padding: 0px;
|
||||
}
|
||||
.classicEnlighterJSTabPane .classicEnlighterJS{
|
||||
border-top-width: 0px;
|
||||
}
|
143
EnlighterJS/Source/Themes/Droide.css
Normal file
143
EnlighterJS/Source/Themes/Droide.css
Normal file
|
@ -0,0 +1,143 @@
|
|||
/*
|
||||
---
|
||||
description: Droide Theme
|
||||
|
||||
license: MIT-style X11
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
styles:
|
||||
base:
|
||||
font-family: Consolas, "Source Code Pro", "Liberation Mono", "Courier New", Courier, monospace
|
||||
font-size: 13px
|
||||
color: '#404141'
|
||||
line:
|
||||
font-family: Consolas, "Source Code Pro", "Liberation Mono", "Courier New", Courier, monospace
|
||||
font-size: 11px
|
||||
line-height: 18px
|
||||
color: '#707070'
|
||||
raw:
|
||||
font-family: Consolas, "Source Code Pro", "Liberation Mono", "Courier New", Courier, monospace
|
||||
font-size: 13px
|
||||
line-height: 18px
|
||||
color: '#404141'
|
||||
background-color: '#f7f7f9'
|
||||
hover:
|
||||
background-color: '#fae9d9'
|
||||
specialline:
|
||||
background-color: '#fae9d9'
|
||||
...
|
||||
*/
|
||||
.droideEnlighterJS, .droideEnlighterJSWrapper{
|
||||
font-family: Consolas, "Source Code Pro", "Liberation Mono", "Courier New", Courier, monospace;
|
||||
}
|
||||
/* Inline specific styles */
|
||||
span.droideEnlighterJS{
|
||||
background-color: #f7f7f9;
|
||||
border: solid 1px #e0e0e0;
|
||||
}
|
||||
|
||||
/* LIST specific styles */
|
||||
ol.droideEnlighterJS, ul.droideEnlighterJS, .droideEnlighterJSWrapper pre{
|
||||
font-size: 13px;
|
||||
color: #404141;
|
||||
border: solid 1px #e0e0e0;
|
||||
background-color: #f7f7f9;
|
||||
paddding: 10px;
|
||||
}
|
||||
|
||||
/* line styles */
|
||||
ol.droideEnlighterJS li, ul.droideEnlighterJS li{
|
||||
border: solid 0px #ffffff;
|
||||
padding: 1px 5px 1px 14px;
|
||||
line-height: 18px;
|
||||
color: #707070;
|
||||
background-color: #f7f7f9;
|
||||
font-size: 11px;
|
||||
}
|
||||
ol.droideEnlighterJS li{
|
||||
list-style: decimal outside;
|
||||
border-left: 1px dashed #e0e0e0;
|
||||
padding: 1px 5px 1px 14px;
|
||||
}
|
||||
|
||||
/* special line highlight color */
|
||||
ol.droideEnlighterJS li.specialline, ul.droideEnlighterJS li.specialline {
|
||||
background-color: #fae9d9;
|
||||
border-left: solid 5px #e07c19;
|
||||
}
|
||||
|
||||
/* hover effect */
|
||||
ol.droideEnlighterJS.hoverEnabled li:hover, ul.droideEnlighterJS.hoverEnabled li:hover {
|
||||
background-color: #fae9d9;
|
||||
}
|
||||
ol.droideEnlighterJS.hoverEnabled li:hover{
|
||||
border-left-width: 1px;
|
||||
}
|
||||
|
||||
.droideEnlighterJS span{
|
||||
font-size: 13px;
|
||||
}
|
||||
/* symbol styles */
|
||||
.droideEnlighterJS .de1 { color: #CF6A4C; }
|
||||
.droideEnlighterJS .de2 { color: #CF6A4C; }
|
||||
.droideEnlighterJS .kw1 { color: #12217c; font-weight: bold; }
|
||||
.droideEnlighterJS .kw2 { color: #6e0d6e; }
|
||||
.droideEnlighterJS .kw3 { color: #445588; }
|
||||
.droideEnlighterJS .kw4 { color: #990073; }
|
||||
.droideEnlighterJS .co1 { color: #086b08; }
|
||||
.droideEnlighterJS .co2 { color: #086b08; }
|
||||
.droideEnlighterJS .st0 { color: #961414; }
|
||||
.droideEnlighterJS .st1 { color: #963f14; }
|
||||
.droideEnlighterJS .st2 { color: #961414; }
|
||||
.droideEnlighterJS .nu0 { color: #009999; }
|
||||
.droideEnlighterJS .me0 { }
|
||||
.droideEnlighterJS .me1 { }
|
||||
.droideEnlighterJS .br0 { }
|
||||
.droideEnlighterJS .sy0 { }
|
||||
.droideEnlighterJS .es0 { }
|
||||
.droideEnlighterJS .re0 { color: #009926; }
|
||||
|
||||
/* Tab Panel */
|
||||
.droideEnlighterJSTabPane .controls{
|
||||
background-color: transparent;
|
||||
padding: 5px 5px 0px 5px;
|
||||
}
|
||||
.droideEnlighterJSTabPane .controls ul{
|
||||
margin: 0px;
|
||||
}
|
||||
.droideEnlighterJSTabPane .controls li {
|
||||
border: solid 1px #e0e0e0;
|
||||
font-size: 12px;
|
||||
color: #000000;
|
||||
background-color: transparent;
|
||||
cursor: pointer;
|
||||
border-radius: 0px;
|
||||
border-bottom-width: 0px;
|
||||
padding-bottom: 5px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.droideEnlighterJSTabPane .controls li:hover {
|
||||
background-color: transparent;
|
||||
}
|
||||
.droideEnlighterJSTabPane .controls .selected,.droideEnlighterJSTabPane .controls .selected:hover{
|
||||
background-color: #f7f7f9;
|
||||
color: #000000;
|
||||
border-color: #c9c9c9;
|
||||
}
|
||||
|
||||
.droideEnlighterJSTabPane .pane{
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
/* Raw Code Pane */
|
||||
.droideEnlighterJSWrapper pre{
|
||||
background-color: #ffffff;
|
||||
font-size: 13px;
|
||||
color: #717171;
|
||||
}
|
||||
|
||||
/* Raw Button */
|
||||
.droideEnlighterJSWrapper .EnlighterJSRawButton{
|
||||
}
|
142
EnlighterJS/Source/Themes/Eclipse.css
Normal file
142
EnlighterJS/Source/Themes/Eclipse.css
Normal file
|
@ -0,0 +1,142 @@
|
|||
/*
|
||||
---
|
||||
description: Eclipse inspired Theme
|
||||
|
||||
license: MIT-style X11
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
styles:
|
||||
base:
|
||||
font-family: "Source Code Pro", "Courier New", Courier, monospace
|
||||
font-size: 13px
|
||||
color: '#000000'
|
||||
line:
|
||||
font-family: "Source Code Pro", "Courier New", Courier, monospace
|
||||
font-size: 11px
|
||||
line-height: 16px
|
||||
color: '#787878'
|
||||
odd: '#ffffff'
|
||||
even: '#ffffff'
|
||||
raw:
|
||||
font-family: "Source Code Pro", "Courier New", Courier, monospace
|
||||
font-size: 13px
|
||||
line-height: 18px
|
||||
color: '#717171'
|
||||
background-color: '#ffffff'
|
||||
hover:
|
||||
background-color: '#e8f2fe'
|
||||
specialline:
|
||||
background-color: '#f9f9f9'
|
||||
...
|
||||
*/
|
||||
|
||||
/* Inline specific styles */
|
||||
span.eclipseEnlighterJS{
|
||||
border-radius: 3px;
|
||||
background-color: #f8f8f8;
|
||||
border: solid 0px #ffffff;
|
||||
}
|
||||
|
||||
/* LIST specific styles */
|
||||
ol.eclipseEnlighterJS, ul.eclipseEnlighterJS, .eclipseEnlighterJSWrapper pre{
|
||||
font-size: 11px;
|
||||
color: #939393;
|
||||
border-radius: 5px;
|
||||
border: solid 8px #f3f3f3;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
/* line styles */
|
||||
ol.eclipseEnlighterJS li, ul.eclipseEnlighterJS li{
|
||||
padding: 1px 5px 1px 14px;
|
||||
line-height: 16px;
|
||||
color: #787878;
|
||||
}
|
||||
ol.eclipseEnlighterJS li{
|
||||
list-style: decimal outside;
|
||||
border-left: 2px solid #f8f8f8;
|
||||
padding: 1px 5px 1px 14px;
|
||||
}
|
||||
|
||||
/* special line highlight color */
|
||||
ol.eclipseEnlighterJS li.specialline, ul.eclipseEnlighterJS li.specialline {
|
||||
background-color: #f9f9f9;
|
||||
border-left-color: #f0f0f0;
|
||||
}
|
||||
|
||||
/* hover effect */
|
||||
ol.eclipseEnlighterJS.hoverEnabled li:hover, ul.eclipseEnlighterJS.hoverEnabled li:hover {
|
||||
background-color: #e8f2fe;
|
||||
color: #444444;
|
||||
}
|
||||
ol.eclipseEnlighterJS.hoverEnabled li:hover{
|
||||
border-left-color: #e0e0e0;
|
||||
}
|
||||
|
||||
.eclipseEnlighterJS span{
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
/* symbol styles */
|
||||
.eclipseEnlighterJS .de1 { color: #3f7f95; }
|
||||
.eclipseEnlighterJS .de2 { color: #3f7f95; }
|
||||
.eclipseEnlighterJS .kw1 { color: #3f7f95; font-weight: bold; }
|
||||
.eclipseEnlighterJS .kw2 { color: #7f007f; font-weight: bold; }
|
||||
.eclipseEnlighterJS .kw3 { color: #445588; }
|
||||
.eclipseEnlighterJS .kw4 { color: #990073; }
|
||||
.eclipseEnlighterJS .co1 { color: #3f7f5f; }
|
||||
.eclipseEnlighterJS .co2 { color: #3f5fbf; }
|
||||
.eclipseEnlighterJS .st0 { color: #320fe3; }
|
||||
.eclipseEnlighterJS .st1 { color: #990073; }
|
||||
.eclipseEnlighterJS .st2 { color: #3f7f95; }
|
||||
.eclipseEnlighterJS .nu0 { color: #000000; }
|
||||
.eclipseEnlighterJS .me0 { color: #000000; }
|
||||
.eclipseEnlighterJS .me1 { color: #000000; }
|
||||
.eclipseEnlighterJS .br0 { color: #777; }
|
||||
.eclipseEnlighterJS .sy0 { color: #777; }
|
||||
.eclipseEnlighterJS .es0 { color: #777; }
|
||||
.eclipseEnlighterJS .re0 { color: #009926; }
|
||||
|
||||
/* Tab Panel */
|
||||
.eclipseEnlighterJSTabPane .controls{
|
||||
background-color: #f3f3f3;
|
||||
height: 35px;
|
||||
padding: 8px 0px 0px 20px;
|
||||
border-radius: 5px 5px 0px 0px;
|
||||
}
|
||||
.eclipseEnlighterJSTabPane .controls li {
|
||||
font-size: 12px;
|
||||
color: #000000;
|
||||
background-color: transparent;
|
||||
cursor: pointer;
|
||||
padding: 5px 10px 5px 10px;
|
||||
border-radius: 5px 5px 0px 0px;
|
||||
}
|
||||
.eclipseEnlighterJSTabPane .controls li:hover {
|
||||
background-color: transparent;
|
||||
}
|
||||
.eclipseEnlighterJSTabPane .controls .selected,.eclipseEnlighterJSTabPane .controls .selected:hover{
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
border-color: #c9c9c9;
|
||||
}
|
||||
.eclipseEnlighterJSTabPane .eclipseEnlighterJS, .eclipseEnlighterJSTabPane pre{
|
||||
border-top-width: 0px;
|
||||
}
|
||||
.eclipseEnlighterJSTabPane .pane{
|
||||
padding: 0px;
|
||||
}
|
||||
.eclipseEnlighterJSTabPane ol.eclipseEnlighterJS, .eclipseEnlighterJSTabPane ul.eclipseEnlighterJS{
|
||||
border-radius: 0px 0px 5px 5px;
|
||||
}
|
||||
/* Raw Code Pane */
|
||||
.eclipseEnlighterJSWrapper pre{
|
||||
background-color: #ffffff;
|
||||
font-size: 13px;
|
||||
color: #717171;
|
||||
}
|
||||
.eclipseEnlighterJSTabPane .EnlighterJSToolbar{
|
||||
padding: 7px 15px 0px 0px;
|
||||
}
|
138
EnlighterJS/Source/Themes/Enlighter.css
Normal file
138
EnlighterJS/Source/Themes/Enlighter.css
Normal file
|
@ -0,0 +1,138 @@
|
|||
/*
|
||||
---
|
||||
description: EnlighterJS standard style - Inspired by GitHub & Bootstrap colors;
|
||||
|
||||
license: MIT-style X11
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
styles:
|
||||
base:
|
||||
font-family: "Source Code Pro", "Courier New", Courier, monospace
|
||||
font-size: 12px
|
||||
color: '#000000'
|
||||
line:
|
||||
font-family: "Source Code Pro", "Courier New", Courier, monospace
|
||||
font-size: 11px
|
||||
line-height: 16px
|
||||
color: '#aaaaaa'
|
||||
raw:
|
||||
font-family: "Source Code Pro", "Courier New", Courier, monospace
|
||||
font-size: 12px
|
||||
line-height: 18px
|
||||
color: '#717171'
|
||||
background-color: '#ffffff'
|
||||
hover:
|
||||
background-color: '#fffcd3'
|
||||
specialline:
|
||||
background-color: '#fdf5f0'
|
||||
...
|
||||
*/
|
||||
|
||||
/* Inline specific styles */
|
||||
span.enlighterEnlighterJS{
|
||||
border-radius: 3px;
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
/* LIST specific styles */
|
||||
ol.enlighterEnlighterJS, ul.enlighterEnlighterJS, .enlighterEnlighterJSWrapper pre{
|
||||
font-size: 11px;
|
||||
color: #939393;
|
||||
border-radius: 8px;
|
||||
border: solid 1px #e0e0e0;
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
/* line styles */
|
||||
ol.enlighterEnlighterJS li, ul.enlighterEnlighterJS li{
|
||||
border: solid 0px #ffffff;
|
||||
padding: 1px 5px 1px 14px;
|
||||
line-height: 16px;
|
||||
color: #aaaaaa;
|
||||
}
|
||||
ol.enlighterEnlighterJS li{
|
||||
list-style: decimal outside;
|
||||
border-left: 1px solid #e0e0e0;
|
||||
padding: 1px 5px 1px 14px;
|
||||
}
|
||||
|
||||
/* special line highlight color */
|
||||
ol.enlighterEnlighterJS li.specialline, ul.enlighterEnlighterJS li.specialline {
|
||||
background-color: #fdf5f0;
|
||||
}
|
||||
|
||||
/* hover effect */
|
||||
ol.enlighterEnlighterJS.hoverEnabled li:hover, ul.enlighterEnlighterJS.hoverEnabled li:hover {
|
||||
background-color: #fffcd3;
|
||||
border: solid 0px #ffffff;
|
||||
color: #444444;
|
||||
}
|
||||
ol.enlighterEnlighterJS.hoverEnabled li:hover{
|
||||
border-left: 1px solid #e0e0e0;
|
||||
}
|
||||
|
||||
/* symbol styles */
|
||||
.enlighterEnlighterJS .de1 { color: #CF6A4C; }
|
||||
.enlighterEnlighterJS .de2 { color: #CF6A4C; }
|
||||
.enlighterEnlighterJS .kw1 { color: #286491; font-weight:bold; }
|
||||
.enlighterEnlighterJS .kw2 { color: #4da0d2; }
|
||||
.enlighterEnlighterJS .kw3 { color: #445588; }
|
||||
.enlighterEnlighterJS .kw4 { color: #990073; }
|
||||
.enlighterEnlighterJS .co1 { color: #9999aa; }
|
||||
.enlighterEnlighterJS .co2 { color: #9999aa; }
|
||||
.enlighterEnlighterJS .st0 { color: #dd1144; }
|
||||
.enlighterEnlighterJS .st1 { color: #dd1144; }
|
||||
.enlighterEnlighterJS .st2 { color: #dd1144; }
|
||||
.enlighterEnlighterJS .nu0 { color: #009999; }
|
||||
.enlighterEnlighterJS .me0 { color: #0086b3; }
|
||||
.enlighterEnlighterJS .me1 { color: #0086b3; }
|
||||
.enlighterEnlighterJS .br0 { color: #777; }
|
||||
.enlighterEnlighterJS .sy0 { color: #777; }
|
||||
.enlighterEnlighterJS .es0 { color: #777; }
|
||||
.enlighterEnlighterJS .re0 { color: #009926; }
|
||||
|
||||
/* Tab Panel */
|
||||
.enlighterEnlighterJSTabPane .controls{
|
||||
border-radius: 8px 8px 0px 0px;
|
||||
background-color: #f9f9f9;
|
||||
border: solid 1px #e0e0e0;
|
||||
border-bottom-width: 0px;
|
||||
padding: 5px;
|
||||
}
|
||||
.enlighterEnlighterJSTabPane .controls li {
|
||||
border-radius: 4px;
|
||||
border: solid 1px #e0e0e0;
|
||||
font-size: 12px;
|
||||
color: #000000;
|
||||
background-color: transparent;
|
||||
cursor: pointer;
|
||||
}
|
||||
.enlighterEnlighterJSTabPane .controls li:hover {
|
||||
background-color: transparent;
|
||||
}
|
||||
.enlighterEnlighterJSTabPane .controls .selected,.enlighterEnlighterJSTabPane .controls .selected:hover{
|
||||
background-color: #e5e5e5;
|
||||
color: #000000;
|
||||
border-color: #c9c9c9;
|
||||
}
|
||||
.enlighterEnlighterJSTabPane .enlighterEnlighterJS, .enlighterEnlighterJSTabPane pre{
|
||||
border-radius: 0px 0px 8px 8px;
|
||||
}
|
||||
.enlighterEnlighterJSTabPane .pane{
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
/* Raw Code Pane */
|
||||
.enlighterEnlighterJSWrapper pre{
|
||||
background-color: #ffffff;
|
||||
font-size: 12px;
|
||||
color: #717171;
|
||||
}
|
||||
|
||||
/* Raw Button */
|
||||
.enlighterEnlighterJSWrapper .EnlighterJSRawButton{
|
||||
border-radius: 3px;
|
||||
background-color: #f7f7f7;
|
||||
}
|
113
EnlighterJS/Source/Themes/Git.css
Normal file
113
EnlighterJS/Source/Themes/Git.css
Normal file
|
@ -0,0 +1,113 @@
|
|||
/*
|
||||
---
|
||||
description: GitHub inspired theme.
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
- Jose Prado
|
||||
|
||||
styles:
|
||||
base:
|
||||
font-family: Courier, monospace
|
||||
font-size: 12px
|
||||
color: '#000000'
|
||||
line:
|
||||
font-family: Courier, monospace
|
||||
font-size: 10px
|
||||
line-height: 16px
|
||||
color: '#939393'
|
||||
raw:
|
||||
font-family: Courier, monospace
|
||||
font-size: 12px
|
||||
line-height: 20px
|
||||
color: '#000000'
|
||||
background-color: '#ffffff'
|
||||
hover:
|
||||
background-color: '#ffffcc'
|
||||
specialline:
|
||||
background-color: '#fffff2'
|
||||
...
|
||||
*/
|
||||
|
||||
/* borders on top&botton */
|
||||
.gitEnlighterJS, .gitEnlighterJSWrapper pre{
|
||||
border: 1px solid #eee;
|
||||
font-family: Courier, monospace;
|
||||
}
|
||||
|
||||
/* no line borders */
|
||||
ol.gitEnlighterJS li, ul.gitEnlighterJS li{
|
||||
border: none;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
/* hover color */
|
||||
ol.gitEnlighterJS.hoverEnabled li:hover, ul.gitEnlighterJS.hoverEnabled li:hover{
|
||||
background-color: #ffffcc;
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* special line highlight color */
|
||||
ol.gitEnlighterJS li.specialline, ul.gitEnlighterJS li.specialline {
|
||||
background-color: #fffff2;
|
||||
}
|
||||
|
||||
/* non leading zero */
|
||||
ol.gitEnlighterJS {
|
||||
list-style-type: decimal;
|
||||
}
|
||||
|
||||
/** Symbol styles */
|
||||
.gitEnlighterJS .de1 { color: #CF6A4C; }
|
||||
.gitEnlighterJS .de2 { color: #CF6A4C; }
|
||||
.gitEnlighterJS .kw1 { color: #000; font-weight: bold; }
|
||||
.gitEnlighterJS .kw2 { color: #0086b3; }
|
||||
.gitEnlighterJS .kw3 { color: #445588; font-weight: bold; }
|
||||
.gitEnlighterJS .kw4 { color: #990073; }
|
||||
.gitEnlighterJS .co1 { color: #999988; font-style: italic; }
|
||||
.gitEnlighterJS .co2 { color: #999988; font-style: italic; }
|
||||
.gitEnlighterJS .st0 { color: #dd1144; }
|
||||
.gitEnlighterJS .st1 { color: #dd1144; }
|
||||
.gitEnlighterJS .st2 { color: #dd1144; }
|
||||
.gitEnlighterJS .nu0 { color: #009999; }
|
||||
.gitEnlighterJS .me0 { color: #0086b3; }
|
||||
.gitEnlighterJS .me1 { color: #0086b3; }
|
||||
.gitEnlighterJS .br0 { color: #777; }
|
||||
.gitEnlighterJS .sy0 { color: #777; }
|
||||
.gitEnlighterJS .es0 { color: #777; }
|
||||
.gitEnlighterJS .re0 { color: #009926; }
|
||||
|
||||
/* Raw Code Pane */
|
||||
.gitEnlighterJSWrapper pre{
|
||||
background-color: #ffffff;
|
||||
font-size: 12px;
|
||||
color: #000000;
|
||||
line-height: 20px;
|
||||
}
|
||||
.gitEnlighterJSWrapper .EnlighterJSToolbar > a{
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
/* Tab Styles */
|
||||
.gitEnlighterJSTabPane .controls{
|
||||
background-color: #f2f2f2;
|
||||
border: 1px solid #eee;
|
||||
border-bottom-width: 0px;
|
||||
}
|
||||
.gitEnlighterJSTabPane .controls ul{
|
||||
margin: 0px 0px 0px 35px;
|
||||
}
|
||||
.gitEnlighterJSTabPane .controls li{
|
||||
border-radius: 0px;
|
||||
}
|
||||
.gitEnlighterJSTabPane .controls li.selected{
|
||||
background-color: #e0e0e0;
|
||||
}
|
||||
.gitEnlighterJSTabPane .pane{
|
||||
padding: 0px;
|
||||
}
|
||||
.gitEnlighterJSTabPane .gitEnlighterJS{
|
||||
border-top-color: #e0e0e0;
|
||||
}
|
142
EnlighterJS/Source/Themes/Godzilla.css
Normal file
142
EnlighterJS/Source/Themes/Godzilla.css
Normal file
|
@ -0,0 +1,142 @@
|
|||
/*
|
||||
---
|
||||
description: Godzilla - Inspired by MDN colors
|
||||
|
||||
license: MIT-style X11
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
styles:
|
||||
base:
|
||||
font-family: "Source Code Pro", "Courier New", Courier, monospace
|
||||
font-size: 14px
|
||||
color: '#2b333a'
|
||||
line:
|
||||
font-family: "Source Code Pro", "Courier New", Courier, monospace
|
||||
font-size: 11px
|
||||
line-height: 19px
|
||||
color: '#f7f7f7'
|
||||
raw:
|
||||
font-family: "Source Code Pro", "Courier New", Courier, monospace
|
||||
font-size: 14px
|
||||
line-height: 21px
|
||||
color: '#2b333a'
|
||||
background-color: '#f7f7f7'
|
||||
hover:
|
||||
background-color: '#f0f0f1'
|
||||
specialline:
|
||||
background-color: 'transparent'
|
||||
...
|
||||
*/
|
||||
|
||||
/* Inline specific styles */
|
||||
span.godzillaEnlighterJS{
|
||||
background-color: #f7f7f7;
|
||||
border: dotted 1px #e0e0e1;
|
||||
border-left: solid 2px #4a80b3;
|
||||
}
|
||||
|
||||
/* LIST specific styles (BLOCK) */
|
||||
ol.godzillaEnlighterJS, ul.godzillaEnlighterJS, .godzillaEnlighterJSWrapper pre{
|
||||
font-size: 11px;
|
||||
background-color: #f0f0f1;
|
||||
border-left: solid 6px #4a80b3;
|
||||
background-image: url('data:image/gif;base64,R0lGODlhHgAeAJEAAPLz9ezt7vf39wAAACwAAAAAHgAeAAACYYyPqXvi/wCccr5gY3Y1491Z4fRlI3Rem5ByaymurQBT8nuDuM57wA8MCodEQA2V8yRjm6OmZ3G6oKSlrWlFYqlaJffpNWUvxbL5J2WNHenZrL2mxd/znfjLrm/v/Kg+UwAAOw==');
|
||||
background-repeat: repeat;
|
||||
background-position: 0px 0px;
|
||||
|
||||
}
|
||||
.godzillaEnlighterJSWrapper pre{
|
||||
font-size: 14px;
|
||||
line-height: 21px;
|
||||
color: #2b333a;
|
||||
}
|
||||
|
||||
/* line styles */
|
||||
ol.godzillaEnlighterJS li, ul.godzillaEnlighterJS li{
|
||||
border: solid 0px #ffffff;
|
||||
line-height: 19px;
|
||||
color: #2b333a;
|
||||
background-color: transparent;
|
||||
padding: 0px 5px 0px 14px;
|
||||
}
|
||||
ol.godzillaEnlighterJS li{
|
||||
list-style: decimal outside;
|
||||
color: #9c9ea0;
|
||||
}
|
||||
|
||||
/* default symbol styles */
|
||||
.godzillaEnlighterJS span{
|
||||
font-size: 14px;
|
||||
color: #2b333a;
|
||||
}
|
||||
/* Symbol Styles */
|
||||
/* Delimiter e.g. <?php ?> */
|
||||
.godzillaEnlighterJS .de1 { color: #9b0d5c; font-weight: bold; }
|
||||
.godzillaEnlighterJS .de2 { color: #9b0d5c; font-weight: bold; }
|
||||
|
||||
/* Laanguage Kewords */
|
||||
.godzillaEnlighterJS .kw1 { color: #085789; font-weight: bold; }
|
||||
.godzillaEnlighterJS .kw2 { color: #4284ae; font-weight: bold; }
|
||||
.godzillaEnlighterJS .kw3 { color: #4284ae; }
|
||||
.godzillaEnlighterJS .kw4 { color: #ae42a0; }
|
||||
|
||||
/* Comments */
|
||||
.godzillaEnlighterJS .co1 { color: #6b7c8b; }
|
||||
.godzillaEnlighterJS .co2 { color: #5b7c9c; }
|
||||
|
||||
/* Strings */
|
||||
.godzillaEnlighterJS .st0 { color: #5e860f; }
|
||||
.godzillaEnlighterJS .st1 { color: #5e860f; }
|
||||
.godzillaEnlighterJS .st2 { color: #5e860f; }
|
||||
|
||||
/* Numbers */
|
||||
.godzillaEnlighterJS .nu0 { color: #9b0d5c; }
|
||||
|
||||
.godzillaEnlighterJS .me0 { color: #d0284a; }
|
||||
.godzillaEnlighterJS .me1 { color: #d0284a; }
|
||||
|
||||
/* Brackets */
|
||||
.godzillaEnlighterJS .br0 { color: #35434c; }
|
||||
|
||||
/* Symbols */
|
||||
.godzillaEnlighterJS .sy0 { color: #35434c; }
|
||||
|
||||
/* Escape Sequences */
|
||||
.godzillaEnlighterJS .es0 { }
|
||||
|
||||
/* Regular Expression outside Strings */
|
||||
.godzillaEnlighterJS .re0 { color: #d2901d}
|
||||
|
||||
/* hover effect */
|
||||
ol.godzillaEnlighterJS.hoverEnabled li:hover, ul.godzillaEnlighterJS.hoverEnabled li:hover {
|
||||
background-color: #f0f0f1;
|
||||
}
|
||||
/* special line highlight color */
|
||||
ol.godzillaEnlighterJS li.specialline, ul.godzillaEnlighterJS li.specialline {
|
||||
border-left: solid 5px #9b0d5c;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
/* Tab Pane */
|
||||
.godzillaEnlighterJSTabPane .controls{
|
||||
background-color: #4a80b3;
|
||||
padding: 5px 0px 5px 0px;
|
||||
}
|
||||
.godzillaEnlighterJSTabPane .controls ul{
|
||||
margin-left: 10px;
|
||||
}
|
||||
.godzillaEnlighterJSTabPane .controls li{
|
||||
border-radius: 0px;
|
||||
background-color: transparent;
|
||||
line-height: 20px;
|
||||
font-size: 14px;
|
||||
color: #f0f0f0;
|
||||
}
|
||||
.godzillaEnlighterJSTabPane .controls li:hover {
|
||||
|
||||
}
|
||||
.godzillaEnlighterJSTabPane .controls li.selected{
|
||||
background-color: #00417f;
|
||||
}
|
141
EnlighterJS/Source/Themes/Minimal.css
Normal file
141
EnlighterJS/Source/Themes/Minimal.css
Normal file
|
@ -0,0 +1,141 @@
|
|||
/*
|
||||
---
|
||||
description: Minimal Theme
|
||||
|
||||
license: MIT-style X11
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
styles:
|
||||
base:
|
||||
font-family: "Droid Sans Mono", "Courier New", Courier, monospace
|
||||
font-size: 13px
|
||||
color: '#2a2a2a'
|
||||
line:
|
||||
font-family: "Droid Sans Mono", "Courier New", Courier, monospace
|
||||
font-size: 10px
|
||||
line-height: 18px
|
||||
color: '#a0a0a0'
|
||||
raw:
|
||||
font-family: "Droid Sans Mono", "Courier New", Courier, monospace
|
||||
font-size: 13px
|
||||
line-height: 18px
|
||||
color: '#2a2a2a'
|
||||
background-color: 'transparent'
|
||||
hover:
|
||||
background-color: '#f0f0f0'
|
||||
specialline:
|
||||
background-color: '#f9f9f9'
|
||||
...
|
||||
*/
|
||||
.minimalEnlighterJS, .minimalEnlighterJSWrapper{
|
||||
font-family: "Droid Sans Mono", "Courier New", Courier, monospace;
|
||||
}
|
||||
/* Inline specific styles */
|
||||
span.minimalEnlighterJS{
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* LIST specific styles */
|
||||
ol.minimalEnlighterJS, ul.minimalEnlighterJS, .minimalEnlighterJSWrapper pre{
|
||||
font-size: 13px;
|
||||
color: #404141;
|
||||
border-top: solid 3px #e0e0e0;
|
||||
border-bottom: solid 3px #e0e0e0;
|
||||
background-color: transparent;
|
||||
padding: 10px 0px 10px 0px
|
||||
}
|
||||
|
||||
/* line styles */
|
||||
ol.minimalEnlighterJS li, ul.minimalEnlighterJS li{
|
||||
border: solid 0px #ffffff;
|
||||
padding: 1px 5px 1px 0px;
|
||||
line-height: 18px;
|
||||
color: #a0a0a0;
|
||||
background-color: transparent;
|
||||
font-size: 10px;
|
||||
}
|
||||
ol.minimalEnlighterJS li{
|
||||
list-style: decimal inside;
|
||||
padding: 1px 10px 1px 10px;
|
||||
margin: 0px 0px 0px 0px;
|
||||
}
|
||||
|
||||
/* special line highlight color */
|
||||
ol.minimalEnlighterJS li.specialline, ul.minimalEnlighterJS li.specialline {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
/* hover effect */
|
||||
ol.minimalEnlighterJS.hoverEnabled li:hover, ul.minimalEnlighterJS.hoverEnabled li:hover {
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
ol.minimalEnlighterJS.hoverEnabled li:hover{
|
||||
}
|
||||
|
||||
.minimalEnlighterJS span{
|
||||
font-size: 13px;
|
||||
color: #2a2a2a;
|
||||
}
|
||||
/* symbol styles */
|
||||
.minimalEnlighterJS .de1 { color: #CF6A4C; }
|
||||
.minimalEnlighterJS .de2 { color: #CF6A4C; }
|
||||
.minimalEnlighterJS .kw1 { color: #12217c; font-weight: bold; }
|
||||
.minimalEnlighterJS .kw2 { color: #445588; border-bottom: dotted 1px #445588; }
|
||||
.minimalEnlighterJS .kw3 { color: #445588; }
|
||||
.minimalEnlighterJS .kw4 { color: #990073; }
|
||||
.minimalEnlighterJS .co1 { color: #a0a0a0; }
|
||||
.minimalEnlighterJS .co2 { color: #a0a0a0; }
|
||||
.minimalEnlighterJS .st0 { color: #387905; border-bottom: dotted 1px #387905; }
|
||||
.minimalEnlighterJS .st1 { color: #217908; border-bottom: dotted 1px #387905; }
|
||||
.minimalEnlighterJS .st2 { color: #217908; }
|
||||
.minimalEnlighterJS .nu0 { color: #a61d1b; font-weight:bold; }
|
||||
.minimalEnlighterJS .me0 { color: #12217c; background-color: #e0e0e0;}
|
||||
.minimalEnlighterJS .me1 { color: #12217c; background-color: #e0e0e0; }
|
||||
.minimalEnlighterJS .br0 { }
|
||||
.minimalEnlighterJS .sy0 { }
|
||||
.minimalEnlighterJS .es0 { }
|
||||
.minimalEnlighterJS .re0 { color: #996700; border-bottom: solid 1px #996700;}
|
||||
|
||||
/* Tab Panel */
|
||||
.minimalEnlighterJSTabPane .controls{
|
||||
background-color: transparent;
|
||||
padding: 5px 5px 0px 5px;
|
||||
}
|
||||
.minimalEnlighterJSTabPane .controls ul{
|
||||
margin: 0px 0px 5px 0px;
|
||||
}
|
||||
.minimalEnlighterJSTabPane .controls li {
|
||||
font-size: 12px;
|
||||
color: #000000;
|
||||
background-color: transparent;
|
||||
cursor: pointer;
|
||||
border-radius: 0px;
|
||||
font-weight: bold;
|
||||
text-transform: uppercase;
|
||||
padding: 1px 6px 1px 6px;
|
||||
}
|
||||
.minimalEnlighterJSTabPane .controls li:hover {
|
||||
background-color: transparent;
|
||||
}
|
||||
.minimalEnlighterJSTabPane .controls .selected,.minimalEnlighterJSTabPane .controls .selected:hover{
|
||||
background-color: #e0e0e0;
|
||||
color: #2a2a2a;
|
||||
}
|
||||
|
||||
.minimalEnlighterJSTabPane .pane{
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
/* Raw Code Pane */
|
||||
.minimalEnlighterJSWrapper pre{
|
||||
background-color: transparent;
|
||||
font-size: 13px;
|
||||
color: #2a2a2a;
|
||||
}
|
||||
|
||||
/* Raw Button */
|
||||
.minimalEnlighterJSWrapper .EnlighterJSRawButton{
|
||||
}
|
120
EnlighterJS/Source/Themes/Mocha.css
Normal file
120
EnlighterJS/Source/Themes/Mocha.css
Normal file
|
@ -0,0 +1,120 @@
|
|||
/*
|
||||
---
|
||||
description: TextMate mocha inspired theme.
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Jose Prado
|
||||
- Andi Dittrich
|
||||
|
||||
styles:
|
||||
base:
|
||||
font-family: Monaco, Courier, Monospace
|
||||
font-size: 12px
|
||||
color: '#000000'
|
||||
line:
|
||||
font-family: Monaco, Courier, Monospace
|
||||
font-size: 10px
|
||||
line-height: 16px
|
||||
color: '#f8f8f8'
|
||||
raw:
|
||||
font-family: Monaco, Courier, Monospace
|
||||
font-size: 12px
|
||||
line-height: 14px
|
||||
color: '#e0e0e0'
|
||||
background-color: '#2D2522'
|
||||
hover:
|
||||
background-color: '#423F43'
|
||||
specialline:
|
||||
background-color: '#423F43'
|
||||
...
|
||||
*/
|
||||
.mochaEnlighterJS, .mochaEnlighterJSWrapper{
|
||||
font-family: Monaco, Courier, monospace;
|
||||
}
|
||||
|
||||
.mochaEnlighterJSTabPane .controls li{
|
||||
background-color: #e5e5e5;
|
||||
font-size: 12px;
|
||||
color: #000000;
|
||||
border-radius: 0px;
|
||||
}
|
||||
.mochaEnlighterJSTabPane .controls .selected, .mochaEnlighterJSTabPane .controls .selected:hover{
|
||||
background-color: #BBCCD5;
|
||||
}
|
||||
|
||||
/* Inline Styles */
|
||||
span.mochaEnlighterJS{
|
||||
background-color: #2D2522;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.mochaEnlighterJS {
|
||||
color: #f8f8f8;
|
||||
}
|
||||
ol.mochaEnlighterJS {
|
||||
background-color: #BBCCD5;
|
||||
list-style-type: decimal;
|
||||
}
|
||||
ul.mochaEnlighterJS {
|
||||
background-color: #BBCCD5;
|
||||
}
|
||||
ol.mochaEnlighterJS li, ul.mochaEnlighterJS li{
|
||||
border: none;
|
||||
border-left: 2px solid #939393;
|
||||
background-color: #2D2522;
|
||||
color: #000000;
|
||||
}
|
||||
ol.mochaEnlighterJS.hoverEnabled li:hover, ul.mochaEnlighterJS.hoverEnabled li:hover{
|
||||
background-color: #423F43;
|
||||
border: none;
|
||||
border-left: 2px solid #939393;
|
||||
}
|
||||
|
||||
/* special line highlight color */
|
||||
ol.mochaEnlighterJS li.specialline, ul.mochaEnlighterJS li.specialline {
|
||||
background-color: #423F43;
|
||||
}
|
||||
|
||||
.mochaEnlighterJS span{
|
||||
color: #f8f8f8;
|
||||
}
|
||||
|
||||
/** Symbol Styles */
|
||||
.mochaEnlighterJS .de1 { color: #CF6A4C; }
|
||||
.mochaEnlighterJS .de2 { color: #CF6A4C; }
|
||||
.mochaEnlighterJS .kw1 { color: #CDA869; }
|
||||
.mochaEnlighterJS .kw2 { color: #CACD69; }
|
||||
.mochaEnlighterJS .kw3 { color: #afc4db; }
|
||||
.mochaEnlighterJS .kw4 { color: #CF6A4C; }
|
||||
.mochaEnlighterJS .co1 { color: #5F5A60; font-style: italic; }
|
||||
.mochaEnlighterJS .co2 { color: #5F5A60; font-style: italic; }
|
||||
.mochaEnlighterJS .st0 { color: #8F9D6A; }
|
||||
.mochaEnlighterJS .st1 { color: #8F9D6A; }
|
||||
.mochaEnlighterJS .st2 { color: #DDF2A4; }
|
||||
.mochaEnlighterJS .nu0 { color: #5B97B5; }
|
||||
.mochaEnlighterJS .me0 { color: #C5AF75; }
|
||||
.mochaEnlighterJS .me1 { color: #C5AF75; }
|
||||
.mochaEnlighterJS .br0 { color: #777; }
|
||||
.mochaEnlighterJS .sy0 { color: #777; }
|
||||
.mochaEnlighterJS .es0 { color: #777; }
|
||||
.mochaEnlighterJS .re0 { color: #B55B8B; }
|
||||
|
||||
/* Raw Code Pane */
|
||||
.mochaEnlighterJSWrapper pre{
|
||||
background-color: #2D2522;
|
||||
font-size: 12px;
|
||||
color: #e0e0e0;
|
||||
line-height: 14px;
|
||||
border-left: 2px solid #939393;
|
||||
}
|
||||
|
||||
/* Tab Pane */
|
||||
.mochaEnlighterJSWrapper .EnlighterJSToolbar > a{
|
||||
border-radius: 0px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
.mochaEnlighterJSWrapper .EnlighterJSToolbar > a:hover{
|
||||
opacity: 1.0;
|
||||
}
|
89
EnlighterJS/Source/Themes/MooTools.css
Normal file
89
EnlighterJS/Source/Themes/MooTools.css
Normal file
|
@ -0,0 +1,89 @@
|
|||
/*
|
||||
---
|
||||
description: Inspired by MooTools code coloring.
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Jose Prado
|
||||
- Andi Dittrich
|
||||
|
||||
styles:
|
||||
base:
|
||||
font-family: Monaco, Courier, monospace
|
||||
font-size: 12px
|
||||
color: '#000000'
|
||||
line:
|
||||
font-family: Monaco, Courier, monospace
|
||||
font-size: 10px
|
||||
line-height: 16px
|
||||
color: '#939393'
|
||||
raw:
|
||||
font-family: Monaco, Courier, monospace
|
||||
font-size: 12px
|
||||
line-height: 16px
|
||||
color: '#444444'
|
||||
background-color: '#ffffff'
|
||||
hover:
|
||||
background-color: '#F4F8FC'
|
||||
specialline:
|
||||
background-color: '#F4F8FC'
|
||||
...
|
||||
*/
|
||||
|
||||
.mootoolsEnlighterJS, .mootoolsEnlighterJSWrapper{
|
||||
font-family: Monaco, Courier, monospace;
|
||||
}
|
||||
|
||||
/* line styles */
|
||||
ol.mootoolsEnlighterJS li, ul.mootoolsEnlighterJS li {
|
||||
border-top: 1px solid #fff;
|
||||
border-bottom: 1px solid #fff;
|
||||
}
|
||||
ol.mootoolsEnlighterJS li{
|
||||
border-left: 1px solid #939393;
|
||||
}
|
||||
|
||||
/* hover effect */
|
||||
ol.mootoolsEnlighterJS.hoverEnabled li:hover, ul.mootoolsEnlighterJS.hoverEnabled li:hover{
|
||||
border-top: 1px solid #eee;
|
||||
border-bottom: 1px solid #eee;
|
||||
background-color: #F4F8FC;
|
||||
}
|
||||
|
||||
/* theme symbol styles */
|
||||
.mootoolsEnlighterJS .de1 {}
|
||||
.mootoolsEnlighterJS .de2 {}
|
||||
.mootoolsEnlighterJS .kw1 { color: #1b609a; }
|
||||
.mootoolsEnlighterJS .kw2 { color: #9a6f1b; }
|
||||
.mootoolsEnlighterJS .kw3 { color: #784e0c; }
|
||||
.mootoolsEnlighterJS .kw4 { color: #9a6f1b; }
|
||||
.mootoolsEnlighterJS .co1 { color: #888888; }
|
||||
.mootoolsEnlighterJS .co2 { color: #888888; }
|
||||
.mootoolsEnlighterJS .st0 { color: #489a1b; }
|
||||
.mootoolsEnlighterJS .st1 { color: #489a1b; }
|
||||
.mootoolsEnlighterJS .st2 { color: #489a1b; }
|
||||
.mootoolsEnlighterJS .nu0 { color: #70483d; }
|
||||
.mootoolsEnlighterJS .me0 { color: #666666; }
|
||||
.mootoolsEnlighterJS .me1 { color: #666666; }
|
||||
.mootoolsEnlighterJS .br0 { color: #444444; }
|
||||
.mootoolsEnlighterJS .sy0 { color: #444444; }
|
||||
.mootoolsEnlighterJS .es0 { color: #444444; }
|
||||
.mootoolsEnlighterJS .re0 { color: #784e0c; }
|
||||
|
||||
/* Raw Code Pane */
|
||||
.mootoolsEnlighterJSWrapper pre{
|
||||
line-height: 16px;
|
||||
}
|
||||
|
||||
/* Toolbar */
|
||||
.mootoolsEnlighterJSTabPane .controls li{
|
||||
border-radius: 0px;
|
||||
}
|
||||
.mootoolsEnlighterJSTabPane .controls li:hover {
|
||||
background-color: #e5e5e5;
|
||||
}
|
||||
|
||||
.mootoolsEnlighterJSTabPane .controls li.selected{
|
||||
background-color: #e5e5e5;
|
||||
}
|
139
EnlighterJS/Source/Themes/MooTwo.css
Normal file
139
EnlighterJS/Source/Themes/MooTwo.css
Normal file
|
@ -0,0 +1,139 @@
|
|||
/*
|
||||
---
|
||||
description: MooTwo - Inspired by mootools.net website (v2) colors
|
||||
|
||||
license: MIT-style X11
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
styles:
|
||||
base:
|
||||
font-family: "Source Code Pro", "Courier New", Courier, monospace
|
||||
font-size: 14px
|
||||
color: '#000000'
|
||||
line:
|
||||
font-family: "Source Code Pro", "Courier New", Courier, monospace
|
||||
font-size: 11px
|
||||
line-height: 18px
|
||||
color: '#313437'
|
||||
raw:
|
||||
font-family: "Source Code Pro", "Courier New", Courier, monospace
|
||||
font-size: 14px
|
||||
line-height: 22px
|
||||
color: '#313437'
|
||||
background-color: '#f0f0f1'
|
||||
hover:
|
||||
background-color: '#e9e9e9'
|
||||
specialline:
|
||||
background-color: '#e9e9e9'
|
||||
...
|
||||
*/
|
||||
|
||||
/* Inline specific styles */
|
||||
span.mootwoEnlighterJS{
|
||||
border-radius: 4px;
|
||||
background-color: #f0f0f1;
|
||||
border: solid 1px #f0f0f1;
|
||||
}
|
||||
|
||||
/* LIST specific styles (BLOCK) */
|
||||
ol.mootwoEnlighterJS, ul.mootwoEnlighterJS, .mootwoEnlighterJSWrapper pre{
|
||||
font-size: 11px;
|
||||
background-color: #f0f0f1;
|
||||
border: solid 1px #f0f0f1;
|
||||
border-radius: 7px;
|
||||
}
|
||||
.mootwoEnlighterJSWrapper pre{
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
color: #313437;
|
||||
}
|
||||
|
||||
/* line styles */
|
||||
ol.mootwoEnlighterJS li, ul.mootwoEnlighterJS li{
|
||||
border: solid 0px #ffffff;
|
||||
line-height: 18px;
|
||||
color: #313437;
|
||||
background-color: #f0f0f1;
|
||||
padding: 1px 5px 1px 14px;
|
||||
}
|
||||
ol.mootwoEnlighterJS li{
|
||||
list-style: decimal outside;
|
||||
color: #9c9ea0;
|
||||
}
|
||||
|
||||
/* default symbol styles */
|
||||
.mootwoEnlighterJS span{
|
||||
font-size: 14px;
|
||||
color: #313437;
|
||||
}
|
||||
/* Symbol Styles */
|
||||
/* Delimiter e.g. <?php ?> */
|
||||
.mootwoEnlighterJS .de1 {}
|
||||
.mootwoEnlighterJS .de2 {}
|
||||
|
||||
/* Laanguage Kewords */
|
||||
.mootwoEnlighterJS .kw1 { color: #b05098; font-weight: bold; }
|
||||
.mootwoEnlighterJS .kw2 { color: #b05098; }
|
||||
.mootwoEnlighterJS .kw3 { }
|
||||
.mootwoEnlighterJS .kw4 { }
|
||||
|
||||
/* Comments */
|
||||
.mootwoEnlighterJS .co1 { color: #9c9ea0; }
|
||||
.mootwoEnlighterJS .co2 { color: #9c9ea0; }
|
||||
|
||||
/* Strings */
|
||||
.mootwoEnlighterJS .st0 { color: #83a440; }
|
||||
.mootwoEnlighterJS .st1 { color: #83a440; }
|
||||
.mootwoEnlighterJS .st2 { color: #83a440; }
|
||||
|
||||
/* Numbers */
|
||||
.mootwoEnlighterJS .nu0 { color: #429bc1; }
|
||||
|
||||
.mootwoEnlighterJS .me0 { color: #666666; }
|
||||
.mootwoEnlighterJS .me1 { color: #666666; }
|
||||
|
||||
/* Brackets */
|
||||
.mootwoEnlighterJS .br0 { color: #909090; }
|
||||
|
||||
/* Symbols */
|
||||
.mootwoEnlighterJS .sy0 { color: #864c08; }
|
||||
|
||||
/* Escape Sequences */
|
||||
.mootwoEnlighterJS .es0 { }
|
||||
|
||||
/* Regular Expression outside Strings */
|
||||
.mootwoEnlighterJS .re0 { }
|
||||
|
||||
/* hover effect */
|
||||
ol.mootwoEnlighterJS.hoverEnabled li:hover, ul.mootwoEnlighterJS.hoverEnabled li:hover {
|
||||
background-color: #e9e9e9;
|
||||
}
|
||||
/* special line highlight color */
|
||||
ol.mootwoEnlighterJS li.specialline, ul.mootwoEnlighterJS li.specialline {
|
||||
background-color: #e9e9e9;
|
||||
}
|
||||
|
||||
/* Tab Pane */
|
||||
.mootwoEnlighterJSTabPane .controls{
|
||||
background-color: #585b5e;
|
||||
padding: 10px 0px 10px 0px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
.mootwoEnlighterJSTabPane .controls ul{
|
||||
margin-left: 10px;
|
||||
}
|
||||
.mootwoEnlighterJSTabPane .controls li{
|
||||
border-radius: 0px;
|
||||
background-color: transparent;
|
||||
line-height: 20px;
|
||||
font-size: 15px;
|
||||
color: #f0f0f0;
|
||||
}
|
||||
.mootwoEnlighterJSTabPane .controls li:hover {
|
||||
|
||||
}
|
||||
.mootwoEnlighterJSTabPane .controls li.selected{
|
||||
text-decoration: underline;
|
||||
}
|
94
EnlighterJS/Source/Themes/Panic.css
Normal file
94
EnlighterJS/Source/Themes/Panic.css
Normal file
|
@ -0,0 +1,94 @@
|
|||
/*
|
||||
---
|
||||
description: Panic Coda inspired theme.
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Jose Prado
|
||||
- Andi Dittrich
|
||||
|
||||
styles:
|
||||
base:
|
||||
font-family: Monaco, Courier, monospace
|
||||
font-size: 12px
|
||||
color: '#000000'
|
||||
line:
|
||||
font-family: Monaco, Courier, monospace
|
||||
font-size: 10px
|
||||
line-height: 16px
|
||||
color: '#939393'
|
||||
raw:
|
||||
font-family: Monaco, Courier, monospace
|
||||
font-size: 12px
|
||||
line-height: 16px
|
||||
color: '#000000'
|
||||
background-color: '#ffffff'
|
||||
hover:
|
||||
background-color: '#F4F8FC'
|
||||
specialline:
|
||||
background-color: '#F4F8FC'
|
||||
...
|
||||
*/
|
||||
.panicEnlighterJS, .panicEnlighterJSWrapper{
|
||||
font-family: Monaco, Courier, monospace;
|
||||
}
|
||||
|
||||
.panicEnlighterJSTabPane .controls li{
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
.panicEnlighterJSTabPane .controls li:hover{
|
||||
background-color: #e5e5e5;
|
||||
}
|
||||
.panicEnlighterJSTabPane .controls .selected, .panicEnlighterJSTabPane .controls .selected:hover{
|
||||
background-color: #E4F8FC;
|
||||
}
|
||||
|
||||
/* line styles */
|
||||
ol.panicEnlighterJS li, ul.panicEnlighterJS li {
|
||||
border-top: 1px solid #fff;
|
||||
border-bottom: 1px solid #fff;
|
||||
}
|
||||
ol.panicEnlighterJS li{
|
||||
border-left: 1px solid #939393;
|
||||
}
|
||||
|
||||
/* hover effect */
|
||||
ol.panicEnlighterJS.hoverEnabled li:hover, ul.panicEnlighterJS.hoverEnabled li:hover{
|
||||
border-top: 1px solid #eee;
|
||||
border-bottom: 1px solid #eee;
|
||||
background-color: #F4F8FC;
|
||||
}
|
||||
|
||||
|
||||
/** Symbol styles */
|
||||
.panicEnlighterJS .de1 { color: #A00083; }
|
||||
.panicEnlighterJS .de2 { color: #A00083; }
|
||||
.panicEnlighterJS .kw1 { color: #9F0050; }
|
||||
.panicEnlighterJS .kw2 { color: #9F0050; }
|
||||
.panicEnlighterJS .kw3 { color: #9a6c00; }
|
||||
.panicEnlighterJS .kw4 { color: #9F0050; }
|
||||
.panicEnlighterJS .co1 { color: #00721F; font-style: italic; }
|
||||
.panicEnlighterJS .co2 { color: #00721F; font-style: italic; }
|
||||
.panicEnlighterJS .st0 { color: #EF7300; }
|
||||
.panicEnlighterJS .st1 { color: #8A000F; }
|
||||
.panicEnlighterJS .st2 { color: #8A000F; }
|
||||
.panicEnlighterJS .nu0 { color: #1600FF; }
|
||||
.panicEnlighterJS .me0 { color: #00417f; }
|
||||
.panicEnlighterJS .me1 { color: #00417f; }
|
||||
.panicEnlighterJS .br0 { color: #000; }
|
||||
.panicEnlighterJS .sy0 { color: #000; }
|
||||
.panicEnlighterJS .es0 { color: #000; }
|
||||
.panicEnlighterJS .re0 { color: #8A000F; }
|
||||
|
||||
/* Raw Code Pane */
|
||||
.panicEnlighterJSWrapper pre{
|
||||
background-color: #ffffff;
|
||||
font-size: 12px;
|
||||
color: #000000;
|
||||
line-height: 16px;
|
||||
}
|
||||
/* Tab Pane */
|
||||
.panicEnlighterJSWrapper .EnlighterJSToolbar > a{
|
||||
border-radius: 0px;
|
||||
}
|
165
EnlighterJS/Source/Themes/Rowhammer.css
Normal file
165
EnlighterJS/Source/Themes/Rowhammer.css
Normal file
|
@ -0,0 +1,165 @@
|
|||
/*
|
||||
---
|
||||
description: Rowhammer Theme
|
||||
|
||||
license: MIT-style X11
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
styles:
|
||||
base:
|
||||
font-family: "Ubuntu Mono", "Source Code Pro", "Courier New", Courier, monospace;
|
||||
font-size: 15px
|
||||
color: '#121212'
|
||||
line:
|
||||
font-family: "Ubuntu Mono", "Source Code Pro", "Courier New", Courier, monospace;
|
||||
font-size: 10px
|
||||
line-height: 20px
|
||||
color: '#94a9bf'
|
||||
raw:
|
||||
font-family: "Ubuntu Mono", "Source Code Pro", "Courier New", Courier, monospace;
|
||||
font-size: 15px
|
||||
line-height: 22px
|
||||
color: '#2a2a2a'
|
||||
background-color: 'transparent'
|
||||
hover:
|
||||
background-color: '#f0f0f0'
|
||||
specialline:
|
||||
background-color: '#f9f9f9'
|
||||
...
|
||||
*/
|
||||
.rowhammerEnlighterJS, .rowhammerEnlighterJSWrapper, .rowhammerEnlighterJSTabPane{
|
||||
font-family: "Ubuntu Mono", "Source Code Pro", "Courier New", Courier, monospace;
|
||||
}
|
||||
/* Inline specific styles */
|
||||
span.rowhammerEnlighterJS{
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* LIST specific styles */
|
||||
ol.rowhammerEnlighterJS, ul.rowhammerEnlighterJS, .rowhammerEnlighterJSWrapper pre{
|
||||
font-size: 13px;
|
||||
color: #404141;
|
||||
background-color: transparent;
|
||||
padding: 10px 0px 10px 0px;
|
||||
}
|
||||
|
||||
|
||||
/* line styles */
|
||||
ol.rowhammerEnlighterJS li, ul.rowhammerEnlighterJS li{
|
||||
border: solid 0px #ffffff;
|
||||
padding: 1px 5px 1px 0px;
|
||||
line-height: 20px;
|
||||
color: #94a9bf;
|
||||
background-color: transparent;
|
||||
font-size: 10px;
|
||||
border-bottom: dotted 1px #e9e9f0;
|
||||
}
|
||||
ol.rowhammerEnlighterJS li:nth-of-type(1), ul.rowhammerEnlighterJS li:nth-of-type(1) {
|
||||
border-top: dotted 1px #e9e9f0;
|
||||
}
|
||||
|
||||
ol.rowhammerEnlighterJS li{
|
||||
list-style: decimal-leading-zero inside;
|
||||
padding: 1px 10px 1px 10px;
|
||||
margin: 0px 0px 0px 0px;
|
||||
}
|
||||
|
||||
/* special line highlight color */
|
||||
ol.rowhammerEnlighterJS li.specialline, ul.rowhammerEnlighterJS li.specialline {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
/* hover effect */
|
||||
ol.rowhammerEnlighterJS.hoverEnabled li:hover, ul.rowhammerEnlighterJS.hoverEnabled li:hover {
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
ol.rowhammerEnlighterJS.hoverEnabled li:hover{
|
||||
}
|
||||
|
||||
.rowhammerEnlighterJS span{
|
||||
font-size: 15px;
|
||||
color: #121212;
|
||||
}
|
||||
/* symbol styles */
|
||||
/* Delimiter e.g. <?php ?> */
|
||||
.rowhammerEnlighterJS .de1 { color: #9b0d5c; font-weight: bold; }
|
||||
.rowhammerEnlighterJS .de2 { color: #9b0d5c; font-weight: bold; }
|
||||
|
||||
/* Laanguage Kewords */
|
||||
.rowhammerEnlighterJS .kw1 { color: #0077aa; font-weight: bold; border-bottom: dotted 1px #0077aa; }
|
||||
.rowhammerEnlighterJS .kw2 { color: #0077aa; font-weight: bold; }
|
||||
.rowhammerEnlighterJS .kw3 { color: #0077aa; }
|
||||
.rowhammerEnlighterJS .kw4 { color: #ae42a0; }
|
||||
|
||||
/* Comments */
|
||||
.rowhammerEnlighterJS .co1 { color: #758697; }
|
||||
.rowhammerEnlighterJS .co2 { color: #758697; }
|
||||
|
||||
/* Strings */
|
||||
.rowhammerEnlighterJS .st0 { color: #639500; border-bottom: dotted 1px #639500; }
|
||||
.rowhammerEnlighterJS .st1 { color: #639500; }
|
||||
.rowhammerEnlighterJS .st2 { color: #639500; }
|
||||
|
||||
/* Numbers */
|
||||
.rowhammerEnlighterJS .nu0 { color: #9b0d5c; }
|
||||
|
||||
.rowhammerEnlighterJS .me0 { color: #c2415b; font-weight: bold;}
|
||||
.rowhammerEnlighterJS .me1 { color: #d0284a; font-weight: bold;}
|
||||
|
||||
/* Brackets */
|
||||
.rowhammerEnlighterJS .br0 { color: #6b7c8b; font-weight: bold; }
|
||||
|
||||
/* Symbols */
|
||||
.rowhammerEnlighterJS .sy0 { color: #35434c; font-weight: bold; }
|
||||
|
||||
/* Escape Sequences */
|
||||
.rowhammerEnlighterJS .es0 { }
|
||||
|
||||
/* Regular Expression outside Strings */
|
||||
.rowhammerEnlighterJS .re0 { color: #d2901d }
|
||||
|
||||
|
||||
/* Tab Panel */
|
||||
.rowhammerEnlighterJSTabPane .controls{
|
||||
background-color: transparent;
|
||||
padding: 5px 5px 0px 5px;
|
||||
}
|
||||
.rowhammerEnlighterJSTabPane .controls ul{
|
||||
margin: 0px 0px 5px 0px;
|
||||
}
|
||||
.rowhammerEnlighterJSTabPane .controls li {
|
||||
font-size: 14px;
|
||||
color: #758697;
|
||||
background-color: transparent;
|
||||
cursor: pointer;
|
||||
border-radius: 0px;
|
||||
font-weight: bold;
|
||||
text-transform: uppercase;
|
||||
padding: 1px 6px 1px 6px;
|
||||
}
|
||||
.rowhammerEnlighterJSTabPane .controls li:hover {
|
||||
background-color: transparent;
|
||||
}
|
||||
.rowhammerEnlighterJSTabPane .controls .selected,.rowhammerEnlighterJSTabPane .controls .selected:hover{
|
||||
border-bottom: dotted 1px #758697;
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
|
||||
.rowhammerEnlighterJSTabPane .pane{
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
/* Raw Code Pane */
|
||||
.rowhammerEnlighterJSWrapper pre{
|
||||
background-color: transparent;
|
||||
font-size: 15px;
|
||||
line-height: 22px;
|
||||
color: #2a2a2a;
|
||||
}
|
||||
|
||||
/* Raw Button */
|
||||
.rowhammerEnlighterJSWrapper .EnlighterJSRawButton{
|
||||
}
|
70
EnlighterJS/Source/Themes/Template.MyTheme.css
Normal file
70
EnlighterJS/Source/Themes/Template.MyTheme.css
Normal file
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
---
|
||||
description: Theme-Development Startup - your theme prefix has to be lowercase!!
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
...
|
||||
*/
|
||||
|
||||
/* Symbol Styles */
|
||||
|
||||
/* Start Delimiter e.g. <?php */
|
||||
.mythemeEnlighterJS .de1 {}
|
||||
|
||||
/* Stop Delimiter e.g. ?> */
|
||||
.mythemeEnlighterJS .de2 {}
|
||||
|
||||
/* Laanguage Kewords */
|
||||
.mythemeEnlighterJS .kw1 { color: #ff609a; }
|
||||
.mythemeEnlighterJS .kw2 { color: #ff6f1b; }
|
||||
.mythemeEnlighterJS .kw3 { color: #ff4e0c; }
|
||||
.mythemeEnlighterJS .kw4 { color: #ff6f1b; }
|
||||
|
||||
/* Comments */
|
||||
.mythemeEnlighterJS .co1 { color: #88f888; }
|
||||
.mythemeEnlighterJS .co2 { color: #888888; }
|
||||
|
||||
/* Strings */
|
||||
.mythemeEnlighterJS .st0 { color: #489a1b; }
|
||||
.mythemeEnlighterJS .st1 { color: #489a1b; }
|
||||
.mythemeEnlighterJS .st2 { color: #489a1b; }
|
||||
|
||||
/* Numbers */
|
||||
.mythemeEnlighterJS .nu0 { color: #70483d; }
|
||||
|
||||
/* Function calls */
|
||||
.mythemeEnlighterJS .me0 { color: #666666; }
|
||||
|
||||
/* Methid calls */
|
||||
.mythemeEnlighterJS .me1 { color: #666666; }
|
||||
|
||||
/* Brackets */
|
||||
.mythemeEnlighterJS .br0 { color: #f44444; }
|
||||
|
||||
/* Symbols */
|
||||
.mythemeEnlighterJS .sy0 { color: #444444; }
|
||||
|
||||
/* Escape Sequences */
|
||||
.mythemeEnlighterJS .es0 { color: #444444; }
|
||||
|
||||
/* Regular Expression outside Strings */
|
||||
.mythemeEnlighterJS .re0 { color: #784e0c; }
|
||||
|
||||
/* Raw Code Pane */
|
||||
.mythemeEnlighterJSWrapper pre{
|
||||
line-height: 16px;
|
||||
}
|
||||
|
||||
/* Tab Pane */
|
||||
.mythemeEnlighterJSTabPane .controls li{
|
||||
border-radius: 0px;
|
||||
}
|
||||
.mythemeEnlighterJSTabPane .controls li:hover {
|
||||
background-color: #e5e5e5;
|
||||
}
|
||||
.mythemeEnlighterJSTabPane .controls li.selected{
|
||||
background-color: #e5e5e5;
|
||||
}
|
113
EnlighterJS/Source/Themes/Tutti.css
Normal file
113
EnlighterJS/Source/Themes/Tutti.css
Normal file
|
@ -0,0 +1,113 @@
|
|||
/*
|
||||
---
|
||||
description: MacRabbit Espresso inspired theme.
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Jose Prado
|
||||
- Andi Dittrich
|
||||
|
||||
styles:
|
||||
base:
|
||||
font-family: Monaco, Courier, Monospace
|
||||
font-size: 12px
|
||||
color: '#000000'
|
||||
line:
|
||||
font-family: Monaco, Courier, Monospace
|
||||
font-size: 10px
|
||||
line-height: 16px
|
||||
color: '#939393'
|
||||
raw:
|
||||
font-family: Monaco, Courier, Monospace
|
||||
font-size: 12px
|
||||
line-height: 16px
|
||||
color: '#000000'
|
||||
background-color: '#ffffff'
|
||||
hover:
|
||||
background-color: '#F4F8FC'
|
||||
specialline:
|
||||
background-color: '#F4F8FC'
|
||||
...
|
||||
*/
|
||||
.tuttiEnlighterJS, .tuttiEnlighterJSWrapper{
|
||||
font-family: Monaco, Courier, monospace;
|
||||
}
|
||||
|
||||
.tuttiEnlighterJSTabPane .controls li{
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.tuttiEnlighterJSTabPane .controls .selected, .tuttiEnlighterJSTabPane .controls .selected:hover, .tuttiEnlighterJSTabPane .controls li:hover{
|
||||
background-color: #F4F8FC;
|
||||
}
|
||||
|
||||
.tuttiEnlighterJS {
|
||||
color: #000000;
|
||||
}
|
||||
ol.tuttiEnlighterJS {
|
||||
background-color: #fbfbfb;
|
||||
list-style-type: decimal;
|
||||
}
|
||||
ul.tuttiEnlighterJS {
|
||||
background-color: #fbfbfb;
|
||||
}
|
||||
|
||||
span.tuttiEnlighterJS {
|
||||
background-color: #f9f9f9;
|
||||
border: none;
|
||||
}
|
||||
|
||||
ol.tuttiEnlighterJS li, ul.tuttiEnlighterJS li{
|
||||
border: none;
|
||||
line-height: 16px;
|
||||
}
|
||||
|
||||
ol.tuttiEnlighterJS.hoverEnabled li:hover, ul.tuttiEnlighterJS.hoverEnabled li:hover{
|
||||
background-color: #F4F8FC;
|
||||
color: #000000;
|
||||
border: none;
|
||||
}
|
||||
/* special line highlight color */
|
||||
ol.tuttiEnlighterJS li.specialline, ul.tuttiEnlighterJS li.specialline {
|
||||
background-color: #F4F8FC;
|
||||
}
|
||||
|
||||
/** Symbol styles */
|
||||
.tuttiEnlighterJS .de1 { color: #6eb13f; }
|
||||
.tuttiEnlighterJS .de2 { color: #6eb13f; }
|
||||
.tuttiEnlighterJS .kw1 { color: #8600c9; }
|
||||
.tuttiEnlighterJS .kw2 { color: #3a1d72; font-weight: bold; }
|
||||
.tuttiEnlighterJS .kw3 { color: #4F9FCF; }
|
||||
.tuttiEnlighterJS .kw4 { color: #4F9FCF; }
|
||||
.tuttiEnlighterJS .co1 { color: #bbb; }
|
||||
.tuttiEnlighterJS .co2 { color: #bbb; }
|
||||
.tuttiEnlighterJS .st0 { color: #bc670f; background-color: #fffdf7;}
|
||||
.tuttiEnlighterJS .st1 { color: #bc670f; background-color: #fffdf7;}
|
||||
.tuttiEnlighterJS .st2 { color: #bc670f; background-color: #fffdf7;}
|
||||
.tuttiEnlighterJS .nu0 { color: #6700b9; }
|
||||
.tuttiEnlighterJS .me0 { color: #000; }
|
||||
.tuttiEnlighterJS .me1 { color: #6eb13f; font-weight: bold; }
|
||||
.tuttiEnlighterJS .br0 { color: #4f4f4f; }
|
||||
.tuttiEnlighterJS .sy0 { color: #626fc9; }
|
||||
.tuttiEnlighterJS .es0 { color: #4f4f4f; }
|
||||
.tuttiEnlighterJS .re0 { color: #d44950; }
|
||||
|
||||
/* Raw Code Pane */
|
||||
.tuttiEnlighterJSWrapper pre{
|
||||
background-color: #ffffff;
|
||||
font-size: 12px;
|
||||
color: #000000;
|
||||
line-height: 16px;
|
||||
}
|
||||
|
||||
/* Tab Pane */
|
||||
.tuttiEnlighterJSWrapper .EnlighterJSToolbar > a{
|
||||
border-radius: 0px;
|
||||
opacity: 0.8;
|
||||
border: none;
|
||||
width: 21px;
|
||||
height: 21px;
|
||||
}
|
||||
.tuttiEnlighterJSWrapper .EnlighterJSToolbar > a:HOVER{
|
||||
opacity: 1.0;
|
||||
}
|
119
EnlighterJS/Source/Themes/Twilight.css
Normal file
119
EnlighterJS/Source/Themes/Twilight.css
Normal file
|
@ -0,0 +1,119 @@
|
|||
/*
|
||||
---
|
||||
description: TextMate twilight inspired theme.
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Jose Prado
|
||||
- Andi Dittrich
|
||||
|
||||
styles:
|
||||
base:
|
||||
font-family: Monaco, Courier, monospace
|
||||
font-size: 12px
|
||||
color: '#f8f8f8'
|
||||
line:
|
||||
font-family: Monaco, Courier, monospace
|
||||
font-size: 10px
|
||||
line-height: 16px
|
||||
color: '#939393'
|
||||
raw:
|
||||
font-family: Monaco, Courier, monospace
|
||||
font-size: 12px
|
||||
line-height: 20px
|
||||
color: '#f8f8f8'
|
||||
background-color: '#141414'
|
||||
hover:
|
||||
background-color: '#202021'
|
||||
specialline:
|
||||
background-color: ' #202021'
|
||||
...
|
||||
*/
|
||||
.twilightEnlighterJS, .twilightEnlighterJSWrapper{
|
||||
font-family: Monaco, Courier, monospace;
|
||||
}
|
||||
.twilightEnlighterJSTabPane .controls li{
|
||||
background-color: #303030;
|
||||
font-size: 12px;
|
||||
color: #f2f2f2;
|
||||
border-radius: 0px;
|
||||
}
|
||||
.twilightEnlighterJSTabPane .controls li:hover{
|
||||
color: #8F9657;
|
||||
background-color: #303030;
|
||||
}
|
||||
.twilightEnlighterJSTabPane .controls .selected, .twilightEnlighterJSTabPane .controls .selected:hover{
|
||||
background-color: #000000;
|
||||
}
|
||||
|
||||
/* Inline Styles */
|
||||
span.twilightEnlighterJS{
|
||||
background-color: #141414;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.twilightEnlighterJS span{
|
||||
color: #f8f8f8;
|
||||
}
|
||||
ol.twilightEnlighterJS {
|
||||
background-color: #f2f2f2;
|
||||
list-style-type: decimal;
|
||||
border: solid 1px #222222;
|
||||
}
|
||||
ul.twilightEnlighterJS {
|
||||
background-color: #f2f2f2;
|
||||
border: solid 1px #222222;
|
||||
}
|
||||
ol.twilightEnlighterJS li, ul.twilightEnlighterJS li{
|
||||
border: none;
|
||||
border-left: 1px solid #939393;
|
||||
line-height: 19px;
|
||||
background-color: #141414;
|
||||
}
|
||||
ol.twilightEnlighterJS.hoverEnabled li:hover, ul.twilightEnlighterJS.hoverEnabled li:hover{
|
||||
background-color: #202021;
|
||||
border: none;
|
||||
border-left: 1px solid #939393;
|
||||
}
|
||||
|
||||
/* special line highlight color */
|
||||
ol.twilightEnlighterJS li.specialline, ul.twilightEnlighterJS li.specialline {
|
||||
background-color: #202021;
|
||||
}
|
||||
|
||||
/** Symbol styles */
|
||||
.twilightEnlighterJS .de1 { color: #fff; }
|
||||
.twilightEnlighterJS .de2 { color: #fff; }
|
||||
.twilightEnlighterJS .kw1 { color: #CDA869; }
|
||||
.twilightEnlighterJS .kw2 { color: #F9EE98; }
|
||||
.twilightEnlighterJS .kw3 { color: #6F87A8; }
|
||||
.twilightEnlighterJS .kw4 { color: #E96546; }
|
||||
.twilightEnlighterJS .co1 { color: #5F5A60; }
|
||||
.twilightEnlighterJS .co2 { color: #5F5A60; }
|
||||
.twilightEnlighterJS .st0 { color: #8F9657; }
|
||||
.twilightEnlighterJS .st1 { color: #8F9657; }
|
||||
.twilightEnlighterJS .st2 { color: #8F9657; }
|
||||
.twilightEnlighterJS .nu0 { color: #CF6745; }
|
||||
.twilightEnlighterJS .me0 { color: #fff; }
|
||||
.twilightEnlighterJS .me1 { color: #fff; }
|
||||
.twilightEnlighterJS .br0 { color: #fff; }
|
||||
.twilightEnlighterJS .sy0 { color: #fff; }
|
||||
.twilightEnlighterJS .es0 { color: #fff; }
|
||||
.twilightEnlighterJS .re0 { color: #E57A27; }
|
||||
|
||||
/* Raw Code Pane */
|
||||
.twilightEnlighterJSWrapper pre{
|
||||
background-color: #141414;
|
||||
font-size: 12px;
|
||||
color: #f8f8f8;
|
||||
line-height: 20px;
|
||||
}
|
||||
/* Tab Pane */
|
||||
.twilightEnlighterJSWrapper .EnlighterJSToolbar > a{
|
||||
border-radius: 0px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
.twilightEnlighterJSWrapper .EnlighterJSToolbar > a:hover{
|
||||
opacity: 1.0;
|
||||
}
|
BIN
EnlighterJS/Source/Themes/info.gif
Normal file
BIN
EnlighterJS/Source/Themes/info.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 245 B |
BIN
EnlighterJS/Source/Themes/new_window1.gif
Normal file
BIN
EnlighterJS/Source/Themes/new_window1.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 262 B |
BIN
EnlighterJS/Source/Themes/raw_code1.gif
Normal file
BIN
EnlighterJS/Source/Themes/raw_code1.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 301 B |
0
EnlighterJS/Source/Themes/variables.less
Normal file
0
EnlighterJS/Source/Themes/variables.less
Normal file
114
EnlighterJS/Source/Tokenizer/Standard.js
Normal file
114
EnlighterJS/Source/Tokenizer/Standard.js
Normal file
|
@ -0,0 +1,114 @@
|
|||
/*
|
||||
---
|
||||
description: Enlighter`s Standard Tokenizer Engine
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [Tokenizer.Standard]
|
||||
...
|
||||
*/
|
||||
EJS.Tokenizer.Standard = new Class({
|
||||
|
||||
initialize : function(){
|
||||
},
|
||||
|
||||
getTokens : function(language, code){
|
||||
// create token object
|
||||
var token = (function(text, alias, index){
|
||||
return {
|
||||
text: text,
|
||||
alias: alias,
|
||||
index: index,
|
||||
length: text.length,
|
||||
end: text.length + index
|
||||
}
|
||||
});
|
||||
|
||||
// token list
|
||||
var rawTokens = this.getPreprocessedTokens(token);
|
||||
|
||||
// apply each rule to given sourcecode string
|
||||
Array.each(language.getRules(), function(rule){
|
||||
var match;
|
||||
|
||||
// find ALL possible matches (also overlapping ones!)
|
||||
while (match = rule.pattern.exec(code)){
|
||||
// overrides the usual regex behaviour of not matching results that overlap
|
||||
rule.pattern.lastIndex = match.index+1;
|
||||
|
||||
// matching groups used ?
|
||||
if (match.length == 1) {
|
||||
rawTokens.push(token(match[0], rule.alias, match.index));
|
||||
// use full pattern
|
||||
}else{
|
||||
// get first matched group
|
||||
for (var i = 1; i < match.length; i++) {
|
||||
if (match[i] && match[i].length > 0){
|
||||
rawTokens.push(token(match[i], rule.alias, match.index + match[0].indexOf(match[i])));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// sort tokens by index (first occurrence)
|
||||
rawTokens = rawTokens.sort(function(token1, token2){
|
||||
return token1.index - token2.index;
|
||||
});
|
||||
|
||||
// cleaned token list to render
|
||||
var tokens = [];
|
||||
|
||||
// last token position
|
||||
var lastTokenEnd = 0;
|
||||
|
||||
// iterate over raw token list and retain the first match - drop overlaps
|
||||
for (var i=0; i<rawTokens.length; i++){
|
||||
// unmatched text between tokens ?
|
||||
if (lastTokenEnd < rawTokens[i].index ){
|
||||
// create new start text token
|
||||
tokens.push(token(code.substring(lastTokenEnd, rawTokens[i].index), '', lastTokenEnd));
|
||||
}
|
||||
|
||||
// push current token to list
|
||||
tokens.push(rawTokens[i]);
|
||||
|
||||
// store last token position
|
||||
lastTokenEnd = rawTokens[i].end;
|
||||
|
||||
// find next, non overlapping token
|
||||
var nextTokenFound = false;
|
||||
for (var j = i + 1; j < rawTokens.length; j++){
|
||||
if (rawTokens[j].index >= lastTokenEnd){
|
||||
// the "current" token -> i will be incremented in the next loop => j-1
|
||||
i = j-1;
|
||||
nextTokenFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// final position reached ?
|
||||
if (nextTokenFound===false){
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// text fragments complete ? or is the final one missing ?
|
||||
if (lastTokenEnd < code.length){
|
||||
tokens.push(token(code.substring(lastTokenEnd), '', lastTokenEnd));
|
||||
}
|
||||
|
||||
return tokens;
|
||||
},
|
||||
|
||||
// token pre-processing; can be overloaded by extending class
|
||||
getPreprocessedTokens: function(token){
|
||||
return [];
|
||||
}
|
||||
});
|
68
EnlighterJS/Source/Tokenizer/Xml.js
Normal file
68
EnlighterJS/Source/Tokenizer/Xml.js
Normal file
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
---
|
||||
description: XML parser engine for EnlighterJS
|
||||
|
||||
license: MIT-style
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
- Jose Prado
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Tokenizer.Xml]
|
||||
...
|
||||
*/
|
||||
EnlighterJS.Tokenizer.Xml = new Class({
|
||||
|
||||
Extends : EnlighterJS.Tokenizer.Standard,
|
||||
|
||||
code: null,
|
||||
|
||||
/**
|
||||
* Store code to pre-process XML
|
||||
*/
|
||||
getTokens : function(language, code){
|
||||
this.code = code;
|
||||
return this.parent(language, code);
|
||||
},
|
||||
|
||||
/**
|
||||
* XML Syntax is preprocessed
|
||||
*/
|
||||
getPreprocessedTokens: function(token){
|
||||
// token list
|
||||
var rawTokens = [];
|
||||
|
||||
// Tags + attributes matching and preprocessing.
|
||||
var tagPattern = /((?:\<|<)[A-Z:_][A-Z0-9:.-]*)([\s\S]*?)(\/?(?:\>|>))/gi;
|
||||
var attPattern = /\b([\w:-]+)([ \t]*)(=)([ \t]*)(['"][^'"]+['"]|[^'" \t]+)/gi;
|
||||
|
||||
// tmp storage
|
||||
var match = null;
|
||||
var attMatch = null;
|
||||
var index = 0;
|
||||
|
||||
// Create array of matches containing opening tags, attributes, values, and separators.
|
||||
while ((match = tagPattern.exec(this.code)) != null){
|
||||
rawTokens.push(token(match[1], 'kw1', match.index));
|
||||
while ((attMatch = attPattern.exec(match[2])) != null){
|
||||
// Attributes
|
||||
index = match.index + match[1].length + attMatch.index;
|
||||
rawTokens.push(token(attMatch[1], 'kw2', index));
|
||||
|
||||
// Separators (=)
|
||||
index += attMatch[1].length + attMatch[2].length;
|
||||
rawTokens.push(token(attMatch[3], 'kw1', index));
|
||||
|
||||
// Values
|
||||
index += attMatch[3].length + attMatch[4].length;
|
||||
rawTokens.push(token(attMatch[5], 'st0', index));
|
||||
}
|
||||
rawTokens.push(token(match[3], 'kw1', match.index + match[1].length + match[2].length));
|
||||
}
|
||||
|
||||
return rawTokens;
|
||||
}
|
||||
});
|
30
EnlighterJS/Source/UI/CodeWindow.js
Normal file
30
EnlighterJS/Source/UI/CodeWindow.js
Normal file
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
---
|
||||
name: CodeWindow
|
||||
description: Opens a new Window with the raw-sourcecode within
|
||||
|
||||
license: MIT-style X11 License
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.UI.CodeWindow]
|
||||
...
|
||||
*/
|
||||
EJS.UI.CodeWindow = (function(code){
|
||||
// code "cleanup"
|
||||
code = code.replace(/&/gim, '&').replace(/</gim, '<').replace(/>/gim, '>');
|
||||
|
||||
// open new window
|
||||
var w = window.open('', '', 'width=' + (window.screen.width -200) + ', height=' + (screen.height-300) + ', menubar=no, titlebar=no, toolbar=no, top=100, left=100, scrollbars=yes, status=no');
|
||||
|
||||
// insert code
|
||||
w.document.body.innerHTML = '<pre>' + code + '</pre>';
|
||||
w.document.title = 'EnlighterJS Sourcecode';
|
||||
});
|
||||
|
||||
|
||||
|
120
EnlighterJS/Source/UI/TabPane.js
Normal file
120
EnlighterJS/Source/UI/TabPane.js
Normal file
|
@ -0,0 +1,120 @@
|
|||
/*
|
||||
---
|
||||
name: TapPane
|
||||
description: Displays multiple code-blocks within a group
|
||||
|
||||
license: MIT-style X11 License
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.UI.TabPane]
|
||||
...
|
||||
*/
|
||||
EJS.UI.TabPane = new Class({
|
||||
|
||||
// wrapper container which contains the controls + panes
|
||||
container: null,
|
||||
|
||||
// control container - contains the tab names
|
||||
controlContainer: null,
|
||||
|
||||
// pane container - contains the tab panes
|
||||
paneContainer: null,
|
||||
|
||||
// array of tab objects
|
||||
tabs: [],
|
||||
|
||||
// current active tab
|
||||
selectedTabIndex: 0,
|
||||
|
||||
/**
|
||||
* @constructs
|
||||
* @param {String} cssClassname The class-name of the outer container
|
||||
*/
|
||||
initialize : function(cssClassname) {
|
||||
// create container
|
||||
this.container = new EJS.Dom.Element('div', {
|
||||
'class': 'EnlighterJSTabPane ' + cssClassname.toLowerCase() + 'EnlighterJSTabPane'
|
||||
});
|
||||
|
||||
// create container structure
|
||||
// <div class="EnlighterJSTabPane ...">
|
||||
// <div class="controls">
|
||||
// <ul> <li>Tab1</li> .... </ul>
|
||||
// </div>
|
||||
// <div class="pane">
|
||||
// <div>Enlighter Tab1</div>
|
||||
// <div>Enlighter Tab2</div>
|
||||
// </div>
|
||||
// </div>
|
||||
this.controlContainer = new EJS.Dom.Element('ul');
|
||||
this.paneContainer = new EJS.Dom.Element('div', {
|
||||
'class': 'pane'
|
||||
});
|
||||
var controlWrapper = new EJS.Dom.Element('div', {
|
||||
'class': 'controls'
|
||||
});
|
||||
controlWrapper.grab(this.controlContainer);
|
||||
|
||||
this.container.grab(controlWrapper);
|
||||
this.container.grab(this.paneContainer);
|
||||
},
|
||||
|
||||
selectTab: function(index){
|
||||
if (index < this.tabs.length){
|
||||
// hide current tab
|
||||
this.tabs[this.selectedTabIndex].pane.setStyle('display', 'none');
|
||||
this.tabs[this.selectedTabIndex].control.removeClass('selected');
|
||||
|
||||
// show selected tab
|
||||
this.tabs[index].pane.setStyle('display', 'block');
|
||||
this.tabs[index].control.addClass('selected');
|
||||
|
||||
// store selected index
|
||||
this.selectedTabIndex = index;
|
||||
}
|
||||
},
|
||||
|
||||
addTab: function(name){
|
||||
// create new control element
|
||||
var ctrl = new EJS.Dom.Element('li', {
|
||||
text: name
|
||||
});
|
||||
this.controlContainer.grab(ctrl);
|
||||
|
||||
// get new tab position
|
||||
var tabIndex = this.tabs.length;
|
||||
|
||||
// select event - display tab
|
||||
ctrl.addEvent('click', function(){
|
||||
this.selectTab(tabIndex);
|
||||
}.bind(this));
|
||||
|
||||
// create new tab element
|
||||
var tab = new EJS.Dom.Element('div', {
|
||||
'styles': {
|
||||
'display': 'none'
|
||||
}
|
||||
});
|
||||
this.paneContainer.grab(tab);
|
||||
|
||||
// store new tab
|
||||
this.tabs.push({
|
||||
control: ctrl,
|
||||
pane: tab
|
||||
});
|
||||
|
||||
// return created tab element
|
||||
return tab;
|
||||
},
|
||||
|
||||
getContainer: function(){
|
||||
return this.container;
|
||||
}
|
||||
|
||||
|
||||
});
|
94
EnlighterJS/Source/UI/Toolbar.js
Normal file
94
EnlighterJS/Source/UI/Toolbar.js
Normal file
|
@ -0,0 +1,94 @@
|
|||
/*
|
||||
---
|
||||
name: Toolbar
|
||||
description: Container which contains various buttons
|
||||
|
||||
license: MIT-style X11 License
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.UI.Toolbar]
|
||||
...
|
||||
*/
|
||||
EJS.UI.Toolbar = new Class({
|
||||
Implements: Options,
|
||||
|
||||
options: {
|
||||
toolbar: {
|
||||
rawTitle: 'Toggle RAW Code',
|
||||
windowTitle: 'Open Code in new Window',
|
||||
infoTitle: 'EnlighterJS Syntax Highlighter'
|
||||
}
|
||||
},
|
||||
|
||||
// toolbar container
|
||||
container: null,
|
||||
|
||||
initialize : function(enlighterInstance){
|
||||
// get options
|
||||
this.setOptions(enlighterInstance.options);
|
||||
|
||||
// create outer container
|
||||
this.container = new EJS.Dom.Element('div', {
|
||||
'class': 'EnlighterJSToolbar'
|
||||
});
|
||||
|
||||
// info button ?
|
||||
if (this.options.infoButton){
|
||||
// create window "button"
|
||||
this.container.grab(new EJS.Dom.Element('a', {
|
||||
'class': 'EnlighterJSInfoButton',
|
||||
title: this.options.toolbar.infoTitle,
|
||||
events: {
|
||||
// open new window on click
|
||||
click: function(){
|
||||
window.open('http://enlighterjs.andidittrich.de');
|
||||
}.bind(this)
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
// toggle button ?
|
||||
if (this.options.rawButton){
|
||||
// create toggle "button"
|
||||
this.container.grab(new EJS.Dom.Element('a', {
|
||||
'class': 'EnlighterJSRawButton',
|
||||
title: this.options.toolbar.rawTitle,
|
||||
events: {
|
||||
click: function(){
|
||||
// trigger toggle
|
||||
enlighterInstance.toggleRawCode();
|
||||
}.bind(this)
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
// code window button ?
|
||||
if (this.options.windowButton){
|
||||
// create window "button"
|
||||
this.container.grab(new EJS.Dom.Element('a', {
|
||||
'class': 'EnlighterJSWindowButton',
|
||||
title: this.options.toolbar.windowTitle,
|
||||
events: {
|
||||
// open new window on click
|
||||
click: function(){
|
||||
EJS.UI.CodeWindow(enlighterInstance.getRawCode(false));
|
||||
}.bind(this)
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
// clearfix
|
||||
this.container.grab(new EJS.Dom.Element('span', {
|
||||
'class': 'clear'
|
||||
}));
|
||||
},
|
||||
|
||||
toElement: function(){
|
||||
return this.container;
|
||||
}
|
||||
});
|
90
EnlighterJS/Source/Util/Helper.js
Normal file
90
EnlighterJS/Source/Util/Helper.js
Normal file
|
@ -0,0 +1,90 @@
|
|||
/*
|
||||
---
|
||||
name: Helper
|
||||
description: Helper to initialize multiple Enlighter instances on your page as well as code-groups
|
||||
|
||||
license: MIT-style X11 License
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Util.Helper]
|
||||
...
|
||||
*/
|
||||
EJS.Util.Helper = (function(elements, options){
|
||||
// break if no elements are selected/found
|
||||
if (elements == null || (elements.length && elements.length == 0)){
|
||||
return;
|
||||
}
|
||||
|
||||
// defaults
|
||||
options = options || {};
|
||||
|
||||
// element grouping disabled?
|
||||
if (options.grouping && options.grouping===false){
|
||||
// highlight all elements
|
||||
elements.enlight(options);
|
||||
|
||||
// use grouping
|
||||
}else{
|
||||
// get separated groups and single elements
|
||||
var groups = {};
|
||||
var ungrouped = [];
|
||||
|
||||
// group elements
|
||||
Array.each(elements, function(el){
|
||||
// extract group name
|
||||
var groupName = el.get('data-enlighter-group');
|
||||
|
||||
// build element tree
|
||||
if (groupName){
|
||||
if (groups[groupName]){
|
||||
groups[groupName].push(el);
|
||||
}else{
|
||||
groups[groupName] = [el];
|
||||
}
|
||||
}else{
|
||||
ungrouped.push(el);
|
||||
}
|
||||
});
|
||||
|
||||
// highlight single elements (non grouped)
|
||||
ungrouped.each(function(el){
|
||||
el.enlight(options);
|
||||
});
|
||||
|
||||
// create & highlight groups
|
||||
Object.each(groups, function(obj){
|
||||
// copy options
|
||||
var localoptions = Object.clone(options);
|
||||
|
||||
// force theme defined within options (all group members should have the same theme as group-leader)
|
||||
localoptions.forceTheme = true;
|
||||
|
||||
// get group-leader theme
|
||||
localoptions.theme = obj[0].get('data-enlighter-theme') || options.theme || 'Enlighter';
|
||||
|
||||
// create new tab pane
|
||||
var tabpane = new EJS.UI.TabPane(localoptions.theme);
|
||||
|
||||
// put enlighted objects into the tabpane
|
||||
Array.each(obj, function(el, index){
|
||||
// create new tab - set title with fallback
|
||||
var container = tabpane.addTab(el.get('data-enlighter-title') || el.get('data-enlighter-language') || localoptions.language);
|
||||
|
||||
// run enlighter
|
||||
(new EJS(el, localoptions, container)).enlight(true);
|
||||
|
||||
}.bind(this));
|
||||
|
||||
// select first tab (group-leader)
|
||||
tabpane.getContainer().inject(obj[0], 'before');
|
||||
tabpane.selectTab(0);
|
||||
|
||||
}.bind(this));
|
||||
}
|
||||
});
|
||||
|
32
EnlighterJS/Source/Util/Init.js
Normal file
32
EnlighterJS/Source/Util/Init.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
---
|
||||
description: Simple global-initialization of inline+block codeblocks
|
||||
|
||||
license: MIT-style X11 License
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS.Util.Init]
|
||||
...
|
||||
*/
|
||||
EJS.Util.Init = (function(blockSelector, inlineSelector, options){
|
||||
// defaults
|
||||
options = options || {};
|
||||
|
||||
// highlight all matching block tags
|
||||
if (blockSelector){
|
||||
options.renderer = 'Block';
|
||||
EJS.Util.Helper(EJS.Dom.getElements(blockSelector), options);
|
||||
}
|
||||
|
||||
// highlight all matching inline tags
|
||||
if (inlineSelector){
|
||||
options.renderer = 'Inline';
|
||||
options.grouping = false;
|
||||
EJS.Util.Helper(EJS.Dom.getElements(inlineSelector), options);
|
||||
}
|
||||
});
|
55
EnlighterJS/Source/Util/Metainit.js
Normal file
55
EnlighterJS/Source/Util/Metainit.js
Normal file
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
---
|
||||
description: Automatical element highlighting using meta tag options
|
||||
|
||||
license: MIT-style X11 License
|
||||
|
||||
authors:
|
||||
- Andi Dittrich
|
||||
|
||||
requires:
|
||||
- Core/1.4.5
|
||||
|
||||
provides: [EnlighterJS]
|
||||
...
|
||||
*/
|
||||
window.addEvent('domready', function(){
|
||||
// metadata config available ? -> autoinit
|
||||
var m = EJS.Dom.getElement('meta[name="EnlighterJS"]');
|
||||
|
||||
// check instance
|
||||
if (!m){
|
||||
return;
|
||||
}
|
||||
|
||||
// create new options object
|
||||
var options = {
|
||||
language: m.get('data-language') || 'generic',
|
||||
theme: m.get('data-theme') || 'Enlighter',
|
||||
indent: m.get('data-indent').toInt() || -1,
|
||||
hover: m.get('data-hover') || 'hoverEnabled',
|
||||
rawButton: (m.get('data-rawcodebutton')==='true'),
|
||||
windowButton: (m.get('data-windowbutton')==='true'),
|
||||
infoButton: (m.get('data-infobutton')==='true'),
|
||||
showLinenumbers: (m.get('data-linenumbers')!=='false')
|
||||
};
|
||||
|
||||
// selector available ? if not, match all pre-tags
|
||||
var blockSelector = m.get('data-selector-block') || 'pre';
|
||||
|
||||
// selector available ? if not, match all pre-tags
|
||||
var inlineSelector = m.get('data-selector-inline') || 'code';
|
||||
|
||||
// highlight all matching block tags
|
||||
if (blockSelector != 'NULL'){
|
||||
options.renderer = 'Block';
|
||||
EJS.Util.Helper(EJS.Dom.getElements(blockSelector), options);
|
||||
}
|
||||
|
||||
// highlight all matching inline tags
|
||||
if (inlineSelector != 'NULL'){
|
||||
options.renderer = 'Inline';
|
||||
options.grouping = false;
|
||||
EJS.Util.Helper(EJS.Dom.getElements(inlineSelector), options);
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue