├── .gitignore ├── Gruntfile.js ├── README.md ├── TODO ├── js ├── ace │ ├── ace.js │ ├── ext-searchbox.js │ ├── ext-spellcheck.js │ ├── ext-static_highlight.js │ ├── ext-textarea.js │ ├── keybinding-emacs.js │ ├── keybinding-vim.js │ ├── mode-abap.js │ ├── mode-asciidoc.js │ ├── mode-c9search.js │ ├── mode-c_cpp.js │ ├── mode-clojure.js │ ├── mode-coffee.js │ ├── mode-coldfusion.js │ ├── mode-csharp.js │ ├── mode-css.js │ ├── mode-curly.js │ ├── mode-dart.js │ ├── mode-diff.js │ ├── mode-django.js │ ├── mode-dot.js │ ├── mode-glsl.js │ ├── mode-golang.js │ ├── mode-groovy.js │ ├── mode-haml.js │ ├── mode-haxe.js │ ├── mode-html.js │ ├── mode-jade.js │ ├── mode-java.js │ ├── mode-javascript.js │ ├── mode-json.js │ ├── mode-jsp.js │ ├── mode-jsx.js │ ├── mode-latex.js │ ├── mode-less.js │ ├── mode-liquid.js │ ├── mode-lisp.js │ ├── mode-livescript.js │ ├── mode-lua.js │ ├── mode-luapage.js │ ├── mode-lucene.js │ ├── mode-makefile.js │ ├── mode-markdown.js │ ├── mode-objectivec.js │ ├── mode-ocaml.js │ ├── mode-perl.js │ ├── mode-pgsql.js │ ├── mode-php.js │ ├── mode-powershell.js │ ├── mode-python.js │ ├── mode-r.js │ ├── mode-rdoc.js │ ├── mode-rhtml.js │ ├── mode-ruby.js │ ├── mode-scad.js │ ├── mode-scala.js │ ├── mode-scheme.js │ ├── mode-scss.js │ ├── mode-sh.js │ ├── mode-sql.js │ ├── mode-stylus.js │ ├── mode-svg.js │ ├── mode-tcl.js │ ├── mode-tex.js │ ├── mode-text.js │ ├── mode-textile.js │ ├── mode-tm_snippet.js │ ├── mode-typescript.js │ ├── mode-vbscript.js │ ├── mode-xml.js │ ├── mode-xquery.js │ ├── mode-yaml.js │ ├── theme-ambiance.js │ ├── theme-chaos.js │ ├── theme-chrome.js │ ├── theme-clouds.js │ ├── theme-clouds_midnight.js │ ├── theme-cobalt.js │ ├── theme-crimson_editor.js │ ├── theme-dawn.js │ ├── theme-dreamweaver.js │ ├── theme-eclipse.js │ ├── theme-github.js │ ├── theme-idle_fingers.js │ ├── theme-kr.js │ ├── theme-merbivore.js │ ├── theme-merbivore_soft.js │ ├── theme-mono_industrial.js │ ├── theme-monokai.js │ ├── theme-pastel_on_dark.js │ ├── theme-solarized_dark.js │ ├── theme-solarized_light.js │ ├── theme-textmate.js │ ├── theme-tomorrow.js │ ├── theme-tomorrow_night.js │ ├── theme-tomorrow_night_blue.js │ ├── theme-tomorrow_night_bright.js │ ├── theme-tomorrow_night_eighties.js │ ├── theme-twilight.js │ ├── theme-vibrant_ink.js │ ├── theme-xcode.js │ ├── worker-coffee.js │ ├── worker-css.js │ ├── worker-javascript.js │ ├── worker-json.js │ ├── worker-php.js │ └── worker-xquery.js ├── dom │ ├── Delay.js │ ├── Stage.js │ └── Visible.js ├── file.js ├── google-code │ └── prettify.js ├── interactives │ ├── CanvasProto.js │ ├── HouseLoop.js │ ├── LightIf.js │ ├── MetaCanvas.js │ ├── Regex.js │ ├── StringEscaping.js │ └── data │ │ ├── ajaxAutocomplete.time │ │ ├── canvas.time │ │ ├── formValidation.time │ │ ├── goldilocks.time │ │ ├── loops.time │ │ ├── objectLoops.time │ │ ├── storage.time │ │ ├── tabs.time │ │ └── template.time ├── jquery-1.9.min.js ├── meta │ ├── Evil.js │ ├── TLPlayer.js │ └── TimeLapse.js └── require.js ├── package.json ├── src ├── ajax.html ├── arrays.html ├── canvas.html ├── conclusion.html ├── conditionals.html ├── css │ ├── base.less │ ├── grid.less │ ├── interactive.less │ ├── seed.less │ ├── semantic.less │ ├── syntax.less │ └── values.less ├── events.html ├── forms.html ├── functions.html ├── gettingStarted.html ├── git.html ├── html.html ├── index.html ├── inheritance.html ├── interactives │ ├── canvasProto.html │ ├── escaping.html │ ├── houses.html │ ├── lightbulbs.html │ ├── regex.html │ └── timelapse.html ├── introduction.html ├── jquery.html ├── lmgtfy.html ├── mapreduce.html ├── node.html ├── objects.html ├── security.html ├── snippets │ ├── foot.html │ ├── head.html │ └── scripts.html └── storage.html └── tools └── timelapse ├── index.html └── test.time /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | build/ 3 | .DS_Store -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | grunt.loadNpmTasks('grunt-contrib-watch'); 3 | grunt.loadNpmTasks('grunt-contrib-connect'); 4 | 5 | var fs = require('fs'); 6 | var path = require('path'); 7 | var http = require('http'); 8 | var exec = require("child_process").exec; 9 | 10 | grunt.initConfig({ 11 | less: { 12 | paths: ['./src/css'], 13 | output: './build/css/styles.css' 14 | }, 15 | connect: { 16 | local: { 17 | options: { 18 | livereload: true, 19 | base: "build" 20 | } 21 | } 22 | }, 23 | watch: { 24 | html: { 25 | files: ['./src/**/*.html'], 26 | tasks: ['template'] 27 | }, 28 | js: { 29 | files: ['./src/code/*.js'], 30 | tasks: ['compileJS'] 31 | }, 32 | css: { 33 | files: ['./src/css/*.less'], 34 | tasks: ['less'] 35 | }, 36 | options: { 37 | nospawn: true, 38 | livereload: true 39 | } 40 | } 41 | }); 42 | 43 | grunt.registerTask('default', 'build connect watch'.split(' ')); 44 | grunt.registerTask('build', 'template less compileJS'.split(' ')); 45 | 46 | /* 47 | The JavaScript on the page is kept in the source folder, then compiled into the build directory so that require() can request it. The textbook base library is also compiled using the RequireJS optimizer. Many scripts will do neither--small demos are included inline using the Shorts tempating. 48 | */ 49 | grunt.registerTask('compileJS', 'Build/copy scripts', function() { 50 | var c = this.async(); 51 | exec("cp ./js build -r", c); 52 | }); 53 | 54 | /* 55 | A simple LESS compilation task. 56 | */ 57 | grunt.registerTask('less', 'Build the CSS file from seed.less', function() { 58 | 59 | var less = require('less'); 60 | var config = grunt.config('less'); 61 | 62 | var seed = grunt.file.read('src/css/seed.less'); 63 | 64 | var callback = this.async(); 65 | 66 | less.render(seed, { paths: config.paths }).then(function(rendered) { 67 | var css = rendered.css; 68 | grunt.file.write(config.output, css); 69 | callback(); 70 | }, function(err) { console.error(err); callback() }); 71 | }); 72 | 73 | /** 74 | Build output pages via Lo-dash templating 75 | */ 76 | var path = require("path"); 77 | grunt.template.include = function(where, data) { 78 | var src = grunt.file.read(path.resolve("src", where)); 79 | data = Object.create(data || null); 80 | data.t = grunt.template; 81 | return grunt.template.process(src, {data:data}) 82 | }; 83 | grunt.registerTask('template', 'Simple shortcode templating', function() { 84 | var files = grunt.file.expandMapping("*.html", "build", { cwd: "src" }); 85 | var data = { t: grunt.template }; 86 | 87 | files.forEach(function(file) { 88 | var src = file.src[0]; 89 | console.log("building file", src); 90 | var rendered = grunt.template.process(grunt.file.read(src), { data: data }); 91 | grunt.file.write(file.dest, rendered); 92 | }); 93 | 94 | }); 95 | }; -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Working Title: JavaScript for the Web Savvy 2 | =========================================== 3 | 4 | There aren't a lot of good JavaScript textbooks out there, so I'm writing one. HTML/CSS source starts in the /src folder, and gets output after templating and LESS compilation to the /build folder. It's a work in progress, so mind the dust. 5 | 6 | You can view a recent (but not cutting edge) version of the output by visiting: http://thomaswilburn.github.com/textbook 7 | 8 | This project no longer includes built files in the repo. If you want to edit a local copy, the included Gruntfile will start a dev server with live reload. Make sure to install its dependencies from NPM first. 9 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | Textbook Tasks Remaining 2 | ======================== 3 | - Convert to CommonJS builds and Lo-dash templates 4 | - Add images: 5 | * console for browser, sniff the current browser and offer others 6 | * Use Marmoset to generate some code sample images? 7 | - Write sample code for functions chapter 8 | * Something that illustrates using functions to refactor 9 | * Spellchecker/sanitizer/image update? 10 | - Practice questions and exercises: 11 | * AJAX 12 | * Inheritance 13 | * Forms 14 | * Objects 15 | * Conditionals 16 | - Redo/rethink interactives: 17 | * light bulbs 18 | - Should demonstrate if/if else/if else if 19 | - Maybe use a flow chart instead of light bulbs? 20 | - Do people really have problems with if/else? 21 | * loops 22 | * inheritance 23 | - show the "shadow" properties that are inherited on an object 24 | - side-by-side code is probably better than the dot interactive 25 | - Add sidebar icons--helpful tip, resources, history, etc. 26 | - Add dev tools detection 27 | * window.outerHeight - window.innerHeight > 150 28 | * doesn't work if the window is undocked 29 | * is there really a place where this is useful? 30 | * better scenario: create more interactive sections where the page is mutable based on console ops 31 | - Switch to a nice set of web fonts 32 | - Add a license for this thing 33 | - Add live animation example 34 | - Show asteroids live 35 | -------------------------------------------------------------------------------- /js/ace/ext-spellcheck.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/ext/spellcheck",["require","exports","module"],function(e,t,n){text.spellcheck=!0,host.on("nativecontextmenu",function(e){if(!host.selection.isEmpty())return;var t=host.getCursorPosition(),n=host.session.getWordRange(t.row,t.column),r=host.session.getTextRange(n);host.session.tokenRe.lastIndex=0;if(!host.session.tokenRe.test(r))return;var e=r+" "+PLACEHOLDER;text.value=e,text.setSelectionRange(r.length+1,r.length+1),text.setSelectionRange(0,0),inputHandler=function(t){if(t==e)return"";if(t.lastIndexOf(e)==t.length-e.length)return t.slice(0,-e.length);if(t.indexOf(e)==0)return t.slice(e.length);if(t.slice(-2)==PLACEHOLDER){var r=t.slice(0,-2);if(r.slice(-1)==" ")return r=r.slice(0,-1),host.session.replace(n,r),r}return t}})}) -------------------------------------------------------------------------------- /js/ace/ext-static_highlight.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/ext/static_highlight",["require","exports","module","ace/edit_session","ace/layer/text"],function(e,t,n){var r=e("../edit_session").EditSession,i=e("../layer/text").Text,s=".ace_editor {font-family: 'Monaco', 'Menlo', 'Droid Sans Mono', 'Courier New', monospace;font-size: 12px;}.ace_editor .ace_gutter { width: 25px !important;display: block;float: left;text-align: right; padding: 0 3px 0 0; margin-right: 3px;}.ace_line { clear: both; }*.ace_gutter-cell {-moz-user-select: -moz-none;-khtml-user-select: none;-webkit-user-select: none;user-select: none;}";t.render=function(e,t,n,o,u){o=parseInt(o||1,10);var a=new r("");a.setMode(t),a.setUseWorker(!1);var f=new i(document.createElement("div"));f.setSession(a),f.config={characterWidth:10,lineHeight:20},a.setValue(e);var l=[],c=a.getLength();for(var h=0;h"),u||l.push(""+(h+o)+""),f.$renderLine(l,h,!0,!1),l.push("");var p="
:code
".replace(/:cssClass/,n.cssClass).replace(/:code/,l.join(""));return f.destroy(),{css:s+n.cssText,html:p}}}) -------------------------------------------------------------------------------- /js/ace/mode-c9search.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/c9search",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/c9search_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/c9search"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./c9search_highlight_rules").C9SearchHighlightRules,u=e("./matching_brace_outdent").MatchingBraceOutdent,a=e("./folding/c9search").FoldMode,f=function(){this.$tokenizer=new s((new o).getRules(),"i"),this.$outdent=new u,this.foldingRules=new a};r.inherits(f,i),function(){this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t);return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)}}.call(f.prototype),t.Mode=f}),ace.define("ace/mode/c9search_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:["c9searchresults.constant.numeric","c9searchresults.text","c9searchresults.text"],regex:"(^\\s+[0-9]+)(:\\s*)(.+)"},{token:["string","text"],regex:"(.+)(:$)"}]}};r.inherits(s,i),t.C9SearchHighlightRules=s}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){var t=e.match(/^(\s+)/);return t?t[1]:""}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/folding/c9search",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(){};r.inherits(o,s),function(){this.foldingStartMarker=/^(\S.*\:|Searching for.*)$/,this.foldingStopMarker=/^(\s+|Found.*)$/,this.getFoldWidgetRange=function(e,t,n){var r=e.doc.getAllLines(n),s=r[n],o=/^(Found.*|Searching for.*)$/,u=/^(\S.*\:|\s*)$/,a=o.test(s)?o:u;if(this.foldingStartMarker.test(s)){for(var f=n+1,l=e.getLength();f=0;f--){s=r[f];if(a.test(s))break}return new i(f,s.length,n,0)}}}.call(o.prototype)}) -------------------------------------------------------------------------------- /js/ace/mode-dart.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/dart",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/dart_highlight_rules","ace/mode/folding/cstyle"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./dart_highlight_rules").DartHighlightRules,u=e("./folding/cstyle").FoldMode,a=function(){var e=new o;this.foldingRules=new u,this.$tokenizer=new s(e.getRules())};r.inherits(a,i),function(){}.call(a.prototype),t.Mode=a}),ace.define("ace/mode/dart_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e="true|false|null",t="this|super",n="try|catch|finally|throw|break|case|continue|default|do|else|for|if|in|return|switch|while|new",r="abstract|class|extends|external|factory|implements|interface|get|native|operator|set|typedef",i="static|final|const",s="void|bool|num|int|double|Dynamic|var|String",o=this.createKeywordMapper({"constant.language.dart":e,"variable.language.dart":t,"keyword.control.dart":n,"keyword.declaration.dart":r,"storage.modifier.dart":i,"storage.type.primitive.dart":s},"identifier"),u={token:"string",regex:".+"};this.$rules={start:[{token:"comment",regex:/\/\/.*$/},{token:"comment",regex:/\/\*/,next:"comment"},{token:["meta.preprocessor.script.dart"],regex:"^(#!.*)$"},{token:"keyword.other.import.dart",regex:"#(?:\\b)(?:library|import|source|resource)(?:\\b)"},{token:["keyword.other.import.dart","text"],regex:"(?:\\b)(prefix)(\\s*:)"},{regex:"\\bas\\b",token:"keyword.cast.dart"},{regex:"\\?|:",token:"keyword.control.ternary.dart"},{regex:"(?:\\b)(is\\!?)(?:\\b)",token:["keyword.operator.dart"]},{regex:"(<<|>>>?|~|\\^|\\||&)",token:["keyword.operator.bitwise.dart"]},{regex:"((?:&|\\^|\\||<<|>>>?)=)",token:["keyword.operator.assignment.bitwise.dart"]},{regex:"(===?|!==?|<=?|>=?)",token:["keyword.operator.comparison.dart"]},{regex:"((?:[+*/%-]|\\~)=)",token:["keyword.operator.assignment.arithmetic.dart"]},{regex:"=",token:"keyword.operator.assignment.dart"},{token:"string",regex:"'''",next:"qdoc"},{token:"string",regex:'"""',next:"qqdoc"},{token:"string",regex:"'",next:"qstring"},{token:"string",regex:'"',next:"qqstring"},{regex:"(\\-\\-|\\+\\+)",token:["keyword.operator.increment-decrement.dart"]},{regex:"(\\-|\\+|\\*|\\/|\\~\\/|%)",token:["keyword.operator.arithmetic.dart"]},{regex:"(!|&&|\\|\\|)",token:["keyword.operator.logical.dart"]},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:o,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"}],comment:[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}],qdoc:[{token:"string",regex:".*?'''",next:"start"},u],qqdoc:[{token:"string",regex:'.*?"""',next:"start"},u],qstring:[{token:"string",regex:"[^\\\\']*(?:\\\\.[^\\\\']*)*'",next:"start"},u],qqstring:[{token:"string",regex:'[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',next:"start"},u]}};r.inherits(s,i),t.DartHighlightRules=s}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(){};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.getFoldWidgetRange=function(e,t,n){var r=e.getLine(n),i=r.match(this.foldingStartMarker);if(i){var s=i.index;return i[1]?this.openingBracketBlock(e,i[1],n,s):e.getCommentFoldRange(n,s+i[0].length,1)}if(t!=="markbeginend")return;var i=r.match(this.foldingStopMarker);if(i){var s=i.index+i[0].length;return i[1]?this.closingBracketBlock(e,i[1],n,s):e.getCommentFoldRange(n,s,-1)}}}.call(o.prototype)}) -------------------------------------------------------------------------------- /js/ace/mode-diff.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/diff",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/diff_highlight_rules","ace/mode/folding/diff"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./diff_highlight_rules").DiffHighlightRules,u=e("./folding/diff").FoldMode,a=function(){this.$tokenizer=new s((new o).getRules(),"i"),this.foldingRules=new u(["diff","index","\\+{3}","@@|\\*{5}"],"i")};r.inherits(a,i),function(){}.call(a.prototype),t.Mode=a}),ace.define("ace/mode/diff_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{regex:"^(?:\\*{15}|={67}|-{3}|\\+{3})$",token:"punctuation.definition.separator.diff",name:"keyword"},{regex:"^(@@)(\\s*.+?\\s*)(@@)(.*)$",token:["constant","constant.numeric","constant","comment.doc.tag"]},{regex:"^(\\d+)([,\\d]+)(a|d|c)(\\d+)([,\\d]+)(.*)$",token:["constant.numeric","punctuation.definition.range.diff","constant.function","constant.numeric","punctuation.definition.range.diff","invalid"],name:"meta."},{regex:"^(\\-{3}|\\+{3}|\\*{3})( .+)$",token:["constant.numeric","meta.tag"]},{regex:"^([!+>])(.*?)(\\s*)$",token:["support.constant","text","invalid"]},{regex:"^([<\\-])(.*?)(\\s*)$",token:["support.function","string","invalid"]},{regex:"^(diff)(\\s+--\\w+)?(.+?)( .+)?$",token:["variable","variable","keyword","variable"]},{regex:"^Index.+$",token:"variable"},{regex:"\\s*$",token:"invalid"},{defaultToken:"invisible"}]}};r.inherits(s,i),t.DiffHighlightRules=s}),ace.define("ace/mode/folding/diff",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],function(e,t,n){var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=e("../../range").Range,o=t.FoldMode=function(e,t){this.regExpList=e,this.flag=t,this.foldingStartMarker=RegExp("^("+e.join("|")+")",this.flag)};r.inherits(o,i),function(){this.getFoldWidgetRange=function(e,t,n){var r=e.getLine(n),i={row:n,column:r.length},o=this.regExpList;for(var u=1;u<=o.length;u++){var a=RegExp("^("+o.slice(0,u).join("|")+")",this.flag);if(a.test(r))break}for(var f=e.getLength();++n=2){f||(l=i.getCurrentTokenRow()-1),f+=c==2?1:-1;if(f<0)break}else if(c>=a)break}f||(l=i.getCurrentTokenRow()-1);while(l>t&&!/\S/.test(e.getLine(l)))l--;return new s(t,e.getLine(t).length,l,e.getLine(l).length)}}.call(u.prototype)}) -------------------------------------------------------------------------------- /js/ace/mode-lisp.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/lisp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/lisp_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./lisp_highlight_rules").LispHighlightRules,u=function(){var e=new o;this.$tokenizer=new s(e.getRules())};r.inherits(u,i),function(){}.call(u.prototype),t.Mode=u}),ace.define("ace/mode/lisp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e="case|do|let|loop|if|else|when",t="eq|neq|and|or",n="null|nil",r="cons|car|cdr|cond|lambda|format|setq|setf|quote|eval|append|list|listp|memberp|t|load|progn",i=this.createKeywordMapper({"keyword.control":e,"keyword.operator":t,"constant.language":n,"support.function":r},"identifier",!0);this.$rules={start:[{token:"comment",regex:";.*$"},{token:["storage.type.function-type.lisp","text","entity.name.function.lisp"],regex:"(?:\\b(?:(defun|defmethod|defmacro))\\b)(\\s+)((?:\\w|\\-|\\!|\\?)*)"},{token:["punctuation.definition.constant.character.lisp","constant.character.lisp"],regex:"(#)((?:\\w|[\\\\+-=<>'\"&#])+)"},{token:["punctuation.definition.variable.lisp","variable.other.global.lisp","punctuation.definition.variable.lisp"],regex:"(\\*)(\\S*)(\\*)"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+(?:L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(?:L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:i,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"string",regex:'"(?=.)',next:"qqstring"}],qqstring:[{token:"constant.character.escape.lisp",regex:"\\\\."},{token:"string",regex:'[^"\\\\]+'},{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"start"}]}};r.inherits(s,i),t.LispHighlightRules=s}) -------------------------------------------------------------------------------- /js/ace/mode-livescript.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/ls",function(e,t,n){function u(e,t){function n(){}return n.prototype=(e.superclass=t).prototype,(e.prototype=new n).constructor=e,typeof t.extended=="function"&&t.extended(e),e}function a(e,t){var n={}.hasOwnProperty;for(var r in t)n.call(t,r)&&(e[r]=t[r]);return e}var r,i,s,o;r="(?![\\d\\s])[$\\w\\xAA-\\uFFDC](?:(?!\\s)[$\\w\\xAA-\\uFFDC]|-[A-Za-z])*",t.Mode=i=function(t){function o(){var t;this.$tokenizer=new(e("ace/tokenizer").Tokenizer)(o.Rules);if(t=e("ace/mode/matching_brace_outdent"))this.$outdent=new t.MatchingBraceOutdent}var n,i=u((a(o,t).displayName="LiveScriptMode",o),t).prototype,s=o;return n=RegExp("(?:[({[=:]|[-~]>|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*"+r+")?))\\s*$"),i.getNextLineIndent=function(e,t,r){var i,s;return i=this.$getIndent(t),s=this.$tokenizer.getLineTokens(t,e).tokens,(!s.length||s[s.length-1].type!=="comment")&&e==="start"&&n.test(t)&&(i+=r),i},i.toggleCommentLines=function(t,n,r,i){var s,o,u,a,f,l;s=/^(\s*)#/,o=new(e("ace/range").Range)(0,0,0,0);for(u=r;u<=i;++u)a=u,(f=s.test(l=n.getLine(a)))?l=l.replace(s,"$1"):l=l.replace(/^\s*/,"$&#"),o.end.row=o.start.row=a,o.end.column=l.length+1,n.replace(o,l);return 1-f*2},i.checkOutdent=function(e,t,n){var r;return(r=this.$outdent)!=null?r.checkOutdent(t,n):void 8},i.autoOutdent=function(e,t,n){var r;return(r=this.$outdent)!=null?r.autoOutdent(t,n):void 8},o}(e("ace/mode/text").Mode),s="(?![$\\w]|-[A-Za-z]|\\s*:(?![:=]))",o={token:"string",regex:".+"},i.Rules={start:[{token:"keyword",regex:"(?:t(?:h(?:is|row|en)|ry|ypeof!?)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])|d(?:e(?:fault|lete|bugger)|o)|f(?:or(?:\\s+own)?|inally|unction)|s(?:uper|witch)|e(?:lse|x(?:tends|port)|val)|a(?:nd|rguments)|n(?:ew|ot)|un(?:less|til)|w(?:hile|ith)|o[fr]|return|break|let|var|loop)"+s},{token:"constant.language",regex:"(?:true|false|yes|no|on|off|null|void|undefined)"+s},{token:"invalid.illegal",regex:"(?:p(?:ackage|r(?:ivate|otected)|ublic)|i(?:mplements|nterface)|enum|static|yield)"+s},{token:"language.support.class",regex:"(?:R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|Array|Boolean|Date|Function|Number|Object|TypeError|URIError)"+s},{token:"language.support.function",regex:"(?:is(?:NaN|Finite)|parse(?:Int|Float)|Math|JSON|(?:en|de)codeURI(?:Component)?)"+s},{token:"variable.language",regex:"(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)"+s},{token:"identifier",regex:r+"\\s*:(?![:=])"},{token:"variable",regex:r},{token:"keyword.operator",regex:"(?:\\.{3}|\\s+\\?)"},{token:"keyword.variable",regex:"(?:@+|::|\\.\\.)",next:"key"},{token:"keyword.operator",regex:"\\.\\s*",next:"key"},{token:"string",regex:"\\\\\\S[^\\s,;)}\\]]*"},{token:"string.doc",regex:"'''",next:"qdoc"},{token:"string.doc",regex:'"""',next:"qqdoc"},{token:"string",regex:"'",next:"qstring"},{token:"string",regex:'"',next:"qqstring"},{token:"string",regex:"`",next:"js"},{token:"string",regex:"<\\[",next:"words"},{token:"string.regex",regex:"//",next:"heregex"},{token:"comment.doc",regex:"/\\*",next:"comment"},{token:"comment",regex:"#.*"},{token:"string.regex",regex:"\\/(?:[^[\\/\\n\\\\]*(?:(?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[\\/\\n\\\\]*)*)\\/[gimy$]{0,4}",next:"key"},{token:"constant.numeric",regex:"(?:0x[\\da-fA-F][\\da-fA-F_]*|(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]*|(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*)(?:e[+-]?\\d[\\d_]*)?[\\w$]*)"},{token:"lparen",regex:"[({[]"},{token:"rparen",regex:"[)}\\]]",next:"key"},{token:"keyword.operator",regex:"\\S+"},{token:"text",regex:"\\s+"}],heregex:[{token:"string.regex",regex:".*?//[gimy$?]{0,4}",next:"start"},{token:"string.regex",regex:"\\s*#{"},{token:"comment.regex",regex:"\\s+(?:#.*)?"},{token:"string.regex",regex:"\\S+"}],key:[{token:"keyword.operator",regex:"[.?@!]+"},{token:"identifier",regex:r,next:"start"},{token:"text",regex:".",next:"start"}],comment:[{token:"comment.doc",regex:".*?\\*/",next:"start"},{token:"comment.doc",regex:".+"}],qdoc:[{token:"string",regex:".*?'''",next:"key"},o],qqdoc:[{token:"string",regex:'.*?"""',next:"key"},o],qstring:[{token:"string",regex:"[^\\\\']*(?:\\\\.[^\\\\']*)*'",next:"key"},o],qqstring:[{token:"string",regex:'[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',next:"key"},o],js:[{token:"string",regex:"[^\\\\`]*(?:\\\\.[^\\\\`]*)*`",next:"key"},o],words:[{token:"string",regex:".*?\\]>",next:"key"},o]}}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){var t=e.match(/^(\s+)/);return t?t[1]:""}}).call(i.prototype),t.MatchingBraceOutdent=i}) -------------------------------------------------------------------------------- /js/ace/mode-lucene.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/lucene",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/lucene_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./lucene_highlight_rules").LuceneHighlightRules,u=function(){this.$tokenizer=new s((new o).getRules())};r.inherits(u,i),t.Mode=u}),ace.define("ace/mode/lucene_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=function(){this.$rules={start:[{token:"constant.character.negation",regex:"[\\-]"},{token:"constant.character.interro",regex:"[\\?]"},{token:"constant.character.asterisk",regex:"[\\*]"},{token:"constant.character.proximity",regex:"~[0-9]+\\b"},{token:"keyword.operator",regex:"(?:AND|OR|NOT)\\b"},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"keyword",regex:"[\\S]+:"},{token:"string",regex:'".*?"'},{token:"text",regex:"\\s+"}]}};r.inherits(o,s),t.LuceneHighlightRules=o}) -------------------------------------------------------------------------------- /js/ace/mode-makefile.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/makefile",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/makefile_highlight_rules","ace/mode/folding/coffee"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./makefile_highlight_rules").MakefileHighlightRules,u=e("./folding/coffee").FoldMode,a=function(){var e=new o;this.foldingRules=new u,this.$tokenizer=new s(e.getRules())};r.inherits(a,i),function(){}.call(a.prototype),t.Mode=a}),ace.define("ace/mode/makefile_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules","ace/mode/sh_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=e("./sh_highlight_rules"),o=function(){var e=this.createKeywordMapper({keyword:s.reservedKeywords,"support.function.builtin":s.languageConstructs,"invalid.deprecated":"debugger"},"string");this.$rules={start:[{token:"string.interpolated.backtick.makefile",regex:"`",next:"shell-start"},{token:"punctuation.definition.comment.makefile",regex:/#(?=.)/,next:"comment"},{token:["keyword.control.makefile"],regex:"^(?:\\s*\\b)(\\-??include|ifeq|ifneq|ifdef|ifndef|else|endif|vpath|export|unexport|define|endef|override)(?:\\b)"},{token:["entity.name.function.makefile","text"],regex:"^([^\\t ]+(?:\\s[^\\t ]+)*:)(\\s*.*)"}],comment:[{token:"punctuation.definition.comment.makefile",regex:/.+\\/},{token:"punctuation.definition.comment.makefile",regex:".+",next:"start"}],"shell-start":[{token:e,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"string",regex:"\\w+"},{token:"string.interpolated.backtick.makefile",regex:"`",next:"start"}]}};r.inherits(o,i),t.MakefileHighlightRules=o}),ace.define("ace/mode/sh_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=t.reservedKeywords="!|{|}|case|do|done|elif|else|esac|fi|for|if|in|then|until|while|&|;|export|local|read|typeset|unset|elif|select|set",o=t.languageConstructs="[|]|alias|bg|bind|break|builtin|cd|command|compgen|complete|continue|dirs|disown|echo|enable|eval|exec|exit|fc|fg|getopts|hash|help|history|jobs|kill|let|logout|popd|printf|pushd|pwd|return|set|shift|shopt|source|suspend|test|times|trap|type|ulimit|umask|unalias|wait",u=function(){var e=this.createKeywordMapper({keyword:s,"support.function.builtin":o,"invalid.deprecated":"debugger"},"identifier"),t="(?:(?:[1-9]\\d*)|(?:0))",n="(?:\\.\\d+)",r="(?:\\d+)",i="(?:(?:"+r+"?"+n+")|(?:"+r+"\\.))",u="(?:(?:"+i+"|"+r+")"+")",a="(?:"+u+"|"+i+")",f="(?:&"+r+")",l="[a-zA-Z][a-zA-Z0-9_]*",c="(?:(?:\\$"+l+")|(?:"+l+"=))",h="(?:\\$(?:SHLVL|\\$|\\!|\\?))",p="(?:"+l+"\\s*\\(\\))";this.$rules={start:[{token:["text","comment"],regex:/(^|\s)(#.*)$/},{token:"string",regex:'"(?:[^\\\\]|\\\\.)*?"'},{token:"variable.language",regex:h},{token:"variable",regex:c},{token:"support.function",regex:p},{token:"support.function",regex:f},{token:"string",regex:"'(?:[^\\\\]|\\\\.)*?'"},{token:"constant.numeric",regex:a},{token:"constant.numeric",regex:t+"\\b"},{token:e,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!="},{token:"paren.lparen",regex:"[\\[\\(\\{]"},{token:"paren.rparen",regex:"[\\]\\)\\}]"}]}};r.inherits(u,i),t.ShHighlightRules=u}),ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],function(e,t,n){var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=e("../../range").Range,o=t.FoldMode=function(){};r.inherits(o,i),function(){this.getFoldWidgetRange=function(e,t,n){var r=this.indentationBlock(e,n);if(r)return r;var i=/\S/,o=e.getLine(n),u=o.search(i);if(u==-1||o[u]!="#")return;var a=o.length,f=e.getLength(),l=n,c=n;while(++nl){var p=e.getLine(c).length;return new s(l,a,c,p)}},this.getFoldWidget=function(e,t,n){var r=e.getLine(n),i=r.search(/\S/),s=e.getLine(n+1),o=e.getLine(n-1),u=o.search(/\S/),a=s.search(/\S/);if(i==-1)return e.foldWidgets[n-1]=u!=-1&&u>=|<<=|<=>|&&=|=>|!~|\\^=|&=|\\|=|\\.=|x=|%=|\\/=|\\*=|\\-=|\\+=|=~|\\*\\*|\\-\\-|\\.\\.|\\|\\||&&|\\+\\+|\\->|!=|==|>=|<=|>>|<<|,|=|\\?\\:|\\^|\\||x|%|\\/|\\*|<|&|\\\\|~|!|>|\\.|\\-|\\+|\\-C|\\-b|\\-S|\\-u|\\-t|\\-p|\\-l|\\-d|\\-f|\\-g|\\-s|\\-z|\\-k|\\-e|\\-O|\\-T|\\-B|\\-M|\\-A|\\-X|\\-W|\\-c|\\-R|\\-o|\\-x|\\-w|\\-r|\\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],qqstring:[{token:"string",regex:'(?:(?:\\\\.)|(?:[^"\\\\]))*?"',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:(?:\\\\.)|(?:[^'\\\\]))*?'",next:"start"},{token:"string",regex:".+"}]}};r.inherits(s,i),t.PerlHighlightRules=s}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){var t=e.match(/^(\s+)/);return t?t[1]:""}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(){};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.getFoldWidgetRange=function(e,t,n){var r=e.getLine(n),i=r.match(this.foldingStartMarker);if(i){var s=i.index;return i[1]?this.openingBracketBlock(e,i[1],n,s):e.getCommentFoldRange(n,s+i[0].length,1)}if(t!=="markbeginend")return;var i=r.match(this.foldingStopMarker);if(i){var s=i.index+i[0].length;return i[1]?this.closingBracketBlock(e,i[1],n,s):e.getCommentFoldRange(n,s,-1)}}}.call(o.prototype)}) -------------------------------------------------------------------------------- /js/ace/mode-python.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/python",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/python_highlight_rules","ace/mode/folding/pythonic","ace/range"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./python_highlight_rules").PythonHighlightRules,u=e("./folding/pythonic").FoldMode,a=e("../range").Range,f=function(){this.$tokenizer=new s((new o).getRules()),this.foldingRules=new u("\\:")};r.inherits(f,i),function(){this.toggleCommentLines=function(e,t,n,r){var i=!0,s=/^(\s*)#/;for(var o=n;o<=r;o++)if(!s.test(t.getLine(o))){i=!1;break}if(i){var u=new a(0,0,0,0);for(var o=n;o<=r;o++){var f=t.getLine(o),l=f.match(s);u.start.row=o,u.end.row=o,u.end.column=l[0].length,t.replace(u,l[1])}}else t.indentRows(n,r,"#")},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.$tokenizer.getLineTokens(t,e),s=i.tokens;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"){var o=t.match(/^.*[\{\(\[\:]\s*$/);o&&(r+=n)}return r};var e={pass:1,"return":1,raise:1,"break":1,"continue":1};this.checkOutdent=function(t,n,r){if(r!=="\r\n"&&r!=="\r"&&r!=="\n")return!1;var i=this.$tokenizer.getLineTokens(n.trim(),t).tokens;if(!i)return!1;do var s=i.pop();while(s&&(s.type=="comment"||s.type=="text"&&s.value.match(/^\s+$/)));return s?s.type=="keyword"&&e[s.value]:!1},this.autoOutdent=function(e,t,n){n+=1;var r=this.$getIndent(t.getLine(n)),i=t.getTabString();r.slice(-i.length)==i&&t.remove(new a(n,r.length-i.length,n,r.length))}}.call(f.prototype),t.Mode=f}),ace.define("ace/mode/python_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e="and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield",t="True|False|None|NotImplemented|Ellipsis|__debug__",n="abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|float|list|raw_input|unichr|callable|format|locals|reduce|unicode|chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|__import__|complex|hash|min|set|apply|delattr|help|next|setattr|buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern",r=this.createKeywordMapper({"invalid.deprecated":"debugger","support.function":n,"constant.language":t,keyword:e},"identifier"),i="(?:r|u|ur|R|U|UR|Ur|uR)?",s="(?:(?:[1-9]\\d*)|(?:0))",o="(?:0[oO]?[0-7]+)",u="(?:0[xX][\\dA-Fa-f]+)",a="(?:0[bB][01]+)",f="(?:"+s+"|"+o+"|"+u+"|"+a+")",l="(?:[eE][+-]?\\d+)",c="(?:\\.\\d+)",h="(?:\\d+)",p="(?:(?:"+h+"?"+c+")|(?:"+h+"\\.))",d="(?:(?:"+p+"|"+h+")"+l+")",v="(?:"+d+"|"+p+")";this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"string",regex:i+'"{3}(?:[^\\\\]|\\\\.)*?"{3}'},{token:"string",regex:i+'"{3}.*$',next:"qqstring"},{token:"string",regex:i+'"(?:[^\\\\]|\\\\.)*?"'},{token:"string",regex:i+"'{3}(?:[^\\\\]|\\\\.)*?'{3}"},{token:"string",regex:i+"'{3}.*$",next:"qstring"},{token:"string",regex:i+"'(?:[^\\\\]|\\\\.)*?'"},{token:"constant.numeric",regex:"(?:"+v+"|\\d+)[jJ]\\b"},{token:"constant.numeric",regex:v},{token:"constant.numeric",regex:f+"[lL]\\b"},{token:"constant.numeric",regex:f+"\\b"},{token:r,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"paren.lparen",regex:"[\\[\\(\\{]"},{token:"paren.rparen",regex:"[\\]\\)\\}]"},{token:"text",regex:"\\s+"}],qqstring:[{token:"string",regex:'(?:[^\\\\]|\\\\.)*?"{3}',next:"start"},{token:"string",regex:".+"}],qstring:[{token:"string",regex:"(?:[^\\\\]|\\\\.)*?'{3}",next:"start"},{token:"string",regex:".+"}]}};r.inherits(s,i),t.PythonHighlightRules=s}),ace.define("ace/mode/folding/pythonic",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"],function(e,t,n){var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=t.FoldMode=function(e){this.foldingStartMarker=new RegExp("([\\[{])(?:\\s*)$|("+e+")(?:\\s*)(?:#.*)?$")};r.inherits(s,i),function(){this.getFoldWidgetRange=function(e,t,n){var r=e.getLine(n),i=r.match(this.foldingStartMarker);if(i)return i[1]?this.openingBracketBlock(e,i[1],n,i.index):i[2]?this.indentationBlock(e,n,i.index+i[2].length):this.indentationBlock(e,n)}}.call(s.prototype)}) -------------------------------------------------------------------------------- /js/ace/mode-rdoc.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/rdoc",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/rdoc_highlight_rules","ace/mode/matching_brace_outdent"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./text_highlight_rules").TextHighlightRules,u=e("./rdoc_highlight_rules").RDocHighlightRules,a=e("./matching_brace_outdent").MatchingBraceOutdent,f=function(e){this.$tokenizer=new s((new u).getRules()),this.$outdent=new a};r.inherits(f,i),function(){this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)}}.call(f.prototype),t.Mode=f}),ace.define("ace/mode/rdoc_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/latex_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=e("./latex_highlight_rules"),u=function(){this.$rules={start:[{token:"comment",regex:"%.*$"},{token:"text",regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:name|alias|method|S3method|S4method|item|code|preformatted|kbd|pkg|var|env|option|command|author|email|url|source|cite|acronym|href|code|preformatted|link|eqn|deqn|keyword|usage|examples|dontrun|dontshow|figure|if|ifelse|Sexpr|RdOpts|inputencoding|usepackage)\\b",next:"nospell"},{token:"keyword",regex:"\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],nospell:[{token:"comment",regex:"%.*$",next:"start"},{token:"nospell.text",regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:name|alias|method|S3method|S4method|item|code|preformatted|kbd|pkg|var|env|option|command|author|email|url|source|cite|acronym|href|code|preformatted|link|eqn|deqn|keyword|usage|examples|dontrun|dontshow|figure|if|ifelse|Sexpr|RdOpts|inputencoding|usepackage)\\b"},{token:"keyword",regex:"\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])",next:"start"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])]"},{token:"paren.keyword.operator",regex:"}",next:"start"},{token:"nospell.text",regex:"\\s+"},{token:"nospell.text",regex:"\\w+"}]}};r.inherits(u,s),t.RDocHighlightRules=u}),ace.define("ace/mode/latex_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"keyword",regex:"\\\\(?:[^a-zA-Z]|[a-zA-Z]+)"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"string",regex:"\\$(?:(?:\\\\.)|(?:[^\\$\\\\]))*?\\$"},{token:"comment",regex:"%.*$"}]}};r.inherits(s,i),t.LatexHighlightRules=s}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){var t=e.match(/^(\s+)/);return t?t[1]:""}}).call(i.prototype),t.MatchingBraceOutdent=i}) -------------------------------------------------------------------------------- /js/ace/mode-scheme.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/scheme",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/scheme_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./scheme_highlight_rules").SchemeHighlightRules,u=function(){var e=new o;this.$tokenizer=new s(e.getRules())};r.inherits(u,i),function(){}.call(u.prototype),t.Mode=u}),ace.define("ace/mode/scheme_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e="case|do|let|loop|if|else|when",t="eq?|eqv?|equal?|and|or|not|null?",n="#t|#f",r="cons|car|cdr|cond|lambda|lambda*|syntax-rules|format|set!|quote|eval|append|list|list?|member?|load",i=this.createKeywordMapper({"keyword.control":e,"keyword.operator":t,"constant.language":n,"support.function":r},"identifier",!0);this.$rules={start:[{token:"comment",regex:";.*$"},{token:["storage.type.function-type.scheme","text","entity.name.function.scheme"],regex:"(?:\\b(?:(define|define-syntax|define-macro))\\b)(\\s+)((?:\\w|\\-|\\!|\\?)*)"},{token:"punctuation.definition.constant.character.scheme",regex:"#:\\S+"},{token:["punctuation.definition.variable.scheme","variable.other.global.scheme","punctuation.definition.variable.scheme"],regex:"(\\*)(\\S*)(\\*)"},{token:"constant.numeric",regex:"#[xXoObB][0-9a-fA-F]+"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?"},{token:i,regex:"[a-zA-Z_#][a-zA-Z0-9_\\-\\?\\!\\*]*"},{token:"string",regex:'"(?=.)',next:"qqstring"}],qqstring:[{token:"constant.character.escape.scheme",regex:"\\\\."},{token:"string",regex:'[^"\\\\]+',merge:!0},{token:"string",regex:"\\\\$",next:"qqstring",merge:!0},{token:"string",regex:'"|$',next:"start",merge:!0}]}};r.inherits(s,i),t.SchemeHighlightRules=s}) -------------------------------------------------------------------------------- /js/ace/mode-sh.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/sh",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/sh_highlight_rules","ace/range"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./sh_highlight_rules").ShHighlightRules,u=e("../range").Range,a=function(){this.$tokenizer=new s((new o).getRules())};r.inherits(a,i),function(){this.toggleCommentLines=function(e,t,n,r){var i=!0,s=/^(\s*)#/;for(var o=n;o<=r;o++)if(!s.test(t.getLine(o))){i=!1;break}if(i){var a=new u(0,0,0,0);for(var o=n;o<=r;o++){var f=t.getLine(o),l=f.match(s);a.start.row=o,a.end.row=o,a.end.column=l[0].length,t.replace(a,l[1])}}else t.indentRows(n,r,"#")},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.$tokenizer.getLineTokens(t,e),s=i.tokens;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"){var o=t.match(/^.*[\{\(\[\:]\s*$/);o&&(r+=n)}return r};var e={pass:1,"return":1,raise:1,"break":1,"continue":1};this.checkOutdent=function(t,n,r){if(r!=="\r\n"&&r!=="\r"&&r!=="\n")return!1;var i=this.$tokenizer.getLineTokens(n.trim(),t).tokens;if(!i)return!1;do var s=i.pop();while(s&&(s.type=="comment"||s.type=="text"&&s.value.match(/^\s+$/)));return s?s.type=="keyword"&&e[s.value]:!1},this.autoOutdent=function(e,t,n){n+=1;var r=this.$getIndent(t.getLine(n)),i=t.getTabString();r.slice(-i.length)==i&&t.remove(new u(n,r.length-i.length,n,r.length))}}.call(a.prototype),t.Mode=a}),ace.define("ace/mode/sh_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=t.reservedKeywords="!|{|}|case|do|done|elif|else|esac|fi|for|if|in|then|until|while|&|;|export|local|read|typeset|unset|elif|select|set",o=t.languageConstructs="[|]|alias|bg|bind|break|builtin|cd|command|compgen|complete|continue|dirs|disown|echo|enable|eval|exec|exit|fc|fg|getopts|hash|help|history|jobs|kill|let|logout|popd|printf|pushd|pwd|return|set|shift|shopt|source|suspend|test|times|trap|type|ulimit|umask|unalias|wait",u=function(){var e=this.createKeywordMapper({keyword:s,"support.function.builtin":o,"invalid.deprecated":"debugger"},"identifier"),t="(?:(?:[1-9]\\d*)|(?:0))",n="(?:\\.\\d+)",r="(?:\\d+)",i="(?:(?:"+r+"?"+n+")|(?:"+r+"\\.))",u="(?:(?:"+i+"|"+r+")"+")",a="(?:"+u+"|"+i+")",f="(?:&"+r+")",l="[a-zA-Z][a-zA-Z0-9_]*",c="(?:(?:\\$"+l+")|(?:"+l+"=))",h="(?:\\$(?:SHLVL|\\$|\\!|\\?))",p="(?:"+l+"\\s*\\(\\))";this.$rules={start:[{token:["text","comment"],regex:/(^|\s)(#.*)$/},{token:"string",regex:'"(?:[^\\\\]|\\\\.)*?"'},{token:"variable.language",regex:h},{token:"variable",regex:c},{token:"support.function",regex:p},{token:"support.function",regex:f},{token:"string",regex:"'(?:[^\\\\]|\\\\.)*?'"},{token:"constant.numeric",regex:a},{token:"constant.numeric",regex:t+"\\b"},{token:e,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!="},{token:"paren.lparen",regex:"[\\[\\(\\{]"},{token:"paren.rparen",regex:"[\\]\\)\\}]"}]}};r.inherits(u,i),t.ShHighlightRules=u}) -------------------------------------------------------------------------------- /js/ace/mode-sql.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/sql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/sql_highlight_rules","ace/range"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./sql_highlight_rules").SqlHighlightRules,u=e("../range").Range,a=function(){this.$tokenizer=new s((new o).getRules())};r.inherits(a,i),function(){this.toggleCommentLines=function(e,t,n,r){var i=!0,s=[],o=/^(\s*)--/;for(var a=n;a<=r;a++)if(!o.test(t.getLine(a))){i=!1;break}if(i){var f=new u(0,0,0,0);for(var a=n;a<=r;a++){var l=t.getLine(a),c=l.match(o);f.start.row=a,f.end.row=a,f.end.column=c[0].length,t.replace(f,c[1])}}else t.indentRows(n,r,"--")}}.call(a.prototype),t.Mode=a}),ace.define("ace/mode/sql_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e="select|insert|update|delete|from|where|and|or|group|by|order|limit|offset|having|as|case|when|else|end|type|left|right|join|on|outer|desc|asc",t="true|false|null",n="count|min|max|avg|sum|rank|now|coalesce",r=this.createKeywordMapper({"support.function":n,keyword:e,"constant.language":t},"identifier",!0);this.$rules={start:[{token:"comment",regex:"--.*$"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:r,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"text",regex:"\\s+"}]}};r.inherits(s,i),t.SqlHighlightRules=s}) -------------------------------------------------------------------------------- /js/ace/mode-tcl.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/tcl",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/folding/cstyle","ace/mode/tcl_highlight_rules","ace/mode/matching_brace_outdent","ace/range"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./folding/cstyle").FoldMode,u=e("./tcl_highlight_rules").TclHighlightRules,a=e("./matching_brace_outdent").MatchingBraceOutdent,f=e("../range").Range,l=function(){this.$tokenizer=new s((new u).getRules()),this.$outdent=new a,this.foldingRules=new o};r.inherits(l,i),function(){this.toggleCommentLines=function(e,t,n,r){var i=!0,s=/^(\s*)#/;for(var o=n;o<=r;o++)if(!s.test(t.getLine(o))){i=!1;break}if(i){var u=new f(0,0,0,0);for(var o=n;o<=r;o++){var a=t.getLine(o),l=a.match(s);u.start.row=o,u.end.row=o,u.end.column=l[0].length,t.replace(u,l[1])}}else t.indentRows(n,r,"#")},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.$tokenizer.getLineTokens(t,e),s=i.tokens;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"){var o=t.match(/^.*[\{\(\[]\s*$/);o&&(r+=n)}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)}}.call(l.prototype),t.Mode=l}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(){};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.getFoldWidgetRange=function(e,t,n){var r=e.getLine(n),i=r.match(this.foldingStartMarker);if(i){var s=i.index;return i[1]?this.openingBracketBlock(e,i[1],n,s):e.getCommentFoldRange(n,s+i[0].length,1)}if(t!=="markbeginend")return;var i=r.match(this.foldingStopMarker);if(i){var s=i.index+i[0].length;return i[1]?this.closingBracketBlock(e,i[1],n,s):e.getCommentFoldRange(n,s,-1)}}}.call(o.prototype)}),ace.define("ace/mode/tcl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment",regex:"#.*\\\\$",next:"commentfollow"},{token:"comment",regex:"#.*$"},{token:"support.function",regex:"[\\\\]$",next:"splitlineStart"},{token:"text",regex:'[\\\\](?:["]|[{]|[}]|[[]|[]]|[$]|[])'},{token:"text",regex:"^|[^{][;][^}]|[/\r/]",next:"commandItem"},{token:"string",regex:'[ ]*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:'[ ]*["]',next:"qqstring"},{token:"variable.instance",regex:"[$]",next:"variable"},{token:"support.function",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|{\\*}|;|::"},{token:"identifier",regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"paren.lparen",regex:"[[{]",next:"commandItem"},{token:"paren.lparen",regex:"[(]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],commandItem:[{token:"comment",regex:"#.*\\\\$",next:"commentfollow"},{token:"comment",regex:"#.*$",next:"start"},{token:"string",regex:'[ ]*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"variable.instance",regex:"[$]",next:"variable"},{token:"support.function",regex:"(?:[:][:])[a-zA-Z0-9_/]+(?:[:][:])",next:"commandItem"},{token:"support.function",regex:"[a-zA-Z0-9_/]+(?:[:][:])",next:"commandItem"},{token:"support.function",regex:"(?:[:][:])",next:"commandItem"},{token:"paren.rparen",regex:"[\\])}]"},{token:"support.function",regex:"!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|{\\*}|;|::"},{token:"keyword",regex:"[a-zA-Z0-9_/]+",next:"start"}],commentfollow:[{token:"comment",regex:".*\\\\$",next:"commentfollow"},{token:"comment",regex:".+",next:"start"}],splitlineStart:[{token:"text",regex:"^.",next:"start"}],variable:[{token:"variable.instance",regex:"(?:[:][:])?[a-zA-Z_\\d]+(?:(?:[:][:])?[a-zA-Z_\\d]+)?(?:[(][a-zA-Z_\\d]+[)])?",next:"start"},{token:"variable.instance",regex:"[a-zA-Z_\\d]+(?:[(][a-zA-Z_\\d]+[)])?",next:"start"},{token:"variable.instance",regex:"{?[a-zA-Z_\\d]+}?",next:"start"}],qqstring:[{token:"string",regex:'(?:[^\\\\]|\\\\.)*?["]',next:"start"},{token:"string",regex:".+"}]}};r.inherits(s,i),t.TclHighlightRules=s}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){var t=e.match(/^(\s+)/);return t?t[1]:""}}).call(i.prototype),t.MatchingBraceOutdent=i}) -------------------------------------------------------------------------------- /js/ace/mode-tex.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/tex",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/tex_highlight_rules","ace/mode/matching_brace_outdent"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./text_highlight_rules").TextHighlightRules,u=e("./tex_highlight_rules").TexHighlightRules,a=e("./matching_brace_outdent").MatchingBraceOutdent,f=function(e){e?this.$tokenizer=new s((new o).getRules()):this.$tokenizer=new s((new u).getRules()),this.$outdent=new a};r.inherits(f,i),function(){this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.allowAutoInsert=function(){return!1}}.call(f.prototype),t.Mode=f}),ace.define("ace/mode/tex_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=function(e){e||(e="text"),this.$rules={start:[{token:"comment",regex:"%.*$"},{token:e,regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b",next:"nospell"},{token:"keyword",regex:"\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])}]"},{token:e,regex:"\\s+"}],nospell:[{token:"comment",regex:"%.*$",next:"start"},{token:"nospell."+e,regex:"\\\\[$&%#\\{\\}]"},{token:"keyword",regex:"\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b"},{token:"keyword",regex:"\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])",next:"start"},{token:"paren.keyword.operator",regex:"[[({]"},{token:"paren.keyword.operator",regex:"[\\])]"},{token:"paren.keyword.operator",regex:"}",next:"start"},{token:"nospell."+e,regex:"\\s+"},{token:"nospell."+e,regex:"\\w+"}]}};r.inherits(o,s),t.TexHighlightRules=o}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){var t=e.match(/^(\s+)/);return t?t[1]:""}}).call(i.prototype),t.MatchingBraceOutdent=i}) -------------------------------------------------------------------------------- /js/ace/mode-text.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomaswilburn/textbook/aaa45529dafacc83ec8002c7658c0f5862bf14ee/js/ace/mode-text.js -------------------------------------------------------------------------------- /js/ace/mode-textile.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/textile",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/textile_highlight_rules","ace/mode/matching_brace_outdent"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./textile_highlight_rules").TextileHighlightRules,u=e("./matching_brace_outdent").MatchingBraceOutdent,a=function(){this.$tokenizer=new s((new o).getRules()),this.$outdent=new u};r.inherits(a,i),function(){this.getNextLineIndent=function(e,t,n){return e=="intag"?n:""},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)}}.call(a.prototype),t.Mode=a}),ace.define("ace/mode/textile_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:function(e){return e.charAt(0)=="h"?"markup.heading."+e.charAt(1):"markup.heading"},regex:"h1|h2|h3|h4|h5|h6|bq|p|bc|pre",next:"blocktag"},{token:"keyword",regex:"[\\*]+|[#]+"},{token:"text",regex:".+"}],blocktag:[{token:"keyword",regex:"\\. ",next:"start"},{token:"keyword",regex:"\\(",next:"blocktagproperties"}],blocktagproperties:[{token:"keyword",regex:"\\)",next:"blocktag"},{token:"string",regex:"[a-zA-Z0-9\\-_]+"},{token:"keyword",regex:"#"}]}};r.inherits(s,i),t.TextileHighlightRules=s}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){var t=e.match(/^(\s+)/);return t?t[1]:""}}).call(i.prototype),t.MatchingBraceOutdent=i}) -------------------------------------------------------------------------------- /js/ace/mode-tm_snippet.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/tm_snippet",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./text_highlight_rules").TextHighlightRules,u=function(){var e="SELECTION|CURRENT_WORD|SELECTED_TEXT|CURRENT_LINE|LINE_INDEX|LINE_NUMBER|SOFT_TABS|TAB_SIZE|FILENAME|FILEPATH|FULLNAME";this.$rules={start:[{token:"constant.language.escape",regex:/\\[\$}`\\]/},{token:"keyword",regex:"\\$(?:TM_)?(?:"+e+")\\b"},{token:"variable",regex:"\\$\\w+"},{token:function(e,t,n){return n[1]?n[1]++:n.unshift("start",1),this.tokenName},tokenName:"markup.list",regex:"\\${",next:"varDecl"},{token:function(e,t,n){return n[1]?(n[1]--,n[1]||n.splice(0,2),this.tokenName):"text"},tokenName:"markup.list",regex:"}"},{token:"doc,comment",regex:/^\${2}-{5,}$/}],varDecl:[{regex:/\d+\b/,token:"constant.numeric"},{token:"keyword",regex:"(?:TM_)?(?:"+e+")\\b"},{token:"variable",regex:"\\w+"},{regex:/:/,token:"punctuation.operator",next:"start"},{regex:/\//,token:"string.regex",next:"regexp"},{regex:"",next:"start"}],regexp:[{regex:/\\./,token:"escape"},{regex:/\[/,token:"regex.start",next:"charClass"},{regex:"/",token:"string.regex",next:"format"},{token:"string.regex",regex:"."}],charClass:[{regex:"\\.",token:"escape"},{regex:"\\]",token:"regex.end",next:"regexp"},{token:"string.regex",regex:"."}],format:[{regex:/\\[ulULE]/,token:"keyword"},{regex:/\$\d+/,token:"variable"},{regex:"/[gim]*:?",token:"string.regex",next:"start"},{token:"string",regex:"."}]}};r.inherits(u,o),t.SnippetHighlightRules=u;var a=function(){var e=new u;this.$tokenizer=new s(e.getRules())};r.inherits(a,i),function(){this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)}}.call(a.prototype),t.Mode=a}) -------------------------------------------------------------------------------- /js/ace/mode-vbscript.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/vbscript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/vbscript_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./vbscript_highlight_rules").VBScriptHighlightRules,u=function(){var e=new o;this.$tokenizer=new s(e.getRules())};r.inherits(u,i),function(){}.call(u.prototype),t.Mode=u}),ace.define("ace/mode/vbscript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:["meta.ending-space"],regex:"$"},{token:[null],regex:"^(?=\\t)",next:"state_3"},{token:[null],regex:"^(?= )",next:"state_4"},{token:["storage.type.function.asp","text","entity.name.function.asp","text","punctuation.definition.parameters.asp","variable.parameter.function.asp","punctuation.definition.parameters.asp"],regex:"^\\s*((?:Function|Sub))(\\s*)([a-zA-Z_]\\w*)(\\s*)(\\()([^)]*)(\\)).*\\n?"},{token:"punctuation.definition.comment.asp",regex:"'|REM",next:"comment"},{token:["keyword.control.asp"],regex:"(?:\\b(If|Then|Else|ElseIf|Else If|End If|While|Wend|For|To|Each|Case|Select|End Select|Return|Continue|Do|Until|Loop|Next|With|Exit Do|Exit For|Exit Function|Exit Property|Exit Sub|IIf)\\b)"},{token:["keyword.operator.asp"],regex:"(?:\\b(Mod|And|Not|Or|Xor|as)\\b)"},{token:["storage.type.asp"],regex:"Dim|Call|Class|Const|Dim|Redim|Function|Sub|Private Sub|Public Sub|End sub|End Function|Set|Let|Get|New|Randomize|Option Explicit|On Error Resume Next|On Error GoTo"},{token:["storage.modifier.asp"],regex:"(?:\\b(Private|Public|Default)\\b)"},{token:["constant.language.asp"],regex:"(?:\\s*\\b(Empty|False|Nothing|Null|True)\\b)"},{token:["punctuation.definition.string.begin.asp"],regex:'"',next:"string"},{token:["punctuation.definition.variable.asp"],regex:"(\\$)[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\\b\\s*"},{token:["support.class.asp"],regex:"(?:\\b(Application|ObjectContext|Request|Response|Server|Session)\\b)"},{token:["support.class.collection.asp"],regex:"(?:\\b(Contents|StaticObjects|ClientCertificate|Cookies|Form|QueryString|ServerVariables)\\b)"},{token:["support.constant.asp"],regex:"(?:\\b(TotalBytes|Buffer|CacheControl|Charset|ContentType|Expires|ExpiresAbsolute|IsClientConnected|PICS|Status|ScriptTimeout|CodePage|LCID|SessionID|Timeout)\\b)"},{token:["support.function.asp"],regex:"(?:\\b(Lock|Unlock|SetAbort|SetComplete|BianryRead|AddHeader|AppendToLog|BinaryWrite|Clear|End|Flush|Redirect|Write|CreateObject|HTMLEncode|MapPath|URLEncode|Abandon|Convert|Regex)\\b)"},{token:["support.function.event.asp"],regex:"(?:\\b(Application_OnEnd|Application_OnStart|OnTransactionAbort|OnTransactionCommit|Session_OnEnd|Session_OnStart)\\b)"},{token:["support.function.vb.asp"],regex:"(?:\\b(Array|Add|Asc|Atn|CBool|CByte|CCur|CDate|CDbl|Chr|CInt|CLng|Conversions|Cos|CreateObject|CSng|CStr|Date|DateAdd|DateDiff|DatePart|DateSerial|DateValue|Day|Derived|Math|Escape|Eval|Exists|Exp|Filter|FormatCurrency|FormatDateTime|FormatNumber|FormatPercent|GetLocale|GetObject|GetRef|Hex|Hour|InputBox|InStr|InStrRev|Int|Fix|IsArray|IsDate|IsEmpty|IsNull|IsNumeric|IsObject|Item|Items|Join|Keys|LBound|LCase|Left|Len|LoadPicture|Log|LTrim|RTrim|Trim|Maths|Mid|Minute|Month|MonthName|MsgBox|Now|Oct|Remove|RemoveAll|Replace|RGB|Right|Rnd|Round|ScriptEngine|ScriptEngineBuildVersion|ScriptEngineMajorVersion|ScriptEngineMinorVersion|Second|SetLocale|Sgn|Sin|Space|Split|Sqr|StrComp|String|StrReverse|Tan|Time|Timer|TimeSerial|TimeValue|TypeName|UBound|UCase|Unescape|VarType|Weekday|WeekdayName|Year)\\b)"},{token:["constant.numeric.asp"],regex:"-?\\b(?:(?:0(?:x|X)[0-9a-fA-F]*)|(?:(?:[0-9]+\\.?[0-9]*)|(?:\\.[0-9]+))(?:(?:e|E)(?:\\+|-)?[0-9]+)?)(?:L|l|UL|ul|u|U|F|f)?\\b"},{token:["support.type.vb.asp"],regex:"(?:\\b(vbtrue|fvbalse|vbcr|vbcrlf|vbformfeed|vblf|vbnewline|vbnullchar|vbnullstring|int32|vbtab|vbverticaltab|vbbinarycompare|vbtextcomparevbsunday|vbmonday|vbtuesday|vbwednesday|vbthursday|vbfriday|vbsaturday|vbusesystemdayofweek|vbfirstjan1|vbfirstfourdays|vbfirstfullweek|vbgeneraldate|vblongdate|vbshortdate|vblongtime|vbshorttime|vbobjecterror|vbEmpty|vbNull|vbInteger|vbLong|vbSingle|vbDouble|vbCurrency|vbDate|vbString|vbObject|vbError|vbBoolean|vbVariant|vbDataObject|vbDecimal|vbByte|vbArray)\\b)"},{token:["entity.name.function.asp"],regex:"(?:(\\b[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\\b)(?=\\(\\)?))"},{token:["keyword.operator.asp"],regex:"\\-|\\+|\\*\\/|\\>|\\<|\\=|\\&"}],state_3:[{token:["meta.odd-tab.tabs","meta.even-tab.tabs"],regex:"(\\t)(\\t)?"},{token:"meta.leading-space",regex:"(?=[^\\t])",next:"start"},{token:"meta.leading-space",regex:".",next:"state_3"}],state_4:[{token:["meta.odd-tab.spaces","meta.even-tab.spaces"],regex:"( )( )?"},{token:"meta.leading-space",regex:"(?=[^ ])",next:"start"},{token:"meta.leading-space",regex:".",next:"state_4"}],comment:[{token:"comment.line.apostrophe.asp",regex:"$|(?=(?:%>))",next:"start"},{token:"comment.line.apostrophe.asp",regex:"."}],string:[{token:"constant.character.escape.apostrophe.asp",regex:'""'},{token:"string.quoted.double.asp",regex:'"',next:"start"},{token:"string.quoted.double.asp",regex:"."}]}};r.inherits(s,i),t.VBScriptHighlightRules=s}) -------------------------------------------------------------------------------- /js/ace/mode-yaml.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/mode/yaml",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/yaml_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/coffee"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./yaml_highlight_rules").YamlHighlightRules,u=e("./matching_brace_outdent").MatchingBraceOutdent,a=e("./folding/coffee").FoldMode,f=function(){this.$tokenizer=new s((new o).getRules()),this.$outdent=new u,this.foldingRules=new a};r.inherits(f,i),function(){this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t);if(e=="start"){var i=t.match(/^.*[\{\(\[]\s*$/);i&&(r+=n)}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)}}.call(f.prototype),t.Mode=f}),ace.define("ace/mode/yaml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment",regex:"#.*$"},{token:"list.markup",regex:/^(?:-{3}|\.{3})\s*(?=#|$)/},{token:"list.markup",regex:/^\s*[\-?](?:$|\s)/},{token:"constant",regex:"!![\\w//]+"},{token:"constant.language",regex:"[&\\*][a-zA-Z0-9-_]+"},{token:["meta.tag","keyword"],regex:/^(\s*\w.*?)(\:(?:\s+|$))/},{token:["meta.tag","keyword"],regex:/(\w+?)(\s*\:(?:\s+|$))/},{token:"keyword.operator",regex:"<<\\w*:\\w*"},{token:"keyword.operator",regex:"-\\s*(?=[{])"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:"[\\|>]\\w*",next:"qqstring"},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"constant.numeric",regex:/[+\-]?[\d_]+(?:(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?\b/},{token:"constant.numeric",regex:/[+\-]?\.inf\b|NaN\b|0x[\dA-Fa-f_]+|0b[10_]+/},{token:"constant.language.boolean",regex:"(?:true|false|TRUE|FALSE|True|False|yes|no)\\b"},{token:"invalid.illegal",regex:"\\/\\/.*$"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"}],qqstring:[{token:"string",regex:"(?=(?:(?:\\\\.)|(?:[^:]))*?:)",next:"start"},{token:"string",regex:".+"}]}};r.inherits(s,i),t.YamlHighlightRules=s}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){var t=e.match(/^(\s+)/);return t?t[1]:""}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],function(e,t,n){var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=e("../../range").Range,o=t.FoldMode=function(){};r.inherits(o,i),function(){this.getFoldWidgetRange=function(e,t,n){var r=this.indentationBlock(e,n);if(r)return r;var i=/\S/,o=e.getLine(n),u=o.search(i);if(u==-1||o[u]!="#")return;var a=o.length,f=e.getLength(),l=n,c=n;while(++nl){var p=e.getLine(c).length;return new s(l,a,c,p)}},this.getFoldWidget=function(e,t,n){var r=e.getLine(n),i=r.search(/\S/),s=e.getLine(n+1),o=e.getLine(n-1),u=o.search(/\S/),a=s.search(/\S/);if(i==-1)return e.foldWidgets[n-1]=u!=-1&&u span {font-weight: normal !important;}.ace-github .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-github .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-github .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-github .ace_gutter-active-line {background-color : rgba(0, 0, 0, 0.07);}.ace-github .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-github .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-github .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}';var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /js/ace/theme-idle_fingers.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/idle_fingers",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-idle-fingers",t.cssText=".ace-idle-fingers .ace_gutter {background: #3b3b3b;color: #fff}.ace-idle-fingers .ace_print-margin {width: 1px;background: #3b3b3b}.ace-idle-fingers .ace_scroller {background-color: #323232}.ace-idle-fingers .ace_text-layer {color: #FFFFFF}.ace-idle-fingers .ace_cursor {border-left: 2px solid #91FF00}.ace-idle-fingers .ace_overwrite-cursors .ace_cursor {border-left: 0px;border-bottom: 1px solid #91FF00}.ace-idle-fingers .ace_marker-layer .ace_selection {background: rgba(90, 100, 126, 0.88)}.ace-idle-fingers.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #323232;border-radius: 2px}.ace-idle-fingers .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-idle-fingers .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #404040}.ace-idle-fingers .ace_marker-layer .ace_active-line {background: #353637}.ace-idle-fingers .ace_gutter-active-line {background-color: #353637}.ace-idle-fingers .ace_marker-layer .ace_selected-word {border: 1px solid rgba(90, 100, 126, 0.88)}.ace-idle-fingers .ace_invisible {color: #404040}.ace-idle-fingers .ace_keyword,.ace-idle-fingers .ace_meta {color: #CC7833}.ace-idle-fingers .ace_constant,.ace-idle-fingers .ace_constant.ace_character,.ace-idle-fingers .ace_constant.ace_character.ace_escape,.ace-idle-fingers .ace_constant.ace_other,.ace-idle-fingers .ace_support.ace_constant {color: #6C99BB}.ace-idle-fingers .ace_invalid {color: #FFFFFF;background-color: #FF0000}.ace-idle-fingers .ace_fold {background-color: #CC7833;border-color: #FFFFFF}.ace-idle-fingers .ace_support.ace_function {color: #B83426}.ace-idle-fingers .ace_variable.ace_parameter {font-style: italic}.ace-idle-fingers .ace_string {color: #A5C261}.ace-idle-fingers .ace_string.ace_regexp {color: #CCCC33}.ace-idle-fingers .ace_comment {font-style: italic;color: #BC9458}.ace-idle-fingers .ace_meta.ace_tag {color: #FFE5BB}.ace-idle-fingers .ace_entity.ace_name {color: #FFC66D}.ace-idle-fingers .ace_markup.ace_underline {text-decoration: underline}.ace-idle-fingers .ace_collab.ace_user1 {color: #323232;background-color: #FFF980}.ace-idle-fingers .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMwMjL6zzBz5sz/ABEUBGCqhK6UAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /js/ace/theme-kr.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/kr_theme",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-kr-theme",t.cssText=".ace-kr-theme .ace_gutter {background: #1c1917;color: #FCFFE0}.ace-kr-theme .ace_print-margin {width: 1px;background: #1c1917}.ace-kr-theme .ace_scroller {background-color: #0B0A09}.ace-kr-theme .ace_text-layer {color: #FCFFE0}.ace-kr-theme .ace_cursor {border-left: 2px solid #FF9900}.ace-kr-theme .ace_overwrite-cursors .ace_cursor {border-left: 0px;border-bottom: 1px solid #FF9900}.ace-kr-theme .ace_marker-layer .ace_selection {background: rgba(170, 0, 255, 0.45)}.ace-kr-theme.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #0B0A09;border-radius: 2px}.ace-kr-theme .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-kr-theme .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(255, 177, 111, 0.32)}.ace-kr-theme .ace_marker-layer .ace_active-line {background: #38403D}.ace-kr-theme .ace_gutter-active-line {background-color : #38403D}.ace-kr-theme .ace_marker-layer .ace_selected-word {border: 1px solid rgba(170, 0, 255, 0.45)}.ace-kr-theme .ace_invisible {color: rgba(255, 177, 111, 0.32)}.ace-kr-theme .ace_keyword,.ace-kr-theme .ace_meta {color: #949C8B}.ace-kr-theme .ace_constant,.ace-kr-theme .ace_constant.ace_character,.ace-kr-theme .ace_constant.ace_character.ace_escape,.ace-kr-theme .ace_constant.ace_other {color: rgba(210, 117, 24, 0.76)}.ace-kr-theme .ace_invalid {color: #F8F8F8;background-color: #A41300}.ace-kr-theme .ace_support {color: #9FC28A}.ace-kr-theme .ace_support.ace_constant {color: #C27E66}.ace-kr-theme .ace_fold {background-color: #949C8B;border-color: #FCFFE0}.ace-kr-theme .ace_support.ace_function {color: #85873A}.ace-kr-theme .ace_storage {color: #FFEE80}.ace-kr-theme .ace_string {color: rgba(164, 161, 181, 0.8)}.ace-kr-theme .ace_string.ace_regexp {color: rgba(125, 255, 192, 0.65)}.ace-kr-theme .ace_comment {font-style: italic;color: #706D5B}.ace-kr-theme .ace_variable {color: #D1A796}.ace-kr-theme .ace_variable.ace_language {color: #FF80E1}.ace-kr-theme .ace_meta.ace_tag {color: #BABD9C}.ace-kr-theme .ace_markup.ace_underline {text-decoration: underline}.ace-kr-theme .ace_markup.ace_list {background-color: #0F0040}.ace-kr-theme .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPg5uL8zzBz5sz/AA1WA+hUYIqjAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /js/ace/theme-merbivore.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/merbivore",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-merbivore",t.cssText=".ace-merbivore .ace_gutter {background: #202020;color: #E6E1DC}.ace-merbivore .ace_print-margin {width: 1px;background: #555651}.ace-merbivore .ace_scroller {background-color: #161616}.ace-merbivore .ace_text-layer {color: #E6E1DC}.ace-merbivore .ace_cursor {border-left: 2px solid #FFFFFF}.ace-merbivore .ace_overwrite-cursors .ace_cursor {border-left: 0px;border-bottom: 1px solid #FFFFFF}.ace-merbivore .ace_marker-layer .ace_selection {background: #454545}.ace-merbivore.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #161616;border-radius: 2px}.ace-merbivore .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-merbivore .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #404040}.ace-merbivore .ace_marker-layer .ace_active-line {background: #333435}.ace-merbivore .ace_gutter-active-line {background-color: #333435}.ace-merbivore .ace_marker-layer .ace_selected-word {border: 1px solid #454545}.ace-merbivore .ace_invisible {color: #404040}.ace-merbivore .ace_entity.ace_name.ace_tag,.ace-merbivore .ace_keyword,.ace-merbivore .ace_meta,.ace-merbivore .ace_meta.ace_tag,.ace-merbivore .ace_storage,.ace-merbivore .ace_support.ace_function {color: #FC6F09}.ace-merbivore .ace_constant,.ace-merbivore .ace_constant.ace_character,.ace-merbivore .ace_constant.ace_character.ace_escape,.ace-merbivore .ace_constant.ace_other,.ace-merbivore .ace_support.ace_type {color: #1EDAFB}.ace-merbivore .ace_constant.ace_character.ace_escape {color: #519F50}.ace-merbivore .ace_constant.ace_language {color: #FDC251}.ace-merbivore .ace_constant.ace_library,.ace-merbivore .ace_string,.ace-merbivore .ace_support.ace_constant {color: #8DFF0A}.ace-merbivore .ace_constant.ace_numeric {color: #58C554}.ace-merbivore .ace_invalid {color: #FFFFFF;background-color: #990000}.ace-merbivore .ace_fold {background-color: #FC6F09;border-color: #E6E1DC}.ace-merbivore .ace_comment {font-style: italic;color: #AD2EA4}.ace-merbivore .ace_entity.ace_other.ace_attribute-name {color: #FFFF89}.ace-merbivore .ace_markup.ace_underline {text-decoration: underline}.ace-merbivore .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQExP7zzBz5sz/AA50BAyDznYhAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /js/ace/theme-merbivore_soft.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/merbivore_soft",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-merbivore-soft",t.cssText=".ace-merbivore-soft .ace_gutter {background: #262424;color: #E6E1DC}.ace-merbivore-soft .ace_print-margin {width: 1px;background: #262424}.ace-merbivore-soft .ace_scroller {background-color: #1C1C1C}.ace-merbivore-soft .ace_text-layer {color: #E6E1DC}.ace-merbivore-soft .ace_cursor {border-left: 2px solid #FFFFFF}.ace-merbivore-soft .ace_overwrite-cursors .ace_cursor {border-left: 0px;border-bottom: 1px solid #FFFFFF}.ace-merbivore-soft .ace_marker-layer .ace_selection {background: #494949}.ace-merbivore-soft.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #1C1C1C;border-radius: 2px}.ace-merbivore-soft .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-merbivore-soft .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #404040}.ace-merbivore-soft .ace_marker-layer .ace_active-line {background: #333435}.ace-merbivore-soft .ace_gutter-active-line {background-color: #333435}.ace-merbivore-soft .ace_marker-layer .ace_selected-word {border: 1px solid #494949}.ace-merbivore-soft .ace_invisible {color: #404040}.ace-merbivore-soft .ace_entity.ace_name.ace_tag,.ace-merbivore-soft .ace_keyword,.ace-merbivore-soft .ace_meta,.ace-merbivore-soft .ace_meta.ace_tag,.ace-merbivore-soft .ace_storage {color: #FC803A}.ace-merbivore-soft .ace_constant,.ace-merbivore-soft .ace_constant.ace_character,.ace-merbivore-soft .ace_constant.ace_character.ace_escape,.ace-merbivore-soft .ace_constant.ace_other,.ace-merbivore-soft .ace_support.ace_type {color: #68C1D8}.ace-merbivore-soft .ace_constant.ace_character.ace_escape {color: #B3E5B4}.ace-merbivore-soft .ace_constant.ace_language {color: #E1C582}.ace-merbivore-soft .ace_constant.ace_library,.ace-merbivore-soft .ace_string,.ace-merbivore-soft .ace_support.ace_constant {color: #8EC65F}.ace-merbivore-soft .ace_constant.ace_numeric {color: #7FC578}.ace-merbivore-soft .ace_invalid,.ace-merbivore-soft .ace_invalid.ace_deprecated {color: #FFFFFF;background-color: #FE3838}.ace-merbivore-soft .ace_fold {background-color: #FC803A;border-color: #E6E1DC}.ace-merbivore-soft .ace_comment,.ace-merbivore-soft .ace_meta {font-style: italic;color: #AC4BB8}.ace-merbivore-soft .ace_entity.ace_other.ace_attribute-name {color: #EAF1A3}.ace-merbivore-soft .ace_markup.ace_underline {text-decoration: underline}.ace-merbivore-soft .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWOQkZH5zzBz5sz/AA8EBB6crd1rAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /js/ace/theme-mono_industrial.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/mono_industrial",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-mono-industrial",t.cssText=".ace-mono-industrial .ace_gutter {background: #1d2521;color: #C5C9C9}.ace-mono-industrial .ace_print-margin {width: 1px;background: #555651}.ace-mono-industrial .ace_scroller {background-color: #222C28}.ace-mono-industrial .ace_text-layer {color: #FFFFFF}.ace-mono-industrial .ace_cursor {border-left: 2px solid #FFFFFF}.ace-mono-industrial .ace_overwrite-cursors .ace_cursor {border-left: 0px;border-bottom: 1px solid #FFFFFF}.ace-mono-industrial .ace_marker-layer .ace_selection {background: rgba(145, 153, 148, 0.40)}.ace-mono-industrial.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #222C28;border-radius: 2px}.ace-mono-industrial .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-mono-industrial .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(102, 108, 104, 0.50)}.ace-mono-industrial .ace_marker-layer .ace_active-line {background: rgba(12, 13, 12, 0.25)}.ace-mono-industrial .ace_gutter-active-line {background-color: rgba(12, 13, 12, 0.25)}.ace-mono-industrial .ace_marker-layer .ace_selected-word {border: 1px solid rgba(145, 153, 148, 0.40)}.ace-mono-industrial .ace_invisible {color: rgba(102, 108, 104, 0.50)}.ace-mono-industrial .ace_string {background-color: #151C19;color: #FFFFFF}.ace-mono-industrial .ace_keyword,.ace-mono-industrial .ace_meta {color: #A39E64}.ace-mono-industrial .ace_constant,.ace-mono-industrial .ace_constant.ace_character,.ace-mono-industrial .ace_constant.ace_character.ace_escape,.ace-mono-industrial .ace_constant.ace_numeric,.ace-mono-industrial .ace_constant.ace_other {color: #E98800}.ace-mono-industrial .ace_entity.ace_name.ace_function,.ace-mono-industrial .ace_keyword.ace_operator,.ace-mono-industrial .ace_variable {color: #A8B3AB}.ace-mono-industrial .ace_invalid {color: #FFFFFF;background-color: rgba(153, 0, 0, 0.68)}.ace-mono-industrial .ace_support.ace_constant {color: #C87500}.ace-mono-industrial .ace_fold {background-color: #A8B3AB;border-color: #FFFFFF}.ace-mono-industrial .ace_support.ace_function {color: #588E60}.ace-mono-industrial .ace_entity.ace_name,.ace-mono-industrial .ace_support.ace_class,.ace-mono-industrial .ace_support.ace_type {color: #5778B6}.ace-mono-industrial .ace_storage {color: #C23B00}.ace-mono-industrial .ace_variable.ace_language,.ace-mono-industrial .ace_variable.ace_parameter {color: #648BD2}.ace-mono-industrial .ace_comment {color: #666C68;background-color: #151C19}.ace-mono-industrial .ace_entity.ace_other.ace_attribute-name {color: #909993}.ace-mono-industrial .ace_markup.ace_underline {text-decoration: underline}.ace-mono-industrial .ace_entity.ace_name.ace_tag {color: #A65EFF}.ace-mono-industrial .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNQ0tH4zzBz5sz/ABAOBECKH+evAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /js/ace/theme-monokai.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/monokai",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-monokai",t.cssText=".ace-monokai .ace_gutter {background: #2F3129;color: #8F908A}.ace-monokai .ace_print-margin {width: 1px;background: #555651}.ace-monokai .ace_scroller {background-color: #272822}.ace-monokai .ace_text-layer {color: #F8F8F2}.ace-monokai .ace_cursor {border-left: 2px solid #F8F8F0}.ace-monokai .ace_overwrite-cursors .ace_cursor {border-left: 0px;border-bottom: 1px solid #F8F8F0}.ace-monokai .ace_marker-layer .ace_selection {background: #49483E}.ace-monokai.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #272822;border-radius: 2px}.ace-monokai .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-monokai .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #49483E}.ace-monokai .ace_marker-layer .ace_active-line {background: #202020}.ace-monokai .ace_gutter-active-line {background-color: #272727}.ace-monokai .ace_marker-layer .ace_selected-word {border: 1px solid #49483E}.ace-monokai .ace_invisible {color: #52524d}.ace-monokai .ace_entity.ace_name.ace_tag,.ace-monokai .ace_keyword,.ace-monokai .ace_meta,.ace-monokai .ace_storage {color: #F92672}.ace-monokai .ace_constant.ace_character,.ace-monokai .ace_constant.ace_language,.ace-monokai .ace_constant.ace_numeric,.ace-monokai .ace_constant.ace_other {color: #AE81FF}.ace-monokai .ace_invalid {color: #F8F8F0;background-color: #F92672}.ace-monokai .ace_invalid.ace_deprecated {color: #F8F8F0;background-color: #AE81FF}.ace-monokai .ace_support.ace_constant,.ace-monokai .ace_support.ace_function {color: #66D9EF}.ace-monokai .ace_fold {background-color: #A6E22E;border-color: #F8F8F2}.ace-monokai .ace_storage.ace_type,.ace-monokai .ace_support.ace_class,.ace-monokai .ace_support.ace_type {font-style: italic;color: #66D9EF}.ace-monokai .ace_entity.ace_name.ace_function,.ace-monokai .ace_entity.ace_other,.ace-monokai .ace_variable {color: #A6E22E}.ace-monokai .ace_variable.ace_parameter {font-style: italic;color: #FD971F}.ace-monokai .ace_string {color: #E6DB74}.ace-monokai .ace_comment {color: #75715E}.ace-monokai .ace_markup.ace_underline {text-decoration: underline}.ace-monokai .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNQ11D6z7Bq1ar/ABCKBG6g04U2AAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /js/ace/theme-pastel_on_dark.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/pastel_on_dark",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-pastel-on-dark",t.cssText=".ace-pastel-on-dark .ace_gutter {background: #353030;color: #8F938F}.ace-pastel-on-dark .ace_print-margin {width: 1px;background: #353030}.ace-pastel-on-dark .ace_scroller {background-color: #2C2828}.ace-pastel-on-dark .ace_text-layer {color: #8F938F}.ace-pastel-on-dark .ace_cursor {border-left: 2px solid #A7A7A7}.ace-pastel-on-dark .ace_overwrite-cursors .ace_cursor {border-left: 0px;border-bottom: 1px solid #A7A7A7}.ace-pastel-on-dark .ace_marker-layer .ace_selection {background: rgba(221, 240, 255, 0.20)}.ace-pastel-on-dark.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #2C2828;border-radius: 2px}.ace-pastel-on-dark .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-pastel-on-dark .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(255, 255, 255, 0.25)}.ace-pastel-on-dark .ace_marker-layer .ace_active-line {background: rgba(255, 255, 255, 0.031)}.ace-pastel-on-dark .ace_gutter-active-line {background-color: rgba(255, 255, 255, 0.031)}.ace-pastel-on-dark .ace_marker-layer .ace_selected-word {border: 1px solid rgba(221, 240, 255, 0.20)}.ace-pastel-on-dark .ace_invisible {color: rgba(255, 255, 255, 0.25)}.ace-pastel-on-dark .ace_keyword,.ace-pastel-on-dark .ace_meta {color: #757aD8}.ace-pastel-on-dark .ace_constant,.ace-pastel-on-dark .ace_constant.ace_character,.ace-pastel-on-dark .ace_constant.ace_character.ace_escape,.ace-pastel-on-dark .ace_constant.ace_other {color: #4FB7C5}.ace-pastel-on-dark .ace_keyword.ace_operator {color: #797878}.ace-pastel-on-dark .ace_constant.ace_character {color: #AFA472}.ace-pastel-on-dark .ace_constant.ace_language {color: #DE8E30}.ace-pastel-on-dark .ace_constant.ace_numeric {color: #CCCCCC}.ace-pastel-on-dark .ace_invalid,.ace-pastel-on-dark .ace_invalid.ace_illegal {color: #F8F8F8;background-color: rgba(86, 45, 86, 0.75)}.ace-pastel-on-dark .ace_invalid.ace_deprecated {text-decoration: underline;font-style: italic;color: #D2A8A1}.ace-pastel-on-dark .ace_fold {background-color: #757aD8;border-color: #8F938F}.ace-pastel-on-dark .ace_support.ace_function {color: #AEB2F8}.ace-pastel-on-dark .ace_string {color: #66A968}.ace-pastel-on-dark .ace_string.ace_regexp {color: #E9C062}.ace-pastel-on-dark .ace_comment {color: #A6C6FF}.ace-pastel-on-dark .ace_variable {color: #BEBF55}.ace-pastel-on-dark .ace_variable.ace_language {color: #C1C144}.ace-pastel-on-dark .ace_xml-pe {color: #494949}.ace-pastel-on-dark .ace_markup.ace_underline {text-decoration: underline}.ace-pastel-on-dark .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0dD4z9DR0fEfAA+vBBPqhbn1AAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /js/ace/theme-solarized_dark.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/solarized_dark",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-solarized-dark",t.cssText=".ace-solarized-dark .ace_gutter {background: #01313f;color: #d0edf7}.ace-solarized-dark .ace_print-margin {width: 1px;background: #33555E}.ace-solarized-dark .ace_scroller {background-color: #002B36}.ace-solarized-dark .ace_entity.ace_other.ace_attribute-name,.ace-solarized-dark .ace_storage,.ace-solarized-dark .ace_text-layer {color: #93A1A1}.ace-solarized-dark .ace_cursor {border-left: 2px solid #D30102}.ace-solarized-dark .ace_overwrite-cursors .ace_cursor {border-left: 0px;border-bottom: 1px solid #D30102}.ace-solarized-dark .ace_marker-layer .ace_active-line,.ace-solarized-dark .ace_marker-layer .ace_selection {background: rgba(255, 255, 255, 0.1)}.ace-solarized-dark.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #002B36;border-radius: 2px}.ace-solarized-dark .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-solarized-dark .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(147, 161, 161, 0.50)}.ace-solarized-dark .ace_gutter-active-line {background-color: #0d3440}.ace-solarized-dark .ace_marker-layer .ace_selected-word {border: 1px solid #073642}.ace-solarized-dark .ace_invisible {color: rgba(147, 161, 161, 0.50)}.ace-solarized-dark .ace_keyword,.ace-solarized-dark .ace_meta,.ace-solarized-dark .ace_support.ace_class,.ace-solarized-dark .ace_support.ace_type {color: #859900}.ace-solarized-dark .ace_constant.ace_character,.ace-solarized-dark .ace_constant.ace_other {color: #CB4B16}.ace-solarized-dark .ace_constant.ace_language {color: #B58900}.ace-solarized-dark .ace_constant.ace_numeric {color: #D33682}.ace-solarized-dark .ace_fold {background-color: #268BD2;border-color: #93A1A1}.ace-solarized-dark .ace_entity.ace_name.ace_function,.ace-solarized-dark .ace_entity.ace_name.ace_tag,.ace-solarized-dark .ace_support.ace_function,.ace-solarized-dark .ace_variable,.ace-solarized-dark .ace_variable.ace_language {color: #268BD2}.ace-solarized-dark .ace_string {color: #2AA198}.ace-solarized-dark .ace_string.ace_regexp {color: #D30102}.ace-solarized-dark .ace_comment {font-style: italic;color: #657B83}.ace-solarized-dark .ace_markup.ace_underline {text-decoration: underline}.ace-solarized-dark .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNg0Db7zzBz5sz/AA82BCv7wOIDAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /js/ace/theme-solarized_light.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/solarized_light",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-solarized-light",t.cssText=".ace-solarized-light .ace_gutter {background: #fbf1d3;color: #333}.ace-solarized-light .ace_print-margin {width: 1px;background: #e8e8e8}.ace-solarized-light .ace_scroller {background-color: #FDF6E3}.ace-solarized-light .ace_text-layer {color: #586E75}.ace-solarized-light .ace_cursor {border-left: 2px solid #000000}.ace-solarized-light .ace_overwrite-cursors .ace_cursor {border-left: 0px;border-bottom: 1px solid #000000}.ace-solarized-light .ace_marker-layer .ace_selection {background: #073642}.ace-solarized-light.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #FDF6E3;border-radius: 2px}.ace-solarized-light .ace_marker-layer .ace_step {background: rgb(255, 255, 0)}.ace-solarized-light .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(147, 161, 161, 0.50)}.ace-solarized-light .ace_marker-layer .ace_active-line {background: #EEE8D5}.ace-solarized-light .ace_gutter-active-line {background-color : #dcdcdc}.ace-solarized-light .ace_marker-layer .ace_selected-word {border: 1px solid #073642}.ace-solarized-light .ace_invisible {color: rgba(147, 161, 161, 0.50)}.ace-solarized-light .ace_keyword,.ace-solarized-light .ace_meta,.ace-solarized-light .ace_support.ace_class,.ace-solarized-light .ace_support.ace_type {color: #859900}.ace-solarized-light .ace_constant.ace_character,.ace-solarized-light .ace_constant.ace_other {color: #CB4B16}.ace-solarized-light .ace_constant.ace_language {color: #B58900}.ace-solarized-light .ace_constant.ace_numeric {color: #D33682}.ace-solarized-light .ace_fold {background-color: #268BD2;border-color: #586E75}.ace-solarized-light .ace_entity.ace_name.ace_function,.ace-solarized-light .ace_entity.ace_name.ace_tag,.ace-solarized-light .ace_support.ace_function,.ace-solarized-light .ace_variable,.ace-solarized-light .ace_variable.ace_language {color: #268BD2}.ace-solarized-light .ace_storage {color: #073642}.ace-solarized-light .ace_string {color: #2AA198}.ace-solarized-light .ace_string.ace_regexp {color: #D30102}.ace-solarized-light .ace_comment,.ace-solarized-light .ace_entity.ace_other.ace_attribute-name {color: #93A1A1}.ace-solarized-light .ace_markup.ace_underline {text-decoration: underline}.ace-solarized-light .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4++3xf4ZVq1b9BwAjxwbT1g3hiwAAAABJRU5ErkJggg==) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /js/ace/theme-textmate.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-tm",t.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm .ace_scroller {background-color: #FFFFFF;}.ace-tm .ace_cursor {border-left: 2px solid black;}.ace-tm .ace_overwrite-cursors .ace_cursor {border-left: 0px;border-bottom: 1px solid black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_markup.ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_markup.ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;border-radius: 2px;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}';var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /js/ace/theme-tomorrow.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/tomorrow",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-tomorrow",t.cssText=".ace-tomorrow .ace_gutter {background: #f6f6f6;color: #4D4D4C}.ace-tomorrow .ace_print-margin {width: 1px;background: #f6f6f6}.ace-tomorrow .ace_scroller {background-color: #FFFFFF}.ace-tomorrow .ace_text-layer {color: #4D4D4C}.ace-tomorrow .ace_cursor {border-left: 2px solid #AEAFAD}.ace-tomorrow .ace_overwrite-cursors .ace_cursor {border-left: 0px;border-bottom: 1px solid #AEAFAD}.ace-tomorrow .ace_marker-layer .ace_selection {background: #D6D6D6}.ace-tomorrow.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #FFFFFF;border-radius: 2px}.ace-tomorrow .ace_marker-layer .ace_step {background: rgb(255, 255, 0)}.ace-tomorrow .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #D1D1D1}.ace-tomorrow .ace_marker-layer .ace_active-line {background: #EFEFEF}.ace-tomorrow .ace_gutter-active-line {background-color : #dcdcdc}.ace-tomorrow .ace_marker-layer .ace_selected-word {border: 1px solid #D6D6D6}.ace-tomorrow .ace_invisible {color: #D1D1D1}.ace-tomorrow .ace_keyword,.ace-tomorrow .ace_meta,.ace-tomorrow .ace_storage,.ace-tomorrow .ace_storage.ace_type,.ace-tomorrow .ace_support.ace_type {color: #8959A8}.ace-tomorrow .ace_keyword.ace_operator {color: #3E999F}.ace-tomorrow .ace_constant.ace_character,.ace-tomorrow .ace_constant.ace_language,.ace-tomorrow .ace_constant.ace_numeric,.ace-tomorrow .ace_keyword.ace_other.ace_unit,.ace-tomorrow .ace_support.ace_constant,.ace-tomorrow .ace_variable.ace_parameter {color: #F5871F}.ace-tomorrow .ace_constant.ace_other {color: #666969}.ace-tomorrow .ace_invalid {color: #FFFFFF;background-color: #C82829}.ace-tomorrow .ace_invalid.ace_deprecated {color: #FFFFFF;background-color: #8959A8}.ace-tomorrow .ace_fold {background-color: #4271AE;border-color: #4D4D4C}.ace-tomorrow .ace_entity.ace_name.ace_function,.ace-tomorrow .ace_support.ace_function,.ace-tomorrow .ace_variable {color: #4271AE}.ace-tomorrow .ace_support.ace_class,.ace-tomorrow .ace_support.ace_type {color: #C99E00}.ace-tomorrow .ace_markup.ace_heading,.ace-tomorrow .ace_string {color: #718C00}.ace-tomorrow .ace_entity.ace_name.ace_tag,.ace-tomorrow .ace_entity.ace_other.ace_attribute-name,.ace-tomorrow .ace_meta.ace_tag,.ace-tomorrow .ace_string.ace_regexp,.ace-tomorrow .ace_variable {color: #C82829}.ace-tomorrow .ace_comment {color: #8E908C}.ace-tomorrow .ace_markup.ace_underline {text-decoration: underline}.ace-tomorrow .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bdu3f/BwAlfgctduB85QAAAABJRU5ErkJggg==) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /js/ace/theme-tomorrow_night.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/tomorrow_night",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-tomorrow-night",t.cssText=".ace-tomorrow-night .ace_gutter {background: #25282c;color: #C5C8C6}.ace-tomorrow-night .ace_print-margin {width: 1px;background: #25282c}.ace-tomorrow-night .ace_scroller {background-color: #1D1F21}.ace-tomorrow-night .ace_text-layer {color: #C5C8C6}.ace-tomorrow-night .ace_cursor {border-left: 2px solid #AEAFAD}.ace-tomorrow-night .ace_overwrite-cursors .ace_cursor {border-left: 0px;border-bottom: 1px solid #AEAFAD}.ace-tomorrow-night .ace_marker-layer .ace_selection {background: #373B41}.ace-tomorrow-night.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #1D1F21;border-radius: 2px}.ace-tomorrow-night .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-tomorrow-night .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #4B4E55}.ace-tomorrow-night .ace_marker-layer .ace_active-line {background: #282A2E}.ace-tomorrow-night .ace_gutter-active-line {background-color: #282A2E}.ace-tomorrow-night .ace_marker-layer .ace_selected-word {border: 1px solid #373B41}.ace-tomorrow-night .ace_invisible {color: #4B4E55}.ace-tomorrow-night .ace_keyword,.ace-tomorrow-night .ace_meta,.ace-tomorrow-night .ace_storage,.ace-tomorrow-night .ace_storage.ace_type,.ace-tomorrow-night .ace_support.ace_type {color: #B294BB}.ace-tomorrow-night .ace_keyword.ace_operator {color: #8ABEB7}.ace-tomorrow-night .ace_constant.ace_character,.ace-tomorrow-night .ace_constant.ace_language,.ace-tomorrow-night .ace_constant.ace_numeric,.ace-tomorrow-night .ace_keyword.ace_other.ace_unit,.ace-tomorrow-night .ace_support.ace_constant,.ace-tomorrow-night .ace_variable.ace_parameter {color: #DE935F}.ace-tomorrow-night .ace_constant.ace_other {color: #CED1CF}.ace-tomorrow-night .ace_invalid {color: #CED2CF;background-color: #DF5F5F}.ace-tomorrow-night .ace_invalid.ace_deprecated {color: #CED2CF;background-color: #B798BF}.ace-tomorrow-night .ace_fold {background-color: #81A2BE;border-color: #C5C8C6}.ace-tomorrow-night .ace_entity.ace_name.ace_function,.ace-tomorrow-night .ace_support.ace_function,.ace-tomorrow-night .ace_variable {color: #81A2BE}.ace-tomorrow-night .ace_support.ace_class,.ace-tomorrow-night .ace_support.ace_type {color: #F0C674}.ace-tomorrow-night .ace_markup.ace_heading,.ace-tomorrow-night .ace_string {color: #B5BD68}.ace-tomorrow-night .ace_entity.ace_name.ace_tag,.ace-tomorrow-night .ace_entity.ace_other.ace_attribute-name,.ace-tomorrow-night .ace_meta.ace_tag,.ace-tomorrow-night .ace_string.ace_regexp,.ace-tomorrow-night .ace_variable {color: #CC6666}.ace-tomorrow-night .ace_comment {color: #969896}.ace-tomorrow-night .ace_markup.ace_underline {text-decoration: underline}.ace-tomorrow-night .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWOQlVf8z7Bq1ar/AA/hBFp7egmpAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /js/ace/theme-tomorrow_night_blue.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/tomorrow_night_blue",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-tomorrow-night-blue",t.cssText=".ace-tomorrow-night-blue .ace_gutter {background: #00204b;color: #7388b5}.ace-tomorrow-night-blue .ace_print-margin {width: 1px;background: #00204b}.ace-tomorrow-night-blue .ace_scroller {background-color: #002451}.ace-tomorrow-night-blue .ace_constant.ace_other,.ace-tomorrow-night-blue .ace_text-layer {color: #FFFFFF}.ace-tomorrow-night-blue .ace_cursor {border-left: 2px solid #FFFFFF}.ace-tomorrow-night-blue .ace_overwrite-cursors .ace_cursor {border-left: 0px;border-bottom: 1px solid #FFFFFF}.ace-tomorrow-night-blue .ace_marker-layer .ace_selection {background: #003F8E}.ace-tomorrow-night-blue.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #002451;border-radius: 2px}.ace-tomorrow-night-blue .ace_marker-layer .ace_step {background: rgb(127, 111, 19)}.ace-tomorrow-night-blue .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #404F7D}.ace-tomorrow-night-blue .ace_marker-layer .ace_active-line {background: #00346E}.ace-tomorrow-night-blue .ace_gutter-active-line {background-color: #022040}.ace-tomorrow-night-blue .ace_marker-layer .ace_selected-word {border: 1px solid #003F8E}.ace-tomorrow-night-blue .ace_invisible {color: #404F7D}.ace-tomorrow-night-blue .ace_keyword,.ace-tomorrow-night-blue .ace_meta,.ace-tomorrow-night-blue .ace_storage,.ace-tomorrow-night-blue .ace_storage.ace_type,.ace-tomorrow-night-blue .ace_support.ace_type {color: #EBBBFF}.ace-tomorrow-night-blue .ace_keyword.ace_operator {color: #99FFFF}.ace-tomorrow-night-blue .ace_constant.ace_character,.ace-tomorrow-night-blue .ace_constant.ace_language,.ace-tomorrow-night-blue .ace_constant.ace_numeric,.ace-tomorrow-night-blue .ace_keyword.ace_other.ace_unit,.ace-tomorrow-night-blue .ace_support.ace_constant,.ace-tomorrow-night-blue .ace_variable.ace_parameter {color: #FFC58F}.ace-tomorrow-night-blue .ace_invalid {color: #FFFFFF;background-color: #F99DA5}.ace-tomorrow-night-blue .ace_invalid.ace_deprecated {color: #FFFFFF;background-color: #EBBBFF}.ace-tomorrow-night-blue .ace_fold {background-color: #BBDAFF;border-color: #FFFFFF}.ace-tomorrow-night-blue .ace_entity.ace_name.ace_function,.ace-tomorrow-night-blue .ace_support.ace_function,.ace-tomorrow-night-blue .ace_variable {color: #BBDAFF}.ace-tomorrow-night-blue .ace_support.ace_class,.ace-tomorrow-night-blue .ace_support.ace_type {color: #FFEEAD}.ace-tomorrow-night-blue .ace_markup.ace_heading,.ace-tomorrow-night-blue .ace_string {color: #D1F1A9}.ace-tomorrow-night-blue .ace_entity.ace_name.ace_tag,.ace-tomorrow-night-blue .ace_entity.ace_other.ace_attribute-name,.ace-tomorrow-night-blue .ace_meta.ace_tag,.ace-tomorrow-night-blue .ace_string.ace_regexp,.ace-tomorrow-night-blue .ace_variable {color: #FF9DA4}.ace-tomorrow-night-blue .ace_comment {color: #7285B7}.ace-tomorrow-night-blue .ace_markup.ace_underline {text-decoration: underline}.ace-tomorrow-night-blue .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgUAn8z7Bq1ar/ABBUBHJ4/r3JAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /js/ace/theme-tomorrow_night_bright.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/tomorrow_night_bright",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-tomorrow-night-bright",t.cssText=".ace-tomorrow-night-bright .ace_gutter {background: #1a1a1a;color: #DEDEDE}.ace-tomorrow-night-bright .ace_print-margin {width: 1px;background: #1a1a1a}.ace-tomorrow-night-bright .ace_scroller {background-color: #000000}.ace-tomorrow-night-bright .ace_text-layer {color: #DEDEDE}.ace-tomorrow-night-bright .ace_cursor {border-left: 2px solid #9F9F9F}.ace-tomorrow-night-bright .ace_overwrite-cursors .ace_cursor {border-left: 0px;border-bottom: 1px solid #9F9F9F}.ace-tomorrow-night-bright .ace_marker-layer .ace_selection {background: #424242}.ace-tomorrow-night-bright.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #000000;border-radius: 2px}.ace-tomorrow-night-bright .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-tomorrow-night-bright .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #343434}.ace-tomorrow-night-bright .ace_marker-layer .ace_active-line {background: #2A2A2A}.ace-tomorrow-night-bright .ace_gutter-active-line {background-color: #2A2A2A}.ace-tomorrow-night-bright .ace_marker-layer .ace_selected-word {border: 1px solid #424242}.ace-tomorrow-night-bright .ace_invisible {color: #343434}.ace-tomorrow-night-bright .ace_keyword,.ace-tomorrow-night-bright .ace_meta,.ace-tomorrow-night-bright .ace_storage,.ace-tomorrow-night-bright .ace_storage.ace_type,.ace-tomorrow-night-bright .ace_support.ace_type {color: #C397D8}.ace-tomorrow-night-bright .ace_keyword.ace_operator {color: #70C0B1}.ace-tomorrow-night-bright .ace_constant.ace_character,.ace-tomorrow-night-bright .ace_constant.ace_language,.ace-tomorrow-night-bright .ace_constant.ace_numeric,.ace-tomorrow-night-bright .ace_keyword.ace_other.ace_unit,.ace-tomorrow-night-bright .ace_support.ace_constant,.ace-tomorrow-night-bright .ace_variable.ace_parameter {color: #E78C45}.ace-tomorrow-night-bright .ace_constant.ace_other {color: #EEEEEE}.ace-tomorrow-night-bright .ace_invalid {color: #CED2CF;background-color: #DF5F5F}.ace-tomorrow-night-bright .ace_invalid.ace_deprecated {color: #CED2CF;background-color: #B798BF}.ace-tomorrow-night-bright .ace_fold {background-color: #7AA6DA;border-color: #DEDEDE}.ace-tomorrow-night-bright .ace_entity.ace_name.ace_function,.ace-tomorrow-night-bright .ace_support.ace_function,.ace-tomorrow-night-bright .ace_variable {color: #7AA6DA}.ace-tomorrow-night-bright .ace_support.ace_class,.ace-tomorrow-night-bright .ace_support.ace_type {color: #E7C547}.ace-tomorrow-night-bright .ace_markup.ace_heading,.ace-tomorrow-night-bright .ace_string {color: #B9CA4A}.ace-tomorrow-night-bright .ace_entity.ace_name.ace_tag,.ace-tomorrow-night-bright .ace_entity.ace_other.ace_attribute-name,.ace-tomorrow-night-bright .ace_meta.ace_tag,.ace-tomorrow-night-bright .ace_string.ace_regexp,.ace-tomorrow-night-bright .ace_variable {color: #D54E53}.ace-tomorrow-night-bright .ace_comment {color: #969896}.ace-tomorrow-night-bright .ace_markup.ace_underline {text-decoration: underline}.ace-tomorrow-night-bright .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGD4z7Bq1ar/AAz9A/2naJQKAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /js/ace/theme-tomorrow_night_eighties.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/tomorrow_night_eighties",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-tomorrow-night-eighties",t.cssText=".ace-tomorrow-night-eighties .ace_gutter {background: #272727;color: #CCC}.ace-tomorrow-night-eighties .ace_print-margin {width: 1px;background: #272727}.ace-tomorrow-night-eighties .ace_scroller {background-color: #2D2D2D}.ace-tomorrow-night-eighties .ace_constant.ace_other,.ace-tomorrow-night-eighties .ace_text-layer {color: #CCCCCC}.ace-tomorrow-night-eighties .ace_cursor {border-left: 2px solid #CCCCCC}.ace-tomorrow-night-eighties .ace_overwrite-cursors .ace_cursor {border-left: 0px;border-bottom: 1px solid #CCCCCC}.ace-tomorrow-night-eighties .ace_marker-layer .ace_selection {background: #515151}.ace-tomorrow-night-eighties.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #2D2D2D;border-radius: 2px}.ace-tomorrow-night-eighties .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-tomorrow-night-eighties .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #6A6A6A}.ace-tomorrow-night-eighties .ace_marker-layer .ace_active-line {background: #393939}.ace-tomorrow-night-eighties .ace_gutter-active-line {background-color: #393939}.ace-tomorrow-night-eighties .ace_marker-layer .ace_selected-word {border: 1px solid #515151}.ace-tomorrow-night-eighties .ace_invisible {color: #6A6A6A}.ace-tomorrow-night-eighties .ace_keyword,.ace-tomorrow-night-eighties .ace_meta,.ace-tomorrow-night-eighties .ace_storage,.ace-tomorrow-night-eighties .ace_storage.ace_type,.ace-tomorrow-night-eighties .ace_support.ace_type {color: #CC99CC}.ace-tomorrow-night-eighties .ace_keyword.ace_operator {color: #66CCCC}.ace-tomorrow-night-eighties .ace_constant.ace_character,.ace-tomorrow-night-eighties .ace_constant.ace_language,.ace-tomorrow-night-eighties .ace_constant.ace_numeric,.ace-tomorrow-night-eighties .ace_keyword.ace_other.ace_unit,.ace-tomorrow-night-eighties .ace_support.ace_constant,.ace-tomorrow-night-eighties .ace_variable.ace_parameter {color: #F99157}.ace-tomorrow-night-eighties .ace_invalid {color: #CDCDCD;background-color: #F2777A}.ace-tomorrow-night-eighties .ace_invalid.ace_deprecated {color: #CDCDCD;background-color: #CC99CC}.ace-tomorrow-night-eighties .ace_fold {background-color: #6699CC;border-color: #CCCCCC}.ace-tomorrow-night-eighties .ace_entity.ace_name.ace_function,.ace-tomorrow-night-eighties .ace_support.ace_function,.ace-tomorrow-night-eighties .ace_variable {color: #6699CC}.ace-tomorrow-night-eighties .ace_support.ace_class,.ace-tomorrow-night-eighties .ace_support.ace_type {color: #FFCC66}.ace-tomorrow-night-eighties .ace_markup.ace_heading,.ace-tomorrow-night-eighties .ace_string {color: #99CC99}.ace-tomorrow-night-eighties .ace_comment {color: #999999}.ace-tomorrow-night-eighties .ace_entity.ace_name.ace_tag,.ace-tomorrow-night-eighties .ace_entity.ace_other.ace_attribute-name,.ace-tomorrow-night-eighties .ace_meta.ace_tag,.ace-tomorrow-night-eighties .ace_variable {color: #F2777A}.ace-tomorrow-night-eighties .ace_markup.ace_underline {text-decoration: underline}.ace-tomorrow-night-eighties .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ1dX9z7Bq1ar/ABE1BITwhhuFAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /js/ace/theme-twilight.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/twilight",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-twilight",t.cssText=".ace-twilight .ace_gutter {background: #232323;color: #E2E2E2}.ace-twilight .ace_print-margin {width: 1px;background: #232323}.ace-twilight .ace_scroller {background-color: #141414}.ace-twilight .ace_text-layer {color: #F8F8F8}.ace-twilight .ace_cursor {border-left: 2px solid #A7A7A7}.ace-twilight .ace_overwrite-cursors .ace_cursor {border-left: 0px;border-bottom: 1px solid #A7A7A7}.ace-twilight .ace_marker-layer .ace_selection {background: rgba(221, 240, 255, 0.20)}.ace-twilight.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #141414;border-radius: 2px}.ace-twilight .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-twilight .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(255, 255, 255, 0.25)}.ace-twilight .ace_marker-layer .ace_active-line {background: rgba(255, 255, 255, 0.031)}.ace-twilight .ace_gutter-active-line {background-color: rgba(255, 255, 255, 0.031)}.ace-twilight .ace_marker-layer .ace_selected-word {border: 1px solid rgba(221, 240, 255, 0.20)}.ace-twilight .ace_invisible {color: rgba(255, 255, 255, 0.25)}.ace-twilight .ace_keyword,.ace-twilight .ace_meta {color: #CDA869}.ace-twilight .ace_constant,.ace-twilight .ace_constant.ace_character,.ace-twilight .ace_constant.ace_character.ace_escape,.ace-twilight .ace_constant.ace_other,.ace-twilight .ace_markup.ace_heading,.ace-twilight .ace_support.ace_constant {color: #CF6A4C}.ace-twilight .ace_invalid.ace_illegal {color: #F8F8F8;background-color: rgba(86, 45, 86, 0.75)}.ace-twilight .ace_invalid.ace_deprecated {text-decoration: underline;font-style: italic;color: #D2A8A1}.ace-twilight .ace_support {color: #9B859D}.ace-twilight .ace_fold {background-color: #AC885B;border-color: #F8F8F8}.ace-twilight .ace_support.ace_function {color: #DAD085}.ace-twilight .ace_markup.ace_list,.ace-twilight .ace_storage {color: #F9EE98}.ace-twilight .ace_entity.ace_name.ace_function,.ace-twilight .ace_meta.ace_tag,.ace-twilight .ace_variable {color: #AC885B}.ace-twilight .ace_string {color: #8F9D6A}.ace-twilight .ace_string.ace_regexp {color: #E9C062}.ace-twilight .ace_comment {font-style: italic;color: #5F5A60}.ace-twilight .ace_variable {color: #7587A6}.ace-twilight .ace_xml-pe {color: #494949}.ace-twilight .ace_markup.ace_underline {text-decoration: underline}.ace-twilight .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQERH5zzBz5sz/AA5EBAYqeZXWAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /js/ace/theme-vibrant_ink.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/vibrant_ink",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-vibrant-ink",t.cssText=".ace-vibrant-ink .ace_gutter {background: #1a1a1a;color: #BEBEBE}.ace-vibrant-ink .ace_print-margin {width: 1px;background: #1a1a1a}.ace-vibrant-ink .ace_scroller {background-color: #0F0F0F}.ace-vibrant-ink .ace_text-layer {color: #FFFFFF}.ace-vibrant-ink .ace_cursor {border-left: 2px solid #FFFFFF}.ace-vibrant-ink .ace_overwrite-cursors .ace_cursor {border-left: 0px;border-bottom: 1px solid #FFFFFF}.ace-vibrant-ink .ace_marker-layer .ace_selection {background: #6699CC}.ace-vibrant-ink.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #0F0F0F;border-radius: 2px}.ace-vibrant-ink .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-vibrant-ink .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #404040}.ace-vibrant-ink .ace_marker-layer .ace_active-line {background: #333333}.ace-vibrant-ink .ace_gutter-active-line {background-color: #333333}.ace-vibrant-ink .ace_marker-layer .ace_selected-word {border: 1px solid #6699CC}.ace-vibrant-ink .ace_invisible {color: #404040}.ace-vibrant-ink .ace_keyword,.ace-vibrant-ink .ace_meta {color: #FF6600}.ace-vibrant-ink .ace_constant,.ace-vibrant-ink .ace_constant.ace_character,.ace-vibrant-ink .ace_constant.ace_character.ace_escape,.ace-vibrant-ink .ace_constant.ace_other {color: #339999}.ace-vibrant-ink .ace_constant.ace_numeric {color: #99CC99}.ace-vibrant-ink .ace_invalid,.ace-vibrant-ink .ace_invalid.ace_deprecated {color: #CCFF33;background-color: #000000}.ace-vibrant-ink .ace_fold {background-color: #FFCC00;border-color: #FFFFFF}.ace-vibrant-ink .ace_entity.ace_name.ace_function,.ace-vibrant-ink .ace_support.ace_function,.ace-vibrant-ink .ace_variable {color: #FFCC00}.ace-vibrant-ink .ace_variable.ace_parameter {font-style: italic}.ace-vibrant-ink .ace_string {color: #66FF00}.ace-vibrant-ink .ace_string.ace_regexp {color: #44B4CC}.ace-vibrant-ink .ace_comment {color: #9933CC}.ace-vibrant-ink .ace_entity.ace_other.ace_attribute-name {font-style: italic;color: #99CC99}.ace-vibrant-ink .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPg5+f/z7Bq1ar/AA5lBCqoLxsgAAAAAElFTkSuQmCC) right repeat-y}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /js/ace/theme-xcode.js: -------------------------------------------------------------------------------- 1 | ace.define("ace/theme/xcode",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-xcode",t.cssText="/* THIS THEME WAS AUTOGENERATED BY Theme.tmpl.css (UUID: EE3AD170-2B7F-4DE1-B724-C75F13FE0085) */.ace-xcode .ace_gutter {background: #e8e8e8;color: #333}.ace-xcode .ace_print-margin {width: 1px;background: #e8e8e8}.ace-xcode .ace_scroller {background-color: #FFFFFF}.ace-xcode .ace_text-layer {color: #000000}.ace-xcode .ace_cursor {border-left: 2px solid #000000}.ace-xcode .ace_overwrite-cursors .ace_cursor {border-left: 0px;border-bottom: 1px solid #000000}.ace-xcode .ace_marker-layer .ace_selection {background: #B5D5FF}.ace-xcode.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #FFFFFF;border-radius: 2px}.ace-xcode .ace_marker-layer .ace_step {background: rgb(198, 219, 174)}.ace-xcode .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #BFBFBF}.ace-xcode .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.071)}.ace-xcode .ace_gutter-active-line {background-color: rgba(0, 0, 0, 0.071)}.ace-xcode .ace_marker-layer .ace_selected-word {border: 1px solid #B5D5FF}.ace-xcode .ace_constant.ace_language,.ace-xcode .ace_keyword,.ace-xcode .ace_meta,.ace-xcode .ace_variable.ace_language {color: #C800A4}.ace-xcode .ace_invisible {color: #BFBFBF}.ace-xcode .ace_constant.ace_character,.ace-xcode .ace_constant.ace_other {color: #275A5E}.ace-xcode .ace_constant.ace_numeric {color: #3A00DC}.ace-xcode .ace_entity.ace_other.ace_attribute-name,.ace-xcode .ace_support.ace_constant,.ace-xcode .ace_support.ace_function {color: #450084}.ace-xcode .ace_fold {background-color: #C800A4;border-color: #000000}.ace-xcode .ace_entity.ace_name.ace_tag,.ace-xcode .ace_support.ace_class,.ace-xcode .ace_support.ace_type {color: #790EAD}.ace-xcode .ace_storage {color: #C900A4}.ace-xcode .ace_string {color: #DF0002}.ace-xcode .ace_comment {color: #008E00}.ace-xcode .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==) right repeat-y;}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) -------------------------------------------------------------------------------- /js/dom/Delay.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Delay is a module for running scripts only when a given element scrolls into 4 | view. You can run it by passing in an element to Delay(), which will return a 5 | promise that's fulfilled when it enters the viewport. 6 | 7 | Note: We don't use this as a plugin (i.e., require(['delay!'])), even though 8 | that would be awesome, because Require normally requires scripts to return 9 | within a certain timeout period (default of 7 seconds). However, if we were to 10 | set that to 0, we could get the awesome plugin behavior. 11 | 12 | */ 13 | 14 | define(['jquery'], function($) { 15 | 16 | var offsets = []; 17 | $(window).on('scroll', function() { 18 | var boundary = window.scrollY + window.innerHeight; 19 | offsets = offsets.filter(function(item) { 20 | if (item.top < boundary) { 21 | item.callback(); 22 | return false; 23 | } 24 | return true; 25 | }); 26 | }); 27 | 28 | setTimeout(function() { 29 | $(window).trigger('scroll'); 30 | }) 31 | 32 | return function(element) { 33 | element = typeof element == "string" ? $(element) : element; 34 | var deferred = $.Deferred(); 35 | var offset = element.offset(); 36 | offset.callback = deferred.resolve; 37 | offsets.push(offset); 38 | return deferred; 39 | } 40 | 41 | }); -------------------------------------------------------------------------------- /js/dom/Stage.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Stage provides a simple, minimal version of the AS3 display tree as a thin 4 | wrapper for the Canvas APIs. It's meant to make complex display heirarchies 5 | somewhat less painful to code. It does not, at this time, provide any kind of 6 | event handling. What you get is pretty terse: 7 | 8 | * Stage(canvas) provides a stage object that spawns other display objects, 9 | including 10 | 11 | * Sprite, which has can host smaller Sprites and draw on a transformed 12 | context, and 13 | 14 | * TextBox, which provides very basic text handling 15 | 16 | If it gets much bigger than this, we'll have to break it into multiple 17 | modules. Let's not. 18 | 19 | */ 20 | 21 | define([], function() { 22 | 23 | var SpriteProto = { 24 | render: function() { 25 | var context = this.context; 26 | context.save(); 27 | context.fillStyle = "black"; 28 | context.strokeStyle = "black"; 29 | context.lineWidth = 1; 30 | var transform = { 31 | x: this.x || 0, 32 | y: this.y || 0, 33 | rot: this.rotation || 0, 34 | scaleX: this.scaleX || 1, 35 | scaleY: this.scaleY || 1 36 | } 37 | context.translate(transform.x, transform.y); 38 | context.rotate(transform.rot); 39 | context.scale(transform.scaleX, transform.scaleY); 40 | context.beginPath(); 41 | this.draw(); 42 | if (this.children) for (var i = 0; i < this.children.length; i++) { 43 | this.children[i].render(); 44 | } 45 | context.restore(); 46 | }, 47 | draw: function() { /* OVERRIDE ME */}, 48 | addChild: function(child) { 49 | this.removeChild(child); 50 | this.children.push(child); 51 | }, 52 | removeChild: function(child) { 53 | this.children = this.children.filter(function(item) { 54 | return item != child; 55 | }); 56 | } 57 | }; 58 | 59 | var TextProto = { 60 | x: 0, 61 | y: 0, 62 | width: 150, 63 | height: 100, 64 | font: 'sans-serif', 65 | size: 16, 66 | lineSpacing: 2, 67 | color: 'black', 68 | text: '', 69 | align: 'left', 70 | render: SpriteProto.render, 71 | draw: function() { 72 | var context = this.context; 73 | var split = this.text.split(' '); 74 | context.fillStyle = this.color; 75 | context.font = this.size + "px " + this.font; 76 | var y = this.size; 77 | var line = ""; 78 | for (var i = 0; i < split.length; i++) { 79 | var word = split[i] + " "; 80 | line += word; 81 | var measure = context.measureText(line + (split[i + 1] || "")); 82 | if (measure.width > this.width || i == split.length - 1) { 83 | var lineWidth = context.measureText(line).width; 84 | var margin = 0; 85 | switch (this.align) { 86 | case 'center': 87 | margin = (this.width - lineWidth) / 2; 88 | break; 89 | 90 | case 'right': 91 | margin = (this.width - lineWidth); 92 | } 93 | context.fillText(line, margin, y); 94 | line = ""; 95 | y += this.size + this.lineSpacing; 96 | } 97 | } 98 | } 99 | } 100 | 101 | var Stage = function(canvas) { 102 | if (typeof canvas == 'string') { 103 | canvas = document.querySelector(canvas); 104 | } 105 | this.canvas = canvas.jquery ? canvas[0] : canvas; 106 | this.context = this.canvas.getContext('2d'); 107 | this.children = []; 108 | var stage = this; 109 | 110 | var Sprite = function() { 111 | this.stage = stage; 112 | this.context = stage.context; 113 | this.children = []; 114 | this.x = this.y = 0; 115 | this.scaleX = this.scaleY = 1; 116 | this.rotation = 0; 117 | }; 118 | 119 | var Text = function() { 120 | this.stage = stage; 121 | this.context = stage.context; 122 | this.x = this.y = 0; 123 | this.scaleX = this.scaleY = 1; 124 | this.rotation = 0; 125 | } 126 | 127 | Sprite.prototype = SpriteProto; 128 | Text.prototype = TextProto; 129 | this.Sprite = Sprite; 130 | this.TextBox = Text; 131 | this.draw = function() { 132 | this.context.clearRect(0, 0, this.canvas.width, this.canvas.height); 133 | } 134 | } 135 | Stage.prototype = SpriteProto; 136 | 137 | return Stage; 138 | 139 | }); -------------------------------------------------------------------------------- /js/dom/Visible.js: -------------------------------------------------------------------------------- 1 | /* 2 | A module that allows you to enable "visible" and "hidden" events on elements, 3 | which is useful for costly animations that you don't want to run while they're 4 | offscreen. 5 | */ 6 | 7 | define(['jquery'], function($) { 8 | 9 | 10 | 11 | }); -------------------------------------------------------------------------------- /js/file.js: -------------------------------------------------------------------------------- 1 | /* 2 | File load plugin for RequireJS. 3 | I'm not wild about how text! works, so we're going to use this instead. 4 | NOTE: doesn't work on local files, start a server first. 5 | */ 6 | 7 | define(['jquery'], function() { 8 | 9 | var cache = {}; 10 | 11 | var plugin = { 12 | load: function(name, parentRequire, onload, config) { 13 | var file = config.baseUrl + '/' + name; 14 | file = file.replace(/\/\/+/g, '/'); 15 | var request = $.ajax({ 16 | url: file, 17 | dataType: 'text', 18 | isLocal: true 19 | }); 20 | request.done(function(data) { onload(data) }); 21 | request.fail(function(xhr) { onload.error(xhr.statusText) }); 22 | } 23 | }; 24 | 25 | return plugin; 26 | 27 | }) -------------------------------------------------------------------------------- /js/interactives/CanvasProto.js: -------------------------------------------------------------------------------- 1 | define(['jquery'], function($) { 2 | 3 | var interactive = $('.interactive.prototype-canvas'); 4 | 5 | var drawChain = function(e) { 6 | var id = this.getAttribute('id'); 7 | var others = interactive.find('.' + id); 8 | var offset = $(this).offset(); 9 | var x = e.pageX - offset.left; 10 | var y = e.pageY - offset.top; 11 | var color = this.getAttribute('data-color'); 12 | var index = others.toArray().indexOf(this); 13 | for (var i = 0; i < others.length; i++) { 14 | var canvas = others[i]; 15 | var context = canvas.getContext('2d'); 16 | if (i <= index) { 17 | context.globalCompositeOperation = "source-over"; 18 | } else { 19 | context.globalCompositeOperation = "destination-over"; 20 | } 21 | context.beginPath(); 22 | context.fillStyle = color; 23 | context.arc(x, y, 3, 0, Math.PI * 2); 24 | context.fill(); 25 | } 26 | } 27 | 28 | $('.prototype-canvas canvas').on('mousedown', drawChain); 29 | 30 | }) -------------------------------------------------------------------------------- /js/interactives/LightIf.js: -------------------------------------------------------------------------------- 1 | define(['jquery', 'dom/Delay', 'meta/Evil', 'dom/Stage'], function($, Delay, Evil, Stage) { 2 | var canvas = document.querySelector('canvas#flowchart'); 3 | var context = canvas.getContext('2d'); 4 | 5 | var ifTrue = true; 6 | 7 | var drawWire = function(points, on) { 8 | context.strokeStyle = "#888"; 9 | context.lineWidth = 4; 10 | if (on) { 11 | context.strokeStyle = "#5C5"; 12 | } 13 | context.beginPath(); 14 | context.moveTo(points[0].x, points[0].y); 15 | for (var i = 1; i < points.length; i++) { 16 | context.lineTo(points[i].x, points[i].y); 17 | } 18 | context.stroke(); 19 | }; 20 | 21 | var stage = new Stage(canvas); 22 | var Bulb = function() { 23 | stage.Sprite.call(this); 24 | }; 25 | Bulb.prototype = new stage.Sprite(); 26 | Bulb.prototype.draw = function() { 27 | //draw our lightbulb - man, I hate canvas 28 | var context = this.context; 29 | context.beginPath(); 30 | context.fillStyle = this.on ? "yellow" : "white"; 31 | context.arc(20, 20, 20, Math.PI, Math.PI * 2); 32 | context.lineTo(30, 40); 33 | context.lineTo(10, 40); 34 | context.lineTo(0, 20); 35 | context.closePath(); 36 | context.fill(); 37 | context.stroke(); 38 | context.beginPath() 39 | context.moveTo(10, 20); 40 | context.lineTo(20, 40); 41 | context.lineTo(30, 20); 42 | context.stroke(); 43 | context.beginPath(); 44 | context.moveTo(30, 40); 45 | context.lineTo(32, 42); 46 | context.lineTo(32, 50); 47 | context.lineTo(8, 50); 48 | context.lineTo(8, 42); 49 | context.lineTo(10, 40); 50 | context.closePath(); 51 | context.fillStyle = "#888"; 52 | context.fill(); 53 | } 54 | var ifBulb = new Bulb(); 55 | var elseBulb = new Bulb(); 56 | stage.addChild(ifBulb); 57 | stage.addChild(elseBulb); 58 | ifBulb.x = 60; 59 | ifBulb.y = 80; 60 | elseBulb.x = 140 61 | elseBulb.y = 180; 62 | 63 | stage.draw = function() { 64 | var start = $('.flowbox.start'); 65 | var end = $('.flowbox.end'); 66 | var middle = $('.flowbox.else'); 67 | var startPos = start.position(); 68 | var endPos = end.position(); 69 | drawWire([ 70 | {x: 140, y: startPos.top + start.outerHeight()}, 71 | {x: 140, y: ifBulb.y + 45}, 72 | {x: ifBulb.x + 20, y: ifBulb.y + 45}, 73 | {x: ifBulb.x + 20, y: ifBulb.y + 55}, 74 | {x: 10, y: ifBulb.y + 55}, 75 | {x: 10, y: endPos.top - 10}, 76 | {x: endPos.left, y: endPos.top} 77 | ], ifBulb.on); 78 | var midPos = middle.position(); 79 | drawWire([ 80 | {x: 200, y: startPos.top + start.outerHeight()}, 81 | {x: 200, y: midPos.top - 4}, 82 | {x: midPos.left + 200, y: midPos.top - 4}, 83 | {x: midPos.left + 200, y: elseBulb.y + 45}, 84 | {x: elseBulb.x + 20, y: elseBulb.y + 45}, 85 | {x: elseBulb.x + 20, y: endPos.top} 86 | ], elseBulb.on); 87 | } 88 | 89 | stage.render(); 90 | 91 | Delay("#flowchart").done(function() { 92 | $(canvas).hide().fadeIn(); 93 | $('#conditional').on('keyup', function(e) { 94 | var input = $(this).val(); 95 | var output = Evil(input); 96 | if (typeof output == 'undefined' || output.error) { 97 | ifBulb.on = elseBulb.on = false; 98 | } else { 99 | if (output) { 100 | //truthy path 101 | ifBulb.on = true; 102 | elseBulb.on = false; 103 | } else { 104 | //falsey path 105 | ifBulb.on = false; 106 | elseBulb.on = true; 107 | } 108 | } 109 | stage.render(); 110 | }).trigger('keyup'); 111 | }); 112 | }); -------------------------------------------------------------------------------- /js/interactives/MetaCanvas.js: -------------------------------------------------------------------------------- 1 | define(['jquery', 'meta/Evil'], function($, Evil) { 2 | 3 | return function(id) { 4 | var canvas = document.querySelector("#" + id + " canvas"); 5 | var context = canvas.getContext('2d'); 6 | var code = $('#' + id + ' code'); 7 | 8 | var checkTimer = function() { 9 | var now = Date.now(); 10 | if (now - then > 500) throw "This script takes too long to run."; 11 | } 12 | var then = 0; 13 | var evaluate = function() { 14 | var source = code.text(); 15 | source = source.replace(/(for|while)\s*\((.*?)\)\s*\{/gmi, "$1 ($2) { checkTimer();"); 16 | then = Date.now(); 17 | window.context = context; 18 | window.canvas = canvas; 19 | window.checkTimer = checkTimer; 20 | context.clearRect(0, 0, canvas.width, canvas.height); 21 | var result = Evil(source); 22 | if (result && result.error) console.error(result.error); 23 | try { 24 | delete window.context; 25 | delete window.canvas; 26 | delete window.checkTimer; 27 | } catch (e) {}; 28 | }; 29 | 30 | var timeout; 31 | code.on('keyup', function() { 32 | if (timeout) clearTimeout(timeout); 33 | setTimeout(evaluate, 250); 34 | }).trigger('keyup'); 35 | }; 36 | }); -------------------------------------------------------------------------------- /js/interactives/Regex.js: -------------------------------------------------------------------------------- 1 | define(['jquery'], function() { 2 | 3 | var interactive = $('.interactive.regex-tester'); 4 | var input = interactive.find('.pattern'); 5 | var sample = interactive.find('.matched'); 6 | var status = interactive.find('.status'); 7 | status.html('Ready'); 8 | 9 | input.on('keyup', function() { 10 | try { 11 | var extract = /^\/(.+?)\/([gmix]+)?$/; 12 | var extracted = input.val().match(extract); 13 | if (!extracted) { 14 | sample.html(sample.text()); 15 | if (input.val() == "") { 16 | status.html("Ready"); 17 | } else { 18 | status.html("Doesn't look valid--did you forget the slashes?"); 19 | } 20 | return; 21 | } 22 | var pattern = extracted[1]; 23 | var flags = extracted[2] ? extracted[2].replace(/g|m/g, '') : ''; 24 | var re = new RegExp(pattern, flags + 'gm'); 25 | status.html("Searching for: " + extracted[1]); 26 | 27 | var match; 28 | var text = sample.text(); 29 | var output = "" 30 | var last = 0; 31 | var limit = 0; 32 | while (match = re.exec(text)) { 33 | limit++; 34 | if (limit > 100) return; 35 | if (last < match.index) output += text.substr(last, match.index - last); 36 | last = match.index; 37 | match = match[0]; 38 | output += "" + match + ""; 39 | last += match.length; 40 | } 41 | if (last < text.length) { 42 | output += text.substr(last); 43 | } 44 | sample.html(output); 45 | } catch (e) { 46 | console.log(e); 47 | status.html("Not a valid regular expression"); 48 | sample.html(sample.text()); 49 | } 50 | }).trigger('keyup'); 51 | 52 | var timeout; 53 | 54 | sample.on('keyup', function() { 55 | if (timeout) clearTimeout(timeout); 56 | timeout = setTimeout(function() { 57 | input.trigger('keyup'); 58 | }, 500); 59 | }); 60 | 61 | }); -------------------------------------------------------------------------------- /js/interactives/StringEscaping.js: -------------------------------------------------------------------------------- 1 | define(['jquery', 'meta/Evil'], function($, Evil) { 2 | 3 | var escaping = $('.interactive.escaping'); 4 | var inputs = escaping.find('input'); 5 | inputs.each(function(index, item) { 6 | var input = $(item); 7 | input.addClass('broken'); 8 | input.on('keyup', function() { 9 | var result = Evil(input.val()); 10 | if (result && !result.error) { 11 | input.removeClass('broken').addClass('fixed'); 12 | } else { 13 | input.removeClass('fixed').addClass('broken'); 14 | } 15 | if (escaping.find('.broken').length == 0) { 16 | escaping.find('.praise').html('You did it! Congratulations!'); 17 | } 18 | }).trigger('keyup'); 19 | }); 20 | 21 | }); -------------------------------------------------------------------------------- /js/interactives/data/ajaxAutocomplete.time: -------------------------------------------------------------------------------- 1 | @,0@$.ajax({ 2 | @1,1@var request = $.ajax({ 3 | @,1@ url: "http://youcompleteme.com/autocomplete", 4 | @,1@ dataType: "json", 5 | @,1@ data: { 6 | @,1@ q: "dog" 7 | @,1@ } 8 | @4,@var requestPending = false; 9 | @4,@ 10 | @2,@$('#search').on('keyup', function() { 11 | @4,@ 12 | @4,@ if (requestPending) { 13 | @4,@ return; 14 | @4,@ } 15 | @2,@ 16 | @2,@ var request = $.ajax({ 17 | @2,@ url: "http://youcompleteme.com/autocomplete", 18 | @2,@ dataType: "json", 19 | @2,@ data: { 20 | @2,2@ q: "dog" 21 | @3,@ q: $(this).val(); 22 | @2,@ } 23 | @2,@ }); 24 | @4,@ 25 | @4,@ requestPending = true; 26 | @4,@ 27 | @2,@ request.done(function(data) { 28 | @4,@ requestPending = false; 29 | @2,@ $('#suggestion').html("Did you mean " + data.suggestions[0] + "?"); 30 | @2,@ }); 31 | @2,@ 32 | }); 33 | @1,1@request.done(function(data) { 34 | @1,1@ $('#suggestion').html("Did you mean " + data.suggestions[0] + "?"); 35 | @1,1@}); 36 | @@c:0;We'll start by making a sample request to the server, just to make sure that the service works. In this case, we're going to type "dog," for which autocomplete suggestions might range from "dog food" to "doggerel."@@ 37 | @@c:1;The $.ajax function returns a promise object representing the outgoing request. We'll add a function to the done() handler of the request, which will prompt with the first item in the array that the server sends back. For reference, the server response probably looks something like this: 38 | 39 | { 40 | suggestions: [ 41 | "dog food", 42 | "dog training", 43 | "doggy day care" 44 | ] 45 | }@@ 46 | @@c:2;Once we know the request works properly, we'll hook it up to the input search box. Of course, we're still just sending "dog" each time, no matter what the person has sent, but now we're doing so in response to keyup events.@@ 47 | @@c:3;It's a simple change to make the request send actual query data now, just by retrieving the form value. Remember that inside the keyup listener, this is the #search input box.@@ 48 | @@c:4;Finally, we don't want to flood the server on every request. Instead, we can create a variable that's used to track whether a request is out, and not send a new autocomplete request until the current one finishes.@@ -------------------------------------------------------------------------------- /js/interactives/data/canvas.time: -------------------------------------------------------------------------------- 1 | var ball = { 2 | x: 10, 3 | y: 10, 4 | dx: 1, 5 | dy: 1 6 | } 7 | @1,@ 8 | @1,1@context.beginPath(); 9 | @1,1@context.fillStyle = "#FF0"; 10 | @1,1@//draw a circle 10 pixels in radius at the ball's location 11 | @1,1@context.arc(ball.x, ball.y, 10, 0, Math.PI * 2); 12 | @1,1@context.fill(); 13 | @2,@var drawBall = function() { 14 | @2,@ context.beginPath(); 15 | @2,@ context.fillStyle = "#FF0"; 16 | @2,@ //draw a circle 10 pixels in radius at the ball's location 17 | @2,@ context.arc(ball.x, ball.y, 10, 0, Math.PI * 2); 18 | @2,@ context.fill(); 19 | @2,@}; 20 | @2,@ 21 | @2,2@drawBall(); 22 | @8,@var moveBall = function() { 23 | @8,@ //Adjust the x and y by the dx and dy properties 24 | @8,@ ball.x = ball.x + ball.dx; 25 | @8,@ ball.y = ball.y + ball.dy; 26 | @8,@ if (ball.y >= canvas.height || ball.y <= 0) { 27 | @8,@ ball.dy = ball.dy * -1; 28 | @8,@ } 29 | @8,@ if (ball.x >= canvas.width || ball.x <= 0) { 30 | @8,@ ball.dx = ball.dx * -1; 31 | @8,@ } 32 | @8,@}; 33 | @8,@ 34 | @3,@var animate = function() { 35 | @3,@ context.clearRect(0, 0, canvas.width, canvas.height); 36 | @3,@ drawBall(); 37 | @4,7@ //Adjust the x and y by the dx and dy properties 38 | @4,7@ ball.x = ball.x + ball.dx; 39 | @4,7@ ball.y = ball.y + ball.dy; 40 | @5,6@ if (ball.y >= canvas.height) { 41 | @7,7@ if (ball.y >= canvas.height || ball.y <= 0) { 42 | @5,7@ ball.dy = ball.dy * -1; 43 | @5,7@ } 44 | @6,6@ if (ball.y <= 0) { 45 | @6,6@ ball.dy = ball.dy * -1; 46 | @7,7@ if (ball.x >= canvas.width || ball.x <= 0) { 47 | @7,7@ ball.dx = ball.dx * -1; 48 | @6,7@ } 49 | @6,6@ if (ball.x >= canvas.width) { 50 | @6,6@ ball.dx = ball.dx * -1 51 | @6,6@ } 52 | @6,6@ if (ball.x <= 0) { 53 | @6,6@ ball.dx = ball.dx * -1; 54 | @6,6@ } 55 | @8,@ moveBall(); 56 | @3,@ setTimeout(animate, 100); 57 | @3,@}; 58 | @3,@ 59 | @3,@animate(); 60 | @@c:0;We'll start with something very simple: creating an object to represent our bouncing ball. In addition to the x and y properties, which describe its position, we also have dx and dy. These two properties stand for the "delta," or the change, in both the x and y coordinates for each frame. Or to put it another way, they are the ball's vertical and horizontal speed.@@ 61 | @@c:1;Now we can actually draw the ball, based on this object. So far, nothing too complicated.@@ 62 | @@c:2;Let's put the drawing instructions inside a function, which will make them easier to trigger repeatedly.@@ 63 | @@c:3;Next, we'll create an animation function that draws the ball every 100 milliseconds, calling itself using the same method described above. It also needs to clear the screen, or else our ball would leave trails behind.@@ 64 | @@c:4;Of course, our animation just draws the same thing, over and over, every frame, so it doesn't look very animated. To make this work meaningful, we need to change the ball's position on each frame, thus creating an actual animation.@@ 65 | @@c:5;If you load this code in a browser now (plus the code for getting a canvas context, of course), you'll see the ball animate. But it doesn't bounce: it moves down and to the right until it moves offscreen, where it probably keeps going forever, out of sight. We need to add some collision detection, so that it can bounce off the walls. 66 | 67 | We'll start with the bottom. When the y coordinate of the ball reaches the bottom of the canvas, we're going to reverse its dx property by multiplying it by -1. Now, instead of moving down, it will head upward.@@ 68 | @@c:6;Adding bounce behavior to the other three sides is correspondingly simple: we're just checking to see if the ball has gone outside the bounds of the canvas element.@@ 69 | @@c:7;In fact, since hitting the top and bottom, or the left and right, results in the same behavior, we can combine their conditions using the OR operator, represented by ||.@@ 70 | @@c:8;Finally, to make this as clean as possible, we might move our physics code into a separate function. This refactoring lets us keep our animation loop more descriptive, and if we needed to add more object later, it would be easier to repurpose a standalone function.@@ -------------------------------------------------------------------------------- /js/interactives/data/formValidation.time: -------------------------------------------------------------------------------- 1 | <!doctype html> 2 | <html> 3 | <body> 4 | <form action="/post.php"> 5 | <label>Phone</label> 6 | <input pattern="[^a-zA-Z]+" name="phone" 7 | data-error="Please enter only numbers and punctuation"> 8 | <span class="error"></span> 9 | 10 | <label>Email</label> 11 | <input pattern=".+@.+\..+" id="email" 12 | data-error="Please enter a valid e-mail address."> 13 | <span class="error"></span> 14 | 15 | <input type="submit"> 16 | </form> 17 | 18 | <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> 19 | <script> 20 | 21 | @1,@$('input[type=submit]').on('click', function(e) { 22 | @2,@ 23 | @2,@ var $this = $(this); 24 | @2,@ var form = $this.closest('form'); 25 | @2,@ var inputs = form.find('input[pattern]'); 26 | @3,@ 27 | @3,@ for (var i = 0; i < inputs.length; i++) { 28 | @3,@ input = inputs.eq(i); 29 | @4,@ var pattern = input.attr('pattern'); 30 | @4,@ var regex = RegExp(pattern); 31 | @5,@ var valid = regex.test(input.val()); 32 | @5,@ if (!valid) { 33 | @5,@ e.preventDefault(); 34 | @6,@ var error = input.attr('data-error'); 35 | @6,@ input.next('.error').html(error); 36 | @8,@ input.addClass('invalid'); 37 | @7,@ } else { 38 | @7,@ input.next('.error').html(''); 39 | @8,@ input.removeClass('invalid'); 40 | @5,@ } 41 | @3,@ } 42 | @5,@}); 43 | @2,@ 44 | @1,4@ e.preventDefault(); 45 | @1,4@}); 46 | @,4@ 47 | @,0@ 48 | </script> 49 | </body> 50 | </html> 51 | @@c:0;We'll start with our basic HTML page, with two form inputs waiting to be filled in: one with a phone number, the other with an e-mail address. Because we want to take advantage of HTML5-compliant browsers, we're using the pattern attribute on each, and we'll supplement that with our script. 52 | 53 | In addition to the pattern, each input has a data-error attribute that we'll use for more friendly error messages than the browser provides by default, and a span following it that we can use to show that message.@@ 54 | @@c:1;We'll start by attaching a listener to our submit button, and calling the preventDefault() method on the event that's passed in. This will stop the form from actually being submitted. This puts us in control of the form submission process. If anything is invalid, we call preventDefault. If everything checks out, we do nothing, the event goes through, and the browser will submit the form for us.@@ 55 | @@c:2;We want to apply our validation to inputs in the surrounding form. First, we'll store a jQuery version of the this value (which is the submit button that was clicked). Then we'll use that as a starting place, and work our way up the DOM using jQuery's closest() method. Once there, we can get all the other inputs by searching for elements with a pattern attribute. The '[attribute]' selector is extremely handy when working with forms.@@ 56 | @@c:3;We'll loop through all of the selected inputs, using the eq() function to extract them from the jQuery collection. We could also use the square brackets, as with an array, but that would give us the raw DOM element and we want a jQuery-wrapped version, which eq() provides.@@ 57 | @@c:4;For each input, we will get the value of its pattern attribute, then use the RegExp() function to turn that string into a regular expression.@@ 58 | @@c:5;From here, it's a simple matter to use the regex's test() method and check the input's value. If it fails, we'll prevent the default event action--remember, our event is a click on the submit button, which means that we're cancelling that click.@@ 59 | @@c:6;Error messages in browsers for the pattern attribute are usually terrifically vague, however. We'd like to make things more clear. By using the data-error attribute that we added to each input, we can give better feedback by setting the contents of the next error span.@@ 60 | @@c:7;When someone corrects their mistake and presses submit again, we don't want to leave old errors hanging. So we'll remove it in the else clause for our validation.@@ 61 | @@c:8;Most browsers that support validation will add some sort of visual feedback to form elements that don't satisfy their pattern requirements. But just to be safe, as a final touch, let's add a class to each input that fails the test, and remove it from inputs that pass. How you style that class is, of course, up to you. By treating it as a class, and not styling it in JavaScript, we separate behavior and content, which will keep our code cleaner and make maintenance simpler.@@ -------------------------------------------------------------------------------- /js/interactives/data/goldilocks.time: -------------------------------------------------------------------------------- 1 | var enter = confirm("You are outside a forest cabin. Press OK to enter."); 2 | @1,@ 3 | @1,@if (enter) { 4 | @1,@ //go into the cabin 5 | @3,@ var bowl = prompt("You see three bowls of porridge. Eat bowl 1, 2, or 3?") 6 | @3,@ if (bowl == 1) { 7 | @3,@ console.log("It's too hot! THE END"); 8 | @4,@ } else if (bowl == 2) { 9 | @4,@ console.log("It's too cold! THE END"); 10 | @4,@ } else { 11 | @4,@ console.log("It's delicious."); 12 | @5,@ 13 | @5,@ var hours = "The porridge makes you sleepy. Nap for how many hours?"; 14 | @5,@ var sleep = prompt(hours); 15 | @5,@ sleep = Number(sleep); 16 | @5,@ 17 | @6,@ if (sleep < 2) { 18 | @6,@ console.log("You wake just in time, and scamper away!"); 19 | @6,@ } else { 20 | @6,@ console.log("You sleep to late, and are eaten by hungry bears."); 21 | @6,@ } 22 | @6,@ console.log("THE END."); 23 | @6,@ 24 | @3,@ } 25 | @1,@} else { 26 | @1,@ //didn't go in 27 | @2,@ console.log("And that's the world's shortest fable. THE END.") 28 | @1,@} 29 | @@c:0;We'll start by asking our opening true/false question.@@ 30 | @@c:1;Since confirm() returns either true or false, we can just use its value directly for a conditional statement.@@ 31 | @@c:2;We leave comments for ourselves as a way of keeping track of our position in the script logic. Here, we've filled in the branch for people who don't go into the cabin which, according to the horror movie wisdom of generations, is probably a wise move.@@ 32 | @@c:3;Using prompt(), we can create another set of decisions inside the first conditional statement. Of course, with three bowls, our if/else statement will have to be more complicated.@@ 33 | @@c:4;We can follow an else with another if statement to handle multiple contingencies. In this case, people can select from one of three bowls. 34 | 35 | Of course, when we chain the statements together like this, the last one becomes our default, no matter what the user types in. If we wanted to be more strict, we could, but this'll be fine for now.@@ 36 | @@c:5;For the last condition, we'll want to compare numbers. Unfortunately, prompt() only returns a string. We'll use Number() to convert it before we make any comparisons.@@ 37 | @@c:6;For our last condition, take note of how we can handle commonality between the two branches. Since both of them are the end of the story, we can put our "THE END" outside the condition. To be honest, we could move it all the way out, after all the choices, and it would work even better.@@ -------------------------------------------------------------------------------- /js/interactives/data/loops.time: -------------------------------------------------------------------------------- 1 | var numbers = [1, 17, 23, 5, 68, 4, 3, 2, 100, 31]; 2 | @1,@ 3 | @2,@var sum = 0; 4 | @2,@var highest = -Infinity; 5 | @2,@var lowest = Infinity; 6 | @2,@ 7 | @1,@for (var i = 0; i < numbers.length; i++) { 8 | @1,2@ 9 | @3,4@ sum = sum + numbers[i]; 10 | @5,@ var item = numbers[i]; 11 | @5,@ sum = sum + item; 12 | @5,@ if (item > highest) { 13 | @5,@ highest = item; 14 | @5,@ } 15 | @6,@ if (item < lowest) { 16 | @6,@ lowest = item; 17 | @6,@ } 18 | @1,@} 19 | @3,@ 20 | @4,4@for (var i = 0; i < highest.length; i++) { 21 | @4,4@ var item = numbers[i]; 22 | @4,4@ if (item > highest) { 23 | @4,4@ highest = item; 24 | @4,4@ } 25 | @4,4@} 26 | @4,4@ 27 | @3,@console.log('The total is: ' + sum); 28 | @4,@console.log('The highest number is: ' + highest); 29 | @6,@console.log('The lowest number is: ' + lowest); 30 | @@c:0;The variable numbers contains a list of random values between 1 and 100. Our job is to find the highest, the lowest, and the sum of these numbers.@@ 31 | @@c:1;Almost every time that you loop over an array, the same form is used--the version shown here, which uses i as a counter variable and moves through the array until we run out of values (by way of its length).@@ 32 | @@c:2;We'll also need some starting values for our three results. Sum starts at zero, for obvious reasons. For highest and lowest, we need to have values that will be way out of bounds of the array, so that anything we find will be higher or lower, respectively. We could also use the first value in the array, particularly in a non-numeric list, but the Infinity special value is helpful on numeric arrays like this.@@ 33 | @@c:3;Let's start with the easiest of the three, the sum. For each item in the array, we'll add its value (extracted via numbers[i]) to the running total in sum. By the end, we'll have add all of the values together.@@ 34 | @@c:4;For the highest, we have to introduce a conditional statement. For each number, if it is higher than the previously-found highest value, we'll store it as the new highest. In this way, we're always keeping track of our maximum value for comparisons, and for output.@@ 35 | @@c:5;We could keep the highest (and lowest) logic in separate loops like this, but there's really no point--they do exactly the same things in terms of visiting each array item in turn. We might as well merge them into a single loop.@@ 36 | @@c:6;The search for the minimum value is just the opposite of looking for the maximum: at each array index, compare its value with the previously-found minimum, and replace the latter with the former if we locate a lesser value.@@ -------------------------------------------------------------------------------- /js/interactives/data/objectLoops.time: -------------------------------------------------------------------------------- 1 | var gameObjects = [{ 2 | type: "Monster", 3 | health: 10, 4 | x: 20, 5 | y: 30 6 | }, { 7 | type: "Bonus", 8 | score: 1000, 9 | x: 45, 10 | y: 10 11 | }, { 12 | type: "Fence", 13 | height: 20, 14 | x: 10, 15 | y: 0 16 | }]; 17 | @1,@ 18 | @2,@var notFence = []; 19 | @3,@var lowAltitude = []; 20 | @4,@var typeCounter = {}; 21 | @2,@ 22 | @1,@for (var i = 0; i < gameObjects.length; i++) { 23 | @1,1@ 24 | @2,@ var item = gameObjects[i]; //get each item 25 | @2,@ if (item.type !== "Fence") { 26 | @2,@ notFence.push(item); //add qualifying items to array 27 | @2,@ } 28 | @3,@ if (item.y < 10) { 29 | @3,@ lowAltitude.push(item); 30 | @3,@ } 31 | @5,@ var type = item.type; 32 | @6,@ if (typeof typeCounter[type] == "undefined") { 33 | @6,@ typeCounter[type] = 0; 34 | @6,@ } 35 | @5,@ typeCounter[type]++; 36 | @1,@} 37 | @7,@ 38 | @7,@console.log("All non-fence items: ", notFence); 39 | @7,@console.log("All low-altitude items: ", lowAltitude); 40 | @8,@ 41 | @8,@for (var type in typeCounter) { 42 | @8,@ var count = typeCounter[type]; 43 | @8,@ console.log(count + " items of type " + type); 44 | @8,@} 45 | @@c:0;We'll start by defining our array of game objects. We have only three, and we're going to filter on fairly broad terms, but this would easily scale to much larger data sets. 46 | 47 | In this code, we're going to try to assemble three pieces of data: an array containing only non-Fence items, an array of anything positioned close to the floor (y < 20), and a count of each item type.@@ 48 | @@c:1;Although we're working with objects, the actual collection that we're looping over is an array. Even with the new kinds of loops we've learned, the old-fashioned array loop never goes out of style.@@ 49 | @@c:2;We'll first create a filtered list of items that are not scenery, using the aptly-named notFence variable. As we run through the list, if an item matches our requirements, we'll push it into this list.@@ 50 | @@c:3;We can do the same thing for items that are close to the ground, just by checking their y property and pushing them into the lowAltitude array. Some items will end up in both places--that's okay. You can have an item stored in multiple arrays, just as you can have the same value in multiple variables.@@ 51 | @@c:4;Our third question, counting the individual object types, is more difficult. For this, we're going to use an object as a named collection. We'll call it typeCounter;@@ 52 | @@c:5;Inside our loop, we're going to get the item type, and use that as a key for lookup inside typeCounter.@@ 53 | @@c:6;Of course, this code is not going to work very well, since we haven't create anything at typeCounter[type] yet, whatever that may be. We can check to see if we've encountered that type before by testing for undefined. If the property hasn't been defined yet, we'll set it equal to 0 before performing our addition.@@ 54 | @@c:7;Finally, we have to log these out. The notFence and lowAltitude arrays are pretty easy to log out via console.log().@@ 55 | @@c:8;Our list of item counts by type is a little more complex. We could log it out by just passing it to console.log(), as we did with the arrays, but let's loop over the object and extract a more readable count instead.@@ -------------------------------------------------------------------------------- /js/interactives/data/storage.time: -------------------------------------------------------------------------------- 1 | var storage = { 2 | get: function(key) { 3 | @,0@ 4 | @1,@ if (typeof window.localStorage == "undefined") { 5 | @1,@ //use cookie 6 | @4,@ var cookies = document.cookie.split(/;\s*/); 7 | @4,@ for (var i = 0; i < cookies.length; i++) { 8 | @4,@ var pair = cookies[i].split("="); 9 | @4,@ if (pair[0] == key) { 10 | @4,@ return pair[1]; 11 | @4,@ } 12 | @4,@ } 13 | @4,@ return null; 14 | @1,@ } else { 15 | @1,@ //use localStorage 16 | @2,@ window.localStorage.getItem(key); 17 | @1,@ } 18 | }, 19 | set: function(key, value) { 20 | @,0@ 21 | @1,@ if (typeof window.localStorage == "undefined") { 22 | @1,@ //use cookie 23 | @3,@ var expires = new Date(); 24 | @3,@ //set expiration for 1 year in the future 25 | @3,@ expires.setFullYear(expires.getFullYear() + 1); 26 | @3,@ expires = expires.toGMTString(); 27 | @3,@ document.cookie = key+"="+value+";path=/;expires="+expires; 28 | @1,@ } else { 29 | @1,@ //use localStorage 30 | @2,@ window.localStorage.setItem(key, value); 31 | @1,@ } 32 | }, 33 | remove: function(key, value) { 34 | @,0@ 35 | @1,@ if (typeof window.localStorage == "undefined") { 36 | @1,@ //use cookie 37 | @5,@ var value = this.get(key); 38 | @5,@ var expires = new Date(); 39 | @5,@ expires.setFullYear(1981); 40 | @5,@ expires = expires.toGMTString(); 41 | @5,@ document.cookie = key+"=null;path=/;expires="+expires; 42 | @1,@ } else { 43 | @1,@ //use localStorage 44 | @2,@ window.localStorage.removeItem(key); 45 | @1,@ } 46 | } 47 | }; 48 | @@c:0;Our storage object will use localStorage if it exists, but otherwise it will use cookies as a fallback. We'll start by stubbing out the three methods it uses: get, set, and remove@@ 49 | @@c:1;In each of our methods, we'll add a feature-detection statement to decide whether to use localStorage or cookies. In browsers that don't support the new storage mode, typeof window.localStorage will return "undefined"--in those browsers, we need to use cookies instead.@@ 50 | @@c:2;Our storage methods map cleanly to the local storage API, so we can go ahead and fill those in.@@ 51 | @@c:3;Let's start with set, since it's the easiest to test. We'll need to construct a cookie string that expires one year from now, and then assign it to document.cookie to save it. 52 | 53 | We can test that this works by calling storage.set() from the console, then looking at document.cookie, but first we'll have set the condition to "true" temporarily--otherwise our polyfill will use localStorage as intended.@@ 54 | @@c:4;Now we can add our get() method. It should look familiar from the code we wrote earlier for getting and setting cookies.@@ 55 | @@c:5;Finally, we just add a quick removal method, by assigning the cookie with a null value and a date in the past.@@ -------------------------------------------------------------------------------- /js/interactives/data/tabs.time: -------------------------------------------------------------------------------- 1 | <!doctype html> 2 | <html> 3 | @9,@<head> 4 | @9,@ <style> /* YOUR STYLES HERE */ </style> 5 | @9,@</head> 6 | <body> 7 | 8 | <ul class="tabs"> 9 | <li> <a href="#one">One</a> 10 | <li> <a href="#two">Two</a> 11 | <li> <a href="#three">Three</a> 12 | </ul> 13 | 14 | <div class="tab" id="one">First tab</div> 15 | <div class="tab" id="two">Second tab</div> 16 | <div class="tab" id="three">Third tab</div> 17 | 18 | <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> 19 | <script> 20 | @1,@var clickedTab = function() { 21 | @1,1@ 22 | @2,@ var $this = $(this); 23 | @8,@ $('ul.tabs .active').removeClass('active'); 24 | @8,@ $this.closest('li').addClass('active'); //highlight current item 25 | @3,@ var href = $this.attr('href'); //get the href attribute 26 | @4,@ var tab = $(href); //find the tab by ID 27 | @5,@ $('.tab').hide(); 28 | @5,@ tab.show(); 29 | @1,@}; 30 | 31 | @6,6@$('.tab').not(':first').hide(); 32 | @7,@$('ul.tabs a').on('click', clickedTab); 33 | @7,@$('ul.tabs a:first').trigger('click'); 34 | @6,@ 35 | @1,6@$('ul.tabs a').on('click', clickedTab); 36 | </script> 37 | </body> 38 | </html> 39 | @@c:0;Since we're working with jQuery events, for this example we'll show the script in the context of the page. As you can see, we start out with the HTML5 doctype to trigger the newest JavaScript versions and HTML features, and we put the scripts at the bottom so that loading will be visually faster for our users. 40 | 41 | In the middle, we have an unordered list to use as our tab set, followed by three <div> tags with matching IDs. In non-JavaScript browsers, this will still work via in-page links to those IDs.@@ 42 | @@c:1;First things first, let's stub out our click listener and attach it to the tabs. We're going to select the links inside the menu, instead of the list items, because we want to use their href attributes for selecting the correct tab.@@ 43 | @@c:2;Inside the listener, the element that was clicked will be assigned to this before our function is called. We'll make a jQuery version of it for easy manipulation.@@ 44 | @@c:3;The href attributes of each link are in-page links, but (in a rare example of good design in CSS) they are also valid ID selectors. We'll extract them from the clicked link by using jQuery's attr() function, which gets or sets an element's attributes.@@ 45 | @@c:4;Once we have that selector, we can use it to find the tab that we want to show.@@ 46 | @@c:5;Now we'll hide all the tabs (including the one we want) and show the selected tab. There's a little bit of waste here, but browsers are fast enough that hiding an element and then showing it on the next line will be imperceptible, and the code remains elegant.@@ 47 | @@c:6;There's only one problem remaining: the tabs work once you click on them, but when the page first loads, all the <div> tags are visible. We could hide all the tabs after the first one, like so...@@ 48 | @@c:7;But it's cleaner if we just trigger a click event on the first link and let the listener we just created do the work.@@ 49 | @@c:8;Triggering the click listener makes more sense if we put in some code to show which tab is currently selected, by adding an "active" class to the clicked link's parent <li>. Now, even though we didn't plan for that code from the start, the first item will get the correct class when the page loads, because it all goes through a single code path.@@ 50 | @@c:9;By styling this page in different ways, you can get different user experiences without changing the JavaScript at all. This code works for tabs, but it would also work for a thumbnail gallery, if the links contained images, or a slideshow, if they took the form of an outline. Could you improve on this code? What else could you make from this simple interaction with just a tweak or two?@@ -------------------------------------------------------------------------------- /js/interactives/data/template.time: -------------------------------------------------------------------------------- 1 | var fillMe = '{{text}}'; 2 | var link = { 3 | url: "http://example.com", 4 | title: "Just another link", 5 | text: "This space intentionally left blank" 6 | }; 7 | @1,@ 8 | @1,2@for (var key in link) { 9 | @1,2@ 10 | @2,2@ var value = link[key]; //get the value of each item 11 | @2,2@ //now we substitute each tag with its value 12 | @2,2@ fillMe = fillMe.replace('{{' + key + '}}', value); 13 | @1,2@} 14 | @2,2@console.log(fillMe); 15 | @3,4@var template = function() { 16 | @5,@var template = function(text, data) { 17 | @3,5@ for (var key in link) { 18 | @3,5@ var value = link[key]; //get the value of each item 19 | @6,@ for (var key in data) { 20 | @6,@ var value = data[key]; //get the value of each item 21 | @3,@ //now we substitute each tag with its value 22 | @3,5@ fillMe = fillMe.replace('{{' + key + '}}', value); 23 | @6,@ text = text.replace('{{' + key + '}}', value); 24 | @3,@ } 25 | @3,4@ console.log(fillMe); 26 | @5,5@ return fillMe; 27 | @6,@ return text; 28 | @3,@}; 29 | @4,@ 30 | @4,5@template(); 31 | @6,6@template(fillMe, link); 32 | @7,@var output = template(fillMe, link); 33 | @7,@console.log(output); 34 | @8,@ 35 | @8,@var menuTemplate = '
  • {{label}}'; 36 | @8,@var menus = [ 37 | @8,@ { 38 | @8,@ classes: 'about', 39 | @8,@ href: '#about-us', 40 | @8,@ label: "About us" 41 | @8,@ }, 42 | @8,@ { 43 | @8,@ classes: 'buy', 44 | @8,@ href: 'buy.html', 45 | @8,@ label: 'Buy Tickets' 46 | @8,@ }, 47 | @8,@ { 48 | @8,@ classes: 'news', 49 | @8,@ href: 'news.php', 50 | @8,@ label: "Recent News" 51 | @8,@ } 52 | @8,@]; 53 | @8,@ 54 | @8,@for (var i = 0; i < menus.length; i++) { //loop through the menus 55 | @8,@ var menuItem = template(menuTemplate, menus[i]); //create each from data 56 | @8,@ $('#main-menu').append(menuItem); //add to the main menu element 57 | @8,@} 58 | @@c:0;Much like sculpting, programmers write code by starting with broad shapes and then adding detail. In this case, we start out with just two items: a string that will act as our template, and an object that we'll use to fill the template with data.@@ 59 | @@c:1;Inside of our template, we've inserted placeholder tags wherever we want to insert data. The keys on these tags match to keys on the link object. So if we loop through that object...@@ 60 | @@c:2;...we can replace them with the values from the object. 61 | 62 | The console should log out a completed link now.@@ 63 | @@c:3;Of course, we haven't made a function yet, but that's fine. We wanted to make sure we had the basics working first. So let's just wrap our existing code in a function definition.@@ 64 | @@c:4;Writing a function is like writing a recipe: useful, but it's not the same as a cake. Now that our code is wrapped up as a function, if we want it to run we have to call it.@@ 65 | @@c:5;Of course, our new function has no inputs or outputs. It's not very flexible, because it only ever acts on a single link object, and it just logs to the console. Let's change that, by adding some arguments and a return statement.@@ 66 | @@c:6;We can replace the previous references to our global variables, fillMe and link, with our new arguments, text and data. That means we need to pass in our values as arguments now.@@ 67 | @@c:7;Finally, we can capture our template's output by storing its return value in a new variable. We'll log that, just to make sure that it works.@@ 68 | @@c:8;To see it in action, let's create a new template and data object (in this case, a list of menu items to be dynamically created), and feed those to the function. With this templating system, we can create new HTML structures very easily, without having to construct them out of either string addition or (even worse) building one element at a time.@@ -------------------------------------------------------------------------------- /js/meta/Evil.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Evil is a safe eval function. It should only be used on small chunks of code-- 4 | ideally single lines--since it's still not THAT safe. 5 | 6 | */ 7 | 8 | define([], function() { 9 | 10 | return function(source, context) { 11 | context = context || {}; 12 | source = source.split(/\r?\n/); 13 | var empty = /^\s*$/; 14 | source = source.filter(function(line) { 15 | return !empty.test(line); 16 | }); 17 | source[source.length - 1] = 'return ' + source[source.length - 1]; 18 | var code = source.join(';\n'); 19 | try { 20 | var f = new Function(code); 21 | var result = f.call(context); 22 | return result; 23 | } catch (e) { 24 | return {error: e}; 25 | } 26 | } 27 | 28 | }); -------------------------------------------------------------------------------- /js/meta/TLPlayer.js: -------------------------------------------------------------------------------- 1 | define(['jquery', 'meta/TimeLapse', 'google-code/prettify'], function($, TimeLapse) { 2 | 3 | var Player = function(element) { 4 | this.timelapse = new TimeLapse(); 5 | this.current = 0; 6 | }; 7 | Player.prototype = { 8 | load: function(input) { 9 | var loader = $.Deferred(); 10 | if (typeof input == 'string') { 11 | this.timelapse.parse(input); 12 | this.length = this.timelapse.revisions.length; 13 | loader.resolve(); 14 | } else { 15 | //other option is that it's a file handle, but probably it's not 16 | var reader = new FileReader(); 17 | reader.readAsText(input); 18 | reader.onload = function() { 19 | this.timelapse.parse(reader.result); 20 | this.length = this.timelapse.revisions.length; 21 | loader.resolve(); 22 | } 23 | } 24 | return loader.promise(); 25 | }, 26 | connect: function(options) { 27 | this.ui = { 28 | code: options.code || $(), 29 | comments: options.comments || $(), 30 | next: options.next || $(), 31 | previous: options.prev || $(), 32 | first: options.first || $(), 33 | last: options.last || $() 34 | }; 35 | }, 36 | switch: function(number) { 37 | if (number < 0 || number >= this.length) { 38 | return; 39 | } 40 | var spans = []; 41 | this.current = number * 1; 42 | var data = this.timelapse.data.lines; 43 | for (var i = 0; i < data.length; i++) { 44 | var line = data[i]; 45 | if (!(line.start <= number && line.end >= number)) continue; 46 | var span; 47 | if (line.start == number) { 48 | span = ''; 49 | } else { 50 | span = ''; 51 | } 52 | span += line.text.replace(//g, '>') + ''; 53 | spans.push(span); 54 | } 55 | this.ui.code.html(PR.prettyPrintOne(spans.join('\n'))); 56 | var comment = this.timelapse.data.comments[number]; 57 | if (comment) { 58 | comment = comment.replace(/\n/g, '
    '); 59 | this.ui.comments.html(comment); 60 | 61 | } 62 | 63 | }, 64 | first: function() { 65 | this.switch(0); 66 | }, 67 | last: function() { 68 | this.switch(this.timelapse.revisions.length - 1); 69 | }, 70 | next: function() { 71 | this.switch(this.current + 1); 72 | }, 73 | previous: function() { 74 | this.switch(this.current - 1); 75 | } 76 | }; 77 | 78 | return Player; 79 | 80 | }); -------------------------------------------------------------------------------- /js/meta/TimeLapse.js: -------------------------------------------------------------------------------- 1 | define(['jquery'], function($) { 2 | 3 | var TimeLapse = function() { 4 | 5 | }; 6 | TimeLapse.prototype = { 7 | load: function(url) { 8 | var request = $.ajax({ 9 | url: url, 10 | dataType: 'text', 11 | context: this 12 | }); 13 | var loading = $.Deferred(); 14 | request.done(function(data) { 15 | this.data = this.parse(data); 16 | }).then(loading.resolve); 17 | return loading.promise(); 18 | }, 19 | parse: function(text) { 20 | //find comments first, because they're multiline 21 | var isComment = /\r?\n\r?@@c:(\d)+;([^@]*)@@/; 22 | var comment; 23 | var comments = []; 24 | while (comment = isComment.exec(text)) { 25 | var all = comment[0]; 26 | var rev = comment[1] * 1; 27 | comments[rev] = comment[2] || ""; 28 | text = text.replace(all, ''); 29 | }; 30 | 31 | //then parse remaining text 32 | var lines = text.split(/\r?\n\r?/); 33 | var parsed = []; 34 | var last = 0; 35 | 36 | var tagger = /(?:@)([^@]+)(?:@)/; 37 | var startEnd = /@?(\d+)?,(\d+)?@?/; 38 | 39 | for (var i = 0; i < lines.length; i++) { 40 | var line = lines[i]; 41 | var match = tagger.exec(line); 42 | var metadata = {line: i}; 43 | if (match && match[1]) { 44 | var tagContents = match[1]; 45 | var duration = startEnd.exec(tagContents); 46 | metadata.start = duration[1] * 1 || 0; 47 | metadata.end = duration[2] * 1; 48 | if (typeof metadata.end != "number" || isNaN(metadata.end)) metadata.end = Infinity; 49 | metadata.text = line.replace(startEnd, ''); 50 | parsed.push(metadata); 51 | if (metadata.start > last) last = metadata.start; 52 | if (metadata.end != Infinity && metadata.end > last) last = metadata.end; 53 | } else { 54 | var metadata = { 55 | start: 0, 56 | end: Infinity, 57 | text: line 58 | }; 59 | parsed.push(metadata); 60 | } 61 | } 62 | this.data = { 63 | lines: parsed, 64 | comments: comments, 65 | length: last + 1 66 | }; 67 | this.revisions = this.buildRevisions(); 68 | return this.data; 69 | }, 70 | buildRevisions: function() { 71 | var lines = this.data.lines; 72 | var comments = this.data.comments; 73 | var length = this.data.length; 74 | var revisions = []; 75 | var current = 0; 76 | 77 | for (var i = 0; i < length; i++) { 78 | var rev = []; 79 | for (var j = 0; j < lines.length; j++) { 80 | var line = lines[j]; 81 | if (line.start <= i && line.end >= i) { 82 | rev.push(line.text); 83 | } 84 | } 85 | revisions[i] = { 86 | text: rev.join('\n'), 87 | comment: comments[i] ? comments[i] : "" 88 | } 89 | } 90 | return revisions; 91 | }, 92 | serialize: function() { 93 | var revisions = this.revisions; 94 | var source = revisions[0].text; 95 | source = source.split('\n').map(function(line) { 96 | return { 97 | text: line, 98 | start: 0, 99 | end: Infinity 100 | } 101 | }); 102 | //loop over each new revision 103 | for (var i = 1; i < revisions.length; i++) { 104 | var integrated = []; 105 | var target = revisions[i].text.split('\n'); 106 | var start = 0; //don't backtrack in target revision 107 | //match against each line of source 108 | for (var j = 0; j < source.length; j++) { 109 | var sourceLine = source[j]; 110 | if (sourceLine.end < i) { 111 | integrated.push(sourceLine); 112 | continue; 113 | } 114 | var line = sourceLine.text; 115 | var found = false; 116 | for (var k = start; k < target.length; k++) { 117 | var targetLine = target[k]; 118 | if (targetLine == line) { 119 | //skipped lines are additions 120 | while (start < k) { 121 | integrated.push({ 122 | start: i, 123 | text: target[start], 124 | end: Infinity 125 | }); 126 | start++; 127 | } 128 | start++; 129 | integrated.push(sourceLine); 130 | found = true; 131 | break; 132 | } 133 | } 134 | if (!found) { 135 | sourceLine.end = i - 1; 136 | integrated.push(sourceLine); 137 | } 138 | } 139 | while (start < target.length) { 140 | integrated.push({ 141 | start: i, 142 | text: target[start], 143 | end: Infinity 144 | }); 145 | start++; 146 | } 147 | source = integrated; 148 | } 149 | //build tagged version 150 | var tagged = source.map(function(item) { 151 | if (item.start == 0 && item.end == Infinity) return item.text; 152 | var line = "@"; 153 | if (item.start) { 154 | line += item.start; 155 | } 156 | line += ',' 157 | if (item.end < Infinity) { 158 | line += item.end 159 | } 160 | line += "@" + item.text; 161 | return line; 162 | }); 163 | for (var i = 0; i < revisions.length; i++) { 164 | if (revisions[i].comment) { 165 | tagged.push('@@c:' + i + ';' + revisions[i].comment + '@@'); 166 | } 167 | } 168 | return tagged.join('\n'); 169 | } 170 | }; 171 | 172 | return TimeLapse; 173 | 174 | }); -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "savvy-js", 3 | "preferGlobal": false, 4 | "version": "0.1.0", 5 | "author": "Thomas Wilburn ", 6 | "description": "JavaScript for the Web Savvy", 7 | "repository": { 8 | "type": "git", 9 | "url": "git://github.com/thomaswilburn/textbook.git" 10 | }, 11 | "dependencies": { 12 | "grunt": ">=0.4", 13 | "grunt-contrib-watch": "^0.6.1", 14 | "less": "^2.0.0", 15 | "grunt-contrib-connect": "~0.9.0" 16 | }, 17 | "license": "MIT" 18 | } 19 | -------------------------------------------------------------------------------- /src/conclusion.html: -------------------------------------------------------------------------------- 1 | <%= t.include("snippets/head.html", { title: "The Road Ahead" }) %> 2 | 3 |

    4 | Congratulations! Having finished this book, you have completed your education in basic JavaScript. You know how to store values in variables and collections, to make decisions using flow control operators, and to write your own functions. You can interact with the page using jQuery, make your own graphics with HTML5's canvas element, and talk to servers without refreshing the page using AJAX. Along the way, we've also touched on a number of crucial programming skills, such as checking into source control, evaluating technical advice, and even writing JavaScript on the server. 5 | 6 |

    7 | To be honest, I'm a little jealous: nowadays JavaScript has an extremely warm, vibrant community that's pushing the envelope of what this language--formerly considered a "toy" unsuitable for read development--can do. There's no better time to be an intermediate programmer, able to learn from the web's best practices. What lies ahead of you is an exciting world of new opportunities and fascinating career paths. You're in for great time. 8 | 9 |

    10 | That said, it is also a scary experience, to be turned loose on your own and expect to make sense of the JavaScript world's sound and fury. Many of my students are initially confused by their options at this point, but there are a few good places to go from here: 11 | 12 |

      13 | 14 |
    • JavaScript: The Good Parts by Douglas Crockford is the the book for JavaScript programmers to read as they advance their skills from beginner to intermediate. It's not a perfect book--much of its advice is either unfashionable or inefficient in modern browsers--but when it is wrong it is almost always wrong in interesting, mind-bending ways. At only 140 pages, it will be one of the shortest technical books you'll ever read, and simultaneously one of the densest. I highly recommend working through this book a chapter at a time, experimenting with each code sample until you understand it. 15 | 16 |
    • A programmer is only as good as their tools. Luckily, the tools available to us in the browser are some of the best in any language, but that won't help you until you know how to use them to their full advantage. The Discover Devtools lessons will guide you through using Chrome's developer tools, but the lessons carry over equally well to Firefox's dev tools and the Firebug plugin. 17 | 18 |
    • Take some time to read some source code. One of the great joys of open-source development is that it puts good code out where we can puzzle over it and use it to build our own skills. Google developer advocate Paul Irish has a great set of videos detailing techniques he learned by reading the jQuery source. Pick a project that you like and do the same! 19 | 20 |
    21 | 22 |

    23 | Finally, and most importantly, the best way to learn JavaScript is to build things. Yes, you will make mistakes. Yes, it will be terrifying, and confusing. But programming is just like any other skill: the only way to get better is to practice, day in and day out. Over time, you'll be surprised by how far you'll get if you just keep pushing forward. I can't wait to see what you're capable of. 24 | 25 |

    26 | Thanks for reading! 27 | 28 |

    29 | Thomas Wilburn 30 | 31 | <%= t.include("snippets/scripts.html") %> 32 | <%= t.include("snippets/foot.html") %> -------------------------------------------------------------------------------- /src/css/base.less: -------------------------------------------------------------------------------- 1 | /* basic document look and feel */ 2 | 3 | html { 4 | background: darken(@background, 5%); 5 | font-size: @base-font-size; 6 | } 7 | 8 | body { 9 | font-family: calibri, tahoma, verdana, sans-serif; 10 | background: @background; 11 | //Context = 16px font size 12 | width: 44em; 13 | padding: 1em 0; 14 | margin: auto; 15 | //go left to center with asides 16 | -webkit-transform: translateX(-12.5em); 17 | transform: translateX(-12.5em); 18 | .drop-shadow(.5em, 0px, 1em, .1); 19 | min-height: 50em; 20 | position: relative; 21 | 22 | & > h1 { 23 | text-transform: uppercase; 24 | background: @background-secondary; 25 | color: @foreground-secondary; 26 | .carved; 27 | .inset; 28 | padding: 1em .5em; 29 | margin: 0 0 1em; 30 | } 31 | 32 | @media screen and (max-width: @collapseColumns) { 33 | margin: auto; 34 | -webkit-transform: none; 35 | transform: none; 36 | } 37 | 38 | @media screen and (max-width: @tablet) { 39 | width: auto; 40 | } 41 | } 42 | 43 | .navigation { 44 | 45 | font-size: 12px; 46 | padding-bottom: 1em; 47 | padding-left: 1em; 48 | 49 | } 50 | 51 | .content { 52 | padding: 0 2em; 53 | 54 | @media screen and (max-width: 46em) { 55 | padding: 0 1em; 56 | } 57 | } 58 | 59 | h2 { 60 | border-bottom: 1px solid black; 61 | } 62 | 63 | a { 64 | color: #456; 65 | 66 | &:visited { 67 | color: #789; 68 | } 69 | } 70 | 71 | //tables 72 | table { 73 | border-collapse: collapse; 74 | border: 1px solid #888; 75 | } 76 | 77 | td, th { 78 | padding: 4px 1em; 79 | border: 1px solid #888; 80 | } 81 | 82 | th { 83 | color: white; 84 | background: #555; 85 | } 86 | 87 | tr:nth-child(2n) { 88 | background: #EEE; 89 | } 90 | 91 | input { 92 | border: 1px solid @foreground; 93 | } 94 | 95 | button { 96 | border: 2px solid darken(@background-secondary, 20%); 97 | .drop-shadow(2px, 2px, 2px, .2); 98 | padding: .5em; 99 | background: lighten(@background-secondary, 10%); 100 | border-radius: 4px; 101 | color: darken(@background-secondary, 50%); 102 | font-weight: bold; 103 | cursor: pointer; 104 | 105 | &:hover { 106 | background: @background-secondary; 107 | } 108 | } 109 | 110 | li { 111 | margin-bottom: 8px; 112 | } 113 | 114 | -------------------------------------------------------------------------------- /src/css/grid.less: -------------------------------------------------------------------------------- 1 | * { 2 | -webkit-box-sizing: border-box; 3 | -moz-box-sizing: border-box; 4 | -ms-box-sizing: border-box; 5 | -o-box-sizing: border-box; 6 | box-sizing: border-box; 7 | } -------------------------------------------------------------------------------- /src/css/interactive.less: -------------------------------------------------------------------------------- 1 | @flowBorder: #888; 2 | @choiceBorder: #5C5; 3 | 4 | .interactive { 5 | 6 | position: relative; 7 | 8 | //escaping - gettingStarted.html 9 | &.escaping { 10 | 11 | input { 12 | display: block; 13 | width: 80%; 14 | margin: 1em; 15 | padding: .5em; 16 | font-family: consolas, monospace; 17 | 18 | &.broken { 19 | background: #FCC; 20 | } 21 | 22 | &.fixed { 23 | background: #CFC; 24 | } 25 | } 26 | 27 | } 28 | 29 | //flowcharts - conditionals.html 30 | &.flowchart { 31 | 32 | .flowbox { 33 | position: absolute; 34 | padding: 0 0 .5em 0; 35 | margin: 0; 36 | font-weight: bold; 37 | font-family: consolas, monospace; 38 | 39 | &.start { 40 | border-bottom: 4px solid @choiceBorder; 41 | } 42 | 43 | &.end { 44 | border-top: 4px solid @choiceBorder; 45 | } 46 | } 47 | 48 | } 49 | 50 | //housing loop - arrays.html 51 | &.houses { 52 | button { 53 | margin: 1em; 54 | } 55 | 56 | .highlight { 57 | background: #DFD; 58 | } 59 | .last { 60 | background: #F8F8F8; 61 | } 62 | 63 | pre { 64 | width: 420px; 65 | float: left; 66 | padding-right: 0; 67 | margin: 0; 68 | } 69 | 70 | .description { 71 | width: 200px; 72 | float: right; 73 | } 74 | } 75 | 76 | &.timelapse { 77 | .controls ul { 78 | list-style-type: none; 79 | padding: 0; 80 | margin: 0; 81 | display: inline; 82 | } 83 | 84 | .controls a, .controls li { 85 | display: inline-block; 86 | margin: 0 3px; 87 | background: @background-secondary; 88 | padding: 4px; 89 | color: @foreground-secondary; 90 | cursor: pointer; 91 | 92 | &:hover { 93 | background: lighten(@background-secondary, 10%); 94 | } 95 | 96 | &.active { 97 | border: 3px solid darken(@background-secondary, 10%); 98 | } 99 | } 100 | 101 | .new { 102 | background: white; 103 | border: 1px dotted rgba(0, 0, 0, .1); 104 | font-weight: bold; 105 | } 106 | } 107 | 108 | &.regex-tester { 109 | input { 110 | width: 100%; 111 | padding: 4px; 112 | } 113 | 114 | textarea { 115 | width: 100%; 116 | height: 200px; 117 | } 118 | 119 | .match { 120 | background: #0FF; 121 | } 122 | } 123 | 124 | &.canvas { 125 | canvas { 126 | position: absolute; 127 | right: -10px; 128 | top: -10px; 129 | background: white; 130 | z-index: 1; 131 | .drop-shadow; 132 | } 133 | } 134 | 135 | &.prototype-canvas { 136 | 137 | font-weight: bold; 138 | 139 | canvas { 140 | border: 1px dotted black; 141 | vertical-align: middle; 142 | } 143 | 144 | } 145 | 146 | } 147 | 148 | .blank { 149 | border: none; 150 | border-bottom: 1px dashed #888; 151 | text-align: center; 152 | } 153 | 154 | // The jQuery lesson elements 155 | 156 | #substitute { 157 | border: 1px solid #ABC; 158 | min-height: 3em; 159 | padding: 1em; 160 | } 161 | 162 | .awesome { 163 | border: 8px dotted #0F0; 164 | outline: 8px solid magenta; 165 | } -------------------------------------------------------------------------------- /src/css/seed.less: -------------------------------------------------------------------------------- 1 | @import "values"; 2 | @import "grid"; 3 | @import "base"; 4 | @import "semantic"; 5 | @import "syntax"; 6 | @import "interactive"; -------------------------------------------------------------------------------- /src/css/semantic.less: -------------------------------------------------------------------------------- 1 | 2 | //code 3 | var, code { 4 | font-family: consolas, monospace; 5 | .font-size(14); 6 | font-style: normal; 7 | } 8 | 9 | var { 10 | font-weight: bold; 11 | 12 | h1 > &, h2 > &, h2 > & { 13 | font-size: inherit; 14 | } 15 | } 16 | 17 | //definitions 18 | mark { 19 | background: transparent; 20 | font-weight: bold; 21 | } 22 | 23 | //structure 24 | 25 | aside { 26 | 27 | @width: 25em; 28 | 29 | .font-size(15); 30 | width: @width; 31 | float: right; 32 | clear: right; 33 | margin-right: -@width - 1.75; 34 | margin-bottom: 1em; 35 | border: 1px dotted #888; 36 | padding: 1em; 37 | background: white; 38 | box-shadow: .25em .25em .5em rgba(0, 0, 0, .1); 39 | 40 | h1 { 41 | background: @background; 42 | color: @foreground; 43 | } 44 | 45 | ul { 46 | padding-left: 1em; 47 | list-style-type: square; 48 | } 49 | 50 | @media screen and (max-width: @collapseColumns) { 51 | float: none; 52 | clear: none; 53 | width: auto; 54 | margin-right: 0; 55 | } 56 | 57 | } -------------------------------------------------------------------------------- /src/css/syntax.less: -------------------------------------------------------------------------------- 1 | @codeBackground: #F8F8F8; 2 | @codeForeground: #234; 3 | @codeRadius: 8px; 4 | @codeBorder: 1px solid #789; 5 | 6 | code { 7 | display: block; 8 | padding: 1em 0 1em .5em; 9 | background: @codeBackground; 10 | color: @codeForeground; 11 | margin: 1em 0; 12 | white-space: pre; 13 | border-radius: @codeRadius; 14 | border: @codeBorder; 15 | 16 | @media screen and (max-width: 41em) { 17 | white-space: pre-wrap; 18 | } 19 | } 20 | 21 | samp { 22 | display: block; 23 | padding: .5em; 24 | margin: 1em 0; 25 | 26 | &:before { 27 | content: "> "; 28 | color: #33A; 29 | } 30 | 31 | code + & { 32 | margin-top: -1em; 33 | border-bottom: 1px dashed #888; 34 | } 35 | 36 | &.pre { 37 | white-space: pre; 38 | &:before { 39 | content: none; 40 | } 41 | } 42 | 43 | } 44 | 45 | 46 | /* Pretty printing styles. Used with prettify.js. */ 47 | 48 | pre .str, code .str { color: #A33; } /* string */ 49 | pre .kwd, code .kwd { color: #808; } /* keyword */ 50 | pre .com, code .com { color: lighten(@codeForeground, 20%); font-style: italic; } /* comment */ 51 | pre .typ, code .typ { color: #F00; } /* type */ 52 | pre .lit, code .lit { color: #191; } /* literal */ 53 | pre .pun, code .pun { color: @codeForeground; } /* punctuation */ 54 | pre .pln, code .pln { color: darken(@codeForeground, 20%); } /* plaintext */ 55 | pre .tag, code .tag { color: lighten(@codeForeground, 20%); } /* html/xml tag */ 56 | pre .atn, code .atn { color: #293; } /* html/xml attribute name */ 57 | pre .atv, code .atv { color: #239; } /* html/xml attribute value */ 58 | pre .dec, code .dec { color: #3387CC; } /* decimal */ 59 | 60 | pre.prettyprint, code.prettyprint { 61 | background-color: @codeBackground; 62 | -moz-border-radius: @codeRadius; 63 | -webkit-border-radius: @codeRadius; 64 | -o-border-radius: @codeRadius; 65 | -ms-border-radius: @codeRadius; 66 | -khtml-border-radius: @codeRadius; 67 | border-radius: @codeRadius; 68 | } 69 | 70 | pre.prettyprint { 71 | width: 95%; 72 | margin: 1em auto; 73 | padding: 1em; 74 | white-space: pre-wrap; 75 | } 76 | 77 | 78 | /* Specify class=linenums on a pre to get line numbering */ 79 | ol.linenums { margin-top: 0; margin-bottom: 0; color: lighten(@codeForeground, 20%); } /* IE indents via margin-left */ 80 | li.L0,li.L1,li.L2,li.L3,li.L4,li.L5,li.L6,li.L7,li.L8 { list-style-type: decimal-leading-zero; background: black; border-left: 1px solid #333; padding-left: 4px;} 81 | /* Alternate shading for lines */ 82 | li.L1,li.L3,li.L5,li.L7,li.L9 { background: #111; } 83 | 84 | @media print { 85 | pre .str, code .str { color: #060; } 86 | pre .kwd, code .kwd { color: #006; font-weight: bold; } 87 | pre .com, code .com { color: #600; font-style: italic; } 88 | pre .typ, code .typ { color: #404; font-weight: bold; } 89 | pre .lit, code .lit { color: #044; } 90 | pre .pun, code .pun { color: #440; } 91 | pre .pln, code .pln { color: #000; } 92 | pre .tag, code .tag { color: #006; font-weight: bold; } 93 | pre .atn, code .atn { color: #404; } 94 | pre .atv, code .atv { color: #060; } 95 | } 96 | -------------------------------------------------------------------------------- /src/css/values.less: -------------------------------------------------------------------------------- 1 | @foreground: black; 2 | @background: white; 3 | 4 | @foreground-secondary: white; 5 | @background-secondary: #789; 6 | 7 | @base-font-size: 16; 8 | 9 | .font-size(@target) { 10 | @pxValue: @target; 11 | @remValue: @target / @base-font-size; 12 | font-size: ~"@{pxValue}px"; 13 | font-size: ~"@{remValue}rem"; 14 | } 15 | 16 | .drop-shadow(@x: 4px, @y: 4px, @distance: 8px, @alpha: .2) { 17 | -moz-box-shadow: @x @y @distance rgba(0, 0, 0, @alpha); 18 | -webkit-box-shadow: @x @y @distance rgba(0, 0, 0, @alpha); 19 | -ms-box-shadow: @x @y @distance rgba(0, 0, 0, @alpha); 20 | box-shadow: @x @y @distance rgba(0, 0, 0, @alpha); 21 | } 22 | 23 | .inset { 24 | -moz-box-shadow: inset 4px 4px 4px rgba(0, 0, 0, .2); 25 | -webkit-box-shadow: inset 4px 4px 4px rgba(0, 0, 0, .2); 26 | -ms-box-shadow: inset 4px 4px 4px rgba(0, 0, 0, .2); 27 | box-shadow: inset 4px 4px 4px rgba(0, 0, 0, .2); 28 | } 29 | 30 | .carved { 31 | //fallback 32 | color: white; 33 | 34 | :not(.ie) & { 35 | color: transparent; 36 | text-shadow: 37 | 1px 1px rgba(255, 255, 255, .2), 38 | 0 0 #012; 39 | } 40 | } 41 | 42 | //breakpoints 43 | @collapseColumns: 69em; 44 | @tablet: 800px; 45 | @phone: 500px; -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | <%= t.include("snippets/head.html", { title: "Table of Contents" }) %> 2 | 3 |

    Chapters

    4 | 5 |
      6 |
    1. Introduction 7 |
    2. Getting Started 8 |
    3. Choose Your Own Adventure 9 |
    4. Intermission: Finding Help 10 |
    5. Loops and Arrays 11 |
    6. Object Lesson 12 |
    7. Beginning jQuery 13 |
    8. Intermission: Writing HTML for JavaScript 14 |
    9. Functions 15 |
    10. jQuery Events 16 |
    11. Forms 17 |
    12. Intermission: Source Control with Git 18 |
    13. Canvas 19 |
    14. Constructors and Inheritance 20 |
    15. AJAX 21 |
    16. Cookies and Local Storage 22 |
    17. Intermission: JavaScript Security 23 |
    18. Functional Programming 24 |
    19. Server-side code with NodeJS 25 |
    20. The Road Ahead 26 |
    27 | 28 | <%= t.include("snippets/foot.html") %> -------------------------------------------------------------------------------- /src/interactives/canvasProto.html: -------------------------------------------------------------------------------- 1 |
    2 | → 3 | → 4 | → 5 | 6 |
    7 | -------------------------------------------------------------------------------- /src/interactives/escaping.html: -------------------------------------------------------------------------------- 1 |
    2 | 3 | 4 | 5 | 6 |
    7 |
    -------------------------------------------------------------------------------- /src/interactives/houses.html: -------------------------------------------------------------------------------- 1 |
    2 | 3 | 4 | 5 | 6 |
     7 | var houses = [true, false, true, true, false];
     8 | var counter = 0;
     9 | for (var i = 0; i < houses.length;  i = i + 1) {
    10 |   var current = houses[i];
    11 |   if (current) {
    12 |     counter = counter + 1;
    13 |   }
    14 | }
    15 | console.log("Total: " + counter)
    16 |   
    17 |
    18 |
    19 |
    -------------------------------------------------------------------------------- /src/interactives/lightbulbs.html: -------------------------------------------------------------------------------- 1 |
    2 | 3 |
    console.log('Hello, world!');
     4 | placeholder = placeholder + 12;
     5 | if () {
    6 |
    } else {
    7 |
    }
     8 | console.log("remaining code");
     9 | //we now resume normal program flow
    10 |
    -------------------------------------------------------------------------------- /src/interactives/regex.html: -------------------------------------------------------------------------------- 1 |
    2 | 3 |
    4 | Phone numbers: 5 | (555) 012-1234 6 | 555.012.1234 7 | 5550121234 8 | 9 | Email: 10 | a@b.com 11 | a@b.co.uk 12 | a.b@c.com 13 | a.b+c@d.com 14 | 15 |
    -------------------------------------------------------------------------------- /src/interactives/timelapse.html: -------------------------------------------------------------------------------- 1 |
    2 |
    3 | First 4 | 5 |
      6 | 7 | Last 8 |
      9 | 13 | 14 | 15 |
      16 | -------------------------------------------------------------------------------- /src/snippets/foot.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/snippets/head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Javascript for the Web Savvy • <%= title %> 6 | 7 | 8 | 9 | 10 | 11 | 19 | 20 | 21 |

      <%= title %>

      22 |
      -------------------------------------------------------------------------------- /src/snippets/scripts.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tools/timelapse/test.time: -------------------------------------------------------------------------------- 1 | This is a timelapse file 2 | @,0@This line was removed after the first revision 3 | @1,@This line was added after the first revision 4 | @@c:1;This is a revision comment added for the first revision. 5 | Comments are allowed to be multiline@@ --------------------------------------------------------------------------------