pull/512/head
nightwing 2018-06-27 23:48:57 +04:00
rodzic 19bfd37aa5
commit eb35256497
192 zmienionych plików z 6295 dodań i 132548 usunięć

3
plugins/node_modules/ace/.gitignore wygenerowano vendored
Wyświetl plik

@ -10,8 +10,10 @@
!/.gitignore
.*.gz
*.tmTheme.js
package-lock.json
# A handy place to put stuff that git should ignore:
/coverage
/ignore/
node_modules/
jam/
@ -20,4 +22,3 @@ jam/
.git-ref
npm-debug.log
deps/
build/*

32
plugins/node_modules/ace/.travis.yml wygenerowano vendored
Wyświetl plik

@ -1 +1,31 @@
language: node_js
language: node_js
node_js:
- "4"
install:
- cleanup() { find node_modules -regextype posix-extended -iregex '.*((test|example|doc|demo)s?|\.(md|ts)|license|idea|coverage|file.txt)$' -exec rm -rf {} \; || echo $?; };
install() { npm i && npm i eslint codecov istanbul && cp package.json node_modules/package.json; cleanup; };
cmp --silent package.json node_modules/package.json || install;
script:
- node node_modules/eslint/bin/eslint "lib/ace/**/*.js"
- node_modules/.bin/istanbul cover lib/ace/test/all.js
- node_modules/.bin/codecov
matrix:
fast_finish: false
cache:
directories:
- node_modules
sudo: false
git:
depth: 1
submodules: false
branches:
only:
- master

2
plugins/node_modules/ace/CNAME wygenerowano vendored
Wyświetl plik

@ -1 +1 @@
ace.c9.io
ace.c9.io

74
plugins/node_modules/ace/ChangeLog.txt wygenerowano vendored
Wyświetl plik

@ -1,3 +1,77 @@
2018.03.26 Version 1.3.3
* fix regession in static-highlight extension
* use css animation for cursor blinking
2018.03.21 Version 1.3.2
* add experimental support for using ace-builds with webpack
2018.02.11 Version 1.3.1
* fixed regression with selectionChange event not firing some times
* improved handling of non-ascii characters in vim normal mode
2018.01.31 Version 1.3.0
* added copy copyWithEmptySelection option
* improved undoManager
* improved settings_menu plugin
* improved handling of files with very long lines
* fixed bug with scrolling editor out of view in transformed elements
2017.10.17 Version 1.2.9
* added support for bidirectional text, with monospace font (Alex Shensis)
* added support for emoji 😊
* new language modes
- Red (Toomas Vooglaid)
- CSound (Nathan Whetsell)
- JSSM (John Haugeland)
* New Themes
- Dracula (Austin Schwartz)
2017.07.02 Version 1.2.8
* Fixed small bugs in searchbox and autocompleter
2017.06.18 Version 1.2.7
* Added Support for arrow keys on external IPad keyboard (Emanuele Tamponi)
* added match counter to searchbox extension
- implemented higlighting of multiline strings in yaml mode (Maxim Trushin)
- improved haml syntax highlighter (Andrés Álvarez)
2016.12.03 Version 1.2.6
* Fixed IME handling on new Chrome
* Support for php 7 in the syntax checker
2016.08.16 Version 1.2.5
* Fixed regression in noconflict mode
2016.07.27 Version 1.2.4
* Maintenance release with several new modes and small bugfixes
2016.01.17 Version 1.2.3
* Bugfixes
- fix memory leak in setSession (Tyler Stalder)
- double click not working on linux/mac
* new language modes
- reStructuredText (Robin Jarry)
- NSIS (Jan T. Sott)
2015.10.28 Version 1.2.1
* new language modes
- Swift
- JSX
2015.07.11 Version 1.2.0
* New Features

Wyświetl plik

@ -56,23 +56,24 @@ function main(args) {
if (i != -1 && args[i+1])
BUILD_DIR = args[i+1];
if (args.indexOf("--h") == -1) {
if (type == "minimal") {
buildAce({
compress: args.indexOf("--m") != -1,
noconflict: args.indexOf("--nc") != -1,
shrinkwrap: args.indexOf("--s") != -1
});
} else if (type == "normal") {
ace();
} else if (type == "demo") {
demo();
} else if (type == "full") {
ace();
demo();
} else if (type == "highlighter") {
// TODO
}
if (args.indexOf("--h") != -1 || args.indexOf("-h") != -1 || args.indexOf("--help") != -1) {
return showHelp();
}
if (type == "minimal") {
buildAce({
compress: args.indexOf("--m") != -1,
noconflict: args.indexOf("--nc") != -1,
shrinkwrap: args.indexOf("--s") != -1
});
} else if (type == "normal") {
ace();
} else if (type == "demo") {
demo();
} else if (type == "full") {
ace();
demo();
} else if (type == "highlighter") {
// TODO
}
}
@ -105,8 +106,37 @@ function ace() {
copy.file(ACE_HOME + "/ChangeLog.txt", BUILD_DIR + "/ChangeLog.txt");
console.log('# ace ---------');
for (var i = 0; i < 4; i++)
buildAce({compress: i & 2, noconflict: i & 1});
for (var i = 0; i < 4; i++) {
buildAce({compress: i & 2, noconflict: i & 1, check: true});
}
}
function buildTypes() {
copy.file(ACE_HOME + "/ace.d.ts", BUILD_DIR + "/ace.d.ts");
var paths = fs.readdirSync(BUILD_DIR + '/src-noconflict');
var pathModules = paths.map(function(path) {
if (/^(mode|theme|ext|keybinding)-/.test(path)) {
var moduleName = path.split('.')[0];
return "declare module 'ace-builds/src-noconflict/" + moduleName + "';";
}
}).filter(Boolean).join('\n')
+ "\ndeclare module 'ace-builds/webpack-resolver';\n";
fs.appendFileSync(BUILD_DIR + '/ace.d.ts', '\n' + pathModules);
var loader = paths.map(function(path) {
if (/\.js$/.test(path) && !/^ace\.js$/.test(path)) {
var moduleName = path.split('.')[0].replace(/-/, "/");
if (/^worker/.test(moduleName))
moduleName = "mode" + moduleName.slice(6) + "_worker";
moduleName = moduleName.replace(/keybinding/, "keyboard");
return "ace.config.setModuleUrl('ace/" + moduleName + "', require('file-loader!./src-noconflict/" + path + "'))";
}
}).join('\n');
fs.writeFileSync(BUILD_DIR + '/webpack-resolver.js', loader, "utf8");
}
function demo() {
@ -237,7 +267,7 @@ function buildAceModuleInternal(opts, callback) {
paths: {
ace: ACE_HOME + "/lib/ace",
"kitchen-sink": ACE_HOME + "/demo/kitchen-sink",
build_support: ACE_HOME + "/build_support",
build_support: ACE_HOME + "/build_support"
},
root: ACE_HOME
};
@ -261,11 +291,7 @@ function buildAceModuleInternal(opts, callback) {
code = result.codeMin;
}
var targetDir = BUILD_DIR + "/src";
if (opts.compress)
targetDir += "-min";
if (opts.noconflict)
targetDir += "-noconflict";
var targetDir = getTargetDir(opts);
var to = /^([\\/]|\w:)/.test(opts.outputFile)
? opts.outputFile
@ -280,9 +306,9 @@ function buildAceModuleInternal(opts, callback) {
if (opts.noconflict)
filters.push(namespace(ns));
var projectType = opts.projectType;
if (projectType == "main" || projectType == "ext") {
if (projectType !== "worker") {
filters.push(exportAce(ns, opts.require[0],
opts.noconflict ? ns : "", projectType == "ext"));
opts.noconflict ? ns : "", projectType !== "main"));
}
filters.push(normalizeLineEndings);
@ -291,7 +317,7 @@ function buildAceModuleInternal(opts, callback) {
build.writeToFile({code: code}, {
outputFolder: path.dirname(to),
outputFile: path.basename(to),
outputFile: path.basename(to)
}, function() {});
callback && callback(err, result);
@ -303,7 +329,7 @@ function buildAceModuleInternal(opts, callback) {
pathConfig: pathConfig,
additional: opts.additional,
enableBrowser: true,
keepDepArrays: "all",
keepDepArrays: opts.noconflict ? "" : "all",
noArchitect: true,
compress: false,
ignore: opts.ignore || [],
@ -337,17 +363,17 @@ function buildSubmodule(options, extra, file, callback) {
});
}
function buildAce(options) {
function buildAce(options, callback) {
var snippetFiles = jsFileList("lib/ace/snippets");
var modeNames = modeList();
buildCore(options, {outputFile: "ace.js"}),
buildCore(options, {outputFile: "ace.js"}, addCb());
// modes
modeNames.forEach(function(name) {
buildSubmodule(options, {
projectType: "mode",
require: ["ace/mode/" + name]
}, "mode-" + name);
}, "mode-" + name, addCb());
});
// snippets
modeNames.forEach(function(name) {
@ -355,29 +381,29 @@ function buildAce(options) {
addSnippetFile(name);
buildSubmodule(options, {
require: ["ace/snippets/" + name],
}, "snippets/" + name);
require: ["ace/snippets/" + name]
}, "snippets/" + name, addCb());
});
// themes
jsFileList("lib/ace/theme").forEach(function(name) {
buildSubmodule(options, {
projectType: "theme",
require: ["ace/theme/" + name]
}, "theme-" + name);
}, "theme-" + name, addCb());
});
// keybindings
["vim", "emacs"].forEach(function(name) {
buildSubmodule(options, {
projectType: "keybinding",
require: ["ace/keyboard/" + name ]
}, "keybinding-" + name);
}, "keybinding-" + name, addCb());
});
// extensions
jsFileList("lib/ace/ext").forEach(function(name) {
buildSubmodule(options, {
projectType: "ext",
require: ["ace/ext/" + name]
}, "ext-" + name);
}, "ext-" + name, addCb());
});
// workers
workers("lib/ace/mode").forEach(function(name) {
@ -389,9 +415,26 @@ function buildAce(options) {
id: "ace/worker/worker",
transforms: [],
order: -1000
}],
}, "worker-" + name);
}]
}, "worker-" + name, addCb());
});
//
function addCb() {
addCb.count = (addCb.count || 0) + 1;
return done
}
function done() {
if (--addCb.count > 0)
return;
if (options.check)
sanityCheck(options, callback);
if (options.noconflict && !options.compress)
buildTypes();
if (callback)
return callback();
console.log("Finished building " + getTargetDir(options))
}
}
function getLoadedFileList(options, callback, result) {
@ -407,6 +450,7 @@ function getLoadedFileList(options, callback, result) {
});
});
delete deps["ace/theme/textmate"];
deps["ace/ace"] = 1;
callback(Object.keys(deps));
}
@ -476,7 +520,7 @@ function namespace(ns) {
.toString()
.replace(/ACE_NAMESPACE\s*=\s*""/, 'ACE_NAMESPACE = "' + ns +'"')
.replace(/\bdefine\(/g, function(def, index, source) {
if (/(^|[;})])\s*$/.test(source.slice(0, index)))
if (/(^|[;}),])\s*$/.test(source.slice(0, index)))
return ns + "." + def;
return def;
});
@ -492,11 +536,18 @@ function exportAce(ns, modules, requireBase, extModules) {
var template = function() {
(function() {
REQUIRE_NS.require(MODULES, function(a) {
a && a.config.init(true);
if (a) {
a.config.init(true);
a.define = REQUIRE_NS.define;
}
if (!window.NS)
window.NS = a;
for (var key in a) if (a.hasOwnProperty(key))
window.NS[key] = a[key];
window.NS["default"] = window.NS;
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = window.NS;
}
});
})();
};
@ -504,7 +555,11 @@ function exportAce(ns, modules, requireBase, extModules) {
if (extModules) {
template = function() {
(function() {
REQUIRE_NS.require(MODULES, function() {});
REQUIRE_NS.require(MODULES, function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
};
}
@ -558,10 +613,23 @@ function addSnippetFile(modeName) {
}
function compress(text) {
var ujs = require("dryice").copy.filter.uglifyjs;
ujs.options.mangle_toplevel = {except: ["ACE_NAMESPACE", "requirejs"]};
ujs.options.beautify = {ascii_only: true, inline_script: true}
return ujs(text);
var uglify = require("dryice").copy.filter.uglifyjs;
uglify.options.mangle_toplevel = {except: ["ACE_NAMESPACE", "requirejs"]};
uglify.options.beautify = {ascii_only: true, inline_script: true}
return asciify(uglify(text));
// copy.filter.uglifyjs.options.ascii_only = true; doesn't work with some uglify.js versions
function asciify(text) {
return text.replace(/[\x00-\x08\x0b\x0c\x0e\x19\x80-\uffff]/g, function(c) {
c = c.charCodeAt(0).toString(16);
if (c.length == 1)
return "\\x0" + c;
if (c.length == 2)
return "\\x" + c;
if (c.length == 3)
return "\\u0" + c;
return "\\u" + c;
});
}
}
function extend(base, extra) {
@ -571,6 +639,36 @@ function extend(base, extra) {
return base;
}
function getTargetDir(opts) {
var targetDir = BUILD_DIR + "/src";
if (opts.compress)
targetDir += "-min";
if (opts.noconflict)
targetDir += "-noconflict";
return targetDir;
}
function sanityCheck(opts, callback) {
var targetDir = getTargetDir(opts);
require("child_process").execFile(process.execPath, ["-e", "(" + function() {
window = global;
require("./ace");
if (typeof ace.edit != "function")
process.exit(1);
require("fs").readdirSync(".").forEach(function(p) {
if (!/ace\.js$/.test(p) && /\.js$/.test(p))
require("./" + p);
});
process.exit(0);
} + ")()"], {
cwd: targetDir
}, function(err, stdout) {
if (callback) return callback(err, stdout);
if (err)
throw err;
});
}
if (!module.parent)
main(process.argv);
else

66
plugins/node_modules/ace/Readme.md wygenerowano vendored
Wyświetl plik

@ -1,6 +1,8 @@
Ace (Ajax.org Cloud9 Editor)
============================
[![Build Status](https://secure.travis-ci.org/ajaxorg/ace.svg?branch=master)](http://travis-ci.org/ajaxorg/ace) [![npm](https://img.shields.io/npm/v/ace-builds.svg)](https://www.npmjs.com/package/ace-builds)
_Note_: The new site at http://ace.c9.io contains all the info below along with an embedding guide and all the other resources you need to get started with Ace.
Ace is a standalone code editor written in JavaScript. Our goal is to create a browser based editor that matches and extends the features, usability and performance of existing native editors such as TextMate, Vim or Eclipse. It can be easily embedded in any web page or JavaScript application. Ace is developed as the primary editor for [Cloud9 IDE](https://c9.io/) and the successor of the Mozilla Skywriter (Bespin) Project.
@ -8,7 +10,7 @@ Ace is a standalone code editor written in JavaScript. Our goal is to create a b
Features
--------
* Syntax highlighting for over 110 languages (TextMate/Sublime/_.tmlanguage_ files can be imported)
* Syntax highlighting for over 120 languages (TextMate/Sublime/_.tmlanguage_ files can be imported)
* Over 20 themes (TextMate/Sublime/_.tmtheme_ files can be imported)
* Automatic indent and outdent
* An optional command line
@ -41,48 +43,56 @@ Ace can be easily embedded into any existing web page. You can either use one of
The easiest version is simply:
```html
<div id="editor">some text</div>
<script src="src/ace.js" type="text/javascript" charset="utf-8"></script>
<script>
var editor = ace.edit("editor");
</script>
<div id="editor">some text</div>
<script src="src/ace.js" type="text/javascript" charset="utf-8"></script>
<script>
var editor = ace.edit("editor");
</script>
```
With "editor" being the id of the DOM element, which should be converted to an editor. Note that this element must be explicitly sized and positioned `absolute` or `relative` for Ace to work. e.g.
```css
#editor {
position: absolute;
width: 500px;
height: 400px;
}
#editor {
position: absolute;
width: 500px;
height: 400px;
}
```
To change the theme simply include the Theme's JavaScript file
```html
<script src="src/theme-twilight.js" type="text/javascript" charset="utf-8"></script>
<script src="src/theme-twilight.js" type="text/javascript" charset="utf-8"></script>
```
and configure the editor to use the theme:
```javascript
editor.setTheme("ace/theme/twilight");
editor.setTheme("ace/theme/twilight");
```
By default the editor only supports plain text mode; many other languages are available as separate modules. After including the mode's JavaScript file:
```html
<script src="src/mode-javascript.js" type="text/javascript" charset="utf-8"></script>
<script src="src/mode-javascript.js" type="text/javascript" charset="utf-8"></script>
```
The mode can then be used like this:
```javascript
var JavaScriptMode = ace.require("ace/mode/javascript").Mode;
editor.getSession().setMode(new JavaScriptMode());
var JavaScriptMode = ace.require("ace/mode/javascript").Mode;
editor.session.setMode(new JavaScriptMode());
```
to destroy editor use
```javascript
editor.destroy();
editor.container.remove();
```
Documentation
-------------
@ -97,17 +107,10 @@ If you still need help, feel free to drop a mail on the [ace mailing list](http:
Running Ace
-----------
After the checkout Ace works out of the box. No build step is required. To try it out, simply start the bundled mini HTTP server:
After the checkout Ace works out of the box. No build step is required. To try it out, simply start the bundled mini HTTP server using Node.JS
```bash
./static.py
```
Or using Node.JS
```bash
npm install mime
node ./static.js
node ./static.js
```
The editor can then be opened at http://localhost:8888/kitchen-sink.html.
@ -122,8 +125,8 @@ You do not generally need to build ACE. The [ace-builds repository](https://gith
However, all you need is Node.js and npm installed to package ACE. Just run `npm install` in the ace folder to install dependencies:
```bash
npm install
node ./Makefile.dryice.js
npm install
node ./Makefile.dryice.js
```
To package Ace, we use the dryice build tool developed by the Mozilla Skywriter team. Call `node Makefile.dryice.js` on the command-line to start the packing. This build script accepts the following options
@ -143,7 +146,7 @@ Running the Unit Tests
The Ace unit tests can run on node.js. Assuming you have already done `npm install`, just call:
```bash
node lib/ace/test/all.js
node lib/ace/test/all.js
```
You can also run the tests in your browser by serving:
@ -159,10 +162,3 @@ Ace is a community project and wouldn't be what it is without contributions! We
Feel free to fork and improve/enhance Ace any way you want. If you feel that the editor or the Ace community will benefit from your changes, please open a pull request. For more information on our contributing guidelines, see [CONTRIBUTING.md](https://github.com/ajaxorg/ace/blob/master/CONTRIBUTING.md).
Continuous Integration status
-----------------------------
This project is tested with [Travis CI](http://travis-ci.org)
[![Build Status](https://secure.travis-ci.org/ajaxorg/ace.png?branch=master)](http://travis-ci.org/ajaxorg/ace)

797
plugins/node_modules/ace/ace.d.ts wygenerowano vendored 100644
Wyświetl plik

@ -0,0 +1,797 @@
export namespace Ace {
export type NewLineMode = 'auto' | 'unix' | 'windows';
export interface Anchor extends EventEmitter {
getPosition(): Position;
getDocument(): Document;
setPosition(row: number, column: number, noClip?: boolean): void;
detach(): void;
attach(doc: Document): void;
}
export interface Document extends EventEmitter {
setValue(text: string): void;
getValue(): string;
createAnchor(row: number, column: number): Anchor;
getNewLineCharacter(): string;
setNewLineMode(newLineMode: NewLineMode): void;
getNewLineMode(): NewLineMode;
isNewLine(text: string): boolean;
getLine(row: number): string;
getLines(firstRow: number, lastRow: number): string[];
getAllLines(): string[];
getTextRange(range: Range): string;
getLinesForRange(range: Range): string[];
insert(position: Position, text: string): Position;
insertInLine(position: Position, text: string): Position;
clippedPos(row: number, column: number): Point;
clonePos(pos: Point): Point;
pos(row: number, column: number): Point;
insertFullLines(row: number, lines: string[]): void;
insertMergedLines(position: Position, lines: string[]): Point;
remove(range: Range): Position;
removeInLine(row: number, startColumn: number, endColumn: number): Position;
removeFullLines(firstRow: number, lastRow: number): string[];
removeNewLine(row: number): void;
replace(range: Range, text: string): Position;
applyDeltas(deltas: Delta[]): void;
revertDeltas(deltas: Delta[]): void;
applyDelta(delta: Delta, doNotValidate?: boolean): void;
revertDelta(delta: Delta): void;
indexToPosition(index: number, startRow: number): Position;
positionToIndex(pos: Position, startRow?: number): number;
}
export interface FoldLine {
folds: Fold[];
range: Range;
start: Point;
end: Point;
shiftRow(shift: number): void;
addFold(fold: Fold): void;
containsRow(row: number): boolean;
walk(callback: Function, endRow?: number, endColumn?: number): void;
getNextFoldTo(row: number, column: number): null | { fold: Fold, kind: string };
addRemoveChars(row: number, column: number, len: number): void;
split(row: number, column: number): FoldLine;
merge(foldLineNext: FoldLine): void;
idxToPosition(idx: number): Point;
}
export interface Fold {
range: Range;
start: Point;
end: Point;
foldLine?: FoldLine;
sameRow: boolean;
subFolds: Fold[];
setFoldLine(foldLine: FoldLine): void;
clone(): Fold;
addSubFold(fold: Fold): Fold;
restoreRange(range: Range): void;
}
export interface Range {
start: Point;
end: Point;
isEqual(range: Range): boolean;
toString(): string;
contains(row: number, column: number): boolean;
compareRange(range: Range): number;
comparePoint(p: Point): number;
containsRange(range: Range): boolean;
intersects(range: Range): boolean;
isEnd(row: number, column: number): boolean;
isStart(row: number, column: number): boolean;
setStart(row: number, column: number): void;
setEnd(row: number, column: number): void;
inside(row: number, column: number): boolean;
insideStart(row: number, column: number): boolean;
insideEnd(row: number, column: number): boolean;
compare(row: number, column: number): number;
compareStart(row: number, column: number): number;
compareEnd(row: number, column: number): number;
compareInside(row: number, column: number): number;
clipRows(firstRow: number, lastRow: number): Range;
extend(row: number, column: number): Range;
isEmpty(): boolean;
isMultiLine(): boolean;
clone(): Range;
collapseRows(): Range;
toScreenRange(session: EditSession): Range;
moveBy(row: number, column: number): void;
}
export interface EditSessionOptions {
wrap: string | number;
wrapMethod: 'code' | 'text' | 'auto';
indentedSoftWrap: boolean;
firstLineNumber: number;
useWorker: boolean;
useSoftTabs: boolean;
tabSize: number;
navigateWithinSoftTabs: boolean;
foldStyle: 'markbegin' | 'markbeginend' | 'manual';
overwrite: boolean;
newLineMode: NewLineMode;
mode: string;
}
export interface VirtualRendererOptions {
animatedScroll: boolean;
showInvisibles: boolean;
showPrintMargin: boolean;
printMarginColumn: number;
printMargin: boolean | number;
showGutter: boolean;
fadeFoldWidgets: boolean;
showFoldWidgets: boolean;
showLineNumbers: boolean;
displayIndentGuides: boolean;
highlightGutterLine: boolean;
hScrollBarAlwaysVisible: boolean;
vScrollBarAlwaysVisible: boolean;
fontSize: number;
fontFamily: string;
maxLines: number;
minLines: number;
scrollPastEnd: boolean;
fixedWidthGutter: boolean;
theme: string;
hasCssTransforms: boolean;
maxPixelHeight: number;
}
export interface MouseHandlerOptions {
scrollSpeed: number;
dragDelay: number;
dragEnabled: boolean;
focusTimeout: number;
tooltipFollowsMouse: boolean;
}
export interface EditorOptions extends EditSessionOptions,
MouseHandlerOptions,
VirtualRendererOptions {
selectionStyle: string;
highlightActiveLine: boolean;
highlightSelectedWord: boolean;
readOnly: boolean;
copyWithEmptySelection: boolean;
cursorStyle: 'ace' | 'slim' | 'smooth' | 'wide';
mergeUndoDeltas: true | false | 'always';
behavioursEnabled: boolean;
wrapBehavioursEnabled: boolean;
autoScrollEditorIntoView: boolean;
keyboardHandler: string;
value: string;
session: EditSession;
}
export interface SearchOptions {
needle: string | RegExp;
preventScroll: boolean;
backwards: boolean;
start: Range;
skipCurrent: boolean;
range: Range;
preserveCase: boolean;
regExp: RegExp;
wholeWord: string;
caseSensitive: boolean;
wrap: boolean;
}
export interface EventEmitter {
once(name: string, callback: Function): void;
setDefaultHandler(name: string, callback: Function): void;
removeDefaultHandler(name: string, callback: Function): void;
on(name: string, callback: Function, capturing?: boolean): void;
addEventListener(name: string, callback: Function, capturing?: boolean): void;
off(name: string, callback: Function): void;
removeListener(name: string, callback: Function): void;
removeEventListener(name: string, callback: Function): void;
}
export interface Point {
row: number;
column: number;
}
export interface Delta {
action: 'insert' | 'remove';
start: Point;
end: Point;
lines: string[];
}
export interface Annotation {
row?: number;
column?: number;
text: string;
type: string;
}
export interface Command {
name?: string;
bindKey?: string | { mac?: string, win?: string };
readOnly?: boolean;
exec: (editor: Editor, args?: any) => void;
}
export type CommandLike = Command | ((editor: Editor) => void);
export interface KeyboardHandler {
handleKeyboard: Function;
}
export interface MarkerLike {
range: Range;
type: string;
renderer?: MarkerRenderer;
clazz: string;
inFront: boolean;
id: number;
update?: (html: string[],
// TODO maybe define Marker class
marker: any,
session: EditSession,
config: any) => void;
}
export type MarkerRenderer = (html: string[],
range: Range,
left: number,
top: number,
config: any) => void;
export interface Token {
type: string;
value: string;
index?: number;
start?: number;
}
export interface Completion {
value: string;
score: number;
meta?: string;
name?: string;
caption?: string;
}
export interface Tokenizer {
removeCapturingGroups(src: string): string;
createSplitterRegexp(src: string, flag?: string): RegExp;
getLineTokens(line: string, startState: string | string[]): Token[];
}
export interface SyntaxMode {
getTokenizer(): Tokenizer;
toggleCommentLines(state: any,
session: EditSession,
startRow: number,
endRow: number): void;
toggleBlockComment(state: any,
session: EditSession,
range: Range,
cursor: Position): void;
getNextLineIndent(state: any, line: string, tab: string): string;
checkOutdent(state: any, line: string, input: string): boolean;
autoOutdent(state: any, doc: Document, row: number): void;
// TODO implement WorkerClient types
createWorker(session: EditSession): any;
createModeDelegates(mapping: {[key: string]: string}): void;
transformAction(state: string,
action: string,
editor: Editor,
session: EditSession,
text: string): any;
getKeywords(append?: boolean): Array<string | RegExp>;
getCompletions(state: string,
session: EditSession,
pos: Position,
prefix: string): Completion[];
}
export interface Config {
get(key: string): any;
set(key: string, value: any): void;
all(): {[key: string]: any};
moduleUrl(name: string, component?: string): string;
setModuleUrl(name: string, subst: string): string;
loadModule(moduleName: string | [string, string],
onLoad: (module: any) => void): void;
init(packaged: any): any;
defineOptions(obj: any, path: string, options: {[key: string]: any}): Config;
resetOptions(obj: any): void;
setDefaultValue(path: string, name: string, value: any): void;
setDefaultValues(path: string, optionHash: {[key: string]: any}): void;
}
export interface OptionsProvider {
setOptions(optList: {[key: string]: any}): void;
getOptions(optionNames?: string[] | {[key: string]: any}): {[key: string]: any};
setOption(name: string, value: any): void;
getOption(name: string): any;
}
export interface UndoManager {
addSession(session: EditSession): void;
add(delta: Delta, allowMerge: boolean, session: EditSession): void;
addSelection(selection: string, rev?: number): void;
startNewGroup(): void;
markIgnored(from: number, to?: number): void;
getSelection(rev: number, after?: boolean): { value: string, rev: number };
getRevision(): number;
getDeltas(from: number, to?: number): Delta[];
undo(session: EditSession, dontSelect?: boolean): void;
redo(session: EditSession, dontSelect?: boolean): void;
reset(): void;
canUndo(): boolean;
canRedo(): boolean;
bookmark(rev?: number): void;
isAtBookmark(): boolean;
}
export interface EditSession extends EventEmitter, OptionsProvider {
selection: Selection;
on(name: 'changeFold',
callback: (obj: { data: Fold, action: string }) => void): void;
on(name: 'changeScrollLeft', callback: (scrollLeft: number) => void): void;
on(name: 'changeScrollTop', callback: (scrollTop: number) => void): void;
on(name: 'tokenizerUpdate',
callback: (obj: { data: { first: number, last: number } }) => void): void;
setOption<T extends keyof EditSessionOptions>(name: T, value: EditSessionOptions[T]): void;
getOption<T extends keyof EditSessionOptions>(name: T): EditSessionOptions[T];
setDocument(doc: Document): void;
getDocument(): Document;
resetCaches(): void;
setValue(text: string): void;
getValue(): string;
getSelection(): Selection;
getState(row: number): string;
getTokens(row: number): Token[];
getTokenAt(row: number, column: number): Token | null;
setUndoManager(undoManager: UndoManager): void;
markUndoGroup(): void;
getUndoManager(): UndoManager;
getTabString(): string;
setUseSoftTabs(val: boolean): void;
getUseSoftTabs(): boolean;
setTabSize(tabSize: number): void;
getTabSize(): number;
isTabStop(position: Position): boolean;
setNavigateWithinSoftTabs(navigateWithinSoftTabs: boolean): void;
getNavigateWithinSoftTabs(): boolean;
setOverwrite(overwrite: boolean): void;
getOverwrite(): boolean;
toggleOverwrite(): void;
addGutterDecoration(row: number, className: string): void;
removeGutterDecoration(row: number, className: string): void;
getBreakpoints(): string[];
setBreakpoints(rows: number[]): void;
clearBreakpoints(): void;
setBreakpoint(row: number, className: string): void;
clearBreakpoint(row: number): void;
addMarker(range: Range,
clazz: string,
type: MarkerRenderer,
inFront: boolean): number;
addDynamicMarker(marker: MarkerLike, inFront: boolean): MarkerLike;
removeMarker(markerId: number): void;
getMarkers(inFront?: boolean): MarkerLike[];
highlight(re: RegExp): void;
highlightLines(startRow: number,
endRow: number,
clazz: string,
inFront?: boolean): Range;
setAnnotations(annotations: Annotation[]): void;
getAnnotations(): Annotation[];
clearAnnotations(): void;
getWordRange(row: number, column: number): Range;
getAWordRange(row: number, column: number): Range;
setNewLineMode(newLineMode: NewLineMode): void;
getNewLineMode(): NewLineMode;
setUseWorker(useWorker: boolean): void;
getUseWorker(): boolean;
setMode(mode: string | SyntaxMode, callback?: () => void): void;
getMode(): SyntaxMode;
setScrollTop(scrollTop: number): void;
getScrollTop(): number;
setScrollLeft(scrollLeft: number): void;
getScrollLeft(): number;
getScreenWidth(): number;
getLineWidgetMaxWidth(): number;
getLine(row: number): string;
getLines(firstRow: number, lastRow: number): string[];
getLength(): number;
getTextRange(range: Range): string;
insert(position: Position, text: string): void;
remove(range: Range): void;
removeFullLines(firstRow: number, lastRow: number): void;
undoChanges(deltas: Delta[], dontSelect?: boolean): void;
redoChanges(deltas: Delta[], dontSelect?: boolean): void;
setUndoSelect(enable: boolean): void;
replace(range: Range, text: string): void;
moveText(fromRange: Range, toPosition: Position, copy?: boolean): void;
indentRows(startRow: number, endRow: number, indentString: string): void;
outdentRows(range: Range): void;
moveLinesUp(firstRow: number, lastRow: number): void;
moveLinesDown(firstRow: number, lastRow: number): void;
duplicateLines(firstRow: number, lastRow: number): void;
setUseWrapMode(useWrapMode: boolean): void;
getUseWrapMode(): boolean;
setWrapLimitRange(min: number, max: number): void;
adjustWrapLimit(desiredLimit: number): boolean;
getWrapLimit(): number;
setWrapLimit(limit: number): void;
getWrapLimitRange(): { min: number, max: number };
getRowLineCount(row: number): number;
getRowWrapIndent(screenRow: number): number;
getScreenLastRowColumn(screenRow: number): number;
getDocumentLastRowColumn(docRow: number, docColumn: number): number;
getdocumentLastRowColumnPosition(docRow: number, docColumn: number): Position;
getRowSplitData(row: number): string | undefined;
getScreenTabSize(screenColumn: number): number;
screenToDocumentRow(screenRow: number, screenColumn: number): number;
screenToDocumentColumn(screenRow: number, screenColumn: number): number;
screenToDocumentPosition(screenRow: number,
screenColumn: number,
offsetX?: number): Position;
documentToScreenPosition(docRow: number, docColumn: number): Position;
documentToScreenPosition(position: Position): Position;
documentToScreenColumn(row: number, docColumn: number): number;
documentToScreenRow(docRow: number, docColumn: number): number;
getScreenLength(): number;
destroy(): void;
}
export interface KeyBinding {
setDefaultHandler(handler: KeyboardHandler): void;
setKeyboardHandler(handler: KeyboardHandler): void;
addKeyboardHandler(handler: KeyboardHandler, pos: number): void;
removeKeyboardHandler(handler: KeyboardHandler): boolean;
getKeyboardHandler(): KeyboardHandler;
getStatusText(): string;
}
export interface CommandManager extends EventEmitter {
on(name: 'exec', callback: (obj: {
editor: Editor,
command: Command,
args: any[]
}) => void): void;
once(name: string, callback: Function): void;
setDefaultHandler(name: string, callback: Function): void;
removeDefaultHandler(name: string, callback: Function): void;
on(name: string, callback: Function, capturing?: boolean): void;
addEventListener(name: string, callback: Function, capturing?: boolean): void;
off(name: string, callback: Function): void;
removeListener(name: string, callback: Function): void;
removeEventListener(name: string, callback: Function): void;
exec(command: string, editor: Editor, args: any): boolean;
toggleRecording(editor: Editor): void;
replay(editor: Editor): void;
addCommand(command: Command): void;
removeCommand(command: Command, keepCommand?: boolean): void;
bindKey(key: string | { mac?: string, win?: string},
command: CommandLike,
position?: number): void;
}
export interface VirtualRenderer extends OptionsProvider, EventEmitter {
container: HTMLElement;
setOption<T extends keyof VirtualRendererOptions>(name: T, value: VirtualRendererOptions[T]): void;
getOption<T extends keyof VirtualRendererOptions>(name: T): VirtualRendererOptions[T];
setSession(session: EditSession): void;
updateLines(firstRow: number, lastRow: number, force?: boolean): void;
updateText(): void;
updateFull(force?: boolean): void;
updateFontSize(): void;
adjustWrapLimit(): boolean;
setAnimatedScroll(shouldAnimate: boolean): void;
getAnimatedScroll(): boolean;
setShowInvisibles(showInvisibles: boolean): void;
getShowInvisibles(): boolean;
setDisplayIndentGuides(display: boolean): void;
getDisplayIndentGuides(): boolean;
setShowPrintMargin(showPrintMargin: boolean): void;
getShowPrintMargin(): boolean;
setPrintMarginColumn(showPrintMargin: boolean): void;
getPrintMarginColumn(): boolean;
setShowGutter(show: boolean): void;
getShowGutter(): boolean;
setFadeFoldWidgets(show: boolean): void;
getFadeFoldWidgets(): boolean;
setHighlightGutterLine(shouldHighlight: boolean): void;
getHighlightGutterLine(): boolean;
getContainerElement(): HTMLElement;
getMouseEventTarget(): HTMLElement;
getTextAreaContainer(): HTMLElement;
getFirstVisibleRow(): number;
getFirstFullyVisibleRow(): number;
getLastFullyVisibleRow(): number;
getLastVisibleRow(): number;
setPadding(padding: number): void;
setScrollMargin(top: number,
bottom: number,
left: number,
right: number): void;
setHScrollBarAlwaysVisible(alwaysVisible: boolean): void;
getHScrollBarAlwaysVisible(): boolean;
setVScrollBarAlwaysVisible(alwaysVisible: boolean): void;
getVScrollBarAlwaysVisible(): boolean;
freeze(): void;
unfreeze(): void;
updateFrontMarkers(): void;
updateBackMarkers(): void;
updateBreakpoints(): void;
setAnnotations(annotations: Annotation[]): void;
updateCursor(): void;
hideCursor(): void;
showCursor(): void;
scrollSelectionIntoView(anchor: Position,
lead: Position,
offset?: number): void;
scrollCursorIntoView(cursor: Position, offset?: number): void;
getScrollTop(): number;
getScrollLeft(): number;
getScrollTopRow(): number;
getScrollBottomRow(): number;
scrollToRow(row: number): void;
alignCursor(cursor: Position | number, alignment: number): number;
scrollToLine(line: number,
center: boolean,
animate: boolean,
callback: () => void): void;
animateScrolling(fromValue: number, callback: () => void): void;
scrollToY(scrollTop: number): void;
scrollToX(scrollLeft: number): void;
scrollTo(x: number, y: number): void;
scrollBy(deltaX: number, deltaY: number): void;
isScrollableBy(deltaX: number, deltaY: number): boolean;
textToScreenCoordinates(row: number, column: number): { pageX: number, pageY: number};
visualizeFocus(): void;
visualizeBlur(): void;
showComposition(position: number): void;
setCompositionText(text: string): void;
hideComposition(): void;
setTheme(theme: string, callback?: () => void): void;
getTheme(): string;
setStyle(style: string, include?: boolean): void;
unsetStyle(style: string): void;
setCursorStyle(style: string): void;
setMouseCursor(cursorStyle: string): void;
attachToShadowRoot(): void;
destroy(): void;
}
export interface Selection extends EventEmitter {
moveCursorWordLeft(): void;
moveCursorWordRight(): void;
fromOrientedRange(range: Range): void;
setSelectionRange(match: any): void;
getAllRanges(): Range[];
addRange(range: Range): void;
isEmpty(): boolean;
isMultiLine(): boolean;
setCursor(row: number, column: number): void;
setAnchor(row: number, column: number): void;
getAnchor(): Position;
getCursor(): Position;
isBackwards(): boolean;
getRange(): Range;
clearSelection(): void;
selectAll(): void;
setRange(range: Range, reverse?: boolean): void;
selectTo(row: number, column: number): void;
selectToPosition(pos: any): void;
selectUp(): void;
selectDown(): void;
selectRight(): void;
selectLeft(): void;
selectLineStart(): void;
selectLineEnd(): void;
selectFileEnd(): void;
selectFileStart(): void;
selectWordRight(): void;
selectWordLeft(): void;
getWordRange(): void;
selectWord(): void;
selectAWord(): void;
selectLine(): void;
moveCursorUp(): void;
moveCursorDown(): void;
moveCursorLeft(): void;
moveCursorRight(): void;
moveCursorLineStart(): void;
moveCursorLineEnd(): void;
moveCursorFileEnd(): void;
moveCursorFileStart(): void;
moveCursorLongWordRight(): void;
moveCursorLongWordLeft(): void;
moveCursorBy(rows: number, chars: number): void;
moveCursorToPosition(position: any): void;
moveCursorTo(row: number, column: number, keepDesiredColumn?: boolean): void;
moveCursorToScreen(row: number, column: number, keepDesiredColumn: boolean): void;
}
var Selection: {
new(session: EditSession): Selection;
}
export interface Editor extends OptionsProvider, EventEmitter {
container: HTMLElement;
renderer: VirtualRenderer;
id: string;
commands: CommandManager;
keyBinding: KeyBinding;
session: EditSession;
selection: Selection;
on(name: 'blur', callback: (e: Event) => void): void;
on(name: 'change', callback: (delta: Delta) => void): void;
on(name: 'changeSelectionStyle', callback: (obj: { data: string }) => void): void;
on(name: 'changeSession',
callback: (obj: { session: EditSession, oldSession: EditSession }) => void): void;
on(name: 'copy', callback: (obj: { text: string }) => void): void;
on(name: 'focus', callback: (e: Event) => void): void;
on(name: 'paste', callback: (obj: { text: string }) => void): void;
setOption<T extends keyof EditorOptions>(name: T, value: EditorOptions[T]): void;
getOption<T extends keyof EditorOptions>(name: T): EditorOptions[T];
setKeyboardHandler(keyboardHandler: string, callback?: () => void): void;
getKeyboardHandler(): string;
setSession(session: EditSession): void;
getSession(): EditSession;
setValue(val: string, cursorPos?: number): string;
getValue(): string;
getSelection(): Selection;
resize(force?: boolean): void;
setTheme(theme: string, callback?: () => void): void;
getTheme(): string;
setStyle(style: string): void;
unsetStyle(style: string): void;
getFontSize(): string;
setFontSize(size: string): void;
focus(): void;
isFocused(): boolean;
flur(): void;
getSelectedText(): string;
getCopyText(): string;
execCommand(command: string | string[], args: any): boolean;
insert(text: string, pasted?: boolean): void;
setOverwrite(overwrite: boolean): void;
getOverwrite(): boolean;
toggleOverwrite(): void;
setScrollSpeed(speed: number): void;
getScrollSpeed(): number;
setDragDelay(dragDelay: number): void;
getDragDelay(): number;
setSelectionStyle(val: string): void;
getSelectionStyle(): string;
setHighlightActiveLine(shouldHighlight: boolean): void;
getHighlightActiveLine(): boolean;
setHighlightGutterLine(shouldHighlight: boolean): void;
getHighlightGutterLine(): boolean;
setHighlightSelectedWord(shouldHighlight: boolean): void;
getHighlightSelectedWord(): boolean;
setAnimatedScroll(shouldAnimate: boolean): void;
getAnimatedScroll(): boolean;
setShowInvisibles(showInvisibles: boolean): void;
getShowInvisibles(): boolean;
setDisplayIndentGuides(display: boolean): void;
getDisplayIndentGuides(): boolean;
setShowPrintMargin(showPrintMargin: boolean): void;
getShowPrintMargin(): boolean;
setPrintMarginColumn(showPrintMargin: number): void;
getPrintMarginColumn(): number;
setReadOnly(readOnly: boolean): void;
getReadOnly(): boolean;
setBehavioursEnabled(enabled: boolean): void;
getBehavioursEnabled(): boolean;
setWrapBehavioursEnabled(enabled: boolean): void;
getWrapBehavioursEnabled(): boolean;
setShowFoldWidgets(show: boolean): void;
getShowFoldWidgets(): boolean;
setFadeFoldWidgets(fade: boolean): void;
getFadeFoldWidgets(): boolean;
remove(dir?: 'left' | 'right'): void;
removeWordRight(): void;
removeWordLeft(): void;
removeLineToEnd(): void;
splitLine(): void;
transposeLetters(): void;
toLowerCase(): void;
toUpperCase(): void;
indent(): void;
blockIndent(): void;
blockOutdent(): void;
sortLines(): void;
toggleCommentLines(): void;
toggleBlockComment(): void;
modifyNumber(amount: number): void;
removeLines(): void;
duplicateSelection(): void;
moveLinesDown(): void;
moveLinesUp(): void;
moveText(range: Range, toPosition: Point, copy?: boolean): Range;
copyLinesUp(): void;
copyLinesDown(): void;
getFirstVisibleRow(): number;
getLastVisibleRow(): number;
isRowVisible(row: number): boolean;
isRowFullyVisible(row: number): boolean;
selectPageDown(): void;
selectPageUp(): void;
gotoPageDown(): void;
gotoPageUp(): void;
scrollPageDown(): void;
scrollPageUp(): void;
scrollToRow(row: number): void;
scrollToLine(line: number, center: boolean, animate: boolean, callback: () => void): void;
centerSelection(): void;
getCursorPosition(): Point;
getCursorPositionScreen(): Point;
getSelectionRange(): Range;
selectAll(): void;
clearSelection(): void;
moveCursorTo(row: number, column: number): void;
moveCursorToPosition(pos: Point): void;
jumpToMatching(select: boolean, expand: boolean): void;
gotoLine(lineNumber: number, column: number, animate: boolean): void;
navigateTo(row: number, column: number): void;
navigateUp(): void;
navigateDown(): void;
navigateLeft(): void;
navigateRight(): void;
navigateLineStart(): void;
navigateLineEnd(): void;
navigateFileEnd(): void;
navigateFileStart(): void;
navigateWordRight(): void;
navigateWordLeft(): void;
replace(replacement: string, options?: Partial<SearchOptions>): number;
replaceAll(replacement: string, options?: Partial<SearchOptions>): number;
getLastSearchOptions(): Partial<SearchOptions>;
find(needle: string, options?: Partial<SearchOptions>, animate?: boolean): void;
findNext(options?: Partial<SearchOptions>, animate?: boolean): void;
findPrevious(options?: Partial<SearchOptions>, animate?: boolean): void;
undo(): void;
redo(): void;
destroy(): void;
setAutoScrollEditorIntoView(enable: boolean): void;
}
}
export const version: string;
export const config: Ace.Config;
export function require(name: string): any;
export function edit(el: Element | string, options?: Partial<Ace.EditorOptions>): Ace.Editor;
export function createEditSession(text: Ace.Document | string, mode: Ace.SyntaxMode): Ace.EditSession;
export const VirtualRenderer: {
new(container: HTMLElement, theme?: string): Ace.VirtualRenderer;
};
export const EditSession: {
new(text: string | Document, mode?: Ace.SyntaxMode): Ace.EditSession;
};
export const UndoManager: {
new(): Ace.UndoManager;
};
export const Range: {
new(startRow: number, startColumn: number, endRow: number, endColumn: number): Ace.Range;
fromPoints(start: Ace.Point, end: Ace.Point): Ace.Range;
comparePoints(p1: Ace.Point, p2: Ace.Point): number;
};

Wyświetl plik

@ -1,112 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link href="style.css" rel="stylesheet" type="text/css">
<title>Ace Bookmarklet Builder</title>
</head>
<body>
<div id="wrapper">
<div class="content" style="width: 950px">
<div class="column1" style="margin-top: 47px">
<textarea id="textarea" style="width:300px; height:300px">
/**
* This is Ace injected using a bookmarklet.
*/
function foo() {
var bar = true;
}</textarea><br>
SourceUrl: <br>
<input id="srcURL" style="width:300px" value="http://ajaxorg.github.com/ace-builds/src-noconflict"></input><br>
<button id="buBuild">Build Link</button> <br> <a href="#"></a>
<a href="https://github.com/ajaxorg/ace/">
<div class="fork_on_github" ></div>
</a>
</div>
<div class="column2">
<h1>Ace Bookmarklet Builder</h1>
<p id="first">
<strong>WARNING:</strong> Currently, this is only supported in non IE browsers.
</p>
<h2>How to use it:</h2>
<ul>
<li>Select the options as you want them to be by default.</li>
<li>Enter the "SourceUrl". This has to be the URL pointing to build/textarea/src/ (you can leave the default to server the scripts from GitHub).</li>
<li>Click the "Build Link" button to generate your custom Ace Bookmarklet.</li>
<li>Drag the generated link to your toolbar or store it somewhere else.</li>
<li>Go to a page with a textarea element and click the bookmarklet - wait a little bit till the files are loaded.</li>
<li>Click three times on the textarea you want to replace - Ace will replace it.</li>
<li>To change settings, just click the red icon in the bottom right corner.</li>
</ul>
</div>
</div>
</div>
<script>
function inject(options, callback) {
var baseUrl = options.baseUrl || "../../src-noconflict";
var load = function(path, callback) {
var head = document.getElementsByTagName('head')[0];
var s = document.createElement('script');
s.src = baseUrl + "/" + path;
head.appendChild(s);
s.onload = s.onreadystatechange = function(_, isAbort) {
if (isAbort || !s.readyState || s.readyState == "loaded" || s.readyState == "complete") {
s = s.onload = s.onreadystatechange = null;
if (!isAbort)
callback();
}
};
};
load("ace.js", function() {
ace.config.loadModule("ace/ext/textarea", function() {
var event = ace.require("ace/lib/event");
var areas = document.getElementsByTagName("textarea");
for (var i = 0; i < areas.length; i++) {
event.addListener(areas[i], "click", function(e) {
if (e.detail == 3) {
ace.transformTextarea(e.target, options.ace);
}
});
}
callback && callback();
});
});
}
// Call the inject function to load the ace files.
var textAce;
inject({}, function () {
// Transform the textarea on the page into an ace editor.
var t = document.querySelector("textarea");
textAce = ace.require("ace/ext/textarea").transformTextarea(t);
setTimeout(function(){textAce.setDisplaySettings(true)});
});
document.getElementById("buBuild").onclick = function() {
var injectSrc = inject.toString().split("\n").join("");
injectSrc = injectSrc.replace(/\s+/g, " ");
var options = textAce.getOptions();
options.baseUrl = document.getElementById("srcURL").value;
var a = document.querySelector("a");
a.href = "javascript:(" + injectSrc + ")(" + JSON.stringify(options) + ")";
a.innerHTML = "Ace Bookmarklet Link";
}
</script>
</body>
</html>

Wyświetl plik

@ -32,7 +32,7 @@
<script>
var editor = ace.edit("editor");
editor.setTheme("ace/theme/twilight");
editor.getSession().setMode("ace/mode/javascript");
editor.session.setMode("ace/mode/javascript");
</script>
</body>

Wyświetl plik

@ -1,226 +0,0 @@
@import url(//fonts.googleapis.com/css?family=Droid+Sans+Mono);
body {
margin:0;
padding:0;
background-color:#e6f5fc;
}
H2, H3, H4 {
font-family:Trebuchet MS;
font-weight:bold;
margin:0;
padding:0;
}
H2 {
font-size:28px;
color:#263842;
padding-bottom:6px;
}
H3 {
font-family:Trebuchet MS;
font-weight:bold;
font-size:22px;
color:#253741;
margin-top:43px;
margin-bottom:8px;
}
H4 {
font-family:Trebuchet MS;
font-weight:bold;
font-size:21px;
color:#222222;
margin-bottom:4px;
}
P {
padding:13px 0;
margin:0;
line-height:22px;
}
UL{
line-height : 22px;
}
PRE{
background : #333;
color : white;
padding : 10px;
}
#header {
height : 227px;
position:relative;
overflow:hidden;
background: url(images/background.png) repeat-x 0 0;
border-bottom:1px solid #c9e8fa;
}
#header .content .signature {
font-family:Trebuchet MS;
font-size:11px;
color:#ebe4d6;
position:absolute;
bottom:5px;
right:42px;
letter-spacing : 1px;
}
.content {
width:970px;
position:relative;
margin:0 auto;
}
#header .content {
height:184px;
margin-top:22px;
}
#header .content .logo {
width : 282px;
height : 184px;
background:url(images/logo.png) no-repeat 0 0;
position:absolute;
top:0;
left:0;
}
#header .content .title {
width : 605px;
height : 58px;
background:url(images/ace.png) no-repeat 0 0;
position:absolute;
top:98px;
left:329px;
}
#wrapper {
background:url(images/body_background.png) repeat-x 0 0;
min-height:250px;
}
#wrapper .content {
font-family:Arial;
font-size:14px;
color:#222222;
width:1000px;
}
#wrapper .content .column1 {
position:relative;
float:left;
width:315px;
margin-right:31px;
}
#wrapper .content .column2 {
position:relative;
overflow:hidden;
float:left;
width:600px;
padding-top:47px;
}
.fork_on_github {
width:310px;
height:80px;
background:url(images/fork_on_github.png) no-repeat 0 0;
position:relative;
overflow:hidden;
margin-top:49px;
cursor:pointer;
}
.fork_on_github:hover {
background-position:0 -80px;
}
.divider {
height:3px;
background-color:#bedaea;
margin-bottom:3px;
}
.menu {
padding:23px 0 0 24px;
}
UL.content-list {
padding:15px;
margin:0;
}
UL.menu-list {
padding:0;
margin:0 0 20px 0;
list-style-type:none;
line-height : 16px;
}
UL.menu-list LI {
color:#2557b4;
font-family:Trebuchet MS;
font-size:14px;
padding:7px 0;
border-bottom:1px dotted #d6e2e7;
}
UL.menu-list LI:last-child {
border-bottom:0;
}
A {
color:#2557b4;
text-decoration:none;
}
A:hover {
text-decoration:underline;
}
P#first{
background : rgba(255,255,255,0.5);
padding : 20px;
font-size : 16px;
line-height : 24px;
margin : 0 0 20px 0;
}
#footer {
height:40px;
position:relative;
overflow:hidden;
background:url(images/bottombar.png) repeat-x 0 0;
position:relative;
margin-top:40px;
}
UL.menu-footer {
padding:0;
margin:8px 11px 0 0;
list-style-type:none;
float:right;
}
UL.menu-footer LI {
color:white;
font-family:Arial;
font-size:12px;
display:inline-block;
margin:0 1px;
}
UL.menu-footer LI A {
color:#8dd0ff;
text-decoration:none;
}
UL.menu-footer LI A:hover {
text-decoration:underline;
}

Wyświetl plik

@ -33,19 +33,21 @@
require.config({paths: { "ace" : "../lib/ace"}});
// load ace and extensions
require(["ace/ace"], function(ace) {
var editor1 = ace.edit("editor1", {
theme: "ace/theme/tomorrow_night_eighties",
mode: "ace/mode/html",
maxLines: 30,
wrap: true,
autoScrollEditorIntoView: true
});
var editor1 = ace.edit("editor1");
editor1.setTheme("ace/theme/tomorrow_night_eighties");
editor1.session.setMode("ace/mode/html");
editor1.setAutoScrollEditorIntoView(true);
editor1.setOption("maxLines", 30);
var editor2 = ace.edit("editor2");
editor2.setTheme("ace/theme/tomorrow_night_blue");
editor2.session.setMode("ace/mode/html");
editor2.setAutoScrollEditorIntoView(true);
editor2.setOption("maxLines", 30);
editor2.setOption("minLines", 2);
var editor2 = ace.edit("editor2", {
theme: "ace/theme/tomorrow_night_blue",
mode: "ace/mode/html",
autoScrollEditorIntoView: true,
maxLines: 30,
minLines: 2
});
var editor = ace.edit("editor3");
editor.setOptions({

Wyświetl plik

@ -1,39 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ACE ChromeVox demo</title>
<style type="text/css" media="screen">
body {
overflow: hidden;
}
#editor {
margin: 0;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
</style>
</head>
<body>
<pre id="editor"></pre>
<!-- load ace -->
<script src="../build/src/ace.js"></script>
<!-- load ace accessibility extension -->
<script src="../build/src/ext-chromevox.js"></script>
<script>
// trigger extension
ace.require("ace/ext/chromevox");
var editor = ace.edit("editor");
editor.session.setMode("ace/mode/html");
editor.setTheme("ace/theme/tomorrow");
</script>
<script src="./show_own_source.js"></script>
</body>
</html>

44
plugins/node_modules/ace/demo/ie7.html wygenerowano vendored
Wyświetl plik

@ -1,44 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>ACE Editor StatusBar Demo</title>
<style type="text/css" media="screen">
/*!important without this top: 0; bottom: 0 doesn't work on old ie */
body, html {
position: absolute;
top: 0px; bottom: 0; left: 0; right: 0;
margin:0; padding:0;
overflow:hidden
}
#editor {
margin: 0;
position: absolute;
top: 0; bottom: 0; left: 0; right: 0;
}
</style>
</head>
<body>
<pre id="editor">
require("ace/ext/old_ie");
// now ace will work even on ie7!
var editor = ace.edit("editor");
</pre>
<script src="../build/src/ace.js"></script>
<script src="../build/src/ext-old_ie.js"></script>
<script>
// before creating an editor patch up things for old ie
require("ace/ext/old_ie");
// now ace will work even on ie7!
var editor = ace.edit("editor");
editor.setTheme("ace/theme/textmate");
editor.session.setMode("ace/mode/javascript");
</script>
</body>
</html>

Wyświetl plik

@ -34,6 +34,8 @@ define(function(require, exports, module) {
require("ace/lib/fixoldbrowsers");
require("ace/ext/rtl");
require("ace/multi_select");
require("ace/ext/spellcheck");
require("./inline_editor");
@ -64,21 +66,36 @@ var whitespace = require("ace/ext/whitespace");
var doclist = require("./doclist");
var modelist = require("ace/ext/modelist");
var themelist = require("ace/ext/themelist");
var layout = require("./layout");
var TokenTooltip = require("./token_tooltip").TokenTooltip;
var util = require("./util");
var saveOption = util.saveOption;
var fillDropdown = util.fillDropdown;
var bindCheckbox = util.bindCheckbox;
var bindDropdown = util.bindDropdown;
var ElasticTabstopsLite = require("ace/ext/elastic_tabstops_lite").ElasticTabstopsLite;
var IncrementalSearch = require("ace/incremental_search").IncrementalSearch;
var TokenTooltip = require("./token_tooltip").TokenTooltip;
require("ace/config").defineOptions(Editor.prototype, "editor", {
showTokenInfo: {
set: function(val) {
if (val) {
this.tokenTooltip = this.tokenTooltip || new TokenTooltip(this);
}
else if (this.tokenTooltip) {
this.tokenTooltip.destroy();
delete this.tokenTooltip;
}
},
get: function() {
return !!this.tokenTooltip;
},
handlesSet: true
}
});
var workerModule = require("ace/worker/worker_client");
if (location.href.indexOf("noworker") !== -1) {
workerModule.WorkerClient = workerModule.UIWorkerClient;
@ -251,21 +268,6 @@ commands.addCommand({
}
});
var keybindings = {
ace: null, // Null = use "default" keymapping
vim: require("ace/keyboard/vim").handler,
emacs: "ace/keyboard/emacs",
// This is a way to define simple keyboard remappings
custom: new HashHandler({
"gotoright": "Tab",
"indent": "]",
"outdent": "[",
"gotolinestart": "^",
"gotolineend": "$"
})
};
/*********** manage layout ***************************/
var consoleHeight = 20;
@ -284,32 +286,6 @@ window.onresize = onResize;
onResize();
/*********** options panel ***************************/
var docEl = document.getElementById("doc");
var modeEl = document.getElementById("mode");
var wrapModeEl = document.getElementById("soft_wrap");
var themeEl = document.getElementById("theme");
var foldingEl = document.getElementById("folding");
var selectStyleEl = document.getElementById("select_style");
var highlightActiveEl = document.getElementById("highlight_active");
var showHiddenEl = document.getElementById("show_hidden");
var showGutterEl = document.getElementById("show_gutter");
var showPrintMarginEl = document.getElementById("show_print_margin");
var highlightSelectedWordE = document.getElementById("highlight_selected_word");
var showHScrollEl = document.getElementById("show_hscroll");
var showVScrollEl = document.getElementById("show_vscroll");
var animateScrollEl = document.getElementById("animate_scroll");
var softTabEl = document.getElementById("soft_tab");
var behavioursEl = document.getElementById("enable_behaviours");
fillDropdown(docEl, doclist.all);
fillDropdown(modeEl, modelist.modes);
var modesByName = modelist.modesByName;
bindDropdown("mode", function(value) {
env.editor.session.setMode(modesByName[value].mode || modesByName.text.mode);
env.editor.session.modeName = value;
});
doclist.history = doclist.docs.map(function(doc) {
return doc.name;
});
@ -322,8 +298,7 @@ doclist.cycleOpen = function(editor, dir) {
else if (h.index <= 0)
h.index = h.length - 1;
var s = h[h.index];
docEl.value = s;
docEl.onchange();
doclist.pickDocument(s);
};
doclist.addToHistory = function(name) {
var h = this.history;
@ -334,177 +309,99 @@ doclist.addToHistory = function(name) {
h.index = h.push(name);
}
};
bindDropdown("doc", function(name) {
doclist.pickDocument = function(name) {
doclist.loadDoc(name, function(session) {
if (!session)
return;
doclist.addToHistory(session.name);
session = env.split.setSession(session);
whitespace.detectIndentation(session);
updateUIEditorOptions();
optionsPanel.render();
env.editor.focus();
});
});
function updateUIEditorOptions() {
var editor = env.editor;
var session = editor.session;
session.setFoldStyle(foldingEl.value);
saveOption(docEl, session.name);
saveOption(modeEl, session.modeName || "text");
saveOption(wrapModeEl, session.getUseWrapMode() ? session.getWrapLimitRange().min || "free" : "off");
saveOption(selectStyleEl, editor.getSelectionStyle() == "line");
saveOption(themeEl, editor.getTheme());
saveOption(highlightActiveEl, editor.getHighlightActiveLine());
saveOption(showHiddenEl, editor.getShowInvisibles());
saveOption(showGutterEl, editor.renderer.getShowGutter());
saveOption(showPrintMarginEl, editor.renderer.getShowPrintMargin());
saveOption(highlightSelectedWordE, editor.getHighlightSelectedWord());
saveOption(showHScrollEl, editor.renderer.getHScrollBarAlwaysVisible());
saveOption(animateScrollEl, editor.getAnimatedScroll());
saveOption(softTabEl, session.getUseSoftTabs());
saveOption(behavioursEl, editor.getBehavioursEnabled());
}
themelist.themes.forEach(function(x){ x.value = x.theme });
fillDropdown(themeEl, {
Bright: themelist.themes.filter(function(x){return !x.isDark}),
Dark: themelist.themes.filter(function(x){return x.isDark}),
});
event.addListener(themeEl, "mouseover", function(e){
themeEl.desiredValue = e.target.value;
if (!themeEl.$timer)
themeEl.$timer = setTimeout(themeEl.updateTheme);
});
event.addListener(themeEl, "mouseout", function(e){
themeEl.desiredValue = null;
if (!themeEl.$timer)
themeEl.$timer = setTimeout(themeEl.updateTheme, 20);
});
themeEl.updateTheme = function(){
env.split.setTheme((themeEl.desiredValue || themeEl.selectedValue));
themeEl.$timer = null;
};
bindDropdown("theme", function(value) {
if (!value)
return;
env.editor.setTheme(value);
themeEl.selectedValue = value;
});
bindDropdown("keybinding", function(value) {
env.editor.setKeyboardHandler(keybindings[value]);
});
bindDropdown("fontsize", function(value) {
env.split.setFontSize(value);
});
var OptionPanel = require("ace/ext/options").OptionPanel;
var optionsPanel = new OptionPanel(env.editor);
bindDropdown("folding", function(value) {
env.editor.session.setFoldStyle(value);
env.editor.setShowFoldWidgets(value !== "manual");
});
optionsPanel.add({
Main: {
Document: {
type: "select",
path: "doc",
items: doclist.all,
position: -101,
onchange: doclist.pickDocument,
getValue: function() {
return env.editor.session.name || "javascript";
}
},
Split: {
type: "buttonBar",
path: "split",
values: ["None", "Below", "Beside"],
position: -100,
onchange: function(value) {
var sp = env.split;
if (value == "Below" || value == "Beside") {
var newEditor = (sp.getSplits() == 1);
sp.setOrientation(value == "Below" ? sp.BELOW : sp.BESIDE);
sp.setSplits(2);
bindDropdown("soft_wrap", function(value) {
env.editor.setOption("wrap", value);
});
bindCheckbox("select_style", function(checked) {
env.editor.setOption("selectionStyle", checked ? "line" : "text");
});
bindCheckbox("highlight_active", function(checked) {
env.editor.setHighlightActiveLine(checked);
});
bindCheckbox("show_hidden", function(checked) {
env.editor.setShowInvisibles(checked);
});
bindCheckbox("display_indent_guides", function(checked) {
env.editor.setDisplayIndentGuides(checked);
});
bindCheckbox("show_gutter", function(checked) {
env.editor.renderer.setShowGutter(checked);
});
bindCheckbox("show_print_margin", function(checked) {
env.editor.renderer.setShowPrintMargin(checked);
});
bindCheckbox("highlight_selected_word", function(checked) {
env.editor.setHighlightSelectedWord(checked);
});
bindCheckbox("show_hscroll", function(checked) {
env.editor.setOption("hScrollBarAlwaysVisible", checked);
});
bindCheckbox("show_vscroll", function(checked) {
env.editor.setOption("vScrollBarAlwaysVisible", checked);
});
bindCheckbox("animate_scroll", function(checked) {
env.editor.setAnimatedScroll(checked);
});
bindCheckbox("soft_tab", function(checked) {
env.editor.session.setUseSoftTabs(checked);
});
bindCheckbox("enable_behaviours", function(checked) {
env.editor.setBehavioursEnabled(checked);
});
bindCheckbox("fade_fold_widgets", function(checked) {
env.editor.setFadeFoldWidgets(checked);
});
bindCheckbox("read_only", function(checked) {
env.editor.setReadOnly(checked);
});
bindCheckbox("scrollPastEnd", function(checked) {
env.editor.setOption("scrollPastEnd", checked);
});
bindDropdown("split", function(value) {
var sp = env.split;
if (value == "none") {
sp.setSplits(1);
} else {
var newEditor = (sp.getSplits() == 1);
sp.setOrientation(value == "below" ? sp.BELOW : sp.BESIDE);
sp.setSplits(2);
if (newEditor) {
var session = sp.getEditor(0).session;
var newSession = sp.setSession(session, 1);
newSession.name = session.name;
if (newEditor) {
var session = sp.getEditor(0).session;
var newSession = sp.setSession(session, 1);
newSession.name = session.name;
}
} else {
sp.setSplits(1);
}
},
getValue: function() {
var sp = env.split;
return sp.getSplits() == 1
? "None"
: sp.getOrientation() == sp.BELOW
? "Below"
: "Beside";
}
}
},
More: {
"Rtl Text": {
path: "rtlText",
position: 900
},
"Show token info": {
path: "showTokenInfo",
position: 1000
}
}
});
bindCheckbox("elastic_tabstops", function(checked) {
env.editor.setOption("useElasticTabstops", checked);
var optionsPanelContainer = document.getElementById("optionsPanel");
optionsPanel.render();
optionsPanelContainer.insertBefore(optionsPanel.container, optionsPanelContainer.firstChild);
optionsPanel.on("setOption", function(e) {
util.saveOption(e.name, e.value);
});
var iSearchCheckbox = bindCheckbox("isearch", function(checked) {
env.editor.setOption("useIncrementalSearch", checked);
});
function updateUIEditorOptions() {
optionsPanel.editor = env.editor;
optionsPanel.render();
}
env.editor.addEventListener('incrementalSearchSettingChanged', function(event) {
iSearchCheckbox.checked = event.isEnabled;
});
optionsPanel.setOption("doc", util.getOption("doc") || "JavaScript");
for (var i in optionsPanel.options) {
var value = util.getOption(i);
if (value != undefined) {
if ((i == "mode" || i == "theme") && !/[/]/.test(value))
value = "ace/" + i + "/" + value;
optionsPanel.setOption(i, value);
}
}
function synchroniseScrolling() {
@ -516,16 +413,6 @@ function synchroniseScrolling() {
s2.on('changeScrollLeft', function(pos) {s1.setScrollLeft(pos)});
}
bindCheckbox("highlight_token", function(checked) {
var editor = env.editor;
if (editor.tokenTooltip && !checked) {
editor.tokenTooltip.destroy();
delete editor.tokenTooltip;
} else if (checked) {
editor.tokenTooltip = new TokenTooltip(editor);
}
});
var StatusBar = require("ace/ext/statusbar").StatusBar;
new StatusBar(env.editor, cmdLine.container);
@ -536,8 +423,7 @@ net.loadScript("https://cloud9ide.github.io/emmet-core/emmet.js", function() {
env.editor.setOption("enableEmmet", true);
});
// require("ace/placeholder").PlaceHolder;
require("ace/placeholder").PlaceHolder;
var snippetManager = require("ace/snippets").snippetManager;
@ -572,6 +458,12 @@ env.editSnippets = function() {
editor.focus();
};
optionsPanelContainer.insertBefore(
dom.buildDom(["div", {style: "text-align:right;margin-right: 60px"},
["button", {onclick: env.editSnippets}, "Edit Snippets"]]),
optionsPanelContainer.children[1]
);
require("ace/ext/language_tools");
env.editor.setOptions({
enableBasicAutocompletion: true,
@ -582,4 +474,53 @@ env.editor.setOptions({
var beautify = require("ace/ext/beautify");
env.editor.commands.addCommands(beautify.commands);
// global keybindings
var KeyBinding = require("ace/keyboard/keybinding").KeyBinding;
var CommandManager = require("ace/commands/command_manager").CommandManager;
var commandManager = new CommandManager();
var kb = new KeyBinding({
commands: commandManager,
fake: true
});
event.addCommandKeyListener(document.documentElement, kb.onCommandKey.bind(kb));
event.addListener(document.documentElement, "keyup", function(e) {
if (e.keyCode === 18) // do not trigger browser menu on windows
e.preventDefault();
});
commandManager.addCommands([{
name: "window-left",
bindKey: {win: "cmd-alt-left", mac: "ctrl-cmd-left"},
exec: function() {
moveFocus();
}
}, {
name: "window-right",
bindKey: {win: "cmd-alt-right", mac: "ctrl-cmd-right"},
exec: function() {
moveFocus();
}
}, {
name: "window-up",
bindKey: {win: "cmd-alt-up", mac: "ctrl-cmd-up"},
exec: function() {
moveFocus();
}
}, {
name: "window-down",
bindKey: {win: "cmd-alt-down", mac: "ctrl-cmd-down"},
exec: function() {
moveFocus();
}
}]);
function moveFocus() {
var el = document.activeElement;
if (el == env.editor.textInput.getElement())
env.editor.cmdLine.focus();
else
env.editor.focus();
}
});

Wyświetl plik

@ -140,7 +140,7 @@ function prepareDocList(docs) {
if (doc.desc.length > 18)
doc.desc = doc.desc.slice(0, 7) + ".." + doc.desc.slice(-9);
fileCache[doc.name] = doc;
fileCache[doc.name.toLowerCase()] = doc;
list.push(doc);
}
@ -148,7 +148,7 @@ function prepareDocList(docs) {
}
function loadDoc(name, callback) {
var doc = fileCache[name];
var doc = fileCache[name.toLowerCase()];
if (!doc)
return callback(null);
@ -170,7 +170,7 @@ function loadDoc(name, callback) {
}
function saveDoc(name, callback) {
var doc = fileCache[name] || name;
var doc = fileCache[name.toLowerCase()] || name;
if (!doc || !doc.session)
return callback("Unknown document: " + name);
@ -185,8 +185,11 @@ function saveDoc(name, callback) {
}
function upload(url, data, callback) {
url = net.qualifyURL(url);
if (!/https?:/.test(url))
var absUrl = net.qualifyURL(url);
if (/^file:/.test(absUrl))
absUrl = "http://localhost:8888/" + url;
url = absUrl;
if (!/^https?:/.test(url))
return callback(new Error("Unsupported url scheme"));
var xhr = new XMLHttpRequest();
xhr.open("PUT", url, true);
@ -196,8 +199,7 @@ function upload(url, data, callback) {
}
};
xhr.send(data);
};
}
module.exports = {
fileCache: fileCache,
@ -206,7 +208,7 @@ module.exports = {
hugeDocs: prepareDocList(hugeDocs),
initDoc: initDoc,
loadDoc: loadDoc,
saveDoc: saveDoc,
saveDoc: saveDoc
};
module.exports.all = {
"Mode Examples": module.exports.docs,

Wyświetl plik

@ -33,4 +33,9 @@ DATA LAST_EOM TYPE D. "last end-of-month date
DATA : BEGIN OF I_VBRK OCCURS 0,
VBELN LIKE VBRK-VBELN,
ZUONR LIKE VBRK-ZUONR,
END OF I_VBRK.
END OF I_VBRK.
SORT i_vbrk BY vbeln ASCENDING.
SORT i_vbrk BY vbeln DESCENDING.
RETURN.

Wyświetl plik

@ -0,0 +1,81 @@
/*
* Intel ACPI Component Architecture
* AML/ASL+ Disassembler version 20180105
*
* ASL example
*/
DefinitionBlock ("", "SSDT", 1, "PmRef", "Cpu0Ist", 0x00003000)
{
External (_PR_.CPU0, DeviceObj)
External (_SB_.CPUP, UnknownObj)
Scope (\_PR.CPU0)
{
Method (_PCT, 0, NotSerialized) // _PCT: Performance Control
{
If (((CFGD & One) && (PDC0 & One)))
{
Return (Package (0x02)
{
ResourceTemplate ()
{
Register (FFixedHW,
0x00, // Bit Width
0x00, // Bit Offset
0x0000000000000000, // Address
,)
},
ResourceTemplate ()
{
Register (FFixedHW,
0x00, // Bit Width
0x00, // Bit Offset
0x0000000000000000, // Address
,)
}
})
}
Return (Package (0x02)
{
ResourceTemplate ()
{
Register (SystemIO,
0x10, // Bit Width
0x00, // Bit Offset
0x0000000000001000, // Address
,)
},
ResourceTemplate ()
{
Register (SystemIO,
0x08, // Bit Width
0x00, // Bit Offset
0x00000000000000B3, // Address
,)
}
})
}
Name (PSDF, Zero)
Method (_PSD, 0, NotSerialized) // _PSD: Power State Dependencies
{
If (!PSDF)
{
DerefOf (HPSD [Zero]) [0x04] = TCNT /* External reference */
DerefOf (SPSD [Zero]) [0x04] = TCNT /* External reference */
PSDF = Ones
}
If ((PDC0 & 0x0800))
{
Return (HPSD) /* \_PR_.CPU0.HPSD */
}
Return (SPSD) /* \_PR_.CPU0.SPSD */
}
}
}

Wyświetl plik

@ -0,0 +1,26 @@
##! Add countries for the originator and responder of a connection
##! to the connection logs.
module Conn;
export {
redef record Conn::Info += {
## Country code for the originator of the connection based
## on a GeoIP lookup.
orig_cc: string &optional &log;
## Country code for the responser of the connection based
## on a GeoIP lookup.
resp_cc: string &optional &log;
};
}
event connection_state_remove(c: connection)
{
local orig_loc = lookup_location(c$id$orig_h);
if ( orig_loc?$country_code )
c$conn$orig_cc = orig_loc$country_code;
local resp_loc = lookup_location(c$id$resp_h);
if ( resp_loc?$country_code )
c$conn$resp_cc = resp_loc$country_code;
}

Wyświetl plik

@ -33,7 +33,7 @@ int main ()
a+=2; // equivalent to a=a+2
cout << a;
#if VERBOSE >= 2
prints("trace message");
prints("trace message\n");
#endif
return 0;
}

Wyświetl plik

@ -0,0 +1,13 @@
text
<CsoundSynthesizer>
<CsInstruments>
0dbfs = 1
prints "hello, world\n"
</CsInstruments>
<CsScore>
i 1 0 0
</CsScore>
<html>
<!DOCTYPE html>
</html>
</CsoundSynthesizer>

Wyświetl plik

@ -0,0 +1,79 @@
/*
* comment
*/
; comment
// comment
instr/**/1,/**/N_a_M_e_,/**/+Name/**///
iDuration = p3
outc:a(aSignal)
endin
opcode/**/aUDO,/**/i[],/**/aik//
aUDO
endop
123 0123456789
0xabcdef0123456789 0XABCDEF
1e2 3e+4 5e-6 7E8 9E+0 1E-2 3. 4.56 .789
"characters$MACRO."
"\\\a\b\n\r\t\012\345\67\""
{{
characters$MACRO.
}}
{{\\\a\b\n\r\t\"\012\345\67}}
+ - ~ ¬ ! * / ^ % << >> < > <= >= == != & # | && || ? : += -= *= /=
0dbfs A4 kr ksmps nchnls nchnls_i sr
do else elseif endif enduntil fi if ithen kthen od then until while
return rireturn
aLabel:
label2:
goto aLabel
reinit aLabel
cggoto 1==0, aLabel
timout 0, 0, aLabel
loop_ge 0, 0, 0, aLabel
readscore {{
i 1 0 0
}}
pyrun {{
# Python
}}
lua_exec {{
-- Lua
}}
#include/**/"file.udo"
#include/**/|file.udo|
#ifdef MACRO
#else
#ifndef MACRO
#endif
#undef MACRO
# define MACRO#macro_body#
#define/**/
MACRO/**/
#\#macro
body\##
#define MACRO(ARG1#ARG2) #macro_body#
#define/**/
MACRO(ARG1'ARG2'ARG3)/**/
#\#macro
body\##
$MACRO $MACRO.
$MACRO(x)
@0
@@ 1
$MACRO.(((x#y\)))' "(#'x)\)x\))"# {{x\))x)\)(#'}});

Wyświetl plik

@ -0,0 +1,22 @@
/*
* comment
*/
; comment
// comment
a b C d e f i q s t v x y
z
np0 nP1 Np2 NP3
m/**/label;
n label
123 0123456789
0xabcdef0123456789 0XABCDEF
1e2 3e+4 5e-6 7E8 9E+0 1E-2 3. 4.56 .789
"characters$MACRO."
{ 1 I
{ 2 J
{ 3 K
$I $J $K
}
}
}
#include "score.sco"

Wyświetl plik

@ -1,5 +1,6 @@
.text-layer {
font: 12px Monaco, "Courier New", monospace;
font-size: 3vmin;
cursor: text;
}
@ -9,10 +10,34 @@
@keyframes blink {
0%, 40% {
opacity: 0;
opacity: 0; /*
*/
opacity: 1
}
40.5%, 100% {
opacity: 1
}
}
}
@document url(http://c9.io/), url-prefix(http://ace.c9.io/build/),
domain(c9.io), regexp("https:.*") /**/
{
/**/
img[title]:before
{
content: attr(title) "\AImage \
retrieved from"
attr(src); /*
*/
white-space: pre;
display: block;
background: url(asdasd); "err
}
}
@viewport {
min-zoom: 1;
max-zoom: 200%;
user-zoom: fixed;
}

Wyświetl plik

@ -0,0 +1,127 @@
/*
* Copyright 2010 JBoss Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
Original source
https://github.com/droolsjbpm/drools/blob/master/drools-examples/
http://docs.jboss.org/drools/
*/
package com.example.ace
import java.math.BigDecimal
import function my.package.Foo.hello
declare FactType
@author( Bob )
id : String
name : String @maxLength(100) @notnull
value : BigDecimal
end
declare FactType2 extends AnotherType
end
declare trait TraitType extends com.package.AnotherType
end
declare trait GoldenCustomer
balance : long @Alias( "org.acme.foo.accountBalance" )
end
global org.slf4j.Logger logger
/**
* @param name who we'll salute?
*/
function String hello(String name) {
return "Hello "+name+"!";
}
rule "Trim all strings"
dialect "java"
no-loop
when // fdsfds
$s : String(a == null || == "empty", $g : size)
Cheese( name matches "(Buffalo)?\\S*Mozarella" )
CheeseCounter( cheeses contains $var ) // contains with a variable
CheeseCounter( cheese memberof $matureCheeses )
Cheese( name soundslike 'foobar' )
Message( routingValue str[startsWith] "R1" )
Cheese( name in ( "stilton", "cheddar", $cheese ) )
Person( eval( age == girlAge + 2 ), sex = 'M' )
then
/**
* TODO There mus be better way
*/
retract($s);
String a = "fd";
a.toString();
insert($s.trim());
end
query isContainedIn( String x, String y )
Location( x, y; )
or
( Location( z, y; ) and isContainedIn( x, z; ) )
end
rule "go" salience 10
when
$s : String( )
then
System.out.println( $s );
end
rule "When all English buses are not red"
when
not(forall( $bus : Bus( nationality == 'english')
Bus( this == $bus, color = 'red' ) ))
then
// What if all english buses are not red?
end
rule "go1"
when
String( this == "go1" )
isContainedIn("Office", "House"; )
then
System.out.println( "office is in the house" );
end
rule "go2"
when
String( this == "go2" )
isContainedIn("Draw", "House"; )
then
System.out.println( "Draw in the House" );
end
/**
* Go Right
*/
rule GoRight dialect "mvel" salience (Math.abs( $df.colDiff )) when
$df : DirectionDiff(colDiff > 0 )
$target : Cell( row == $df.row, col == ($df.col + 1) )
CellContents( cell == $target, cellType != CellType.WALL )
not Direction(character == $df.fromChar, horizontal == Direction.RIGHT )
then
System.out.println( "monster right" );
retract( $df );
insert( new Direction($df.fromChar, Direction.RIGHT, Direction.NONE ) );
end

Wyświetl plik

@ -0,0 +1,26 @@
UNB+UNOA:1+005435656:1+006415160:1+060515:1434+00000000000778'
UNH+00000000000117+INVnrOIC:D:97B:UN'
BGM+380+342459+9'
DTM+3:20060515:102'
RFF+ON:521052'
NAD+BY+792820524::16++CUMMINS MID-RANGE ENGINE PLANT'
NAD+SE+005435656::16++GENERAL WIDGET COMPANY'
CUX+1:USD'
LIN+1++157870:IN'
IMD+F++:::WIDGET'
QTY+47:1020:EA'
ALI+US'
MOA+203:1202.58'
PRI+INV:1.179'
LIN+2++157871:IN'
IMD+F++:::DIFFERENT WIDGET'
QTY+47:20:EA'
ALI+JP'
MOA+203:410'
PRI+INV:20.5'
UNS+S'
MOA+39:2137.58'
ALC+C+ABG'
MOA+8:525'
UNT+23+00000000000117'
UNZ+1+00000000000778'

Wyświetl plik

@ -0,0 +1,33 @@
#include "globalDefines.h"
!=========================================================
program main
!=========================================================
use params_module, only : nx, ny, nz
implicit none
integer, parameter :: g = 9.81
real, allocatable, dimension(:,:,:) :: array
integer :: a, b, c
real*8 :: x, y, z
b = 5
c = 7
#ifdef ARRAY_COMP
allocate(array(10,10,10), status=a)
write(c,'(i5.5)') b
#endif
if(x.lt.5.0) then
array(:,:,:) = g
else
array(:,:,:) = x - y
endif
return
!========================================================
end program main
!========================================================

Wyświetl plik

@ -0,0 +1,13 @@
(* fsharp (* example *) *)
module Test =
let func1 x =
if x < 100 then
x*x
else
x*x + 1
let list = (-1, 42) :: [ for i in 0 .. 99 -> (i, func1(i)) ]
let verbatim = @"c:\Program "" Files\"
let trippleQuote = """ "hello world" """
// print
printfn "The table of squares from 0 to 99 is:\n%A" list

Wyświetl plik

@ -0,0 +1,19 @@
program {
/*
* A gobstons multiline comment
* Taken from:
* http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308/"
*/
sumar(2, 3)
}
function sumar(a, b) {
r := a + b
}
// unreachable code
-- unreachable code
# unreachable code
procedure hacerAlgo() {
Mover(Este)
Poner(Rojo)
Sacar(Azul)
}

Wyświetl plik

@ -0,0 +1,73 @@
# Main Schema
schema {
query: Query;
}
scalar Date;
# Simple type to contain all scalar types
type AllTypes {
# Field Description for String
testString: String;
# Field Description for Int
testInt: Int;
# Field Description for ID
testID: ID;
# Field Description for Boolean
testBoolean: Boolean;
# Field Description for Float
testFloat: Float;
}
interface ISearchable {
searchPreview: String!;
}
union ProductTypes = Movie | Book;
# Testing enum
enum MovieGenere {
ACTION
COMEDY
THRILLER
DRAMA
}
# Testing Input
input SearchByGenere {
before: Date;
after: Date;
genere: MovieGenere!;
}
# Testing Interface
type Movie implements ISearchable {
id: ID!;
searchPreview: String!;
rentPrice: Float;
publishDate: Date;
genere: MovieGenere;
cast: [String];
}
# Testing Interface
type Book implements ISearchable {
id: ID!;
searchPreview: String!;
price: Float;
publishDate: Date;
authors: [String];
}
type Query {
testString: String;
testDate; Date;
allTypes: AllTypes;
allProducts: [ProductTypes];
# searches only movies by genere with sophisticated argument
searchMovieByGenere(searchObject: SearchByGenere!): [Movie];
# Searchs all products by text string
searchProduct(text: String!): [ISearchable];
}

Wyświetl plik

@ -1,22 +1,46 @@
!!!5
# <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
# <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
# <!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
# <!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
/[if IE]
%a{ :href => 'http://www.mozilla.com/en-US/firefox/' }
%h1 Get Firefox
-# This is a HAML comment. It will not show in the output HTML
-#
This is a HAML multiline comment
This won't be displayed
Nor will this
Nor will this.
/ This is a HTML comment. It will be rendered as HTML
/
%p This doesn't render...
%div
%h1 Because it's commented out!
.row
.col-md-6
.col-md-6
/adasdasdad
%div{:id => "#{@item.type}_#{@item.number}", :class => '#{@item.type} #{@item.urgency}', :phoney => `asdasdasd`}
#users.row.green
#articles{:style => "border: 5px;"}
#lists.list-inline
%div#todos.bg-green{:id => "#{@item.type}_#{@item.number}", :class => '#{@item.type} #{@item.urgency}', :phoney => `asdasdasd`}
/ file: app/views/movies/index.html.haml
\d
%ads:{:bleh => 33}
%p==ddd==
%p
Date/Time:
- now = DateTime.now
- now = DateTime.now
%strong= now
= if now DateTime.parse("December 31, 2006")
= if now DateTime.parse("December 31, 2006")
= "Happy new " + "year!"
%sfd.dfdfg
#content
.title
@ -29,8 +53,23 @@
%div.article.title Blah
%div.article.date 2006-11-05
%div.article.entry
Neil Patrick Harris
Neil Patrick Harris
%div[@user, :greeting]
%bar[290]/
==Hello!==
%bar[290]
/ This is a comment
/ This is another comment with line break above
.row
.col-md-6
.col-md-6
.col-md-6
.row
.col-md-6
.col-md-6

Wyświetl plik

@ -0,0 +1,77 @@
name: reload
version: 0.1.0.0
synopsis: Initial project template from stack
Description:
The \'cabal\' command-line program simplifies the process of managing
Haskell software by automating the fetching, configuration, compilation
and installation of Haskell libraries and programs.
homepage: https://github.com/jpmoresmau/dbIDE/reload#readme
license: BSD3
license-file: LICENSE
author: JP Moresmau
maintainer: jpmoresmau@gmail.com
copyright: 2016 JP Moresmau
category: Web
build-type: Simple
-- extra-source-files:
cabal-version: >=1.10
Flag network-uri
description: Get Network.URI from the network-uri package
default: True
library
hs-source-dirs: src
exposed-modules: Language.Haskell.Reload
build-depends: base >= 4.7 && < 5
, aeson
, scotty
, wai
, text
, directory
, filepath
, bytestring
, containers
, mime-types
, transformers
, wai-handler-launch
, wai-middleware-static
, wai-extra
, http-types
default-language: Haskell2010
other-modules: Language.Haskell.Reload.FileBrowser
ghc-options: -Wall -O2
executable reload-exe
hs-source-dirs: app
main-is: Main.hs
ghc-options: -threaded -O2 -rtsopts -with-rtsopts=-N
build-depends: base
, reload
default-language: Haskell2010
test-suite reload-test
type: exitcode-stdio-1.0
hs-source-dirs: test
main-is: Spec.hs
build-depends: base
, reload
, hspec
, hspec-wai
, hspec-wai-json
, aeson
, directory
, filepath
, text
, containers
, unordered-containers
, bytestring
, wai-extra
ghc-options: -threaded -O2 -rtsopts -with-rtsopts=-N
default-language: Haskell2010
other-modules: Language.Haskell.Reload.FileBrowserSpec
Language.Haskell.ReloadSpec
source-repository head
type: git
location: https://github.com/jpmoresmau/dbIDE/reload

Wyświetl plik

@ -0,0 +1,16 @@
{
# specify rate in requests/second (because comments are helpful!)
rate: 1000
// prefer c-style comments?
/* feeling old fashioned? */
# did you notice that rate doesn't need quotes?
hey: look ma, no quotes for strings either!
# best of all
notice: []
anything: ?
# yes, commas are optional!
}

Wyświetl plik

@ -0,0 +1,26 @@
<h1>Listing Books</h1>
<table>
<tr>
<th>Title</th>
<th>Summary</th>
<th></th>
<th></th>
<th></th>
</tr>
<%= for book <- @books do %>
<tr>
<%# comment %>
<td><%= book.title %></td>
<td><%= book.content %></td>
<td><%= link "Show", to: book_path(@conn, :show, book) %></td>
<td><%= link "Edit", to: book_path(@conn, :edit, book) %></td>
<td><%= link "Delete", to: book_path(@conn, :delete, book), method: :delete, data: [confirm: "Are you sure?"] %></td>
</tr>
<% end %>
</table>
<br />
<%= link "New book", to: book_path(@conn, :new) %>

Wyświetl plik

@ -1,10 +1,21 @@
<%-- initial comment --%>
<%@ page import="java.util.Date" %>
<%--@ page isELIgnored="true" //Now EL will be ignored --%>
<html>
<body>
<script>
var x = "abc";
function y {
}
</script>
<jsp:declaration>
int day = 3;
</jsp:declaration>
<%@ include file="relative url" %>
<jsp:directive.include file="relative url" />
<head>
<title>Day <%= day %></title>
</head>
<body>
<script>
var x = "abc";
function y {
}
</script>
<style>
.class {
background: #124356;
@ -14,7 +25,19 @@
<p>
Today's date: <%= (new java.util.Date()).toLocaleString()%>
</p>
<%! int i = 0; %>
<%! int day = 3; %>
<jsp:directive.page attribute="value" />
<%-- This comment will not be visible in the page source --%>
<!-- html comment -->
<body>
<p>
Today's date: <%= (new java.util.Date()).toLocaleString()%>
</p>
<%! int i = 0; %>
<jsp:declaration>
int j = 10;
</jsp:declaration>
@ -42,5 +65,37 @@
}
}
%>
</body>
</html>
<%
switch(day) {
case 0:
out.println("It\'s Sunday.");
break;
case 1:
out.println("It\'s Monday.");
break;
case 2:
out.println("It\'s Tuesday.");
break;
case 3:
out.println("It\'s Wednesday.");
break;
case 4:
out.println("It\'s Thursday.");
break;
case 5:
out.println("It\'s Friday.");
break;
//hello
default:
out.println("It's Saturday.");
}
%>
<p>
<jsp:scriptlet>
out.println("Your IP address is " + request.getRemoteAddr());
</jsp:scriptlet>
</p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,25 @@
machine_name : "Three-state traffic light, plus off and flash-red";
machine_version : 1.2.1;
jssm_version : >= 5.0.0;
graph_layout : dot;
on_init : ${setup};
on_halt : ${finalize};
/* turn on */
Off 'Enable' { follow: ${turned_on}; } -> Red;
// main sequence
Red 'Proceed' => Green 'Proceed' => Yellow 'Proceed' => Red;
// emergency flash red
[Red Yellow Green] 'Flash' -> Flash;
Flash 'Proceed' { label: 'no change'; } -> Flash 'Exit' -> Red;
// turn off
[Red Yellow Green Flash] 'Disable' { follow: ${turned_off}; } ~> Off;

Wyświetl plik

@ -0,0 +1,130 @@
/*Taken from http://try.kotlinlang.org/#/Examples/Longer%20examples/Life/Life.kt*/
/**
* This is a straightforward implementation of The Game of Life
* See http://en.wikipedia.org/wiki/Conway's_Game_of_Life
*/
package life
/*
* A field where cells live. Effectively immutable
*/
class Field(
val width: Int,
val height: Int,
// This function tells the constructor which cells are alive
// if init(i, j) is true, the cell (i, j) is alive
init: (Int, Int) -> Boolean
) {
private val live: Array<Array<Boolean>> = Array(height) { i -> Array(width) { j -> init(i, j) } }
private fun liveCount(i: Int, j: Int)
= if (i in 0..height - 1 &&
j in 0..width - 1 &&
live[i][j]) 1 else 0
// How many neighbors of (i, j) are alive?
fun liveNeighbors(i: Int, j: Int) =
liveCount(i - 1, j - 1) +
liveCount(i - 1, j) +
liveCount(i - 1, j + 1) +
liveCount(i, j - 1) +
liveCount(i, j + 1) +
liveCount(i + 1, j - 1) +
liveCount(i + 1, j) +
liveCount(i + 1, j + 1)
// You can say field[i, j], and this function gets called
operator fun get(i: Int, j: Int) = live[i][j]
}
/**
* This function takes the present state of the field
* and returns a new field representing the next moment of time
*/
fun next(field: Field): Field {
return Field(field.width, field.height) { i, j ->
val n = field.liveNeighbors(i, j)
if (field[i, j])
// (i, j) is alive
n in 2..3 // It remains alive iff it has 2 or 3 neighbors
else
// (i, j) is dead
n == 3 // A new cell is born if there are 3 neighbors alive
}
}
/** A few colony examples here */
fun main(args: Array<String>) {
// Simplistic demo
runGameOfLife("***", 3)
// "Star burst"
runGameOfLife("""
_______
___*___
__***__
___*___
_______
""", 10)
// Stable colony
runGameOfLife("""
_____
__*__
_*_*_
__*__
_____
""", 3)
// Stable from the step 2
runGameOfLife("""
__**__
__**__
__**__
""", 3)
// Oscillating colony
runGameOfLife("""
__**____
__**____
____**__
____**__
""", 6)
// A fancier oscillating colony
runGameOfLife("""
-------------------
-------***---***---
-------------------
-----*----*-*----*-
-----*----*-*----*-
-----*----*-*----*-
-------***---***---
-------------------
-------***---***---
-----*----*-*----*-
-----*----*-*----*-
-----*----*-*----*-
-------------------
-------***---***---
-------------------
""", 10)
}
// UTILITIES
fun runGameOfLife(fieldText: String, steps: Int) {
var field = makeField(fieldText)
for (step in 1..steps) {
println("Step: $step")
for (i in 0..field.height - 1) {
for (j in 0..field.width - 1) {
print(if (field[i, j]) "*" else " ")
}
println("")
}
field = next(field)
}
}
fun makeField(s: String): Field {
val lines = s.replace(" ", "").split('\n').filter({ it.isNotEmpty() })
val longestLine = lines.toList().maxBy { it.length } ?: ""
return Field(longestLine.length, lines.size) { i, j -> lines[i][j] == '*' }
}

Wyświetl plik

@ -1,9 +0,0 @@
import logic
section
variables (A : Type) (p q : A → Prop)
example : (∀x : A, p x ∧ q x) → ∀y : A, p y :=
assume H : ∀x : A, p x ∧ q x,
take y : A,
show p y, from and.elim_left (H y)
end

Wyświetl plik

@ -0,0 +1,6 @@
* PROGRAM START
ΔSTART LDA 2000 LOAD A FROM CELL 2000
CMP7 =15=
12345 HLT
END START
ABC ALF abc

Wyświetl plik

@ -0,0 +1,31 @@
/*
NSIS Mode
for Ace
*/
; Includes
!include MUI2.nsh
; Settings
Name "installer_name"
OutFile "installer_name.exe"
RequestExecutionLevel user
CRCCheck on
!ifdef x64
InstallDir "$PROGRAMFILES64\installer_name"
!else
InstallDir "$PROGRAMFILES\installer_name"
!endif
; Pages
!insertmacro MUI_PAGE_INSTFILES
; Sections
Section "section_name" section_index
# your code here
SectionEnd
; Functions
Function .onInit
MessageBox MB_OK "Here comes a$\n$\rline-break!"
FunctionEnd

Wyświetl plik

@ -3,35 +3,26 @@
perl example code for Ace
=cut
use v5.10;
use strict;
use warnings;
my $num_primes = 0;
use List::Util qw(first);
my @primes;
# Put 2 as the first prime so we won't have an empty array
$primes[$num_primes] = 2;
$num_primes++;
push @primes, 2;
MAIN_LOOP:
for my $number_to_check (3 .. 200)
{
for my $p (0 .. ($num_primes-1))
{
if ($number_to_check % $primes[$p] == 0)
{
next MAIN_LOOP;
}
}
for my $number_to_check (3 .. 200) {
# Check if the current number is divisible by any previous prime
# if it is, skip to the next number. Use first to bail out as soon
# as we find a prime that divides it.
next if (first {$number_to_check % $_ == 0} @primes);
# If we reached this point it means $number_to_check is not
# divisable by any prime number that came before it.
$primes[$num_primes] = $number_to_check;
$num_primes++;
push @primes, $number_to_check;
}
for my $p (0 .. ($num_primes-1))
{
print $primes[$p], ", ";
}
print "\n";
# List out all of the primes
say join(', ', @primes);

Wyświetl plik

@ -0,0 +1,68 @@
<!-- Stored in resources/views/layouts/app.blade.php -->
<html>
<head>
<title>App Name - @yield('title')</title>
<script>
var app = @json($array);
</script>
</head>
<body>
@extends('layouts.app')
@section('sidebar')
@parent
<p>This is appended to the master sidebar.</p>
@endsection
@if (count($records) === 1)
I have one record!
@elseif (count($records) > 1)
I have multiple records!
@else
I don't have any records!
@endif
@foreach ($users as $user)
@if ($user->type == 1)
@continue
@endif
<li>{{ $user->name }}</li>
@if ($user->number == 5)
@break
@endif
@endforeach
@foreach ($users as $user)
@continue($user->type == 1)
<li>{{ $user->name }}</li>
@break($user->number == 5)
@endforeach
<div>
@include('shared.errors')
<form>
<!-- Form Contents -->
</form>
</div>
@includeIf('view.name', ['some' => 'data'])
@env('local')
// The application is in the local environment...
@elseenv('testing')
// The application is in the testing environment...
@else
// The application is not in the local or testing environment...
@endenv
<div class="container">
@yield('content')
</div>
</body>
</html>

Wyświetl plik

@ -0,0 +1,9 @@
A = load 'mobydick.txt';
B = foreach A generate flatten(TOKENIZE((chararray)$0)) as word;
C = filter B by word matches '\\w+';
D = group C by word;
E = foreach D generate COUNT(C) as count, group as word;
F = order E by count desc;
-- one comment
/* another comment */
dump F;

Wyświetl plik

@ -142,7 +142,14 @@ procedure oldStyle .str1$ .num .str2$
.local = 1
endproc
# New-style procedure declaration
# New-style procedure declaration with parentheses
procedure newStyle (.str1$, .num, .str2$)
.local = 1
# Command with "local" variable
.local = Get total duration
endproc
# New-style procedure declaration with colon
procedure newStyle: .str1$, .num, .str2$
# Command with "local" variable
newStyle.local = Get total duration
endproc

Wyświetl plik

@ -0,0 +1,51 @@
define apache::vhost ($port, $docroot, $servername = $title, $vhost_name = '*') {
include apache
include apache::params
$vhost_dir = $apache::params::vhost_dir
file { "${vhost_dir}/${servername}.conf":
content => template('apache/vhost-default.conf.erb'),
owner => 'www',
group => 'www',
mode => '644',
require => Package['httpd'],
notify => Service['httpd'],
}
}
type MyModule::Tree = Array[Variant[Data, Tree]]
function apache::bool2http(Variant[String, Boolean] $arg) >> String {
case $arg {
false, undef, /(?i:false)/ : { 'Off' }
true, /(?i:true)/ : { 'On' }
default : { "$arg" }
}
}
# A class with parameters
class apache (String $version = 'latest') {
package {'httpd':
ensure => $version, # Using the class parameter from above
before => File['/etc/httpd.conf'],
}
file {'/etc/httpd.conf':
ensure => file,
owner => 'httpd',
content => template('apache/httpd.conf.erb'), # Template from a module
}
service {'httpd':
ensure => running,
enable => true,
subscribe => File['/etc/httpd.conf'],
}
}
if $is_virtual {
warning( 'Tried to include class ntp on virtual machine; this node might be misclassified.' )
}
elsif $operatingsystem == 'Darwin' {
warning( 'This NTP module does not yet work on our Mac laptops.' )
else {
include ntp
}

Wyświetl plik

@ -0,0 +1,7 @@
@* razor mode *@
@{
Layout = "~/layout"
@: <a>
@Layout
@: </a>
}

Wyświetl plik

@ -0,0 +1,62 @@
Red []
info: func ['fn /name /intro /args /refinements /locals /return /spec
/arg-num /arg-names /arg-types /ref-names /ref-types /ref-num /type
/local intr ars refs locs ret arg ref typ
][
intr: copy "" ars: make map! copy [] refs: make map! copy [] locs: copy [] ret: copy [] typ: ref-arg: ref-arg-type: none
if lit-word? fn [fn: to-word fn]
unless find [op! native! function! action!] type?/word get fn [
cause-error 'user 'message ["Only function types accepted!"]
]
out: make map! copy []
specs: spec-of get fn
parse specs [
opt [set intr string!]
any [set arg [word! | lit-word!] opt [set typ block!] opt string! (put ars arg either typ [typ][[any-type!]])]
any [set ref refinement! [
if (ref <> /local) (put refs to-lit-word ref make map! copy [])
opt string!
any [set ref-arg word! opt [set ref-arg-type block!]
(put refs/(to-word ref) to-lit-word ref-arg either ref-arg-type [ref-arg-type][[any-type!]])
]
| any [set loc word! (append locs loc) opt string!]
opt [set-word! set ret block!]
]]
(
out: case [
name [to-word fn]
intro [intr]
args [ars]
arg-num [length? ars]
arg-names [copy keys-of ars]
arg-types [copy values-of ars]
refinements [refs]
ref-names [copy keys-of refs]
ref-types [copy values-of refs]
ref-num [length? refs]
locals [locs]
return [ret]
spec [specs]
true [
make object! [
name: to-word fn
intro: intr
args: ars
refinements: refs
locals: locs
return: ret
spec: specs
type: type? get fn
arg-num: length? args
arg-names: copy keys-of args
arg-types: copy values-of args
ref-names: copy keys-of refinements
ref-types: copy values-of refinements
ref-num: length? refinements
]
]
])
]
out
]

Wyświetl plik

@ -0,0 +1,413 @@
==========================================
*reStructuredText* Highlighter for **Ace**
==========================================
.. seealso::
http://docutils.sourceforge.net/docs/user/rst/quickstart.html
ReStructuredText Primer
=======================
:Author: Richard Jones
:Version: $Revision: 5801 $
:Copyright: This document has been placed in the public domain.
.. contents::
The text below contains links that look like "(quickref__)". These
are relative links that point to the `Quick reStructuredText`_ user
reference. If these links don't work, please refer to the `master
quick reference`_ document.
__
.. _Quick reStructuredText: quickref.html
.. _master quick reference:
http://docutils.sourceforge.net/docs/user/rst/quickref.html
.. Note:: This document is an informal introduction to
reStructuredText. The `What Next?`_ section below has links to
further resources, including a formal reference.
Structure
---------
From the outset, let me say that "Structured Text" is probably a bit
of a misnomer. It's more like "Relaxed Text" that uses certain
consistent patterns. These patterns are interpreted by a HTML
converter to produce "Very Structured Text" that can be used by a web
browser.
The most basic pattern recognised is a **paragraph** (quickref__).
That's a chunk of text that is separated by blank lines (one is
enough). Paragraphs must have the same indentation -- that is, line
up at their left edge. Paragraphs that start indented will result in
indented quote paragraphs. For example::
This is a paragraph. It's quite
short.
This paragraph will result in an indented block of
text, typically used for quoting other text.
This is another one.
Results in:
This is a paragraph. It's quite
short.
This paragraph will result in an indented block of
text, typically used for quoting other text.
This is another one.
__ quickref.html#paragraphs
Text styles
-----------
(quickref__)
__ quickref.html#inline-markup
Inside paragraphs and other bodies of text, you may additionally mark
text for *italics* with "``*italics*``" or **bold** with
"``**bold**``". This is called "inline markup".
If you want something to appear as a fixed-space literal, use
"````double back-quotes````". Note that no further fiddling is done
inside the double back-quotes -- so asterisks "``*``" etc. are left
alone.
If you find that you want to use one of the "special" characters in
text, it will generally be OK -- reStructuredText is pretty smart.
For example, this lone asterisk * is handled just fine, as is the
asterisk in this equation: 5*6=30. If you actually
want text \*surrounded by asterisks* to **not** be italicised, then
you need to indicate that the asterisk is not special. You do this by
placing a backslash just before it, like so "``\*``" (quickref__), or
by enclosing it in double back-quotes (inline literals), like this::
``*``
__ quickref.html#escaping
.. Tip:: Think of inline markup as a form of (parentheses) and use it
the same way: immediately before and after the text being marked
up. Inline markup by itself (surrounded by whitespace) or in the
middle of a word won't be recognized. See the `markup spec`__ for
full details.
__ ../../ref/rst/restructuredtext.html#inline-markup
Lists
-----
Lists of items come in three main flavours: **enumerated**,
**bulleted** and **definitions**. In all list cases, you may have as
many paragraphs, sublists, etc. as you want, as long as the left-hand
side of the paragraph or whatever aligns with the first line of text
in the list item.
Lists must always start a new paragraph -- that is, they must appear
after a blank line.
**enumerated** lists (numbers, letters or roman numerals; quickref__)
__ quickref.html#enumerated-lists
Start a line off with a number or letter followed by a period ".",
right bracket ")" or surrounded by brackets "( )" -- whatever you're
comfortable with. All of the following forms are recognised::
1. numbers
A. upper-case letters
and it goes over many lines
with two paragraphs and all!
a. lower-case letters
3. with a sub-list starting at a different number
4. make sure the numbers are in the correct sequence though!
I. upper-case roman numerals
i. lower-case roman numerals
(1) numbers again
1) and again
Results in (note: the different enumerated list styles are not
always supported by every web browser, so you may not get the full
effect here):
1. numbers
A. upper-case letters
and it goes over many lines
with two paragraphs and all!
a. lower-case letters
3. with a sub-list starting at a different number
4. make sure the numbers are in the correct sequence though!
I. upper-case roman numerals
i. lower-case roman numerals
(1) numbers again
1) and again
**bulleted** lists (quickref__)
__ quickref.html#bullet-lists
Just like enumerated lists, start the line off with a bullet point
character - either "-", "+" or "\*"::
* a bullet point using "\*"
- a sub-list using "-"
+ yet another sub-list
- another item
Results in:
* a bullet point using "\*"
- a sub-list using "-"
+ yet another sub-list
- another item
**definition** lists (quickref__)
__ quickref.html#definition-lists
Unlike the other two, the definition lists consist of a term, and
the definition of that term. The format of a definition list is::
what
Definition lists associate a term with a definition.
*how*
The term is a one-line phrase, and the definition is one or more
paragraphs or body elements, indented relative to the term.
Blank lines are not allowed between term and definition.
Results in:
what
Definition lists associate a term with a definition.
*how*
The term is a one-line phrase, and the definition is one or more
paragraphs or body elements, indented relative to the term.
Blank lines are not allowed between term and definition.
Preformatting (code samples)
----------------------------
(quickref__)
__ quickref.html#literal-blocks
To just include a chunk of preformatted, never-to-be-fiddled-with
text, finish the prior paragraph with "``::``". The preformatted
block is finished when the text falls back to the same indentation
level as a paragraph prior to the preformatted block. For example::
An example::
Whitespace, newlines, blank lines, and all kinds of markup
(like *this* or \this) is preserved by literal blocks.
Lookie here, I've dropped an indentation level
(but not far enough)
no more example
Results in:
An example::
Whitespace, newlines, blank lines, and all kinds of markup
(like *this* or \this) is preserved by literal blocks.
Lookie here, I've dropped an indentation level
(but not far enough)
no more example
Note that if a paragraph consists only of "``::``", then it's removed
from the output::
::
This is preformatted text, and the
last "::" paragraph is removed
Results in:
::
This is preformatted text, and the
last "::" paragraph is removed
Sections
--------
(quickref__)
__ quickref.html#section-structure
To break longer text up into sections, you use **section headers**.
These are a single line of text (one or more words) with adornment: an
underline alone, or an underline and an overline together, in dashes
"``-----``", equals "``======``", tildes "``~~~~~~``" or any of the
non-alphanumeric characters ``= - ` : ' " ~ ^ _ * + # < >`` that you
feel comfortable with. An underline-only adornment is distinct from
an overline-and-underline adornment using the same character. The
underline/overline must be at least as long as the title text. Be
consistent, since all sections marked with the same adornment style
are deemed to be at the same level::
Chapter 1 Title
===============
Section 1.1 Title
-----------------
Subsection 1.1.1 Title
~~~~~~~~~~~~~~~~~~~~~~
Section 1.2 Title
-----------------
Chapter 2 Title
===============
This results in the following structure, illustrated by simplified
pseudo-XML::
<section>
<title>
Chapter 1 Title
<section>
<title>
Section 1.1 Title
<section>
<title>
Subsection 1.1.1 Title
<section>
<title>
Section 1.2 Title
<section>
<title>
Chapter 2 Title
(Pseudo-XML uses indentation for nesting and has no end-tags. It's
not possible to show actual processed output, as in the other
examples, because sections cannot exist inside block quotes. For a
concrete example, compare the section structure of this document's
source text and processed output.)
Note that section headers are available as link targets, just using
their name. To link to the Lists_ heading, I write "``Lists_``". If
the heading has a space in it like `text styles`_, we need to quote
the heading "```text styles`_``".
Document Title / Subtitle
`````````````````````````
The title of the whole document is distinct from section titles and
may be formatted somewhat differently (e.g. the HTML writer by default
shows it as a centered heading).
To indicate the document title in reStructuredText, use a unique adornment
style at the beginning of the document. To indicate the document subtitle,
use another unique adornment style immediately after the document title. For
example::
================
Document Title
================
----------
Subtitle
----------
Section Title
=============
...
Note that "Document Title" and "Section Title" above both use equals
signs, but are distict and unrelated styles. The text of
overline-and-underlined titles (but not underlined-only) may be inset
for aesthetics.
Images
------
(quickref__)
__ quickref.html#directives
To include an image in your document, you use the the ``image`` directive__.
For example::
.. image:: images/biohazard.png
results in:
.. image:: images/biohazard.png
The ``images/biohazard.png`` part indicates the filename of the image
you wish to appear in the document. There's no restriction placed on
the image (format, size etc). If the image is to appear in HTML and
you wish to supply additional information, you may::
.. image:: images/biohazard.png
:height: 100
:width: 200
:scale: 50
:alt: alternate text
See the full `image directive documentation`__ for more info.
__ ../../ref/rst/directives.html
__ ../../ref/rst/directives.html#images
What Next?
----------
This primer introduces the most common features of reStructuredText,
but there are a lot more to explore. The `Quick reStructuredText`_
user reference is a good place to go next. For complete details, the
`reStructuredText Markup Specification`_ is the place to go [#]_.
Users who have questions or need assistance with Docutils or
reStructuredText should post a message to the Docutils-users_ mailing
list.
.. [#] If that relative link doesn't work, try the master document:
http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html.
.. _reStructuredText Markup Specification:
../../ref/rst/restructuredtext.html
.. _Docutils-users: ../mailing-lists.html#docutils-users
.. _Docutils project web site: http://docutils.sourceforge.net/

Wyświetl plik

@ -0,0 +1,34 @@
doctype html
html
head
title Slim Examples
meta name="keywords" content="template language"
meta name="author" content=author
link rel="icon" type="image/png" href=file_path("favicon.png")
javascript:
alert('Slim supports embedded javascript!')
body
h1 Markup examples
#content
p This example shows you how a basic Slim file looks.
== yield
- if items.any?
table#items
- for item in items
tr
td.name = item.name
td.price = item.price
- else
p No items found. Please add some inventory.
Thank you!
div id="footer"
== render 'footer'
| Copyright &copy; #{@year} #{@author}
indenting test
- @page_current = true

Wyświetl plik

@ -0,0 +1,13 @@
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
# 1. Directors of movies starring Brad Pitt
# Datasource: http://fragments.dbpedia.org/*/en
SELECT ?movie ?title ?name
WHERE {
?movie dbpedia-owl:starring [ rdfs:label "Brad Pitt"@en ];
rdfs:label ?title;
dbpedia-owl:director [ rdfs:label ?name ].
FILTER LANGMATCHES(LANG(?title), "EN")
FILTER LANGMATCHES(LANG(?name), "EN")
}

Wyświetl plik

@ -0,0 +1,94 @@
export TF_LOG=TRACE
# An AMI
variable "ami" {
description = "the AMI to use"
}
/* A multi
line comment. */
resource "aws_instance" "web" {
ami = "${var.ami}"
count = 2
source_dest_check = false
connection {
user = "root"
}
}
resource "aws_instance" "web" {
subnet = "${var.env == "production" ? var.prod_subnet : var.dev_subnet}"
}
variable "count" {
default = 2
}
variable "hostnames" {
default = {
"0" = "example1.org"
"1" = "example2.net"
}
}
data "template_file" "web_init" {
# Render the template once for each instance
count = "${length(var.hostnames)}"
template = "${file("templates/web_init.tpl")}"
vars {
# count.index tells us the index of the instance we are rendering
hostname = "${var.hostnames[count.index]}"
}
}
resource "aws_instance" "web" {
# Create one instance for each hostname
count = "${length(var.hostnames)}"
# Pass each instance its corresponding template_file
user_data = "${data.template_file.web_init.*.rendered[count.index]}"
}
variable "count" {
default = 2
}
# Define the common tags for all resources
locals {
common_tags = {
Component = "awesome-app"
Environment = "production"
}
}
# Create a resource that blends the common tags with instance-specific tags.
resource "aws_instance" "server" {
ami = "ami-123456"
instance_type = "t2.micro"
tags = "${merge(
local.common_tags,
map(
"Name", "awesome-app-server",
"Role", "server"
)
)}"
}
$ terraform apply -var foo=bar -var foo=baz
$ terraform apply -var 'foo={quux="bar"}' -var 'foo={bar="baz"}'
$ terraform apply -var-file=foo.tfvars -var-file=bar.tfvars
$ TF_VAR_somemap='{foo = "bar", baz = "qux"}' terraform plan
resource "aws_instance" "web" {
# ...
count = "${var.count}"
# Tag the instance with a counter starting at 1, ie. web-001
tags {
Name = "${format("web-%03d", count.index + 1)}"
}
}

Wyświetl plik

@ -0,0 +1,3 @@
var mode = <div>
Typescript + <b> JSX </b>
</div>;

Wyświetl plik

@ -0,0 +1,15 @@
@base <http://example.org/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rel: <http://www.perceive.net/schemas/relationship/> .
<#green-goblin>
rel:enemyOf <#spiderman> ;
a foaf:Person ; # in the context of the Marvel universe
foaf:name "Green Goblin" .
<#spiderman>
rel:enemyOf <#green-goblin> ;
a foaf:Person ;
foaf:name "Spiderman", "Человек-паук"@ru .

Wyświetl plik

@ -11,7 +11,7 @@ class Greeter {
var greeter = new Greeter("world");
var button = document.createElement('button')
button.innerText = "Say Hello"
button.innerText = <string>"Say Hello";
button.onclick = function() {
alert(greeter.greet())
}

Wyświetl plik

@ -0,0 +1,28 @@
class Actividad {
method calcularMejora()
}
class EstudiarMateria inherits Actividad {
var materia
var puntos = 0
new(m, p) {
materia = m
puntos = p
}
override method calcularMejora() = puntos
}
class EjercitarEnSimulador inherits Actividad {
var horas = 0
new(h) { horas = h }
override method calcularMejora() = 10 * horas
}
object pepita {
var energia = 100
method volar(m) {
energia -= m
}
}

Wyświetl plik

@ -1 +0,0 @@
The icons in this folder are from the Eclipse project and licensed under the Eclipse public license version 1.0 (EPL).

Wyświetl plik

@ -1,260 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0049)http://www.eclipse.org/org/documents/epl-v10.html -->
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Eclipse Public License - Version 1.0</title>
<style type="text/css">
body {
size: 8.5in 11.0in;
margin: 0.25in 0.5in 0.25in 0.5in;
tab-interval: 0.5in;
}
p {
margin-left: auto;
margin-top: 0.5em;
margin-bottom: 0.5em;
}
p.list {
margin-left: 0.5in;
margin-top: 0.05em;
margin-bottom: 0.05em;
}
</style>
<script src="chrome-extension://jgghnecdoiloelcogfmgjgcacadpaejf/inject.js"></script></head>
<body lang="EN-US">
<h2>Eclipse Public License - v 1.0</h2>
<p>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR
DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS
AGREEMENT.</p>
<p><b>1. DEFINITIONS</b></p>
<p>"Contribution" means:</p>
<p class="list">a) in the case of the initial Contributor, the initial
code and documentation distributed under this Agreement, and</p>
<p class="list">b) in the case of each subsequent Contributor:</p>
<p class="list">i) changes to the Program, and</p>
<p class="list">ii) additions to the Program;</p>
<p class="list">where such changes and/or additions to the Program
originate from and are distributed by that particular Contributor. A
Contribution 'originates' from a Contributor if it was added to the
Program by such Contributor itself or anyone acting on such
Contributor's behalf. Contributions do not include additions to the
Program which: (i) are separate modules of software distributed in
conjunction with the Program under their own license agreement, and (ii)
are not derivative works of the Program.</p>
<p>"Contributor" means any person or entity that distributes
the Program.</p>
<p>"Licensed Patents" mean patent claims licensable by a
Contributor which are necessarily infringed by the use or sale of its
Contribution alone or when combined with the Program.</p>
<p>"Program" means the Contributions distributed in accordance
with this Agreement.</p>
<p>"Recipient" means anyone who receives the Program under
this Agreement, including all Contributors.</p>
<p><b>2. GRANT OF RIGHTS</b></p>
<p class="list">a) Subject to the terms of this Agreement, each
Contributor hereby grants Recipient a non-exclusive, worldwide,
royalty-free copyright license to reproduce, prepare derivative works
of, publicly display, publicly perform, distribute and sublicense the
Contribution of such Contributor, if any, and such derivative works, in
source code and object code form.</p>
<p class="list">b) Subject to the terms of this Agreement, each
Contributor hereby grants Recipient a non-exclusive, worldwide,
royalty-free patent license under Licensed Patents to make, use, sell,
offer to sell, import and otherwise transfer the Contribution of such
Contributor, if any, in source code and object code form. This patent
license shall apply to the combination of the Contribution and the
Program if, at the time the Contribution is added by the Contributor,
such addition of the Contribution causes such combination to be covered
by the Licensed Patents. The patent license shall not apply to any other
combinations which include the Contribution. No hardware per se is
licensed hereunder.</p>
<p class="list">c) Recipient understands that although each Contributor
grants the licenses to its Contributions set forth herein, no assurances
are provided by any Contributor that the Program does not infringe the
patent or other intellectual property rights of any other entity. Each
Contributor disclaims any liability to Recipient for claims brought by
any other entity based on infringement of intellectual property rights
or otherwise. As a condition to exercising the rights and licenses
granted hereunder, each Recipient hereby assumes sole responsibility to
secure any other intellectual property rights needed, if any. For
example, if a third party patent license is required to allow Recipient
to distribute the Program, it is Recipient's responsibility to acquire
that license before distributing the Program.</p>
<p class="list">d) Each Contributor represents that to its knowledge it
has sufficient copyright rights in its Contribution, if any, to grant
the copyright license set forth in this Agreement.</p>
<p><b>3. REQUIREMENTS</b></p>
<p>A Contributor may choose to distribute the Program in object code
form under its own license agreement, provided that:</p>
<p class="list">a) it complies with the terms and conditions of this
Agreement; and</p>
<p class="list">b) its license agreement:</p>
<p class="list">i) effectively disclaims on behalf of all Contributors
all warranties and conditions, express and implied, including warranties
or conditions of title and non-infringement, and implied warranties or
conditions of merchantability and fitness for a particular purpose;</p>
<p class="list">ii) effectively excludes on behalf of all Contributors
all liability for damages, including direct, indirect, special,
incidental and consequential damages, such as lost profits;</p>
<p class="list">iii) states that any provisions which differ from this
Agreement are offered by that Contributor alone and not by any other
party; and</p>
<p class="list">iv) states that source code for the Program is available
from such Contributor, and informs licensees how to obtain it in a
reasonable manner on or through a medium customarily used for software
exchange.</p>
<p>When the Program is made available in source code form:</p>
<p class="list">a) it must be made available under this Agreement; and</p>
<p class="list">b) a copy of this Agreement must be included with each
copy of the Program.</p>
<p>Contributors may not remove or alter any copyright notices contained
within the Program.</p>
<p>Each Contributor must identify itself as the originator of its
Contribution, if any, in a manner that reasonably allows subsequent
Recipients to identify the originator of the Contribution.</p>
<p><b>4. COMMERCIAL DISTRIBUTION</b></p>
<p>Commercial distributors of software may accept certain
responsibilities with respect to end users, business partners and the
like. While this license is intended to facilitate the commercial use of
the Program, the Contributor who includes the Program in a commercial
product offering should do so in a manner which does not create
potential liability for other Contributors. Therefore, if a Contributor
includes the Program in a commercial product offering, such Contributor
("Commercial Contributor") hereby agrees to defend and
indemnify every other Contributor ("Indemnified Contributor")
against any losses, damages and costs (collectively "Losses")
arising from claims, lawsuits and other legal actions brought by a third
party against the Indemnified Contributor to the extent caused by the
acts or omissions of such Commercial Contributor in connection with its
distribution of the Program in a commercial product offering. The
obligations in this section do not apply to any claims or Losses
relating to any actual or alleged intellectual property infringement. In
order to qualify, an Indemnified Contributor must: a) promptly notify
the Commercial Contributor in writing of such claim, and b) allow the
Commercial Contributor to control, and cooperate with the Commercial
Contributor in, the defense and any related settlement negotiations. The
Indemnified Contributor may participate in any such claim at its own
expense.</p>
<p>For example, a Contributor might include the Program in a commercial
product offering, Product X. That Contributor is then a Commercial
Contributor. If that Commercial Contributor then makes performance
claims, or offers warranties related to Product X, those performance
claims and warranties are such Commercial Contributor's responsibility
alone. Under this section, the Commercial Contributor would have to
defend claims against the other Contributors related to those
performance claims and warranties, and if a court requires any other
Contributor to pay any damages as a result, the Commercial Contributor
must pay those damages.</p>
<p><b>5. NO WARRANTY</b></p>
<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION,
ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
responsible for determining the appropriateness of using and
distributing the Program and assumes all risks associated with its
exercise of rights under this Agreement , including but not limited to
the risks and costs of program errors, compliance with applicable laws,
damage to or loss of data, programs or equipment, and unavailability or
interruption of operations.</p>
<p><b>6. DISCLAIMER OF LIABILITY</b></p>
<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</p>
<p><b>7. GENERAL</b></p>
<p>If any provision of this Agreement is invalid or unenforceable under
applicable law, it shall not affect the validity or enforceability of
the remainder of the terms of this Agreement, and without further action
by the parties hereto, such provision shall be reformed to the minimum
extent necessary to make such provision valid and enforceable.</p>
<p>If Recipient institutes patent litigation against any entity
(including a cross-claim or counterclaim in a lawsuit) alleging that the
Program itself (excluding combinations of the Program with other
software or hardware) infringes such Recipient's patent(s), then such
Recipient's rights granted under Section 2(b) shall terminate as of the
date such litigation is filed.</p>
<p>All Recipient's rights under this Agreement shall terminate if it
fails to comply with any of the material terms or conditions of this
Agreement and does not cure such failure in a reasonable period of time
after becoming aware of such noncompliance. If all Recipient's rights
under this Agreement terminate, Recipient agrees to cease use and
distribution of the Program as soon as reasonably practicable. However,
Recipient's obligations under this Agreement and any licenses granted by
Recipient relating to the Program shall continue and survive.</p>
<p>Everyone is permitted to copy and distribute copies of this
Agreement, but in order to avoid inconsistency the Agreement is
copyrighted and may only be modified in the following manner. The
Agreement Steward reserves the right to publish new versions (including
revisions) of this Agreement from time to time. No one other than the
Agreement Steward has the right to modify this Agreement. The Eclipse
Foundation is the initial Agreement Steward. The Eclipse Foundation may
assign the responsibility to serve as the Agreement Steward to a
suitable separate entity. Each new version of the Agreement will be
given a distinguishing version number. The Program (including
Contributions) may always be distributed subject to the version of the
Agreement under which it was received. In addition, after a new version
of the Agreement is published, Contributor may elect to distribute the
Program (including its Contributions) under the new version. Except as
expressly stated in Sections 2(a) and 2(b) above, Recipient receives no
rights or licenses to the intellectual property of any Contributor under
this Agreement, whether expressly, by implication, estoppel or
otherwise. All rights in the Program not expressly granted under this
Agreement are reserved.</p>
<p>This Agreement is governed by the laws of the State of New York and
the intellectual property laws of the United States of America. No party
to this Agreement will bring a legal action under this Agreement more
than one year after the cause of action arose. Each party waives its
rights to a jury trial in any resulting litigation.</p>
</body></html>

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 339 B

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 324 B

Wyświetl plik

@ -121,7 +121,7 @@ exports.singleLineEditor = function(el) {
editor.setShowPrintMargin(false);
editor.renderer.setShowGutter(false);
editor.renderer.setHighlightGutterLine(false);
editor.$mouseHandler.$focusTimeout = 0;
editor.$mouseHandler.$focusWaitTimout = 0;
return editor;
};

Wyświetl plik

@ -40,10 +40,31 @@ var Renderer = require("ace/virtual_renderer").VirtualRenderer;
var Editor = require("ace/editor").Editor;
var MultiSelect = require("ace/multi_select").MultiSelect;
var urlOptions = {}
try {
window.location.search.slice(1).split(/[&]/).forEach(function(e) {
var parts = e.split("=");
urlOptions[decodeURIComponent(parts[0])] = decodeURIComponent(parts[1]);
});
} catch(e) {
console.error(e);
}
exports.createEditor = function(el) {
return new Editor(new Renderer(el));
};
exports.getOption = function(name) {
if (urlOptions[name])
return urlOptions[name];
return localStorage && localStorage.getItem(name);
};
exports.saveOption = function(name, value) {
if (value == false)
value = "";
localStorage && localStorage.setItem(name, value);
};
exports.createSplitEditor = function(el) {
if (typeof(el) == "string")
el = document.getElementById(el);
@ -133,23 +154,17 @@ exports.stripLeadingComments = function(str) {
};
/***************************/
exports.saveOption = function(el, val) {
function saveOptionFromElement(el, val) {
if (!el.onchange && !el.onclick)
return;
if ("checked" in el) {
if (val !== undefined)
el.checked = val;
localStorage && localStorage.setItem(el.id, el.checked ? 1 : 0);
}
else {
if (val !== undefined)
el.value = val;
localStorage && localStorage.setItem(el.id, el.value);
}
};
}
exports.bindCheckbox = function(id, callback, noInit) {
if (typeof id == "string")
@ -159,12 +174,15 @@ exports.bindCheckbox = function(id, callback, noInit) {
id = el.id;
}
var el = document.getElementById(id);
if (localStorage && localStorage.getItem(id))
if (urlOptions[id])
el.checked = urlOptions[id] == "1";
else if (localStorage && localStorage.getItem(id))
el.checked = localStorage.getItem(id) == "1";
var onCheck = function() {
callback(!!el.checked);
exports.saveOption(el);
saveOptionFromElement(el);
};
el.onclick = onCheck;
noInit || onCheck();
@ -178,12 +196,15 @@ exports.bindDropdown = function(id, callback, noInit) {
var el = id;
id = el.id;
}
if (localStorage && localStorage.getItem(id))
if (urlOptions[id])
el.value = urlOptions[id];
else if (localStorage && localStorage.getItem(id))
el.value = localStorage.getItem(id);
var onChange = function() {
callback(el.value);
exports.saveOption(el);
saveOptionFromElement(el);
};
el.onchange = onChange;

Wyświetl plik

@ -1,11 +1,11 @@
({
optimize: "none",
preserveLicenseComments: false,
name: "node_modules/almond/almond",
baseUrl: "../../",
name: "node_modules/almond/almond.js",
baseUrl: ".",
paths: {
ace : "lib/ace",
demo: "demo/kitchen-sink"
ace : "../../lib/ace",
demo: "../../demo/kitchen-sink"
},
packages: [
],
@ -14,7 +14,7 @@
],
exclude: [
],
out: "./packed.js",
out: "./dist/bundle.js",
useStrict: true,
wrap: false
})

Wyświetl plik

@ -24,7 +24,7 @@
<div>
</pre>
<script src="./packed.js" data-ace-base="src" type="text/javascript" charset="utf-8"></script>
<script src="./dist/bundle.js" data-ace-base="src" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
require("ace/config").set("basePath", "../../build/src")
require("ace/config").set("packaged", true)

Wyświetl plik

@ -49,6 +49,9 @@
border-radius: 10px 10px 10px 10px;
box-shadow: 0 0 12px 0 lightblue;
}
body {
transform: translateZ(0);
}
</style>
</head>
<body>
@ -82,7 +85,7 @@ require(["ace/ace", "ace/ext/themelist"], function(ace) {
var $ = document.getElementById.bind(document);
var dom = require("ace/lib/dom");
//add command to all new editor instaces
//add command to all new editor instances
require("ace/commands/default_commands").commands.push({
name: "Toggle Fullscreen",
bindKey: "F11",

Wyświetl plik

@ -35,7 +35,7 @@ require(["ace/ace", "ace/ext/settings_menu"], function(ace) {
editor.session.setMode("ace/mode/html");
editor.commands.addCommands([{
name: "showSettingsMenu",
bindKey: {win: "Ctrl-q", mac: "Command-q"},
bindKey: {win: "Ctrl-q", mac: "Ctrl-q"},
exec: function(editor) {
editor.showSettingsMenu();
},

124
plugins/node_modules/ace/demo/shadow-dom.html wygenerowano vendored 100644
Wyświetl plik

@ -0,0 +1,124 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Editor</title>
<style type="text/css" media="screen">
.scrollmargin {
text-align: center;
}
.large-button {
color: lightblue;
cursor: pointer;
font: 30px arial;
padding: 20px;
text-align: center;
border: medium solid transparent;
display: inline-block;
}
.large-button:hover {
border: medium solid lightgray;
border-radius: 10px 10px 10px 10px;
box-shadow: 0 0 12px 0 lightblue;
}
body {
transform: translateZ(0);
}
</style>
</head>
<body>
<div class="scrollmargin">
<span onclick="add()" class="large-button">+</span>
</div>
<ace-playground></ace-playground>
<script src="kitchen-sink/require.js"></script>
<script>
require.config({paths: { "ace" : "../lib/ace"}});
require(["ace/ace"], function(ace) {
var dom = require("ace/lib/dom");
class AcePlayground extends HTMLElement {
constructor() {
super();
var shadow = this.createShadowRoot({mode: "open"});
var dom = require("ace/lib/dom");
dom.buildDom(["div", {id: "host"},
["div", {id: "html"}],
["div", {id: "css"}],
["iframe", {id: "preview"}],
["style", `
#host {
border: solid 1px gray;
display: grid;
grid-template-areas: "html preview" "css preview";
}
#html {
grid-area: html;
height: 200px;
}
#css {
grid-area: css;
height: 200px;
}
#preview {
grid-area: preview;
width: 100%;
height: 100%;
border: none;
}
`]
], shadow);
var htmlEditor = ace.edit(shadow.querySelector("#html"), {
theme: "ace/theme/solarized_light",
mode: "ace/mode/html",
value: "<div>\n\thollow world!\n</div>\n<script><\/script>",
autoScrollEditorIntoView: false
});
var cssEditor = ace.edit(shadow.querySelector("#css"), {
theme: "ace/theme/solarized_dark",
mode: "ace/mode/css",
value: "*{\n\tcolor:red\n}",
autoScrollEditorIntoView: false
});
var preview = shadow.querySelector("#preview");
this.htmlEditor = htmlEditor;
this.cssEditor = cssEditor;
this.preview = preview;
htmlEditor.renderer.attachToShadowRoot();
this.updatePreview = this.updatePreview.bind(this)
htmlEditor.on("input", this.updatePreview);
cssEditor.on("input", this.updatePreview);
this.updatePreview();
}
updatePreview() {
var code = this.htmlEditor.getValue() + "<style>" + this.cssEditor.getValue() + "</style>";
this.preview.src = "data:text/html," + encodeURIComponent(code)
}
}
customElements.define('ace-playground', AcePlayground);
window.add = function() {
var el = document.createElement("ace-playground");
document.body.appendChild(el);
};
});
</script>
</body>
</html>

95
plugins/node_modules/ace/demo/toolbar.html wygenerowano vendored 100644
Wyświetl plik

@ -0,0 +1,95 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Editor</title>
<style type="text/css" media="screen">
.ace_editor, .toolbar {
border: 1px solid lightgray;
margin: auto;
width: 80%;
}
.ace_editor {
height: 200px;
}
</style>
</head>
<body>
<script src="kitchen-sink/require.js"></script>
<script>
// setup paths
require.config({paths: { "ace" : "../lib/ace"}});
// load ace and extensions
require(["ace/ace", "ace/ext/language_tools"], function(ace) {
var buildDom = require("ace/lib/dom").buildDom;
var editor = ace.edit();
editor.setOptions({
theme: "ace/theme/tomorrow_night_eighties",
mode: "ace/mode/markdown",
maxLines: 30,
minLines: 30,
autoScrollEditorIntoView: true,
});
var refs = {};
function updateToolbar() {
refs.saveButton.disabled = editor.session.getUndoManager().isClean();
refs.undoButton.disabled = !editor.session.getUndoManager().hasUndo();
refs.redoButton.disabled = !editor.session.getUndoManager().hasRedo();
}
editor.on("input", updateToolbar);
editor.session.setValue(localStorage.savedValue || "Welcome to ace Toolbar demo!")
function save() {
localStorage.savedValue = editor.getValue();
editor.session.getUndoManager().markClean();
updateToolbar();
}
editor.commands.addCommand({
name: "save",
exec: save,
bindKey: { win: "ctrl-s", mac: "cmd-s" }
});
buildDom(["div", { class: "toolbar" },
["button", {
ref: "saveButton",
onclick: save
}, "save"],
["button", {
ref: "undoButton",
onclick: function() {
editor.undo();
}
}, "undo"],
["button", {
ref: "redoButton",
onclick: function() {
editor.redo();
}
}, "redo"],
["button", {
style: "font-weight: bold",
onclick: function() {
editor.insertSnippet("**${1:$SELECTION}**");
editor.renderer.scrollCursorIntoView()
}
}, "bold"],
["button", {
style: "font-style: italic",
onclick: function() {
editor.insertSnippet("*${1:$SELECTION}*");
editor.renderer.scrollCursorIntoView()
}
}, "Italic"],
], document.body, refs);
document.body.appendChild(editor.container)
window.editor = editor;
});
</script>
</body>
</html>

143
plugins/node_modules/ace/demo/transform.html wygenerowano vendored 100644
Wyświetl plik

@ -0,0 +1,143 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Editor</title>
<style type="text/css" media="screen">
.ace_editor {
border: 1px solid lightgray;
margin: auto;
height: 800px;
width: 400px;
font-size: 26px!important;
max-width: 30%;
}
.scrollmargin {
height: 80px;
text-align: center;
}
#editor1, #editor2, #editor3 {
display:inline-block
}
.wrapper {
text-align: center;
perspective: 500px;
margin-top: 50px;
}
#editor1 {
transform: rotateY(10deg) rotateX(-1deg);
}
#editor2 {
transform: translateZ(-36px) rotateX(-1deg);
}
#editor3 {
transform: rotateY(-10deg) rotateX(-1deg);
}
#editor4 {
transform: scale(-1,1) rotateX(-1deg);
}
.transformed {
transform: scale(0.5);
transform-origin: center 12%
}
#editor {
width: 100%;
min-width: 100%
}
body {
background: #a9bfc7;
}
.scrollmargin input > {margin: 10px}
</style>
</head>
<body>
<div class="transformed">
<div class="wrapper">
<pre id="editor1">editor1</pre>
<pre id="editor2">editor2</pre>
<pre id="editor3">editor3</pre>
</div>
<div class="scrollmargin"></div>
<pre id="editor4">editor4</pre>
<div class="scrollmargin">
<textarea></textarea>
</div>
<pre id="editor">editor</pre>
<div class="scrollmargin" style="transform: scale(2) translateY(3em);">
<input type="checkbox" id="option">Auto scroll into view</input>
<input type="range" onchange="document.body.style.zoom = 1 + value/250">css Zoom</input>
<input type="range" onchange="document.body.style.transform = 'rotateZ(' + (this.value * 18) +'deg)'">css Transform</input>
</div>
</div>
<div class="scrollmargin">
</div>
<script src="kitchen-sink/require.js"></script>
<script>
// setup paths
require.config({paths: { "ace" : "../lib/ace"}});
// load ace and extensions
require(["ace/ace"], function(ace) {
var editor1 = ace.edit("editor1");
editor1.setOptions({
hasCssTransforms: true,
theme: "ace/theme/tomorrow_night_blue",
mode: "ace/mode/html"
});
var editor2 = ace.edit("editor2");
editor2.setOptions({
hasCssTransforms: true,
theme: "ace/theme/kuroir",
mode: "ace/mode/html"
});
var editor3 = ace.edit("editor3");
editor3.setOptions({
hasCssTransforms: true,
theme: "ace/theme/tomorrow_night_eighties",
mode: "ace/mode/html"
});
var editor4 = ace.edit("editor4");
editor4.setOptions({
hasCssTransforms: true,
theme: "ace/theme/solarized_light",
mode: "ace/mode/html"
});
var editor = ace.edit("editor");
editor.setOptions({
hasCssTransforms: true,
mode: "ace/mode/html",
value: "editor 4\n from a mirror",
});
editor.renderer.setScrollMargin(10, 10, 10, 10);
var checkbox = document.getElementById("option");
checkbox.onchange = function() {
editor1.setOption("autoScrollEditorIntoView", checkbox.checked);
editor2.setOption("autoScrollEditorIntoView", checkbox.checked);
editor3.setOption("autoScrollEditorIntoView", checkbox.checked);
editor4.setOption("autoScrollEditorIntoView", checkbox.checked);
editor.setOption("autoScrollEditorIntoView", checkbox.checked);
};
checkbox.onchange();
});
</script>
<script src="./show_own_source.js"></script>
</body>
</html>

34
plugins/node_modules/ace/demo/webpack/demo.js wygenerowano vendored 100644
Wyświetl plik

@ -0,0 +1,34 @@
"use strict";
// import ace
import ace from '../../build'
// import Range from ace (it is also available as ace.Range)
import {Range, EditSession} from '../../build/'
// import modes that you want to include into your main bundle
import "../../build/src-noconflict/mode-javascript";
// import webpack resolver to dynamically load modes, you need to install file-loader for this to work!
import "../../build/webpack-resolver";
// if you want to allow dynamic loading of only a few modules use setModuleUrl for each of them manually
/*
import jsWorkerUrl from "file-loader!../../build/src-noconflict/worker-javascript";
ace.config.setModuleUrl("ace/mode/javascript_worker", jsWorkerUrl)
*/
var editor = ace.edit(null, {
maxLines: 50,
minLines: 10,
value: "var hello = 'world'" + "\n",
mode: "ace/mode/javascript",
bug: 1
})
editor.selection.setRange(new Range(0,0,0,3))
document.body.appendChild(editor.container)
/*
import {Mode as JSMode} from "../../build/src-noconflict/mode-javascript"
editor.setMode( new JSMode())
*/

34
plugins/node_modules/ace/demo/webpack/demo.ts wygenerowano vendored 100644
Wyświetl plik

@ -0,0 +1,34 @@
"use strict";
// import ace
import ace from '../../build'
// import Range from ace (it is also available as ace.Range)
import {Range, EditSession} from '../../build/'
// import modes that you want to include into your main bundle
import "../../build/src-noconflict/mode-javascript";
// import webpack resolver to dynamically load modes, you need to install file-loader for this to work!
import "../../build/webpack-resolver";
// if you want to allow dynamic loading of only a few modules use setModuleUrl for each of them manually
/*
import jsWorkerUrl from "file-loader!../../build/src-noconflict/worker-javascript";
ace.config.setModuleUrl("ace/mode/javascript_worker", jsWorkerUrl)
*/
var editor = ace.edit(null, {
maxLines: 50,
minLines: 10,
value: "var hello = 'world'" + "\n",
mode: "ace/mode/javascript",
bug: 1
})
editor.selection.setRange(new Range(0,0,0,3))
document.body.appendChild(editor.container)
/*
import {Mode as JSMode} from "../../build/src-noconflict/mode-javascript"
editor.setMode( new JSMode())
*/

5
plugins/node_modules/ace/demo/webpack/index.html wygenerowano vendored 100644
Wyświetl plik

@ -0,0 +1,5 @@
<!doctype html>
<meta charset="utf-8">
<body>
</body>
<script src="bundle.js"></script>

18
plugins/node_modules/ace/demo/webpack/package.json wygenerowano vendored 100644
Wyświetl plik

@ -0,0 +1,18 @@
{
"name": "ace-webpack-demo",
"version": "1.0.0",
"description": "",
"scripts": {
"start": "webpack-dev-server"
},
"keywords": [],
"author": "",
"dependencies": {
"file-loader": "^1.1.11",
"webpack": "^4.0.1",
"webpack-cli": "^2.0.10"
},
"devDependencies": {
"webpack-dev-server": "^3.1.0"
}
}

Wyświetl plik

@ -0,0 +1,29 @@
"use strict";
module.exports = {
mode: "development",
entry: "./demo.js",
output: {
path: __dirname + "/dist",
filename: "bundle.js"
},
node: {
global: false,
process: false,
Buffer: false,
__filename: "mock",
__dirname: "mock",
setImmediate: false
},
resolveLoader: {
modules: [
"node_modules",
__dirname + "/node_modules",
],
},
devServer: {
contentBase: __dirname,
compress: true,
port: 9000
}
};

404
plugins/node_modules/ace/experiments/dom.html wygenerowano vendored 100644
Wyświetl plik

@ -0,0 +1,404 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Dom test</title>
</head>
<body>
<pre id="root"></pre>
<script type="text/javascript" charset="utf-8">
var tests = {};
tests.innerHTML = function() {
function update(rootEl, lines) {
var html = []
for (var i = 0; i < lines.length; i++) {
html.push("<div class='line'>")
renderLine(html, lines[i])
html.push("</div>")
}
rootEl.innerHTML = html.join("")
}
function renderLine(html, tokens) {
for (var i = 0; i < tokens.length; i ++) {
html.push("<span class='", tokens[i], "'>", tokens[i], "</span>")
}
}
return update;
}
tests.domNewNodes = function() {
function elt(parent, name, className, content) {
var el = document.createElement(name);
if (content) {
el.appendChild(document.createTextNode(content))
}
parent && parent.appendChild(el)
el.className = className
return el;
}
function txtEl(parent, str) {
return parent.appendChild(document.createTextNode(str))
}
function clearEl(el) {
while (el.lastChild)
el.removeChild(el.lastChild);
}
function update(rootEl, lines) {
clearEl(rootEl)
for (var i = 0; i < lines.length; i++) {
var el = elt(rootEl, "div", "line")
renderLine(el, lines[i])
}
}
function renderLine(html, tokens) {
for (var i = 0; i < tokens.length; i ++) {
elt(html, "span", tokens[i], tokens[i])
}
}
return update;
}
tests.domCloneNode = function() {
var els = {}
function elt(parent, name, className, content) {
if (!els[name]) els[name] = document.createElement(name);
var el = els[name].cloneNode(false)
if (content) {
el.appendChild(document.createTextNode(content))
}
parent && parent.appendChild(el)
el.className = className
return el;
}
function txtEl(parent, str) {
return parent.appendChild(document.createTextNode(str))
}
function clearEl(el) {
while (el.lastChild)
el.removeChild(el.lastChild);
}
function update(rootEl, lines) {
clearEl(rootEl)
for (var i = 0; i < lines.length; i++) {
var el = elt(rootEl, "div", "line")
renderLine(el, lines[i])
}
}
function renderLine(html, tokens) {
for (var i = 0; i < tokens.length; i ++) {
elt(html, "span", tokens[i], tokens[i])
}
}
return update;
}
tests.domReuseNodes = function() {
function elt(parent, name, className, content) {
var el = document.createElement(name);
if (content) {
el.appendChild(document.createTextNode(content))
}
parent && parent.appendChild(el)
el.className = className
return el;
}
function txtEl(parent, str) {
return parent.appendChild(document.createTextNode(str))
}
function clearEl(el, l) {
while (l --> 0)
el.removeChild(el.lastChild);
}
function update(rootEl, lines) {
var ch = rootEl.childNodes
for (var i = 0; i < lines.length; i++) {
if (ch[i]) {
var el = ch[i]
el.className = "line"
}
else
var el = elt(rootEl, "div", "line")
renderLine(el, lines[i])
}
clearEl(rootEl, ch.length - i)
}
function renderLine(rootEl, tokens) {
var ch = rootEl.childNodes
for (var i = 0; i < tokens.length; i ++) {
if (ch[i]) {
var el = ch[i]
el.className = tokens[i]
el.firstChild.nodeValue = tokens[i]
}
else
elt(rootEl, "span", tokens[i], tokens[i])
}
clearEl(rootEl, ch.length - i)
}
return update;
}
tests.domReuseNodesWithFragment = function() {
function elt(parent, name, className, content) {
var el = document.createElement(name);
if (content) {
el.appendChild(document.createTextNode(content))
}
parent && parent.appendChild(el)
el.className = className
return el;
}
function txtEl(parent, str) {
return parent.appendChild(document.createTextNode(str))
}
function clearEl(el, l) {
while (l --> 0)
el.removeChild(el.lastChild);
}
function update(rootEl, lines) {
var fr = document.createDocumentFragment()
var ch = rootEl.childNodes
for (var i = 0; i < lines.length; i++) {
if (ch[i]) {
var el = ch[i]
el.className = "line"
fr.appendChild(el)
}
else
var el = elt(fr, "div", "line")
renderLine(el, lines[i])
}
clearEl(rootEl, ch.length - i)
rootEl.appendChild(fr)
}
function renderLine(rootEl, tokens) {
var ch = rootEl.childNodes
for (var i = 0; i < tokens.length; i ++) {
if (ch[i]) {
var el = ch[i]
el.className = tokens[i]
el.firstChild.nodeValue = tokens[i]
}
else
elt(rootEl, "span", tokens[i], tokens[i])
}
clearEl(rootEl, ch.length - i)
}
return update;
}
tests.domWithFragment = function() {
function elt(parent, name, className, content) {
var el = document.createElement(name);
if (content) {
el.appendChild(document.createTextNode(content))
}
parent && parent.appendChild(el)
el.className = className
return el;
}
function txtEl(parent, str) {
return parent.appendChild(document.createTextNode(str))
}
function clearEl(el) {
while (el.lastChild)
el.removeChild(el.lastChild);
}
function update(rootEl, lines) {
var fr = document.createDocumentFragment()
clearEl(rootEl)
for (var i = 0; i < lines.length; i++) {
var el = elt(fr, "div", "line")
renderLine(el, lines[i])
}
rootEl.appendChild(fr)
}
function renderLine(html, tokens) {
for (var i = 0; i < tokens.length; i ++) {
elt(html, "span", tokens[i], tokens[i])
}
}
return update;
}
tests.domdomReuseNodes_allowTextNodes = function dom31() {
function elt(parent, name, className, content) {
var el = document.createElement(name);
if (content) {
el.appendChild(document.createTextNode(content))
}
parent && parent.appendChild(el)
el.className = className
return el;
}
function txtEl(parent, str) {
return parent.appendChild(document.createTextNode(str))
}
function clearEl(el, l) {
while (l --> 0)
el.removeChild(el.lastChild);
}
function update(rootEl, lines) {
var ch = rootEl.childNodes
for (var i = 0; i < lines.length; i++) {
if (ch[i]) {
var el = ch[i]
el.className = "line"
}
else
var el = elt(rootEl, "div", "line")
renderLine(el, lines[i])
}
clearEl(rootEl, ch.length - i)
}
function renderLine(rootEl, tokens) {
var ch = rootEl.childNodes
for (var i = 0; i < tokens.length; i ++) {
if (i % 2) {
if (ch[i]) {
var el = ch[i]
el.className = tokens[i]
el.firstChild.nodeValue = tokens[i]
}
else
elt(rootEl, "span", tokens[i], tokens[i])
}
else {
if (ch[i]) {
var el = ch[i]
el.nodeValue = tokens[i]
}
else
txtEl(rootEl, tokens[i])
}
}
clearEl(rootEl, ch.length - i)
}
return update;
}
tests.domdomReuseNodes_AllWrapped = function dom32() {
function elt(parent, name, className, content) {
var el = document.createElement(name);
if (content) {
el.appendChild(document.createTextNode(content))
}
parent && parent.appendChild(el)
el.className = className
return el;
}
function txtEl(parent, str) {
return parent.appendChild(document.createTextNode(str))
}
function clearEl(el, l) {
while (l --> 0)
el.removeChild(el.lastChild);
}
function update(rootEl, lines) {
var ch = rootEl.childNodes
for (var i = 0; i < lines.length; i++) {
if (ch[i]) {
var el = ch[i]
el.className = "line"
}
else
var el = elt(rootEl, "div", "line")
renderLine(el, lines[i])
}
clearEl(rootEl, ch.length - i)
}
function renderLine(rootEl, tokens) {
var ch = rootEl.childNodes
for (var i = 0; i < tokens.length; i ++) {
if (ch[i]) {
var el = ch[i]
el.className = tokens[i]
el.firstChild.nodeValue = tokens[i]
}
else
elt(rootEl, "span", tokens[i], tokens[i])
}
clearEl(rootEl, ch.length - i)
}
return update;
}
function runTest(render, cb) {
var rootEl = document.getElementById("root")
rootEl.innerHTML = "";
var lines = [];
for (var i = 0; i < LINES; i++) {
var line = []
lines.push(line)
for (var j = 0; j < COLS; j ++) {
var ch = ((i + j) % COLS).toString(20)
var ch = " " + Array(5).join(ch) + " "
line.push(ch)
}
}
var now = performance.now();
var repeat = 100
function next() {
if (repeat --< 0) {
var dt = now - performance.now()
console.log(dt)
return cb && cb(null, dt)
}
lines.push(lines.shift())
render(rootEl, lines);
requestAnimationFrame(next)
}
next()
}
var LINES = 100
var COLS = 50
var method = /test=(\w+)|$/.exec(location.search)[1]
window.clearResults = function() {
Object.keys(localStorage).forEach(function(x) {
if (/^m_/.test(x)) delete localStorage[x]
})
showResults()
}
function showResults() {
document.getElementById("root").innerHTML = Object.keys(tests).map(function(x) {
return "<a href='?test=" + x + "'>" + x + "</a>: " + (localStorage["m_" + x] || "no results");
}).join("<br>")
+ "<br><br><a onclick='clearResults()' href='?'>clearResults</a>";
}
if (method && tests[method]) {
var update = tests[method]();
runTest(update, function(e, a) {
var all = localStorage["m_" + method];
localStorage["m_" + method] = all ? all + "," + a : a;
showResults()
})
} else {
showResults();
}
</script>
</body>
</html>

477
plugins/node_modules/ace/index.html wygenerowano vendored
Wyświetl plik

@ -1,6 +1,6 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://www.w3.org/2005/10/profile">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Ace - The High Performance Code Editor for the Web</title>
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap.no-icons.min.css" />
@ -16,18 +16,18 @@
<![endif]-->
</head>
<body>
<a href="http://github.com/ajaxorg/ace">
<a href="https://github.com/ajaxorg/ace">
<img style="z-index: 50000; position: absolute; top: 0; right: 0; border: 0; width: 125px; height: 125px" src="https://camo.githubusercontent.com/e6bef7a091f5f3138b8cd40bc3e114258dd68ddf/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub" />
</a>
<div id="wrapper">
<div class="content">
<div class="column2">
<div id="top_container" class="collapse">
<h1><img src="https://d1n0x3qji82z53.cloudfront.net/textimage.png" alt="The high performance code editor for the web." /></h1>
<div id="top_container">
<h1><img src="./doc/site/images/textimage.png" alt="The high performance code editor for the web." /></h1>
<div id="page_logo">
<img src="https://d1n0x3qji82z53.cloudfront.net/ace-logo.png" />
<iframe style="padding-top:5px" src="http://ghbtns.com/github-btn.html?user=ajaxorg&amp;repo=ace&amp;type=watch&amp;count=true" allowtransparency="true" frameborder="0" scrolling="0" width="110px" height="20px"></iframe>
<iframe src="http://ghbtns.com/github-btn.html?user=ajaxorg&amp;repo=ace&amp;type=fork&amp;count=true" allowtransparency="true" frameborder="0" scrolling="0" width="95px" height="20px"></iframe>
<img src="./doc/site/images/ace-logo.png" />
<iframe style="padding-top:5px" src="https://ghbtns.com/github-btn.html?user=ajaxorg&amp;repo=ace&amp;type=watch&amp;count=true" allowtransparency="true" frameborder="0" scrolling="0" width="110px" height="20px"></iframe>
<iframe src="https://ghbtns.com/github-btn.html?user=ajaxorg&amp;repo=ace&amp;type=fork&amp;count=true" allowtransparency="true" frameborder="0" scrolling="0" width="110px" height="20px"></iframe>
</div>
</div>
<div style="clear: both"></div>
@ -64,7 +64,7 @@
It matches the features and performance of native
editors such as Sublime, Vim and TextMate. It can be easily embedded
in any web page and JavaScript application. Ace is maintained as the
primary editor for <a href="http://c9.io">Cloud9 IDE</a>
primary editor for <a href="https://c9.io">Cloud9 IDE</a>
and is the successor of the Mozilla Skywriter (Bespin) project.
</p>
@ -86,11 +86,11 @@ console.log(addResult);
</pre>
<p id="embed_link"><a href="#nav=embedding">Learn how to embed this in your own site</a></p>
<p class="highlight_note">Looking for a more full-featured demo? Check out the
<a href="build/kitchen-sink.html" target="_blank">kitchen sink</a>.
<a href="build/kitchen-sink.html" target="_blank" rel="noreferer">kitchen sink</a>.
</p>
<h2>Features</h2>
<ul class="content-list">
<li><a href="http://pcwalton.blogspot.com/2010/11/syntax-highlighting-specification.html">Syntax highlighting</a> for over 110 languages (TextMate/Sublime Text<em>.tmlanguage</em> files can be imported)</li>
<li><a href="https://pcwalton.blogspot.com/2010/11/syntax-highlighting-specification.html">Syntax highlighting</a> for over 110 languages (TextMate/Sublime Text<em>.tmlanguage</em> files can be imported)</li>
<li>Over 20 themes (TextMate/Sublime Text <em>.tmtheme</em> files can be imported)</li>
<li>Automatic indent and outdent</li>
<li>An optional command line</li>
@ -109,7 +109,7 @@ console.log(addResult);
</ul>
<h2>Get the Open-Source Code</h2>
<p>Ace is a community project. We actively encourage and support
contributions! The Ace source code is <a href="http://github.com/ajaxorg/ace">hosted on GitHub</a>
contributions! The Ace source code is <a href="https://github.com/ajaxorg/ace">hosted on GitHub</a>
and released under the BSD license &dash;
very simple and friendly to all kinds of projects, whether open-source
or not. Take charge of your editor and add your favorite language
@ -121,14 +121,14 @@ console.log(addResult);
as two independent projects both aiming to build a no compromise
code editor component for the web. Bespin started as part of
Mozilla Labs and was based on the &lt;canvas> tag, while Ace is
the editor component of <a href="http://c9.io">Cloud9 IDE</a>
the editor component of <a href="https://c9.io">Cloud9 IDE</a>
and uses the DOM for rendering. After the release of Ace at
<a href="http://jsconf.eu/2010/speaker/kick_ass_code_editing_and_end.html">JSConf.eu 2010</a>
<a href="https://www.youtube.com/watch?v=hN_7tAKh0dM" title="[JSConfEU 2010] Fabian Jakobs: Kick ass code editing and end to end JavaScript debugging">JSConf.eu 2010</a>
in Berlin the Skywriter team decided to merge Ace with a simplified
version of Skywriter's plugin system and some of Skywriter&apos;s
extensibility points. All these changes have been merged back to Ace
now, which supersedes Skywriter. Both <a href="http://c9.io">Cloud9 IDE</a>
and <a href="http://mozilla.org">Mozilla</a> are actively developing and
now, which supersedes Skywriter. Both <a href="https://c9.io">Cloud9 IDE</a>
and <a href="https://mozilla.org">Mozilla</a> are actively developing and
maintaining Ace.
</p>
<h2>Related Projects</h2>
@ -168,7 +168,7 @@ console.log(addResult);
&lt;script>
var editor = ace.edit("editor");
editor.setTheme("ace/theme/monokai");
editor.getSession().setMode("ace/mode/javascript");
editor.session.setMode("ace/mode/javascript");
&lt;/script>
&lt;/body>
&lt;/html></pre>
@ -190,32 +190,63 @@ console.log(addResult);
<p><em>In all of these examples Ace has been invoked
as shown in the <a href="#nav=embedding">embedding guide</a>.</em>
</p>
<h2>Configuring the editor</h2>
<p>there are several ways to pass configuration to Ace</p>
<pre><code class="javascript">// pass options to ace.edit
ace.edit(element, {
mode: "ace/mode/javascript",
selectionStyle: "text"
})
// use setOptions method to set several options at once
editor.setOptions({
autoScrollEditorIntoView: true,
copyWithEmptySelection: true,
});
// use setOptions method
editor.setOption("mergeUndoDeltas", "always");
// some options are also available as methods e.g.
editor.setTheme(...)
// to get the value of the option use
editor.getOption("optionName");
</code>
</pre>
<p>See <a href="https://github.com/ajaxorg/ace/wiki/Configuring-Ace">Configuring-Ace wiki page</a> for a more detailed list of options.</p>
<h3>Changing the size of the editor</h3>
<p>Ace only checks for changes of the size of it's container when window is resized. If you resize the editor div in another manner, and need Ace to resize, use the following:</p>
<pre><code class="javascript">editor.resize()</code></pre>
<p>if you want editor to change it's size based on contents, use maxLines option as shown in <a target="_blank" rel="noreferer noopener" href="https://ace.c9.io/demo/autoresize.html">https://ace.c9.io/demo/autoresize.html</a></p>
<h2>Setting Themes</h2>
<p>Themes are loaded on demand; all you have to do is pass the string name:</p>
<pre><code class="javascript">editor.setTheme("ace/theme/twilight");</code></pre>
<p><span class="expand_arrow">&gt;</span> <a href="https://github.com/ajaxorg/ace/tree/master/lib/ace/theme" target="_blank">See all themes</a></p>
<p><span class="expand_arrow">&gt;</span> <a href="https://github.com/ajaxorg/ace/tree/master/lib/ace/theme" target="_blank" rel="noreferer noopener">See all themes</a></p>
<h2>Setting the Programming Language Mode</h2>
<p>By default, the editor supports plain text mode. All other language modes are available as separate modules, loaded on demand like this:</p>
<pre><code class="javascript">editor.getSession().setMode("ace/mode/javascript");</code></pre>
<!--h2>One Editor, Multiple Sessions</h2>
<pre><code class="javascript">editor.session.setMode("ace/mode/javascript");</code></pre>
<h2>One Editor, Multiple Sessions</h2>
<p>Ace keeps everything about the state of the editor (selection, scroll position, etc.)
in <code class="javascript">editor.session</code>. This means you can grab the
session, store it in a var, and set the editor to another session (e.g. a tabbed editor).</p>
<p>You might accomplish this like so:</p>
<pre><code class="javascript">var EditSession = require("ace/edit_session").EditSession;
var js = new EditSession("some js code");
var css = new EditSession(["some", "css", "code here"]);
// and then to load document into editor, just call
editor.setSession(js);</code></pre-->
var js = new EditSession("some js code");
var css = new EditSession(["some", "css", "code here"]);
// and then to load document into editor, just call
editor.setSession(js);</code></pre>
<h2>Common Operations</h2>
<p>Set and get content:</p>
<pre><code class="javascript">editor.setValue("the new text here"); // or session.setValue
<pre><code class="javascript">editor.setValue("the new text here");
editor.session.setValue("the new text here"); // set value and reset undo history
editor.getValue(); // or session.getValue</code></pre>
<p>Get selected text:</p>
<pre><code class="javascript">editor.session.getTextRange(editor.getSelectionRange());</code></pre>
<p>Insert at cursor:</p>
<pre><code class="javascript">editor.getSelectedText(); // or for a specific range
editor.session.getTextRange(editor.getSelectionRange()); </code></pre>
<p>Insert at cursor, emulating user input:</p>
<pre><code class="javascript">editor.insert("Something cool");</code></pre>
<p>Replace text in range:</p>
<pre><code class="javascript">editor.session.replace(new ace.Range(0, 0, 1, 1), "new text");</code></pre>
<p>Get the current cursor line and column:</p>
<pre><code class="javascript">editor.selection.getCursor();</code></pre>
<p>Go to a line:</p>
@ -223,22 +254,30 @@ editor.getValue(); // or session.getValue</code></pre>
<p>Get total number of lines:</p>
<pre><code class="javascript">editor.session.getLength();</code></pre>
<p>Set the default tab size:</p>
<pre><code class="javascript">editor.getSession().setTabSize(4);</code></pre>
<pre><code class="javascript">editor.session.setTabSize(4);</code></pre>
<p>Use soft tabs:</p>
<pre><code class="javascript">editor.getSession().setUseSoftTabs(true);</code></pre>
<pre><code class="javascript">editor.session.setUseSoftTabs(true);</code></pre>
<p>Set the font size:</p>
<pre><code class="javascript">document.getElementById('editor').style.fontSize='12px';</code></pre>
<p>Toggle word wrapping:</p>
<pre><code class="javascript">editor.getSession().setUseWrapMode(true);</code></pre>
<pre><code class="javascript">editor.session.setUseWrapMode(true);</code></pre>
<p>Set line highlighting:</p>
<pre><code class="javascript">editor.setHighlightActiveLine(false);</code></pre>
<p>Set the print margin visibility:</p>
<pre><code class="javascript">editor.setShowPrintMargin(false);</code></pre>
<p>Set the editor to read-only:</p>
<pre><code class="javascript">editor.setReadOnly(true); // false to make it editable</code></pre>
<h3>Triggering Resizes</h3>
<p>Ace only resizes itself on window events. If you resize the editor div in another manner, and need Ace to resize, use the following:</p>
<pre><code class="javascript">editor.resize()</code></pre>
<h3>Using undo manager</h3>
<p>To group undo delta of the next edit with the previous one set `mergeUndoDeltas` to true</p>
<pre><code class="language-javascript">editor.session.mergeUndoDeltas = true;
editor.session.insert({row: 0, column:0}, Date()+"");</code></pre>
<p>To start new undo group use `markUndoGroup` method</p>
<pre><code class="language-javascript">editor.insertSnippet("a$0b");
editor.session.markUndoGroup();
editor.insertSnippet("x$0y");</code></pre>
<p>To implement undo/redo buttons see <a target="_blank" rel="noreferer noopener" href="https://ace.c9.io/demo/toolbar.html">https://ace.c9.io/demo/toolbar.html</a></p>
<h3>Searching</h3>
<pre><code class="language-javascript">editor.find('needle',{
backwards: false,
@ -278,6 +317,9 @@ editor.findPrevious();</code></pre>
<li>
<code>skipCurrent</code>: Whether or not to include the current line in the search. Default to <code>false</code>.
</li>
<li>
<code>preventScroll</code>: Whether or not to move the cursor to the next match. Default to <code>false</code>.
</li>
</ul>
<p>Here's how you can perform a replace:</p>
<pre><code class="javascript">editor.find('foo');
@ -287,14 +329,14 @@ editor.replace('bar');</code></pre>
<p>(<code>editor.replaceAll</code> uses the needle set earlier by <code>editor.find('needle', ...</code>)</p>
<h3>Listening to Events</h3>
<p>To listen for an <code>onchange</code>:</p>
<pre><code class="javascript">editor.getSession().on('change', function(e) {
// e.type, etc
<pre><code class="javascript">editor.session.on('change', function(delta) {
// delta.start, delta.end, delta.lines, delta.action
});</code></pre>
<p>To listen for an <code>selection</code> change:</p>
<pre><code class="javascript">editor.getSession().selection.on('changeSelection', function(e) {
<pre><code class="javascript">editor.session.selection.on('changeSelection', function(e) {
});</code></pre>
<p>To listen for a <code>cursor</code> change:</p>
<pre><code class="javascript">editor.getSession().selection.on('changeCursor', function(e) {
<pre><code class="javascript">editor.session.selection.on('changeCursor', function(e) {
});</code></pre>
<h3>Adding New Commands and Keybindings</h3>
<p>To assign key bindings to a custom function:</p>
@ -309,9 +351,9 @@ editor.replace('bar');</code></pre>
</div>
<div class="tab-pane fade" id="higlighter">
<h1>Creating a Syntax Highlighter for Ace</h1>
<p>Creating a new syntax highlighter for Ace is extremly simple. You'll need to define two pieces of code: a new mode, and a new set of highlighting rules.</p>
<p>Creating a new syntax highlighter for Ace is extremely simple. You'll need to define two pieces of code: a new mode, and a new set of highlighting rules.</p>
<h2 id="where-to-start"><a class="heading_anchor" href="#where-to-start"><i class="headerLinkIcon"></i></a>Where to Start</h2>
<p>We recommend using the the <a href="tool/mode_creator.html">Ace Mode Creator</a> when defining your highlighter. This allows you to inspect your code's tokens, as well as providing a live preview of the syntax highlighter in action.</p>
<p>We recommend using the <a href="tool/mode_creator.html">Ace Mode Creator</a> when defining your highlighter. This allows you to inspect your code's tokens, as well as providing a live preview of the syntax highlighter in action.</p>
<h2 id="defining-a-mode"><a class="heading_anchor" href="#defining-a-mode"><i class="headerLinkIcon"></i></a>Defining a Mode</h2>
<p>Every language needs a mode. A mode contains the paths to a language's syntax highlighting rules, indentation rules, and code folding rules. Without defining a mode, Ace won't know anything about the finer aspects of your language.</p>
<p>Here is the starter template we'll use to create a new mode:</p>
@ -389,9 +431,9 @@ var MyNewHighlightRules = function() {
this.$rules = {
"start" : [
{
token: &lt;token&gt;, // String, Array, or Function: the CSS token to apply
regex: &lt;regex&gt;, // String or RegExp: the regexp to match
next: &lt;next&gt; // [Optional] String: next state to enter
token: token, // String, Array, or Function: the CSS token to apply
regex: regex, // String or RegExp: the regexp to match
next: next // [Optional] String: next state to enter
}
]
};
@ -472,7 +514,7 @@ var fonts = lang.arrayToMap(
token : "text",
regex : "&lt;\\!\\[CDATA\\[",
next : "cdata"
},
} ],
"cdata" : [ {
token : "text",
@ -482,7 +524,7 @@ var fonts = lang.arrayToMap(
defaultToken : "text"
} ]
};</code></pre>
<p>In this extremly short sample, we're defining some highlighting rules for when Ace detectes a <code>&lt;![CDATA</code> tag. When one is encountered, the tokenizer moves from <code>start</code> into the <code>cdata</code> state. It remains there, applying the <code>text</code> token to any string it encounters. Finally, when it hits a closing <code>]&gt;</code> symbol, it returns to the <code>start</code> state and continues to tokenize anything else.</p>
<p>In this extremely short sample, we're defining some highlighting rules for when Ace detects a <code>&lt;![CDATA</code> tag. When one is encountered, the tokenizer moves from <code>start</code> into the <code>cdata</code> state. It remains there, applying the <code>text</code> token to any string it encounters. Finally, when it hits a closing <code>]&gt;</code> symbol, it returns to the <code>start</code> state and continues to tokenize anything else.</p>
<h2>Using the TMLanguage Tool</h2>
<p>There is a tool that
will take an existing <em>tmlanguage</em> file and do its best to convert it into Javascript for Ace to consume. Here's what you need to get started:
@ -652,7 +694,7 @@ if (match) {
</p>
<p>After this running <code><span style="color:#008800">highlight_rules_test.js</span> <span style="color:#000088">optionalLanguageName</span></code> will compare output of your tokenizer with the correct output you've created.
</p>
<p>Any files ending with the <em>_test.js</em> suffix are automatically run by Ace&#39;s <a href="http://travis-ci.org/#!/ajaxorg/ace">Travis CI</a> server.</p>
<p>Any files ending with the <em>_test.js</em> suffix are automatically run by Ace&#39;s <a href="https://travis-ci.org/#!/ajaxorg/ace">Travis CI</a> server.</p>
</div>
<div class="tab-pane fade" id="api">
<div class="row centerpiece">
@ -716,7 +758,7 @@ if (match) {
information on how to work with Ace, check out the <a href="#nav=embedding">embedding guide</a>.
</p>
<p>Below is an ERD diagram describing some fundamentals about how the internals of Ace works:</p>
<img src="doc/template/resources/images/Ace_ERD.png" style="max-width:100%; max-height:100%" />
<img lazy-src="doc/template/resources/images/Ace_ERD.png" style="max-width:100%; max-height:100%" />
</div>
</div>
</div>
@ -725,159 +767,136 @@ if (match) {
<h1>Projects Using Ace</h1>
<p>Ace is used all over the web in all kinds of production applications. Here is
just a small sampling:</p>
<ul class="menu-list">
<ul class="menu-list" style="overflow: hidden;">
<li>
<img src="doc/site/images/github-logo.png"
style="left: -15px; top: -9px;" />
<a href="https://github.com/blog/905-edit-like-an-ace">GitHub</a>
<div style="height: 100%;background: url(https://a0.awsstatic.com/main/images/logos/aws_smile-header-desktop-en-white_59x35@2x.png) no-repeat 0 7px/100px;"></div>
<a href="https://aws.amazon.com/">AWS</a>
</li>
<li>
<img src="doc/site/images/khan-logo.png"
<img lazy-src="doc/site/images/khan-logo.png"
style="left: -10px; top: -27px; width: 120px" />
<a href="http://ejohn.org/blog/introducing-khan-cs/">Khan Academy</a>
</li>
<li>
<img src="doc/site/images/cloud9-logo.png"
<img lazy-src="doc/site/images/cloud9-logo.png"
style="left: -11px;top:-12px; width:122px" />
<a href="https://github.com/ajaxorg/cloud9">Cloud9 IDE</a>
</li>
<li>
<img src="doc/site/images/firefox-logo.png"
style="left:10px;top:-5px;width:80px" />
<a href="https://builder.addons.mozilla.org/">Firefox Add-on Builder</a>
</li>
<li>
<img src="doc/site/images/codecademy-logo.png"
<img lazy-src="doc/site/images/codecademy-logo.png"
style="left: -5px; top: 10px;" />
<a href="http://www.codecademy.com/">Codecademy</a>
</li>
<li>
<img src="doc/site/images/rstudio_logo_64.png"
<img lazy-src="doc/site/images/rstudio_logo_64.png"
style="left: 19px; top: 2px;" />
<a href="http://rstudio.org/">RStudio</a>
</li>
<li>
<img src="http://zedapp.s3.amazonaws.com/uploads/2014/02/zed-small.png" style="left: -1px;top: -20px;width: 103px;">
<img lazy-src="https://zedapp.s3.amazonaws.com/uploads/2014/02/zed-small.png" style="left: -1px;top: -20px;width: 103px;">
<a href="http://zedapp.org">Zed</a>
</li>
<li>
<img src="https://raw.githubusercontent.com/creationix/tedit/gh-pages/icons/icon-128.png"
<img lazy-src="https://raw.githubusercontent.com/creationix/tedit/gh-pages/icons/icon-128.png"
style="width: 104px; left: -1px; top: -17px;">
<a href="https://github.com/creationix/tedit">Tedit</a>
</li>
<li>
<img src="http://upload.wikimedia.org/wikipedia/commons/6/63/Wikipedia-logo.png" style="left: -5px; top: -35px; width: 110px;">
<img lazy-src="https://upload.wikimedia.org/wikipedia/commons/6/63/Wikipedia-logo.png" style="left: -5px; top: -35px; width: 110px;">
<a href="https://en.wikipedia.org/wiki/Special:Version" style="font-family: 'Linux Libertine','Hoefler Text',Georgia,'Times New Roman',Times,serif;">W<span style="font-variant: small-caps;">ikipedi</span>A</a>
</li>
<li>
<img src="doc/site/images/codiad.png"
<img lazy-src="doc/site/images/codiad.png"
style="left: 10px; top: -4px; width:80px" />
<a href="http://codiad.com/">Codiad</a>
</li>
<li>
<img src="doc/site/images/zorba-logo.png"
style="left: -5px; top: 16px;
padding: 6px 4px 6px 6px; width: 100px" />
<a href="http://try.zorba.io/queries/xquery">Zorba XQuery</a>
</li>
<li>
<img src="doc/site/images/plunker.png"
<img lazy-src="doc/site/images/plunker.png"
style="left: 13px; top: -4px; width: 75px" />
<a href="http://plnkr.co/edit/">Plunker</a>
</li>
<li>
<img src="https://raw.githubusercontent.com/dart-lang/chromedeveditor/master/ide/web/images/icon_128.png"
style="left: 0px;top: -15px;width: 100px;" />
<a href="https://github.com/dart-lang/chromedeveditor">Chrome Dev Editor</a>
</li>
<img lazy-src="doc/site/images/shiftedit-logo.png"
style="left: -10px; top: -20px; width: 120px" />
<a href="http://shiftedit.net/">ShiftEdit</a>
</li>
<li>
<img src="doc/site/images/sassmeister-logo.png"
<img lazy-src="doc/site/images/sassmeister-logo.png"
style="left: 10px;top: -5px;width: 80px;" />
<a href="http://sassmeister.com/">SassMeister</a>
</li>
<li>
<img src="doc/site/images/sx-logo.png"
<img lazy-src="doc/site/images/sx-logo.png"
style="left: -11px; top: -12px;">
<a href="http://www.scroipe.com">Scroipe</a>
</li>
<li>
<img src="doc/site/images/ideone-logo.png"
<img lazy-src="doc/site/images/ideone-logo.png"
style="left: -5px; top: 20px;">
<a href="http://ideone.com">Ideone.com</a>
</li>
<li>
<div style="
background: url(http://lively-web.org/core/media/lively-web-logo.png) no-repeat;
background: url(https://lively-web.org/core/media/lively-web-logo.png) no-repeat;
position: absolute; left: -5px; height: 71px; width: 103px; background-size: 390px;
background-position: 19px;"></div>
<a href="http://lively-web.org">Lively Web</a>
</li>
<li>
<img src="doc/site/images/modx-logo-4.png"
<img lazy-src="doc/site/images/modx-logo-4.png"
style="left: 18px; top: 6px;">
<a href="http://modx.com/extras/package/ace">MODX</a>
</li>
<li>
<img src="doc/site/images/shiftedit-logo.png"
style="left: -10px; top: -20px; width: 120px" />
<a href="http://shiftedit.net/">ShiftEdit</a>
</li>
<img lazy-src="https://raw.githubusercontent.com/dart-lang/chromedeveditor/master/ide/web/images/icon_128.png"
style="left: 0px;top: -15px;width: 100px;" />
<a href="https://github.com/dart-lang/chromedeveditor">Chrome Dev Editor</a>
</li>
<li>
<div class="rotating-logo" style="background:url(doc/site/images/habitat-logo.svg) center no-repeat;
left: 19px; top: 6px;width: 60px;height: 60px;background-size: 60px;position: relative;"></div>
<a href="http://habitat.inkling.com">Inkling Habitat</a>
</li>
<li style="width: 248px;">
<img src="http://codecombat.com/images/pages/base/logo.png" style="left: 0px; top: 1px; width: 248px">
<img lazy-src="https://codecombat.com/images/pages/base/logo.png" style="left: 0px; top: 1px; width: 248px">
<a href="http://codecombat.com">Code Combat</a>
</li>
<!--seems to be down <li>
<img src="doc/site/images/lws-logo.png"
<img lazy-src="doc/site/images/lws-logo.png"
style="left: 0px; top: 0px; width: 100px" />
<a href="http://liveworkspace.org">Live Workspace</a>
</li>-->
<li>
<img src="doc/site/images/repl.it-logo.png"
<img lazy-src="doc/site/images/repl.it-logo.png"
style="left: 0px; top: 17px; width: 100px" />
<a href="http://repl.it/">Repl.it</a>
</li>
<li>
<img src="doc/site/images/stypi-logo.png"
style="left: 9px; top: -5px; width: 84px" />
<a href="https://code.stypi.com/">Stypi</a>
<img lazy-src="https://www.codingame.com/blog/wp-content/uploads/2016/11/logo_codingame_hud.png"
style="left: -15px;top: 27px;width: 127px;background: black;" />
<a href="https://www.codingame.com">CodinGame</a>
</li>
<li>
<img src="doc/site/images/weecod-logo.png"
style="left: 0px; top: 0px; width: 100px" />
<a href="http://www.weecod.com">Weecod</a>
</li>
<li>
<img src="doc/site/images/processwire-logo.svg"
<img lazy-src="doc/site/images/processwire-logo.svg"
style="left: 0px; top: 25px; width: 102px" />
<a href=" http://modules.processwire.com/modules/inputfield-ace-editor/">Process<i>Wire</i></a>
</li>
<li>
<img src="doc/site/images/crunchapp-logo.png"
<img lazy-src="https://getcrunch.co/wp-content/uploads/2015/07/crunch-icon_32.png"
style="left: 9px; top: -5px; width: 84px" />
<a href="http://crunchapp.net/">Crunch</a>
<a href="http://getcrunch.co/">Crunch</a>
</li>
<li>
<img src="https://googledrive.com/host/0B3cR-oSmQsB5aUhWQ2N4RDNmYzA/h/img/icon-128.png"
<img lazy-src="https://drivenotepad.github.io/images/icon-128.png"
style="left: 9px; top: -5px; width: 84px">
<a href="https://drivenotepad.appspot.com/support">Drive Notepad</a>
</li>
<li>
<img src="http://textor.houfeng.net/images/textor.png"
style="position: relative; left: 13px; top: -3px; width: 75px" />
<div class="text-logo">textor</div>
<a href="http://textor.houfeng.net/">Textor</a>
</li>
<li>
<img src="http://phpassist.com/images/logo-large.png"
style="left: 3px; top: -10px; width: 95px">
<a href="http://phpassist.com/f8456">PHP Assist</a>
</li>
<li>
<div class="text-logo">Dillinger</div>
<a href="http://dillinger.io/">Dillinger</a>
@ -887,10 +906,7 @@ if (match) {
<a href="http://www.evaluzio.net/editor">Evaluzio</a>
</li>
<li>
<div style="
background: url(http://www.gamedevhelper.com/images/header/logo.png) no-repeat;
position: absolute; height: 65px; width: 87px; background-size: 320px;
background-position: 19px;"></div>
<div class="text-logo" style="margin-left: -14px;">CodeHelper</div>
<a href="http://www.gamedevhelper.com/">CodeHelper</a>
</li>
<li>
@ -898,8 +914,7 @@ if (match) {
<a href="http://www.edicy.com/blog/new-code-editor-for-creating-unique-website-designs">Edicy</a>
</li>
<li>
<img src="http://www.pixeljet.net/images/logo.png"
style="width: 108px; top: 20px; left: -3px;">
<div class="text-logo">pixelJET</div>
<a href="http://www.pixeljet.net/index.html">pixelJET</a>
</li>
<li>
@ -907,8 +922,8 @@ if (match) {
<a href="http://orbit.bonsaijs.org/">BonsaiJS playground</a>
</li>
<li>
<img src="http://approximatrix.com/products/simplytext/logo-320x320.png"
style="width: 106px; left: -4px; top: -22px;">
<img lazy-src="https://approximatrix.com/static/images/simplytext/logo-long-white.png"
style="width: 106px; left: -4px; top: 26px;">
<a href="http://approximatrix.com/products/simplytext">Simply Text</a>
</li>
<li>
@ -916,13 +931,7 @@ if (match) {
<a href="https://www.sharelatex.com">ShareLaTeX</a>
</li>
<li>
<img src="http://pagesofinterest.net/images/products/code-complete-140.png"
style="left: -6px; width: 113px;top: -37px;">
<a href="http://pagesofinterest.net/shop/code-complete">Code Complete</a>
</li>
<li>
<img src="http://pagesofinterest.net/images/projects/aceview.png"
style="left: 2px; width: 96px;top: -8px;">
<div class="text-logo" style="font-size: 18px;">ACEView</div>
<a href="https://github.com/faceleg/ACEView">ACEView</a>
</li>
<li>
@ -930,7 +939,7 @@ if (match) {
<a href="http://www.boottheme.com/">BootTheme</a>
</li>
<li>
<img src="http://codebender.cc/images/codebender-transparent.png"
<img lazy-src="https://codebender.cc/images/codebender-transparent.png"
style="left: -9px; width: 117px;top: -22px;">
<a href="http://codebender.cc/">Codebender</a>
</li>
@ -946,12 +955,12 @@ if (match) {
<a href="http://slimtext.org/">Slim Text</a>
</li>
<li>
<img src="https://www.decor-tab-creator.com/_files/decor_logo_white_new.png"
<img lazy-src="https://www.decor-tab-creator.com/_files/decor_logo_white_new.png"
style="left: -5px; width: 111px;top: 20px;">
<a href="https://www.decor-tab-creator.com">Decor</a>
</li>
<li>
<img src="http://papeeria.com/assets/all/images/papeeria_small.png" style="width: 95px; left: 2px; top: 8px;">
<img lazy-src="https://papeeria.com/assets/all/images/papeeria_small.png" style="width: 95px; left: 2px; top: 8px;">
<a href="http://papeeria.com">Papeeria</a>
</li>
<li>
@ -962,12 +971,12 @@ if (match) {
<a href="https://chocolatejs.org">Chocolatejs</a>
</li>
<li>
<img src="doc/site/images/ac-logo.png"
<img lazy-src="doc/site/images/ac-logo.png"
style="left: 4px; top: 25px;" />
<a href="http://www.applicationcraft.com/">Application Craft</a>
</li>
<li>
<img src="http://playir.com/common/icon_playir.png"
<img lazy-src="https://playir.com/common/icon_playir.png"
style="left: 11px; width: 96px;top: -17px;">
<a href="http://playir.com">Playir</a>
</li>
@ -976,7 +985,7 @@ if (match) {
<a href="http://runnable.com">Runnable</a>
</li>
<li>
<img src="http://joshnuss.github.io/mruby-web-irb/images/favicon.png"
<img lazy-src="https://joshnuss.github.io/mruby-web-irb/images/favicon.png"
style="left: 4px; width: 90px;top: -17px;">
<a href="http://joshnuss.github.io/mruby-web-irb/">Mruby-web-irb</a>
</li>
@ -988,51 +997,26 @@ if (match) {
<div class="text-logo" style="margin-left:0px;">Jetstrap</div>
<a href="http://jetstrap.com/">Jetstrap</a>
</li>
<li title="Remote pair programming">
<div class="text-logo" style="margin-left:0px;">MadEye</div>
<a href="http://madeye.io/">MadEye</a>
</li>
<li>
<div class="text-logo" style="text-shadow:none">Online Judge</div>
<a href="http://www.realoj.com">RealOJ</a>
</li>
<li title="WebRTC based video chat + code editor">
<div class="text-logo" style="font-size: 18px;">(codassium);</div>
<a href="http://codassium.com/">(codassium);</a>
</li>
<li>
<div style="
background: url(http://www.compileonline.com/images/col.png) no-repeat;
position: absolute; left: 23px; height: 68px; width: 62px; background-size: 444px;
background-position: -283px;"></div>
<a href="http://compileonline.com">compileonline</a>
</li>
<li>
<img src="http://www.stickygit.com/img/logo1.png"
style="width: 64px; left: 18px; top: 5px;">
<a href="http://www.stickygit.com/">StickyGit</a>
</li>
<li>
<img src="http://iknode.com/iknode_symbol.png"
style="width: 96px; left: 2px; top: -21px;">
<a href="http://iknode.com/">iKnode</a>
<div style="font-size:50px" class="text-logo">t<span style="color:green">p<span></div>
<a href="https://www.tutorialspoint.com/online_html_editor.php">tutorialspoint</a>
</li>
<li title="Online conference and code review tool">
<div style="width: 90px; left: 10px; top: 0px;background:rgb(24,73,92);color: white;position: absolute;
font-size: 68px;text-align: center;font-weight: bold;font-family: inherit;line-height: normal;">sT</div>
<a href="http://sourcetalk.net/">SourceTalk</a>
</li>
<li title="Php framework">
<div class="text-logo" style="margin-left:-12px;">Andromeda</div>
<a href="http://www.andromeda-project.org/index.php">Andromeda</a>
</li>
<li>
<img src="https://raw.github.com/Gisto/Gisto/master/app/icon.png"
<img lazy-src="https://raw.github.com/Gisto/Gisto/master/app/icon.png"
style="width: 96px; left: 2px; top: -21px;">
<a href="http://www.gistoapp.com/">Gisto</a>
</li>
<li>
<img src="http://jdoodle.com/static/images/jdoodle.png"
<img lazy-src="https://jdoodle.com/static/images/jdoodle.png"
style="width: 122px; left: -3px; top: -12px;">
<a href="http://jdoodle.com/">JDoodle</a>
</li>
@ -1041,34 +1025,16 @@ if (match) {
<a href="https://github.com/websiteduck/Run-PHP-Code">RunPHPCode</a>
</li>
<li>
<div class="text-logo">InstaEDU</div>
<a href="http://instaedu.com/lesson-demo/">InstaEDU</a>
</li>
<li>
<img src="http://s7.postimg.org/tbw9lfcvb/cloudcmd.png"
<img lazy-src="https://s7.postimg.org/tbw9lfcvb/cloudcmd.png"
style="width: 74px; left: 13px; top: -2px;">
<a href="http://cloudcmd.io">Cloud Commander</a>
</li>
<li>
<img src="http://www.ogeditor.com/images/logo.png"
style="width: 105px; left: -2px; top: 27px;">
<a href="http://www.ogeditor.com/index.aspx">ogEditor</a>
</li>
<li>
<div class="text-logo">allong.es</div>
<a href="http://allong.es/try/">Try allong.es</a>
</li>
<li>
<div class="text-logo">NapCat</div>
<a href="http://napcatapp.tumblr.com/post/60598006734/version-1-3-is-released">NapCat</a>
</li>
<li>
<div class="text-logo">CorsLit</div>
<a href="http://www.corslit.com/new/melloWorld">CorsLit</a>
</li>
<li>
<img src="http://ojjs.org/media/oj_logo_big.png"
style="width: 74px; left: 13px; top: 8px;background: white;box-shadow: 0 0 2px 6px white;">
<div style="color:orange;font-size:50px" class="text-logo">OJ</div>
<a href="http://ojjs.org/index.html">OJjs</a>
</li>
<li>
@ -1076,38 +1042,34 @@ if (match) {
<a href="http://codechat.net/">Codechat</a>
</li>
<li>
<img src="doc/site/images/wolf_3d_logo_trans.png"
<img lazy-src="doc/site/images/wolf_3d_logo_trans.png"
style="left: 10px; top: -4px; width:80px" />
<a href="http://www.wolfcms.org/repository/133">Wolf CMS</a>
</li>
<li>
<img src="http://thlorenz.github.io/scriptie-talkie/images/code.png" style="left: 20px; top: 20px; width: 60px;">
<a href="http://thlorenz.github.io/scriptie-talkie/">Scriptie-Talkie</a>
<div style="color:green;font-size:50px" class="text-logo">&lt;/&gt;</div>
<a href="https://thlorenz.github.io/scriptie-talkie/">Scriptie-Talkie</a>
</li>
<li>
<div class="text-logo">md</div>
<a href="http://thlorenz.github.io/browserify-markdown-editor/">browserify-markdown-editor</a>
<a href="https://thlorenz.github.io/browserify-markdown-editor/">browserify-markdown-editor</a>
</li>
<li>
<img src="http://www.siteleaf.com/images/logo.svg" style="left: 20px; top: -15px; width: 60px;">
<a href="http://www.siteleaf.com/">Siteleaf</a>
<!-- <img src="https://www.siteleaf.com/images/logo.svg" style="left: 20px; top: -15px; width: 60px;"> -->
<a href="https://www.siteleaf.com/">Siteleaf</a>
</li>
<li>
<div class="" style="
background: url(http://colorsublime.com/img/ColorSublime_logo.png);
background: url(https://colorsublime.github.io/assets/img/ColorSublime_logo.png);
position: absolute;height: 65px;width: 99px;
background-size: 310px 128px;background-position: 210px top;
"></div>
<a href="http://colorsublime.com/">ColorSublime</a>
<a href="https://colorsublime.github.io/">ColorSublime</a>
</li>
<li>
<div class="text-logo">iMDone</div>
<a href="http://piascikj.github.io/imdone/">iMDone</a>
</li>
<li>
<div class="text-logo"></div>
<a href="http://bakemycss.mypathforpython.appspot.com/">BakeMyCss</a>
</li>
<li>
<div style="
background: url(https://s3.amazonaws.com/spark-website/spark.png) no-repeat;
@ -1116,20 +1078,15 @@ if (match) {
<a href="http://spark.io/build">Spark Core</a>
</li>
<li>
<img src="https://2.gravatar.com/avatar/021e207e86fe81a7d81c67ef1ff38a0c" style="left: 11px; top: -5px;">
<img lazy-src="https://2.gravatar.com/avatar/021e207e86fe81a7d81c67ef1ff38a0c" style="left: 11px; top: -5px;">
<a href="http://owncloud.org">ownCloud</a>
</li>
<li>
<img src="http://www.ezoui.com/prod/images/EZo_logo.png" style="left: 11px; top: -5px;">
<!-- <img src="https://www.ezoui.com/prod/images/EZo_logo.png" style="left: 11px; top: -5px;"> -->
<a href="http://jqmdesigner.appspot.com">JQM Designer</a>
</li>
<li>
<img src="http://www.praczone.info/images/praczone.png" style="top: 20px;width: 100px;">
<a href=" http://www.praczone.com/editor">pracZone</a>
</li>
<li>
<img src="http://resources.qooxdoo.org/images/logo.gif"
style="width: 125px; left: -13px; top: 18px;">
<div class="text-logo">qooxdoo</div>
<a href="http://demo.qooxdoo.org/devel/playground/#">Qooxdoo playground</a>
</li>
<li>
@ -1137,9 +1094,9 @@ if (match) {
<a href="http://sharejs.org/hello-ace.html">ShareJS</a>
</li>
<li>
<img src="https://neutron-drive.appspot.com/static/img/neutron_face_high.png"
<img lazy-src="https://neutron-drive.appspot.com/static/img/neutron_face_high.png"
style="width: 86px; left: 7px; top: -11px;">
<a href="http://neutronide.com/">Neutron IDE</a>
<a href="https://super.neutrondrive.com/">Neutron IDE</a>
</li>
<li>
<div style="
@ -1149,135 +1106,100 @@ if (match) {
<a href="http://www.pythonanywhere.com/">PythonAnywhere</a>
</li>
<li>
<img src="http://subtexteditor.com/images/subtext-icon-4.png"
style="width: 86px; left: 7px; top: -11px;">
<a href="http://subtexteditor.com/">Subtext Editor</a>
</li>
<li>
<img src="http://climbi.com/static/img/logo.png"
style="width: 86px; left: 7px; top: -11px;">
<a href="http://climbi.com/">Climbi</a>
</li>
<li>
<div style="
background: url(http://gpupowered.org/sites/default/files/favicon.png) rgba(0, 0, 0, 0.66) no-repeat;
position: absolute;
height: 75px;
width: 99px; background-size: 27px 32px;
background-position: 37px;"></div>
<a href="http://www.gpupowered.org/sand2/launch2/#">GPUPowered</a>
</li>
<li style="width: 248px;">
<img src="http://www.codeavengers.com/image/RedLogoSmall.png" style="width: 248px; top: 30px;">
<a href="http://www.codeavengers.com/image/RedLogoSmall.png">Code Avengers</a>
</li>
<li style="width: 248px;">
<img src="http://playcodemonkey.com/images/logoSmallFaceTopTrans.png" style="width: 238px; top: -2px; left: 5px">
<a href="http://www.codemonkey.co.il/">CodeMonkey</a>
</li>
<li style="width: 248px;">
<img src="http://learn-angular.org/Content/Images/LearnAngular-small.png" style="width: 275px; left: -12px; top: 7px;">
<a href="http://learn-angular.org">Learn Angular</a>
</li>
<li>
<a href="http://www.divshot.com/">Divshot</a>
</li>
<li>
<img src="http://asciidocfx.com/images/logo.png" style="width: 75px; left: 12px; top: 0px;">
<!-- <img src="https://asciidocfx.com/images/logo.png" style="width: 75px; left: 12px; top: 0px;"> -->
<a href="http://asciidocfx.com/">Asciidoc FX</a>
</li>
<li>
<img src="http://devunity.com/public/images/logo.png" style="width: 125px; left: -12px; top: 15px;">
<img lazy-src="https://octobercms.com/themes/website/assets/images/october.png" style="width: 95px; left: 2px; top: -17px;">
<a href="http://octobercms.com">October CMS</a>
</li>
<li style="width: 248px;">
<img lazy-src="https://www.codeavengers.com/image/RedLogoSmall.png" style="width: 248px; top: 30px;">
<a href="http://www.codeavengers.com/image/RedLogoSmall.png">Code Avengers</a>
</li>
<li>
<div style="font-size:23px" class="text-logo">{dev<span style="color:#ef4423">un</span>ity}</div>
<a href="http://devunity.com/">Devunity</a>
</li>
<li>
<img src="http://funprogramming.org/i/fun_programming_logo_for_ace.png" style="width: 75px; left: 12px; top: -5px;">
<a href="http://funprogramming.org">Fun Programming</a>
<li style="width: 248px;">
<img lazy-src="https://d2j5eocv5gptnv.cloudfront.net/assets/non_game_misc/site_header_logo.png?v=2" style="width: 238px; top: 15px; left: 5px">
<a href="http://www.codemonkey.co.il/">CodeMonkey</a>
</li>
<li>
<img src="http://lh4.ggpht.com/hG5bDu1GBXwxpPnrgPcAmTNQyZK4ICBDC9aeLNmMZahEYQOz_2vYT6sBqLNGLIGPopWjdveEvPuM9NBuErUSLQ=s60" style="width: 75px; left: 12px; top: -5px;">
<img lazy-src="https://funprogramming.org/i/fun_programming_logo_for_ace.png" style="width: 75px; left: 12px; top: -5px;">
<a href="http://funprogramming.org">Fun Programming</a>
</li>
</li>
<li>
<!-- <img src="https://learn-angular.org/Content/Images/LearnAngular-small.png" style="width: 275px; left: -12px; top: 7px;"> -->
<a href="http://learn-angular.org">Learn Angular</a>
</li>
<li>
<img lazy-src="https://lh4.ggpht.com/hG5bDu1GBXwxpPnrgPcAmTNQyZK4ICBDC9aeLNmMZahEYQOz_2vYT6sBqLNGLIGPopWjdveEvPuM9NBuErUSLQ=s60" style="width: 75px; left: 12px; top: -5px;">
<a href="http://bootzee.com">Bootzee</a>
</li>
<li>
<img src="https://dbgr.cc/images/logo.png" style="width: 85px; left: 8px; top: 5px;">
<a href="https://dbgr.cc">dbgr</a>
</li>
<li>
<img src=" http://www.branchcms.com/layout/images/branch-brand-logo-2.png" style="width: 125px; left: -12px; top: 15px;">
<img lazy-src="https://www.branchcms.com/layout/images/branch-brand-logo-2.png" style="width: 125px; left: -12px; top: 15px;">
<a href="http://www.branchcms.com/blog/post/new-code-editor-ace">Branch CMS</a>
</li>
<li>
<img src="https://neocities.org/assets/img/cat.png" style="width: 95px; left: 2px; top: 0px;">
<!-- <img src="https://neocities.org/assets/img/cat.png" style="width: 95px; left: 2px; top: 0px;"> -->
<a href="https://neocities.org">Neocities</a>
</li>
<li>
<img src="http://octobercms.com/themes/website/assets/images/october.png" style="width: 95px; left: 2px; top: -17px;">
<a href="http://octobercms.com">October CMS</a>
</li>
<li>
<img src="http://webftp.selfbuild.fr/images/logo/logo_128.png" style="width: 95px; left: 2px; top: -17px;">
<!-- <img src="https://webftp.selfbuild.fr/images/logo/logo_128.png" style="width: 95px; left: 2px; top: -17px;"> -->
<a href="http://webftp.selfbuild.fr">SelfBuild </a>
</li>
<li>
<img src="http://fnboard.herokuapp.com/logo.png"
<img src="https://fnboard.herokuapp.com/logo.png"
style="left: 5px; width: 90px;top: 0px;">
<a href="http://fnboard.herokuapp.com/">Pixeladded</a>
</li>
<li>
<img src="http://www.aldryn.com/static/img/logo-main-print.png" style="width: 125px; left: -12px; top: 18px;">
<!-- <img src="https://www.aldryn.com/static/img/logo-main-print.png" style="width: 125px; left: -12px; top: 18px;"> -->
<a href="http://www.aldryn.com">Aldryn</a>
</li>
<li>
<img src="http://sbp.selfbuild.fr/sbp.png" style="width: 95px; left: 2px; top: -8px;">
<!-- <img src="https://sbp.selfbuild.fr/sbp.png" style="width: 95px; left: 2px; top: -8px;"> -->
<a href="http://sbp.selfbuild.fr/">SBP</a>
</li>
<li>
<img src="https://mycodestock.com/mycodestock.png" style="width: 126px; left: -18px; top: -30px;">
<a href="https://mycodestock.com/">SBP</a>
<img lazy-src="https://mycodestock.com/assets/img/mycodestock.png?v=2.1.0" style="width: 126px; left: -18px; top: -30px;">
<a href="https://mycodestock.com/">my code stock</a>
</li>
<li>
<img src="http://eseecode.com/web/sites/eseecode.com/files/favicon.png" style="width: 100px; left: 0px; top: -20px;">
<!-- <img src="https://eseecode.com/web/sites/eseecode.com/files/favicon.png" style="width: 100px; left: 0px; top: -20px;"> -->
<a href="http://eseecode.com/">eSeeCode</a>
</li>
<li>
<img src="https://codinghire.com/static/img/twitter.png" style="width: 80px; left: 10px; top: -3px;">
<img lazy-src="https://codinghire.com/static/img/twitter.png" style="width: 80px; left: 10px; top: -3px;">
<a href="https://codinghire.com/">Coding Hire</a>
</li>
<li>
<div style="
background: url(https://apiary.a.ssl.fastly.net/assets/images/website/logotype-apiary-cb8fa3918bdf3961.png) no-repeat;
position: absolute; height: 65px; width: 87px; background-size: 200px;
background-position: 19px;"></div>
<div style=""></div>
<a href="http://apiary.io/">Apiary</a>
</li>
<li>
<img src="http://exist-db.org/exist/apps/eXide/resources/images/logo.png" style="width: 120px; left: -10px; top: 15px;">
<!-- <img src="https://exist-db.org/exist/apps/eXide/resources/images/logo.png" style="width: 120px; left: -10px; top: 15px;"> -->
<a href="http://exist-db.org">ExistDB</a>
</li>
<li>
<img src="https://jscalc.io/img/icons/jscalc_full_bleed_24.svg" style="width: 90px; left: 5px; top: -10px;">
<img lazy-src="https://jscalc.io/img/icons/jscalc_full_bleed_24.svg" style="width: 90px; left: 5px; top: -10px;">
<a href="https://jscalc.io/">JSCalc</a>
</li>
<li>
<img src="http://tworld-ai.com/imgs/web-app/rob_face.png" style="width: 90px; left: 5px; top: -10px;">
<!-- <img src="https://tworld-ai.com/imgs/web-app/rob_face.png" style="width: 90px; left: 5px; top: -10px;"> -->
<a href="http://tworld-ai.com/imgs/web-app/rob_face.png">T-World</a>
</li>
<li>
<img src="https://www.gestixi.com/assets/img/icons/gestixi-64.png" style="width: 90px; left: 5px; top: 20px;">
<img lazy-src="https://www.gestixi.com/assets/img/icons/gestixi-64.png" style="width: 90px; left: 5px; top: 20px;">
<a href="https://www.gestixi.com/">GestiXi</a>
</li>
<li>
<div class="text-logo">Clicpilot</div>
<a href="http://www.clicpilot.com/">clicpilot</a>
</li>
<li>
<div class="text-logo" style="font-size:22px;text-shadow:none;margin-top:13px">Code-Fight.Club</div>
<a href="http://code-fight.club">Code-Fight.Club</a>
</li>
<li>
<a href="https://cloud.formcycle.de/formcycle/fd2/">Formcycle</a>
</li>
<li>
<a href="http://www.wavemaker.com/">WaveMaker</a>
</li>
@ -1287,12 +1209,6 @@ if (match) {
<li>
<a href="http://ext.radiantcms.org/extensions/264-ace">Radiant CMS</a>
</li>
<li>
<a href="http://developercompanion.com/">Developer Companion</a>
</li>
<li>
<a href="http://www.akshell.com/">Akshell</a>
</li>
<li>
<div class="text-logo">Semantic Ui</div>
@ -1306,15 +1222,12 @@ if (match) {
<div class="text-logo">Git-Edit</div>
<a href="https://github.com/krispo/git-edit">Git-Edit</a>
</li>
<li>
<a href="http://dev.cmsmadesimple.org/projects/aceeditor">CMS Made Simple</a>
</li>
<li>
<a href="http://tryjasmine.com/">Try Jasmine</a>
</li>
<li>
<a href="http://codebender.cc/">Codebender</a>
</li>
<li>
<a href="http://beautifytools.com/">BeautifyTools</a>
</li>
<li id="add_your_site">
<p>+</p>
<a href="mailto:ace@c9.io?subject=Put%20me%20on%20the%20Ace%20site!&body=Please include a link to a logo hosted on your site!">Your Site Here</a>

251
plugins/node_modules/ace/kitchen-sink.html wygenerowano vendored
Wyświetl plik

@ -12,254 +12,35 @@
-->
<link rel="stylesheet" href="demo/kitchen-sink/styles.css" type="text/css" media="screen" charset="utf-8">
<!--PACKAGE
<script async="true" src="https://use.edgefonts.net/source-code-pro.js"></script>
PACKAGE-->
<link href="./doc/site/images/favicon.ico" rel="icon" type="image/x-icon">
</head>
<body>
<div id="optionsPanel" style="position:absolute;height:100%;width:260px">
<a href="http://c9.io" title="Cloud9 IDE | Your code anywhere, anytime">
<div style="position:absolute;height:100%;width:260px">
<a href="https://c9.io" title="Cloud9 IDE | Your code anywhere, anytime">
<img id="c9-logo" src="demo/kitchen-sink/logo.png" style="width: 172px;margin: -9px 30px -12px 51px;">
</a>
<div style="position: absolute; overflow: hidden; top:100px; bottom:0">
<div style="width: 120%; height:100%; overflow-y: scroll">
<div id="optionsPanel" style="width: 120%; height:100%; overflow-y: scroll">
<table id="controls">
<tr>
<td>
<label for="doc">Document</label>
</td><td>
<select id="doc" size="1">
</select>
</td>
</tr>
<tr>
<td >
<label for="mode">Mode</label>
</td><td>
<select id="mode" size="1">
</select>
</td>
</tr>
<tr>
<td>
<label for="split">Split</label>
</td><td>
<select id="split" size="1">
<option value="none">None</option>
<option value="below">Below</option>
<option value="beside">Beside</option>
</select>
</td>
</tr>
<tr>
<td >
<label for="theme">Theme</label>
</td><td>
<select id="theme" size="1">
</select>
</td>
</tr>
<tr>
<td>
<label for="fontsize">Font Size</label>
</td><td>
<select id="fontsize" size="1">
<option value="10px">10px</option>
<option value="11px">11px</option>
<option value="12px" selected="selected">12px</option>
<option value="13px">13px</option>
<option value="14px">14px</option>
<option value="16px">16px</option>
<option value="18px">18px</option>
<option value="20px">20px</option>
<option value="24px">24px</option>
</select>
</td>
</tr>
<tr>
<td>
<label for="folding">Code Folding</label>
</td><td>
<select id="folding" size="1">
<option value="manual">manual</option>
<option value="markbegin" selected="selected">mark begin</option>
<option value="markbeginend">mark begin and end</option>
</select>
</td>
</tr>
<tr>
<td >
<label for="keybinding">Key Binding</label>
</td><td>
<select id="keybinding" size="1">
<option value="ace">Ace</option>
<option value="vim">Vim</option>
<option value="emacs">Emacs</option>
<option value="custom">Custom</option>
</select>
</td>
</tr>
<tr>
<td >
<label for="soft_wrap">Soft Wrap</label>
</td><td>
<select id="soft_wrap" size="1">
<option value="off">Off</option>
<option value="40">40 Chars</option>
<option value="80">80 Chars</option>
<option value="free">Free</option>
</select>
</td>
</tr>
<tr><td colspan="2">
<table id="more-controls">
<tr>
<td>
<label for="select_style">Full Line Selection</label>
</td><td>
<input type="checkbox" name="select_style" id="select_style" checked>
</td>
</tr>
<tr>
<td>
<label for="highlight_active">Highlight Active Line</label>
</td><td>
<input type="checkbox" name="highlight_active" id="highlight_active" checked>
</td>
</tr>
<tr>
<td >
<label for="show_hidden">Show Invisibles</label>
</td><td>
<input type="checkbox" name="show_hidden" id="show_hidden" checked>
</td>
</tr>
<tr>
<td >
<label for="display_indent_guides">Show Indent Guides</label>
</td><td>
<input type="checkbox" name="display_indent_guides" id="display_indent_guides" checked>
</td>
</tr>
<tr>
<td >
<label for="show_hscroll">Persistent HScroll</label>
</td><td>
<input type="checkbox" name="show_hscroll" id="show_hscroll">
<label for="show_hscroll">VScroll</label>
<input type="checkbox" name="show_vscroll" id="show_vscroll">
</td>
</tr>
<tr>
<td >
<label for="animate_scroll">Animate scrolling</label>
</td><td>
<input type="checkbox" name="animate_scroll" id="animate_scroll">
</td>
</tr>
<tr>
<td >
<label for="show_gutter">Show Gutter</label>
</td><td>
<input type="checkbox" id="show_gutter" checked>
</td>
</tr>
<tr>
<td >
<label for="show_print_margin">Show Print Margin</label>
</td><td>
<input type="checkbox" id="show_print_margin" checked>
</td>
</tr>
<tr>
<td >
<label for="soft_tab">Use Soft Tab</label>
</td><td>
<input type="checkbox" id="soft_tab" checked>
</td>
</tr>
<tr>
<td >
<label for="highlight_selected_word">Highlight selected word</label>
</td>
<td>
<input type="checkbox" id="highlight_selected_word" checked>
</td>
</tr>
<tr>
<td >
<label for="enable_behaviours">Enable Behaviours</label>
</td>
<td>
<input type="checkbox" id="enable_behaviours">
</td>
</tr>
<tr>
<td >
<label for="fade_fold_widgets">Fade Fold Widgets</label>
</td>
<td>
<input type="checkbox" id="fade_fold_widgets">
</td>
</tr>
<tr>
<td >
<label for="elastic_tabstops">Enable Elastic Tabstops</label>
</td>
<td>
<input type="checkbox" id="elastic_tabstops">
</td>
</tr>
<tr>
<td >
<label for="isearch">Incremental Search</label>
</td>
<td>
<input type="checkbox" id="isearch">
</td>
</tr>
<tr>
<td >
<label for="highlight_token">Show token info</label>
</td>
<td>
<input type="checkbox" id="highlight_token">
</td>
</tr>
<tr>
<td >
<label for="read_only">Read-only</label>
</td>
<td>
<input type="checkbox" id="read_only">
</td>
</tr>
<tr>
<td >
<label for="scrollPastEnd">Scroll Past End</label>
</td>
<td>
<input type="checkbox" id="scrollPastEnd" checked>
</td>
</tr>
<tr>
<td colspan="2">
<input type="button" value="Edit Snippets" onclick="env.editSnippets()">
</td>
</tr>
</table>
</td></tr>
</table>
<a href="http://ace.c9.io">
<a href="https://ace.c9.io">
<img id="ace-logo" src="doc/site/images/ace-logo.png" style="width: 134px;margin: 46px 0px 4px 66px;">
</a>
<div><a target="_test" href="./lib/ace/test/tests.html"
style="color: whitesmoke; text-align: left; padding: 1em;">tests</a>
<!--DEVEL-->
<div style="text-align: left; padding: 0.5em 1em;">
<a style="color: whitesmoke;" target="_test" rel="noreferer" href="./lib/ace/test/tests.html">tests</a>
</div>
<div style="text-align: left; padding: 0.5em 1em;">
<a style="color: whitesmoke;" target="_test" rel="noreferer" href="./tool/mode_creator.html">Mode Creator</a>
</div>
<div style="text-align: left; padding: 0.5em 1em;">
<a style="color: whitesmoke;" target="_test" rel="noreferer" href="./tool/perf-test.html">Performance test</a>
</div>
<!--DEVEL-->
</div>
</div>
</div>

Wyświetl plik

@ -33,8 +33,7 @@ define(function(require, exports, module) {
var bidiUtil = require("./lib/bidiutil");
var lang = require("./lib/lang");
var useragent = require("./lib/useragent");
var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/;
/**
* This object is used to ensure Bi-Directional support (for languages with text flowing from right to left, like Arabic or Hebrew)
@ -61,9 +60,14 @@ var BidiHandler = function(session) {
this.isRtlDir = false;
this.line = "";
this.wrapIndent = 0;
this.isLastRow = false;
this.EOF = "\xB6";
this.seenBidi = false;
this.RLE = "\u202B";
this.contentWidth = 0;
this.fontMetrics = null;
this.rtlLineOffset = 0;
this.wrapOffset = 0;
this.isMoveLeftOperation = false;
this.seenBidi = null;
};
(function() {
@ -123,6 +127,8 @@ var BidiHandler = function(session) {
prevIndex = currentIndex;
splitIndex++;
}
} else {
splitIndex = this.currentRow;
}
return splitIndex;
@ -132,9 +138,12 @@ var BidiHandler = function(session) {
if (docRow === undefined)
docRow = this.getDocumentRow();
var isLastRow = (docRow === this.session.getLength() - 1),
endOfLine = isLastRow ? this.EOF : this.EOL;
this.wrapIndent = 0;
this.isLastRow = (docRow === this.session.getLength() - 1);
this.line = this.session.getLine(docRow);
this.isRtlDir = this.line.charAt(0) === this.RLE;
if (this.session.$useWrapMode) {
var splits = this.session.$wrapData[docRow];
if (splits) {
@ -143,13 +152,18 @@ var BidiHandler = function(session) {
if(splitIndex > 0 && splits.length) {
this.wrapIndent = splits.indent;
this.wrapOffset = this.wrapIndent * this.charWidths[bidiUtil.L];
this.line = (splitIndex < splits.length) ?
this.line.substring(splits[splitIndex - 1], splits[splits.length - 1]) :
this.line.substring(splits[splitIndex - 1], splits[splitIndex]) :
this.line.substring(splits[splits.length - 1]);
} else {
this.line = this.line.substring(0, splits[splitIndex]);
}
}
if (splitIndex == splits.length)
this.line += (this.showInvisibles) ? endOfLine : bidiUtil.DOT;
} else {
this.line += this.showInvisibles ? endOfLine : bidiUtil.DOT;
}
/* replace tab and wide characters by commensurate spaces */
@ -162,13 +176,17 @@ var BidiHandler = function(session) {
}
return ch;
});
if (this.isRtlDir) {
this.fontMetrics.$main.innerHTML = (this.line.charAt(this.line.length - 1) == bidiUtil.DOT) ? this.line.substr(0, this.line.length - 1) : this.line;
this.rtlLineOffset = this.contentWidth - this.fontMetrics.$main.getBoundingClientRect().width;
}
};
this.updateBidiMap = function() {
var textCharTypes = [], endOfLine = this.isLastRow ? this.EOF : this.EOL;
var line = this.line + (this.showInvisibles ? endOfLine : bidiUtil.DOT);
if (bidiUtil.hasBidiCharacters(line, textCharTypes)) {
this.bidiMap = bidiUtil.doBidiReorder(line, textCharTypes, this.isRtlDir);
var textCharTypes = [];
if (bidiUtil.hasBidiCharacters(this.line, textCharTypes) || this.isRtlDir) {
this.bidiMap = bidiUtil.doBidiReorder(this.line, textCharTypes, this.isRtlDir);
} else {
this.bidiMap = {};
}
@ -187,26 +205,21 @@ var BidiHandler = function(session) {
*
**/
this.updateCharacterWidths = function(fontMetrics) {
if (!this.seenBidi)
return;
if (this.characterWidth === fontMetrics.$characterSize.width)
return;
this.fontMetrics = fontMetrics;
var characterWidth = this.characterWidth = fontMetrics.$characterSize.width;
var bidiCharWidth = fontMetrics.$measureCharWidth("\u05d4");
this.charWidths[bidiUtil.L] = this.charWidths[bidiUtil.EN] = this.charWidths[bidiUtil.ON_R] = characterWidth;
this.charWidths[bidiUtil.R] = this.charWidths[bidiUtil.AN] = bidiCharWidth;
this.charWidths[bidiUtil.R_H] = useragent.isChrome ? bidiCharWidth : bidiCharWidth * 0.45;
this.charWidths[bidiUtil.B] = 0;
this.charWidths[bidiUtil.R_H] = bidiCharWidth * 0.45;
this.charWidths[bidiUtil.B] = this.charWidths[bidiUtil.RLE] = 0;
this.currentRow = null;
};
this.getShowInvisibles = function() {
return this.showInvisibles;
};
this.setShowInvisibles = function(showInvisibles) {
this.showInvisibles = showInvisibles;
this.currentRow = null;
@ -216,10 +229,28 @@ var BidiHandler = function(session) {
this.EOL = eolChar;
};
this.setTextDir = function(isRtlDir) {
this.isRtlDir = isRtlDir;
this.setContentWidth = function(width) {
this.contentWidth = width;
};
this.isRtlLine = function(row) {
if (row != undefined)
return (this.session.getLine(row).charAt(0) == this.RLE);
else
return this.isRtlDir;
};
this.setRtlDirection = function(editor, isRtlDir) {
var cursor = editor.getCursorPosition();
for (var row = editor.selection.getSelectionAnchor().row; row <= cursor.row; row++) {
if (!isRtlDir && editor.session.getLine(row).charAt(0) === editor.session.$bidiHandler.RLE)
editor.session.doc.removeInLine(row, 0, 1);
else if (isRtlDir && editor.session.getLine(row).charAt(0) !== editor.session.$bidiHandler.RLE)
editor.session.doc.insert({column: 0, row: row}, editor.session.$bidiHandler.RLE);
}
};
/**
* Returns offset of character at position defined by column.
* @param {Number} the screen column position
@ -228,21 +259,26 @@ var BidiHandler = function(session) {
**/
this.getPosLeft = function(col) {
col -= this.wrapIndent;
var visualIdx = bidiUtil.getVisualFromLogicalIdx(col > 0 ? col - 1 : 0, this.bidiMap),
var leftBoundary = (this.line.charAt(0) === this.RLE) ? 1 : 0;
var logicalIdx = (col > leftBoundary) ? (this.session.getOverwrite() ? col : col - 1) : leftBoundary;
var visualIdx = bidiUtil.getVisualFromLogicalIdx(logicalIdx, this.bidiMap),
levels = this.bidiMap.bidiLevels, left = 0;
if (col === 0 && levels[visualIdx] % 2 !== 0)
if (!this.session.getOverwrite() && col <= leftBoundary && levels[visualIdx] % 2 !== 0)
visualIdx++;
for (var i = 0; i < visualIdx; i++) {
left += this.charWidths[levels[i]];
}
if (col !== 0 && levels[visualIdx] % 2 === 0)
if (!this.session.getOverwrite() && (col > leftBoundary) && (levels[visualIdx] % 2 === 0))
left += this.charWidths[levels[visualIdx]];
if (this.wrapIndent)
left += this.wrapIndent * this.charWidths[bidiUtil.L];
left += this.isRtlDir ? (-1 * this.wrapOffset) : this.wrapOffset;
if (this.isRtlDir)
left += this.rtlLineOffset;
return left;
};
@ -255,9 +291,12 @@ var BidiHandler = function(session) {
* @return {Array of Objects} Each object contains 'left' and 'width' values defining selection rectangle.
**/
this.getSelections = function(startCol, endCol) {
var map = this.bidiMap, levels = map.bidiLevels, level, offset = this.wrapIndent * this.charWidths[bidiUtil.L], selections = [],
var map = this.bidiMap, levels = map.bidiLevels, level, selections = [], offset = 0,
selColMin = Math.min(startCol, endCol) - this.wrapIndent, selColMax = Math.max(startCol, endCol) - this.wrapIndent,
isSelected = false, isSelectedPrev = false, selectionStart = 0;
if (this.wrapIndent)
offset += this.isRtlDir ? (-1 * this.wrapOffset) : this.wrapOffset;
for (var logIdx, visIdx = 0; visIdx < levels.length; visIdx++) {
logIdx = map.logicalFromVisual[visIdx];
@ -276,6 +315,11 @@ var BidiHandler = function(session) {
selections.push({left: selectionStart, width: offset - selectionStart});
}
if(this.isRtlDir) {
for (var i = 0; i < selections.length; i++) {
selections[i].left += this.rtlLineOffset;
}
}
return selections;
};
@ -286,13 +330,15 @@ var BidiHandler = function(session) {
* @return {Number} screen column number corresponding to given pixel offset
**/
this.offsetToCol = function(posX) {
if(this.isRtlDir)
posX -= this.rtlLineOffset;
var logicalIdx = 0, posX = Math.max(posX, 0),
offset = 0, visualIdx = 0, levels = this.bidiMap.bidiLevels,
charWidth = this.charWidths[levels[visualIdx]];
if (this.wrapIndent) {
posX -= this.wrapIndent * this.charWidths[bidiUtil.L];
}
if (this.wrapIndent)
posX -= this.isRtlDir ? (-1 * this.wrapOffset) : this.wrapOffset;
while(posX > offset + charWidth/2) {
offset += charWidth;
@ -329,6 +375,9 @@ var BidiHandler = function(session) {
logicalIdx = this.bidiMap.logicalFromVisual[visualIdx];
}
if (logicalIdx === 0 && this.isRtlDir)
logicalIdx++;
return (logicalIdx + this.wrapIndent);
};

Wyświetl plik

@ -159,9 +159,9 @@ var EditSession = function(text, mode) {
if (typeof text != "object" || !text.getLine)
text = new Document(text);
this.$bidiHandler = new BidiHandler(this);
this.setDocument(text);
this.selection = new Selection(this);
this.$bidiHandler = new BidiHandler(this);
config.resetOptions(this);
this.setMode(mode);

Wyświetl plik

@ -141,6 +141,7 @@ var supportedModes = {
pgSQL: ["pgsql"],
PHP_Laravel_blade: ["blade.php"],
PHP: ["php|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],
Puppet: ["epp|pp"],
Pig: ["pig"],
Powershell: ["ps1"],
Praat: ["praat|praatscript|psc|proc"],
@ -174,6 +175,7 @@ var supportedModes = {
SVG: ["svg"],
Swift: ["swift"],
Tcl: ["tcl"],
Terraform: ["tf", "tfvars", "terragrunt"],
Tex: ["tex"],
Text: ["txt"],
Textile: ["textile"],

124
plugins/node_modules/ace/lib/ace/ext/rtl.js wygenerowano vendored 100644
Wyświetl plik

@ -0,0 +1,124 @@
define(function(require, exports, module) {
"use strict";
/** simple statusbar **/
var dom = require("ace/lib/dom");
var lang = require("ace/lib/lang");
var commands = [{
name: "leftToRight",
bindKey: { win: "Ctrl-Alt-Shift-L", mac: "Command-Alt-Shift-L" },
exec: function(editor) {
editor.session.$bidiHandler.setRtlDirection(editor, false);
},
readOnly: true
}, {
name: "rightToLeft",
bindKey: { win: "Ctrl-Alt-Shift-R", mac: "Command-Alt-Shift-R" },
exec: function(editor) {
editor.session.$bidiHandler.setRtlDirection(editor, true);
},
readOnly: true
}];
var Editor = require("../editor").Editor;
require("../config").defineOptions(Editor.prototype, "editor", {
rtlText: {
set: function(val) {
if (val) {
this.on("session", onChange);
this.on("changeSelection", onChangeSelection);
this.renderer.on("afterRender", updateLineDirection);
this.commands.on("exec", onCommandEmitted);
this.commands.addCommands(commands);
} else {
this.off("session", onChange);
this.off("changeSelection", onChangeSelection);
this.renderer.off("afterRender", updateLineDirection);
this.commands.off("exec", onCommandEmitted);
this.commands.removeCommands(commands);
clearTextLayer(this.renderer);
}
this.renderer.updateFull();
}
}
});
/**
* Whenever the selection is changed, prevent cursor (lead) to be positioned at
* position 0 of right-to-left line in order to maintain the RLE marker at this position.
* When cursor reaches position 0, either advance it to position 1 of current line (default)
* or to last position of previous line (if it comes from position 1 as the result of commands
* mentioned in 'onCommandEmitted' event handler).
* This serves few purposes:
* - ensures cursor visual movement as if RLE mark doesn't exist.
* - prevents character insertion before RLE mark.
* - prevents RLE mark removal when 'delete' is pressed when cursot stays at position 0.
* - ensures RLE mark removal on line merge, when 'delete' is pressed and cursor stays
* at last position of previous line and when 'backspace' is pressed and cursor stays at
* first position of current line. This is achived by hacking range boundaries on 'remove' operation.
**/
function onChangeSelection(e, editor) {
var lead = editor.getSelection().lead;
if (editor.session.$bidiHandler.isRtlLine(lead.row)) {
if (lead.column === 0) {
if (editor.session.$bidiHandler.isMoveLeftOperation && lead.row > 0) {
editor.getSelection().moveCursorTo(lead.row - 1, editor.session.getLine(lead.row - 1).length);
} else {
if (editor.getSelection().isEmpty())
lead.column += 1;
else
lead.setPosition(lead.row, lead.column + 1);
}
}
}
}
function onCommandEmitted(commadEvent) {
commadEvent.editor.session.$bidiHandler.isMoveLeftOperation = /gotoleft|selectleft|backspace|removewordleft/.test(commadEvent.command.name);
}
/**
* Whenever the document is changed make sure that line break operatin
* on right-to-left line (like pressing Enter or pasting multi-line text)
* produces new right-to-left lines
**/
function onChange(delta, session) {
session.$bidiHandler.currentRow = null;
if (session.$bidiHandler.isRtlLine(delta.start.row) && delta.action === 'insert' && delta.lines.length > 1) {
for (var row = delta.start.row; row < delta.end.row; row++) {
if (session.getLine(row + 1).charAt(0) !== session.$bidiHandler.RLE)
session.getDocument().$lines[row + 1] = session.$bidiHandler.RLE + session.getLine(row + 1);
}
}
}
function updateLineDirection(e, renderer) {
var session = renderer.session;
var $bidiHandler = session.$bidiHandler;
var cells = renderer.$textLayer.$lines.cells;
var width = renderer.layerConfig.width - renderer.layerConfig.padding + "px";
cells.forEach(function(cell) {
var style = cell.element.style;
if ($bidiHandler && $bidiHandler.isRtlLine(cell.row)) {
style.direction = "rtl";
style.textAlign = "right";
style.width = width;
} else {
style.direction = "";
style.textAlign = "";
style.width = "";
}
});
}
function clearTextLayer(renderer) {
var lines = renderer.$textLayer.$lines;
lines.cells.forEach(clear);
lines.cellCache.forEach(clear);
function clear(cell) {
var style = cell.element.style;
style.direction = style.textAlign = style.width = "";
}
}
});

Wyświetl plik

@ -1,465 +0,0 @@
// DO NOT COMMIT TO OPEN SOURCE ACE!
define(function(require, exports, module) {
"use strict";
var keyUtil = require("../lib/keys");
var oop = require("../lib/oop");
var useragent = require("../lib/useragent");
var HashHandler = require("../keyboard/hash_handler").HashHandler;
var keyMods = (function() {
var keyMods = [];
var mods = ["meta", "ctrl", "alt", "shift"];
for (var i = mods.length; i--;) {
keyMods[i] = mods.filter(function(x) {
return i & keyUtil.KEY_MODS[x];
}).join("-") + "-";
}
return keyMods;
})();
var commandMap = {
"auto_complete" : "complete",
"build" : "build",
"clear_bookmarks" : false,
"clear_fields" : false,
"close" : false,
"close_file" : "closetab",
"close_pane" : "closepane",
"close_tag" : false,
"close_window" : "closealltabs",
"commit_completion": false,
"context_menu" : false,
"decrease_font_size" : "smallerfont",
"increase_font_size" : "largerfont"
// "copy"
// "cut"
// "delete_to_mark"
// "delete_word" :
// "duplicate_line" : "duplicate"
// "exec"
// "expand_selection"
// "find_all"
// "find_all_under"
// "find_next"
// "find_prev"
// "find_under"
// "find_under_expand"
// "find_under_expand_skip"
// "find_under_prev"
// "focus_group"
// "focus_neighboring_group"
// "focus_side_bar"
// "fold"
// "fold_by_level"
// "fold_tag_attributes"
// "goto_definition"
// "goto_symbol_in_project"
// "hide_auto_complete"
// "hide_overlay"
// "hide_panel"
// "indent"
// "insert"
// "insert_best_completion"
// "insert_snippet"
// "join_lines"
// "jump_back"
// "jump_forward"
// "left_delete"
// "lower_case"
// "move"
// "move_to"
// "move_to_group"
// "move_to_neighboring_group"
// "new_file"
// "new_pane"
// "new_window"
// "next_bookmark"
// "next_field"
// "next_misspelling"
// "next_result"
// "next_view"
// "next_view_in_stack"
// "paste"
// "paste_and_indent"
// "paste_from_history"
// "prev_bookmark"
// "prev_field"
// "prev_misspelling"
// "prev_result"
// "prev_view"
// "prev_view_in_stack"
// "prompt_open_file"
// "prompt_save_as"
// "prompt_select_workspace"
// "redo"
// "redo_or_repeat"
// "reindent"
// "reopen_last_file"
// "replace_all"
// "replace_completion_with_auto_complete"
// "replace_completion_with_next_completion"
// "replace_next"
// "right_delete"
// "run_macro"
// "run_macro_file"
// "save"
// "scroll_lines"
// "select_all"
// "select_all_bookmarks"
// "select_by_index"
// "select_lines"
// "select_to_mark"
// "set_layout"
// "set_mark"
// "show_at_center"
// "show_overlay"
// "show_panel"
// "show_scope_name"
// "single_selection"
// "slurp_find_string"
// "slurp_replace_string"
// "soft_redo"
// "soft_undo"
// "sort_lines"
// "split_selection_into_lines"
// "swap_line_down"
// "swap_line_up"
// "swap_with_mark"
// "switch_file"
// "toggle_bookmark"
// "toggle_case_sensitive"
// "toggle_comment"
// "toggle_distraction_free"
// "toggle_full_screen"
// "toggle_overwrite"
// "toggle_preserve_case"
// "toggle_record_macro"
// "toggle_regex"
// "toggle_setting"
// "toggle_side_bar"
// "toggle_whole_word"
// "transpose"
// "undo"
// "unfold"
// "unfold_all"
// "unindent"
// "upper_case"
// "wrap_block"
// "wrap_lines"
// "yank"
};
function getKeyValue(key, ace) {
switch (key) {
case "auto_complete_visible":
// Returns true if the autocomplete list is visible.
break;
case "has_next_field":
// Returns true if a next snippet field is available.
break;
case "has_prev_field":
// Returns true if a previous snippet field is available.
break;
case "num_selections":
// Returns the number of selections.
return ace.selection.ranges.length || 1;
break;
case "overlay_visible":
// Returns true if any overlay is visible.
break;
case "panel_visible":
// Returns true if any panel is visible.
break;
case "following_text":
// Restricts the test just to the text following the caret.
var pos = ace.getCursorPosition();
return ace.session.getLine(pos.row).substr(pos.column);
break;
case "preceding_text":
// Restricts the test just to the text preceding the caret.
pos = ace.getCursorPosition();
return ace.session.getLine(pos.row).substr(pos.column);
break;
case "selection_empty":
// Returns true if the selection is an empty region.
break;
case "text":
// Restricts the test just to the selected text.
return ace.getSelectedText();
break;
case "selector":
// Returns the current scope.
break;
case "panel_has_focus":
// Returns true if the current focus is on a panel.
break;
case "panel":
// Returns true if the panel given as operand is visible.
break;
default:
// case "setting.x":
// Returns the value of the x setting. x can be any string.
}
}
var operators = {
isTrue: function(a){return !!a},
equal: function(a,b){return a === b},
not_equal: function(a,b){return a !== b},
regex_match: function(a,b){ return typeof a == "string" && a.match(b) },
not_regex_match: function(a,b){return typeof a == "string" && !a.match(b)},
regex_contains: function(a,b){return typeof a == "string" && a.search(b) !== -1},
not_regex_contains: function(a,b){return typeof a == "string" && a.search(b) === -1}
};
function testIsAvailable(editor, args, e) {
if (!this.context)
return true;
return this.context.some(function(ctx) {
if (!ctx.key)
return;
if (ctx.operator && ctx.operator.indexOf("regex") != -1) {
if (ctx.operand && typeof ctx.operand == "string")
ctx.operand = new RegExp(ctx.operand);
}
var op = operators[ctx.operator] || (
ctx.operand ? operators.equal : operators.isTrue);
var key = getKeyValue(ctx.key, editor, args, e);
return op(key, ctx.operand);
});
}
function SublimeHandler() {
this.commands = {};
this.commandKeyBinding = {};
}
(function() {
oop.implement(this, HashHandler.prototype);
var sublimeToAceKey = {
keypad0: "numpad0",
keypad1: "numpad1",
keypad2: "numpad2",
keypad3: "numpad3",
keypad4: "numpad4",
keypad5: "numpad5",
keypad6: "numpad6",
keypad7: "numpad7",
keypad8: "numpad8",
keypad9: "numpad9",
keypad_period: ".",
keypad_divide: "/",
keypad_multiply: "*",
keypad_minus: "-",
keypad_plus: "+",
keypad_enter: "numpadEnter",
equals: "=",
plus: "+"
};
this.setKeyMap = function(keyMap) {
var prev
var all = keyMap.map(function(cm) {
return cm.context && cm.context.operator
}).sort().filter(function(x) {
if (x == prev)
return false;
prev = x;
return true;
});
console.log(all)
ace.setValue(JSON.stringify(all))
};
this.addCommand = function(command) {
if (this.commands[command.name])
this.removeCommand(command);
this.commands[command.name] = command;
if (command.bindKey)
this._buildKeyHash(command);
};
this.removeCommand = function(command) {
var name = (typeof command === 'string' ? command : command.name);
command = this.commands[name];
delete this.commands[name];
// exhaustive search is brute force but since removeCommand is
// not a performance critical operation this should be OK
var ckb = this.commandKeyBinding;
for (var hashId in ckb) {
for (var key in ckb[hashId]) {
if (ckb[hashId][key] == command)
delete ckb[hashId][key];
}
}
};
this.bindKey = function(key, command) {
if(!key)
return;
if (typeof command == "function") {
this.addCommand({exec: command, bindKey: key, name: command.name || key});
return;
}
var ckb = this.commandKeyBinding;
key.split("|").forEach(function(keyPart) {
var binding = this.parseKeys(keyPart, command);
var hashId = binding.hashId;
(ckb[hashId] || (ckb[hashId] = {}))[binding.key] = command;
}, this);
};
this.addCommands = function(commands) {
commands && Object.keys(commands).forEach(function(name) {
var command = commands[name];
if (!command)
return;
if (typeof command === "string")
return this.bindKey(command, name);
if (typeof command === "function")
command = { exec: command };
if (typeof command !== "object")
return;
if (!command.name)
command.name = name;
this.addCommand(command);
}, this);
};
this.removeCommands = function(commands) {
Object.keys(commands).forEach(function(name) {
this.removeCommand(commands[name]);
}, this);
};
this.bindKeys = function(keyList) {
Object.keys(keyList).forEach(function(key) {
this.bindKey(key, keyList[key]);
}, this);
};
this._buildKeyHash = function(command) {
var binding = command.bindKey;
if (!binding)
return;
var key = typeof binding == "string" ? binding: binding[this.platform];
this.bindKey(key, command);
};
// accepts keys in the form ctrl+Enter or ctrl-Enter
// keys without modifiers or shift only
this.parseKeys = function(keys) {
// todo support keychains
if (keys.indexOf(" ") != -1)
keys = keys.split(/\s+/).pop();
var parts = keys.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(x){return x});
var key = parts.pop();
var keyCode = keyUtil[key];
if (keyUtil.FUNCTION_KEYS[keyCode])
key = keyUtil.FUNCTION_KEYS[keyCode].toLowerCase();
else if (!parts.length)
return {key: key, hashId: -1};
else if (parts.length == 1 && parts[0] == "shift")
return {key: key.toUpperCase(), hashId: -1};
var hashId = 0;
for (var i = parts.length; i--;) {
var modifier = keyUtil.KEY_MODS[parts[i]];
if (modifier == null) {
if (typeof console != "undefined")
console.error("invalid modifier " + parts[i] + " in " + keys);
return false;
}
hashId |= modifier;
}
return {key: key, hashId: hashId};
};
this.bindKey = function(key, command) {
if (!key)
return;
var ckb = this.commandKeyBinding;
key.split("|").forEach(function(keyPart) {
keyPart = keyPart.toLowerCase();
ckb[keyPart] = command;
// register all partial key combos as null commands
// to be able to activate key combos with arbitrary length
// Example: if keyPart is "C-c C-l t" then "C-c C-l t" will
// get command assigned and "C-c" and "C-c C-l" will get
// a null command assigned in this.commandKeyBinding. For
// the lookup logic see handleKeyboard()
var keyParts = keyPart.split(" ").slice(0,-1);
keyParts.reduce(function(keyMapKeys, keyPart, i) {
var prefix = keyMapKeys[i-1] ? keyMapKeys[i-1] + ' ' : '';
return keyMapKeys.concat([prefix + keyPart]);
}, []).forEach(function(keyPart) {
if (!ckb[keyPart]) ckb[keyPart] = "null";
});
}, this);
};
this.handleKeyboard = function(data, hashId, key, keyCode) {
var editor = data.editor;
// insertstring data.count times
if (hashId == -1) {
editor.pushEmacsMark();
if (data.count) {
var str = new Array(data.count + 1).join(key);
data.count = null;
return {command: "insertstring", args: str};
}
}
if (key == "\x00") return undefined;
var modifier = keyMods[hashId];
if (modifier) key = modifier + key;
// Key combos like CTRL+X H build up the data.keyChain
if (data.keyChain) key = data.keyChain += " " + key;
// Key combo prefixes get stored as "null" (String!) in this
// this.commandKeyBinding. When encountered no command is invoked but we
// buld up data.keyChain
var command = this.commandKeyBinding[key];
data.keyChain = command == "null" ? key : "";
// there really is no command
if (!command) return undefined;
// we pass b/c of key combo
if (command === "null") return {command: "null"};
return {command: command, args: command.args};
};
}).call(SublimeHandler.prototype);
exports.handler = new SublimeHandler();
var keyMap = require("../requirejs/text!./sublime/windows.sublime-keymap");
exports.handler.setKeyMap(eval("(" + keyMap + ")"))
});

Wyświetl plik

@ -192,6 +192,8 @@ define(function(require, exports, module) {
this.curOp.force = force;
var result = fn();
if (this.ace.curOp && this.ace.curOp.command.name == "vim") {
if (this.state.dialog)
this.ace.curOp.command.scrollIntoView = false;
this.ace.endOperation();
if (!curOp.cursorActivity && !curOp.lastChange && prevOp)
this.ace.prevOp = prevOp;
@ -715,18 +717,18 @@ dom.importCssString(".normal-mode .ace_cursor{\
.ace_dialog {\
position: absolute;\
left: 0; right: 0;\
background: white;\
background: inherit;\
z-index: 15;\
padding: .1em .8em;\
overflow: hidden;\
color: #333;\
color: inherit;\
}\
.ace_dialog-top {\
border-bottom: 1px solid #eee;\
border-bottom: 1px solid #444;\
top: 0;\
}\
.ace_dialog-bottom {\
border-top: 1px solid #eee;\
border-top: 1px solid #444;\
bottom: 0;\
}\
.ace_dialog input {\
@ -769,11 +771,19 @@ dom.importCssString(".normal-mode .ace_cursor{\
var dialog = dialogDiv(this, template, options.bottom);
var closed = false, me = this;
this.state.dialog = dialog;
function close(newVal) {
if (typeof newVal == 'string') {
inp.value = newVal;
} else {
if (closed) return;
if (newVal && newVal.type == "blur") {
if (document.activeElement === inp)
return;
}
me.state.dialog = null;
closed = true;
dialog.parentNode.removeChild(dialog);
me.focus();

Wyświetl plik

@ -139,8 +139,6 @@ var Gutter = function(parentEl) {
var index = -1;
var row = firstRow;
var cells = Array.prototype.slice.call(this.element.childNodes, 0);
while (true) {
if (row > foldStart) {
row = fold.end.row + 1;
@ -155,7 +153,9 @@ var Gutter = function(parentEl) {
}
cell = this.$lines.get(++index);
if (!cell) {
if (cell) {
cell.row = row;
} else {
cell = this.$lines.createCell(row, config, this.session, onCreateCell);
this.$lines.push(cell);
}

Wyświetl plik

@ -150,23 +150,35 @@ var Marker = function(parentEl) {
var left = padding + range.start.column * config.characterWidth;
extraStyle = extraStyle || "";
this.elt(
clazz + " ace_br1 ace_start",
"height:"+ height+ "px;"+ "right:0;"+ "top:"+top+ "px;left:"+ left+ "px;" + (extraStyle || "")
);
if (this.session.$bidiHandler.isBidiRow(range.start.row)) {
var range1 = range.clone();
range1.end.row = range1.start.row;
range1.end.column = this.session.getLine(range1.start.row).length;
this.drawBidiSingleLineMarker(stringBuilder, range1, clazz + " ace_br1 ace_start", config, null, extraStyle);
} else {
this.elt(
clazz + " ace_br1 ace_start",
"height:"+ height+ "px;"+ "right:0;"+ "top:"+top+ "px;left:"+ left+ "px;" + (extraStyle || "")
);
}
// from start of the last line to the selection end
top = this.$getTop(range.end.row, config);
var width = range.end.column * config.characterWidth;
this.elt(
clazz + " ace_br12",
"height:"+ height+ "px;"+
"width:"+ width+ "px;"+
"top:"+ top+ "px;"+
"left:"+ padding+ "px;"+ (extraStyle || "")
);
if (this.session.$bidiHandler.isBidiRow(range.end.row)) {
var range1 = range.clone();
range1.start.row = range1.end.row;
range1.start.column = 0;
this.drawBidiSingleLineMarker(stringBuilder, range1, clazz + " ace_br12", config, null, extraStyle);
} else {
top = this.$getTop(range.end.row, config);
var width = range.end.column * config.characterWidth;
this.elt(
clazz + " ace_br12",
"height:"+ height+ "px;"+
"width:"+ width+ "px;"+
"top:"+ top+ "px;"+
"left:"+ padding+ "px;"+ (extraStyle || "")
);
}
// all the complete lines
height = (range.end.row - range.start.row - 1) * config.lineHeight;
if (height <= 0)
@ -186,6 +198,8 @@ var Marker = function(parentEl) {
// Draws a marker which covers part or whole width of a single screen line
this.drawSingleLineMarker = function(stringBuilder, range, clazz, config, extraLength, extraStyle) {
if (this.session.$bidiHandler.isBidiRow(range.start.row))
return this.drawBidiSingleLineMarker(stringBuilder, range, clazz, config, extraLength, extraStyle);
var height = config.lineHeight;
var width = (range.end.column + (extraLength || 0) - range.start.column) * config.characterWidth;
@ -201,6 +215,22 @@ var Marker = function(parentEl) {
);
};
// Draws Bidi marker which covers part or whole width of a single screen line
this.drawBidiSingleLineMarker = function(stringBuilder, range, clazz, config, extraLength, extraStyle) {
var height = config.lineHeight, top = this.$getTop(range.start.row, config), padding = this.$padding;
var selections = this.session.$bidiHandler.getSelections(range.start.column, range.end.column);
selections.forEach(function(selection) {
this.elt(
clazz,
"height:" + height + "px;" +
"width:" + selection.width + (extraLength || 0) + "px;" +
"top:" + top + "px;" +
"left:" + (padding + selection.left) + "px;" + (extraStyle || "")
);
}, this);
};
this.drawFullLineMarker = function(stringBuilder, range, clazz, config, extraStyle) {
var top = this.$getTop(range.start.row, config);
var height = config.lineHeight;

Wyświetl plik

@ -320,6 +320,8 @@ exports.AN = 4;
exports.R_H = 5;
/* invisible EOL (6 - even), zero width */
exports.B = 6;
/* invisible RLE (7 - odd), zero width */
exports.RLE = 7;
exports.DOT = "\xB7";
@ -363,6 +365,9 @@ exports.doBidiReorder = function(text, textCharTypes, isRtl) {
if (chars[chars.length - 1] === exports.DOT)
levels[chars.length - 1] = exports.B;
if (chars[0] === '\u202B')
levels[0] = exports.RLE;
for (var i = 0; i < logicalFromVisual.length; i++) {
bidiLevels[i] = levels[logicalFromVisual[i]];
}
@ -375,13 +380,13 @@ exports.doBidiReorder = function(text, textCharTypes, isRtl) {
* @param {String} text string to be reordered
* @param {Array} unicode character types (to be filled by this method)
*
* @return {Boolean} 'true' if text contains Bidi characters, otherwise 'false'
* @return {Boolean} 'true' if text contains Bidi characters, otherwise 'false'
**/
exports.hasBidiCharacters = function(text, textCharTypes){
var ret = false;
for (var i = 0; i < text.length; i++){
textCharTypes[i] = _getCharacterType(text.charAt(i));
if (!ret && (textCharTypes[i] == R || textCharTypes[i] == AL))
if (!ret && (textCharTypes[i] == R || textCharTypes[i] == AL || textCharTypes[i] == AN))
ret = true;
}
return ret;

Wyświetl plik

@ -1,8 +0,0 @@
{
"name": "ace-mode-creator",
"version": "0.1.0",
"dependencies": {
"connect": "",
"socket.io": ""
}
}

Wyświetl plik

@ -0,0 +1,21 @@
always @(negedge reset or posedge clk) begin
if (reset == 0) begin
d_out <= 16'h0000;
d_out_mem[resetcount] <= d_out;
laststoredvalue <= d_out;
end else begin
d_out <= d_out + 1'b1;
end
end
always @(bufreadaddr)
bufreadval = d_out_mem[bufreadaddr];
module test;
assign a = "1";
initial begin
$display("Hello \778\xaa\
\n world")
$finish;
end
endmodule

Wyświetl plik

@ -0,0 +1,94 @@
[[
"start",
["constant.language","child-src"]
],[
"start",
["constant.language","connect-src"]
],[
"start",
["constant.language","default-src"]
],[
"start",
["constant.language","font-src"]
],[
"start",
["constant.language","frame-src"]
],[
"start",
["constant.language","img-src"]
],[
"start",
["constant.language","manifest-src"]
],[
"start",
["constant.language","media-src"]
],[
"start",
["constant.language","object-src"]
],[
"start",
["constant.language","script-src"]
],[
"start",
["constant.language","style-src"]
],[
"start",
["constant.language","worker-src"]
],[
"start",
["constant.language","base-uri"]
],[
"start",
["constant.language","plugin-types"]
],[
"start",
["constant.language","sandbox"]
],[
"start",
["constant.language","disown-opener"]
],[
"start",
["constant.language","form-action"]
],[
"start",
["constant.language","frame-ancestors"]
],[
"start",
["constant.language","report-uri"]
],[
"start",
["constant.language","report-to"]
],[
"start",
["constant.language","upgrade-insecure-requests"]
],[
"start",
["constant.language","block-all-mixed-content"]
],[
"start",
["constant.language","require-sri-for"]
],[
"start",
["constant.language","reflected-xss"]
],[
"start",
["constant.language","referrer"]
],[
"start",
["constant.language","policy-uri"]
],[
"start",
["variable","'self'"]
],[
"start",
["variable","'unsafe-inline'"]
],[
"start",
["variable","'unsafe-eval'"]
],[
"start",
["variable","'strict-dynamic'"]
],[
"start",
["variable","'unsafe-hashed-attributes'"]
]]

Wyświetl plik

@ -7,7 +7,8 @@
"ruleset",
["text"," "],
["support.type","font"],
["text",": "],
["punctuation.operator",":"],
["text"," "],
["constant.numeric","12"],
["keyword","px"],
["text"," Monaco, "],
@ -16,14 +17,15 @@
["string.end","\""],
["text",", "],
["support.constant.fonts","monospace"],
["text",";"]
["punctuation.operator",";"]
],[
"ruleset",
["text"," "],
["support.type","cursor"],
["text",": "],
["punctuation.operator",":"],
["text"," "],
["support.constant","text"],
["text",";"]
["punctuation.operator",";"]
],[
"start",
["paren.rparen","}"]
@ -38,12 +40,14 @@
"ruleset",
["text"," "],
["support.type","animation"],
["text",": blink "],
["punctuation.operator",":"],
["text"," blink "],
["constant.numeric","1"],
["keyword","s"],
["text"," "],
["support.constant","linear"],
["text"," infinite alternate;"]
["text"," infinite alternate"],
["punctuation.operator",";"]
],[
"start",
["paren.rparen","}"]
@ -69,9 +73,11 @@
["comment","ruleset"],
["text"," "],
["support.type","opacity"],
["text",": "],
["punctuation.operator",":"],
["text"," "],
["constant.numeric","0"],
["text","; "],
["punctuation.operator",";"],
["text"," "],
["comment","/*"]
],[
"ruleset",
@ -80,7 +86,8 @@
"ruleset",
["text"," "],
["support.type","opacity"],
["text",": "],
["punctuation.operator",":"],
["text"," "],
["constant.numeric","1"]
],[
"start",
@ -102,7 +109,8 @@
"ruleset",
["text"," "],
["support.type","opacity"],
["text",": "],
["punctuation.operator",":"],
["text"," "],
["constant.numeric","1"]
],[
"start",
@ -162,7 +170,8 @@
["string.start0","ruleset"],
["text"," "],
["support.type","content"],
["text",": "],
["punctuation.operator",":"],
["text"," "],
["support.function","attr"],
["text","(title) "],
["string.start","\""],
@ -177,7 +186,9 @@
["comment","ruleset"],
["text"," "],
["support.function","attr"],
["text","(src); "],
["text","(src)"],
["punctuation.operator",";"],
["text"," "],
["comment","/*"]
],[
"ruleset",
@ -186,25 +197,29 @@
"ruleset",
["text"," "],
["support.type","white-space"],
["text",": "],
["punctuation.operator",":"],
["text"," "],
["support.constant","pre"],
["text",";"]
["punctuation.operator",";"]
],[
"ruleset",
["text"," "],
["support.type","display"],
["text",": "],
["punctuation.operator",":"],
["text"," "],
["support.constant","block"],
["text",";"]
["punctuation.operator",";"]
],[
"ruleset",
["text"," "],
["support.type","background"],
["text",": "],
["punctuation.operator",":"],
["text"," "],
["support.function","url("],
["string","asdasd"],
["support.function",")"],
["text","; "],
["punctuation.operator",";"],
["text"," "],
["string.start","\""],
["string","err"]
],[
@ -218,4 +233,4 @@
"start"
],[
"start"
]]
]]

Wyświetl plik

@ -85,6 +85,39 @@
["identifier","d"],
["rparen",")"],
["text",";"]
],[
"start",
["text"," "],
["keyword","int"],
["text"," "],
["identifier","exports"],
["text"," "],
["keyword.operator","="],
["text"," "],
["constant.numeric","10"],
["text",";"]
],[
"start",
["text"," "],
["keyword","int"],
["text"," "],
["identifier","requires"],
["text"," "],
["keyword.operator","="],
["text"," "],
["constant.numeric","20"],
["text",";"]
],[
"start",
["text"," "],
["keyword","int"],
["text"," "],
["identifier","open"],
["text"," "],
["keyword.operator","="],
["text"," "],
["constant.numeric","30"],
["text",";"]
],[
"start",
["text"," "],

Wyświetl plik

@ -59,9 +59,10 @@
"css-ruleset",
["text"," "],
["support.type","background"],
["text",": "],
["punctuation.operator",":"],
["text"," "],
["constant.numeric","#124356"],
["text",";"]
["punctuation.operator",";"]
],[
"css-start",
["text"," "],
@ -432,4 +433,4 @@
["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.tag-name.xml","html"],
["meta.tag.punctuation.tag-close.xml",">"]
]]
]]

Wyświetl plik

@ -101,7 +101,8 @@
["#tmp","css-block-ruleset","paren.lparen52","constant.language40"],
["text"," "],
["support.type","background"],
["text",": "],
["punctuation.operator",":"],
["text"," "],
["support.function","url("],
["string","'name.png'"],
["support.function",")"],
@ -111,7 +112,7 @@
["constant.numeric","0"],
["text"," "],
["support.constant","no-repeat"],
["text",";"]
["punctuation.operator",";"]
],[
["#tmp","css-block-start","paren.lparen52","constant.language40"],
["text"," "],
@ -299,4 +300,4 @@
["identifier","name"],
["paren.rparen.markup.italic","]"],
["string.end","\""]
]]
]]

Wyświetl plik

@ -33,7 +33,7 @@
["support.function","return"],
["text"," "],
["constant.numeric","1"],
["text",";"]
["punctuation.operator",";"]
],[
"php-start",
["text"," "],
@ -61,7 +61,7 @@
["text"," "],
["constant.numeric","1"],
["paren.rparen",")"],
["text",";"]
["punctuation.operator",";"]
],[
"php-start",
["text"," "],
@ -78,7 +78,7 @@
["string","\""],
["constant.language.escape","\\n\\n"],
["string","Please enter a whole number ... \""],
["text",";"]
["punctuation.operator",";"]
],[
"php-start",
["variable","$num"],
@ -91,7 +91,7 @@
["paren.lparen","("],
["constant.language","STDIN"],
["paren.rparen","))"],
["text",";"]
["punctuation.operator",";"]
],[
"php-start"
],[
@ -119,13 +119,13 @@
["string","\""],
["constant.language.escape","\\n\\n"],
["string","\""],
["text",";"]
["punctuation.operator",";"]
],[
"php-start",
["support.function","echo"],
["text"," "],
["variable","$output"],
["text",";"]
["punctuation.operator",";"]
],[
"php-start"
],[
@ -145,7 +145,7 @@
],[
["php-start","js-start"],
["string","'"],
["text",";"]
["punctuation.operator",";"]
],[
"js-start",
["support.php_tag","?>"]
@ -157,7 +157,8 @@
["support.function","echo"],
["text"," "],
["string","':)'"],
["text","; "],
["punctuation.operator",";"],
["text"," "],
["support.php_tag","?>"]
],[
"start",
@ -168,4 +169,4 @@
["constant.language.escape.reference.xml","&js;"]
],[
"start"
]]
]]

Wyświetl plik

@ -253,28 +253,31 @@
"css-ruleset",
["text"," "],
["support.type","font-family"],
["text",": Monaco, "],
["punctuation.operator",":"],
["text"," Monaco, "],
["string.start","\""],
["string","Courier New"],
["string.end","\""],
["text",", "],
["support.constant.fonts","monospace"],
["text",";"]
["punctuation.operator",";"]
],[
"css-ruleset",
["text"," "],
["support.type","font-size"],
["text",": "],
["punctuation.operator",":"],
["text"," "],
["constant.numeric","12"],
["keyword","px"],
["text",";"]
["punctuation.operator",";"]
],[
"css-ruleset",
["text"," "],
["support.type","cursor"],
["text",": "],
["punctuation.operator",":"],
["text"," "],
["support.constant","text"],
["text",";"]
["punctuation.operator",";"]
],[
"css-start",
["text"," "],
@ -284,4 +287,4 @@
["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.style.tag-name.xml","style"],
["meta.tag.punctuation.tag-close.xml",">"]
]]
]]

51
plugins/node_modules/ace/lib/ace/mode/asl.js wygenerowano vendored 100644
Wyświetl plik

@ -0,0 +1,51 @@
/* ***** BEGIN LICENSE BLOCK *****
* Distributed under the BSD license:
*
* Copyright (c) 2012, Ajax.org B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Ajax.org B.V. nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ***** END LICENSE BLOCK ***** */
define(function (require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var ASLHighlightRules = require("./asl_highlight_rules").ASLHighlightRules;
var FoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
this.HighlightRules = ASLHighlightRules;
this.foldingRules = new FoldMode();
this.$behaviour = this.$defaultBehaviour;
};
oop.inherits(Mode, TextMode);
(function () {
this.$id = "ace/mode/asl";
}).call(Mode.prototype);
exports.Mode = Mode;
});

Wyświetl plik

@ -0,0 +1,233 @@
/* ***** BEGIN LICENSE BLOCK *****
* Distributed under the BSD license:
*
* Copyright (c) 2012, Ajax.org B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Ajax.org B.V. nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ***** END LICENSE BLOCK ***** */
define(function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var ASLHighlightRules = function() {
var keywords = (
"Default|DefinitionBlock|Device|Method|Else|ElseIf|For|Function|If|Include|Method|Return|" +
"Scope|Switch|Case|While|Break|BreakPoint|Continue|NoOp|Wait"
);
var keywordOperators = (
"Add|And|Decrement|Divide|Increment|Index|LAnd|LEqual|LGreater|LGreaterEqual|" +
"LLess|LLessEqual|LNot|LNotEqual|LOr|Mod|Multiply|NAnd|NOr|Not|Or|RefOf|Revision|" +
"ShiftLeft|ShiftRight|Subtract|XOr|DerefOf"
);
var buildinFunctions = (
"AccessAs|Acquire|Alias|BankField|Buffer|Concatenate|ConcatenateResTemplate|" +
"CondRefOf|Connection|CopyObject|CreateBitField|CreateByteField|CreateDWordField|" +
"CreateField|CreateQWordField|CreateWordField|DataTableRegion|Debug|" +
"DMA|DWordIO|DWordMemory|DWordSpace|EisaId|EISAID|EndDependentFn|Event|ExtendedIO|" +
"ExtendedMemory|ExtendedSpace|External|Fatal|Field|FindSetLeftBit|FindSetRightBit|" +
"FixedDMA|FixedIO|Fprintf|FromBCD|GpioInt|GpioIo|I2CSerialBusV2|IndexField|" +
"Interrupt|IO|IRQ|IRQNoFlags|Load|LoadTable|Match|Memory32|Memory32Fixed|" +
"Mid|Mutex|Name|Notify|Offset|ObjectType|OperationRegion|Package|PowerResource|Printf|" +
"QWordIO|QWordMemory|QWordSpace|RawDataBuffer|Register|Release|Reset|ResourceTemplate|" +
"Signal|SizeOf|Sleep|SPISerialBusV2|Stall|StartDependentFn|StartDependentFnNoPri|" +
"Store|ThermalZone|Timer|ToBCD|ToBuffer|ToDecimalString|ToInteger|ToPLD|ToString|" +
"ToUUID|UARTSerialBusV2|Unicode|Unload|VendorLong|VendorShort|WordBusNumber|WordIO|" +
"WordSpace"
);
var flags = (
"AttribQuick|AttribSendReceive|AttribByte|AttribBytes|AttribRawBytes|" +
"AttribRawProcessBytes|AttribWord|AttribBlock|AttribProcessCall|AttribBlockProcessCall|" +
"AnyAcc|ByteAcc|WordAcc|DWordAcc|QWordAcc|BufferAcc|" +
"AddressRangeMemory|AddressRangeReserved|AddressRangeNVS|AddressRangeACPI|" +
"RegionSpaceKeyword|FFixedHW|PCC|" +
"AddressingMode7Bit|AddressingMode10Bit|" +
"DataBitsFive|DataBitsSix|DataBitsSeven|DataBitsEight|DataBitsNine|" +
"BusMaster|NotBusMaster|" +
"ClockPhaseFirst|ClockPhaseSecond|ClockPolarityLow|ClockPolarityHigh|" +
"SubDecode|PosDecode|" +
"BigEndianing|LittleEndian|" +
"FlowControlNone|FlowControlXon|FlowControlHardware|" +
"Edge|Level|ActiveHigh|ActiveLow|ActiveBoth|Decode16|Decode10|" +
"IoRestrictionNone|IoRestrictionInputOnly|IoRestrictionOutputOnly|" +
"IoRestrictionNoneAndPreserve|Lock|NoLock|MTR|MEQ|MLE|MLT|MGE|MGT|" +
"MaxFixed|MaxNotFixed|Cacheable|WriteCombining|Prefetchable|NonCacheable|" +
"MinFixed|MinNotFixed|" +
"ParityTypeNone|ParityTypeSpace|ParityTypeMark|ParityTypeOdd|ParityTypeEven|" +
"PullDefault|PullUp|PullDown|PullNone|PolarityHigh|PolarityLow|" +
"ISAOnlyRanges|NonISAOnlyRanges|EntireRange|ReadWrite|ReadOnly|" +
"UserDefRegionSpace|SystemIO|SystemMemory|PCI_Config|EmbeddedControl|" +
"SMBus|SystemCMOS|PciBarTarget|IPMI|GeneralPurposeIO|GenericSerialBus|" +
"ResourceConsumer|ResourceProducer|Serialized|NotSerialized|" +
"Shared|Exclusive|SharedAndWake|ExclusiveAndWake|ControllerInitiated|DeviceInitiated|" +
"StopBitsZero|StopBitsOne|StopBitsOnePlusHalf|StopBitsTwo|" +
"Width8Bit|Width16Bit|Width32Bit|Width64Bit|Width128Bit|Width256Bit|" +
"SparseTranslation|DenseTranslation|TypeTranslation|TypeStatic|" +
"Preserve|WriteAsOnes|WriteAsZeros|Transfer8|Transfer16|Transfer8_16|" +
"ThreeWireMode|FourWireMode"
);
var storageTypes = (
"UnknownObj|IntObj|StrObj|BuffObj|PkgObj|FieldUnitObj|DeviceObj|" +
"EventObj|MethodObj|MutexObj|OpRegionObj|PowerResObj|ProcessorObj|" +
"ThermalZoneObj|BuffFieldObj|DDBHandleObj"
);
var buildinConstants = (
"__FILE__|__PATH__|__LINE__|__DATE__|__IASL__"
);
var deprecated = (
"Memory24|Processor"
);
var keywordMapper = this.createKeywordMapper({
"keyword": keywords,
"keyword.operator": keywordOperators,
"function.buildin": buildinFunctions,
"constant.language": buildinConstants,
"storage.type": storageTypes,
"constant.character": flags,
"invalid.deprecated": deprecated
}, "identifier");
this.$rules = {
"start" : [
{
token : "comment",
regex : "\\/\\/.*$"
},
DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
regex : "\\/\\*",
next : "comment"
},
DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // ignored fields / comments
regex : "\\\[",
next : "ignoredfield"
}, {
token : "variable",
regex : "\\Local[0-7]|\\Arg[0-6]"
}, {
token : "keyword", // pre-compiler directives
regex : "#\\s*(?:define|elif|else|endif|error|if|ifdef|ifndef|include|includebuffer|line|pragma|undef|warning)\\b",
next : "directive"
}, {
token : "string", // single line
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, {
token : "constant.character", // single line
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, {
token : "constant.numeric", // hex
regex : /0[xX][0-9a-fA-F]+\b/
}, {
token : "constant.numeric",
regex : /(One(s)?|Zero|True|False|[0-9]+)\b/
}, {
token : keywordMapper,
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
}, {
token : "keyword.operator",
regex : "/|!|\\$|%|&|\\||\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|\\^|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\|="
}, {
token : "lparen",
regex : "[[({]"
}, {
token : "rparen",
regex : "[\\])}]"
}, {
token : "text",
regex : "\\s+"
}
],
"comment" : [
{
token : "comment", // closing comment
regex : "\\*\\/",
next : "start"
}, {
defaultToken : "comment"
}
],
"ignoredfield" : [
{
token : "comment", // closing ignored fields / comments
regex : "\\\]",
next : "start"
}, {
defaultToken : "comment"
}
],
"directive" : [
{
token : "constant.other.multiline",
regex : /\\/
},
{
token : "constant.other.multiline",
regex : /.*\\/
},
{
token : "constant.other",
regex : "\\s*<.+?>*s",
next : "start"
},
{
token : "constant.other", // single line
regex : '\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]*s',
next : "start"
},
{
token : "constant.other", // single line
regex : "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']",
next : "start"
},
// "\" implies multiline, while "/" implies comment
{
token : "constant.other",
regex : /[^\\\/]+/,
next : "start"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
};
oop.inherits(ASLHighlightRules, TextHighlightRules);
exports.ASLHighlightRules = ASLHighlightRules;
});

File diff suppressed because one or more lines are too long

Wyświetl plik

@ -43,7 +43,7 @@ define(function(require, exports, module) {
"this|throw|then|try|typeof|super|switch|return|break|by|continue|" +
"catch|class|in|instanceof|is|isnt|if|else|extends|for|own|" +
"finally|function|while|when|new|no|not|delete|debugger|do|loop|of|off|" +
"or|on|unless|until|and|yes"
"or|on|unless|until|and|yes|yield|export|import|default"
);
var langConstant = (
@ -51,8 +51,8 @@ define(function(require, exports, module) {
);
var illegal = (
"case|const|default|function|var|void|with|enum|export|implements|" +
"interface|let|package|private|protected|public|static|yield"
"case|const|function|var|void|with|enum|implements|" +
"interface|let|package|private|protected|public|static"
);
var supportClass = (

Wyświetl plik

@ -122,9 +122,11 @@ var CsoundOrchestraHighlightRules = function() {
"MixerSetLevel",
"MixerSetLevel_i",
"OSCinit",
"OSCinitM",
"OSClisten",
"OSCraw",
"OSCsend",
"OSCsend_lo",
"S",
"STKBandedWG",
"STKBeeThree",
@ -174,6 +176,7 @@ var CsoundOrchestraHighlightRules = function() {
"atonex",
"babo",
"balance",
"balance2",
"bamboo",
"barmodel",
"bbcutm",
@ -734,6 +737,8 @@ var CsoundOrchestraHighlightRules = function() {
"lorenz",
"loscil",
"loscil3",
"loscil3phs",
"loscilphs",
"loscilx",
"lowpass2",
"lowres",
@ -1033,7 +1038,6 @@ var CsoundOrchestraHighlightRules = function() {
"pvsftw",
"pvsfwrite",
"pvsgain",
"pvsgendy",
"pvshift",
"pvsifd",
"pvsin",
@ -1271,7 +1275,6 @@ var CsoundOrchestraHighlightRules = function() {
"sockrecv",
"sockrecvs",
"socksend",
"socksend_k",
"socksends",
"sorta",
"sortd",
@ -1372,38 +1375,6 @@ var CsoundOrchestraHighlightRules = function() {
"tanh",
"taninv",
"taninv2",
"tb0",
"tb0_init",
"tb1",
"tb10",
"tb10_init",
"tb11",
"tb11_init",
"tb12",
"tb12_init",
"tb13",
"tb13_init",
"tb14",
"tb14_init",
"tb15",
"tb15_init",
"tb1_init",
"tb2",
"tb2_init",
"tb3",
"tb3_init",
"tb4",
"tb4_init",
"tb5",
"tb5_init",
"tb6",
"tb6_init",
"tb7",
"tb7_init",
"tb8",
"tb8_init",
"tb9",
"tb9_init",
"tbvcf",
"tempest",
"tempo",
@ -1589,6 +1560,10 @@ var CsoundOrchestraHighlightRules = function() {
"lentab",
"maxtab",
"mintab",
"pop",
"pop_f",
"push",
"push_f",
"scalet",
"sndload",
"soundout",
@ -1602,11 +1577,44 @@ var CsoundOrchestraHighlightRules = function() {
"specscal",
"specsum",
"spectrum",
"stack",
"sumtab",
"tabgen",
"tabmap",
"tabmap_i",
"tabslice",
"tb0",
"tb0_init",
"tb1",
"tb10",
"tb10_init",
"tb11",
"tb11_init",
"tb12",
"tb12_init",
"tb13",
"tb13_init",
"tb14",
"tb14_init",
"tb15",
"tb15_init",
"tb1_init",
"tb2",
"tb2_init",
"tb3",
"tb3_init",
"tb4",
"tb4_init",
"tb5",
"tb5_init",
"tb6",
"tb6_init",
"tb7",
"tb7_init",
"tb8",
"tb8_init",
"tb9",
"tb9_init",
"vbap16",
"vbap4",
"vbap4move",

53
plugins/node_modules/ace/lib/ace/mode/csp.js wygenerowano vendored 100644
Wyświetl plik

@ -0,0 +1,53 @@
/* ***** BEGIN LICENSE BLOCK *****
* Distributed under the BSD license:
*
* Copyright (c) 2012, Ajax.org B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Ajax.org B.V. nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ***** END LICENSE BLOCK ***** */
/*
THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
*/
define(function(require, exports, module) {
"use strict";
var TextMode = require("./text").Mode;
var CspHighlightRules = require("./csp_highlight_rules").CspHighlightRules;
var oop = require("../lib/oop");
var Mode = function() {
this.HighlightRules = CspHighlightRules;
};
oop.inherits(Mode, TextMode);
(function() {
this.$id = "ace/mode/csp";
}).call(Mode.prototype);
exports.Mode = Mode;
});

Wyświetl plik

@ -0,0 +1,70 @@
/* ***** BEGIN LICENSE BLOCK *****
* Distributed under the BSD license:
*
* Copyright (c) 2012, Ajax.org B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Ajax.org B.V. nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ***** END LICENSE BLOCK ***** */
/*
EXPLANATION
This highlight rules were created to help developer spot typos when working
with Content-Security-Policy (CSP). See:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/
*/
define(function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CspHighlightRules = function() {
var keywordMapper = this.createKeywordMapper({
"constant.language": "child-src|connect-src|default-src|font-src|frame-src|img-src|manifest-src|media-src|object-src"
+ "|script-src|style-src|worker-src|base-uri|plugin-types|sandbox|disown-opener|form-action|frame-ancestors|report-uri"
+ "|report-to|upgrade-insecure-requests|block-all-mixed-content|require-sri-for|reflected-xss|referrer|policy-uri",
"variable": "'none'|'self'|'unsafe-inline'|'unsafe-eval'|'strict-dynamic'|'unsafe-hashed-attributes'"
}, "identifier", true);
this.$rules = {
start: [{
token: "string.link",
regex: /https?:[^;\s]*/
}, {
token: "operator.punctuation",
regex: /;/
}, {
token: keywordMapper,
regex: /[^\s;]+/
}]
};
};
oop.inherits(CspHighlightRules, TextHighlightRules);
exports.CspHighlightRules = CspHighlightRules;
});

Some files were not shown because too many files have changed in this diff Show More