├── Cakefile
├── LICENSE
├── Procfile
├── README.md
├── editor
├── document.html.mu
└── index.coffee
├── package.json
├── public
├── crossdomain.xml
├── css
│ ├── _boilerplate.less
│ ├── _editor.less
│ ├── _escrito.less
│ ├── _menus.less
│ ├── _normalize.less
│ ├── _theme-escrito.less
│ ├── _tipsy.less
│ ├── _uniform.less
│ ├── elements.less
│ ├── style.css
│ └── style.less
├── favicon.ico
├── humans.txt
├── images
│ ├── logo.png
│ ├── sprite.png
│ ├── switch-bgd.png
│ ├── switch.png
│ └── toolbar-tip.png
├── js
│ ├── libs
│ │ ├── ace
│ │ │ ├── ace.js
│ │ │ ├── behaviour.js
│ │ │ ├── cockpit.js
│ │ │ ├── keybinding-emacs.js
│ │ │ ├── keybinding-vim.js
│ │ │ ├── mode-markdown.js
│ │ │ ├── mode-text.js
│ │ │ ├── mode-textile.js
│ │ │ ├── theme-escrito.js
│ │ │ └── worker-javascript.js
│ │ ├── jquery-1.4.2.min.js
│ │ └── modernizr-1.7.min.js
│ ├── plugins.js
│ └── script.js
└── robots.txt
└── web.coffee
/Cakefile:
--------------------------------------------------------------------------------
1 | # Run "cake build-dependencies && cake build"
2 |
3 | {exec} = require 'child_process'
4 |
5 | task 'build-dependencies', 'Build all coffee files from ShareJS', (options) ->
6 | exec "coffee --compile --bare --output node_modules/share/lib/ node_modules/share/src/", (err, stdout, stderr) ->
7 | throw err if err
8 | console.log stdout + stderr || 'build-dependencies done.'
9 |
10 | task 'build', 'Build the .js files', (options) ->
11 | exec "coffee -c web.coffee editor/index.coffee", (err, stdout, stderr) ->
12 | throw err if err
13 | console.log stdout + stderr || 'build done.'
14 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011 David Francisco
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/Procfile:
--------------------------------------------------------------------------------
1 | web: cake build-dependencies && cake build && node web.js
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](http://unmaintained.tech/)
2 |
3 | 
4 |
5 | ## Live preview
6 |
7 | [**escrito.herokuapp.com**](http://escrito.herokuapp.com/) (also available at the [Chrome Web Store](https://chrome.google.com/webstore/detail/gjdfjkicccgkhmifgkilkpbbbadejddb))
8 |
9 |
10 | ## Installation and Usage
11 |
12 | First make sure you have a working copy of [Node.js](http://nodejs.org/) and [npm](http://npmjs.org/)
13 | (the node package manager).
14 | To install escrito you'll need coffee.
15 |
16 | npm install -g coffee-script
17 |
18 | Check if everything went okay.
19 |
20 | coffee -v
21 |
22 | Next, run (this may take a while):
23 |
24 | npm install -g escrito
25 |
26 | Then start the server.
27 |
28 | escrito
29 |
30 | That should be enough!
31 | You can pass custom arguments:
32 |
33 | escrito --port 4567
34 |
35 | Documents are not persistent by default but you can set a custom database type.
36 | The available options are 'memory' and 'redis'. Those are the database types supported by
37 | the [ShareJS](https://github.com/josephg/ShareJS/) project.
38 |
39 | escrito --database redis
40 |
41 | For more detailed help type:
42 |
43 | escrito -h
44 |
45 |
46 | #### Local installation
47 |
48 | You can also install escrito locally. This will install it in your current directory.
49 |
50 | npm install escrito
51 |
52 | Start the server:
53 |
54 | npm start escrito
55 |
56 | To pass custom arguments using npm, you have to use a slightly different syntax.
57 | For example, to set up the server with a custom port you should do the following:
58 |
59 | npm config set escrito:port 5000
60 |
61 |
62 | #### From source
63 |
64 | You can clone the github repository.
65 |
66 | git clone git://github.com/dmfrancisco/escrito.git
67 |
68 | Install all the dependencies.
69 |
70 | cd escrito
71 | npm install
72 |
73 | Run the server:
74 |
75 | coffee web.coffee
76 |
77 | Again, you can pass custom arguments.
78 |
79 | coffee web.coffee --port 4567 --database redis
80 |
81 |
82 | #### Compiling CoffeeScripts
83 |
84 | If you want to compile the CoffeeScripts to JavaScript.
85 |
86 | cake build-dependencies
87 | cake build
88 |
89 | Run the server:
90 |
91 | node web.js
92 |
93 | ---
94 |
95 | ### This wouldn't be possible without Open Source projects like:
96 |
97 | * [NodeJS](http://nodejs.org/) - Evented I/O for V8 JavaScript
98 | * [ShareJS](https://github.com/josephg/ShareJS/) - The collaborative editing engine by Joseph Gentle
99 | * [Ace Editor](https://github.com/ajaxorg/ace/) - Textarea enriched by Mozilla
100 | * [Markdown mode](https://github.com/fivesixty/notepages/) - Support added by Chris Spencer
101 | * [Showdown](https://github.com/fivesixty/mdext/) - Markdown parser made by John Fraser
102 | * [Textile parser](https://github.com/miebach/js-textile/) - Textile parser made by Ben Daglish
103 | * [Google Caja](http://code.google.com/p/google-caja/) - HTML Sanitizer
104 |
105 | Check them all in the [humans.txt](https://github.com/dmfrancisco/escrito/blob/master/public/humans.txt) file.
106 |
--------------------------------------------------------------------------------
/editor/document.html.mu:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
80 |
81 |
84 |
85 |
86 |
89 |
90 |
109 |
110 |
--------------------------------------------------------------------------------
/editor/index.coffee:
--------------------------------------------------------------------------------
1 | fs = require 'fs'
2 | Mustache = require 'mustache'
3 |
4 | template = fs.readFileSync "#{__dirname}/document.html.mu", 'utf8'
5 |
6 | defaultContent = (name) -> """
7 | h1. This is a public document.
8 |
9 | Anyone who accesses this url can see and edit what you're writing.
10 |
11 | * Start writing by clicking the button *write* or by pressing the @Shift@ and @Tab@ keys together.
12 | * Documents are not persistent for now. If you close your browser and no one is editing or viewing this document, it will disappear.
13 |
14 |
15 |
16 | h3. This wouldn't be possible without Open Source projects like:
17 |
18 | * "NodeJS":http://nodejs.org/ - Evented I/O for V8 JavaScript
19 | * "ShareJS":https://github.com/josephg/ShareJS/ - The collaborative editing engine by Joseph Gentle
20 | * "Ace Editor":https://github.com/ajaxorg/ace/ - Textarea enriched by Mozilla
21 | * "Markdown mode":https://github.com/fivesixty/notepages/ - Support added by Chris Spencer
22 | * "Showdown":https://github.com/fivesixty/mdext/ - Markdown parser made by John Fraser
23 | * "Textile parser":https://github.com/miebach/js-textile/ - Textile parser made by Ben Daglish
24 | * "Google Caja":http://code.google.com/p/google-caja/ - HTML Sanitizer
25 | Read more in our "humans.txt":http://escrito.herokuapp.com/humans.txt file.
26 |
27 |
28 |
29 |
30 | "Fork this project":http://github.com/dmfrancisco/escrito/ _&_ "report issues":http://github.com/dmfrancisco/escrito/issues on github.
31 |
'),define("text!cockpit/ui/images/closer.png",[],"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAj9JREFUeNp0ks+LUlEUx7/vV1o8Z8wUx3IEHcQmiBiQlomjRNCiZpEuEqF/oEUwq/6EhvoHggmRcJUQBM1CRJAW0aLIaGQimZJxJsWxyV/P9/R1zzWlFl04vPvOPZ9z7rnnK5imidmKRCIq+zxgdoPZ1T/ut8xeM3tcKpW6s1hhBkaj0Qj7bDebTX+324WmadxvsVigqipcLleN/d4rFoulORiLxTZY8ItOp8MBCpYkiYPj8Xjus9vtlORWoVB4KcTjcQc732dLpSRXvCZaAws6Q4WDdqsO52kNH+oCRFGEz+f7ydwBKRgMPmTXi49GI1x2D/DsznesB06ws2eDbI7w9HYN6bVjvGss4KAjwDAMq81mM2SW5Wa/3weBbz42UL9uYnVpiO2Nr9ANHSGXib2Wgm9tCYIggGKJEVkvlwgi5/FQRmTLxO6hgJVzI1x0T/fJrBtHJxPeL6tI/fsZLA6ot8lkQi8HRVbw94gkWYI5MaHrOjcCGSNRxZosy9y5cErDzn0Dqx7gcwO8WtBp4PndI35GMYqiUMUvBL5yOBz8yRfFNpbPmqgcCFh/IuHa1nR/YXGM8+oUpFhihEQiwcdRLpfVRqOBtWXWq34Gra6AXq8Hp2piZcmKT4cKnE4nwuHwdByVSmWQz+d32WCTlHG/qaHHREN9kgi0sYQfv0R4PB4EAgESQDKXy72fSy6VSnHJVatVf71eR7vd5n66mtfrRSgU4pLLZrOlf7RKK51Ok8g3/yPyR5lMZi7y3wIMAME4EigHWgKnAAAAAElFTkSuQmCC"),define("text!cockpit/ui/images/dot_clear.gif",[],"data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAEBMgA7"),define("text!cockpit/ui/images/minus.png",[],"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAAZiS0dEANIA0gDS7KbF4AAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9kFGw4xMrIJw5EAAAHcSURBVCjPhZIxSxtxGMZ/976XhJA/RA5EAyJcFksnp64hjUPBoXRyCYLQTyD0UxScu0nFwalCQSgFCVk7dXAwUAiBDA2RO4W7yN1x9+9gcyhU+pteHt4H3pfncay1LOl0OgY4BN4Ar/7KP4BvwNFwOIyWu87S2O12O8DxfD73oygiSRIAarUaxhhWV1fHwMFgMBiWxl6v9y6Koi+3t7ckSUKtVkNVAcjzvNRWVlYwxry9vLz86uzs7HjAZDKZGGstjUaDfxHHMSLC5ubmHdB2V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10bFnIBOSi6Tl9Jgs0zbOEX18wyEwgLPMrxD1Y4aCK8kmTpgYcpAF27Mzs42Hjx4kA8BICUlJfKArR7LcEvTB1xEC9AoEw9OPagWkVU/D1oesmK6U911zEczMVe01oZjiMggg6ux2Qk379qh4rYKet4GjrhhwEteBgBrH8BssoXEtbHzPpSBRRSpqlNpgAiUoxzHKxLRszoVuggIisxaDQWZqkQvQjAoax3NbDbLLGuUEABNGedXqSyLRupXgDT5JfAGZNLio9B0X8Uiwk4w77MDc1D4yejjWtykPS3DX01UDCY/GPQcVDe0QYT0CIxGFvUorfvBxZsRfVrUuWruMBAb/lXCUofoFNZfzGJtowXOX0vwUSFK4BgyMKm6P6s9wQUZld+jrYyMDC0iIQDaJdG4IyZQfL3RfbFcCBIlRgc+u3CjaTApuZ9KsANgG8PNzHlWWD3tCxd6kafNNiFp5HAalAkkJ0SCV2H3CgOD9Nc/FqrXuyb0Eocvfhq171p5eyuJ1omKJEP5rQGe/FOOnXtq335z8YmvYo9cHb2t8spIb3lVSseZW46FlGY/Sk9P50P2w20UlWJUkUHIushfc5PXGAzCo0PlD2pnpCYfCXga3lu+fPlevEhWrVrFyrN/Orfv87FOW9tlqb2Kc9pV8DzioMk3UNUbXM+8B/ATBr8C8CKdvGXWGD/9sqm3dkxtzA4McMjHMB8D2ftheYXo+qzt3pXvz8/PP/vk+v8537V+yYW87Zu+RZ1ZbrexoKAA/SBpaWn4+aL5w5zGk+/jW59JiMkESW5urpiVlWXENRb1H/Yf2I9txIxz5IdkX3TsraukpsbQjz6090yb4XsAvQoRE0YvJdamtIIbOnRoUVlZ2ftsLVQzIdEXHntsaZdimssVfCpFui109+BnWPsXaWLI/zactygAAAAASUVORK5CYII="),define("text!cockpit/ui/images/plus.png",[],"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAAZiS0dEANIA0gDS7KbF4AAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9kFGw4yFTwuJTkAAAH7SURBVCjPdZKxa1NRFMZ/956XZMgFyyMlCZRA4hBx6lBcQ00GoYi4tEstFPwLAs7iLDi7FWuHThaUggihBDI5OWRoQAmBQFISQgvvpbwX3rsOaR4K+o2H8zvfOZxPWWtZqVarGaAJPAEe3ZW/A1+Bd+1221v1qhW4vb1dA44mk0nZ8zyCIAAgk8lgjGF9fb0PHF5cXLQTsF6vP/c879P19TVBEJDJZBARAKIoSmpra2sYY561Wq3PqtFouMBgMBgYay3ZbJZ/yfd9tNaUSqUboOKISPPq6sqsVvZ9H4AvL34B8PTj/QSO45jpdHovn883Ha31znw+JwzDpCEMQx4UloM8zyOdTif3zudztNY7jog8DMMQpRRxHPPt5TCBAEZvxlyOFTsfykRRBICIlB2t9a21Nh3HMXEc8+d7VhJHWCwWyzcohdZaHBHpO46z6fs+IsLj94XECaD4unCHL8FsNouI/HRE5Nx13c3ZbIbWOnG5HKtl+53TSq7rIiLnand31wUGnU7HjEYjlFLJZN/3yRnL1FMYY8jlcmxtbd0AFel2u7dnZ2eXxpi9xWJBEASkUimstYgIQSSkUimKxSKVSgVjzN7p6emPJHL7+/s14KjX65WHwyGz2SxZbWNjg2q12gcOT05O2n9lFeDg4MAAr/4T8rfHx8dJyH8DvvbYGzKvWukAAAAASUVORK5CYII="),define("text!cockpit/ui/images/throbber.gif",[],"data:image/gif;base64,R0lGODlh3AATAPQAAP///wAAAL6+vqamppycnLi4uLKyssjIyNjY2MTExNTU1Nzc3ODg4OTk5LCwsLy8vOjo6Ozs7MrKyvLy8vT09M7Ozvb29sbGxtDQ0O7u7tbW1sLCwqqqqvj4+KCgoJaWliH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAA3AATAAAF/yAgjmRpnmiqrmzrvnAsz3Rt33iu73zv/8CgcEgECAaEpHLJbDqf0Kh0Sq1ar9isdjoQtAQFg8PwKIMHnLF63N2438f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76E4DMPRqFTY860OGhogwYagBFoKEABA46DEGBAoEBB0AUT4sqdIFKBNbcC4M6dkEEk22oYFOTdG9fvWrtsBxM23MytYL17666t9phwXwlum2lIDHmuSA2IGyuOLOHv38qLMbdFjHruZbWgRXeOe1nC2BUEDiyAMMHZuwoTLAQX3nvDOAUW5Vogru434d4JnAsnPmFB9NBshQXfa9104+Rxl8e13rZxN+CEydtVsFkd+vDjE7C/q52wOvb4s7+faz025frbxefWbSoQIAEDEUCwgf9j7bUlwHN9ZVaegxDK1xYzFMJH24L5saXABhlYxiEzHoKoIV8LYqAMaw9aZqFmJUK4YHuNfRjiXhmk+NcyJgaIolvM8BhiBx3IleN8lH1IWAcRgkZgCgYiaBGJojGgHHFTgtagAFYSZhF7/qnTpY+faVlNAnqJN0EHWa6ozAZjBtgmmBokwMB01LW5jAZwbqfmlNips4B4eOqJgDJ2+imXRZpthuigeC6XZTWIxilXmRo8iYKBCwiWmWkJVEAkfB0w8KI1IvlIpKnOkVpqdB5+h96o8d3lFnijrgprjbfGRSt0lH0nAZG5vsprWxYRW6Suq4UWqrLEsspWg8Io6yv/q6EhK0Fw0GLbjKYn5CZYBYht1laPrnEY67kyrhYbuyceiR28Pso7bYwiXjihjWsWuWF5p/H765HmNoiur3RJsGKNG/jq748XMrwmjhwCfO6QD9v7LQsDxPTAMKsFpthyJCdkmgYiw0VdXF/Om9dyv7YMWGXTLYpZg5wNR11C78oW3p8HSGgul4qyrJppgllJHJZHn0Y0yUwDXCXUNquFZNLKyYXBAVZvxtAKYIQEsmPgDacr0tltO1y/DMwYpkgUpJfTasLGzd3cdCN3gN3UWRcY3epIEPevfq+3njBxq/kqBoGBduvea8f393zICS63ivRBTqgFpgaWZEIUULdcK+frIfAAL2AjscXqrLfu+uuwx05FF0XUbvvtuOeu++689+7778AHL/wJIQAAOwAAAAAAAAAAAA==")
--------------------------------------------------------------------------------
/public/js/libs/ace/keybinding-emacs.js:
--------------------------------------------------------------------------------
1 | define("ace/keyboard/keybinding/emacs",["require","exports","module","ace/keyboard/state_handler"],function(a,b,c){var d=a("ace/keyboard/state_handler").StateHandler,e=a("ace/keyboard/state_handler").matchCharacterOnly,f={start:[{key:"ctrl-x",then:"c-x"},{regex:["(?:command-([0-9]*))*","(down|ctrl-n)"],exec:"golinedown",params:[{name:"times",match:1,type:"number",defaultValue:1}]},{regex:["(?:command-([0-9]*))*","(right|ctrl-f)"],exec:"gotoright",params:[{name:"times",match:1,type:"number",defaultValue:1}]},{regex:["(?:command-([0-9]*))*","(up|ctrl-p)"],exec:"golineup",params:[{name:"times",match:1,type:"number",defaultValue:1}]},{regex:["(?:command-([0-9]*))*","(left|ctrl-b)"],exec:"gotoleft",params:[{name:"times",match:1,type:"number",defaultValue:1}]},{comment:"This binding matches all printable characters except numbers as long as they are no numbers and print them n times.",regex:["(?:command-([0-9]*))","([^0-9]+)*"],match:e,exec:"inserttext",params:[{name:"times",match:1,type:"number",defaultValue:"1"},{name:"text",match:2}]},{comment:"This binding matches numbers as long as there is no meta_number in the buffer.",regex:["(command-[0-9]*)*","([0-9]+)"],match:e,disallowMatches:[1],exec:"inserttext",params:[{name:"text",match:2,type:"text"}]},{regex:["command-([0-9]*)","(command-[0-9]|[0-9])"],comment:"Stops execution if the regex /meta_[0-9]+/ matches to avoid resetting the buffer."}],"c-x":[{key:"ctrl-g",then:"start"},{key:"ctrl-s",exec:"save",then:"start"}]};b.Emacs=new d(f)}),define("ace/keyboard/state_handler",["require","exports","module"],function(a,b,c){function e(a){this.keymapping=this.$buildKeymappingRegex(a)}var d=!1;e.prototype={$buildKeymappingRegex:function(a){for(state in a)this.$buildBindingsRegex(a[state]);return a},$buildBindingsRegex:function(a){a.forEach(function(a){a.key?a.key=new RegExp("^"+a.key+"$"):Array.isArray(a.regex)?(a.key=new RegExp("^"+a.regex[1]+"$"),a.regex=new RegExp(a.regex.join("")+"$")):a.regex&&(a.regex=new RegExp(a.regex+"$"))})},$composeBuffer:function(a,b,c){if(a.state==null||a.buffer==null)a.state="start",a.buffer="";var d=[];b&1&&d.push("ctrl"),b&8&&d.push("command"),b&2&&d.push("option"),b&4&&d.push("shift"),c&&d.push(c);var e=d.join("-"),f=a.buffer+e;b!=2&&(a.buffer=f);return{bufferToUse:f,symbolicName:e}},$find:function(a,b,c,e,f){var g={};this.keymapping[a.state].some(function(h){var i;if(h.key&&!h.key.test(c))return!1;if(h.regex&&!(i=h.regex.exec(b)))return!1;if(h.match&&!h.match(b,e,f,c))return!1;if(h.disallowMatches)for(var j=0;j
25 | * Mihai Sucan
26 | *
27 | * Alternatively, the contents of this file may be used under the terms of
28 | * either the GNU General Public License Version 2 or later (the "GPL"), or
29 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
30 | * in which case the provisions of the GPL or the LGPL are applicable instead
31 | * of those above. If you wish to allow use of your version of this file only
32 | * under the terms of either the GPL or the LGPL, and not to allow others to
33 | * use your version of this file under the terms of the MPL, indicate your
34 | * decision by deleting the provisions above and replace them with the notice
35 | * and other provisions required by the GPL or the LGPL. If you do not delete
36 | * the provisions above, a recipient may use your version of this file under
37 | * the terms of any one of the MPL, the GPL or the LGPL.
38 | *
39 | * ***** END LICENSE BLOCK ***** */
40 |
41 | define('ace/mode/markdown', ['require', 'exports', 'module' , 'pilot/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/markdown_highlight_rules'], function(require, exports, module) {
42 |
43 | var oop = require("pilot/oop");
44 | var TextMode = require("ace/mode/text").Mode;
45 | var Tokenizer = require("ace/tokenizer").Tokenizer;
46 | var MarkdownHighlightRules = require("ace/mode/markdown_highlight_rules").MarkdownHighlightRules;
47 |
48 | var Mode = function() {
49 | this.$tokenizer = new Tokenizer(new MarkdownHighlightRules().getRules());
50 | };
51 | oop.inherits(Mode, TextMode);
52 |
53 | (function() {
54 | this.getNextLineIndent = function(state, line, tab) {
55 | var indent = this.$getIndent(line);
56 | return indent;
57 | };
58 | }).call(Mode.prototype);
59 |
60 | exports.Mode = Mode;
61 | });
62 |
63 | /* ***** BEGIN LICENSE BLOCK *****
64 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1
65 | *
66 | * The contents of this file are subject to the Mozilla Public License Version
67 | * 1.1 (the "License"); you may not use this file except in compliance with
68 | * the License. You may obtain a copy of the License at
69 | * http://www.mozilla.org/MPL/
70 | *
71 | * Software distributed under the License is distributed on an "AS IS" basis,
72 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
73 | * for the specific language governing rights and limitations under the
74 | * License.
75 | *
76 | * The Original Code is Ajax.org Code Editor (ACE).
77 | *
78 | * The Initial Developer of the Original Code is
79 | * Ajax.org B.V.
80 | * Portions created by the Initial Developer are Copyright (C) 2010
81 | * the Initial Developer. All Rights Reserved.
82 | *
83 | * Contributor(s):
84 | * Fabian Jakobs
85 | *
86 | * Alternatively, the contents of this file may be used under the terms of
87 | * either the GNU General Public License Version 2 or later (the "GPL"), or
88 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
89 | * in which case the provisions of the GPL or the LGPL are applicable instead
90 | * of those above. If you wish to allow use of your version of this file only
91 | * under the terms of either the GPL or the LGPL, and not to allow others to
92 | * use your version of this file under the terms of the MPL, indicate your
93 | * decision by deleting the provisions above and replace them with the notice
94 | * and other provisions required by the GPL or the LGPL. If you do not delete
95 | * the provisions above, a recipient may use your version of this file under
96 | * the terms of any one of the MPL, the GPL or the LGPL.
97 | *
98 | * ***** END LICENSE BLOCK ***** */
99 |
100 | define('ace/mode/markdown_highlight_rules', ['require', 'exports', 'module', 'pilot/oop', 'ace/mode/text_highlight_rules' ], function(require, exports, module) {
101 |
102 | var oop = require("pilot/oop");
103 | var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules;
104 |
105 | var trex = function (name) {
106 | return { token: name, regex: name };
107 | }
108 |
109 | var MarkdownHighlightRules = function() {
110 |
111 | // regexp must not have capturing parentheses
112 | // regexps are ordered -> the first match is used
113 |
114 | this.$rules = {
115 | "start" : [ {
116 | token : "empty_line",
117 | regex : '^$'
118 | },
119 | /*
120 | trex("constant"),
121 | trex("keyword"),
122 | trex("string.regexp"),
123 | trex("string"),
124 | trex("comment"),
125 | trex("invalid.illegal"),
126 | trex("invalid.deprecated"),
127 | trex("support.function"),
128 | trex("support"),
129 | trex("variable"),
130 | trex("xml_pe"),
131 | trex("url"),
132 | */
133 | { // code span `
134 | token : "support.function",
135 | regex : "`[^\\r]*?[^`]`"
136 | }, { // code block
137 | token : "support.function",
138 | regex : "^[ ]{4}.+"
139 | }, { // header
140 | token : "constant",
141 | regex : "^\#{1,6}",
142 | next : "header"
143 | }, { // reference
144 | token : "text",
145 | regex : "^[ ]{0,3}\\[(?=[^\\]]+\\]:\\s*[^ ]+\\s*(?:[\"][^\"]+[\"])?\\s*$)",
146 | next : "reference"
147 | }, { // link by reference
148 | token : "text",
149 | regex : "\\[(?=(?:[[^\\]]*\\]|[^\\[\\]])*\\][ ]?(?:\\n[ ]*)?\\[(?:.*?)\\])",
150 | next : "linkref"
151 | }, { // link by url
152 | token : "text",
153 | regex : "\\[(?=(?:\\[[^\\]]*\\]|[^\\[\\]])*\\]"+
154 | "\\([ \\t]*(?:(?:[^\\(]*?\\([^\\)]*?\\)\\S*?)|(?:.*?))>?[ \t]*"+
155 | "(?:\"(.*?)\"[ \\t]*)?"+
156 | "\\))",
157 | next : "linkurl"
158 | }, { // HR *
159 | token : "constant",
160 | regex : "^[ ]{0,2}(?:[ ]?\\*[ ]?){3,}[ \\t]*$"
161 | }, { // HR -
162 | token : "constant",
163 | regex : "^[ ]{0,2}(?:[ ]?\\-[ ]?){3,}[ \\t]*$"
164 | }, { // HR _
165 | token : "constant",
166 | regex : "^[ ]{0,2}(?:[ ]?\\_[ ]?){3,}[ \\t]*$"
167 | }, { // math span
168 | token : "keyword",
169 | regex : "[\\%]{2}.+[\\%]{2}"
170 | }, { // math div
171 | token : "keyword",
172 | regex : "[\\$]{2}.+[\\$]{2}"
173 | }, { // strong **
174 | token : "string",
175 | regex : "[*]{2}(?=\\S)(?:[^\\r]*?\\S[*_]*)[*]{2}"
176 | }, { // emphasis *
177 | token : "string",
178 | regex : "[*](?=\\S)(?:[^\\r]*?\\S[*_]*)[*]"
179 | }, { // strong __
180 | token : "string",
181 | regex : "[_]{2}(?=\\S)(?:[^\\r]*?\\S[*_]*)[_]{2}"
182 | }, { // emphasis _
183 | token : "string",
184 | regex : "[_](?=\\S)(?:[^\\r]*?\\S[*_]*)[_]"
185 | }, {
186 | token : "text",
187 | regex : "[^\\*_%$`\\[#]+"
188 | } ],
189 |
190 | "linkurl" : [ {
191 | token : "string",
192 | regex : "(?:\\[[^\\]]*\\]|[^\\[\\]])+"
193 | }, {
194 | token : "text",
195 | regex : "\\]\\([ \\t]*",
196 | next : "linkurl-mid"
197 | } ],
198 | "linkurl-mid" : [ {
199 | token : "url",
200 | regex : "[^\\s\\)]+"
201 | }, {
202 | token : "string",
203 | regex : "\\s*[\"][^\"]+[\"]",
204 | next : "linkurl-end"
205 | }, {
206 | token : "text",
207 | regex : "\\s*\\)",
208 | next : "start"
209 | }, {
210 | token : "text",
211 | regex : ".",
212 | next : "start"
213 | } ],
214 | "linkurl-end" : [ {
215 | token : "text",
216 | regex : "\\s*\\)",
217 | next : "start"
218 | } ],
219 |
220 | "linkref" : [ {
221 | token : "string",
222 | regex : "[^\\]]+",
223 | next : "linkref-mid"
224 | }],
225 | "linkref-mid": [ {
226 | token : "text",
227 | regex : "\\][ ]?(?:\\n[ ]*)?\\["
228 | }, {
229 | token : "constant",
230 | regex : "[^\\]]+"
231 | }, {
232 | token : "text",
233 | regex : "\\]",
234 | next : "start"
235 | }],
236 |
237 | "header" : [ { // end of header
238 | token : "keyword",
239 | regex : ".+$",
240 | next : "start"
241 | }, {
242 | token : "text",
243 | regex : ".",
244 | next : "start"
245 | } ],
246 |
247 | "reference" : [ {
248 | token : "constant",
249 | regex : "[^\\]]+",
250 | next : "reflink"
251 | }, {
252 | token : "text",
253 | regex : ".",
254 | next : "start"
255 | } ],
256 |
257 | "reflink" : [ {
258 | token : "text",
259 | regex : "\\]:\\s*"
260 | }, {
261 | token : "url",
262 | regex : "[^ ]+$",
263 | next : "start"
264 | }, {
265 | token : "url",
266 | regex : "[^ ]+"
267 | }, {
268 | token : "string",
269 | regex : "\\s*[\"][^\"]+[\"]\\s*$",
270 | next : "start"
271 | }, {
272 | token : "text",
273 | regex : "\\s*$",
274 | next : "start"
275 | }]
276 | };
277 | };
278 | oop.inherits(MarkdownHighlightRules, TextHighlightRules);
279 |
280 | exports.MarkdownHighlightRules = MarkdownHighlightRules;
281 | });
--------------------------------------------------------------------------------
/public/js/libs/ace/mode-text.js:
--------------------------------------------------------------------------------
1 |
2 | /* vim:ts=4:sts=4:sw=4:
3 | * ***** BEGIN LICENSE BLOCK *****
4 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 | *
6 | * The contents of this file are subject to the Mozilla Public License Version
7 | * 1.1 (the "License"); you may not use this file except in compliance with
8 | * the License. You may obtain a copy of the License at
9 | * http://www.mozilla.org/MPL/
10 | *
11 | * Software distributed under the License is distributed on an "AS IS" basis,
12 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 | * for the specific language governing rights and limitations under the
14 | * License.
15 | *
16 | * The Original Code is Ajax.org Code Editor (ACE).
17 | *
18 | * The Initial Developer of the Original Code is
19 | * Ajax.org B.V.
20 | * Portions created by the Initial Developer are Copyright (C) 2010
21 | * the Initial Developer. All Rights Reserved.
22 | *
23 | * Contributor(s):
24 | * Fabian Jakobs
25 | * Mihai Sucan
26 | * Chris Spencer
27 | *
28 | * Alternatively, the contents of this file may be used under the terms of
29 | * either the GNU General Public License Version 2 or later (the "GPL"), or
30 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
31 | * in which case the provisions of the GPL or the LGPL are applicable instead
32 | * of those above. If you wish to allow use of your version of this file only
33 | * under the terms of either the GPL or the LGPL, and not to allow others to
34 | * use your version of this file under the terms of the MPL, indicate your
35 | * decision by deleting the provisions above and replace them with the notice
36 | * and other provisions required by the GPL or the LGPL. If you do not delete
37 | * the provisions above, a recipient may use your version of this file under
38 | * the terms of any one of the MPL, the GPL or the LGPL.
39 | *
40 | * ***** END LICENSE BLOCK ***** */
41 |
42 | define('ace/mode/text', ['require', 'exports', 'module' , 'pilot/oop', 'ace/tokenizer', 'ace/mode/behaviour', 'ace/mode/text_highlight_rules'],
43 | function(require, exports, module) {
44 |
45 | var Tokenizer = require("ace/tokenizer").Tokenizer;
46 | var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules;
47 | var Behaviour = require("ace/mode/behaviour").Behaviour;
48 |
49 | var Mode = function() {
50 | this.$tokenizer = new Tokenizer(new TextHighlightRules().getRules());
51 | this.$behaviour = new Behaviour();
52 | };
53 |
54 | (function() {
55 |
56 | this.getTokenizer = function() {
57 | return this.$tokenizer;
58 | };
59 |
60 | this.toggleCommentLines = function(state, doc, startRow, endRow) {
61 | };
62 |
63 | this.getNextLineIndent = function(state, line, tab) {
64 | return "";
65 | };
66 |
67 | this.checkOutdent = function(state, line, input) {
68 | return false;
69 | };
70 |
71 | this.autoOutdent = function(state, doc, row) {
72 | };
73 |
74 | this.$getIndent = function(line) {
75 | var match = line.match(/^(\s+)/);
76 | if (match) {
77 | return match[1];
78 | }
79 |
80 | return "";
81 | };
82 |
83 | this.createWorker = function(session) {
84 | return null;
85 | };
86 |
87 | this.highlightSelection = function(editor) {
88 | var session = editor.session;
89 | if (!session.$selectionOccurrences)
90 | session.$selectionOccurrences = [];
91 |
92 | if (session.$selectionOccurrences.length)
93 | this.clearSelectionHighlight(editor);
94 |
95 | var selection = editor.getSelectionRange();
96 | if (selection.isEmpty() || selection.isMultiLine())
97 | return;
98 |
99 | var startOuter = selection.start.column - 1;
100 | var endOuter = selection.end.column + 1;
101 | var line = session.getLine(selection.start.row);
102 | var lineCols = line.length;
103 | var needle = line.substring(Math.max(startOuter, 0),
104 | Math.min(endOuter, lineCols));
105 |
106 | // Make sure the outer characters are not part of the word.
107 | if ((startOuter >= 0 && /^[\w\d]/.test(needle)) ||
108 | (endOuter <= lineCols && /[\w\d]$/.test(needle)))
109 | return;
110 |
111 | needle = line.substring(selection.start.column, selection.end.column);
112 | if (!/^[\w\d]+$/.test(needle))
113 | return;
114 |
115 | var cursor = editor.getCursorPosition();
116 |
117 | var newOptions = {
118 | wrap: true,
119 | wholeWord: true,
120 | caseSensitive: true,
121 | needle: needle
122 | };
123 |
124 | var currentOptions = editor.$search.getOptions();
125 | editor.$search.set(newOptions);
126 |
127 | var ranges = editor.$search.findAll(session);
128 | ranges.forEach(function(range) {
129 | if (!range.contains(cursor.row, cursor.column)) {
130 | var marker = session.addMarker(range, "ace_selected_word");
131 | session.$selectionOccurrences.push(marker);
132 | }
133 | });
134 |
135 | editor.$search.set(currentOptions);
136 | };
137 |
138 | this.clearSelectionHighlight = function(editor) {
139 | if (!editor.session.$selectionOccurrences)
140 | return;
141 |
142 | editor.session.$selectionOccurrences.forEach(function(marker) {
143 | editor.session.removeMarker(marker);
144 | });
145 |
146 | editor.session.$selectionOccurrences = [];
147 | };
148 |
149 | this.createModeDelegates = function (mapping) {
150 | if (!this.$embeds) {
151 | return;
152 | }
153 | this.$modes = {};
154 | for (var i = 0; i < this.$embeds.length; i++) {
155 | if (mapping[this.$embeds[i]]) {
156 | this.$modes[this.$embeds[i]] = new mapping[this.$embeds[i]]();
157 | }
158 | }
159 |
160 | var delegations = ['toggleCommentLines', 'getNextLineIndent', 'checkOutdent', 'autoOutdent', 'transformAction'];
161 |
162 | for (var i = 0; i < delegations.length; i++) {
163 | (function(scope) {
164 | var functionName = delegations[i];
165 | var defaultHandler = scope[functionName];
166 | scope[delegations[i]] = function() {
167 | return this.$delegator(functionName, arguments, defaultHandler);
168 | }
169 | } (this));
170 | }
171 | }
172 |
173 | this.$delegator = function(method, args, defaultHandler) {
174 | var state = args[0];
175 |
176 | for (var i = 0; i < this.$embeds.length; i++) {
177 | if (!this.$modes[this.$embeds[i]]) continue;
178 |
179 | var split = state.split(this.$embeds[i]);
180 | if (!split[0] && split[1]) {
181 | args[0] = split[1];
182 | var mode = this.$modes[this.$embeds[i]];
183 | return mode[method].apply(mode, args);
184 | }
185 | }
186 | var ret = defaultHandler.apply(this, args);
187 | return defaultHandler ? ret : undefined;
188 | };
189 |
190 | this.transformAction = function(state, action, editor, session, param) {
191 | if (this.$behaviour) {
192 | var behaviours = this.$behaviour.getBehaviours();
193 | for (var key in behaviours) {
194 | if (behaviours[key][action]) {
195 | var ret = behaviours[key][action].apply(this, arguments);
196 | if (ret !== false) {
197 | return ret;
198 | }
199 | }
200 | }
201 | }
202 | return false;
203 | }
204 |
205 | }).call(Mode.prototype);
206 |
207 | exports.Mode = Mode;
208 | });
209 |
210 |
211 | /* ***** BEGIN LICENSE BLOCK *****
212 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1
213 | *
214 | * The contents of this file are subject to the Mozilla Public License Version
215 | * 1.1 (the "License"); you may not use this file except in compliance with
216 | * the License. You may obtain a copy of the License at
217 | * http://www.mozilla.org/MPL/
218 | *
219 | * Software distributed under the License is distributed on an "AS IS" basis,
220 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
221 | * for the specific language governing rights and limitations under the
222 | * License.
223 | *
224 | * The Original Code is Ajax.org Code Editor (ACE).
225 | *
226 | * The Initial Developer of the Original Code is
227 | * Ajax.org B.V.
228 | * Portions created by the Initial Developer are Copyright (C) 2010
229 | * the Initial Developer. All Rights Reserved.
230 | *
231 | * Contributor(s):
232 | * Fabian Jakobs
233 | *
234 | * Alternatively, the contents of this file may be used under the terms of
235 | * either the GNU General Public License Version 2 or later (the "GPL"), or
236 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
237 | * in which case the provisions of the GPL or the LGPL are applicable instead
238 | * of those above. If you wish to allow use of your version of this file only
239 | * under the terms of either the GPL or the LGPL, and not to allow others to
240 | * use your version of this file under the terms of the MPL, indicate your
241 | * decision by deleting the provisions above and replace them with the notice
242 | * and other provisions required by the GPL or the LGPL. If you do not delete
243 | * the provisions above, a recipient may use your version of this file under
244 | * the terms of any one of the MPL, the GPL or the LGPL.
245 | *
246 | * ***** END LICENSE BLOCK ***** */
247 |
248 | define('ace/mode/text_highlight_rules', ['require', 'exports', 'module', 'pilot/oop' ], function(require, exports, module) {
249 |
250 | var lang = require("pilot/lang");
251 |
252 | var TextHighlightRules = function() {
253 |
254 | // regexp must not have capturing parentheses
255 | // regexps are ordered -> the first match is used
256 |
257 | this.$rules = {
258 | "start" : [ {
259 | token : "empty_line",
260 | regex : '^$'
261 | }, {
262 | token : "text",
263 | regex : ".+"
264 | } ]
265 | };
266 | };
267 |
268 | (function() {
269 |
270 | this.addRules = function(rules, prefix) {
271 | for (var key in rules) {
272 | var state = rules[key];
273 | for (var i=0; i
24 | *
25 | * Alternatively, the contents of this file may be used under the terms of
26 | * either the GNU General Public License Version 2 or later (the "GPL"), or
27 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 | * in which case the provisions of the GPL or the LGPL are applicable instead
29 | * of those above. If you wish to allow use of your version of this file only
30 | * under the terms of either the GPL or the LGPL, and not to allow others to
31 | * use your version of this file under the terms of the MPL, indicate your
32 | * decision by deleting the provisions above and replace them with the notice
33 | * and other provisions required by the GPL or the LGPL. If you do not delete
34 | * the provisions above, a recipient may use your version of this file under
35 | * the terms of any one of the MPL, the GPL or the LGPL.
36 | *
37 | * ***** END LICENSE BLOCK ***** */
38 |
39 | define('ace/mode/textile', ['require', 'exports', 'module' , 'pilot/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/textile_highlight_rules'],
40 | function(require, exports, module) {
41 |
42 | var oop = require("pilot/oop");
43 | var TextMode = require("ace/mode/text").Mode;
44 | var Tokenizer = require("ace/tokenizer").Tokenizer;
45 | var TextileHighlightRules = require("ace/mode/textile_highlight_rules").TextileHighlightRules;
46 | var MatchingBraceOutdent = require("ace/mode/matching_brace_outdent").MatchingBraceOutdent;
47 | var Range = require("ace/range").Range;
48 |
49 | var Mode = function()
50 | {
51 | this.$tokenizer = new Tokenizer(new TextileHighlightRules().getRules());
52 | this.$outdent = new MatchingBraceOutdent();
53 | };
54 | oop.inherits(Mode, TextMode);
55 |
56 | (function()
57 | {
58 | this.getNextLineIndent = function(state, line, tab)
59 | {
60 | if (state == "intag")
61 | return tab;
62 |
63 | return "";
64 | };
65 |
66 | this.checkOutdent = function(state, line, input) {
67 | return this.$outdent.checkOutdent(line, input);
68 | };
69 |
70 | this.autoOutdent = function(state, doc, row) {
71 | this.$outdent.autoOutdent(doc, row);
72 | };
73 |
74 | }).call(Mode.prototype);
75 |
76 | exports.Mode = Mode;
77 |
78 | });
79 |
80 |
81 |
82 | /* ***** BEGIN LICENSE BLOCK *****
83 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1
84 | *
85 | * The contents of this file are subject to the Mozilla Public License Version
86 | * 1.1 (the "License"); you may not use this file except in compliance with
87 | * the License. You may obtain a copy of the License at
88 | * http://www.mozilla.org/MPL/
89 | *
90 | * Software distributed under the License is distributed on an "AS IS" basis,
91 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
92 | * for the specific language governing rights and limitations under the
93 | * License.
94 | *
95 | * The Original Code is Ajax.org Code Editor (ACE).
96 | *
97 | * The Initial Developer of the Original Code is
98 | * Ajax.org B.V.
99 | * Portions created by the Initial Developer are Copyright (C) 2010
100 | * the Initial Developer. All Rights Reserved.
101 | *
102 | * Contributor(s):
103 | * Kelley van Evert
104 | *
105 | * Alternatively, the contents of this file may be used under the terms of
106 | * either the GNU General Public License Version 2 or later (the "GPL"), or
107 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
108 | * in which case the provisions of the GPL or the LGPL are applicable instead
109 | * of those above. If you wish to allow use of your version of this file only
110 | * under the terms of either the GPL or the LGPL, and not to allow others to
111 | * use your version of this file under the terms of the MPL, indicate your
112 | * decision by deleting the provisions above and replace them with the notice
113 | * and other provisions required by the GPL or the LGPL. If you do not delete
114 | * the provisions above, a recipient may use your version of this file under
115 | * the terms of any one of the MPL, the GPL or the LGPL.
116 | *
117 | * ***** END LICENSE BLOCK ***** */
118 |
119 | define('ace/mode/textile_highlight_rules', ['require', 'exports', 'module', 'pilot/oop', 'ace/mode/text_highlight_rules' ], function(require, exports, module) {
120 | var oop = require("pilot/oop");
121 | var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules;
122 |
123 | var TextileHighlightRules = function()
124 | {
125 | /*
126 | var phraseModifiers = lang.arrayToMap(
127 | ("_|*|__|**|??|-|+|^|%|@").split("|")
128 | );
129 |
130 | var blockModifiers = lang.arrayToMap(
131 | ("h1|h2|h3|h4|h5|h6|bq|p|bc|pre").split("|")
132 | );
133 | */
134 | /*
135 | var punctuation = lang.arrayToMap(
136 | ("-|--|(tm)|(r)|(c)").split("|")
137 | );
138 | */
139 |
140 | this.$rules = {
141 | "start" : [
142 | {
143 | token : "keyword", // start of block
144 | regex : "h1|h2|h3|h4|h5|h6|bq|p|bc|pre",
145 | next : "blocktag"
146 | },
147 | {
148 | token : "keyword",
149 | regex : "[\\*]+|[#]+"
150 | },
151 | {
152 | token : "text",
153 | regex : ".+"
154 | }
155 | ],
156 | "blocktag" : [
157 | {
158 | token : "keyword",
159 | regex : "\\. ",
160 | next : "start",
161 | },
162 | {
163 | token : "keyword",
164 | regex : "\\(",
165 | next : "blocktagproperties"
166 | },
167 | ],
168 | "blocktagproperties" : [
169 | {
170 | token : "keyword",
171 | regex : "\\)",
172 | next : "blocktag"
173 | },
174 | {
175 | token : "string",
176 | regex : "[a-zA-Z0-9\\-_]+"
177 | },
178 | {
179 | token : "keyword",
180 | regex : "#"
181 | },
182 | ]
183 | };
184 | };
185 |
186 | oop.inherits(TextileHighlightRules, TextHighlightRules);
187 |
188 | exports.TextileHighlightRules = TextileHighlightRules;
189 |
190 | });
191 |
--------------------------------------------------------------------------------
/public/js/libs/ace/theme-escrito.js:
--------------------------------------------------------------------------------
1 | define("ace/theme/escrito", ["require","exports","module"], function(require, exports, module) {
2 | var dom = require("pilot/dom");
3 | var cssText = "";
4 |
5 | // import CSS once
6 | dom.importCssString(cssText);
7 |
8 | exports.cssClass = "ace-escrito";
9 | });
10 |
--------------------------------------------------------------------------------
/public/js/libs/modernizr-1.7.min.js:
--------------------------------------------------------------------------------
1 | // Modernizr v1.7 www.modernizr.com
2 | window.Modernizr=function(a,b,c){function G(){e.input=function(a){for(var b=0,c=a.length;b7)},r.history=function(){return !!(a.history&&history.pushState)},r.draganddrop=function(){return x("dragstart")&&x("drop")},r.websockets=function(){return"WebSocket"in a},r.rgba=function(){A("background-color:rgba(150,255,150,.5)");return D(k.backgroundColor,"rgba")},r.hsla=function(){A("background-color:hsla(120,40%,100%,.5)");return D(k.backgroundColor,"rgba")||D(k.backgroundColor,"hsla")},r.multiplebgs=function(){A("background:url(//:),url(//:),red url(//:)");return(new RegExp("(url\\s*\\(.*?){3}")).test(k.background)},r.backgroundsize=function(){return F("backgroundSize")},r.borderimage=function(){return F("borderImage")},r.borderradius=function(){return F("borderRadius","",function(a){return D(a,"orderRadius")})},r.boxshadow=function(){return F("boxShadow")},r.textshadow=function(){return b.createElement("div").style.textShadow===""},r.opacity=function(){B("opacity:.55");return/^0.55$/.test(k.opacity)},r.cssanimations=function(){return F("animationName")},r.csscolumns=function(){return F("columnCount")},r.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";A((a+o.join(b+a)+o.join(c+a)).slice(0,-a.length));return D(k.backgroundImage,"gradient")},r.cssreflections=function(){return F("boxReflect")},r.csstransforms=function(){return!!E(["transformProperty","WebkitTransform","MozTransform","OTransform","msTransform"])},r.csstransforms3d=function(){var a=!!E(["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"]);a&&"webkitPerspective"in g.style&&(a=w("@media ("+o.join("transform-3d),(")+"modernizr)"));return a},r.csstransitions=function(){return F("transitionProperty")},r.fontface=function(){var a,c,d=h||g,e=b.createElement("style"),f=b.implementation||{hasFeature:function(){return!1}};e.type="text/css",d.insertBefore(e,d.firstChild),a=e.sheet||e.styleSheet;var i=f.hasFeature("CSS2","")?function(b){if(!a||!b)return!1;var c=!1;try{a.insertRule(b,0),c=/src/i.test(a.cssRules[0].cssText),a.deleteRule(a.cssRules.length-1)}catch(d){}return c}:function(b){if(!a||!b)return!1;a.cssText=b;return a.cssText.length!==0&&/src/i.test(a.cssText)&&a.cssText.replace(/\r+|\n+/g,"").indexOf(b.split(" ")[0])===0};c=i('@font-face { font-family: "font"; src: url(data:,); }'),d.removeChild(e);return c},r.video=function(){var a=b.createElement("video"),c=!!a.canPlayType;if(c){c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"');var d='video/mp4; codecs="avc1.42E01E';c.h264=a.canPlayType(d+'"')||a.canPlayType(d+', mp4a.40.2"'),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"')}return c},r.audio=function(){var a=b.createElement("audio"),c=!!a.canPlayType;c&&(c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"'),c.mp3=a.canPlayType("audio/mpeg;"),c.wav=a.canPlayType('audio/wav; codecs="1"'),c.m4a=a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;"));return c},r.localstorage=function(){try{return!!localStorage.getItem}catch(a){return!1}},r.sessionstorage=function(){try{return!!sessionStorage.getItem}catch(a){return!1}},r.webWorkers=function(){return!!a.Worker},r.applicationcache=function(){return!!a.applicationCache},r.svg=function(){return!!b.createElementNS&&!!b.createElementNS(q.svg,"svg").createSVGRect},r.inlinesvg=function(){var a=b.createElement("div");a.innerHTML="";return(a.firstChild&&a.firstChild.namespaceURI)==q.svg},r.smil=function(){return!!b.createElementNS&&/SVG/.test(n.call(b.createElementNS(q.svg,"animate")))},r.svgclippaths=function(){return!!b.createElementNS&&/SVG/.test(n.call(b.createElementNS(q.svg,"clipPath")))};for(var H in r)z(r,H)&&(v=H.toLowerCase(),e[v]=r[H](),u.push((e[v]?"":"no-")+v));e.input||G(),e.crosswindowmessaging=e.postmessage,e.historymanagement=e.history,e.addTest=function(a,b){a=a.toLowerCase();if(!e[a]){b=!!b(),g.className+=" "+(b?"":"no-")+a,e[a]=b;return e}},A(""),j=l=null,f&&a.attachEvent&&function(){var a=b.createElement("div");a.innerHTML="";return a.childNodes.length!==1}()&&function(a,b){function p(a,b){var c=-1,d=a.length,e,f=[];while(++c');
161 |
162 | // Make the switch image based on starting state
163 | image = $('');
167 |
168 | // Insert into placeholder
169 | $(this).html(jQuery(container).html(jQuery(image)));
170 |
171 | $(this).mouseover(function () {
172 | $(this).css("cursor", settings.mouse_over);
173 | });
174 | $(this).mouseout(function () {
175 | $(this).css("background", settings.mouse_out);
176 | });
177 | });
178 | };
179 |
180 |
181 | /*
182 | * Escrito
183 | * -------
184 | */
185 | var escrito = function () {
186 | var strings = {
187 | // Titles
188 | "import-button-title-plain": "Import a text file from your system",
189 | "import-button-title-textile": "Import a Textile file from your system",
190 | "import-button-title-markdown": "Import a Markdown file from your system",
191 | // Menus
192 | "export-text-plain": "Text file",
193 | "export-text-textile": "Textile file",
194 | "export-text-markdown": "Markdown file"
195 | };
196 |
197 | var renderMode, // Current parser being used
198 | scrollPos = 0, // Persist scroll position of the preview mode
199 | editor,
200 | $preview,
201 | $editbox,
202 | markdownConverter;
203 |
204 | var TextMode = require("ace/mode/text").Mode,
205 | textMode = new TextMode(),
206 | TextileMode = require("ace/mode/textile").Mode,
207 | textileMode = new TextileMode(),
208 | MarkdownMode = require("ace/mode/markdown").Mode,
209 | markdownMode = new MarkdownMode();
210 |
211 | function urlX(url) { if (/^https?:\/\//.test(url)) { return url } }
212 | function idX(id) { return id }
213 |
214 | ////////////////////////////////////////////////////////////////////////////////////////////////////
215 |
216 | /* Parse written content and update the preview panel */
217 | function render(val) {
218 | // This only needs to be done when the user is in preview mode
219 | if (!$preview.is(":visible")) {
220 | return;
221 | }
222 |
223 | if (!val) {
224 | val = editor.getSession().getValue();
225 | }
226 | // Sanitize the content
227 | val = html_sanitize(val, urlX, idX);
228 |
229 | switch (renderMode) {
230 | case "plain":
231 | editor.getSession().setMode(textMode);
232 | val = val.replace(/\r\n|\r|\n/g, " "); // Newlines
233 | val = val.replace(/ /g, " "); // Whitespaces
234 | $('#paper').html("" + val);
235 | $('#import-button').attr("title", strings['import-button-title-plain']);
236 | $('#export-text').text(strings['export-text-plain']);
237 | break;
238 |
239 | case "textile":
240 | editor.getSession().setMode(textileMode);
241 | $('#paper').html(textile(val));
242 | $('#import-button').attr("title", strings['import-button-title-textile']);
243 | $('#export-text').text(strings['export-text-textile']);
244 | break;
245 |
246 | case "markdown":
247 | editor.getSession().setMode(markdownMode);
248 | $('#paper').html(markdownConverter.makeHtml(val));
249 | $('#import-button').attr("title", strings['import-button-title-markdown']);
250 | $('#export-text').text(strings['export-text-markdown']);
251 | break;
252 |
253 | case "latex":
254 | break;
255 | }
256 | }
257 |
258 | function previewOn() {
259 | // $editbox.hide();
260 | $preview.show();
261 |
262 | render(editor.getSession().getValue());
263 |
264 | // Return to saved scroll position of the preview mode
265 | $preview.attr({ scrollTop: scrollPos });
266 | $preview.focus();
267 | }
268 |
269 | function writeOn() {
270 | // Save scroll position of the preview mode
271 | scrollPos = $preview.attr('scrollTop');
272 |
273 | $preview.hide();
274 | $editbox.show();
275 | $('textarea').focus();
276 | }
277 |
278 | function languageByFilename(filename) {
279 | switch (filename.split('.').pop()) {
280 | case "txt":
281 | return "plain";
282 | case "textile":
283 | return "textile";
284 | case "markdown":
285 | case "md":
286 | return "markdown";
287 | default:
288 | return "unknown";
289 | }
290 | }
291 |
292 | function changeSelectedLanguage(lang) {
293 | $('.language').each(function () {
294 | $(this).text($(this).text().replace(' ✓', ''));
295 | });
296 |
297 | switch (lang) {
298 | case "plain":
299 | renderMode = "plain";
300 | break;
301 | case "markdown":
302 | renderMode = "markdown";
303 | break;
304 | case "textile":
305 | default:
306 | renderMode = "textile";
307 | }
308 | $("#language-"+ renderMode).append(" ✓");
309 | window.location.hash = renderMode;
310 | }
311 |
312 | /* Text file drag-and-drop */
313 | function dropFile() {
314 | // Check for File API support
315 | // if (typeof window.File === 'undefined' ||
316 | // typeof window.FileReader === 'undefined') {
317 | // alert('The File APIs are not fully supported in this browser.');
318 | // }
319 |
320 | $("#preview").bind('dragover', function () {
321 | $("#paper").addClass('hover');
322 | return false;
323 | }).bind("dragend", function () {
324 | $("#paper").removeClass('hover');
325 | return false;
326 | }).bind("drop", function (e) {
327 | $("#paper").removeClass('hover');
328 | e.stopPropagation();
329 | e.preventDefault();
330 |
331 | renderImportedFile(e.originalEvent.dataTransfer.files[0]);
332 | return false;
333 | });
334 | }
335 |
336 | /* Upload a text file (with-out drag-and-drop) */
337 | function uploadFileClientSide() {
338 | // if (typeof window.FileReader === 'undefined') {
339 | // alert('The File APIs are not fully supported in this browser.');
340 | // }
341 | var $upload = $("input:file");
342 |
343 | $upload.change(function (e) {
344 | e.stopPropagation();
345 | e.preventDefault();
346 |
347 | renderImportedFile($upload.get(0).files[0]);
348 | return false;
349 | });
350 | };
351 |
352 | function renderImportedFile(file) {
353 | var reader = new FileReader();
354 | reader.onload = function (event) {
355 | var lang = languageByFilename(file.name);
356 | if (lang === 'unknown') {
357 | return false;
358 | } else {
359 | changeSelectedLanguage(lang);
360 | }
361 | editor.getSession().setValue(event.target.result);
362 | render(event.target.result);
363 | };
364 | reader.readAsText(file);
365 | }
366 |
367 | /* Print some instructions on how to upload files in the paper sheet */
368 | function addImportInstructions() {
369 | var importMessage = "";
370 |
371 | if (typeof window.File !== 'undefined' &&
372 | typeof window.FileReader !== 'undefined' &&
373 | Modernizr.draganddrop) { /* Chrome & Firefox 4+ */
374 | importMessage = "
Drag & drop a file, " +
375 | "from your system, into this paper sheet.
Alternatively, you can also " +
376 | "upload it here: