31 |
32 |
--------------------------------------------------------------------------------
/Example/main.css:
--------------------------------------------------------------------------------
1 | html, body {
2 | background-color: #a9a9a9;
3 | margin: 0;
4 | padding: 0;
5 | }
6 |
7 | li {
8 | font-size: 12px;
9 | overflow: hidden;
10 | white-space: nowrap;
11 | text-overflow: ellipsis;
12 | width: 800px;
13 | }
14 |
15 | #wrapper {
16 | margin: 0;
17 | padding: 5px;
18 | font-size: 14px;
19 | background-color: #d3d3d3;
20 | color: black;
21 | margin: 5px;
22 | }
--------------------------------------------------------------------------------
/Example/main.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created with JetBrains WebStorm.
3 | * User: nisheeth
4 | * Date: 22/01/13
5 | * Time: 16:51
6 | * To change this template use File | Settings | File Templates.
7 | */
8 | var domReady = false;
9 |
10 | function init() {
11 |
12 | "use strict";
13 |
14 | if (domReady) {
15 | return;
16 | }
17 |
18 | domReady = true;
19 |
20 | var log = document.getElementById('log'),
21 | connectionMode = document.getElementById('ConnectionMode'),
22 | debug = document.getElementById('debug'),
23 | name = ConsoleJS.Browser.toString(),
24 | currentIndex = 0,
25 | Commands = [
26 | "console.log('log test');",
27 | "console.info('info test');",
28 | "console.warn('warn test');",
29 | "console.debug('debug test');",
30 | "console.assert(1 === 1, 'assert test');",
31 | "console.assert(1 !== 1, 'assert test');",
32 | "console.dir(document.getElementById('dummy'));",
33 | "console.dirxml(document.getElementById('dummy'));",
34 | "console.time('test');",
35 | "console.time('test-child');",
36 | "console.count('test');",
37 | "console.count('test-child');",
38 | "console.count('test-child');",
39 | "console.count('test');",
40 | "console.timeEnd('test-child');",
41 | "console.timeEnd('test');",
42 | "console.trace();",
43 | "console.error();"
44 | ],
45 | length = Commands.length;
46 |
47 | setInterval(function () {
48 | if (currentIndex < length) {
49 | eval(Commands[currentIndex++]);
50 | eval(Commands[currentIndex++]);
51 | } else {
52 | currentIndex = 0;
53 | }
54 | }, 3000);
55 |
56 | window.onerror = function (msg, url, line) {
57 | debug.innerHTML += ' Error message: ' + msg + '\nURL: ' + url + '\nLine Number: ' + line;
58 | return true;
59 | };
60 |
61 | ConsoleJS.on('console', function (data) {
62 | var connection;
63 | if (ConsoleJS.Socket) {
64 | connection = ConsoleJS.Socket.getConnectionStatus() + ' : ' + ConsoleJS.Socket.getConnectionMode();
65 | }
66 |
67 | connectionMode.innerHTML = 'Name: ' + name + ' : ' + connection;
68 | });
69 | }
70 |
71 | ConsoleJS.ready(init);
--------------------------------------------------------------------------------
/Remote/Config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created with IntelliJ IDEA.
3 | * User: nisheeth
4 | * Date: 12/02/13
5 | * Time: 19:54
6 | * To change this template use File | Settings | File Templates.
7 | */
8 |
9 | ConsoleJS.Utils.namespace("ConsoleJS.Remote.Config");
10 |
11 | ConsoleJS.Remote.Config = (function () {
12 |
13 | "use strict";
14 |
15 | var key = "ConsoleJS.config",
16 | store = ConsoleJS.Remote.Store.Local,
17 | settings = store.get(key);
18 |
19 | if (!settings) {
20 | settings = {
21 | preserveLogs: true,
22 | maxLogPreserved: 500,
23 | maxLogs: 500,
24 | cache: 1.5
25 | };
26 |
27 | settings.logCache = (settings.maxLogs * settings.cache);
28 | settings.storeCache = (settings.maxLogPreserved * settings.cache);
29 | }
30 |
31 | function set(cfg) {
32 | ConsoleJS.Utils.merge(cfg, settings);
33 | settings.logCache = (settings.maxLogs * settings.cache);
34 | settings.storeCache = (settings.maxLogPreserved * settings.cache);
35 | store.set(key, settings);
36 | }
37 |
38 | function get(name) {
39 | return settings[name] || null;
40 | }
41 |
42 | return {
43 | set: set,
44 | get: get
45 | };
46 | }());
47 |
48 |
--------------------------------------------------------------------------------
/Remote/Store.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created with IntelliJ IDEA.
3 | * User: nisheeth
4 | * Date: 12/02/13
5 | * Time: 19:54
6 | * To change this template use File | Settings | File Templates.
7 | */
8 |
9 | ConsoleJS.Utils.namespace("ConsoleJS.Remote.Store");
10 |
11 | ConsoleJS.Remote.Store = function Store(type) {
12 | var scope = this;
13 | this.storageType = (type || "").toLowerCase() === 'local' ? 'localStorage' : 'sessionStorage';
14 | this.isStorageSupported = (function isStorageSupported() {
15 | try {
16 | return scope.storageType in window && window[scope.storageType] !== null;
17 | } catch (e) {
18 | return false;
19 | }
20 | }());
21 |
22 | this.storage = this.isStorageSupported ? window[this.storageType] : {};
23 | };
24 |
25 | ConsoleJS.Remote.Store.prototype.set = function set(key, value) {
26 | if (this.isStorageSupported) {
27 | this.storage.setItem(key, JSON.stringify(value));
28 | } else {
29 | this.storage[key] = value;
30 | }
31 | };
32 |
33 | ConsoleJS.Remote.Store.prototype.append = function append(key, value) {
34 | var store = this.get(key);
35 | if (!store) {
36 | this.set(key, [value]);
37 | } else if (!ConsoleJS.Utils.isArray(store)) {
38 | this.set(key, [store, value]);
39 | } else {
40 | store.push(value);
41 | this.set(key, store);
42 | }
43 | };
44 |
45 | ConsoleJS.Remote.Store.prototype.unSet = function unSet(key) {
46 | if (this.isStorageSupported) {
47 | this.storage.removeItem(key);
48 | } else {
49 | delete this.storage[key];
50 | }
51 | };
52 |
53 | ConsoleJS.Remote.Store.prototype.get = function get(key) {
54 | if (this.isStorageSupported) {
55 | var data = this.storage.getItem(key);
56 | return data ? JSON.parse(data) : null;
57 | } else {
58 | return this.storage[key] || null;
59 | }
60 | };
61 |
62 | ConsoleJS.Remote.Store.prototype.reset = function reset() {
63 | if (this.isStorageSupported) {
64 | this.storage.clear();
65 | } else {
66 | this.storage = {};
67 | }
68 | };
69 |
70 | ConsoleJS.Remote.Store.Local = new ConsoleJS.Remote.Store('local');
71 | ConsoleJS.Remote.Store.Memory = new ConsoleJS.Remote.Store();
--------------------------------------------------------------------------------
/Remote/icons/offline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkashyap/ConsoleJS/64613aba1d3a03c16ce5cb3464fe18e18b41ba36/Remote/icons/offline.png
--------------------------------------------------------------------------------
/Remote/icons/online.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkashyap/ConsoleJS/64613aba1d3a03c16ce5cb3464fe18e18b41ba36/Remote/icons/online.png
--------------------------------------------------------------------------------
/Server/Config.js:
--------------------------------------------------------------------------------
1 | var config = {
2 | port: 8082,
3 | secure: false
4 | };
5 |
6 | module.exports = config;
7 |
8 |
--------------------------------------------------------------------------------
/Server/ConsoleClient.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created with JetBrains WebStorm.
3 | * User: nisheeth
4 | * Date: 14/01/13
5 | * Time: 15:31
6 | * To change this template use File | Settings | File Templates.
7 | */
8 |
9 | function ConsoleClient(manager, socket) {
10 | this.manager = manager;
11 | this.socket = socket;
12 | this.id = this.socket.handshake.guid || this.socket.id;
13 | this.room = null;
14 | }
15 |
16 | ConsoleClient.prototype.join = function join(room) {
17 | if (this.room) {
18 | this.leave();
19 | }
20 |
21 | this.room = room;
22 | this.room.join(this);
23 | this.subscribe(this.room.name);
24 | };
25 |
26 | ConsoleClient.prototype.leave = function leave() {
27 | if (this.room) {
28 | this.unSubscribe(this.room.name);
29 | this.room.leave(this);
30 | this.room = null;
31 | }
32 | };
33 |
34 | ConsoleClient.prototype.getTransportMode = function getTransportMode() {
35 | return this.id + ":" + this.manager.getTransportMode(this.socket);
36 | };
37 |
38 | ConsoleClient.prototype.subscribe = function subscribe(name) {
39 | this.emit('subscribed', { name: name });
40 | this.socket.join(name);
41 | };
42 |
43 | ConsoleClient.prototype.unSubscribe = function unSubscribe(name) {
44 | this.socket.leave(name);
45 | this.emit('unsubscribed', { name: name });
46 | };
47 |
48 | ConsoleClient.prototype.emit = function emit(eventName, data) {
49 | this.socket.emit(eventName, data);
50 | };
51 |
52 | ConsoleClient.prototype.broadcast = function broadcast(eventName, data, room) {
53 | this.socket.broadcast.to(room).emit(eventName, data);
54 | };
55 |
56 | ConsoleClient.prototype.remove = function remove() {
57 | this.leave();
58 | };
59 |
60 | module.exports = ConsoleClient;
--------------------------------------------------------------------------------
/Server/ControlClient.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created with JetBrains WebStorm.
3 | * User: nisheeth
4 | * Date: 14/01/13
5 | * Time: 15:31
6 | * To change this template use File | Settings | File Templates.
7 | */
8 |
9 | function ControlClient(manager, socket) {
10 | this.manager = manager;
11 | this.socket = socket;
12 | this.id = this.socket.handshake.guid || this.socket.id;
13 | this.rooms = [];
14 | }
15 |
16 | ControlClient.prototype.join = function join(room) {
17 | if (this.rooms.indexOf(room) === -1) {
18 | this.rooms.push(room);
19 | room.subscribe(this);
20 | this.subscribe(room.name);
21 | }
22 | };
23 |
24 | ControlClient.prototype.leave = function leave(room) {
25 | var index = this.rooms.indexOf(room);
26 | if (index > -1) {
27 | this.rooms.splice(index, 1);
28 | room.unSubscribe(this);
29 | this.unSubscribe(room.name);
30 | }
31 | };
32 |
33 | ControlClient.prototype.subscribe = function subscribe(name) {
34 | this.emit('subscribed', { name: name });
35 | this.socket.join(name);
36 | };
37 |
38 | ControlClient.prototype.unSubscribe = function unSubscribe(name) {
39 | this.emit('unsubscribed', { name: name });
40 | this.socket.leave(name);
41 | };
42 |
43 | ControlClient.prototype.emit = function emit(eventName, data) {
44 | this.socket.emit(eventName, data);
45 | };
46 |
47 | ControlClient.prototype.broadcast = function broadcast(eventName, data, room) {
48 | this.socket.broadcast.to(room).emit(eventName, data);
49 | };
50 |
51 | ControlClient.prototype.remove = function remove() {
52 | var self = this;
53 | this.rooms.forEach(function (room) {
54 | self.leave(room);
55 | });
56 | };
57 |
58 | module.exports = ControlClient;
--------------------------------------------------------------------------------
/Server/Guid.js:
--------------------------------------------------------------------------------
1 | var GUID = {
2 |
3 | cookieName: "guid",
4 |
5 | expiry: 365,
6 |
7 | getCookie: function getCookie(document) {
8 | if (document && document.cookie) {
9 | var i,
10 | cookieName,
11 | cookieValue,
12 | cookies = document.cookie.split(";");
13 |
14 | for (i = 0; i < cookies.length; i++) {
15 | cookieName = (cookies[i].substr(0, cookies[i].indexOf("="))).replace(/^\s+|\s+$/g, "");
16 | cookieValue = cookies[i].substr(cookies[i].indexOf("=") + 1);
17 |
18 | if (cookieName === this.cookieName) {
19 | return unescape(cookieValue);
20 | }
21 | }
22 | }
23 |
24 | return null;
25 | },
26 |
27 | generateUniqueId: function generateUniqueId() {
28 | return ((new Date().getTime()) + "-" + Math.random()).replace(".", "");
29 | },
30 |
31 | getValue: function getValue(value) {
32 | var expiryDate = new Date();
33 | expiryDate.setDate(expiryDate.getDate() + this.expiry);
34 | return this.cookieName + "=" + escape(value) + ((this.expiry === null) ? "" : "; expires=" + expiryDate.toUTCString()) + "; path=/";
35 | },
36 |
37 | set: function set(document, value) {
38 | if (!value) {
39 | value = this.get(document.headers);
40 | }
41 |
42 | value = this.getValue(value);
43 |
44 | if (document.setHeader) {
45 | document.setHeader("Set-Cookie", [value]);
46 | } else if (document.headers) {
47 | document.headers.cookie = value;
48 | }
49 | },
50 |
51 | get: function get(document) {
52 | var uniqueId = this.getCookie(document);
53 | if (!uniqueId) {
54 | uniqueId = this.generateUniqueId();
55 | }
56 | return uniqueId;
57 | },
58 |
59 | isSet: function isSet(document) {
60 | return !!this.getCookie(document);
61 | }
62 | };
63 |
64 | module.exports = GUID;
--------------------------------------------------------------------------------
/Server/Room.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created with IntelliJ IDEA.
3 | * User: Nisheeth
4 | * Date: 14/01/13
5 | * Time: 18:21
6 | * To change this template use File | Settings | File Templates.
7 | */
8 |
9 | function Room(manager, data) {
10 | this.manager = manager;
11 | this.name = data.name;
12 | this.controls = [];
13 | this.consoles = [];
14 | }
15 |
16 | Room.prototype.join = function join(client) {
17 | if (this.consoles.indexOf(client) === -1) {
18 | this.consoles.push(client);
19 | this.detectState();
20 | }
21 | };
22 |
23 | Room.prototype.leave = function leave(client) {
24 | var index = this.consoles.indexOf(client);
25 | if (index > -1) {
26 | this.consoles.splice(index, 1);
27 | this.detectState();
28 | }
29 | };
30 |
31 | Room.prototype.subscribe = function subscribe(control) {
32 | if (this.controls.indexOf(control) === -1) {
33 | this.controls.push(control);
34 | }
35 | };
36 |
37 | Room.prototype.unSubscribe = function unSubscribe(control) {
38 | var index = this.controls.indexOf(control);
39 | if (index > -1) {
40 | this.controls.splice(index, 1);
41 | }
42 | };
43 |
44 | Room.prototype.detectState = function detectState() {
45 | if (this.consoles.length > 0) {
46 | this.online();
47 | } else {
48 | this.offline();
49 | }
50 | };
51 |
52 | Room.prototype.getTransportMode = function getTransportMode() {
53 | var mode = [];
54 | this.consoles.forEach(function (item) {
55 | mode.push(item.getTransportMode());
56 | });
57 | return mode.join(",");
58 | };
59 |
60 | Room.prototype.online = function online() {
61 | this.manager.emit('online', {
62 | name: this.name,
63 | mode: this.getTransportMode()
64 | });
65 | };
66 |
67 | Room.prototype.offline = function offline() {
68 | this.manager.emit('offline', {
69 | name: this.name,
70 | mode: this.getTransportMode()
71 | });
72 | };
73 |
74 | Room.prototype.log = function log(data) {
75 | this.controls.forEach(function (control) {
76 | control.emit('console', data);
77 | });
78 | };
79 |
80 | Room.prototype.command = function command(data) {
81 | this.consoles.forEach(function (item) {
82 | item.emit('command', data);
83 | });
84 | };
85 |
86 | module.exports = Room;
--------------------------------------------------------------------------------
/Server/Start.js:
--------------------------------------------------------------------------------
1 | var config = require('./Config'),
2 | server = require('./Server');
3 |
4 | server.start(config);
--------------------------------------------------------------------------------
/certificates/certificate.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIICxzCCAjACCQDiVaBx4ufohTANBgkqhkiG9w0BAQUFADCBpzELMAkGA1UEBhMC
3 | VUsxEzARBgNVBAgMClNvbWUtU3RhdGUxDzANBgNVBAcMBkxvbmRvbjEVMBMGA1UE
4 | CgwMQmxpbmtib3ggTHRkMRMwEQYDVQQLDApUZWNobm9sb2d5MSAwHgYDVQQDDBdj
5 | b25zb2xlLnRoZWRpY3RhdG9yLmNvbTEkMCIGCSqGSIb3DQEJARYVbmlzaGVldGhA
6 | Ymxpbmtib3guY29tMB4XDTEzMDIxODExMDk0MVoXDTEzMDMyMDExMDk0MVowgacx
7 | CzAJBgNVBAYTAlVLMRMwEQYDVQQIDApTb21lLVN0YXRlMQ8wDQYDVQQHDAZMb25k
8 | b24xFTATBgNVBAoMDEJsaW5rYm94IEx0ZDETMBEGA1UECwwKVGVjaG5vbG9neTEg
9 | MB4GA1UEAwwXY29uc29sZS50aGVkaWN0YXRvci5jb20xJDAiBgkqhkiG9w0BCQEW
10 | FW5pc2hlZXRoQGJsaW5rYm94LmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkC
11 | gYEAzAx1+DWJWsh8PKR7QXsFrxolUSzg963SkDffp5aUIPw2P9e9qAWArxt+dh1M
12 | rfnMOO9ZYzEwxHv/Y5ar0nmPqoOObYtJmWHW8Y643OSs5m3HZdn3fjkNYLmH195E
13 | 1oj3DGyX71h+Csh47KDoYG8+0QQbNDXn01Fr9Ff9MKGvVjsCAwEAATANBgkqhkiG
14 | 9w0BAQUFAAOBgQCDkuc8vul43FB1RBytwFyMIhTRP1l8lkbYn3P4LMymaDzFcKFV
15 | mhMufUviT0MSG/jiDv63WuJD1lC1Xdl+pnC3q1sKW81/3T+yH/ODwENFQSicmhE3
16 | TFthLvRQM8OI1nmyw0Bgj8DWBEosQahdF8HOrKw8qj4ypj8XKysRuxaEdw==
17 | -----END CERTIFICATE-----
18 |
--------------------------------------------------------------------------------
/certificates/certrequest.csr:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE REQUEST-----
2 | MIICATCCAWoCAQAwgacxCzAJBgNVBAYTAlVLMRMwEQYDVQQIDApTb21lLVN0YXRl
3 | MQ8wDQYDVQQHDAZMb25kb24xFTATBgNVBAoMDEJsaW5rYm94IEx0ZDETMBEGA1UE
4 | CwwKVGVjaG5vbG9neTEgMB4GA1UEAwwXY29uc29sZS50aGVkaWN0YXRvci5jb20x
5 | JDAiBgkqhkiG9w0BCQEWFW5pc2hlZXRoQGJsaW5rYm94LmNvbTCBnzANBgkqhkiG
6 | 9w0BAQEFAAOBjQAwgYkCgYEAzAx1+DWJWsh8PKR7QXsFrxolUSzg963SkDffp5aU
7 | IPw2P9e9qAWArxt+dh1MrfnMOO9ZYzEwxHv/Y5ar0nmPqoOObYtJmWHW8Y643OSs
8 | 5m3HZdn3fjkNYLmH195E1oj3DGyX71h+Csh47KDoYG8+0QQbNDXn01Fr9Ff9MKGv
9 | VjsCAwEAAaAZMBcGCSqGSIb3DQEJBzEKDAhBYXJ0aTEiMzANBgkqhkiG9w0BAQUF
10 | AAOBgQCYuDrcWO3tHFJ2E399WRFbyGw/sPjYMdQINMsGDz70pqB/H98x0z+xSzmR
11 | 0eCJYxy14UJdIPrhuMixesbh8Pf69h0mFo4x7lJAkLoS/BAKbjZ/+C0UdX2I/BFY
12 | g7s0r6bOwlGCKN9m6n42YD/FKoTTGo/CP2LBFVL2Yu0Ke9QASw==
13 | -----END CERTIFICATE REQUEST-----
14 |
--------------------------------------------------------------------------------
/certificates/privatekey.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN RSA PRIVATE KEY-----
2 | MIICXwIBAAKBgQDMDHX4NYlayHw8pHtBewWvGiVRLOD3rdKQN9+nlpQg/DY/172o
3 | BYCvG352HUyt+cw471ljMTDEe/9jlqvSeY+qg45ti0mZYdbxjrjc5Kzmbcdl2fd+
4 | OQ1guYfX3kTWiPcMbJfvWH4KyHjsoOhgbz7RBBs0NefTUWv0V/0woa9WOwIDAQAB
5 | AoGBAK95G84rBAbtGGHyNQjXqciuXF8VkBWPBt/9HLn7NUG0g1adyjx/Fu3/X95l
6 | TfbjNavUsXMq7zxZQgQ7o2FqJo+6sr+9Wfg7Wdgn1bDZ3kgtqo4h5VRctArBveMP
7 | iuJzUdSqYLlRep0Up/668NYplzyWkbtSkIP8+UM2k1TCNIUpAkEA+qdvZ88EC1W6
8 | 7icD7HjT8V1Y7nt0kGP4W6uaQEjMK0TTgfp/wGc76EHqSKaWYOkxy+/ZjYaz6WAB
9 | Cd2i9YbY1QJBANBmj73qBGVaa3XU8q0tb4kSAf+Dlfv3QsHetUOevdKXWsmasG9E
10 | hh7Vtg1rfLnM3tExma0nckv7sCcEG3VO+s8CQQCFW1fWbznDnhUaZ/+abJ62p+eM
11 | 2nol6EpW23HyCck2rCOr387gWwxwgcFYbelMHkW0LyQcPDK0U7O5wAXXg6sRAkEA
12 | nrvf9KnQ21o5y7B9f4bCE8eRmguiLB8zy/NUYcMBluwODM00YivxdH8XgbVDdUok
13 | 1XZQNWF8X3+/tpgcSgf0ZQJBAL12G1zst2CjQvf2aNKUd00K2qM2DwnpyClmhdkh
14 | DY5Huppg3ADHnWIhvimV9qkNwWanxtc1l3OTKnAVT9aUn8M=
15 | -----END RSA PRIVATE KEY-----
16 |
--------------------------------------------------------------------------------
/consoleJS.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkashyap/ConsoleJS/64613aba1d3a03c16ce5cb3464fe18e18b41ba36/consoleJS.PNG
--------------------------------------------------------------------------------
/install.bat:
--------------------------------------------------------------------------------
1 | npm install socket.io
--------------------------------------------------------------------------------
/lib/bootstrap/img/glyphicons-halflings-white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkashyap/ConsoleJS/64613aba1d3a03c16ce5cb3464fe18e18b41ba36/lib/bootstrap/img/glyphicons-halflings-white.png
--------------------------------------------------------------------------------
/lib/bootstrap/img/glyphicons-halflings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nkashyap/ConsoleJS/64613aba1d3a03c16ce5cb3464fe18e18b41ba36/lib/bootstrap/img/glyphicons-halflings.png
--------------------------------------------------------------------------------
/lib/codemirror/.gitattributes:
--------------------------------------------------------------------------------
1 | *.txt text
2 | *.js text
3 | *.html text
4 | *.md text
5 | *.json text
6 | *.yml text
7 | *.css text
8 | *.svg text
9 |
--------------------------------------------------------------------------------
/lib/codemirror/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules
2 | /npm-debug.log
3 | test.html
4 | .tern-*
5 |
--------------------------------------------------------------------------------
/lib/codemirror/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - 0.8
4 |
--------------------------------------------------------------------------------
/lib/codemirror/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (C) 2013 by Marijn Haverbeke
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
21 | Please note that some subdirectories of the CodeMirror distribution
22 | include their own LICENSE files, and are released under different
23 | licences.
24 |
--------------------------------------------------------------------------------
/lib/codemirror/README.md:
--------------------------------------------------------------------------------
1 | # CodeMirror
2 | [](http://travis-ci.org/marijnh/CodeMirror)
3 | [](http://badge.fury.io/js/codemirror)
4 |
5 | CodeMirror is a JavaScript component that provides a code editor in
6 | the browser. When a mode is available for the language you are coding
7 | in, it will color your code, and optionally help with indentation.
8 |
9 | The project page is http://codemirror.net
10 | The manual is at http://codemirror.net/doc/manual.html
11 | The contributing guidelines are in [CONTRIBUTING.md](https://github.com/marijnh/CodeMirror/blob/master/CONTRIBUTING.md)
12 |
--------------------------------------------------------------------------------
/lib/codemirror/addon/dialog/dialog.css:
--------------------------------------------------------------------------------
1 | .CodeMirror-dialog {
2 | position: absolute;
3 | left: 0; right: 0;
4 | background: white;
5 | z-index: 15;
6 | padding: .1em .8em;
7 | overflow: hidden;
8 | color: #333;
9 | }
10 |
11 | .CodeMirror-dialog-top {
12 | border-bottom: 1px solid #eee;
13 | top: 0;
14 | }
15 |
16 | .CodeMirror-dialog-bottom {
17 | border-top: 1px solid #eee;
18 | bottom: 0;
19 | }
20 |
21 | .CodeMirror-dialog input {
22 | border: none;
23 | outline: none;
24 | background: transparent;
25 | width: 20em;
26 | color: inherit;
27 | font-family: monospace;
28 | }
29 |
30 | .CodeMirror-dialog button {
31 | font-size: 70%;
32 | }
33 |
--------------------------------------------------------------------------------
/lib/codemirror/addon/display/placeholder.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | CodeMirror.defineOption("placeholder", "", function(cm, val, old) {
3 | var prev = old && old != CodeMirror.Init;
4 | if (val && !prev) {
5 | cm.on("focus", onFocus);
6 | cm.on("blur", onBlur);
7 | cm.on("change", onChange);
8 | onChange(cm);
9 | } else if (!val && prev) {
10 | cm.off("focus", onFocus);
11 | cm.off("blur", onBlur);
12 | cm.off("change", onChange);
13 | clearPlaceholder(cm);
14 | var wrapper = cm.getWrapperElement();
15 | wrapper.className = wrapper.className.replace(" CodeMirror-empty", "");
16 | }
17 |
18 | if (val && !cm.hasFocus()) onBlur(cm);
19 | });
20 |
21 | function clearPlaceholder(cm) {
22 | if (cm._placeholder) {
23 | cm._placeholder.parentNode.removeChild(cm._placeholder);
24 | cm._placeholder = null;
25 | }
26 | }
27 | function setPlaceholder(cm) {
28 | clearPlaceholder(cm);
29 | var elt = cm._placeholder = document.createElement("pre");
30 | elt.style.cssText = "height: 0; overflow: visible";
31 | elt.className = "CodeMirror-placeholder";
32 | elt.appendChild(document.createTextNode(cm.getOption("placeholder")));
33 | cm.display.lineSpace.insertBefore(elt, cm.display.lineSpace.firstChild);
34 | }
35 |
36 | function onFocus(cm) {
37 | clearPlaceholder(cm);
38 | }
39 | function onBlur(cm) {
40 | if (isEmpty(cm)) setPlaceholder(cm);
41 | }
42 | function onChange(cm) {
43 | var wrapper = cm.getWrapperElement(), empty = isEmpty(cm);
44 | wrapper.className = wrapper.className.replace(" CodeMirror-empty", "") + (empty ? " CodeMirror-empty" : "");
45 |
46 | if (cm.hasFocus()) return;
47 | if (empty) setPlaceholder(cm);
48 | else clearPlaceholder(cm);
49 | }
50 |
51 | function isEmpty(cm) {
52 | return (cm.lineCount() === 1) && (cm.getLine(0) === "");
53 | }
54 | })();
55 |
--------------------------------------------------------------------------------
/lib/codemirror/addon/edit/closebrackets.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | var DEFAULT_BRACKETS = "()[]{}''\"\"";
3 | var SPACE_CHAR_REGEX = /\s/;
4 |
5 | CodeMirror.defineOption("autoCloseBrackets", false, function(cm, val, old) {
6 | var wasOn = old && old != CodeMirror.Init;
7 | if (val && !wasOn)
8 | cm.addKeyMap(buildKeymap(typeof val == "string" ? val : DEFAULT_BRACKETS));
9 | else if (!val && wasOn)
10 | cm.removeKeyMap("autoCloseBrackets");
11 | });
12 |
13 | function buildKeymap(pairs) {
14 | var map = {
15 | name : "autoCloseBrackets",
16 | Backspace: function(cm) {
17 | if (cm.somethingSelected()) return CodeMirror.Pass;
18 | var cur = cm.getCursor(), line = cm.getLine(cur.line);
19 | if (cur.ch && cur.ch < line.length &&
20 | pairs.indexOf(line.slice(cur.ch - 1, cur.ch + 1)) % 2 == 0)
21 | cm.replaceRange("", CodeMirror.Pos(cur.line, cur.ch - 1), CodeMirror.Pos(cur.line, cur.ch + 1));
22 | else
23 | return CodeMirror.Pass;
24 | }
25 | };
26 | var closingBrackets = [];
27 | for (var i = 0; i < pairs.length; i += 2) (function(left, right) {
28 | if (left != right) closingBrackets.push(right);
29 | function surround(cm) {
30 | var selection = cm.getSelection();
31 | cm.replaceSelection(left + selection + right);
32 | }
33 | function maybeOverwrite(cm) {
34 | var cur = cm.getCursor(), ahead = cm.getRange(cur, CodeMirror.Pos(cur.line, cur.ch + 1));
35 | if (ahead != right || cm.somethingSelected()) return CodeMirror.Pass;
36 | else cm.execCommand("goCharRight");
37 | }
38 | map["'" + left + "'"] = function(cm) {
39 | if (left == "'" && cm.getTokenAt(cm.getCursor()).type == "comment")
40 | return CodeMirror.Pass;
41 | if (cm.somethingSelected()) return surround(cm);
42 | if (left == right && maybeOverwrite(cm) != CodeMirror.Pass) return;
43 | var cur = cm.getCursor(), ahead = CodeMirror.Pos(cur.line, cur.ch + 1);
44 | var line = cm.getLine(cur.line), nextChar = line.charAt(cur.ch);
45 | if (line.length == cur.ch || closingBrackets.indexOf(nextChar) >= 0 || SPACE_CHAR_REGEX.test(nextChar))
46 | cm.replaceSelection(left + right, {head: ahead, anchor: ahead});
47 | else
48 | return CodeMirror.Pass;
49 | };
50 | if (left != right) map["'" + right + "'"] = maybeOverwrite;
51 | })(pairs.charAt(i), pairs.charAt(i + 1));
52 | return map;
53 | }
54 | })();
55 |
--------------------------------------------------------------------------------
/lib/codemirror/addon/edit/continuecomment.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | var modes = ["clike", "css", "javascript"];
3 | for (var i = 0; i < modes.length; ++i)
4 | CodeMirror.extendMode(modes[i], {blockCommentStart: "/*",
5 | blockCommentEnd: "*/",
6 | blockCommentContinue: " * "});
7 |
8 | function continueComment(cm) {
9 | var pos = cm.getCursor(), token = cm.getTokenAt(pos);
10 | var mode = CodeMirror.innerMode(cm.getMode(), token.state).mode;
11 | var space;
12 |
13 | if (token.type == "comment" && mode.blockCommentStart) {
14 | var end = token.string.indexOf(mode.blockCommentEnd);
15 | var full = cm.getRange(CodeMirror.Pos(pos.line, 0), CodeMirror.Pos(pos.line, token.end)), found;
16 | if (end != -1 && end == token.string.length - mode.blockCommentEnd.length) {
17 | // Comment ended, don't continue it
18 | } else if (token.string.indexOf(mode.blockCommentStart) == 0) {
19 | space = full.slice(0, token.start);
20 | if (!/^\s*$/.test(space)) {
21 | space = "";
22 | for (var i = 0; i < token.start; ++i) space += " ";
23 | }
24 | } else if ((found = full.indexOf(mode.blockCommentContinue)) != -1 &&
25 | found + mode.blockCommentContinue.length > token.start &&
26 | /^\s*$/.test(full.slice(0, found))) {
27 | space = full.slice(0, found);
28 | }
29 | }
30 |
31 | if (space != null)
32 | cm.replaceSelection("\n" + space + mode.blockCommentContinue, "end");
33 | else
34 | return CodeMirror.Pass;
35 | }
36 |
37 | CodeMirror.defineOption("continueComments", null, function(cm, val, prev) {
38 | if (prev && prev != CodeMirror.Init)
39 | cm.removeKeyMap("continueComment");
40 | var map = {name: "continueComment"};
41 | map[typeof val == "string" ? val : "Enter"] = continueComment;
42 | cm.addKeyMap(map);
43 | });
44 | })();
45 |
--------------------------------------------------------------------------------
/lib/codemirror/addon/edit/continuelist.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | 'use strict';
3 |
4 | var listRE = /^(\s*)([*+-]|(\d+)\.)(\s*)/,
5 | unorderedBullets = '*+-';
6 |
7 | CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) {
8 | var pos = cm.getCursor(),
9 | inList = cm.getStateAfter(pos.line).list,
10 | match;
11 |
12 | if (!inList || !(match = cm.getLine(pos.line).match(listRE))) {
13 | cm.execCommand('newlineAndIndent');
14 | return;
15 | }
16 |
17 | var indent = match[1], after = match[4];
18 | var bullet = unorderedBullets.indexOf(match[2]) >= 0
19 | ? match[2]
20 | : (parseInt(match[3], 10) + 1) + '.';
21 |
22 | cm.replaceSelection('\n' + indent + bullet + after, 'end');
23 | };
24 |
25 | }());
26 |
--------------------------------------------------------------------------------
/lib/codemirror/addon/fold/brace-fold.js:
--------------------------------------------------------------------------------
1 | CodeMirror.braceRangeFinder = function(cm, start) {
2 | var line = start.line, lineText = cm.getLine(line);
3 | var at = lineText.length, startChar, tokenType;
4 | for (; at > 0;) {
5 | var found = lineText.lastIndexOf("{", at);
6 | if (found < start.ch) break;
7 | tokenType = cm.getTokenAt(CodeMirror.Pos(line, found + 1)).type;
8 | if (!/^(comment|string)/.test(tokenType)) { startChar = found; break; }
9 | at = found - 1;
10 | }
11 | if (startChar == null || lineText.lastIndexOf("}") > startChar) return;
12 | var count = 1, lastLine = cm.lineCount(), end, endCh;
13 | outer: for (var i = line + 1; i < lastLine; ++i) {
14 | var text = cm.getLine(i), pos = 0;
15 | for (;;) {
16 | var nextOpen = text.indexOf("{", pos), nextClose = text.indexOf("}", pos);
17 | if (nextOpen < 0) nextOpen = text.length;
18 | if (nextClose < 0) nextClose = text.length;
19 | pos = Math.min(nextOpen, nextClose);
20 | if (pos == text.length) break;
21 | if (cm.getTokenAt(CodeMirror.Pos(i, pos + 1)).type == tokenType) {
22 | if (pos == nextOpen) ++count;
23 | else if (!--count) { end = i; endCh = pos; break outer; }
24 | }
25 | ++pos;
26 | }
27 | }
28 | if (end == null || end == line + 1) return;
29 | return {from: CodeMirror.Pos(line, startChar + 1),
30 | to: CodeMirror.Pos(end, endCh)};
31 | };
32 |
--------------------------------------------------------------------------------
/lib/codemirror/addon/fold/foldcode.js:
--------------------------------------------------------------------------------
1 | CodeMirror.newFoldFunction = function(rangeFinder, widget) {
2 | if (widget == null) widget = "\u2194";
3 | if (typeof widget == "string") {
4 | var text = document.createTextNode(widget);
5 | widget = document.createElement("span");
6 | widget.appendChild(text);
7 | widget.className = "CodeMirror-foldmarker";
8 | }
9 |
10 | return function(cm, pos) {
11 | if (typeof pos == "number") pos = CodeMirror.Pos(pos, 0);
12 | var range = rangeFinder(cm, pos);
13 | if (!range) return;
14 |
15 | var present = cm.findMarksAt(range.from), cleared = 0;
16 | for (var i = 0; i < present.length; ++i) {
17 | if (present[i].__isFold) {
18 | ++cleared;
19 | present[i].clear();
20 | }
21 | }
22 | if (cleared) return;
23 |
24 | var myWidget = widget.cloneNode(true);
25 | CodeMirror.on(myWidget, "mousedown", function() {myRange.clear();});
26 | var myRange = cm.markText(range.from, range.to, {
27 | replacedWith: myWidget,
28 | clearOnEnter: true,
29 | __isFold: true
30 | });
31 | };
32 | };
33 |
--------------------------------------------------------------------------------
/lib/codemirror/addon/fold/indent-fold.js:
--------------------------------------------------------------------------------
1 | CodeMirror.indentRangeFinder = function(cm, start) {
2 | var tabSize = cm.getOption("tabSize"), firstLine = cm.getLine(start.line);
3 | var myIndent = CodeMirror.countColumn(firstLine, null, tabSize);
4 | for (var i = start.line + 1, end = cm.lineCount(); i < end; ++i) {
5 | var curLine = cm.getLine(i);
6 | if (CodeMirror.countColumn(curLine, null, tabSize) < myIndent &&
7 | CodeMirror.countColumn(cm.getLine(i-1), null, tabSize) > myIndent)
8 | return {from: CodeMirror.Pos(start.line, firstLine.length),
9 | to: CodeMirror.Pos(i, curLine.length)};
10 | }
11 | };
12 |
--------------------------------------------------------------------------------
/lib/codemirror/addon/fold/xml-fold.js:
--------------------------------------------------------------------------------
1 | CodeMirror.tagRangeFinder = (function() {
2 | var nameStartChar = "A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
3 | var nameChar = nameStartChar + "\-\:\.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
4 | var xmlTagStart = new RegExp("<(/?)([" + nameStartChar + "][" + nameChar + "]*)", "g");
5 |
6 | return function(cm, start) {
7 | var line = start.line, ch = start.ch, lineText = cm.getLine(line);
8 |
9 | function nextLine() {
10 | if (line >= cm.lastLine()) return;
11 | ch = 0;
12 | lineText = cm.getLine(++line);
13 | return true;
14 | }
15 | function toTagEnd() {
16 | for (;;) {
17 | var gt = lineText.indexOf(">", ch);
18 | if (gt == -1) { if (nextLine()) continue; else return; }
19 | var lastSlash = lineText.lastIndexOf("/", gt);
20 | var selfClose = lastSlash > -1 && /^\s*$/.test(lineText.slice(lastSlash + 1, gt));
21 | ch = gt + 1;
22 | return selfClose ? "selfClose" : "regular";
23 | }
24 | }
25 | function toNextTag() {
26 | for (;;) {
27 | xmlTagStart.lastIndex = ch;
28 | var found = xmlTagStart.exec(lineText);
29 | if (!found) { if (nextLine()) continue; else return; }
30 | ch = found.index + found[0].length;
31 | return found;
32 | }
33 | }
34 |
35 | var stack = [], startCh;
36 | for (;;) {
37 | var openTag = toNextTag(), end;
38 | if (!openTag || line != start.line || !(end = toTagEnd())) return;
39 | if (!openTag[1] && end != "selfClose") {
40 | stack.push(openTag[2]);
41 | startCh = ch;
42 | break;
43 | }
44 | }
45 |
46 | for (;;) {
47 | var next = toNextTag(), end, tagLine = line, tagCh = ch - (next ? next[0].length : 0);
48 | if (!next || !(end = toTagEnd())) return;
49 | if (end == "selfClose") continue;
50 | if (next[1]) { // closing tag
51 | for (var i = stack.length - 1; i >= 0; --i) if (stack[i] == next[2]) {
52 | stack.length = i;
53 | break;
54 | }
55 | if (!stack.length) return {
56 | from: CodeMirror.Pos(start.line, startCh),
57 | to: CodeMirror.Pos(tagLine, tagCh)
58 | };
59 | } else { // opening tag
60 | stack.push(next[2]);
61 | }
62 | }
63 | };
64 | })();
65 |
--------------------------------------------------------------------------------
/lib/codemirror/addon/hint/show-hint.css:
--------------------------------------------------------------------------------
1 | .CodeMirror-hints {
2 | position: absolute;
3 | z-index: 10;
4 | overflow: hidden;
5 | list-style: none;
6 |
7 | margin: 0;
8 | padding: 2px;
9 |
10 | -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
11 | -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
12 | box-shadow: 2px 3px 5px rgba(0,0,0,.2);
13 | border-radius: 3px;
14 | border: 1px solid silver;
15 |
16 | background: white;
17 | font-size: 90%;
18 | font-family: monospace;
19 |
20 | max-height: 20em;
21 | overflow-y: auto;
22 | }
23 |
24 | .CodeMirror-hint {
25 | margin: 0;
26 | padding: 0 4px;
27 | border-radius: 2px;
28 | max-width: 19em;
29 | overflow: hidden;
30 | white-space: pre;
31 | color: black;
32 | cursor: pointer;
33 | }
34 |
35 | .CodeMirror-hint-active {
36 | background: #08f;
37 | color: white;
38 | }
39 |
--------------------------------------------------------------------------------
/lib/codemirror/addon/lint/json-lint.js:
--------------------------------------------------------------------------------
1 | // Depends on jsonlint.js from https://github.com/zaach/jsonlint
2 |
3 | CodeMirror.jsonValidator = function(text) {
4 | var found = [];
5 | jsonlint.parseError = function(str, hash) {
6 | var loc = hash.loc;
7 | found.push({from: CodeMirror.Pos(loc.first_line - 1, loc.first_column),
8 | to: CodeMirror.Pos(loc.last_line - 1, loc.last_column),
9 | message: str});
10 | };
11 | try { jsonlint.parse(text); }
12 | catch(e) {}
13 | return found;
14 | };
15 |
--------------------------------------------------------------------------------
/lib/codemirror/addon/mode/loadmode.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | if (!CodeMirror.modeURL) CodeMirror.modeURL = "../mode/%N/%N.js";
3 |
4 | var loading = {};
5 | function splitCallback(cont, n) {
6 | var countDown = n;
7 | return function() { if (--countDown == 0) cont(); };
8 | }
9 | function ensureDeps(mode, cont) {
10 | var deps = CodeMirror.modes[mode].dependencies;
11 | if (!deps) return cont();
12 | var missing = [];
13 | for (var i = 0; i < deps.length; ++i) {
14 | if (!CodeMirror.modes.hasOwnProperty(deps[i]))
15 | missing.push(deps[i]);
16 | }
17 | if (!missing.length) return cont();
18 | var split = splitCallback(cont, missing.length);
19 | for (var i = 0; i < missing.length; ++i)
20 | CodeMirror.requireMode(missing[i], split);
21 | }
22 |
23 | CodeMirror.requireMode = function(mode, cont) {
24 | if (typeof mode != "string") mode = mode.name;
25 | if (CodeMirror.modes.hasOwnProperty(mode)) return ensureDeps(mode, cont);
26 | if (loading.hasOwnProperty(mode)) return loading[mode].push(cont);
27 |
28 | var script = document.createElement("script");
29 | script.src = CodeMirror.modeURL.replace(/%N/g, mode);
30 | var others = document.getElementsByTagName("script")[0];
31 | others.parentNode.insertBefore(script, others);
32 | var list = loading[mode] = [cont];
33 | var count = 0, poll = setInterval(function() {
34 | if (++count > 100) return clearInterval(poll);
35 | if (CodeMirror.modes.hasOwnProperty(mode)) {
36 | clearInterval(poll);
37 | loading[mode] = null;
38 | ensureDeps(mode, function() {
39 | for (var i = 0; i < list.length; ++i) list[i]();
40 | });
41 | }
42 | }, 200);
43 | };
44 |
45 | CodeMirror.autoLoadMode = function(instance, mode) {
46 | if (!CodeMirror.modes.hasOwnProperty(mode))
47 | CodeMirror.requireMode(mode, function() {
48 | instance.setOption("mode", instance.getOption("mode"));
49 | });
50 | };
51 | }());
52 |
--------------------------------------------------------------------------------
/lib/codemirror/addon/mode/overlay.js:
--------------------------------------------------------------------------------
1 | // Utility function that allows modes to be combined. The mode given
2 | // as the base argument takes care of most of the normal mode
3 | // functionality, but a second (typically simple) mode is used, which
4 | // can override the style of text. Both modes get to parse all of the
5 | // text, but when both assign a non-null style to a piece of code, the
6 | // overlay wins, unless the combine argument was true, in which case
7 | // the styles are combined.
8 |
9 | // overlayParser is the old, deprecated name
10 | CodeMirror.overlayMode = CodeMirror.overlayParser = function(base, overlay, combine) {
11 | return {
12 | startState: function() {
13 | return {
14 | base: CodeMirror.startState(base),
15 | overlay: CodeMirror.startState(overlay),
16 | basePos: 0, baseCur: null,
17 | overlayPos: 0, overlayCur: null
18 | };
19 | },
20 | copyState: function(state) {
21 | return {
22 | base: CodeMirror.copyState(base, state.base),
23 | overlay: CodeMirror.copyState(overlay, state.overlay),
24 | basePos: state.basePos, baseCur: null,
25 | overlayPos: state.overlayPos, overlayCur: null
26 | };
27 | },
28 |
29 | token: function(stream, state) {
30 | if (stream.start == state.basePos) {
31 | state.baseCur = base.token(stream, state.base);
32 | state.basePos = stream.pos;
33 | }
34 | if (stream.start == state.overlayPos) {
35 | stream.pos = stream.start;
36 | state.overlayCur = overlay.token(stream, state.overlay);
37 | state.overlayPos = stream.pos;
38 | }
39 | stream.pos = Math.min(state.basePos, state.overlayPos);
40 | if (stream.eol()) state.basePos = state.overlayPos = 0;
41 |
42 | if (state.overlayCur == null) return state.baseCur;
43 | if (state.baseCur != null && combine) return state.baseCur + " " + state.overlayCur;
44 | else return state.overlayCur;
45 | },
46 |
47 | indent: base.indent && function(state, textAfter) {
48 | return base.indent(state.base, textAfter);
49 | },
50 | electricChars: base.electricChars,
51 |
52 | innerMode: function(state) { return {state: state.base, mode: base}; },
53 |
54 | blankLine: function(state) {
55 | if (base.blankLine) base.blankLine(state.base);
56 | if (overlay.blankLine) overlay.blankLine(state.overlay);
57 | }
58 | };
59 | };
60 |
--------------------------------------------------------------------------------
/lib/codemirror/addon/runmode/colorize.js:
--------------------------------------------------------------------------------
1 | CodeMirror.colorize = (function() {
2 |
3 | var isBlock = /^(p|li|div|h\\d|pre|blockquote|td)$/;
4 |
5 | function textContent(node, out) {
6 | if (node.nodeType == 3) return out.push(node.nodeValue);
7 | for (var ch = node.firstChild; ch; ch = ch.nextSibling) {
8 | textContent(ch, out);
9 | if (isBlock.test(node.nodeType)) out.push("\n");
10 | }
11 | }
12 |
13 | return function(collection, defaultMode) {
14 | if (!collection) collection = document.body.getElementsByTagName("pre");
15 |
16 | for (var i = 0; i < collection.length; ++i) {
17 | var node = collection[i];
18 | var mode = node.getAttribute("data-lang") || defaultMode;
19 | if (!mode) continue;
20 |
21 | var text = [];
22 | textContent(node, text);
23 | node.innerHTML = "";
24 | CodeMirror.runMode(text.join(""), mode, node);
25 |
26 | node.className += " cm-s-default";
27 | }
28 | };
29 | })();
30 |
--------------------------------------------------------------------------------
/lib/codemirror/addon/runmode/runmode.js:
--------------------------------------------------------------------------------
1 | CodeMirror.runMode = function(string, modespec, callback, options) {
2 | var mode = CodeMirror.getMode(CodeMirror.defaults, modespec);
3 |
4 | if (callback.nodeType == 1) {
5 | var tabSize = (options && options.tabSize) || CodeMirror.defaults.tabSize;
6 | var node = callback, col = 0;
7 | node.innerHTML = "";
8 | callback = function(text, style) {
9 | if (text == "\n") {
10 | node.appendChild(document.createElement("br"));
11 | col = 0;
12 | return;
13 | }
14 | var content = "";
15 | // replace tabs
16 | for (var pos = 0;;) {
17 | var idx = text.indexOf("\t", pos);
18 | if (idx == -1) {
19 | content += text.slice(pos);
20 | col += text.length - pos;
21 | break;
22 | } else {
23 | col += idx - pos;
24 | content += text.slice(pos, idx);
25 | var size = tabSize - col % tabSize;
26 | col += size;
27 | for (var i = 0; i < size; ++i) content += " ";
28 | pos = idx + 1;
29 | }
30 | }
31 |
32 | if (style) {
33 | var sp = node.appendChild(document.createElement("span"));
34 | sp.className = "cm-" + style.replace(/ +/g, " cm-");
35 | sp.appendChild(document.createTextNode(content));
36 | } else {
37 | node.appendChild(document.createTextNode(content));
38 | }
39 | };
40 | }
41 |
42 | var lines = CodeMirror.splitLines(string), state = CodeMirror.startState(mode);
43 | for (var i = 0, e = lines.length; i < e; ++i) {
44 | if (i) callback("\n");
45 | var stream = new CodeMirror.StringStream(lines[i]);
46 | while (!stream.eol()) {
47 | var style = mode.token(stream, state);
48 | callback(stream.current(), style, i, stream.start);
49 | stream.start = stream.pos;
50 | }
51 | }
52 | };
53 |
--------------------------------------------------------------------------------
/lib/codemirror/addon/search/match-highlighter.js:
--------------------------------------------------------------------------------
1 | // Highlighting text that matches the selection
2 | //
3 | // Defines an option highlightSelectionMatches, which, when enabled,
4 | // will style strings that match the selection throughout the
5 | // document.
6 | //
7 | // The option can be set to true to simply enable it, or to a
8 | // {minChars, style} object to explicitly configure it. minChars is
9 | // the minimum amount of characters that should be selected for the
10 | // behavior to occur, and style is the token style to apply to the
11 | // matches. This will be prefixed by "cm-" to create an actual CSS
12 | // class name.
13 |
14 | (function() {
15 | var DEFAULT_MIN_CHARS = 2;
16 | var DEFAULT_TOKEN_STYLE = "matchhighlight";
17 |
18 | function State(options) {
19 | this.minChars = typeof options == "object" && options.minChars || DEFAULT_MIN_CHARS;
20 | this.style = typeof options == "object" && options.style || DEFAULT_TOKEN_STYLE;
21 | this.overlay = null;
22 | }
23 |
24 | CodeMirror.defineOption("highlightSelectionMatches", false, function(cm, val, old) {
25 | var prev = old && old != CodeMirror.Init;
26 | if (val && !prev) {
27 | cm._matchHighlightState = new State(val);
28 | cm.on("cursorActivity", highlightMatches);
29 | } else if (!val && prev) {
30 | var over = cm._matchHighlightState.overlay;
31 | if (over) cm.removeOverlay(over);
32 | cm._matchHighlightState = null;
33 | cm.off("cursorActivity", highlightMatches);
34 | }
35 | });
36 |
37 | function highlightMatches(cm) {
38 | cm.operation(function() {
39 | var state = cm._matchHighlightState;
40 | if (state.overlay) {
41 | cm.removeOverlay(state.overlay);
42 | state.overlay = null;
43 | }
44 |
45 | if (!cm.somethingSelected()) return;
46 | var selection = cm.getSelection().replace(/^\s+|\s+$/g, "");
47 | if (selection.length < state.minChars) return;
48 |
49 | cm.addOverlay(state.overlay = makeOverlay(selection, state.style));
50 | });
51 | }
52 |
53 | function makeOverlay(query, style) {
54 | return {token: function(stream) {
55 | if (stream.match(query)) return style;
56 | stream.next();
57 | stream.skipTo(query.charAt(0)) || stream.skipToEnd();
58 | }};
59 | }
60 | })();
61 |
--------------------------------------------------------------------------------
/lib/codemirror/addon/selection/active-line.js:
--------------------------------------------------------------------------------
1 | // Because sometimes you need to style the cursor's line.
2 | //
3 | // Adds an option 'styleActiveLine' which, when enabled, gives the
4 | // active line's wrapping
the CSS class "CodeMirror-activeline",
5 | // and gives its background
the class "CodeMirror-activeline-background".
6 |
7 | (function() {
8 | "use strict";
9 | var WRAP_CLASS = "CodeMirror-activeline";
10 | var BACK_CLASS = "CodeMirror-activeline-background";
11 |
12 | CodeMirror.defineOption("styleActiveLine", false, function(cm, val, old) {
13 | var prev = old && old != CodeMirror.Init;
14 | if (val && !prev) {
15 | updateActiveLine(cm);
16 | cm.on("cursorActivity", updateActiveLine);
17 | } else if (!val && prev) {
18 | cm.off("cursorActivity", updateActiveLine);
19 | clearActiveLine(cm);
20 | delete cm._activeLine;
21 | }
22 | });
23 |
24 | function clearActiveLine(cm) {
25 | if ("_activeLine" in cm) {
26 | cm.removeLineClass(cm._activeLine, "wrap", WRAP_CLASS);
27 | cm.removeLineClass(cm._activeLine, "background", BACK_CLASS);
28 | }
29 | }
30 |
31 | function updateActiveLine(cm) {
32 | var line = cm.getLineHandle(cm.getCursor().line);
33 | if (cm._activeLine == line) return;
34 | clearActiveLine(cm);
35 | cm.addLineClass(line, "wrap", WRAP_CLASS);
36 | cm.addLineClass(line, "background", BACK_CLASS);
37 | cm._activeLine = line;
38 | }
39 | })();
40 |
--------------------------------------------------------------------------------
/lib/codemirror/addon/selection/mark-selection.js:
--------------------------------------------------------------------------------
1 | // Because sometimes you need to mark the selected *text*.
2 | //
3 | // Adds an option 'styleSelectedText' which, when enabled, gives
4 | // selected text the CSS class "CodeMirror-selectedtext".
5 |
6 | (function() {
7 | "use strict";
8 |
9 | CodeMirror.defineOption("styleSelectedText", false, function(cm, val, old) {
10 | var prev = old && old != CodeMirror.Init;
11 | if (val && !prev) {
12 | updateSelectedText(cm);
13 | cm.on("cursorActivity", updateSelectedText);
14 | } else if (!val && prev) {
15 | cm.off("cursorActivity", updateSelectedText);
16 | clearSelectedText(cm);
17 | delete cm._selectionMark;
18 | }
19 | });
20 |
21 | function clearSelectedText(cm) {
22 | if (cm._selectionMark) cm._selectionMark.clear();
23 | }
24 |
25 | function updateSelectedText(cm) {
26 | clearSelectedText(cm);
27 |
28 | if (cm.somethingSelected())
29 | cm._selectionMark = cm.markText(cm.getCursor("start"), cm.getCursor("end"),
30 | {className: "CodeMirror-selectedtext"});
31 | else
32 | cm._selectionMark = null;
33 | }
34 | })();
35 |
--------------------------------------------------------------------------------
/lib/codemirror/demo/changemode.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CodeMirror: Mode-Changing Demo
6 |
7 |
8 |
9 |
10 |
11 |
12 |
15 |
16 |
17 |
CodeMirror: Mode-Changing demo
18 |
19 |
26 |
27 |
On changes to the content of the above editor, a (crude) script
28 | tries to auto-detect the language used, and switches the editor to
29 | either JavaScript or Scheme mode based on that.
The emacs keybindings are enabled by
36 | including keymap/emacs.js and setting
37 | the keyMap option to "emacs". Because
38 | CodeMirror's internal API is quite different from Emacs, they are only
39 | a loose approximation of actual emacs bindings, though.
40 |
41 |
Also note that a lot of browsers disallow certain keys from being
42 | captured. For example, Chrome blocks both Ctrl-W and Ctrl-N, with the
43 | result that idiomatic use of Emacs keys will constantly close your tab
44 | or open a new window.
Demonstration of a multiplexing mode, which, at certain
52 | boundary strings, switches to one or more inner modes. The out
53 | (HTML) mode does not get fed the content of the <<
54 | >> blocks. See
55 | the manual and
56 | the source for more
57 | information.
Demonstration of a mode that parses HTML, highlighting
53 | the Mustache templating
54 | directives inside of it by using the code
55 | in overlay.js. View
56 | source to see the 15 lines of code needed to accomplish this.
The placeholder
24 | plug-in adds an option placeholder that can be set to
25 | make text appear in the editor when it is empty and not focused.
26 | If the source textarea has a placeholder attribute,
27 | it will automatically be inherited.
By setting a few CSS properties, and giving
37 | the viewportMargin
38 | a value of Infinity, CodeMirror can be made to
39 | automatically resize to fit its content.
If this is a function, it will be called for each token with
42 | two arguments, the token's text and the token's style class (may
43 | be null for unstyled tokens). If it is a DOM node,
44 | the tokens will be converted to span elements as in
45 | an editor, and inserted into the node
46 | (through innerHTML).
The vim keybindings are enabled by
43 | including keymap/vim.js and setting
44 | the keyMap option to "vim". Because
45 | CodeMirror's internal API is quite different from Vim, they are only
46 | a loose approximation of actual vim bindings, though.
So you found a problem in CodeMirror. By all means, report it! Bug
25 | reports from users are the main drive behind improvements to
26 | CodeMirror. But first, please read over these points:
27 |
28 |
29 |
CodeMirror is maintained by volunteers. They don't owe you
30 | anything, so be polite. Reports with an indignant or belligerent
31 | tone tend to be moved to the bottom of the pile.
32 |
33 |
Include information about the browser in which the
34 | problem occurred. Even if you tested several browsers, and
35 | the problem occurred in all of them, mention this fact in the bug
36 | report. Also include browser version numbers and the operating
37 | system that you're on.
38 |
39 |
Mention which release of CodeMirror you're using. Preferably,
40 | try also with the current development snapshot, to ensure the
41 | problem has not already been fixed.
42 |
43 |
Mention very precisely what went wrong. "X is broken" is not a
44 | good bug report. What did you expect to happen? What happened
45 | instead? Describe the exact steps a maintainer has to take to make
46 | the problem occur. We can not fix something that we can not
47 | observe.
48 |
49 |
If the problem can not be reproduced in any of the demos
50 | included in the CodeMirror distribution, please provide an HTML
51 | document that demonstrates the problem. The best way to do this is
52 | to go to jsbin.com, enter
53 | it there, press save, and include the resulting link in your bug
54 | report.
Simple mode that tries to handle APL as well as it can.
54 |
It attempts to label functions/operators based upon
55 | monadic/dyadic usage (but this is far from fully fleshed out).
56 | This means there are meaningful classnames so hover states can
57 | have popups etc.
74 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/lib/codemirror/mode/coffeescript/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License
2 |
3 | Copyright (c) 2011 Jeff Pickhardt
4 | Modified from the Python CodeMirror mode, Copyright (c) 2010 Timothy Farrell
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
--------------------------------------------------------------------------------
/lib/codemirror/mode/css/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CodeMirror: CSS mode
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
Handles AT&T assembler syntax (more specifically this handles
48 | the GNU Assembler (gas) syntax.)
49 | It takes a single optional configuration parameter:
50 | architecture, which can be one of "ARM",
51 | "ARMv6" or "x86".
52 | Including the parameter adds syntax for the registers and special
53 | directives for the supplied architecture.
54 |
55 |
Mode for html embedded scripts like JSP and ASP.NET. Depends on HtmlMixed which in turn depends on
44 | JavaScript, CSS and XML. Other dependancies include those of the scriping language chosen.
14 |
32 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/lib/codemirror/mode/jinja2/jinja2.js:
--------------------------------------------------------------------------------
1 | CodeMirror.defineMode("jinja2", function() {
2 | var keywords = ["block", "endblock", "for", "endfor", "in", "true", "false",
3 | "loop", "none", "self", "super", "if", "as", "not", "and",
4 | "else", "import", "with", "without", "context"];
5 | keywords = new RegExp("^((" + keywords.join(")|(") + "))\\b");
6 |
7 | function tokenBase (stream, state) {
8 | var ch = stream.next();
9 | if (ch == "{") {
10 | if (ch = stream.eat(/\{|%|#/)) {
11 | stream.eat("-");
12 | state.tokenize = inTag(ch);
13 | return "tag";
14 | }
15 | }
16 | }
17 | function inTag (close) {
18 | if (close == "{") {
19 | close = "}";
20 | }
21 | return function (stream, state) {
22 | var ch = stream.next();
23 | if ((ch == close || (ch == "-" && stream.eat(close)))
24 | && stream.eat("}")) {
25 | state.tokenize = tokenBase;
26 | return "tag";
27 | }
28 | if (stream.match(keywords)) {
29 | return "keyword";
30 | }
31 | return close == "#" ? "comment" : "string";
32 | };
33 | }
34 | return {
35 | startState: function () {
36 | return {tokenize: tokenBase};
37 | },
38 | token: function (stream, state) {
39 | return state.tokenize(stream, state);
40 | }
41 | };
42 | });
43 |
--------------------------------------------------------------------------------
/lib/codemirror/mode/livescript/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License
2 |
3 | Copyright (c) 2013 Kenneth Bentley
4 | Modified from the CoffeeScript CodeMirror mode, Copyright (c) 2011 Jeff Pickhardt
5 | Modified from the Python CodeMirror mode, Copyright (c) 2010 Timothy Farrell
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy
8 | of this software and associated documentation files (the "Software"), to deal
9 | in the Software without restriction, including without limitation the rights
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be included in
15 | all copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | THE SOFTWARE.
24 |
--------------------------------------------------------------------------------
/lib/codemirror/mode/lua/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CodeMirror: Lua mode
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
CodeMirror: Lua mode
16 |
57 |
64 |
65 |
Loosely based on Franciszek
66 | Wawrzak's CodeMirror
67 | 1 mode. One configuration parameter is
68 | supported, specials, to which you can provide an
69 | array of strings to have those identifiers highlighted with
70 | the lua-special style.
32 |
33 |
34 |
--------------------------------------------------------------------------------
/lib/codemirror/mode/pascal/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011 souceLair
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4 |
5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6 |
7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8 |
--------------------------------------------------------------------------------
/lib/codemirror/mode/pascal/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CodeMirror: Pascal mode
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
CodeMirror: Pascal mode
14 |
15 |
38 |
39 |
45 |
46 |
MIME types defined:text/x-pascal.
47 |
48 |
49 |
--------------------------------------------------------------------------------
/lib/codemirror/mode/perl/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (C) 2011 by Sabaca under the MIT license.
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/lib/codemirror/mode/perl/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CodeMirror: Perl mode
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/lib/codemirror/mode/properties/properties.js:
--------------------------------------------------------------------------------
1 | CodeMirror.defineMode("properties", function() {
2 | return {
3 | token: function(stream, state) {
4 | var sol = stream.sol() || state.afterSection;
5 | var eol = stream.eol();
6 |
7 | state.afterSection = false;
8 |
9 | if (sol) {
10 | if (state.nextMultiline) {
11 | state.inMultiline = true;
12 | state.nextMultiline = false;
13 | } else {
14 | state.position = "def";
15 | }
16 | }
17 |
18 | if (eol && ! state.nextMultiline) {
19 | state.inMultiline = false;
20 | state.position = "def";
21 | }
22 |
23 | if (sol) {
24 | while(stream.eatSpace());
25 | }
26 |
27 | var ch = stream.next();
28 |
29 | if (sol && (ch === "#" || ch === "!" || ch === ";")) {
30 | state.position = "comment";
31 | stream.skipToEnd();
32 | return "comment";
33 | } else if (sol && ch === "[") {
34 | state.afterSection = true;
35 | stream.skipTo("]"); stream.eat("]");
36 | return "header";
37 | } else if (ch === "=" || ch === ":") {
38 | state.position = "quote";
39 | return null;
40 | } else if (ch === "\\" && state.position === "quote") {
41 | if (stream.next() !== "u") { // u = Unicode sequence \u1234
42 | // Multiline value
43 | state.nextMultiline = true;
44 | }
45 | }
46 |
47 | return state.position;
48 | },
49 |
50 | startState: function() {
51 | return {
52 | position : "def", // Current position, "def", "quote" or "comment"
53 | nextMultiline : false, // Is the next line multiline value
54 | inMultiline : false, // Is the current line a multiline value
55 | afterSection : false // Did we just open a section
56 | };
57 | }
58 |
59 | };
60 | });
61 |
62 | CodeMirror.defineMIME("text/x-properties", "properties");
63 | CodeMirror.defineMIME("text/x-ini", "properties");
64 |
--------------------------------------------------------------------------------
/lib/codemirror/mode/python/LICENSE.txt:
--------------------------------------------------------------------------------
1 | The MIT License
2 |
3 | Copyright (c) 2010 Timothy Farrell
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
--------------------------------------------------------------------------------
/lib/codemirror/mode/r/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011, Ubalo, Inc.
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 | * Redistributions of source code must retain the above copyright
7 | notice, this list of conditions and the following disclaimer.
8 | * Redistributions in binary form must reproduce the above copyright
9 | notice, this list of conditions and the following disclaimer in the
10 | documentation and/or other materials provided with the distribution.
11 | * Neither the name of the Ubalo, Inc nor the names of its
12 | contributors may be used to endorse or promote products derived
13 | from this software without specific prior written permission.
14 |
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 | DISCLAIMED. IN NO EVENT SHALL UBALO, INC BE LIABLE FOR ANY
19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 |
--------------------------------------------------------------------------------
/lib/codemirror/mode/r/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CodeMirror: R mode
6 |
7 |
8 |
9 |
16 |
17 |
18 |
19 |
CodeMirror: R mode
20 |
63 |
66 |
67 |
MIME types defined:text/x-rsrc.
68 |
69 |
Development of the CodeMirror R mode was kindly sponsored
70 | by Ubalo, who hold
71 | the license.
52 |
53 |
54 |
--------------------------------------------------------------------------------
/lib/codemirror/mode/rpm/spec/spec.css:
--------------------------------------------------------------------------------
1 | .cm-s-default span.cm-preamble {color: #b26818; font-weight: bold;}
2 | .cm-s-default span.cm-macro {color: #b218b2;}
3 | .cm-s-default span.cm-section {color: green; font-weight: bold;}
4 | .cm-s-default span.cm-script {color: red;}
5 | .cm-s-default span.cm-issue {color: yellow;}
6 |
--------------------------------------------------------------------------------
/lib/codemirror/mode/rst/LICENSE.txt:
--------------------------------------------------------------------------------
1 | The MIT License
2 |
3 | Copyright (c) 2013 Hasan Karahan
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
--------------------------------------------------------------------------------
/lib/codemirror/mode/ruby/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011, Ubalo, Inc.
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 | * Redistributions of source code must retain the above copyright
7 | notice, this list of conditions and the following disclaimer.
8 | * Redistributions in binary form must reproduce the above copyright
9 | notice, this list of conditions and the following disclaimer in the
10 | documentation and/or other materials provided with the distribution.
11 | * Neither the name of the Ubalo, Inc. nor the names of its
12 | contributors may be used to endorse or promote products derived
13 | from this software without specific prior written permission.
14 |
15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 | DISCLAIMED. IN NO EVENT SHALL UBALO, INC BE LIABLE FOR ANY
19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 |
--------------------------------------------------------------------------------
/lib/codemirror/mode/rust/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CodeMirror: Rust mode
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
52 |
--------------------------------------------------------------------------------
/lib/codemirror/mode/sieve/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (C) 2012 Thomas Schmid
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/lib/codemirror/mode/sieve/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CodeMirror: Sieve (RFC5228) mode
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/lib/codemirror/mode/vb/LICENSE.txt:
--------------------------------------------------------------------------------
1 | The MIT License
2 |
3 | Copyright (c) 2012 Codility Limited, 107 Cheapside, London EC2V 6DN, UK
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/lib/codemirror/mode/vbscript/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CodeMirror: VBScript mode
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
The XML mode supports two configuration parameters:
33 |
34 |
htmlMode (boolean)
35 |
This switches the mode to parse HTML instead of XML. This
36 | means attributes do not have to be quoted, and some elements
37 | (such as br) do not require a closing tag.
38 |
alignCDATA (boolean)
39 |
Setting this to true will force the opening tag of CDATA
40 | blocks to not be indented.
41 |
42 |
43 |
MIME types defined:application/xml, text/html.
44 |
45 |
46 |
--------------------------------------------------------------------------------
/lib/codemirror/mode/xquery/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (C) 2011 by MarkLogic Corporation
2 | Author: Mike Brevoort
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in
12 | all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | THE SOFTWARE.
--------------------------------------------------------------------------------
/lib/codemirror/mode/yaml/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CodeMirror: YAML mode
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |