├── .gitignore
├── README.md
├── examples
├── Blank Example
│ ├── LICENSE
│ ├── README.md
│ ├── empty.html
│ ├── example.html
│ └── js
│ │ ├── jqconsole.js
│ │ ├── jquery.js
│ │ ├── lodash.js
│ │ ├── peg.js
│ │ ├── plt.js
│ │ └── sugar.js
├── README.md
├── TreesPlease
│ ├── js
│ │ ├── jqconsole.js
│ │ ├── jquery.js
│ │ ├── lodash.js
│ │ ├── peg.js
│ │ ├── plt.js
│ │ └── sugar.js
│ ├── treesplease.html
│ └── treesplease.js
└── whenever.js
│ ├── README.md
│ ├── example.we
│ ├── lib
│ └── grammar.txt
│ ├── package.json
│ └── whenever.js
└── slides
├── lib
└── stopwork
│ ├── compiler.rb
│ ├── css
│ ├── iconic
│ │ ├── iconic_fill.afm
│ │ ├── iconic_fill.css
│ │ ├── iconic_fill.eot
│ │ ├── iconic_fill.json
│ │ ├── iconic_fill.otf
│ │ ├── iconic_fill.svg
│ │ ├── iconic_fill.ttf
│ │ └── iconic_fill.woff
│ ├── skeleton-base.css
│ ├── style.css
│ ├── transition-fade.css
│ └── transition-slide.css
│ ├── exporter.rb
│ ├── ext.rb
│ ├── js
│ ├── jquery.js
│ └── stopwork.js
│ ├── server.rb
│ ├── slideshow.mustache
│ ├── slideshow.rb
│ ├── stopwork.rb
│ └── types
│ ├── cloudapp.rb
│ ├── hostedvideo.rb
│ ├── image.rb
│ ├── imgur.rb
│ ├── text.rb
│ ├── twitter.rb
│ ├── types.rb
│ ├── video.rb
│ └── web.rb
└── talkingtomachines.stpwrk.html
/.gitignore:
--------------------------------------------------------------------------------
1 | **/node_modules/*
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Talking to Machines (Those A**Holes)
2 |
3 | In this class, we will discuss what it means to envision speaking to machines as a special case of using language as opposed to a special case of math or magical incantations. We will explore the artistic and aesthetic possibilities of creating our own distoring languages.
4 |
5 | ### Timeline
6 | ##### Day 1: Talking to Machines, PLT Through the Ages
7 | * Discuss the history of PLT & talking to machines, including esolangs
8 | * On Distortion, Exercises in Style
9 | * Learn about parsing expression grammars
10 | * Set Up tools
11 |
12 | ##### Day 2: Making Our Own
13 | * Working alone or in teams to make a distortion language with either [PLTJS](https://github.com/nasser/pltjs) or [Ohm](https://github.com/cdglabs/ohm)
14 |
15 | ### Pre-Class Resources
16 | If you aren't familiar with basic programming concepts, particularly in Javascript, I'd recommend taking the time to do the basic [Codecademy Javascript track](https://www.codecademy.com/tracks/javascript) or the [Code School lessons](https://www.codeschool.com/paths/javascript).
17 |
18 | If you'd like to read about esolangs and just get really excited, check out: [Esoteric.codes](http://esoteric.codes/), Daniel Temkin's blog, or the [Esolangs Wiki](http://esolangs.org/wiki/Main_Page) and [Rosetta Code](http://rosettacode.org/wiki/Rosetta_Code)
19 |
20 | Programming history and background books:
21 | * [Code] (http://www.amazon.com/Code-Language-Computer-Hardware-Software/dp/0735611319/ref=sr_1_1?ie=UTF8&qid=1437497973&sr=8-1&keywords=code)
22 | * [10 PRINT CHR](http://www.amazon.com/10-PRINT-CHR-205-5-RND/dp/0262526743/ref=sr_1_1?ie=UTF8&qid=1437497981&sr=8-1&keywords=10+Print)
23 |
24 | Interesting videos:
25 | * [Future of Programming](http://worrydream.com/dbx/)
26 | * [Sketchpad](https://www.youtube.com/watch?v=USyoT_Ha_bA) [Part 2](https://www.youtube.com/watch?v=BKM3CmRqK2o)
27 | * [Mother of All Demos](https://www.youtube.com/watch?v=yJDv-zdhzMY)
28 |
29 |
--------------------------------------------------------------------------------
/examples/Blank Example/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2014 Ramsey Nasser
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.
--------------------------------------------------------------------------------
/examples/Blank Example/README.md:
--------------------------------------------------------------------------------
1 | plt.js
2 | ======
3 | A programming language design prototyping tool
4 |
5 | Overview
6 | --------
7 | plt.js is an environment for writing and testing programming language grammars. You write your language's grammar and example code in an HTMLish syntax, and plt.js will parse your code against your grammar and display the result. It will also provide you with a [REPL](http://en.wikipedia.org/wiki/REPL) interface into your language, so you can get a feel for it right away.
8 |
9 | It looks like this:
10 |
11 | ```html
12 |
(+ 5 10)
21 | (+7 13)
22 | (+ 7 13)
23 | ```
24 |
25 | Which would output
26 |
27 | ```
28 | Addition
29 |
30 | (+ 5 10)
31 | ↳ 15
32 | (+7 13)
33 | ↳ 20
34 | (+ 7 13)
35 | ↳ 20
36 | ```
37 |
38 | And if you type `(+ 12 89)` and hit enter, you should see
39 |
40 | ```
41 | > (+ 12 89)
42 | 101
43 | ```
44 |
45 | Try it. It's great fun.
46 |
47 | Usage
48 | -----
49 | 1. Download and extract [plt.js](https://github.com/nasser/pltjs/archive/master.zip)
50 | 2. Copy `example.html` to `your-language.html`
51 | 3. Open `your-language.html` in a browser
52 | 4. Replace the `` tags. plt.js will parse them and display the result
55 | 7. Write examples of incorrect syntax in `` tags. plt.js will parse them and display the result
56 | 8. Write any other HTML to annotate your examples
57 | 9. Open `your-language.html` file in a browser
58 |
59 | `plt.js` is designed to work offline. The only constraint is that your `your-language.html` file must be in the same folder as the `js/` folder where plt.js keeps its files.
60 |
61 | Name
62 | ----
63 | PLT is short for [Programming Language Theory](http://en.wikipedia.org/wiki/Programming_language_theory), the branch of computer science that deals with the design and implementation of programming languages.
64 |
65 | Acknowledgments
66 | ---------------
67 | plt.js comes out of my time as an [Eyebeam](http://eyebeam.org) Fellow exploring code as a medium of self expression. It was further developed as a teaching tool for my [programming language design class](http://itplanguages.tumblr.com/) at [NYU ITP](http://itp.nyu.edu/itp/).
68 |
69 | Legal
70 | -----
71 | Copyright © 2014 Ramsey Nasser. Released under the MIT License.
72 |
73 | [PEG.js](http://pegjs.majda.cz/) Copyright © 2010–2013 David Majda
74 |
75 | [Sugar.js](http://sugarjs.com/) Copyright © 2011 Andrew Plummer
76 |
--------------------------------------------------------------------------------
/examples/Blank Example/empty.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
15 |
16 | Language
17 |
18 |
31 |
32 |
33 |
34 | start = expr+ / str / rev
35 |
36 | rev = '~~' s:str '~~' { return s.reverse(); }
37 |
38 | str = '??' c:char+ '??' { return c.join('') }
39 | char = [a-zA-Z 0-9]
40 |
41 | expr = '(' op:operators space a:(expr/number)+ ')' space {
42 | return a.reduce(function(prev, next){
43 | return eval(prev + op + next);
44 | });
45 | }
46 |
47 | operators = '+' / '-' / '*' / '/'
48 |
49 | number = d:digit+ space { return +d.join('') }
50 | digit = [0-9]
51 | space = [ ]*
52 |
53 |
54 |
55 |
56 | Examples
57 | (+ 3 10)
58 | (+ 3 10 33)
59 | (/ (+ (+ 44 1) (- 4 5)) 21)
60 |
61 | ??cat??
62 | ??cat butt 55??
63 |
64 | ~~??cookie??~~
--------------------------------------------------------------------------------
/examples/Blank Example/example.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
15 |
16 | Numbers
17 |
18 |
34 |
35 | start = '(' '+' space a:(start / number) ' ' b:(start / number) space ')' { return a + b }
36 |
37 | number = d:digit+ { return parseInt( d.join('') ) }
38 | digit = [0123456789]
39 |
40 | space = ' '*
41 |
42 |
43 | Addition
44 | (+ 5 10)
45 | (+7 13)
46 | (+ 7 13)
47 | (+ 7 13 )
48 | (+ 7 15 )
49 |
--------------------------------------------------------------------------------
/examples/Blank Example/js/jqconsole.js:
--------------------------------------------------------------------------------
1 | (function(){var t,e,i,s,r,o,n,h,p,c,a,l,u,_,f,m,d,$,y,v,g,x,b,k,w,C,T,S,M,P,H,E,L,I,W,D,A,R=function(t,e){return function(){return t.apply(e,arguments)}},U=[].slice;t=jQuery;I=0;W=1;D=2;w=13;H=9;x=46;g=8;T=37;P=39;E=38;b=40;C=36;k=35;M=33;S=34;p="jqconsole-";r=""+p+"cursor";o=""+p+"header";c=""+p+"prompt";h=""+p+"old-prompt";n=""+p+"input";s=""+p+"blurred";y="keypress";m="";_="";f=":empty";L="\n";u=">>> ";l="... ";a=2;i=""+p+"ansi-";d="";$=/\[(\d*)(?:;(\d*))*m/;e=function(){t.prototype.COLORS=["black","red","green","yellow","blue","magenta","cyan","white"];function t(){this.stylize=R(this.stylize,this);this._closeSpan=R(this._closeSpan,this);this._openSpan=R(this._openSpan,this);this.getClasses=R(this.getClasses,this);this._style=R(this._style,this);this._color=R(this._color,this);this._remove=R(this._remove,this);this._append=R(this._append,this);this.klasses=[]}t.prototype._append=function(t){t=""+i+t;if(this.klasses.indexOf(t)===-1){return this.klasses.push(t)}};t.prototype._remove=function(){var t,e,s,r,o,n;s=1<=arguments.length?U.call(arguments,0):[];n=[];for(r=0,o=s.length;r'+t};t.prototype._closeSpan=function(t){return""+t+""};t.prototype.stylize=function(t){var e,i,s,r,o,n;t=this._openSpan(t);s=0;while((s=t.indexOf(d,s))&&s!==-1){if(i=t.slice(s).match($)){n=i.slice(1);for(r=0,o=n.length;r'+(e||"")+""};v=function(){function i(i,s,r,n){this._HideComposition=R(this._HideComposition,this);this._ShowComposition=R(this._ShowComposition,this);this._UpdateComposition=R(this._UpdateComposition,this);this._EndComposition=R(this._EndComposition,this);this._StartComposition=R(this._StartComposition,this);this._CheckComposition=R(this._CheckComposition,this);this._ProcessMatch=R(this._ProcessMatch,this);this._HandleKey=R(this._HandleKey,this);this._HandleChar=R(this._HandleChar,this);this.isMobile=!!navigator.userAgent.match(/iPhone|iPad|iPod|Android/i);this.isIos=!!navigator.userAgent.match(/iPhone|iPad|iPod/i);this.isAndroid=!!navigator.userAgent.match(/Android/i);this.$window=t(window);this.header=s||"";this.prompt_label_main=typeof r==="string"?r:u;this.prompt_label_continue=n||l;this.indent_width=a;this.state=W;this.input_queue=[];this.input_callback=null;this.multiline_callback=null;this.history=[];this.history_index=0;this.history_new="";this.history_active=false;this.shortcuts={};this.$container=t("").appendTo(i);this.$container.css({top:0,left:0,right:0,bottom:0,position:"absolute",overflow:"auto"});this.$console=t('').appendTo(this.$container);this.$console.css({margin:0,position:"relative","min-height":"100%","box-sizing":"border-box","-moz-box-sizing":"border-box","-webkit-box-sizing":"border-box"});this.$console_focused=true;this.$input_container=t(_).appendTo(this.$container);this.$input_container.css({position:"absolute",width:1,height:0,overflow:"hidden"});this.$input_source=this.isAndroid?t(""):t("");this.$input_source.attr({wrap:"off",autocapitalize:"off",autocorrect:"off",spellcheck:"false",autocomplete:"off"});this.$input_source.css({position:"absolute",width:2});this.$input_source.appendTo(this.$input_container);this.$composition=t(_);this.$composition.addClass(""+p+"composition");this.$composition.css({display:"inline",position:"relative"});this.matchings={openings:{},closings:{},clss:[]};this.ansi=new e;this._InitPrompt();this._SetupEvents();this.Write(this.header,o);t(i).data("jqconsole",this)}i.prototype.ResetHistory=function(){return this.SetHistory([])};i.prototype.ResetShortcuts=function(){return this.shortcuts={}};i.prototype.ResetMatchings=function(){return this.matchings={openings:{},closings:{},clss:[]}};i.prototype.Reset=function(){if(this.state!==W){this.ClearPromptText(true)}this.state=W;this.input_queue=[];this.input_callback=null;this.multiline_callback=null;this.ResetHistory();this.ResetShortcuts();this.ResetMatchings();this.$prompt.detach();this.$input_container.detach();this.$console.html("");this.$prompt.appendTo(this.$console);this.$input_container.appendTo(this.$container);this.Write(this.header,o);return void 0};i.prototype.GetHistory=function(){return this.history};i.prototype.SetHistory=function(t){this.history=t.slice();return this.history_index=this.history.length};i.prototype._CheckKeyCode=function(t){if(isNaN(t)){t=t.charCodeAt(0)}else{t=parseInt(t,10)}if(!(0>> "))}else{o.push(t(i).text())}}return o}().join("")};i.prototype.GetState=function(){if(this.state===I){return"input"}else if(this.state===W){return"output"}else{return"prompt"}};i.prototype.Disable=function(){this.$input_source.attr("disabled",true);return this.$input_source.blur()};i.prototype.Enable=function(){return this.$input_source.attr("disabled",false)};i.prototype.IsDisabled=function(){return Boolean(this.$input_source.attr("disabled"))};i.prototype.MoveToStart=function(t){this._MoveTo(t,true);return void 0};i.prototype.MoveToEnd=function(t){this._MoveTo(t,false);return void 0};i.prototype.Clear=function(){this.$console.find("."+o).nextUntil("."+c).addBack().text("");this.$prompt_cursor.detach();return this.$prompt_after.before(this.$prompt_cursor)};i.prototype._CheckInputQueue=function(){if(this.input_queue.length){return this.input_queue.shift()()}};i.prototype._InitPrompt=function(){this.$prompt=t(A(n)).appendTo(this.$console);this.$prompt_before=t(m).appendTo(this.$prompt);this.$prompt_current=t(m).appendTo(this.$prompt);this.$prompt_after=t(m).appendTo(this.$prompt);this.$prompt_label=t(m).appendTo(this.$prompt_current);this.$prompt_left=t(m).appendTo(this.$prompt_current);this.$prompt_right=t(m).appendTo(this.$prompt_current);this.$prompt_right.css({position:"relative"});this.$prompt_cursor=t(A(r," "));this.$prompt_cursor.insertBefore(this.$prompt_right);this.$prompt_cursor.css({color:"transparent",display:"inline",zIndex:0});if(!this.isMobile){return this.$prompt_cursor.css("position","absolute")}};i.prototype._SetupEvents=function(){var t=this;if(this.isMobile){this.$console.click(function(e){e.preventDefault();return t.Focus()})}else{this.$console.mouseup(function(e){var i;if(e.which===2){return t.Focus()}else{i=function(){if(!window.getSelection().toString()){e.preventDefault();return t.Focus()}};return setTimeout(i,0)}})}this.$input_source.focus(function(){var e,i;t._ScrollToEnd();t.$console_focused=true;t.$console.removeClass(s);i=function(){if(t.$console_focused){return t.$console.removeClass(s)}};setTimeout(i,100);e=function(){if(t.isIos&&t.$console_focused){return t.$input_source.hide()}};return setTimeout(e,500)});this.$input_source.blur(function(){var e;t.$console_focused=false;if(t.isIos){t.$input_source.show()}e=function(){if(!t.$console_focused){return t.$console.addClass(s)}};return setTimeout(e,100)});this.$input_source.bind("paste",function(){var e;e=function(){if(t.in_composition){return}t._AppendPromptText(t.$input_source.val());t.$input_source.val("");return t.Focus()};return setTimeout(e,0)});this.$input_source.keypress(this._HandleChar);this.$input_source.keydown(this._HandleKey);this.$input_source.keydown(this._CheckComposition);this.$input_source.bind("compositionstart",this._StartComposition);this.$input_source.bind("compositionend",function(e){return setTimeout(function(){return t._EndComposition(e)},0)});if(this.isAndroid){this.$input_source.bind("input",this._StartComposition);return this.$input_source.bind("input",this._UpdateComposition)}else{return this.$input_source.bind("text",this._UpdateComposition)}};i.prototype._HandleChar=function(t){var e;if(this.state===W||t.metaKey||t.ctrlKey){return true}e=t.which;if(e===8||e===9||e===13){return false}this.$prompt_left.text(this.$prompt_left.text()+String.fromCharCode(e));this._ScrollToEnd();return false};i.prototype._HandleKey=function(e){var i;if(this.state===W){return true}i=e.keyCode||e.which;setTimeout(t.proxy(this._CheckMatchings,this),0);if(e.altKey){return true}else if(e.ctrlKey||e.metaKey){return this._HandleCtrlShortcut(i)}else if(e.shiftKey){switch(i){case w:this._HandleEnter(true);break;case H:this._Unindent();break;case E:this._MoveUp();break;case b:this._MoveDown();break;case M:this._ScrollPage("up");break;case S:this._ScrollPage("down");break;default:return true}return false}else{switch(i){case w:this._HandleEnter(false);break;case H:this._Indent();break;case x:this._Delete(false);break;case g:this._Backspace(false);break;case T:this._MoveLeft(false);break;case P:this._MoveRight(false);break;case E:this._HistoryPrevious();break;case b:this._HistoryNext();break;case C:this.MoveToStart(false);break;case k:this.MoveToEnd(false);break;case M:this._ScrollPage("up");break;case S:this._ScrollPage("down");break;default:return true}return false}};i.prototype._HandleCtrlShortcut=function(t){var e,i,s,r;switch(t){case x:this._Delete(true);break;case g:this._Backspace(true);break;case T:this._MoveLeft(true);break;case P:this._MoveRight(true);break;case E:this._MoveUp();break;case b:this._MoveDown();break;case k:this.MoveToEnd(true);break;case C:this.MoveToStart(true);break;default:if(t in this.shortcuts){r=this.shortcuts[t];for(i=0,s=r.length;ih;o=0<=h?++n:--n){if(t>0){c.push(s._Indent())}else{c.push(s._Unindent())}}return c}else{r=s.state===I?"input":"prompt";s.Write(s.GetPromptText(true)+L,""+p+"old-"+r);s.ClearPromptText(true);if(s.history_active){if(!s.history.length||s.history[s.history.length-1]!==i){s.history.push(i)}s.history_index=s.history.length}s.state=W;e=s.input_callback;s.input_callback=null;if(e){e(i)}return s._CheckInputQueue()}};if(this.multiline_callback){if(this.async_multiline){return this.multiline_callback(i,e)}else{return e(this.multiline_callback(i))}}else{return e(false)}}};i.prototype._GetDirectionals=function(e){var i,s,r,o,n,h,p,c;o=e?this.$prompt_left:this.$prompt_right;i=e?this.$prompt_right:this.$prompt_left;r=e?this.$prompt_before:this.$prompt_after;s=e?this.$prompt_after:this.$prompt_before;h=e?t.proxy(this.MoveToStart,this):t.proxy(this.MoveToEnd,this);n=e?t.proxy(this._MoveLeft,this):t.proxy(this._MoveRight,this);c=e?"last":"first";p=e?"prependTo":"appendTo";return{$prompt_which:o,$prompt_opposite:i,$prompt_relative:r,$prompt_rel_opposite:s,MoveToLimit:h,MoveDirection:n,which_end:c,where_append:p}};i.prototype._VerticalMove=function(t){var e,i,s,r,o,n,h,p;p=this._GetDirectionals(t),s=p.$prompt_which,e=p.$prompt_opposite,i=p.$prompt_relative,o=p.MoveToLimit,r=p.MoveDirection;if(i.is(f)){return}n=this.$prompt_left.text().length;o();r();h=s.text();e.text(t?h.slice(n):h.slice(0,n));return s.text(t?h.slice(0,n):h.slice(n))};i.prototype._MoveUp=function(){return this._VerticalMove(true)};i.prototype._MoveDown=function(){return this._VerticalMove()};i.prototype._HorizontalMove=function(e,i){var s,r,o,n,h,p,c,a,l,u,_,d,$,y;y=this._GetDirectionals(i),h=y.$prompt_which,r=y.$prompt_opposite,n=y.$prompt_relative,o=y.$prompt_rel_opposite,d=y.which_end,_=y.where_append;a=i?/\w*\W*$/:/^\w*\W*/;l=h.text();if(l){if(e){$=l.match(a);if(!$){return}$=$[0];u=r.text();r.text(i?$+u:u+$);c=$.length;return h.text(i?l.slice(0,-c):l.slice(c))}else{u=r.text();r.text(i?l.slice(-1)+u:u+l[0]);return h.text(i?l.slice(0,-1):l.slice(1))}}else if(!n.is(f)){p=t(m)[_](o);p.append(t(m).text(this.$prompt_label.text()));p.append(t(m).text(r.text()));s=n.children()[d]().detach();this.$prompt_label.text(s.children().first().text());h.text(s.children().last().text());return r.text("")}};i.prototype._MoveLeft=function(t){return this._HorizontalMove(t,true)};i.prototype._MoveRight=function(t){return this._HorizontalMove(t)};i.prototype._MoveTo=function(t,e){var i,s,r,o,n,h,p;h=this._GetDirectionals(e),r=h.$prompt_which,i=h.$prompt_opposite,s=h.$prompt_relative,n=h.MoveToLimit,o=h.MoveDirection;if(t){p=[];while(!(s.is(f)&&r.text()==="")){n(false);p.push(o(false))}return p}else{i.text(this.$prompt_left.text()+this.$prompt_right.text());return r.text("")}};i.prototype._Delete=function(t){var e,i,s;i=this.$prompt_right.text();if(i){if(t){s=i.match(/^\w*\W*/);if(!s){return}s=s[0];return this.$prompt_right.text(i.slice(s.length))}else{return this.$prompt_right.text(i.slice(1))}}else if(!this.$prompt_after.is(f)){e=this.$prompt_after.children().first().detach();return this.$prompt_right.text(e.children().last().text())}};i.prototype._Backspace=function(e){var i,s,r;setTimeout(t.proxy(this._ScrollToEnd,this),0);s=this.$prompt_left.text();if(s){if(e){r=s.match(/\w*\W*$/);if(!r){return}r=r[0];return this.$prompt_left.text(s.slice(0,-r.length))}else{return this.$prompt_left.text(s.slice(0,-1))}}else if(!this.$prompt_before.is(f)){i=this.$prompt_before.children().last().detach();this.$prompt_label.text(i.children().first().text());return this.$prompt_left.text(i.children().last().text())}};i.prototype._Indent=function(){var t;return this.$prompt_left.prepend(function(){var e,i,s;s=[];for(t=e=1,i=this.indent_width;1<=i?e<=i:e>=i;t=1<=i?++e:--e){s.push(" ")}return s}.call(this).join(""))};i.prototype._Unindent=function(){var t,e,i,s,r;t=this.$prompt_left.text()+this.$prompt_right.text();r=[];for(e=i=1,s=this.indent_width;1<=s?i<=s:i>=s;e=1<=s?++i:--i){if(!/^ /.test(t)){break}if(this.$prompt_left.text()){this.$prompt_left.text(this.$prompt_left.text().slice(1))}else{this.$prompt_right.text(this.$prompt_right.text().slice(1))}r.push(t=t.slice(1))}return r};i.prototype._InsertNewLine=function(e){var i,s,r;if(e==null){e=false}r=this._SelectPromptLabel(!this.$prompt_before.is(f));i=t(m).appendTo(this.$prompt_before);i.append(t(m).text(r));i.append(t(m).text(this.$prompt_left.text()));this.$prompt_label.text(this._SelectPromptLabel(true));if(e&&(s=this.$prompt_left.text().match(/^\s+/))){this.$prompt_left.text(s[0])}else{this.$prompt_left.text("")}return this._ScrollToEnd()};i.prototype._AppendPromptText=function(t){var e,i,s,r,o,n;i=t.split(L);this.$prompt_left.text(this.$prompt_left.text()+i[0]);o=i.slice(1);n=[];for(s=0,r=o.length;ss.top){return this.$window.scrollTop(i)}}else{if(o+ti){return this.$window.scrollTop(s.top)}}};i.prototype._SelectPromptLabel=function(t){if(this.state===D){if(t){return" \n"+this.prompt_label_continue}else{return this.prompt_label_main}}else{if(t){return"\n "}else{return" "}}};i.prototype._Wrap=function(t,e,i){var s,r;r=t.html();s=r.slice(0,e)+A(i,r[e])+r.slice(e+1);return t.html(s)};i.prototype._WalkCharacters=function(t,e,i,s,r){var o,n,h;n=r?t.length:0;t=t.split("");h=function(){var e,i,s,o;if(r){s=t,t=2<=s.length?U.call(s,0,i=s.length-1):(i=0,[]),e=s[i++]}else{o=t,e=o[0],t=2<=o.length?U.call(o,1):[]}if(e){n=n+(r?-1:+1)}return e};while(o=h()){if(o===e){s++}else if(o===i){s--}if(s===0){return{index:n,current_count:s}}}return{index:-1,current_count:s}};i.prototype._ProcessMatch=function(e,i,s){var r,o,n,h,p,c,a,l,u,_,f,m,d=this;_=i?[e["closing_char"],e["opening_char"]]:[e["opening_char"],e["closing_char"]],h=_[0],l=_[1];f=this._GetDirectionals(i),n=f.$prompt_which,o=f.$prompt_relative;p=1;c=false;u=n.html();if(!i){u=u.slice(1)}if(s&&i){u=u.slice(0,-1)}m=this._WalkCharacters(u,h,l,p,i),a=m.index,p=m.current_count;if(a>-1){this._Wrap(n,a,e.cls);c=true}else{r=o.children();r=i?Array.prototype.reverse.call(r):r;r.each(function(s,r){var o,n;o=t(r).children().last();u=o.html();n=d._WalkCharacters(u,h,l,p,i),a=n.index,p=n.current_count;if(a>-1){if(!i){a--}d._Wrap(o,a,e.cls);c=true;return false}})}return c};i.prototype._CheckMatchings=function(e){var i,s,r,o,n,h,p;r=e?this.$prompt_left.text().slice(this.$prompt_left.text().length-1):this.$prompt_right.text()[0];p=this.matchings.clss;for(n=0,h=p.length;n=this.history.length){return}if(this.history_index===this.history.length-1){this.history_index++;return this.SetPromptText(this.history_new)}else{return this.SetPromptText(this.history[++this.history_index])}};i.prototype._CheckComposition=function(t){var e;e=t.keyCode||t.which;if(e===229){if(this.in_composition){return this._UpdateComposition()}else{return this._StartComposition()}}};i.prototype._StartComposition=function(){if(this.in_composition){return}this.in_composition=true;this._ShowComposition();return setTimeout(this._UpdateComposition,0)};i.prototype._EndComposition=function(){if(!this.in_composition){return}this._HideComposition();this.$prompt_left.text(this.$prompt_left.text()+this.$composition.text());this.$composition.text("");this.$input_source.val("");return this.in_composition=false};i.prototype._UpdateComposition=function(t){var e,i=this;e=function(){if(!i.in_composition){return}return i.$composition.text(i.$input_source.val())};return setTimeout(e,0)};i.prototype._ShowComposition=function(){this.$composition.css("height",this.$prompt_cursor.height());this.$composition.empty();return this.$composition.appendTo(this.$prompt_left)};i.prototype._HideComposition=function(){return this.$composition.detach()};return i}();t.fn.jqconsole=function(t,e,i){return new v(this,t,e,i)};t.fn.jqconsole.JQConsole=v;t.fn.jqconsole.Ansi=e}).call(this);
--------------------------------------------------------------------------------
/examples/Blank Example/js/peg.js:
--------------------------------------------------------------------------------
1 | /*
2 | * PEG.js 0.7.0
3 | *
4 | * http://pegjs.majda.cz/
5 | *
6 | * Copyright (c) 2010-2012 David Majda
7 | * Licensend under the MIT license.
8 | */var PEG=function(undefined){function range(a,b){b===undefined&&(b=a,a=0);var c=new Array(Math.max(0,b-a));for(var d=0,e=a;eg&&(g=e,h=[]),h.push(a)}function l(){var a,b,c,d,f,g;f=e,g=e,a=bg();if(a!==null){b=m(),b=b!==null?b:"";if(b!==null){d=n();if(d!==null){c=[];while(d!==null)c.push(d),d=n()}else c=null;c!==null?a=[a,b,c]:(a=null,e=g)}else a=null,e=g}else a=null,e=g;return a!==null&&(a=function(a,b,c){return{type:"grammar",initializer:b!==""?b:null,rules:c,startRule:c[0].name}}(f,a[1],a[2])),a===null&&(e=f),a}function m(){var a,b,c,d;return c=e,d=e,a=u(),a!==null?(b=A(),b=b!==null?b:"",b!==null?a=[a,b]:(a=null,e=d)):(a=null,e=d),a!==null&&(a=function(a,b){return{type:"initializer",code:b}}(c,a[0])),a===null&&(e=c),a}function n(){var a,b,c,d,f,g,h;return g=e,h=e,a=K(),a!==null?(b=M(),b=b!==null?b:"",b!==null?(c=y(),c!==null?(d=o(),d!==null?(f=A(),f=f!==null?f:"",f!==null?a=[a,b,c,d,f]:(a=null,e=h)):(a=null,e=h)):(a=null,e=h)):(a=null,e=h)):(a=null,e=h),a!==null&&(a=function(a,b,c,d){return{type:"rule",name:b,displayName:c!==""?c:null,expression:d}}(g,a[0],a[1],a[3])),a===null&&(e=g),a}function o(){var a,b,c,d,f,g,h;f=e,g=e,a=p();if(a!==null){b=[],h=e,c=B(),c!==null?(d=p(),d!==null?c=[c,d]:(c=null,e=h)):(c=null,e=h);while(c!==null)b.push(c),h=e,c=B(),c!==null?(d=p(),d!==null?c=[c,d]:(c=null,e=h)):(c=null,e=h);b!==null?a=[a,b]:(a=null,e=g)}else a=null,e=g;return a!==null&&(a=function(a,b,c){if(c.length>0){var d=[b].concat(map(c,function(a){return a[1]}));return{type:"choice",alternatives:d}}return b}(f,a[0],a[1])),a===null&&(e=f),a}function p(){var a,b,c,d;c=e,d=e,a=[],b=q();while(b!==null)a.push(b),b=q();a!==null?(b=u(),b!==null?a=[a,b]:(a=null,e=d)):(a=null,e=d),a!==null&&(a=function(a,b,c){var d=b.length!==1?{type:"sequence",elements:b}:b[0];return{type:"action",expression:d,code:c}}(c,a[0],a[1])),a===null&&(e=c);if(a===null){c=e,a=[],b=q();while(b!==null)a.push(b),b=q();a!==null&&(a=function(a,b){return b.length!==1?{type:"sequence",elements:b}:b[0]}(c,a)),a===null&&(e=c)}return a}function q(){var a,b,c,d,f;return d=e,f=e,a=K(),a!==null?(b=z(),b!==null?(c=r(),c!==null?a=[a,b,c]:(a=null,e=f)):(a=null,e=f)):(a=null,e=f),a!==null&&(a=function(a,b,c){return{type:"labeled",label:b,expression:c}}(d,a[0],a[2])),a===null&&(e=d),a===null&&(a=r()),a}function r(){var a,b,c,d;return c=e,d=e,a=C(),a!==null?(b=u(),b!==null?a=[a,b]:(a=null,e=d)):(a=null,e=d),a!==null&&(a=function(a,b){return{type:"semantic_and",code:b}}(c,a[1])),a===null&&(e=c),a===null&&(c=e,d=e,a=C(),a!==null?(b=s(),b!==null?a=[a,b]:(a=null,e=d)):(a=null,e=d),a!==null&&(a=function(a,b){return{type:"simple_and",expression:b}}(c,a[1])),a===null&&(e=c),a===null&&(c=e,d=e,a=D(),a!==null?(b=u(),b!==null?a=[a,b]:(a=null,e=d)):(a=null,e=d),a!==null&&(a=function(a,b){return{type:"semantic_not",code:b}}(c,a[1])),a===null&&(e=c),a===null&&(c=e,d=e,a=D(),a!==null?(b=s(),b!==null?a=[a,b]:(a=null,e=d)):(a=null,e=d),a!==null&&(a=function(a,b){return{type:"simple_not",expression:b}}(c,a[1])),a===null&&(e=c),a===null&&(a=s())))),a}function s(){var a,b,c,d;return c=e,d=e,a=t(),a!==null?(b=E(),b!==null?a=[a,b]:(a=null,e=d)):(a=null,e=d),a!==null&&(a=function(a,b){return{type:"optional",expression:b}}(c,a[0])),a===null&&(e=c),a===null&&(c=e,d=e,a=t(),a!==null?(b=F(),b!==null?a=[a,b]:(a=null,e=d)):(a=null,e=d),a!==null&&(a=function(a,b){return{type:"zero_or_more",expression:b}}(c,a[0])),a===null&&(e=c),a===null&&(c=e,d=e,a=t(),a!==null?(b=G(),b!==null?a=[a,b]:(a=null,e=d)):(a=null,e=d),a!==null&&(a=function(a,b){return{type:"one_or_more",expression:b}}(c,a[0])),a===null&&(e=c),a===null&&(a=t()))),a}function t(){var a,b,c,d,g,h,i;return d=e,g=e,a=K(),a!==null?(h=e,f++,i=e,b=M(),b=b!==null?b:"",b!==null?(c=y(),c!==null?b=[b,c]:(b=null,e=i)):(b=null,e=i),f--,b===null?b="":(b=null,e=h),b!==null?a=[a,b]:(a=null,e=g)):(a=null,e=g),a!==null&&(a=function(a,b){return{type:"rule_ref",name:b}}(d,a[0])),a===null&&(e=d),a===null&&(a=L(),a===null&&(d=e,a=J(),a!==null&&(a=function(a){return{type:"any"}}(d)),a===null&&(e=d),a===null&&(a=T(),a===null&&(d=e,g=e,a=H(),a!==null?(b=o(),b!==null?(c=I(),c!==null?a=[a,b,c]:(a=null,e=g)):(a=null,e=g)):(a=null,e=g),a!==null&&(a=function(a,b){return b}(d,a[1])),a===null&&(e=d))))),a}function u(){var a,b,c,d;return f++,c=e,d=e,a=v(),a!==null?(b=bg(),b!==null?a=[a,b]:(a=null,e=d)):(a=null,e=d),a!==null&&(a=function(a,b){return b.substr(1,b.length-2)}(c,a[0])),a===null&&(e=c),f--,f===0&&a===null&&k("action"),a}function v(){var a,c,d,g,h;g=e,h=e,b.charCodeAt(e)===123?(a="{",e++):(a=null,f===0&&k('"{"'));if(a!==null){c=[],d=v(),d===null&&(d=x());while(d!==null)c.push(d),d=v(),d===null&&(d=x());c!==null?(b.charCodeAt(e)===125?(d="}",e++):(d=null,f===0&&k('"}"')),d!==null?a=[a,c,d]:(a=null,e=h)):(a=null,e=h)}else a=null,e=h;return a!==null&&(a=function(a,b){return"{"+b.join("")+"}"}(g,a[1])),a===null&&(e=g),a}function w(){var a,b,c;c=e,b=x();if(b!==null){a=[];while(b!==null)a.push(b),b=x()}else a=null;return a!==null&&(a=function(a,b){return b.join("")}(c,a)),a===null&&(e=c),a}function x(){var a;return/^[^{}]/.test(b.charAt(e))?(a=b.charAt(e),e++):(a=null,f===0&&k("[^{}]")),a}function y(){var a,c,d,g;return d=e,g=e,b.charCodeAt(e)===61?(a="=",e++):(a=null,f===0&&k('"="')),a!==null?(c=bg(),c!==null?a=[a,c]:(a=null,e=g)):(a=null,e=g),a!==null&&(a=function(a){return"="}(d)),a===null&&(e=d),a}function z(){var a,c,d,g;return d=e,g=e,b.charCodeAt(e)===58?(a=":",e++):(a=null,f===0&&k('":"')),a!==null?(c=bg(),c!==null?a=[a,c]:(a=null,e=g)):(a=null,e=g),a!==null&&(a=function(a){return":"}(d)),a===null&&(e=d),a}function A(){var a,c,d,g;return d=e,g=e,b.charCodeAt(e)===59?(a=";",e++):(a=null,f===0&&k('";"')),a!==null?(c=bg(),c!==null?a=[a,c]:(a=null,e=g)):(a=null,e=g),a!==null&&(a=function(a){return";"}(d)),a===null&&(e=d),a}function B(){var a,c,d,g;return d=e,g=e,b.charCodeAt(e)===47?(a="/",e++):(a=null,f===0&&k('"/"')),a!==null?(c=bg(),c!==null?a=[a,c]:(a=null,e=g)):(a=null,e=g),a!==null&&(a=function(a){return"/"}(d)),a===null&&(e=d),a}function C(){var a,c,d,g;return d=e,g=e,b.charCodeAt(e)===38?(a="&",e++):(a=null,f===0&&k('"&"')),a!==null?(c=bg(),c!==null?a=[a,c]:(a=null,e=g)):(a=null,e=g),a!==null&&(a=function(a){return"&"}(d)),a===null&&(e=d),a}function D(){var a,c,d,g;return d=e,g=e,b.charCodeAt(e)===33?(a="!",e++):(a=null,f===0&&k('"!"')),a!==null?(c=bg(),c!==null?a=[a,c]:(a=null,e=g)):(a=null,e=g),a!==null&&(a=function(a){return"!"}(d)),a===null&&(e=d),a}function E(){var a,c,d,g;return d=e,g=e,b.charCodeAt(e)===63?(a="?",e++):(a=null,f===0&&k('"?"')),a!==null?(c=bg(),c!==null?a=[a,c]:(a=null,e=g)):(a=null,e=g),a!==null&&(a=function(a){return"?"}(d)),a===null&&(e=d),a}function F(){var a,c,d,g;return d=e,g=e,b.charCodeAt(e)===42?(a="*",e++):(a=null,f===0&&k('"*"')),a!==null?(c=bg(),c!==null?a=[a,c]:(a=null,e=g)):(a=null,e=g),a!==null&&(a=function(a){return"*"}(d)),a===null&&(e=d),a}function G(){var a,c,d,g;return d=e,g=e,b.charCodeAt(e)===43?(a="+",e++):(a=null,f===0&&k('"+"')),a!==null?(c=bg(),c!==null?a=[a,c]:(a=null,e=g)):(a=null,e=g),a!==null&&(a=function(a){return"+"}(d)),a===null&&(e=d),a}function H(){var a,c,d,g;return d=e,g=e,b.charCodeAt(e)===40?(a="(",e++):(a=null,f===0&&k('"("')),a!==null?(c=bg(),c!==null?a=[a,c]:(a=null,e=g)):(a=null,e=g),a!==null&&(a=function(a){return"("}(d)),a===null&&(e=d),a}function I(){var a,c,d,g;return d=e,g=e,b.charCodeAt(e)===41?(a=")",e++):(a=null,f===0&&k('")"')),a!==null?(c=bg(),c!==null?a=[a,c]:(a=null,e=g)):(a=null,e=g),a!==null&&(a=function(a){return")"}(d)),a===null&&(e=d),a}function J(){var a,c,d,g;return d=e,g=e,b.charCodeAt(e)===46?(a=".",e++):(a=null,f===0&&k('"."')),a!==null?(c=bg(),c!==null?a=[a,c]:(a=null,e=g)):(a=null,e=g),a!==null&&(a=function(a){return"."}(d)),a===null&&(e=d),a}function K(){var a,c,d,g,h;f++,g=e,h=e,a=bd(),a===null&&(b.charCodeAt(e)===95?(a="_",e++):(a=null,f===0&&k('"_"')),a===null&&(b.charCodeAt(e)===36?(a="$",e++):(a=null,f===0&&k('"$"'))));if(a!==null){c=[],d=bd(),d===null&&(d=bb(),d===null&&(b.charCodeAt(e)===95?(d="_",e++):(d=null,f===0&&k('"_"')),d===null&&(b.charCodeAt(e)===36?(d="$",e++):(d=null,f===0&&k('"$"')))));while(d!==null)c.push(d),d=bd(),d===null&&(d=bb(),d===null&&(b.charCodeAt(e)===95?(d="_",e++):(d=null,f===0&&k('"_"')),d===null&&(b.charCodeAt(e)===36?(d="$",e++):(d=null,f===0&&k('"$"')))));c!==null?(d=bg(),d!==null?a=[a,c,d]:(a=null,e=h)):(a=null,e=h)}else a=null,e=h;return a!==null&&(a=function(a,b,c){return b+c.join("")}(g,a[0],a[1])),a===null&&(e=g),f--,f===0&&a===null&&k("identifier"),a}function L(){var a,c,d,g,h;return f++,g=e,h=e,a=N(),a===null&&(a=Q()),a!==null?(b.charCodeAt(e)===105?(c="i",e++):(c=null,f===0&&k('"i"')),c=c!==null?c:"",c!==null?(d=bg(),d!==null?a=[a,c,d]:(a=null,e=h)):(a=null,e=h)):(a=null,e=h),a!==null&&(a=function(a,b,c){return{type:"literal",value:b,ignoreCase:c==="i"}}(g,a[0],a[1])),a===null&&(e=g),f--,f===0&&a===null&&k("literal"),a}function M(){var a,b,c,d;return f++,c=e,d=e,a=N(),a===null&&(a=Q()),a!==null?(b=bg(),b!==null?a=[a,b]:(a=null,e=d)):(a=null,e=d),a!==null&&(a=function(a,b){return b}(c,a[0])),a===null&&(e=c),f--,f===0&&a===null&&k("string"),a}function N(){var a,c,d,g,h;g=e,h=e,b.charCodeAt(e)===34?(a='"',e++):(a=null,f===0&&k('"\\""'));if(a!==null){c=[],d=O();while(d!==null)c.push(d),d=O();c!==null?(b.charCodeAt(e)===34?(d='"',e++):(d=null,f===0&&k('"\\""')),d!==null?a=[a,c,d]:(a=null,e=h)):(a=null,e=h)}else a=null,e=h;return a!==null&&(a=function(a,b){return b.join("")}(g,a[1])),a===null&&(e=g),a}function O(){var a;return a=P(),a===null&&(a=Y(),a===null&&(a=Z(),a===null&&(a=$(),a===null&&(a=_(),a===null&&(a=ba()))))),a}function P(){var a,c,d,g,h;return d=e,g=e,h=e,f++,b.charCodeAt(e)===34?(a='"',e++):(a=null,f===0&&k('"\\""')),a===null&&(b.charCodeAt(e)===92?(a="\\",e++):(a=null,f===0&&k('"\\\\"')),a===null&&(a=bl())),f--,a===null?a="":(a=null,e=h),a!==null?(b.length>e?(c=b.charAt(e),e++):(c=null,f===0&&k("any character")),c!==null?a=[a,c]:(a=null,e=g)):(a=null,e=g),a!==null&&(a=function(a,b){return b}(d,a[1])),a===null&&(e=d),a}function Q(){var a,c,d,g,h;g=e,h=e,b.charCodeAt(e)===39?(a="'",e++):(a=null,f===0&&k('"\'"'));if(a!==null){c=[],d=R();while(d!==null)c.push(d),d=R();c!==null?(b.charCodeAt(e)===39?(d="'",e++):(d=null,f===0&&k('"\'"')),d!==null?a=[a,c,d]:(a=null,e=h)):(a=null,e=h)}else a=null,e=h;return a!==null&&(a=function(a,b){return b.join("")}(g,a[1])),a===null&&(e=g),a}function R(){var a;return a=S(),a===null&&(a=Y(),a===null&&(a=Z(),a===null&&(a=$(),a===null&&(a=_(),a===null&&(a=ba()))))),a}function S(){var a,c,d,g,h;return d=e,g=e,h=e,f++,b.charCodeAt(e)===39?(a="'",e++):(a=null,f===0&&k('"\'"')),a===null&&(b.charCodeAt(e)===92?(a="\\",e++):(a=null,f===0&&k('"\\\\"')),a===null&&(a=bl())),f--,a===null?a="":(a=null,e=h),a!==null?(b.length>e?(c=b.charAt(e),e++):(c=null,f===0&&k("any character")),c!==null?a=[a,c]:(a=null,e=g)):(a=null,e=g),a!==null&&(a=function(a,b){return b}(d,a[1])),a===null&&(e=d),a}function T(){var a,c,d,g,h,i,j,l;f++,j=e,l=e,b.charCodeAt(e)===91?(a="[",e++):(a=null,f===0&&k('"["'));if(a!==null){b.charCodeAt(e)===94?(c="^",e++):(c=null,f===0&&k('"^"')),c=c!==null?c:"";if(c!==null){d=[],g=U(),g===null&&(g=V());while(g!==null)d.push(g),g=U(),g===null&&(g=V());d!==null?(b.charCodeAt(e)===93?(g="]",e++):(g=null,f===0&&k('"]"')),g!==null?(b.charCodeAt(e)===105?(h="i",e++):(h=null,f===0&&k('"i"')),h=h!==null?h:"",h!==null?(i=bg(),i!==null?a=[a,c,d,g,h,i]:(a=null,e=l)):(a=null,e=l)):(a=null,e=l)):(a=null,e=l)}else a=null,e=l}else a=null,e=l;return a!==null&&(a=function(a,b,c,d){var e=map(c,function(a){return a.data}),f="["+b+map(c,function(a){return a.rawText}).join("")+"]"+d;return{type:"class",inverted:b==="^",ignoreCase:d==="i",parts:e,rawText:f}}(j,a[1],a[2],a[4])),a===null&&(e=j),f--,f===0&&a===null&&k("character class"),a}function U(){var a,c,d,g,h;return g=e,h=e,a=V(),a!==null?(b.charCodeAt(e)===45?(c="-",e++):(c=null,f===0&&k('"-"')),c!==null?(d=V(),d!==null?a=[a,c,d]:(a=null,e=h)):(a=null,e=h)):(a=null,e=h),a!==null&&(a=function(a,b,c){if(b.data.charCodeAt(0)>c.data.charCodeAt(0))throw new this.SyntaxError("Invalid character range: "+b.rawText+"-"+c.rawText+".");return{data:[b.data,c.data],rawText:b.rawText+"-"+c.rawText}}(g,a[0],a[2])),a===null&&(e=g),a}function V(){var a,b;return b=e,a=W(),a!==null&&(a=function(a,b){return{data:b,rawText:quoteForRegexpClass(b)}}(b,a)),a===null&&(e=b),a}function W(){var a;return a=X(),a===null&&(a=Y(),a===null&&(a=Z(),a===null&&(a=$(),a===null&&(a=_(),a===null&&(a=ba()))))),a}function X(){var a,c,d,g,h;return d=e,g=e,h=e,f++,b.charCodeAt(e)===93?(a="]",e++):(a=null,f===0&&k('"]"')),a===null&&(b.charCodeAt(e)===92?(a="\\",e++):(a=null,f===0&&k('"\\\\"')),a===null&&(a=bl())),f--,a===null?a="":(a=null,e=h),a!==null?(b.length>e?(c=b.charAt(e),e++):(c=null,f===0&&k("any character")),c!==null?a=[a,c]:(a=null,e=g)):(a=null,e=g),a!==null&&(a=function(a,b){return b}(d,a[1])),a===null&&(e=d),a}function Y(){var a,c,d,g,h,i;return g=e,h=e,b.charCodeAt(e)===92?(a="\\",e++):(a=null,f===0&&k('"\\\\"')),a!==null?(i=e,f++,c=bb(),c===null&&(b.charCodeAt(e)===120?(c="x",e++):(c=null,f===0&&k('"x"')),c===null&&(b.charCodeAt(e)===117?(c="u",e++):(c=null,f===0&&k('"u"')),c===null&&(c=bl()))),f--,c===null?c="":(c=null,e=i),c!==null?(b.length>e?(d=b.charAt(e),e++):(d=null,f===0&&k("any character")),d!==null?a=[a,c,d]:(a=null,e=h)):(a=null,e=h)):(a=null,e=h),a!==null&&(a=function(a,b){return b.replace("b","\b").replace("f","\f").replace("n","\n").replace("r","\r").replace("t","\t").replace("v","")}(g,a[2])),a===null&&(e=g),a}function Z(){var a,c,d,g,h;return d=e,g=e,b.substr(e,2)==="\\0"?(a="\\0",e+=2):(a=null,f===0&&k('"\\\\0"')),a!==null?(h=e,f++,c=bb(),f--,c===null?c="":(c=null,e=h),c!==null?a=[a,c]:(a=null,e=g)):(a=null,e=g),a!==null&&(a=function(a){return"\0"}(d)),a===null&&(e=d),a}function $(){var a,c,d,g,h;return g=e,h=e,b.substr(e,2)==="\\x"?(a="\\x",e+=2):(a=null,f===0&&k('"\\\\x"')),a!==null?(c=bc(),c!==null?(d=bc(),d!==null?a=[a,c,d]:(a=null,e=h)):(a=null,e=h)):(a=null,e=h),a!==null&&(a=function(a,b,c){return String.fromCharCode(parseInt(b+c,16))}(g,a[1],a[2])),a===null&&(e=g),a}function _(){var a,c,d,g,h,i,j;return i=e,j=e,b.substr(e,2)==="\\u"?(a="\\u",e+=2):(a=null,f===0&&k('"\\\\u"')),a!==null?(c=bc(),c!==null?(d=bc(),d!==null?(g=bc(),g!==null?(h=bc(),h!==null?a=[a,c,d,g,h]:(a=null,e=j)):(a=null,e=j)):(a=null,e=j)):(a=null,e=j)):(a=null,e=j),a!==null&&(a=function(a,b,c,d,e){return String.fromCharCode(parseInt(b+c+d+e,16))}(i,a[1],a[2],a[3],a[4])),a===null&&(e=i),a}function ba(){var a,c,d,g;return d=e,g=e,b.charCodeAt(e)===92?(a="\\",e++):(a=null,f===0&&k('"\\\\"')),a!==null?(c=bk(),c!==null?a=[a,c]:(a=null,e=g)):(a=null,e=g),a!==null&&(a=function(a,b){return b}(d,a[1])),a===null&&(e=d),a}function bb(){var a;return/^[0-9]/.test(b.charAt(e))?(a=b.charAt(e),e++):(a=null,f===0&&k("[0-9]")),a}function bc(){var a;return/^[0-9a-fA-F]/.test(b.charAt(e))?(a=b.charAt(e),e++):(a=null,f===0&&k("[0-9a-fA-F]")),a}function bd(){var a;return a=be(),a===null&&(a=bf()),a}function be(){var a;return/^[a-z]/.test(b.charAt(e))?(a=b.charAt(e),e++):(a=null,f===0&&k("[a-z]")),a}function bf(){var a;return/^[A-Z]/.test(b.charAt(e))?(a=b.charAt(e),e++):(a=null,f===0&&k("[A-Z]")),a}function bg(){var a,b;a=[],b=bm(),b===null&&(b=bk(),b===null&&(b=bh()));while(b!==null)a.push(b),b=bm(),b===null&&(b=bk(),b===null&&(b=bh()));return a}function bh(){var a;return f++,a=bi(),a===null&&(a=bj()),f--,f===0&&a===null&&k("comment"),a}function bi(){var a,c,d,g,h,i,j;h=e,b.substr(e,2)==="//"?(a="//",e+=2):(a=null,f===0&&k('"//"'));if(a!==null){c=[],i=e,j=e,f++,d=bl(),f--,d===null?d="":(d=null,e=j),d!==null?(b.length>e?(g=b.charAt(e),e++):(g=null,f===0&&k("any character")),g!==null?d=[d,g]:(d=null,e=i)):(d=null,e=i);while(d!==null)c.push(d),i=e,j=e,f++,d=bl(),f--,d===null?d="":(d=null,e=j),d!==null?(b.length>e?(g=b.charAt(e),e++):(g=null,f===0&&k("any character")),g!==null?d=[d,g]:(d=null,e=i)):(d=null,e=i);c!==null?a=[a,c]:(a=null,e=h)}else a=null,e=h;return a}function bj(){var a,c,d,g,h,i,j;h=e,b.substr(e,2)==="/*"?(a="/*",e+=2):(a=null,f===0&&k('"/*"'));if(a!==null){c=[],i=e,j=e,f++,b.substr(e,2)==="*/"?(d="*/",e+=2):(d=null,f===0&&k('"*/"')),f--,d===null?d="":(d=null,e=j),d!==null?(b.length>e?(g=b.charAt(e),e++):(g=null,f===0&&k("any character")),g!==null?d=[d,g]:(d=null,e=i)):(d=null,e=i);while(d!==null)c.push(d),i=e,j=e,f++,b.substr(e,2)==="*/"?(d="*/",e+=2):(d=null,f===0&&k('"*/"')),f--,d===null?d="":(d=null,e=j),d!==null?(b.length>e?(g=b.charAt(e),e++):(g=null,f===0&&k("any character")),g!==null?d=[d,g]:(d=null,e=i)):(d=null,e=i);c!==null?(b.substr(e,2)==="*/"?(d="*/",e+=2):(d=null,f===0&&k('"*/"')),d!==null?a=[a,c,d]:(a=null,e=h)):(a=null,e=h)}else a=null,e=h;return a}function bk(){var a;return f++,b.charCodeAt(e)===10?(a="\n",e++):(a=null,f===0&&k('"\\n"')),a===null&&(b.substr(e,2)==="\r\n"?(a="\r\n",e+=2):(a=null,f===0&&k('"\\r\\n"')),a===null&&(b.charCodeAt(e)===13?(a="\r",e++):(a=null,f===0&&k('"\\r"')),a===null&&(b.charCodeAt(e)===8232?(a="\u2028",e++):(a=null,f===0&&k('"\\u2028"')),a===null&&(b.charCodeAt(e)===8233?(a="\u2029",e++):(a=null,f===0&&k('"\\u2029"')))))),f--,f===0&&a===null&&k("end of line"),a}function bl(){var a;return/^[\n\r\u2028\u2029]/.test(b.charAt(e))?(a=b.charAt(e),e++):(a=null,f===0&&k("[\\n\\r\\u2028\\u2029]")),a}function bm(){var a;return f++,/^[ \t\x0B\f\xA0\uFEFF\u1680\u180E\u2000-\u200A\u202F\u205F\u3000]/.test(b.charAt(e))?(a=b.charAt(e),e++):(a=null,f===0&&k("[ \\t\\x0B\\f\\xA0\\uFEFF\\u1680\\u180E\\u2000-\\u200A\\u202F\\u205F\\u3000]")),f--,f===0&&a===null&&k("whitespace"),a}function bn(a){a.sort();var b=null,c=[];for(var d=0;d0&&e(a.elements[0],b)},labeled:c,simple_and:c,simple_not:c,semantic_and:b,semantic_not:b,optional:c,zero_or_more:c,one_or_more:c,action:c,rule_ref:function(b,c){if(contains(c,b.name))throw new PEG.GrammarError('Left recursion detected for rule "'+b.name+'".');e(findRuleByName(a,b.name),c)},literal:b,any:b,"class":b});e(a,[])},removeProxyRules:function(a){function b(a){return a.type==="rule"&&a.expression.type==="rule_ref"}function c(a,b,c){function d(){}function e(a,b,c){g(a.expression,b,c)}function f(a){return function(b,c,d){each(b[a],function(a){g(a,c,d)})}}var g=buildNodeVisitor({grammar:f("rules"),rule:e,choice:f("alternatives"),sequence:f("elements"),labeled:e,simple_and:e,simple_not:e,semantic_and:d,semantic_not:d,optional:e,zero_or_more:e,one_or_more:e,action:e,rule_ref:function(a,b,c){a.name===b&&(a.name=c)},literal:d,any:d,"class":d});g(a,b,c)}var d=[];each(a.rules,function(e,f){b(e)&&(c(a,e.name,e.expression.name),e.name===a.startRule&&(a.startRule=e.expression.name),d.push(f))}),d.reverse(),each(d,function(b){a.rules.splice(b,1)})},computeVarNames:function(a){function b(a){return"result"+a}function c(a){return"pos"+a}function d(a,c){return a.resultVar=b(c.result),{result:0,pos:0}}function e(a){return function(d,e){var g=f(d.expression,{result:e.result+a.result,pos:e.pos+a.pos});return d.resultVar=b(e.result),a.pos!==0&&(d.posVar=c(e.pos)),{result:g.result+a.result,pos:g.pos+a.pos}}}var f=buildNodeVisitor({grammar:function(a,b){each(a.rules,function(a){f(a,b)})},rule:function(a,d){var e=f(a.expression,d);a.resultVar=b(d.result),a.resultVars=map(range(e.result+1),b),a.posVars=map(range(e.pos),c)},choice:function(a,c){var d=map(a.alternatives,function(a){return f(a,c)});return a.resultVar=b(c.result),{result:Math.max.apply(null,pluck(d,"result")),pos:Math.max.apply(null,pluck(d,"pos"))}},sequence:function(a,d){var e=map(a.elements,function(a,b){return f(a,{result:d.result+b,pos:d.pos+1})});return a.resultVar=b(d.result),a.posVar=c(d.pos),{result:a.elements.length>0?Math.max.apply(null,map(e,function(a,b){return b+a.result})):0,pos:a.elements.length>0?1+Math.max.apply(null,pluck(e,"pos")):1}},labeled:e({result:0,pos:0}),simple_and:e({result:0,pos:1}),simple_not:e({result:0,pos:1}),semantic_and:d,semantic_not:d,optional:e({result:0,pos:0}),zero_or_more:e({result:1,pos:0}),one_or_more:e({result:1,pos:0}),action:e({result:0,pos:1}),rule_ref:d,literal:d,any:d,"class":d});f(a,{result:0,pos:0})},computeParams:function(a){function c(a){b.push({}),a(),b.pop()}function d(){}function e(a){c(function(){g(a.expression)})}function f(a){var c=b[b.length-1],d={},e;for(e in c)d[e]=c[e];a.params=d}var b=[],g=buildNodeVisitor({grammar:function(a){each(a.rules,g)},rule:e,choice:function(a){c(function(){each(a.alternatives,g)})},sequence:function(a){function e(b){each(pluck(a.elements,"resultVar"),function(d,e){(new RegExp("^"+d+"(\\[\\d+\\])*$")).test(c[b])&&(c[b]=a.resultVar+"["+e+"]"+c[b].substr(d.length))})}var c=b[b.length-1],d;each(a.elements,g);for(d in c)e(d)},labeled:function(a){b[b.length-1][a.label]=a.resultVar,c(function(){g(a.expression)})},simple_and:e,simple_not:e,semantic_and:f,semantic_not:f,optional:e,zero_or_more:e,one_or_more:e,action:function(a){c(function(){g(a.expression),f(a)})},rule_ref:d,literal:d,any:d,"class":d});g(a)}},PEG.compiler.emitter=function(a,b){function e(a,c){return c.string=quote,c.pluck=pluck,c.keys=keys,c.values=values,c.emit=g,c.options=b,b.trackLineAndColumn?(c.posInit=function(a){return"var "+a+" = "+"{ offset: 0, line: 1, column: 1, seenCR: false }"},c.posClone=function(a){return"clone("+a+")"},c.posOffset=function(a){return a+".offset"},c.posAdvance=function(a){return"advance(pos, "+a+")"}):(c.posInit=function(a){return"var "+a+" = 0"},c.posClone=function(a){return a},c.posOffset=function(a){return a},c.posAdvance=function(a){return a===1?"pos++":"pos += "+a}),c.posSave=function(a){return a.posVar+" = "+c.posClone("pos")},c.posRestore=function(a){return"pos = "+c.posClone(a.posVar)},d[a](c)}function f(a){return function(b){return e(a,{node:b})}}b=b||{},b.cache===undefined&&(b.cache=!1),b.trackLineAndColumn===undefined&&(b.trackLineAndColumn=!1);var c=function(a){function b(a){function b(a){return a.charCodeAt(0).toString(16).toUpperCase()}return a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(a){return"\\x0"+b(a)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(a){return"\\x"+b(a)}).replace(/[\u0180-\u0FFF]/g,function(a){return"\\u0"+b(a)}).replace(/[\u1080-\uFFFF]/g,function(a){return"\\u"+b(a)})}function c(a){return"__p.push("+a+");"}function d(a,d,e){function f(a,b,c){return a.replace(new RegExp("^.{"+b+"}","gm"),function(a,b){return b===0?c?"":a:""})}var g=b(f(a.substring(0,d),e.indentLevel(),e.atBOL));return g.length>0?c('"'+g+'"'):""}var e={VERSION:"1.1.0",indentStep:2,commands:{"if":{params:/^(.*)$/,compile:function(a,b,c){return["if("+c[0]+"){",[]]},stackOp:"push"},"else":{params:/^$/,compile:function(a){var b=a.commandStack,c=b[b.length-1]==="else",d=b[b.length-1]==="if";if(c)throw new Error("Multiple #elses.");if(!d)throw new Error("Using #else outside of #if.");return["}else{",[]]},stackOp:"replace"},"for":{params:/^([a-zA-Z_][a-zA-Z0-9_]*)[ \t]+in[ \t]+(.*)$/,init:function(a){a.forCurrLevel=0,a.forMaxLevel=0},compile:function(a,b,c){var d="__c"+a.forCurrLevel,e="__l"+a.forCurrLevel,f="__i"+a.forCurrLevel;return a.forCurrLevel++,a.forMaxLevel0)throw new Error("Missing #end.");k.sort();for(o=0;o #{posOffset("rightmostFailuresPos")}) {',' rightmostFailuresPos = #{posClone("pos")};'," rightmostFailuresExpected = [];"," }"," "," rightmostFailuresExpected.push(failure);"," }"," "," #for rule in node.rules"," #block emit(rule)"," "," #end"," "," function cleanupExpected(expected) {"," expected.sort();"," "," var lastExpected = null;"," var cleanExpected = [];"," for (var i = 0; i < expected.length; i++) {"," if (expected[i] !== lastExpected) {"," cleanExpected.push(expected[i]);"," lastExpected = expected[i];"," }"," }"," return cleanExpected;"," }"," "," #if !options.trackLineAndColumn"," function computeErrorPosition() {"," /*"," * The first idea was to use |String.split| to break the input up to the"," * error position along newlines and derive the line and column from"," * there. However IE's |split| implementation is so broken that it was"," * enough to prevent it."," */"," "," var line = 1;"," var column = 1;"," var seenCR = false;"," "," for (var i = 0; i < Math.max(pos, rightmostFailuresPos); i++) {"," var ch = input.charAt(i);",' if (ch === "\\n") {'," if (!seenCR) { line++; }"," column = 1;"," seenCR = false;",' } else if (ch === "\\r" || ch === "\\u2028" || ch === "\\u2029") {'," line++;"," column = 1;"," seenCR = true;"," } else {"," column++;"," seenCR = false;"," }"," }"," "," return { line: line, column: column };"," }"," #end"," "," #if node.initializer"," #block emit(node.initializer)"," #end"," "," var result = parseFunctions[startRule]();"," "," /*"," * The parser is now in one of the following three states:"," *"," * 1. The parser successfully parsed the whole input."," *"," * - |result !== null|",' * - |#{posOffset("pos")} === input.length|'," * - |rightmostFailuresExpected| may or may not contain something"," *"," * 2. The parser successfully parsed only a part of the input."," *"," * - |result !== null|",' * - |#{posOffset("pos")} < input.length|'," * - |rightmostFailuresExpected| may or may not contain something"," *"," * 3. The parser did not successfully parse any part of the input."," *"," * - |result === null|",' * - |#{posOffset("pos")} === 0|'," * - |rightmostFailuresExpected| contains at least one failure"," *"," * All code following this comment (including called functions) must"," * handle these states."," */",' if (result === null || #{posOffset("pos")} !== input.length) {',' var offset = Math.max(#{posOffset("pos")}, #{posOffset("rightmostFailuresPos")});'," var found = offset < input.length ? input.charAt(offset) : null;"," #if options.trackLineAndColumn",' var errorPosition = #{posOffset("pos")} > #{posOffset("rightmostFailuresPos")} ? pos : rightmostFailuresPos;'," #else"," var errorPosition = computeErrorPosition();"," #end"," "," throw new this.SyntaxError("," cleanupExpected(rightmostFailuresExpected),"," found,"," offset,"," errorPosition.line,"," errorPosition.column"," );"," }"," "," return result;"," },"," "," /* Returns the parser source code. */"," toSource: function() { return this._source; }"," };"," "," /* Thrown when a parser encounters a syntax error. */"," "," result.SyntaxError = function(expected, found, offset, line, column) {"," function buildMessage(expected, found) {"," var expectedHumanized, foundHumanized;"," "," switch (expected.length) {"," case 0:",' expectedHumanized = "end of input";'," break;"," case 1:"," expectedHumanized = expected[0];"," break;"," default:",' expectedHumanized = expected.slice(0, expected.length - 1).join(", ")',' + " or "'," + expected[expected.length - 1];"," }"," ",' foundHumanized = found ? quote(found) : "end of input";'," ",' return "Expected " + expectedHumanized + " but " + foundHumanized + " found.";'," }"," ",' this.name = "SyntaxError";'," this.expected = expected;"," this.found = found;"," this.message = buildMessage(expected, found);"," this.offset = offset;"," this.line = line;"," this.column = column;"," };"," "," result.SyntaxError.prototype = Error.prototype;"," "," return result;","})()"],rule:["function parse_#{node.name}() {"," #if options.cache",' var cacheKey = "#{node.name}@" + #{posOffset("pos")};'," var cachedResult = cache[cacheKey];"," if (cachedResult) {",' pos = #{posClone("cachedResult.nextPos")};'," return cachedResult.result;"," }"," "," #end"," #if node.resultVars.length > 0",' var #{node.resultVars.join(", ")};'," #end"," #if node.posVars.length > 0",' var #{node.posVars.join(", ")};'," #end"," "," #if node.displayName !== null"," reportFailures++;"," #end"," #block emit(node.expression)"," #if node.displayName !== null"," reportFailures--;"," if (reportFailures === 0 && #{node.resultVar} === null) {"," matchFailed(#{string(node.displayName)});"," }"," #end"," #if options.cache"," "," cache[cacheKey] = {",' nextPos: #{posClone("pos")},'," result: #{node.resultVar}"," };"," #end"," return #{node.resultVar};","}"],choice:["#block emit(alternative)","#block nextAlternativesCode"],"choice.next":["if (#{node.resultVar} === null) {"," #block code","}"],sequence:["#{posSave(node)};","#block code"],"sequence.iteration":["#block emit(element)","if (#{element.resultVar} !== null) {"," #block code","} else {"," #{node.resultVar} = null;"," #{posRestore(node)};","}"],"sequence.inner":['#{node.resultVar} = [#{pluck(node.elements, "resultVar").join(", ")}];'],simple_and:["#{posSave(node)};","reportFailures++;","#block emit(node.expression)","reportFailures--;","if (#{node.resultVar} !== null) {",' #{node.resultVar} = "";'," #{posRestore(node)};","} else {"," #{node.resultVar} = null;","}"],simple_not:["#{posSave(node)};","reportFailures++;","#block emit(node.expression)","reportFailures--;","if (#{node.resultVar} === null) {",' #{node.resultVar} = "";',"} else {"," #{node.resultVar} = null;"," #{posRestore(node)};","}"],semantic_and:['#{node.resultVar} = (function(#{(options.trackLineAndColumn ? ["offset", "line", "column"] : ["offset"]).concat(keys(node.params)).join(", ")}) {#{node.code}})(#{(options.trackLineAndColumn ? ["pos.offset", "pos.line", "pos.column"] : ["pos"]).concat(values(node.params)).join(", ")}) ? "" : null;'],semantic_not:['#{node.resultVar} = (function(#{(options.trackLineAndColumn ? ["offset", "line", "column"] : ["offset"]).concat(keys(node.params)).join(", ")}) {#{node.code}})(#{(options.trackLineAndColumn ? ["pos.offset", "pos.line", "pos.column"] : ["pos"]).concat(values(node.params)).join(", ")}) ? null : "";'],optional:["#block emit(node.expression)",'#{node.resultVar} = #{node.resultVar} !== null ? #{node.resultVar} : "";'],zero_or_more:["#{node.resultVar} = [];","#block emit(node.expression)","while (#{node.expression.resultVar} !== null) {"," #{node.resultVar}.push(#{node.expression.resultVar});"," #block emit(node.expression)","}"],one_or_more:["#block emit(node.expression)","if (#{node.expression.resultVar} !== null) {"," #{node.resultVar} = [];"," while (#{node.expression.resultVar} !== null) {"," #{node.resultVar}.push(#{node.expression.resultVar});"," #block emit(node.expression)"," }","} else {"," #{node.resultVar} = null;","}"],action:["#{posSave(node)};","#block emit(node.expression)","if (#{node.resultVar} !== null) {",' #{node.resultVar} = (function(#{(options.trackLineAndColumn ? ["offset", "line", "column"] : ["offset"]).concat(keys(node.params)).join(", ")}) {#{node.code}})(#{(options.trackLineAndColumn ? [node.posVar + ".offset", node.posVar + ".line", node.posVar + ".column"] : [node.posVar]).concat(values(node.params)).join(", ")});',"}","if (#{node.resultVar} === null) {"," #{posRestore(node)};","}"],rule_ref:["#{node.resultVar} = parse_#{node.name}();"],literal:["#if node.value.length === 0",' #{node.resultVar} = "";',"#else"," #if !node.ignoreCase"," #if node.value.length === 1",' if (input.charCodeAt(#{posOffset("pos")}) === #{node.value.charCodeAt(0)}) {'," #else",' if (input.substr(#{posOffset("pos")}, #{node.value.length}) === #{string(node.value)}) {'," #end"," #else",' if (input.substr(#{posOffset("pos")}, #{node.value.length}).toLowerCase() === #{string(node.value.toLowerCase())}) {'," #end"," #if !node.ignoreCase"," #{node.resultVar} = #{string(node.value)};"," #else",' #{node.resultVar} = input.substr(#{posOffset("pos")}, #{node.value.length});'," #end"," #{posAdvance(node.value.length)};"," } else {"," #{node.resultVar} = null;"," if (reportFailures === 0) {"," matchFailed(#{string(string(node.value))});"," }"," }","#end"],any:['if (input.length > #{posOffset("pos")}) {',' #{node.resultVar} = input.charAt(#{posOffset("pos")});'," #{posAdvance(1)};","} else {"," #{node.resultVar} = null;"," if (reportFailures === 0) {",' matchFailed("any character");'," }","}"],"class":['if (#{regexp}.test(input.charAt(#{posOffset("pos")}))) {',' #{node.resultVar} = input.charAt(#{posOffset("pos")});'," #{posAdvance(1)};","} else {"," #{node.resultVar} = null;"," if (reportFailures === 0) {"," matchFailed(#{string(node.rawText)});"," }","}"]};for(a in d)b[a]=c.template(d[a].join("\n"));return b}(),g=buildNodeVisitor({grammar:f("grammar"),initializer:function(a){return a.code},rule:f("rule"),choice:function(a){var b,c;for(var d=a.alternatives.length-1;d>=0;d--)c=d!==a.alternatives.length-1?e("choice.next",{node:a,code:b}):"",b=e("choice",{alternative:a.alternatives[d],nextAlternativesCode:c});return b},sequence:function(a){var b=e("sequence.inner",{node:a});for(var c=a.elements.length-1;c>=0;c--)b=e("sequence.iteration",{node:a,element:a.elements[c],code:b});return e("sequence",{node:a,code:b})},labeled:function(a){return g(a.expression)},simple_and:f("simple_and"),simple_not:f("simple_not"),semantic_and:f("semantic_and"),semantic_not:f("semantic_not"),optional:f("optional"),zero_or_more:f("zero_or_more"),one_or_more:f("one_or_more"),action:f("action"),rule_ref:f("rule_ref"),literal:f("literal"),any:f("any"),"class":function(a){var b;return a.parts.length>0?b="/^["+(a.inverted?"^":"")+map(a.parts,function(a){return a instanceof Array?quoteForRegexpClass(a[0])+"-"+quoteForRegexpClass(a[1]):quoteForRegexpClass(a)}).join("")+"]/"+(a.ignoreCase?"i":""):b=a.inverted?"/^[\\S\\s]/":"/^(?!)/",e("class",{node:a,regexp:b})}});return g(a)},PEG}();typeof module!="undefined"&&(module.exports=PEG);
--------------------------------------------------------------------------------
/examples/Blank Example/js/plt.js:
--------------------------------------------------------------------------------
1 | /*
2 | * plt.js 0.2.0
3 | *
4 | * http://github.com/nasser/pltjs
5 | *
6 | * Copyright (c) 2014 Ramsey Nasser
7 | * Licensend under the MIT license.
8 | */
9 |
10 | // configuration object
11 | // refreshes every second by default
12 | var PLT = {
13 | refresh: false,
14 | refreshTime: 1000,
15 |
16 | parser: null
17 | };
18 |
19 | $(function() {
20 | // inject css style to format code elements and body text
21 | var cssNode = document.createElement('style');
22 | cssNode.innerHTML = "body { font-family: sans-serif; }";
23 | cssNode.innerHTML += "code { display: block; white-space: pre; margin-bottom: 1em; }";
24 | cssNode.innerHTML += "#repl { height: 1em; }";
25 | cssNode.innerHTML += "#repl .error { color: red; }";
26 | cssNode.innerHTML += "#repl pre { background: #eee; padding: 5px; }";
27 | cssNode.innerHTML += "textarea { opacity:0 }";
28 | cssNode.innerHTML += ".jqconsole-cursor { background: gray; }";
29 | document.body.appendChild(cssNode);
30 |
31 | // extract PEG grammar from element and build parser
32 | var grammarElement = $("grammar");
33 | PLT.parser = PEG.buildParser(grammarElement.text())
34 | grammarElement.remove();
35 |
36 | var stringifiedParse = function(source) {
37 | return JSON.stringify(PLT.parser.parse(source));
38 | }
39 |
40 | // build repl object
41 | $('').
42 | appendTo("body");
43 | var repl = $("#repl").jqconsole("", '> ');
44 | $("#repl div").attr('style', '');
45 |
46 | var startPrompt = function () {
47 | repl.Prompt(true, function (input) {
48 | try {
49 | var evalfn = PLT.repl || stringifiedParse;
50 | repl.Write(evalfn(input) + '\n', 'jqconsole-output');
51 | } catch(err) {
52 | repl.Write(err.message + "\n", 'error');
53 | }
54 | startPrompt();
55 |
56 | // scroll to the repl when on new line
57 | repl.$console.get(0).scrollIntoView();
58 | });
59 | }
60 | startPrompt();
61 |
62 | // scroll to the repl when a key is pressed
63 | repl.$input_source.keypress(function() { repl.$console.get(0).scrollIntoView(); });
64 |
65 | // focus the repl by default
66 | repl.Focus();
67 |
68 | $('' + $('title').text() + '
').
69 | prependTo("body");
70 |
71 | // collect all correct code examples and try and parse them
72 | var goods = document.querySelectorAll("code:not([bad])")
73 | for (var i = 0; i < goods.length; i++) {
74 | try {
75 | var str = stringifiedParse(goods[i].textContent);
76 |
77 | // Look for expected attribute like this:
78 | if(goods[i].attributes.getNamedItem('expect')){
79 | var expectedValue = goods[i].attributes.getNamedItem('expect').value;
80 |
81 | // Create a regEx from the expectedValue
82 | var re = new RegExp(expectedValue, "");
83 |
84 | // Validate that the expected value matches the returned value
85 | if(!str.match(re)){
86 | var error = new Error('Expected '+expectedValue+" but got "+str)
87 | error.line = 0;
88 | throw error;
89 | }
90 | }
91 | // the code parsed, append result in grey
92 | goods[i].innerHTML += "\n↳ " + str + "";
93 |
94 | } catch (err) {
95 | // the code did not parse, append result in red
96 |
97 | // Add carrot to show the position of the error
98 | var carrot = '';
99 | if(err.line == goods[i].textContent.split('\n').length){
100 | carrot = Array(err.column).join(' ')+'↑\n'
101 | }
102 |
103 | // If there is line info, add information about where the error is
104 | var lineError = '';
105 | if(err.line){
106 | lineError = "
\t" + "Line " + err.line + " Column " + err.column;
107 | }
108 |
109 | goods[i].innerHTML += "\n" + carrot + " " + err.message + lineError + "";
110 | }
111 | }
112 |
113 | // collect all incorrect code examples and try and parse them
114 | var bads = document.querySelectorAll("code[bad]")
115 | for (var i = 0; i < bads.length; i++) {
116 | try {
117 | var str = stringifiedParse(goods[i].textContent);
118 | // the code parsed, append result in red
119 | bads[i].innerHTML += "\n↳ " + str + "";
120 |
121 | } catch (err) {
122 | // the code did not parse, append result in gray
123 | bads[i].innerHTML += "\n↳ " + err.message + "";
124 |
125 | }
126 | }
127 |
128 | // refresh the page if refreshing is enabled
129 | setInterval(function() { if(PLT.refresh) window.location.reload(true) }, PLT.refreshTime);
130 | });
131 |
--------------------------------------------------------------------------------
/examples/README.md:
--------------------------------------------------------------------------------
1 | # Examples for Writing Your Own Grammar
2 |
3 | This repo includes:
4 |
5 | * **Trees Please**: a LISP implementation I wrote at SFPC & Recurse Center. This example has a fairly robust interpreter, including scoping. This example was written to be used from a web REPL.
6 |
7 | * **Whenever.js**: a quick implementation of the esolang [Whenever](http://www.dangermouse.net/esoteric/whenever.html). Expected statements are Javascript functions or Whenever-style statement manipulation.[See, for example, this Friday Pathalogical Programmming article.](http://scienceblogs.com/goodmath/2006/07/28/friday-pathological-programmin-1/) For more details, see README in `whenver.js` directory. This example includes a command-line interface.
8 |
9 | * A blank example for you start jamming on.
10 |
11 | Also check out:
12 | * the code behind [ComicStripScript](https://github.com/yukiy/ComicStripScript) to get a feel for generating images and `canvas` objects from a grammar
13 | * Ramsey Nasser's [Rejoyce implementations](https://github.com/nasser/rejoyce), for the stack approach
--------------------------------------------------------------------------------
/examples/TreesPlease/js/jqconsole.js:
--------------------------------------------------------------------------------
1 | (function(){var t,e,i,s,r,o,n,h,p,c,a,l,u,_,f,m,d,$,y,v,g,x,b,k,w,C,T,S,M,P,H,E,L,I,W,D,A,R=function(t,e){return function(){return t.apply(e,arguments)}},U=[].slice;t=jQuery;I=0;W=1;D=2;w=13;H=9;x=46;g=8;T=37;P=39;E=38;b=40;C=36;k=35;M=33;S=34;p="jqconsole-";r=""+p+"cursor";o=""+p+"header";c=""+p+"prompt";h=""+p+"old-prompt";n=""+p+"input";s=""+p+"blurred";y="keypress";m="";_="";f=":empty";L="\n";u=">>> ";l="... ";a=2;i=""+p+"ansi-";d="";$=/\[(\d*)(?:;(\d*))*m/;e=function(){t.prototype.COLORS=["black","red","green","yellow","blue","magenta","cyan","white"];function t(){this.stylize=R(this.stylize,this);this._closeSpan=R(this._closeSpan,this);this._openSpan=R(this._openSpan,this);this.getClasses=R(this.getClasses,this);this._style=R(this._style,this);this._color=R(this._color,this);this._remove=R(this._remove,this);this._append=R(this._append,this);this.klasses=[]}t.prototype._append=function(t){t=""+i+t;if(this.klasses.indexOf(t)===-1){return this.klasses.push(t)}};t.prototype._remove=function(){var t,e,s,r,o,n;s=1<=arguments.length?U.call(arguments,0):[];n=[];for(r=0,o=s.length;r'+t};t.prototype._closeSpan=function(t){return""+t+" "};t.prototype.stylize=function(t){var e,i,s,r,o,n;t=this._openSpan(t);s=0;while((s=t.indexOf(d,s))&&s!==-1){if(i=t.slice(s).match($)){n=i.slice(1);for(r=0,o=n.length;r'+(e||"")+""};v=function(){function i(i,s,r,n){this._HideComposition=R(this._HideComposition,this);this._ShowComposition=R(this._ShowComposition,this);this._UpdateComposition=R(this._UpdateComposition,this);this._EndComposition=R(this._EndComposition,this);this._StartComposition=R(this._StartComposition,this);this._CheckComposition=R(this._CheckComposition,this);this._ProcessMatch=R(this._ProcessMatch,this);this._HandleKey=R(this._HandleKey,this);this._HandleChar=R(this._HandleChar,this);this.isMobile=!!navigator.userAgent.match(/iPhone|iPad|iPod|Android/i);this.isIos=!!navigator.userAgent.match(/iPhone|iPad|iPod/i);this.isAndroid=!!navigator.userAgent.match(/Android/i);this.$window=t(window);this.header=s||"";this.prompt_label_main=typeof r==="string"?r:u;this.prompt_label_continue=n||l;this.indent_width=a;this.state=W;this.input_queue=[];this.input_callback=null;this.multiline_callback=null;this.history=[];this.history_index=0;this.history_new="";this.history_active=false;this.shortcuts={};this.$container=t("").appendTo(i);this.$container.css({top:0,left:0,right:0,bottom:0,position:"absolute",overflow:"auto"});this.$console=t('').appendTo(this.$container);this.$console.css({margin:0,position:"relative","min-height":"100%","box-sizing":"border-box","-moz-box-sizing":"border-box","-webkit-box-sizing":"border-box"});this.$console_focused=true;this.$input_container=t(_).appendTo(this.$container);this.$input_container.css({position:"absolute",width:1,height:0,overflow:"hidden"});this.$input_source=this.isAndroid?t(""):t("");this.$input_source.attr({wrap:"off",autocapitalize:"off",autocorrect:"off",spellcheck:"false",autocomplete:"off"});this.$input_source.css({position:"absolute",width:2});this.$input_source.appendTo(this.$input_container);this.$composition=t(_);this.$composition.addClass(""+p+"composition");this.$composition.css({display:"inline",position:"relative"});this.matchings={openings:{},closings:{},clss:[]};this.ansi=new e;this._InitPrompt();this._SetupEvents();this.Write(this.header,o);t(i).data("jqconsole",this)}i.prototype.ResetHistory=function(){return this.SetHistory([])};i.prototype.ResetShortcuts=function(){return this.shortcuts={}};i.prototype.ResetMatchings=function(){return this.matchings={openings:{},closings:{},clss:[]}};i.prototype.Reset=function(){if(this.state!==W){this.ClearPromptText(true)}this.state=W;this.input_queue=[];this.input_callback=null;this.multiline_callback=null;this.ResetHistory();this.ResetShortcuts();this.ResetMatchings();this.$prompt.detach();this.$input_container.detach();this.$console.html("");this.$prompt.appendTo(this.$console);this.$input_container.appendTo(this.$container);this.Write(this.header,o);return void 0};i.prototype.GetHistory=function(){return this.history};i.prototype.SetHistory=function(t){this.history=t.slice();return this.history_index=this.history.length};i.prototype._CheckKeyCode=function(t){if(isNaN(t)){t=t.charCodeAt(0)}else{t=parseInt(t,10)}if(!(0>> "))}else{o.push(t(i).text())}}return o}().join("")};i.prototype.GetState=function(){if(this.state===I){return"input"}else if(this.state===W){return"output"}else{return"prompt"}};i.prototype.Disable=function(){this.$input_source.attr("disabled",true);return this.$input_source.blur()};i.prototype.Enable=function(){return this.$input_source.attr("disabled",false)};i.prototype.IsDisabled=function(){return Boolean(this.$input_source.attr("disabled"))};i.prototype.MoveToStart=function(t){this._MoveTo(t,true);return void 0};i.prototype.MoveToEnd=function(t){this._MoveTo(t,false);return void 0};i.prototype.Clear=function(){this.$console.find("."+o).nextUntil("."+c).addBack().text("");this.$prompt_cursor.detach();return this.$prompt_after.before(this.$prompt_cursor)};i.prototype._CheckInputQueue=function(){if(this.input_queue.length){return this.input_queue.shift()()}};i.prototype._InitPrompt=function(){this.$prompt=t(A(n)).appendTo(this.$console);this.$prompt_before=t(m).appendTo(this.$prompt);this.$prompt_current=t(m).appendTo(this.$prompt);this.$prompt_after=t(m).appendTo(this.$prompt);this.$prompt_label=t(m).appendTo(this.$prompt_current);this.$prompt_left=t(m).appendTo(this.$prompt_current);this.$prompt_right=t(m).appendTo(this.$prompt_current);this.$prompt_right.css({position:"relative"});this.$prompt_cursor=t(A(r," "));this.$prompt_cursor.insertBefore(this.$prompt_right);this.$prompt_cursor.css({color:"transparent",display:"inline",zIndex:0});if(!this.isMobile){return this.$prompt_cursor.css("position","absolute")}};i.prototype._SetupEvents=function(){var t=this;if(this.isMobile){this.$console.click(function(e){e.preventDefault();return t.Focus()})}else{this.$console.mouseup(function(e){var i;if(e.which===2){return t.Focus()}else{i=function(){if(!window.getSelection().toString()){e.preventDefault();return t.Focus()}};return setTimeout(i,0)}})}this.$input_source.focus(function(){var e,i;t._ScrollToEnd();t.$console_focused=true;t.$console.removeClass(s);i=function(){if(t.$console_focused){return t.$console.removeClass(s)}};setTimeout(i,100);e=function(){if(t.isIos&&t.$console_focused){return t.$input_source.hide()}};return setTimeout(e,500)});this.$input_source.blur(function(){var e;t.$console_focused=false;if(t.isIos){t.$input_source.show()}e=function(){if(!t.$console_focused){return t.$console.addClass(s)}};return setTimeout(e,100)});this.$input_source.bind("paste",function(){var e;e=function(){if(t.in_composition){return}t._AppendPromptText(t.$input_source.val());t.$input_source.val("");return t.Focus()};return setTimeout(e,0)});this.$input_source.keypress(this._HandleChar);this.$input_source.keydown(this._HandleKey);this.$input_source.keydown(this._CheckComposition);this.$input_source.bind("compositionstart",this._StartComposition);this.$input_source.bind("compositionend",function(e){return setTimeout(function(){return t._EndComposition(e)},0)});if(this.isAndroid){this.$input_source.bind("input",this._StartComposition);return this.$input_source.bind("input",this._UpdateComposition)}else{return this.$input_source.bind("text",this._UpdateComposition)}};i.prototype._HandleChar=function(t){var e;if(this.state===W||t.metaKey||t.ctrlKey){return true}e=t.which;if(e===8||e===9||e===13){return false}this.$prompt_left.text(this.$prompt_left.text()+String.fromCharCode(e));this._ScrollToEnd();return false};i.prototype._HandleKey=function(e){var i;if(this.state===W){return true}i=e.keyCode||e.which;setTimeout(t.proxy(this._CheckMatchings,this),0);if(e.altKey){return true}else if(e.ctrlKey||e.metaKey){return this._HandleCtrlShortcut(i)}else if(e.shiftKey){switch(i){case w:this._HandleEnter(true);break;case H:this._Unindent();break;case E:this._MoveUp();break;case b:this._MoveDown();break;case M:this._ScrollPage("up");break;case S:this._ScrollPage("down");break;default:return true}return false}else{switch(i){case w:this._HandleEnter(false);break;case H:this._Indent();break;case x:this._Delete(false);break;case g:this._Backspace(false);break;case T:this._MoveLeft(false);break;case P:this._MoveRight(false);break;case E:this._HistoryPrevious();break;case b:this._HistoryNext();break;case C:this.MoveToStart(false);break;case k:this.MoveToEnd(false);break;case M:this._ScrollPage("up");break;case S:this._ScrollPage("down");break;default:return true}return false}};i.prototype._HandleCtrlShortcut=function(t){var e,i,s,r;switch(t){case x:this._Delete(true);break;case g:this._Backspace(true);break;case T:this._MoveLeft(true);break;case P:this._MoveRight(true);break;case E:this._MoveUp();break;case b:this._MoveDown();break;case k:this.MoveToEnd(true);break;case C:this.MoveToStart(true);break;default:if(t in this.shortcuts){r=this.shortcuts[t];for(i=0,s=r.length;ih;o=0<=h?++n:--n){if(t>0){c.push(s._Indent())}else{c.push(s._Unindent())}}return c}else{r=s.state===I?"input":"prompt";s.Write(s.GetPromptText(true)+L,""+p+"old-"+r);s.ClearPromptText(true);if(s.history_active){if(!s.history.length||s.history[s.history.length-1]!==i){s.history.push(i)}s.history_index=s.history.length}s.state=W;e=s.input_callback;s.input_callback=null;if(e){e(i)}return s._CheckInputQueue()}};if(this.multiline_callback){if(this.async_multiline){return this.multiline_callback(i,e)}else{return e(this.multiline_callback(i))}}else{return e(false)}}};i.prototype._GetDirectionals=function(e){var i,s,r,o,n,h,p,c;o=e?this.$prompt_left:this.$prompt_right;i=e?this.$prompt_right:this.$prompt_left;r=e?this.$prompt_before:this.$prompt_after;s=e?this.$prompt_after:this.$prompt_before;h=e?t.proxy(this.MoveToStart,this):t.proxy(this.MoveToEnd,this);n=e?t.proxy(this._MoveLeft,this):t.proxy(this._MoveRight,this);c=e?"last":"first";p=e?"prependTo":"appendTo";return{$prompt_which:o,$prompt_opposite:i,$prompt_relative:r,$prompt_rel_opposite:s,MoveToLimit:h,MoveDirection:n,which_end:c,where_append:p}};i.prototype._VerticalMove=function(t){var e,i,s,r,o,n,h,p;p=this._GetDirectionals(t),s=p.$prompt_which,e=p.$prompt_opposite,i=p.$prompt_relative,o=p.MoveToLimit,r=p.MoveDirection;if(i.is(f)){return}n=this.$prompt_left.text().length;o();r();h=s.text();e.text(t?h.slice(n):h.slice(0,n));return s.text(t?h.slice(0,n):h.slice(n))};i.prototype._MoveUp=function(){return this._VerticalMove(true)};i.prototype._MoveDown=function(){return this._VerticalMove()};i.prototype._HorizontalMove=function(e,i){var s,r,o,n,h,p,c,a,l,u,_,d,$,y;y=this._GetDirectionals(i),h=y.$prompt_which,r=y.$prompt_opposite,n=y.$prompt_relative,o=y.$prompt_rel_opposite,d=y.which_end,_=y.where_append;a=i?/\w*\W*$/:/^\w*\W*/;l=h.text();if(l){if(e){$=l.match(a);if(!$){return}$=$[0];u=r.text();r.text(i?$+u:u+$);c=$.length;return h.text(i?l.slice(0,-c):l.slice(c))}else{u=r.text();r.text(i?l.slice(-1)+u:u+l[0]);return h.text(i?l.slice(0,-1):l.slice(1))}}else if(!n.is(f)){p=t(m)[_](o);p.append(t(m).text(this.$prompt_label.text()));p.append(t(m).text(r.text()));s=n.children()[d]().detach();this.$prompt_label.text(s.children().first().text());h.text(s.children().last().text());return r.text("")}};i.prototype._MoveLeft=function(t){return this._HorizontalMove(t,true)};i.prototype._MoveRight=function(t){return this._HorizontalMove(t)};i.prototype._MoveTo=function(t,e){var i,s,r,o,n,h,p;h=this._GetDirectionals(e),r=h.$prompt_which,i=h.$prompt_opposite,s=h.$prompt_relative,n=h.MoveToLimit,o=h.MoveDirection;if(t){p=[];while(!(s.is(f)&&r.text()==="")){n(false);p.push(o(false))}return p}else{i.text(this.$prompt_left.text()+this.$prompt_right.text());return r.text("")}};i.prototype._Delete=function(t){var e,i,s;i=this.$prompt_right.text();if(i){if(t){s=i.match(/^\w*\W*/);if(!s){return}s=s[0];return this.$prompt_right.text(i.slice(s.length))}else{return this.$prompt_right.text(i.slice(1))}}else if(!this.$prompt_after.is(f)){e=this.$prompt_after.children().first().detach();return this.$prompt_right.text(e.children().last().text())}};i.prototype._Backspace=function(e){var i,s,r;setTimeout(t.proxy(this._ScrollToEnd,this),0);s=this.$prompt_left.text();if(s){if(e){r=s.match(/\w*\W*$/);if(!r){return}r=r[0];return this.$prompt_left.text(s.slice(0,-r.length))}else{return this.$prompt_left.text(s.slice(0,-1))}}else if(!this.$prompt_before.is(f)){i=this.$prompt_before.children().last().detach();this.$prompt_label.text(i.children().first().text());return this.$prompt_left.text(i.children().last().text())}};i.prototype._Indent=function(){var t;return this.$prompt_left.prepend(function(){var e,i,s;s=[];for(t=e=1,i=this.indent_width;1<=i?e<=i:e>=i;t=1<=i?++e:--e){s.push(" ")}return s}.call(this).join(""))};i.prototype._Unindent=function(){var t,e,i,s,r;t=this.$prompt_left.text()+this.$prompt_right.text();r=[];for(e=i=1,s=this.indent_width;1<=s?i<=s:i>=s;e=1<=s?++i:--i){if(!/^ /.test(t)){break}if(this.$prompt_left.text()){this.$prompt_left.text(this.$prompt_left.text().slice(1))}else{this.$prompt_right.text(this.$prompt_right.text().slice(1))}r.push(t=t.slice(1))}return r};i.prototype._InsertNewLine=function(e){var i,s,r;if(e==null){e=false}r=this._SelectPromptLabel(!this.$prompt_before.is(f));i=t(m).appendTo(this.$prompt_before);i.append(t(m).text(r));i.append(t(m).text(this.$prompt_left.text()));this.$prompt_label.text(this._SelectPromptLabel(true));if(e&&(s=this.$prompt_left.text().match(/^\s+/))){this.$prompt_left.text(s[0])}else{this.$prompt_left.text("")}return this._ScrollToEnd()};i.prototype._AppendPromptText=function(t){var e,i,s,r,o,n;i=t.split(L);this.$prompt_left.text(this.$prompt_left.text()+i[0]);o=i.slice(1);n=[];for(s=0,r=o.length;ss.top){return this.$window.scrollTop(i)}}else{if(o+ti){return this.$window.scrollTop(s.top)}}};i.prototype._SelectPromptLabel=function(t){if(this.state===D){if(t){return" \n"+this.prompt_label_continue}else{return this.prompt_label_main}}else{if(t){return"\n "}else{return" "}}};i.prototype._Wrap=function(t,e,i){var s,r;r=t.html();s=r.slice(0,e)+A(i,r[e])+r.slice(e+1);return t.html(s)};i.prototype._WalkCharacters=function(t,e,i,s,r){var o,n,h;n=r?t.length:0;t=t.split("");h=function(){var e,i,s,o;if(r){s=t,t=2<=s.length?U.call(s,0,i=s.length-1):(i=0,[]),e=s[i++]}else{o=t,e=o[0],t=2<=o.length?U.call(o,1):[]}if(e){n=n+(r?-1:+1)}return e};while(o=h()){if(o===e){s++}else if(o===i){s--}if(s===0){return{index:n,current_count:s}}}return{index:-1,current_count:s}};i.prototype._ProcessMatch=function(e,i,s){var r,o,n,h,p,c,a,l,u,_,f,m,d=this;_=i?[e["closing_char"],e["opening_char"]]:[e["opening_char"],e["closing_char"]],h=_[0],l=_[1];f=this._GetDirectionals(i),n=f.$prompt_which,o=f.$prompt_relative;p=1;c=false;u=n.html();if(!i){u=u.slice(1)}if(s&&i){u=u.slice(0,-1)}m=this._WalkCharacters(u,h,l,p,i),a=m.index,p=m.current_count;if(a>-1){this._Wrap(n,a,e.cls);c=true}else{r=o.children();r=i?Array.prototype.reverse.call(r):r;r.each(function(s,r){var o,n;o=t(r).children().last();u=o.html();n=d._WalkCharacters(u,h,l,p,i),a=n.index,p=n.current_count;if(a>-1){if(!i){a--}d._Wrap(o,a,e.cls);c=true;return false}})}return c};i.prototype._CheckMatchings=function(e){var i,s,r,o,n,h,p;r=e?this.$prompt_left.text().slice(this.$prompt_left.text().length-1):this.$prompt_right.text()[0];p=this.matchings.clss;for(n=0,h=p.length;n=this.history.length){return}if(this.history_index===this.history.length-1){this.history_index++;return this.SetPromptText(this.history_new)}else{return this.SetPromptText(this.history[++this.history_index])}};i.prototype._CheckComposition=function(t){var e;e=t.keyCode||t.which;if(e===229){if(this.in_composition){return this._UpdateComposition()}else{return this._StartComposition()}}};i.prototype._StartComposition=function(){if(this.in_composition){return}this.in_composition=true;this._ShowComposition();return setTimeout(this._UpdateComposition,0)};i.prototype._EndComposition=function(){if(!this.in_composition){return}this._HideComposition();this.$prompt_left.text(this.$prompt_left.text()+this.$composition.text());this.$composition.text("");this.$input_source.val("");return this.in_composition=false};i.prototype._UpdateComposition=function(t){var e,i=this;e=function(){if(!i.in_composition){return}return i.$composition.text(i.$input_source.val())};return setTimeout(e,0)};i.prototype._ShowComposition=function(){this.$composition.css("height",this.$prompt_cursor.height());this.$composition.empty();return this.$composition.appendTo(this.$prompt_left)};i.prototype._HideComposition=function(){return this.$composition.detach()};return i}();t.fn.jqconsole=function(t,e,i){return new v(this,t,e,i)};t.fn.jqconsole.JQConsole=v;t.fn.jqconsole.Ansi=e}).call(this);
--------------------------------------------------------------------------------
/examples/TreesPlease/js/plt.js:
--------------------------------------------------------------------------------
1 | /*
2 | * plt.js 0.2.0
3 | *
4 | * http://github.com/nasser/pltjs
5 | *
6 | * Copyright (c) 2014 Ramsey Nasser
7 | * Licensend under the MIT license.
8 | */
9 |
10 | // configuration object
11 | // refreshes every second by default
12 | var PLT = {
13 | refresh: false,
14 | refreshTime: 1000,
15 |
16 | parser: null
17 | };
18 |
19 | $(function() {
20 | // inject css style to format code elements and body text
21 | var cssNode = document.createElement('style');
22 | cssNode.innerHTML = "body { font-family: sans-serif; }";
23 | cssNode.innerHTML += "code { display: block; white-space: pre; margin-bottom: 1em; }";
24 | cssNode.innerHTML += "#repl { height: 1em; }";
25 | cssNode.innerHTML += "#repl .error { color: red; }";
26 | cssNode.innerHTML += "#repl pre { background: #eee; padding: 5px; }";
27 | cssNode.innerHTML += "textarea { opacity:0 }";
28 | cssNode.innerHTML += ".jqconsole-cursor { background: gray; }";
29 | document.body.appendChild(cssNode);
30 |
31 | // extract PEG grammar from element and build parser
32 | var grammarElement = $("grammar");
33 | PLT.parser = PEG.buildParser(grammarElement.text())
34 | grammarElement.remove();
35 |
36 | var stringifiedParse = function(source) {
37 | return JSON.stringify(PLT.parser.parse(source));
38 | }
39 |
40 | // build repl object
41 | $('').
42 | appendTo("body");
43 | var repl = $("#repl").jqconsole("", '> ');
44 | $("#repl div").attr('style', '');
45 |
46 | var startPrompt = function () {
47 | repl.Prompt(true, function (input) {
48 | try {
49 | var evalfn = PLT.repl || stringifiedParse;
50 | repl.Write(evalfn(input) + '\n', 'jqconsole-output');
51 | } catch(err) {
52 | repl.Write(err.message + "\n", 'error');
53 | }
54 | startPrompt();
55 |
56 | // scroll to the repl when on new line
57 | repl.$console.get(0).scrollIntoView();
58 | });
59 | }
60 | startPrompt();
61 |
62 | // scroll to the repl when a key is pressed
63 | repl.$input_source.keypress(function() { repl.$console.get(0).scrollIntoView(); });
64 |
65 | // focus the repl by default
66 | repl.Focus();
67 |
68 | $('' + $('title').text() + '
').
69 | prependTo("body");
70 |
71 | // collect all correct code examples and try and parse them
72 | var goods = document.querySelectorAll("code:not([bad])")
73 | for (var i = 0; i < goods.length; i++) {
74 | try {
75 | var str = stringifiedParse(goods[i].textContent);
76 |
77 | // Look for expected attribute like this:
78 | if(goods[i].attributes.getNamedItem('expect')){
79 | var expectedValue = goods[i].attributes.getNamedItem('expect').value;
80 |
81 | // Create a regEx from the expectedValue
82 | var re = new RegExp('^'+ expectedValue + '$', '');
83 |
84 | // Validate that the expected value matches the returned value
85 | if(!str.match(re)){
86 | var error = new Error('Expected '+expectedValue+" but got "+str)
87 | error.line = 0;
88 | throw error;
89 | }
90 | }
91 | // the code parsed, append result in grey
92 | goods[i].innerHTML += "\n↳ " + str + "";
93 |
94 | } catch (err) {
95 | // the code did not parse, append result in red
96 |
97 | // Add carrot to show the position of the error
98 | var carrot = '';
99 | if(err.line == goods[i].textContent.split('\n').length){
100 | carrot = Array(err.column).join(' ')+'↑\n'
101 | }
102 |
103 | // If there is line info, add information about where the error is
104 | var lineError = '';
105 | if(err.line){
106 | lineError = "
\t" + "Line " + err.line + " Column " + err.column;
107 | }
108 |
109 | goods[i].innerHTML += "\n" + carrot + " " + err.message + lineError + "";
110 | }
111 | }
112 |
113 | // collect all incorrect code examples and try and parse them
114 | var bads = document.querySelectorAll("code[bad]")
115 | for (var i = 0; i < bads.length; i++) {
116 | try {
117 | var str = stringifiedParse(goods[i].textContent);
118 | // the code parsed, append result in red
119 | bads[i].innerHTML += "\n↳ " + str + "";
120 |
121 | } catch (err) {
122 | // the code did not parse, append result in gray
123 | bads[i].innerHTML += "\n↳ " + err.message + "";
124 |
125 | }
126 | }
127 |
128 | // refresh the page if refreshing is enabled
129 | setInterval(function() { if(PLT.refresh) window.location.reload(true) }, PLT.refreshTime);
130 | });
131 |
--------------------------------------------------------------------------------
/examples/TreesPlease/treesplease.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
14 |
15 | Language
16 |
17 |
18 | start = program / id
19 | program = scope / assignment / operation / string / number
20 |
21 | scope = space '(' space 'let' space as:assignment+ space ar:start* space pr:program* space ')'
22 | {return { operator: 'let', expressions: [as, ar, pr] } }
23 |
24 |
25 | operation = space '(' space o:operator space exp:start* space ')' space
26 | { return {operator: o, expressions: exp }}
27 | operator = '>'/'<'/'+'/'-'/'*'/'='/'if'/'let'/'print'/id
28 |
29 |
30 | assignment = space '[' space i:id space s:string space ']' space
31 | { return { operator: 'assignment', expressions: [i, s]}; }
32 |
33 | string = space quote str:(mandatory_space/letter)+ quote space { return str.join("") ; }
34 | id = r:raw_id { return {operator: 'var', expressions: r } }
35 | raw_id = t:text+ { return t.join(""); }
36 | letter = [^" \n]
37 | text = [a-zA-Z-]
38 |
39 | number = d:digit+ space { return +(d.join('')); }
40 | digit = [0123456789.-]
41 |
42 | space = [ \n]* / !. { return undefined }
43 | mandatory_space = [ \n]+ / !. { return undefined }
44 |
45 | quote = ["']
46 |
47 |
48 |
49 | Numbers
50 | 67
51 | -17
52 | 22.3
53 | -0.3
54 |
55 | Strings
56 | "Hello, World!"
57 |
58 | Identifiers
59 | These are used for variable names. How do you parse them into somehting different from a string?
60 | foo
61 | bar
62 | some-identifier
63 |
64 | Operations
65 | (+ 1 2)
66 | (- 1 2)
67 | (* 1 2)
68 | (+ 1 2 3 4 5)
69 | (< 5 6)
70 | (< 5 6 8 20 34)
71 | (+ 5 6 (+ 8 20) 34)
72 | (print "Hello, World!")
73 | (print "hey" "you")
74 | (= (+ 1 2) (+ 3 4))
75 |
76 | Nesting
77 | (< (+ 1 2) 6)
78 | (< (+ 1 2) (+ 8 (* 3 (+ 8 (* 3 (+ 8 (* 3 4)))))))
79 | (if (< 20 10) 55 22)
80 | (if (< 20 10) (print "less!") (print "more!"))
81 |
82 | Scope
83 | (let [name "Sarah"] (print name) (print "pie"))
84 | (let [name "Sarah"] [tiger "elephant"] (print name) (print "pie") (print tiger))
85 | (let [name "Sarah"] (let [tiger "elephant"] (print name)) 1)
86 | (let [name "Sarah"] (let [tiger "elephant"] (print name)) "1")
87 | (let [name "Sarah"] (let [tiger "elephant"] (print tiger) (print name)) (print tiger) (print name))
88 |
89 | (let [name "Sarah"] (let [name "Hacker School"] (print name)) (print name))
--------------------------------------------------------------------------------
/examples/TreesPlease/treesplease.js:
--------------------------------------------------------------------------------
1 | // Access functions & scope
2 |
3 | var specialForms = {
4 | 'if': function (args) {
5 | if (evaluate(args[0])){
6 | return evaluate(args[1]);
7 | } else {
8 | return evaluate(args[2]);
9 | }
10 | },
11 |
12 | 'let': function (args){
13 | var flatArgs = _.flatten(args);
14 | return assignment(flatArgs[0], flatArgs.slice(1));
15 | },
16 |
17 | 'assignment': assignment,
18 |
19 | 'var': lookup
20 | };
21 |
22 |
23 | var builtIn = {
24 | '+': function(args) { return infix(args)('+')},
25 | '-': function(args) { return infix(args)('-')},
26 | '*': function(args) { return infix(args)('*')},
27 | '<': function(args) { return infix(args)('<')},
28 | '>': function(args) { return infix(args)('>')},
29 |
30 | '=': function (args) {
31 | var args = moveOverArgs([], args);
32 | return eval(args.join('==='));
33 | },
34 |
35 | 'print': function (args, scope) {
36 | var args = moveOverArgs([], args, scope);
37 | return args.join('');
38 | }
39 |
40 | }
41 |
42 | var scopes = [ builtIn ];
43 |
44 | // Utility functions
45 |
46 | function moveOverArgs(currentArr, arr, scope) {
47 |
48 | typeof arr[0] === 'object' ? currentArr.push(evaluate(arr[0], scope)) : currentArr.push(arr[0]);
49 |
50 | var remainingArr = arr.slice(1);
51 | if (remainingArr.length > 0) {
52 | return moveOverArgs(currentArr, remainingArr, scope);
53 | } else {
54 | return currentArr;
55 | }
56 | }
57 |
58 |
59 | function infix (args) {
60 | return function(operator){
61 | args = moveOverArgs([], args);
62 | return eval(args.join(operator));
63 | }
64 | }
65 |
66 | function assignment (assign, rest, scoped) {
67 |
68 | // the first expression following 'let' MUST be a binding
69 |
70 | var variable = assign.expressions[0].expressions,
71 | value = assign.expressions[1];
72 |
73 | // put identity in current scope or create new scope and add
74 |
75 | if (scoped) {
76 | scopes[scopes.length - 1][variable] = value;
77 | } else {
78 | scopes.push(Object.create(Object.prototype));
79 | scopes[scopes.length - 1][variable] = value;
80 | }
81 |
82 | // iterate through all assignments before then evaluate other expressions
83 |
84 | if(rest.length && rest[0].operator === 'assignment'){
85 | return specialForms.assignment(rest[0], rest.slice(1), true);
86 | } else {
87 | return moveOverArgs([], rest, scopes.length - 1);
88 | }
89 | }
90 |
91 | function lookup(args, scope){
92 |
93 | var scope = scope;
94 |
95 | return (function checkScope(check){
96 | if (check >= 0){
97 | if (scopes[scope][args]){
98 | return scopes[scope][args];
99 | } else {
100 | scope -= 1;
101 | return checkScope(scope);
102 | }
103 | } else {
104 | return 'Reference error. There is no variable ' + args + '. '
105 | }
106 | })(scope);
107 |
108 | }
109 |
110 | function resetScopes(){
111 | scopes = _.dropRight(scopes, scopes.length - 1);
112 | }
113 |
114 | // Evaluation
115 |
116 | var evaluate = function(ast, scope) {
117 |
118 | // Check first that on recursion we haven't just received a scalar value that can be returned
119 |
120 | if(!(ast && typeof ast === 'object')) {
121 | return ast;
122 | }
123 |
124 | // Then set scope & evaluate
125 |
126 | var scope = scope || 0,
127 | special = specialForms[ast.operator];
128 |
129 | console.log(ast, ast.operator, scope);
130 |
131 | if (special) {
132 | return special(ast.expressions, scope);
133 | } else {
134 | return lookup(ast.operator, scope)(ast.expressions, scope);
135 | }
136 |
137 | };
138 |
139 | // Run function
140 |
141 | var run = function(source) {
142 | var ast = PLT.parser.parse(source);
143 | resetScopes();
144 | return evaluate(ast);
145 | };
--------------------------------------------------------------------------------
/examples/whenever.js/README.md:
--------------------------------------------------------------------------------
1 | # whenever.js
2 |
3 | An adaptation and implementation of [Whenever](http://www.dangermouse.net/esoteric/whenever.html) into Javascript.
4 |
5 | The biggest divergence from the original implementation is that whenever.js uses function declarations instead of statements and refers to them by their name string as opposed to by statement number.
6 |
7 | ## Using Whenever
8 |
9 | Whenever is an esolang playing with the idea of control flow. How do you write a program when statements are called out of sync?
10 |
11 | In Whenever, functions are added to an execution bag and then executed in random order. That's pretty much it. Functions are removed from the bag on execution unless otherwise directed by in-built functions (see below).
12 |
13 | ### Writing a Program
14 |
15 | #### Statements
16 | The base of a whenever.js program is the simple statement. This is an argument-less function declaration (not assignment!):
17 |
18 | ```
19 | function name() { ... }
20 | ```
21 |
22 | When this statement is executed, the function will run. If you would like access to global variables, you can take advantage of the non-strict environment in which whenever runs and use assignment without `var`:
23 |
24 |
25 | ~~var~~ `variable = value;`
26 |
27 |
28 | #### Built-in Functions
29 |
30 | Whenever.js includes most Whenever standard functions (except U()). In this case, they are called as normal Javascript functions within a statement. For instance:
31 |
32 | ```js
33 | // create monsters statement
34 | function monsters() {
35 | console.log('OH NO MONSTERS RUN!!!!');
36 | }
37 |
38 | // add six more copies of the monster statement to the bag
39 | function addMonsters() {
40 | add('monsters', 6);
41 | }
42 | ```
43 |
44 | ##### Add
45 | ```js
46 | add('functionNameAsString', #oftimes)
47 | ```
48 |
49 | Adds given number of copies to the execution bag.
50 |
51 | ##### Remove
52 | ```js
53 | remove('functionNameAsString', #oftimes)
54 | ```
55 |
56 | Removes given number of copies from execution bag. If the number is greater than number of copies, it will leave 0.
57 |
58 | ##### Defer
59 | ```js
60 | defer('functionToBeExecutedFirstAsString', #numberoftimestoexecute, function(){} OR 'functionNameAsString')
61 | ```
62 |
63 | Defer will refrain from running the callback until the named function has been executed the given number of times.
64 |
65 | ##### Again
66 | ```js
67 | again(predicate, function(){} OR 'functionNameAsString')
68 | ```
69 |
70 | If the predicate given to again is true, the callback statement is executed but remains in the bag, to be executed again some time later. If the argument is false, the statement is executed and removed from the to-do list as normal.
71 |
72 | The predicate can be simply the name of a function as well as other boolean options. Writing the following, for instance, would execute `monster` as long as `teeth` has not been executed and removed:
73 |
74 | ```js
75 | function keepMonstersGoing() {
76 | again('teeth', 'monster')
77 | }
78 | ```
79 |
80 |
81 | ##### N
82 | ```js
83 | N('functionNameAsString')
84 | ```
85 |
86 | Will return the number of times the named function has been executed.
87 |
88 | ### Running the Program
89 | Whenever.js executes via command-line. Compile by running
90 |
91 | ```
92 | node ./whenever.js
93 | ```
--------------------------------------------------------------------------------
/examples/whenever.js/example.we:
--------------------------------------------------------------------------------
1 | function teeth() {
2 | console.log('Bite with teeth');
3 | }
4 |
5 | function moo() {
6 | console.log('moo');
7 | theres_a_cow = true;
8 |
9 | add("roof");
10 | add("teeth");
11 | }
12 |
13 | function roof() {
14 | console.log('roof');
15 | theres_a_dog = true;
16 |
17 | if (theres_a_dog) {
18 | add("teeth");
19 | add("moo");
20 | }
21 | }
22 |
23 | function count() {
24 | console.log('teeth', N('teeth'));
25 | }
--------------------------------------------------------------------------------
/examples/whenever.js/lib/grammar.txt:
--------------------------------------------------------------------------------
1 | start = statements / other
2 |
3 | statements = ff:function+ { return ff }
4 |
5 | function = space f:( 'function' space name space '(' space ')' space curly ) space
6 | { return [].concat.apply([], f).join('') }
7 |
8 | curly = '{' c:([^{}]/inner)* '}' { return '{' + [].concat.apply([], c).join('') + '}'; }
9 |
10 | inner = ic:(space '{' [^{}]* '}' space) { return [].concat.apply([], ic); }
11 |
12 | other = [^]+ { console.log('That statment is not properly formed. Please check README for help'); }
13 |
14 | name = t:text+
15 | text = [a-zA-Z0-9-._]
16 |
17 | space = [ \n]* / !.
18 |
--------------------------------------------------------------------------------
/examples/whenever.js/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "whenever.js",
3 | "version": "0.0.1",
4 | "description": "A javascript re-interpretation of Whenever",
5 | "main": "whenever.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/sarahgp/talking-to-machines/tree/master/examples/whenever.js"
12 | },
13 | "keywords": [
14 | "esolang"
15 | ],
16 | "author": "Sarah Groff-Palermo",
17 | "license": "MIT",
18 | "dependencies": {
19 | "commander": "^2.8.1",
20 | "lodash": "^3.10.0",
21 | "pegjs": "^0.8.0"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/examples/whenever.js/whenever.js:
--------------------------------------------------------------------------------
1 | var _ = require('lodash'),
2 | fs = require('fs'),
3 | path = require('path'),
4 | PEG = require('pegjs'),
5 | cli = require('commander');
6 |
7 | cli
8 | .version('0.0.1')
9 | .description('Compile your whenever files by passing the path to the file')
10 | .parse(process.argv);
11 |
12 | // Find the files
13 | var file = fs.readFileSync(cli.args[0]);
14 |
15 |
16 | // Use the grammar to make a parser
17 |
18 | var grammar = fs.readFileSync(__dirname + '/lib/grammar.txt').toString(),
19 | parser = PEG.buildParser(grammar),
20 | bag = parser.parse(file.toString());
21 |
22 | // console.log(bag);
23 |
24 | // Built-in whenever funcs
25 |
26 | var timesCalled = {};
27 |
28 | function getFuncFromString(str) {
29 | return _.find(baseArray, function(el){
30 | return el.name === str;
31 | });
32 | }
33 |
34 | function add(fn, times){
35 | var times = times || 1,
36 | fn = getFuncFromString(fn);
37 |
38 | _.times(times, function(){
39 | workingArr.push(fn);
40 | });
41 | }
42 |
43 | function remove(fn, times){
44 | _.times(times, function(){
45 | var idx = _.findIndex(workingArr, function(el){
46 | return el.name === fn;
47 | });
48 |
49 | workingArr.splice(idx, 1);
50 | });
51 | }
52 |
53 | function defer(check, times, cb) {
54 | if(timesCalled[check] > times) {
55 | _.isString(cb) ? getFuncFromString(cb)() : cb();
56 | }
57 | }
58 |
59 | function again(predicate, fn){
60 | var fn = _.isString(fn) ? getFuncFromString(fn) : fn,
61 | predicate = _.isString(predicate) ? _.includes(workingArr, fn) : predicate;
62 |
63 | if (predicate){
64 | fn();
65 | workingArr.push(fn);
66 | } else {
67 | fn();
68 | }
69 |
70 | }
71 |
72 | function N(fn) {
73 | return _.filter(workingArr, function(el){
74 | return el.name === fn;
75 | }).length;
76 | }
77 |
78 |
79 | // Start whenevering!
80 |
81 | function deStringify(arr) {
82 | return _.map(arr, function(el){
83 | eval('var moo = ' + el);
84 | timesCalled[moo.name] = 0;
85 | return moo;
86 | });
87 | }
88 |
89 | function run(arr) {
90 |
91 | var length = arr.length;
92 |
93 | if (!length){
94 | console.log('FIN: THE BAG IS EMPTY');
95 | return;
96 | }
97 |
98 | workingArr = arr;
99 |
100 | var num = Math.floor(Math.random() * length),
101 | chosen = _.pullAt(workingArr, num)[0];
102 |
103 | chosen();
104 | timesCalled[chosen.name]++;
105 | run(workingArr);
106 |
107 | }
108 |
109 | // ACTION
110 |
111 | var baseArray = deStringify(bag),
112 | workingArr; // this mutates and is not to be trusted!
113 |
114 | run(baseArray.slice()); // call run on a copy of the base array
115 |
--------------------------------------------------------------------------------
/slides/lib/stopwork/compiler.rb:
--------------------------------------------------------------------------------
1 | module Stopwork
2 | class Compiler
3 | # Convert slide source to string array
4 | def self.compile source
5 | source.split("\n").
6 | reject { |e| e.empty? }. # empty lines
7 | reject { |e| e =~ /^;/ } # comments
8 | end
9 | end
10 | end
--------------------------------------------------------------------------------
/slides/lib/stopwork/css/iconic/iconic_fill.afm:
--------------------------------------------------------------------------------
1 | StartFontMetrics 2.0
2 | Comment Generated by FontForge 20110222
3 | Comment Creation Date: Tue Sep 18 01:22:18 2012
4 | FontName IconicFill
5 | FullName Iconic Fill
6 | FamilyName Iconic
7 | Weight Medium
8 | Notice (Icons by PJ Onori, font creation script by Yann)
9 | ItalicAngle 0
10 | IsFixedPitch false
11 | UnderlinePosition -100
12 | UnderlineThickness 50
13 | Version 001.000
14 | EncodingScheme ISOLatin1Encoding
15 | FontBBox 14 -14 760 731
16 | Descender -2147483648
17 | StartCharMetrics 151
18 | C 35 ; WX 681 ; N numbersign ; B 15 -14 667 731 ;
19 | C 63 ; WX 402 ; N question ; B 15 -14 388 731 ;
20 | C 64 ; WX 774 ; N at ; B 15 -14 760 731 ;
21 | C 182 ; WX 588 ; N paragraph ; B 15 -14 574 731 ;
22 | C -1 ; WX 495 ; N glyph0 ; B 15 -14 481 731 ;
23 | C -1 ; WX 774 ; N glyph1 ; B 15 -14 760 731 ;
24 | C -1 ; WX 774 ; N glyph2 ; B 15 -14 760 731 ;
25 | C -1 ; WX 774 ; N glyph3 ; B 15 -14 760 731 ;
26 | C -1 ; WX 774 ; N glyph4 ; B 15 -14 760 731 ;
27 | C -1 ; WX 774 ; N glyph5 ; B 15 32 760 684 ;
28 | C -1 ; WX 774 ; N glyph6 ; B 15 32 760 684 ;
29 | C -1 ; WX 774 ; N glyph7 ; B 15 -14 760 731 ;
30 | C -1 ; WX 774 ; N glyph8 ; B 15 -14 760 731 ;
31 | C -1 ; WX 774 ; N glyph9 ; B 15 -14 760 731 ;
32 | C -1 ; WX 728 ; N glyph10 ; B 14 -14 713 731 ;
33 | C -1 ; WX 774 ; N glyph11 ; B 15 -14 760 731 ;
34 | C -1 ; WX 774 ; N glyph12 ; B 15 -14 760 731 ;
35 | C -1 ; WX 681 ; N glyph13 ; B 15 -14 667 730 ;
36 | C -1 ; WX 774 ; N glyph14 ; B 15 32 760 684 ;
37 | C -1 ; WX 774 ; N glyph15 ; B 15 79 760 638 ;
38 | C -1 ; WX 774 ; N glyph16 ; B 15 -14 760 731 ;
39 | C -1 ; WX 774 ; N glyph17 ; B 15 -14 760 731 ;
40 | C -1 ; WX 774 ; N glyph18 ; B 15 172 760 545 ;
41 | C -1 ; WX 588 ; N glyph19 ; B 15 -14 574 731 ;
42 | C -1 ; WX 774 ; N glyph20 ; B 15 -14 760 731 ;
43 | C -1 ; WX 774 ; N glyph21 ; B 15 -14 760 731 ;
44 | C -1 ; WX 774 ; N glyph22 ; B 15 218 760 498 ;
45 | C -1 ; WX 774 ; N glyph23 ; B 15 -14 760 731 ;
46 | C -1 ; WX 774 ; N glyph24 ; B 15 -14 760 731 ;
47 | C -1 ; WX 774 ; N glyph25 ; B 15 172 760 545 ;
48 | C -1 ; WX 774 ; N glyph26 ; B 15 32 760 684 ;
49 | C -1 ; WX 402 ; N glyph27 ; B 15 -14 388 731 ;
50 | C -1 ; WX 774 ; N glyph29 ; B 15 32 760 684 ;
51 | C -1 ; WX 588 ; N glyph30 ; B 15 -14 574 731 ;
52 | C -1 ; WX 588 ; N glyph31 ; B 15 32 574 684 ;
53 | C -1 ; WX 774 ; N glyph32 ; B 15 79 760 638 ;
54 | C -1 ; WX 774 ; N glyph33 ; B 15 79 760 638 ;
55 | C -1 ; WX 774 ; N glyph34 ; B 15 32 760 684 ;
56 | C -1 ; WX 774 ; N glyph35 ; B 15 79 760 638 ;
57 | C -1 ; WX 774 ; N glyph36 ; B 15 79 760 638 ;
58 | C -1 ; WX 681 ; N glyph37 ; B 15 32 667 684 ;
59 | C -1 ; WX 774 ; N glyph38 ; B 15 -14 760 731 ;
60 | C -1 ; WX 774 ; N glyph39 ; B 15 -14 760 731 ;
61 | C -1 ; WX 774 ; N glyph40 ; B 15 -14 760 731 ;
62 | C -1 ; WX 774 ; N glyph41 ; B 15 -14 760 731 ;
63 | C -1 ; WX 588 ; N glyph42 ; B 15 -14 574 731 ;
64 | C -1 ; WX 774 ; N glyph43 ; B 15 -14 760 731 ;
65 | C -1 ; WX 774 ; N glyph44 ; B 15 -14 760 731 ;
66 | C -1 ; WX 774 ; N glyph45 ; B 15 79 760 638 ;
67 | C -1 ; WX 588 ; N glyph46 ; B 15 -14 574 731 ;
68 | C -1 ; WX 774 ; N glyph47 ; B 15 -14 760 731 ;
69 | C -1 ; WX 774 ; N glyph48 ; B 15 -12 760 729 ;
70 | C -1 ; WX 774 ; N glyph49 ; B 15 -14 760 731 ;
71 | C -1 ; WX 774 ; N glyph50 ; B 15 -14 760 731 ;
72 | C -1 ; WX 774 ; N glyph51 ; B 15 -14 760 731 ;
73 | C -1 ; WX 774 ; N glyph52 ; B 15 -14 760 731 ;
74 | C -1 ; WX 774 ; N glyph53 ; B 15 -14 760 731 ;
75 | C -1 ; WX 774 ; N glyph54 ; B 15 -14 760 731 ;
76 | C -1 ; WX 774 ; N glyph55 ; B 15 -14 760 731 ;
77 | C -1 ; WX 774 ; N glyph56 ; B 15 79 760 638 ;
78 | C -1 ; WX 774 ; N glyph57 ; B 15 79 760 638 ;
79 | C -1 ; WX 774 ; N glyph58 ; B 15 -14 760 731 ;
80 | C -1 ; WX 774 ; N glyph59 ; B 15 32 760 684 ;
81 | C -1 ; WX 774 ; N glyph60 ; B 15 -14 760 731 ;
82 | C -1 ; WX 774 ; N glyph61 ; B 15 -14 760 731 ;
83 | C -1 ; WX 588 ; N glyph62 ; B 15 -14 574 731 ;
84 | C -1 ; WX 774 ; N glyph63 ; B 15 -14 760 731 ;
85 | C -1 ; WX 774 ; N glyph64 ; B 15 -14 760 731 ;
86 | C -1 ; WX 774 ; N glyph65 ; B 15 -14 760 731 ;
87 | C -1 ; WX 402 ; N glyph66 ; B 15 -14 388 731 ;
88 | C -1 ; WX 402 ; N glyph67 ; B 15 -14 388 731 ;
89 | C -1 ; WX 774 ; N glyph68 ; B 15 172 760 545 ;
90 | C -1 ; WX 774 ; N glyph69 ; B 15 -14 760 731 ;
91 | C -1 ; WX 588 ; N glyph70 ; B 15 -14 574 731 ;
92 | C -1 ; WX 774 ; N glyph71 ; B 15 -14 760 731 ;
93 | C -1 ; WX 774 ; N glyph72 ; B 15 -14 760 731 ;
94 | C -1 ; WX 402 ; N glyph73 ; B 15 -14 388 731 ;
95 | C -1 ; WX 774 ; N glyph74 ; B 15 -14 760 731 ;
96 | C -1 ; WX 774 ; N glyph75 ; B 15 -14 760 731 ;
97 | C -1 ; WX 774 ; N glyph76 ; B 15 -14 760 731 ;
98 | C -1 ; WX 774 ; N glyph77 ; B 14 79 760 638 ;
99 | C -1 ; WX 774 ; N glyph78 ; B 15 -14 760 731 ;
100 | C -1 ; WX 774 ; N glyph79 ; B 15 79 760 638 ;
101 | C -1 ; WX 774 ; N glyph80 ; B 15 -14 760 731 ;
102 | C -1 ; WX 774 ; N glyph81 ; B 15 125 760 591 ;
103 | C -1 ; WX 774 ; N glyph82 ; B 15 79 760 638 ;
104 | C -1 ; WX 774 ; N glyph83 ; B 15 -14 760 731 ;
105 | C -1 ; WX 774 ; N glyph84 ; B 15 79 760 638 ;
106 | C -1 ; WX 774 ; N glyph85 ; B 15 -14 760 731 ;
107 | C -1 ; WX 774 ; N glyph86 ; B 15 -14 760 731 ;
108 | C -1 ; WX 774 ; N glyph87 ; B 15 -14 760 731 ;
109 | C -1 ; WX 774 ; N glyph88 ; B 15 79 760 638 ;
110 | C -1 ; WX 774 ; N glyph89 ; B 15 218 760 498 ;
111 | C -1 ; WX 774 ; N glyph90 ; B 15 -14 760 731 ;
112 | C -1 ; WX 588 ; N glyph91 ; B 15 32 574 684 ;
113 | C -1 ; WX 774 ; N glyph92 ; B 15 -14 760 731 ;
114 | C -1 ; WX 774 ; N glyph93 ; B 15 -14 760 731 ;
115 | C -1 ; WX 681 ; N glyph94 ; B 15 -14 667 731 ;
116 | C -1 ; WX 774 ; N glyph95 ; B 15 -14 760 731 ;
117 | C -1 ; WX 495 ; N glyph96 ; B 15 -14 481 731 ;
118 | C -1 ; WX 681 ; N glyph97 ; B 15 -14 667 731 ;
119 | C -1 ; WX 774 ; N glyph98 ; B 15 79 760 638 ;
120 | C -1 ; WX 774 ; N glyph99 ; B 15 -14 760 731 ;
121 | C -1 ; WX 774 ; N glyph100 ; B 14 -14 760 731 ;
122 | C -1 ; WX 309 ; N glyph101 ; B 15 -14 295 731 ;
123 | C -1 ; WX 774 ; N glyph102 ; B 15 -14 759 731 ;
124 | C -1 ; WX 681 ; N glyph103 ; B 15 -14 667 731 ;
125 | C -1 ; WX 774 ; N glyph104 ; B 15 -14 760 731 ;
126 | C -1 ; WX 402 ; N glyph105 ; B 15 -14 388 731 ;
127 | C -1 ; WX 774 ; N glyph106 ; B 15 -14 760 731 ;
128 | C -1 ; WX 774 ; N glyph107 ; B 15 -14 760 731 ;
129 | C -1 ; WX 774 ; N glyph108 ; B 15 -14 760 731 ;
130 | C -1 ; WX 774 ; N glyph109 ; B 15 265 760 452 ;
131 | C -1 ; WX 774 ; N glyph110 ; B 15 -14 760 731 ;
132 | C -1 ; WX 774 ; N glyph111 ; B 15 32 760 684 ;
133 | C -1 ; WX 774 ; N glyph113 ; B 15 -14 760 731 ;
134 | C -1 ; WX 774 ; N glyph114 ; B 15 -14 760 731 ;
135 | C -1 ; WX 774 ; N glyph115 ; B 15 -14 760 731 ;
136 | C -1 ; WX 774 ; N glyph116 ; B 15 -14 760 731 ;
137 | C -1 ; WX 774 ; N glyph117 ; B 15 -14 760 731 ;
138 | C -1 ; WX 681 ; N glyph118 ; B 15 -14 667 731 ;
139 | C -1 ; WX 774 ; N glyph119 ; B 15 -14 760 731 ;
140 | C -1 ; WX 774 ; N glyph121 ; B 15 -14 760 731 ;
141 | C -1 ; WX 774 ; N glyph122 ; B 15 -14 760 731 ;
142 | C -1 ; WX 309 ; N glyph123 ; B 15 -14 295 731 ;
143 | C -1 ; WX 774 ; N glyph124 ; B 15 58 760 658 ;
144 | C -1 ; WX 588 ; N glyph125 ; B 15 -14 574 731 ;
145 | C -1 ; WX 681 ; N glyph126 ; B 15 -14 667 731 ;
146 | C -1 ; WX 774 ; N glyph127 ; B 15 -14 760 731 ;
147 | C -1 ; WX 774 ; N glyph128 ; B 15 -14 760 731 ;
148 | C -1 ; WX 774 ; N glyph129 ; B 15 -14 760 731 ;
149 | C -1 ; WX 774 ; N glyph130 ; B 15 -14 760 731 ;
150 | C -1 ; WX 774 ; N glyph131 ; B 15 -14 760 731 ;
151 | C -1 ; WX 588 ; N glyph132 ; B 15 -14 574 731 ;
152 | C -1 ; WX 774 ; N glyph133 ; B 15 -14 760 731 ;
153 | C -1 ; WX 588 ; N glyph134 ; B 15 -14 574 731 ;
154 | C -1 ; WX 774 ; N glyph135 ; B 15 -14 760 731 ;
155 | C -1 ; WX 774 ; N glyph136 ; B 15 32 760 684 ;
156 | C -1 ; WX 774 ; N glyph137 ; B 15 -14 760 731 ;
157 | C -1 ; WX 774 ; N glyph138 ; B 15 -14 760 731 ;
158 | C -1 ; WX 588 ; N glyph139 ; B 15 -14 574 731 ;
159 | C -1 ; WX 774 ; N glyph140 ; B 15 172 760 545 ;
160 | C -1 ; WX 774 ; N glyph141 ; B 15 -14 760 731 ;
161 | C -1 ; WX 774 ; N glyph142 ; B 15 -14 760 731 ;
162 | C -1 ; WX 774 ; N glyph143 ; B 15 -14 760 731 ;
163 | C -1 ; WX 774 ; N glyph145 ; B 15 -14 760 731 ;
164 | C -1 ; WX 774 ; N glyph146 ; B 15 -14 760 731 ;
165 | C -1 ; WX 774 ; N glyph147 ; B 15 -14 760 731 ;
166 | C -1 ; WX 774 ; N glyph148 ; B 15 -14 760 731 ;
167 | C -1 ; WX 774 ; N glyph149 ; B 15 -14 760 731 ;
168 | C -1 ; WX 774 ; N glyph150 ; B 15 -14 760 731 ;
169 | EndCharMetrics
170 | EndFontMetrics
171 |
--------------------------------------------------------------------------------
/slides/lib/stopwork/css/iconic/iconic_fill.css:
--------------------------------------------------------------------------------
1 | @font-face { font-family: 'IconicFill'; src: url('iconic_fill.eot'); src: url('iconic_fill.eot?#iefix') format('embedded-opentype'), url('iconic_fill.ttf') format('truetype'), url('iconic_fill.svg#iconic') format('svg'); font-weight: normal; font-style: normal; }.iconic { display:inline-block; font-family: 'IconicFill'; }.iconic-lightbulb:before {content:'\e063';}.iconic-equalizer:before {content:'\e052';}.iconic-brush-alt:before {content:'\e01c';}.iconic-move:before {content:'\e03e';}.iconic-tag-fill:before {content:'\e02b';}.iconic-book-alt2:before {content:'\e06a';}.iconic-layers:before {content:'\e01f';}.iconic-chat-alt-fill:before {content:'\e007';}.iconic-layers-alt:before {content:'\e020';}.iconic-cloud-upload:before {content:'\e045';}.iconic-chart-alt:before {content:'\e029';}.iconic-fullscreen-exit-alt:before {content:'\e051';}.iconic-cloud-download:before {content:'\e044';}.iconic-paperclip:before {content:'\e08a';}.iconic-heart-fill:before {content:'\2764';}.iconic-mail:before {content:'\2709';}.iconic-pen-alt-fill:before {content:'\e005';}.iconic-check-alt:before {content:'\2714';}.iconic-battery-charging:before {content:'\e05d';}.iconic-lock-fill:before {content:'\e075';}.iconic-stop:before {content:'\e04a';}.iconic-arrow-up:before {content:'\2191';}.iconic-move-horizontal:before {content:'\e038';}.iconic-compass:before {content:'\e021';}.iconic-minus-alt:before {content:'\e009';}.iconic-battery-empty:before {content:'\e05c';}.iconic-comment-fill:before {content:'\e06d';}.iconic-map-pin-alt:before {content:'\e002';}.iconic-question-mark:before {content:'\003f';}.iconic-list:before {content:'\e055';}.iconic-upload:before {content:'\e043';}.iconic-reload:before {content:'\e030';}.iconic-loop-alt4:before {content:'\e035';}.iconic-loop-alt3:before {content:'\e034';}.iconic-loop-alt2:before {content:'\e033';}.iconic-loop-alt1:before {content:'\e032';}.iconic-left-quote:before {content:'\275d';}.iconic-x:before {content:'\2717';}.iconic-last:before {content:'\e04d';}.iconic-bars:before {content:'\e06f';}.iconic-arrow-left:before {content:'\2190';}.iconic-arrow-down:before {content:'\2193';}.iconic-download:before {content:'\e042';}.iconic-home:before {content:'\2302';}.iconic-calendar:before {content:'\e001';}.iconic-right-quote-alt:before {content:'\e012';}.iconic-unlock-fill:before {content:'\e076';}.iconic-fullscreen:before {content:'\e04e';}.iconic-dial:before {content:'\e058';}.iconic-plus-alt:before {content:'\e008';}.iconic-clock:before {content:'\e079';}.iconic-movie:before {content:'\e060';}.iconic-steering-wheel:before {content:'\e024';}.iconic-pen:before {content:'\270e';}.iconic-pin:before {content:'\e067';}.iconic-denied:before {content:'\26d4';}.iconic-left-quote-alt:before {content:'\e011';}.iconic-volume-mute:before {content:'\e071';}.iconic-umbrella:before {content:'\2602';}.iconic-list-nested:before {content:'\e056';}.iconic-arrow-up-alt1:before {content:'\e014';}.iconic-undo:before {content:'\e02f';}.iconic-pause:before {content:'\e049';}.iconic-bolt:before {content:'\26a1';}.iconic-article:before {content:'\e053';}.iconic-read-more:before {content:'\e054';}.iconic-beaker:before {content:'\e023';}.iconic-beaker-alt:before {content:'\e010';}.iconic-battery-full:before {content:'\e073';}.iconic-arrow-right:before {content:'\2192';}.iconic-iphone:before {content:'\e06e';}.iconic-arrow-up-alt2:before {content:'\e018';}.iconic-cog:before {content:'\2699';}.iconic-award-fill:before {content:'\e022';}.iconic-first:before {content:'\e04c';}.iconic-trash-fill:before {content:'\e05a';}.iconic-image:before {content:'\e027';}.iconic-comment-alt1-fill:before {content:'\e003';}.iconic-cd:before {content:'\e064';}.iconic-right-quote:before {content:'\275e';}.iconic-brush:before {content:'\e01b';}.iconic-cloud:before {content:'\2601';}.iconic-eye:before {content:'\e025';}.iconic-play-alt:before {content:'\e048';}.iconic-transfer:before {content:'\e041';}.iconic-pen-alt2:before {content:'\e006';}.iconic-camera:before {content:'\e070';}.iconic-move-horizontal-alt2:before {content:'\e03a';}.iconic-curved-arrow:before {content:'\2935';}.iconic-move-horizontal-alt1:before {content:'\e039';}.iconic-aperture:before {content:'\e026';}.iconic-reload-alt:before {content:'\e031';}.iconic-magnifying-glass:before {content:'\e074';}.iconic-calendar-alt-fill:before {content:'\e06c';}.iconic-fork:before {content:'\e046';}.iconic-box:before {content:'\e06b';}.iconic-map-pin-fill:before {content:'\e068';}.iconic-bars-alt:before {content:'\e00a';}.iconic-volume:before {content:'\e072';}.iconic-x-alt:before {content:'\2718';}.iconic-link:before {content:'\e077';}.iconic-move-vertical:before {content:'\e03b';}.iconic-eyedropper:before {content:'\e01e';}.iconic-spin:before {content:'\e036';}.iconic-rss:before {content:'\e02c';}.iconic-info:before {content:'\2139';}.iconic-target:before {content:'\e02a';}.iconic-cursor:before {content:'\e057';}.iconic-key-fill:before {content:'\26bf';}.iconic-minus:before {content:'\2796';}.iconic-book-alt:before {content:'\e00b';}.iconic-headphones:before {content:'\e061';}.iconic-hash:before {content:'\0023';}.iconic-arrow-left-alt1:before {content:'\e013';}.iconic-arrow-left-alt2:before {content:'\e017';}.iconic-fullscreen-exit:before {content:'\e050';}.iconic-share:before {content:'\e02e';}.iconic-fullscreen-alt:before {content:'\e04f';}.iconic-comment-alt2-fill:before {content:'\e004';}.iconic-moon-fill:before {content:'\263e';}.iconic-at:before {content:'\0040';}.iconic-chat:before {content:'\e05e';}.iconic-move-vertical-alt2:before {content:'\e03d';}.iconic-move-vertical-alt1:before {content:'\e03c';}.iconic-check:before {content:'\2713';}.iconic-mic:before {content:'\e05f';}.iconic-book:before {content:'\e069';}.iconic-move-alt1:before {content:'\e03f';}.iconic-move-alt2:before {content:'\e040';}.iconic-document-fill:before {content:'\e066';}.iconic-plus:before {content:'\2795';}.iconic-wrench:before {content:'\e078';}.iconic-play:before {content:'\e047';}.iconic-star:before {content:'\2605';}.iconic-document-alt-fill:before {content:'\e000';}.iconic-chart:before {content:'\e028';}.iconic-rain:before {content:'\26c6';}.iconic-folder-fill:before {content:'\e065';}.iconic-new-window:before {content:'\e059';}.iconic-user:before {content:'\e062';}.iconic-battery-half:before {content:'\e05b';}.iconic-aperture-alt:before {content:'\e00c';}.iconic-eject:before {content:'\e04b';}.iconic-arrow-down-alt1:before {content:'\e016';}.iconic-pilcrow:before {content:'\00b6';}.iconic-arrow-down-alt2:before {content:'\e01a';}.iconic-arrow-right-alt1:before {content:'\e015';}.iconic-arrow-right-alt2:before {content:'\e019';}.iconic-rss-alt:before {content:'\e02d';}.iconic-spin-alt:before {content:'\e037';}.iconic-sun-fill:before {content:'\2600';}
--------------------------------------------------------------------------------
/slides/lib/stopwork/css/iconic/iconic_fill.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sarahghp/talking-to-machines/87ffc11a7bae282b0f8a1227798e5aaa9c99d8c7/slides/lib/stopwork/css/iconic/iconic_fill.eot
--------------------------------------------------------------------------------
/slides/lib/stopwork/css/iconic/iconic_fill.json:
--------------------------------------------------------------------------------
1 | {
2 | "hash" : "0023",
3 | "question_mark" : "003f",
4 | "at" : "0040",
5 | "pilcrow" : "00b6",
6 | "info" : "2139",
7 | "arrow_left" : "2190",
8 | "arrow_up" : "2191",
9 | "arrow_right" : "2192",
10 | "arrow_down" : "2193",
11 | "home" : "2302",
12 | "sun_fill" : "2600",
13 | "cloud" : "2601",
14 | "umbrella" : "2602",
15 | "star" : "2605",
16 | "moon_fill" : "263e",
17 | "heart_fill" : "2764",
18 | "cog" : "2699",
19 | "bolt" : "26a1",
20 | "key_fill" : "26bf",
21 | "rain" : "26c6",
22 | "denied" : "26d4",
23 | "mail" : "2709",
24 | "pen" : "270e",
25 | "check" : "2713",
26 | "check_alt" : "2714",
27 | "x" : "2717",
28 | "x_alt" : "2718",
29 | "left_quote" : "275d",
30 | "right_quote" : "275e",
31 | "plus" : "2795",
32 | "minus" : "2796",
33 | "curved_arrow" : "2935",
34 | "document_alt_fill" : "e000",
35 | "calendar" : "e001",
36 | "map_pin_alt" : "e002",
37 | "comment_alt1_fill" : "e003",
38 | "comment_alt2_fill" : "e004",
39 | "pen_alt_fill" : "e005",
40 | "pen_alt2" : "e006",
41 | "chat_alt_fill" : "e007",
42 | "plus_alt" : "e008",
43 | "minus_alt" : "e009",
44 | "bars_alt" : "e00a",
45 | "book_alt" : "e00b",
46 | "aperture_alt" : "e00c",
47 | "beaker_alt" : "e010",
48 | "left_quote_alt" : "e011",
49 | "right_quote_alt" : "e012",
50 | "arrow_left_alt1" : "e013",
51 | "arrow_up_alt1" : "e014",
52 | "arrow_right_alt1" : "e015",
53 | "arrow_down_alt1" : "e016",
54 | "arrow_left_alt2" : "e017",
55 | "arrow_up_alt2" : "e018",
56 | "arrow_right_alt2" : "e019",
57 | "arrow_down_alt2" : "e01a",
58 | "brush" : "e01b",
59 | "brush_alt" : "e01c",
60 | "eyedropper" : "e01e",
61 | "layers" : "e01f",
62 | "layers_alt" : "e020",
63 | "compass" : "e021",
64 | "award_fill" : "e022",
65 | "beaker" : "e023",
66 | "steering_wheel" : "e024",
67 | "eye" : "e025",
68 | "aperture" : "e026",
69 | "image" : "e027",
70 | "chart" : "e028",
71 | "chart_alt" : "e029",
72 | "target" : "e02a",
73 | "tag_fill" : "e02b",
74 | "rss" : "e02c",
75 | "rss_alt" : "e02d",
76 | "share" : "e02e",
77 | "undo" : "e02f",
78 | "reload" : "e030",
79 | "reload_alt" : "e031",
80 | "loop_alt1" : "e032",
81 | "loop_alt2" : "e033",
82 | "loop_alt3" : "e034",
83 | "loop_alt4" : "e035",
84 | "spin" : "e036",
85 | "spin_alt" : "e037",
86 | "move_horizontal" : "e038",
87 | "move_horizontal_alt1" : "e039",
88 | "move_horizontal_alt2" : "e03a",
89 | "move_vertical" : "e03b",
90 | "move_vertical_alt1" : "e03c",
91 | "move_vertical_alt2" : "e03d",
92 | "move" : "e03e",
93 | "move_alt1" : "e03f",
94 | "move_alt2" : "e040",
95 | "transfer" : "e041",
96 | "download" : "e042",
97 | "upload" : "e043",
98 | "cloud_download" : "e044",
99 | "cloud_upload" : "e045",
100 | "fork" : "e046",
101 | "play" : "e047",
102 | "play_alt" : "e048",
103 | "pause" : "e049",
104 | "stop" : "e04a",
105 | "eject" : "e04b",
106 | "first" : "e04c",
107 | "last" : "e04d",
108 | "fullscreen" : "e04e",
109 | "fullscreen_alt" : "e04f",
110 | "fullscreen_exit" : "e050",
111 | "fullscreen_exit_alt" : "e051",
112 | "equalizer" : "e052",
113 | "article" : "e053",
114 | "read_more" : "e054",
115 | "list" : "e055",
116 | "list_nested" : "e056",
117 | "cursor" : "e057",
118 | "dial" : "e058",
119 | "new_window" : "e059",
120 | "trash_fill" : "e05a",
121 | "battery_half" : "e05b",
122 | "battery_empty" : "e05c",
123 | "battery_charging" : "e05d",
124 | "chat" : "e05e",
125 | "mic" : "e05f",
126 | "movie" : "e060",
127 | "headphones" : "e061",
128 | "user" : "e062",
129 | "lightbulb" : "e063",
130 | "cd" : "e064",
131 | "folder_fill" : "e065",
132 | "document_fill" : "e066",
133 | "pin" : "e067",
134 | "map_pin_fill" : "e068",
135 | "book" : "e069",
136 | "book_alt2" : "e06a",
137 | "box" : "e06b",
138 | "calendar_alt_fill" : "e06c",
139 | "comment_fill" : "e06d",
140 | "iphone" : "e06e",
141 | "bars" : "e06f",
142 | "camera" : "e070",
143 | "volume_mute" : "e071",
144 | "volume" : "e072",
145 | "battery_full" : "e073",
146 | "magnifying_glass" : "e074",
147 | "lock_fill" : "e075",
148 | "unlock_fill" : "e076",
149 | "link" : "e077",
150 | "wrench" : "e078",
151 | "clock" : "e079",
152 | "paperclip" : "e08a"
153 | }
154 |
--------------------------------------------------------------------------------
/slides/lib/stopwork/css/iconic/iconic_fill.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sarahghp/talking-to-machines/87ffc11a7bae282b0f8a1227798e5aaa9c99d8c7/slides/lib/stopwork/css/iconic/iconic_fill.otf
--------------------------------------------------------------------------------
/slides/lib/stopwork/css/iconic/iconic_fill.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sarahghp/talking-to-machines/87ffc11a7bae282b0f8a1227798e5aaa9c99d8c7/slides/lib/stopwork/css/iconic/iconic_fill.ttf
--------------------------------------------------------------------------------
/slides/lib/stopwork/css/iconic/iconic_fill.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sarahghp/talking-to-machines/87ffc11a7bae282b0f8a1227798e5aaa9c99d8c7/slides/lib/stopwork/css/iconic/iconic_fill.woff
--------------------------------------------------------------------------------
/slides/lib/stopwork/css/skeleton-base.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Skeleton V1.2
3 | * Copyright 2011, Dave Gamache
4 | * www.getskeleton.com
5 | * Free to use under the MIT license.
6 | * http://www.opensource.org/licenses/mit-license.php
7 | * 6/20/2012
8 | */
9 |
10 |
11 | /* Table of Content
12 | ==================================================
13 | #Reset & Basics
14 | #Basic Styles
15 | #Site Styles
16 | #Typography
17 | #Links
18 | #Lists
19 | #Images
20 | #Buttons
21 | #Forms
22 | #Misc */
23 |
24 |
25 | /* #Reset & Basics (Inspired by E. Meyers)
26 | ================================================== */
27 | html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
28 | margin: 0;
29 | padding: 0;
30 | border: 0;
31 | font-size: 100%;
32 | font: inherit;
33 | vertical-align: baseline; }
34 | article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
35 | display: block; }
36 | body {
37 | line-height: 1; }
38 | ol, ul {
39 | list-style: none; }
40 | blockquote, q {
41 | quotes: none; }
42 | blockquote:before, blockquote:after,
43 | q:before, q:after {
44 | content: '';
45 | content: none; }
46 | table {
47 | border-collapse: collapse;
48 | border-spacing: 0; }
49 |
50 |
51 | /* #Basic Styles
52 | ================================================== */
53 | body {
54 | background: #fff;
55 | font: 14px/21px "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
56 | color: #444;
57 | -webkit-font-smoothing: antialiased; /* Fix for webkit rendering */
58 | -webkit-text-size-adjust: 100%;
59 | }
60 |
61 |
62 | /* #Typography
63 | ================================================== */
64 | h1, h2, h3, h4, h5, h6 {
65 | color: #181818;
66 | font-family: "Georgia", "Times New Roman", serif;
67 | font-weight: normal; }
68 | h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { font-weight: inherit; }
69 | h1 { font-size: 46px; line-height: 50px; margin-bottom: 14px;}
70 | h2 { font-size: 35px; line-height: 40px; margin-bottom: 10px; }
71 | h3 { font-size: 28px; line-height: 34px; margin-bottom: 8px; }
72 | h4 { font-size: 21px; line-height: 30px; margin-bottom: 4px; }
73 | h5 { font-size: 17px; line-height: 24px; }
74 | h6 { font-size: 14px; line-height: 21px; }
75 | .subheader { color: #777; }
76 |
77 | p { margin: 0 0 20px 0; }
78 | p img { margin: 0; }
79 | p.lead { font-size: 21px; line-height: 27px; color: #777; }
80 |
81 | em { font-style: italic; }
82 | strong { font-weight: bold; color: #333; }
83 | small { font-size: 80%; }
84 |
85 | /* Blockquotes */
86 | blockquote, blockquote p { font-size: 17px; line-height: 24px; color: #777; font-style: italic; }
87 | blockquote { margin: 0 0 20px; padding: 9px 20px 0 19px; border-left: 1px solid #ddd; }
88 | blockquote cite { display: block; font-size: 12px; color: #555; }
89 | blockquote cite:before { content: "\2014 \0020"; }
90 | blockquote cite a, blockquote cite a:visited, blockquote cite a:visited { color: #555; }
91 |
92 | hr { border: solid #ddd; border-width: 1px 0 0; clear: both; margin: 10px 0 30px; height: 0; }
93 |
94 |
95 | /* #Links
96 | ================================================== */
97 | a, a:visited { color: #333; text-decoration: underline; outline: 0; }
98 | a:hover, a:focus { color: #000; }
99 | p a, p a:visited { line-height: inherit; }
100 |
101 |
102 | /* #Lists
103 | ================================================== */
104 | ul, ol { margin-bottom: 20px; }
105 | ul { list-style: none outside; }
106 | ol { list-style: decimal; }
107 | ol, ul.square, ul.circle, ul.disc { margin-left: 30px; }
108 | ul.square { list-style: square outside; }
109 | ul.circle { list-style: circle outside; }
110 | ul.disc { list-style: disc outside; }
111 | ul ul, ul ol,
112 | ol ol, ol ul { margin: 4px 0 5px 30px; font-size: 90%; }
113 | ul ul li, ul ol li,
114 | ol ol li, ol ul li { margin-bottom: 6px; }
115 | li { line-height: 18px; margin-bottom: 12px; }
116 | ul.large li { line-height: 21px; }
117 | li p { line-height: 21px; }
118 |
119 | /* #Images
120 | ================================================== */
121 |
122 | img.scale-with-grid {
123 | max-width: 100%;
124 | height: auto; }
125 |
126 |
127 | /* #Buttons
128 | ================================================== */
129 |
130 | .button,
131 | button,
132 | input[type="submit"],
133 | input[type="reset"],
134 | input[type="button"] {
135 | background: #eee; /* Old browsers */
136 | background: #eee -moz-linear-gradient(top, rgba(255,255,255,.2) 0%, rgba(0,0,0,.2) 100%); /* FF3.6+ */
137 | background: #eee -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,.2)), color-stop(100%,rgba(0,0,0,.2))); /* Chrome,Safari4+ */
138 | background: #eee -webkit-linear-gradient(top, rgba(255,255,255,.2) 0%,rgba(0,0,0,.2) 100%); /* Chrome10+,Safari5.1+ */
139 | background: #eee -o-linear-gradient(top, rgba(255,255,255,.2) 0%,rgba(0,0,0,.2) 100%); /* Opera11.10+ */
140 | background: #eee -ms-linear-gradient(top, rgba(255,255,255,.2) 0%,rgba(0,0,0,.2) 100%); /* IE10+ */
141 | background: #eee linear-gradient(top, rgba(255,255,255,.2) 0%,rgba(0,0,0,.2) 100%); /* W3C */
142 | border: 1px solid #aaa;
143 | border-top: 1px solid #ccc;
144 | border-left: 1px solid #ccc;
145 | -moz-border-radius: 3px;
146 | -webkit-border-radius: 3px;
147 | border-radius: 3px;
148 | color: #444;
149 | display: inline-block;
150 | font-size: 11px;
151 | font-weight: bold;
152 | text-decoration: none;
153 | text-shadow: 0 1px rgba(255, 255, 255, .75);
154 | cursor: pointer;
155 | margin-bottom: 20px;
156 | line-height: normal;
157 | padding: 8px 10px;
158 | font-family: "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif; }
159 |
160 | .button:hover,
161 | button:hover,
162 | input[type="submit"]:hover,
163 | input[type="reset"]:hover,
164 | input[type="button"]:hover {
165 | color: #222;
166 | background: #ddd; /* Old browsers */
167 | background: #ddd -moz-linear-gradient(top, rgba(255,255,255,.3) 0%, rgba(0,0,0,.3) 100%); /* FF3.6+ */
168 | background: #ddd -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,.3)), color-stop(100%,rgba(0,0,0,.3))); /* Chrome,Safari4+ */
169 | background: #ddd -webkit-linear-gradient(top, rgba(255,255,255,.3) 0%,rgba(0,0,0,.3) 100%); /* Chrome10+,Safari5.1+ */
170 | background: #ddd -o-linear-gradient(top, rgba(255,255,255,.3) 0%,rgba(0,0,0,.3) 100%); /* Opera11.10+ */
171 | background: #ddd -ms-linear-gradient(top, rgba(255,255,255,.3) 0%,rgba(0,0,0,.3) 100%); /* IE10+ */
172 | background: #ddd linear-gradient(top, rgba(255,255,255,.3) 0%,rgba(0,0,0,.3) 100%); /* W3C */
173 | border: 1px solid #888;
174 | border-top: 1px solid #aaa;
175 | border-left: 1px solid #aaa; }
176 |
177 | .button:active,
178 | button:active,
179 | input[type="submit"]:active,
180 | input[type="reset"]:active,
181 | input[type="button"]:active {
182 | border: 1px solid #666;
183 | background: #ccc; /* Old browsers */
184 | background: #ccc -moz-linear-gradient(top, rgba(255,255,255,.35) 0%, rgba(10,10,10,.4) 100%); /* FF3.6+ */
185 | background: #ccc -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,.35)), color-stop(100%,rgba(10,10,10,.4))); /* Chrome,Safari4+ */
186 | background: #ccc -webkit-linear-gradient(top, rgba(255,255,255,.35) 0%,rgba(10,10,10,.4) 100%); /* Chrome10+,Safari5.1+ */
187 | background: #ccc -o-linear-gradient(top, rgba(255,255,255,.35) 0%,rgba(10,10,10,.4) 100%); /* Opera11.10+ */
188 | background: #ccc -ms-linear-gradient(top, rgba(255,255,255,.35) 0%,rgba(10,10,10,.4) 100%); /* IE10+ */
189 | background: #ccc linear-gradient(top, rgba(255,255,255,.35) 0%,rgba(10,10,10,.4) 100%); /* W3C */ }
190 |
191 | .button.full-width,
192 | button.full-width,
193 | input[type="submit"].full-width,
194 | input[type="reset"].full-width,
195 | input[type="button"].full-width {
196 | width: 100%;
197 | padding-left: 0 !important;
198 | padding-right: 0 !important;
199 | text-align: center; }
200 |
201 | /* Fix for odd Mozilla border & padding issues */
202 | button::-moz-focus-inner,
203 | input::-moz-focus-inner {
204 | border: 0;
205 | padding: 0;
206 | }
207 |
208 |
209 | /* #Forms
210 | ================================================== */
211 |
212 | form {
213 | margin-bottom: 20px; }
214 | fieldset {
215 | margin-bottom: 20px; }
216 | input[type="text"],
217 | input[type="password"],
218 | input[type="email"],
219 | textarea,
220 | select {
221 | border: 1px solid #ccc;
222 | padding: 6px 4px;
223 | outline: none;
224 | -moz-border-radius: 2px;
225 | -webkit-border-radius: 2px;
226 | border-radius: 2px;
227 | font: 13px "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
228 | color: #777;
229 | margin: 0;
230 | width: 210px;
231 | max-width: 100%;
232 | display: block;
233 | margin-bottom: 20px;
234 | background: #fff; }
235 | select {
236 | padding: 0; }
237 | input[type="text"]:focus,
238 | input[type="password"]:focus,
239 | input[type="email"]:focus,
240 | textarea:focus {
241 | border: 1px solid #aaa;
242 | color: #444;
243 | -moz-box-shadow: 0 0 3px rgba(0,0,0,.2);
244 | -webkit-box-shadow: 0 0 3px rgba(0,0,0,.2);
245 | box-shadow: 0 0 3px rgba(0,0,0,.2); }
246 | textarea {
247 | min-height: 60px; }
248 | label,
249 | legend {
250 | display: block;
251 | font-weight: bold;
252 | font-size: 13px; }
253 | select {
254 | width: 220px; }
255 | input[type="checkbox"] {
256 | display: inline; }
257 | label span,
258 | legend span {
259 | font-weight: normal;
260 | font-size: 13px;
261 | color: #444; }
262 |
263 | /* #Misc
264 | ================================================== */
265 | .remove-bottom { margin-bottom: 0 !important; }
266 | .half-bottom { margin-bottom: 10px !important; }
267 | .add-bottom { margin-bottom: 20px !important; }
268 |
269 |
270 |
--------------------------------------------------------------------------------
/slides/lib/stopwork/css/style.css:
--------------------------------------------------------------------------------
1 | /* general */
2 |
3 | @import url(http://fonts.googleapis.com/css?family=PT+Mono);
4 |
5 | body, p, h1, h2, h3, h4, h5, h6 {
6 | color: #53535c;
7 | font-family: 'PT Mono', Monaco, monospace;
8 | font-size: 100%;
9 | font-weight: 700;
10 | text-align: left;
11 | }
12 |
13 | .slide {
14 | width: 100%;
15 | height: 100%;
16 | position: absolute;
17 | display: none;
18 | }
19 |
20 | .slide h1 {
21 | font-size: 12.873rem;
22 | line-height: 20.841rem;
23 | text-align: center;
24 | letter-spacing: 4px;
25 | }
26 |
27 | .slide h2 {
28 | font-size: 5rem;
29 | line-height: 7.722rem;
30 | text-align: center;
31 | }
32 |
33 | .slide h3 {
34 | font-weight: 100;
35 | font-size: 5rem;
36 | line-height: 7.722rem;
37 | text-align: center;
38 | }
39 |
40 | .slide h4 {
41 | font-size: 2.999em;
42 | line-height: 4.632rem;
43 | }
44 |
45 | .slide h5, h6 {
46 | font-family: 'PT Mono', Monaco, monospace;
47 | font-weight: 100;
48 | font-size: 2.779em;
49 | line-height: 4.632rem;
50 | text-transform: uppercase;
51 | letter-spacing: 1px;
52 | }
53 |
54 | .slide h6 {
55 | color: hsla(355, 83%, 46%, 1);
56 | }
57 |
58 | .slide code {
59 | font-family: 'PT Mono', Monaco, monospace;
60 | font-size: 1.799rem;
61 | line-height: 2.999rem;
62 | margin-bottom: 1rem;
63 | }
64 |
65 | .slide p {
66 | font-size: 1.799rem;
67 | line-height: 2.999rem;
68 | }
69 |
70 | .slide blockquote {
71 | border: none;
72 | }
73 |
74 | .slide cite {
75 | margin-top: 1em;
76 | font-size: 1em;
77 | }
78 |
79 | .slide.video {
80 | position: relative;
81 | /*height: 100vh;*/
82 | z-index: 0;
83 | }
84 |
85 | .slide.video video {
86 | -webkit-transform: translateX(-50%) translateY(-50%);
87 | -moz-transform: translateX(-50%) translateY(-50%);
88 | -ms-transform: translateX(-50%) translateY(-50%);
89 | -o-transform: translateX(-50%) translateY(-50%);
90 | transform: translateX(-50%) translateY(-50%);
91 | position: absolute;
92 | top: 50%;
93 | left: 50%;
94 | min-height: 100%;
95 | max-height: 100%;
96 | }
97 |
98 | .slide.twitter {
99 | position: relative;
100 | }
101 |
102 | .slide.twitter iframe {
103 | -webkit-transform: translateX(-50%) translateY(-50%);
104 | -moz-transform: translateX(-50%) translateY(-50%);
105 | -ms-transform: translateX(-50%) translateY(-50%);
106 | -o-transform: translateX(-50%) translateY(-50%);
107 | transform: translateX(-50%) translateY(-50%);
108 | position: absolute !important;
109 | top: 50%;
110 | left: 50%;
111 | }
112 |
113 |
114 | .slide *:last-child {
115 | margin-bottom: 0px;
116 | }
117 |
118 | .slide.current {
119 | display: block;
120 | }
121 |
122 | #navigation {
123 | position: fixed;
124 | bottom: 20px;
125 | left: 50%;
126 | width: 100px;
127 | margin-left: -50px;
128 | opacity: 0;
129 | background: black;
130 | -webkit-border-radius: 25px;
131 | -moz-border-radius: 25px;
132 | -o-border-radius: 25px;
133 | border-radius: 25px;
134 | color: white;
135 | }
136 |
137 | #near-navigation {
138 | position: fixed;
139 | bottom: 0;
140 | left: 25%;
141 | width: 50%;
142 | height: 15%;
143 | z-index: 1;
144 | }
145 |
146 | #near-navigation:hover #navigation {
147 | opacity: 0.5;
148 | }
149 |
150 | #navigation.hover,
151 | #navigation:hover {
152 | opacity: 0.9 !important;
153 | }
154 |
155 | #navigation button {
156 | position: absolute;
157 | top: 3px;
158 | text-shadow: none;
159 | font-size: 2em;
160 |
161 | border: none;
162 | background: none;
163 | color: white;
164 | padding: 5px 10px;
165 | margin: 0;
166 | }
167 |
168 | #navigation button.prev {
169 | left: 0;
170 | }
171 |
172 | #navigation button.next {
173 | right: 0;
174 | }
175 |
176 | #navigation div {
177 | width: 100%;
178 | text-align: center;
179 | }
180 |
181 | #navigation div.current {
182 | margin-bottom: -2px;
183 | }
184 |
185 | #navigation div.total {
186 | margin-top: -0px;
187 | }
188 |
189 | /* image slides */
190 | .slide.image {
191 | background: center center no-repeat;
192 | background-size: contain;
193 | }
194 |
195 | /* web slides */
196 | .slide.web iframe {
197 | background-color: white;
198 | width: 100%;
199 | height: 100%;
200 | }
201 |
202 | /* text slides */
203 | .slide.text {
204 | margin-top: -4rem;
205 | padding: 0 2%;
206 | }
207 |
208 | .slide.text.current {
209 | display: table !important;
210 | -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
211 | -moz-box-sizing: border-box; /* Firefox, other Gecko */
212 | box-sizing: border-box; /* Opera/IE 8+ */
213 | }
214 |
215 | .slide.text > * {
216 | display: table-cell;
217 | vertical-align: middle;
218 | text-align: center;
219 | }
220 |
221 | .cobble.loading {
222 | /* spinner animation */
223 | background: url(data:image/gif;base64,R0lGODlhIAAgAPfhANvb29ra2t3d3d7e3tfX19XV1djY2Nzc3O7u7s7OztnZ2efn5/Dw8PT09OLi4uvr69bW1uPj4+3t7e/v7+bm5urq6re3t9HR0eTk5PLy8tPT0+Dg4N/f3+jo6PHx8eXl5fPz89DQ0MPDw8zMzJeXl+np6ezs7M/Pz8rKysXFxdLS0snJydTU1L6+vsjIyPX19cTExKmpqcfHx8vLy7+/v6ioqM3NzcHBwbS0tG1tbeHh4cDAwLKysrGxsbOzs6Ojo7y8vIKCgqenp4ODgzc3N5KSkvb29ru7u7m5ubi4uLW1tTY2NsbGxqampqSkpI6OjqGhoVJSUvf396+vr1FRUcL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0FBAA7) center center no-repeat;
224 | }
225 |
226 | .cobble.loading * {
227 | opacity: 0.5;
228 | }
--------------------------------------------------------------------------------
/slides/lib/stopwork/css/transition-fade.css:
--------------------------------------------------------------------------------
1 | .slide {
2 | opacity: 0;
3 | display: block;
4 |
5 | -webkit-transition: opacity 0.25s;
6 | -moz-transition: opacity 0.25s;
7 | -o-transition: opacity 0.25s;
8 | transition: opacity 0.25s;
9 | }
10 |
11 | .slide.current {
12 | opacity: 1;
13 | }
--------------------------------------------------------------------------------
/slides/lib/stopwork/css/transition-slide.css:
--------------------------------------------------------------------------------
1 | body {
2 | overflow: hidden;
3 | }
4 |
5 | .slide {
6 | -webkit-transition: left 0.25s;
7 | -moz-transition: left 0.25s;
8 | -o-transition: left 0.25s;
9 | transition: left 0.25s;
10 | }
11 |
12 | .slide.next {
13 | display: block;
14 | left: 200% !important;
15 | }
16 |
17 | .slide.prev {
18 | display: block;
19 | left: -200% !important;
20 | }
--------------------------------------------------------------------------------
/slides/lib/stopwork/exporter.rb:
--------------------------------------------------------------------------------
1 | require "rack"
2 | require_relative "stopwork"
3 |
4 | module Stopwork
5 | class Exporter
6 | def self.export file
7 | print "Exporting #{file} to #{file}.html..."
8 | File.open("#{file}.html", 'w') { |f| f.write Slideshow::Export.new(open(file)).render }
9 | puts "OK"
10 | end
11 | end
12 | end
--------------------------------------------------------------------------------
/slides/lib/stopwork/ext.rb:
--------------------------------------------------------------------------------
1 | require 'viddl-rb'
2 | require 'nokogiri'
3 | require 'open-uri'
4 |
5 | class String
6 | def to_title
7 | gsub(/[-_.\s]([a-zA-Z0-9])/) { $1.upcase }.gsub(/([A-Z])/) { " #{$1}"}.gsub(/^([a-z])/) { $1.upcase }
8 | end
9 | end
10 |
11 | class Vine < ViddlRb::PluginBase
12 | def self.matches_provider?(url)
13 | url.include?("vine.co")
14 | end
15 |
16 | # return the url for original video file and title
17 | def self.get_urls_and_filenames(url, options = {})
18 | doc = Nokogiri::HTML(open(url))
19 | url = doc.css("head meta[property='twitter:player:stream']").first.attr("content")
20 | title = doc.css("head meta[property='twitter:title']").first.attr("content")
21 |
22 | [{:url => url, :name => title}]
23 | end
24 | end
--------------------------------------------------------------------------------
/slides/lib/stopwork/js/stopwork.js:
--------------------------------------------------------------------------------
1 | var Stopwork = {
2 | get_next_slide: function (slide) {
3 | return slide.next(".slide").size() == 0 ? $(".slide:first") : slide.next(".slide");
4 | },
5 |
6 | get_prev_slide: function (slide) {
7 | return slide.prev(".slide").size() == 0 ? $(".slide:last") : slide.prev(".slide");
8 | },
9 |
10 | refresh_next_prev: function () {
11 | $(".slide").removeClass('next').removeClass('prev');
12 | this.get_next_slide($(".slide.current")).addClass('next');
13 | this.get_prev_slide($(".slide.current")).addClass('prev');
14 | if(this.current_slide_number() >= 0)
15 | window.location.hash = this.current_slide_number() + 1;
16 | },
17 |
18 | next_slide: function () {
19 | var current_slide = $(".slide.current");
20 | current_slide.removeClass("current");
21 | this.get_next_slide(current_slide).addClass("current");
22 |
23 | $("#navigation .current").html(this.current_slide_number() + 1);
24 | this.refresh_next_prev();
25 | },
26 |
27 | prev_slide: function () {
28 | var current_slide = $(".slide.current");
29 | current_slide.removeClass("current");
30 | this.get_prev_slide(current_slide).addClass("current");
31 |
32 | $("#navigation .current").html(this.current_slide_number() + 1);
33 | this.refresh_next_prev();
34 | },
35 |
36 | goto_slide: function(n) {
37 | var current_slide = $(".slide.current");
38 | current_slide.removeClass("current");
39 | $(".slide").eq(n).addClass("current");
40 |
41 | $("#navigation .current").html(this.current_slide_number() + 1);
42 | this.refresh_next_prev();
43 | },
44 |
45 | current_slide_number: function() {
46 | return $(".slide").index($(".slide.current"));
47 | },
48 |
49 | present: function(content, container) {
50 | // content = content.trim();
51 | if(!container) container = "body";
52 |
53 | $container = $(container);
54 |
55 | $container.addClass('stopwork');
56 | $container.addClass('loading');
57 |
58 | // clear and append navigation elements
59 | $container.append('\
60 | NOT FOUND
"]
48 |
49 | end
50 | end
51 | end
52 | end
--------------------------------------------------------------------------------
/slides/lib/stopwork/slideshow.mustache:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{title}}
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | {{{body}}}
15 |
16 |
17 |
--------------------------------------------------------------------------------
/slides/lib/stopwork/slideshow.rb:
--------------------------------------------------------------------------------
1 | require "mustache"
2 | require_relative "stopwork"
3 |
4 | module Stopwork
5 | # Template for whole slideshow
6 | class Slideshow < Mustache
7 | self.template_file = File.expand_path(File.dirname(__FILE__) + "/slideshow.mustache")
8 |
9 | attr_accessor :title, :source
10 |
11 | def initialize source
12 | @title = "Stopwork Slideshow"
13 | @source = source
14 |
15 | if source.respond_to? :read
16 | @title = File.basename(source, '.*').to_title + " - " + @title
17 | source = source.read
18 | end
19 |
20 | @slides = Compiler.compile source
21 | end
22 |
23 | def body
24 | @slides.map { |s| Stopwork::Types.render(s, self) }.join "\n"
25 | end
26 |
27 | def cache_folder_name
28 | ".stopwork"
29 | end
30 |
31 | def cache_folder_path
32 | cache_folder_path = File.expand_path(File.dirname(@source)) + "/.stopwork"
33 | Dir.mkdir(cache_folder_path) unless File.exists? cache_folder_path
34 |
35 | cache_folder_path
36 | end
37 |
38 | class Export < Slideshow
39 | def self.flatten template_file
40 | open(template_file).read.
41 | gsub(//) { |m|
42 | ""
43 | }.gsub(/"
45 | }
46 | end
47 |
48 | self.template = flatten File.expand_path(File.dirname(__FILE__) + "/slideshow.mustache")
49 | end
50 | end
51 | end
--------------------------------------------------------------------------------
/slides/lib/stopwork/stopwork.rb:
--------------------------------------------------------------------------------
1 | require_relative "ext"
2 | require_relative "slideshow"
3 | require_relative "server"
4 | require_relative "exporter"
5 | require_relative "compiler"
6 | require_relative "types/types"
7 |
8 | Encoding.default_external = Encoding::UTF_8
9 | Encoding.default_internal = Encoding::UTF_8
--------------------------------------------------------------------------------
/slides/lib/stopwork/types/cloudapp.rb:
--------------------------------------------------------------------------------
1 | module Stopwork
2 | module Types
3 | # Image slides
4 | #
5 | # Slides consist of a single image
6 | # Syntax is image filename
7 | class CloudApp < Image
8 | # match data:image or anything ending in an image filetype
9 | def self.match? slide
10 | !! (slide =~ /^http:\/\/cl.ly/)
11 | end
12 |
13 | # url is adjusted to accomodate local images
14 | # TODO figure this out
15 | def url
16 | cached "#{slide}/.png", slide
17 | end
18 | end
19 | end
20 | end
--------------------------------------------------------------------------------
/slides/lib/stopwork/types/hostedvideo.rb:
--------------------------------------------------------------------------------
1 | require 'viddl-rb'
2 |
3 | module Stopwork
4 | module Types
5 | # Video slide
6 | #
7 | # Slides consist of a single embeded video. Currently YouTube and Vimeo only.
8 | # Syntax is any valid youtube or vimeo url
9 | class HostedVideo < Video
10 | # match any video url
11 | def self.match? slide
12 | begin
13 | !! ViddlRb.get_urls(slide)
14 | rescue ViddlRb::DownloadError
15 | return false
16 | end
17 | end
18 |
19 | def url
20 | cached ViddlRb.get_urls(slide).first, slide
21 | end
22 | end
23 | end
24 | end
--------------------------------------------------------------------------------
/slides/lib/stopwork/types/image.rb:
--------------------------------------------------------------------------------
1 | require 'digest/sha1'
2 |
3 | module Stopwork
4 | module Types
5 | # Image slides
6 | #
7 | # Slides consist of a single image
8 | # Syntax is image filename
9 | class Image < Slide
10 | # match data:image or anything ending in an image filetype
11 | def self.match? slide
12 | !! (slide =~ /\.(png|jpg|jpeg|gif)/i or slide =~/^data:image/i)
13 | end
14 |
15 | # set slide's css background to image url, css will center/scale it
16 | def template
17 | ''
18 | end
19 |
20 | # url is adjusted to accomodate local images
21 | # TODO figure this out
22 | def url
23 | if slide =~ /^data:image/
24 | slide
25 | else
26 | cached slide
27 | end
28 | end
29 | end
30 | end
31 | end
--------------------------------------------------------------------------------
/slides/lib/stopwork/types/imgur.rb:
--------------------------------------------------------------------------------
1 | module Stopwork
2 | module Types
3 | # Image slides
4 | #
5 | # Slides consist of a single image
6 | # Syntax is image filename
7 | class Imgur < Image
8 | # match data:image or anything ending in an image filetype
9 | def self.match? slide
10 | !! (slide =~ /^http:\/\/imgur\.com/)
11 | end
12 |
13 | # url is adjusted to accomodate local images
14 | # TODO figure this out
15 | def url
16 | cached "#{slide}.png", slide
17 | end
18 | end
19 | end
20 | end
--------------------------------------------------------------------------------
/slides/lib/stopwork/types/text.rb:
--------------------------------------------------------------------------------
1 | require "kramdown"
2 | require_relative "types"
3 |
4 | module Stopwork
5 | module Types
6 | # Text slides
7 | #
8 | # Slides consist of marked up text
9 | # Syntax is any valid markdown
10 | class Text < Slide
11 | # no match? method, always matches
12 |
13 | # populate div with marked down text
14 | def template
15 | ' '
16 | end
17 |
18 | # slide content is passed through markdown
19 | def body
20 | Kramdown::Document.new(slide).to_html
21 | end
22 | end
23 | end
24 | end
--------------------------------------------------------------------------------
/slides/lib/stopwork/types/twitter.rb:
--------------------------------------------------------------------------------
1 | require "open-uri"
2 | require "json"
3 |
4 | module Stopwork
5 | module Types
6 | class Twitter < Slide
7 | def self.match? slide
8 | !! (slide =~ /twitter\.com/)
9 | end
10 |
11 | # populate div with marked down text
12 | def template
13 | ' '
14 | end
15 |
16 | # slide content is passed through markdown
17 | def body
18 | data = JSON.parse(open("https://api.twitter.com/1/statuses/oembed.json?url=#{slide}").read)
19 | data["html"]
20 | end
21 | end
22 | end
23 | end
--------------------------------------------------------------------------------
/slides/lib/stopwork/types/types.rb:
--------------------------------------------------------------------------------
1 | require "mustache"
2 | require_relative "../Stopwork"
3 |
4 | module Stopwork
5 | module Types
6 | class < #{key_hash}\";
39 | curl -#L \"#{url}\" -o \"#{cached_incomplete}\";
40 | mv \"#{cached_incomplete}\" \"#{cached_finished}\""
41 | end
42 |
43 | url
44 | end
45 | end
46 |
47 | def self.match? slide
48 | true
49 | end
50 |
51 | def template
52 | " "
53 | end
54 | end
55 | end
56 | end
57 |
58 | require_relative "text"
59 | require_relative "twitter"
60 | require_relative "image"
61 | require_relative "cloudapp"
62 | require_relative "imgur"
63 | require_relative "web"
64 | require_relative "video"
65 | require_relative "hostedvideo"
66 |
67 | module Stopwork
68 | module Types
69 | self.match_order = [Imgur, CloudApp, Image, HostedVideo, Video, Twitter, Web, Text]
70 |
71 | def self.render slide, slideshow
72 | self.match_order.select { |f| f.match? slide }.first.new(slide, slideshow).render # TODO optimize
73 | end
74 | end
75 | end
--------------------------------------------------------------------------------
/slides/lib/stopwork/types/video.rb:
--------------------------------------------------------------------------------
1 | module Stopwork
2 | module Types
3 | # Video slide
4 | #
5 | # Slides consist of a single embeded video. Currently YouTube and Vimeo only.
6 | # Syntax is any valid youtube or vimeo url
7 | class Video < Slide
8 | # match any video url
9 | def self.match? slide
10 | !! (slide =~ /\.(mp4|ogg|mov|webm)/i or slide =~/^data:video/i)
11 | end
12 |
13 | # populate the div with the appropriate video tag
14 | def template
15 | ''
16 | end
17 |
18 | def url
19 | cached slide
20 | end
21 | end
22 | end
23 | end
--------------------------------------------------------------------------------
/slides/lib/stopwork/types/web.rb:
--------------------------------------------------------------------------------
1 | module Stopwork
2 | module Types
3 | # Web slides
4 | #
5 | # Slides consist of an embeded webpage
6 | # Syntax is any valid http address
7 | class Web < Slide
8 | # match anything starting with http
9 | def self.match? slide
10 | !! (slide =~ /^http/)
11 | end
12 |
13 | # populate div with an iframe
14 | def template
15 | ''
16 | end
17 | end
18 | end
19 | end
--------------------------------------------------------------------------------
');
68 |
69 | // navigation button scrolling
70 | $("#navigation button.prev").click(function() { Stopwork.prev_slide() });
71 | $("#navigation button.next").click(function() { Stopwork.next_slide() });
72 |
73 | // keyboard input
74 | $(window).keyup(function(e) {
75 | $("#navigation").removeClass("hover");
76 | });
77 |
78 | // populate slides
79 | $("#navigation .total").html($(".slide").size());
80 | this.goto_slide(window.location.hash.length > 0 ? parseInt(window.location.hash.substring(1)) - 1 : 0);
81 |
82 | $(window).keydown(function(e) {
83 | console.log(e.which)
84 | if(e.ctrlKey)
85 | $("#navigation").addClass("hover");
86 |
87 | if(e.which == 39) { // right
88 | if(!$("#editor").hasClass('down'))
89 | Stopwork.next_slide();
90 |
91 | } else if(e.which == 37) { // left
92 | if(!$("#editor").hasClass('down'))
93 | Stopwork.prev_slide();
94 |
95 | } else if(e.which == 27) { // esc
96 | if($("#editor").hasClass('down')) {
97 | Stopwork.replace_current_slide($("#editor textarea").val());
98 | $("#editor").removeClass('down');
99 | }
100 |
101 | }
102 | });
103 | }
104 | }
105 |
106 | $(function(){
107 | Stopwork.present()
108 | })
109 |
110 | window.onresize = function() {
111 | var img = new Image();
112 | var bodyStyle = window.getComputedStyle(document.body, null);
113 |
114 | Array.prototype.slice.call(document.querySelectorAll(".slide.image")).map(function(slide) {
115 | img.src = slide.style.backgroundImage.replace(/url\((['"])?(.*?)\1\)/gi, '$2') .split(',')[0];
116 | if(img.width > parseInt(bodyStyle.width) || img.height > parseInt(bodyStyle.height)) {
117 | slide.style.backgroundSize = "contain";
118 | } else {
119 | slide.style.backgroundSize = "";
120 | }
121 | });
122 | }
123 |
124 | window.onload = function() {
125 | $(".stopwork").removeClass('loading');
126 | window.onresize();
127 | }
--------------------------------------------------------------------------------
/slides/lib/stopwork/server.rb:
--------------------------------------------------------------------------------
1 | require "rack"
2 | require_relative "stopwork"
3 |
4 | module Stopwork
5 | class Server
6 | def self.launch file, port=54021
7 | new(file).launch(port)
8 | end
9 |
10 | def launch port=54021
11 | puts ">> Stopwork Serving on #{`ipconfig getifaddr en1`.strip}:#{port} (v0.2b codename DeKalb)"
12 | `open http://localhost:#{port}`
13 | Rack::Handler::Thin.run self, :Port => port
14 | end
15 |
16 | def initialize file
17 | @file = file
18 | # super File.dirname(__FILE__)
19 | end
20 |
21 | def mime_type file
22 | if file =~ /\.css$/
23 | "text/css"
24 | else
25 | `file -Ib #{file}`.gsub(/\n/,"")
26 | end
27 | end
28 |
29 | def call env
30 | slideshow_relative = File.expand_path(File.dirname(@file) + env['REQUEST_PATH'])
31 | stopwork_relative = File.expand_path(File.dirname(__FILE__) + env['REQUEST_PATH'])
32 |
33 | # root serves slideshow markup
34 | if env['REQUEST_PATH'] == "/"
35 | [200, {'Content-Type' => 'text/html'}, Slideshow.new(open(@file)).render]
36 |
37 | # check local to slideshow file first for assets
38 | elsif File.exists? slideshow_relative
39 | [200, {'Content-Type' => mime_type(slideshow_relative) }, open(slideshow_relative).read]
40 |
41 | # check local to library second for assets
42 | elsif File.exists? stopwork_relative
43 | [200, {'Content-Type' => mime_type(stopwork_relative)}, open(stopwork_relative).read]
44 |
45 | # else not found
46 | else
47 | [404, {'Content-Type' => 'text/html'}, "