├── www ├── .ruby-gemset ├── .ruby-version ├── Gemfile ├── images │ ├── Intercooler_K.png │ ├── Intercooler_CMYK.png │ ├── Intercooler_K_noType.png │ ├── Intercooler_reverse.png │ ├── Intercooler_CMYK_noType.png │ ├── Intercooler_CMYK_noType_64.png │ ├── Intercooler_CMYK_noType_ico.png │ └── Intercooler_reverse_noType.png ├── _config.yml ├── Capfile ├── js │ └── google-code-prettify │ │ ├── lang-rd.js │ │ ├── lang-go.js │ │ ├── lang-tex.js │ │ ├── lang-proto.js │ │ ├── lang-llvm.js │ │ ├── lang-yaml.js │ │ ├── lang-basic.js │ │ ├── lang-wiki.js │ │ ├── lang-lua.js │ │ ├── lang-hs.js │ │ ├── lang-erlang.js │ │ ├── lang-tcl.js │ │ ├── prettify.css │ │ ├── lang-r.js │ │ ├── lang-pascal.js │ │ ├── lang-lisp.js │ │ ├── lang-css.js │ │ ├── lang-mumps.js │ │ ├── lang-scala.js │ │ ├── lang-dart.js │ │ ├── lang-apollo.js │ │ ├── lang-ml.js │ │ ├── lang-n.js │ │ ├── lang-vhdl.js │ │ ├── lang-clj.js │ │ ├── lang-vb.js │ │ ├── lang-sql.js │ │ └── prettify.js ├── config │ └── deploy.rb ├── release │ ├── CHANGES-0.4.1.html │ ├── upgrade-steps-0.3.0.html │ ├── CHANGES-0.4.0.html │ ├── intercooler-0.0.1-prealpha-1.min.js │ ├── intercooler-0.3.0.min.js │ └── intercooler-0.3.1.min.js ├── attributes │ ├── ic-transition.html │ ├── ic-always-update.html │ ├── ic-verb.html │ ├── ic-confirm.html │ ├── ic-limit-children.html │ ├── ic-indicator.html │ ├── ic-delete-from.html │ ├── ic-put-to.html │ ├── ic-include.html │ ├── ic-post-to.html │ ├── ic-poll.html │ ├── ic-trigger-on.html │ ├── ic-get-from.html │ ├── ic-style-src.html │ ├── ic-deps.html │ ├── ic-attr-src.html │ ├── ic-src.html │ ├── ic-append-from.html │ ├── ic-prepend-from.html │ ├── ic-target.html │ └── all.html ├── _plugins │ └── nav_tags.rb ├── _includes │ └── action_common.html ├── tutorials │ ├── flash.html │ ├── bulk_ops.html │ ├── infinite.html │ ├── inline_validation.html │ ├── click_to_load.html │ ├── crud.html │ └── index.html ├── Gemfile.lock ├── why.html ├── css │ └── site.css ├── dependencies.html ├── download.html ├── index.html ├── extending.html ├── _layouts │ └── default.html ├── responses.html └── examples.html ├── .dir-locals.el ├── .gitignore ├── package.json ├── TODO.org ├── LICENSE ├── Gruntfile.js ├── README.md └── test └── sandbox.html /www/.ruby-gemset: -------------------------------------------------------------------------------- 1 | intercoolerjs-www 2 | -------------------------------------------------------------------------------- /www/.ruby-version: -------------------------------------------------------------------------------- 1 | ruby-2.0.0-p247 2 | -------------------------------------------------------------------------------- /.dir-locals.el: -------------------------------------------------------------------------------- 1 | ((js-mode . ((js-indent-level . 2)))) 2 | -------------------------------------------------------------------------------- /www/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'capistrano', '2.15.4' 4 | gem 'jekyll' 5 | gem 'capistrano-s3' 6 | -------------------------------------------------------------------------------- /www/images/Intercooler_K.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruricolist/intercooler-js/master/www/images/Intercooler_K.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .DS_Store 3 | intercooler-js.iml 4 | www/.last_published 5 | www/_site/ 6 | node_modules 7 | rails-demo 8 | -------------------------------------------------------------------------------- /www/images/Intercooler_CMYK.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruricolist/intercooler-js/master/www/images/Intercooler_CMYK.png -------------------------------------------------------------------------------- /www/images/Intercooler_K_noType.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruricolist/intercooler-js/master/www/images/Intercooler_K_noType.png -------------------------------------------------------------------------------- /www/images/Intercooler_reverse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruricolist/intercooler-js/master/www/images/Intercooler_reverse.png -------------------------------------------------------------------------------- /www/images/Intercooler_CMYK_noType.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruricolist/intercooler-js/master/www/images/Intercooler_CMYK_noType.png -------------------------------------------------------------------------------- /www/images/Intercooler_CMYK_noType_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruricolist/intercooler-js/master/www/images/Intercooler_CMYK_noType_64.png -------------------------------------------------------------------------------- /www/images/Intercooler_CMYK_noType_ico.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruricolist/intercooler-js/master/www/images/Intercooler_CMYK_noType_ico.png -------------------------------------------------------------------------------- /www/images/Intercooler_reverse_noType.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ruricolist/intercooler-js/master/www/images/Intercooler_reverse_noType.png -------------------------------------------------------------------------------- /www/_config.yml: -------------------------------------------------------------------------------- 1 | name: IntercoolerJS - REST-ful data bindings for HTML 2 | pygments: false 3 | exclude: 4 | - config 5 | - Gemfile 6 | - Gemfile.lock 7 | - Capfile 8 | -------------------------------------------------------------------------------- /www/Capfile: -------------------------------------------------------------------------------- 1 | load 'deploy' 2 | # Uncomment if you are using Rails' asset pipeline 3 | # load 'deploy/assets' 4 | load 'config/deploy' # remove this line to skip loading any of the default tasks -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "intercooler", 3 | "version": "0.4.1", 4 | "devDependencies": { 5 | "grunt": "~0.4.2", 6 | "grunt-contrib-jshint": "~0.6.3", 7 | "grunt-contrib-nodeunit": "~0.2.0", 8 | "grunt-contrib-uglify": "~0.2.2" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /www/js/google-code-prettify/lang-rd.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\n\r]*/,null,"%"]],[["lit",/^\\(?:cr|l?dots|R|tab)\b/],["kwd",/^\\[@-Za-z]+/],["kwd",/^#(?:ifn?def|endif)/],["pln",/^\\[{}]/],["pun",/^[()[\]{}]+/]]),["Rd","rd"]); 2 | -------------------------------------------------------------------------------- /www/js/google-code-prettify/lang-go.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["pln",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])+(?:'|$)|`[^`]*(?:`|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\/\*[\S\s]*?\*\/)/],["pln",/^(?:[^"'/`]|\/(?![*/]))+/]]),["go"]); 2 | -------------------------------------------------------------------------------- /www/js/google-code-prettify/lang-tex.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\n\r]*/,null,"%"]],[["kwd",/^\\[@-Za-z]+/],["kwd",/^\\./],["typ",/^[$&]/],["lit",/[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i],["pun",/^[()=[\]{}]+/]]),["latex","tex"]); 2 | -------------------------------------------------------------------------------- /www/js/google-code-prettify/lang-proto.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.sourceDecorator({keywords:"bytes,default,double,enum,extend,extensions,false,group,import,max,message,option,optional,package,repeated,required,returns,rpc,service,syntax,to,true",types:/^(bool|(double|s?fixed|[su]?int)(32|64)|float|string)\b/,cStyleComments:!0}),["proto"]); 2 | -------------------------------------------------------------------------------- /TODO.org: -------------------------------------------------------------------------------- 1 | * General 2 | ** Handle Forms as Action Items 3 | ** Handle non-input's as action items (click) 4 | ** Allow overriding action event (e.g. ic-action='mouse-up') 5 | ** Support request progress indicator (e.g. disable button) 6 | ** Allow pluggable transitions 7 | ** API work 8 | *** Allow all request types directly through Intercooler object -------------------------------------------------------------------------------- /www/config/deploy.rb: -------------------------------------------------------------------------------- 1 | 2 | require 'capistrano/s3' 3 | 4 | set :deployment_path, "_site" 5 | set :bucket, "intercoolerjs.org" 6 | set :access_key_id, ENV['AWS_ACCESS_KEY'] 7 | set :secret_access_key, ENV['AWS_SECRET_KEY'] 8 | 9 | # set :s3_endpoint, 's3-us-west-1.amazonaws.com' 10 | 11 | before 'deploy' do 12 | run_locally "jekyll build" 13 | end 14 | -------------------------------------------------------------------------------- /www/js/google-code-prettify/lang-llvm.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^!?"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["com",/^;[^\n\r]*/,null,";"]],[["pln",/^[!%@](?:[$\-.A-Z_a-z][\w$\-.]*|\d+)/],["kwd",/^[^\W\d]\w*/,null],["lit",/^\d+\.\d+/],["lit",/^(?:\d+|0[Xx][\dA-Fa-f]+)/],["pun",/^[(-*,:<->[\]{}]|\.\.\.$/]]),["llvm","ll"]); 2 | -------------------------------------------------------------------------------- /www/js/google-code-prettify/lang-yaml.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:>?|]+/,a,":|>?"],["dec",/^%(?:YAML|TAG)[^\n\r#]+/,a,"%"],["typ",/^&\S+/,a,"&"],["typ",/^!\S*/,a,"!"],["str",/^"(?:[^"\\]|\\.)*(?:"|$)/,a,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,a,"'"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^\s+/,a," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\n\r]|$)/],["pun",/^-/],["kwd",/^\w+:[\n\r ]/],["pln",/^\w+/]]),["yaml","yml"]); 3 | -------------------------------------------------------------------------------- /www/js/google-code-prettify/lang-basic.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^"(?:[^\n\r"\\]|\\.)*(?:"|$)/,a,'"'],["pln",/^\s+/,a," \r\n\t\u00a0"]],[["com",/^REM[^\n\r]*/,a],["kwd",/^\b(?:AND|CLOSE|CLR|CMD|CONT|DATA|DEF ?FN|DIM|END|FOR|GET|GOSUB|GOTO|IF|INPUT|LET|LIST|LOAD|NEW|NEXT|NOT|ON|OPEN|OR|POKE|PRINT|READ|RESTORE|RETURN|RUN|SAVE|STEP|STOP|SYS|THEN|TO|VERIFY|WAIT)\b/,a],["pln",/^[a-z][^\W_]?(?:\$|%)?/i,a],["lit",/^(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/i,a,"0123456789"],["pun", 3 | /^.[^\s\w"$%.]*/,a]]),["basic","cbm"]); 4 | -------------------------------------------------------------------------------- /www/js/google-code-prettify/lang-wiki.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\d\t a-gi-z\xa0]+/,null,"\t \u00a0abcdefgijklmnopqrstuvwxyz0123456789"],["pun",/^[*=[\]^~]+/,null,"=*~^[]"]],[["lang-wiki.meta",/(?:^^|\r\n?|\n)(#[a-z]+)\b/],["lit",/^[A-Z][a-z][\da-z]+[A-Z][a-z][^\W_]+\b/],["lang-",/^{{{([\S\s]+?)}}}/],["lang-",/^`([^\n\r`]+)`/],["str",/^https?:\/\/[^\s#/?]*(?:\/[^\s#?]*)?(?:\?[^\s#]*)?(?:#\S*)?/i],["pln",/^(?:\r\n|[\S\s])[^\n\r#*=A-[^`h{~]*/]]),["wiki"]); 2 | PR.registerLangHandler(PR.createSimpleLexer([["kwd",/^#[a-z]+/i,null,"#"]],[]),["wiki.meta"]); 3 | -------------------------------------------------------------------------------- /www/js/google-code-prettify/lang-lua.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$))/,null,"\"'"]],[["com",/^--(?:\[(=*)\[[\S\s]*?(?:]\1]|$)|[^\n\r]*)/],["str",/^\[(=*)\[[\S\s]*?(?:]\1]|$)/],["kwd",/^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i], 2 | ["pln",/^[_a-z]\w*/i],["pun",/^[^\w\t\n\r \xa0][^\w\t\n\r "'+=\xa0-]*/]]),["lua"]); 3 | -------------------------------------------------------------------------------- /www/js/google-code-prettify/lang-hs.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t-\r ]+/,null,"\t\n\u000b\u000c\r "],["str",/^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["str",/^'(?:[^\n\f\r'\\]|\\[^&])'?/,null,"'"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,null,"0123456789"]],[["com",/^(?:--+[^\n\f\r]*|{-(?:[^-]|-+[^}-])*-})/],["kwd",/^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^\d'A-Za-z]|$)/, 2 | null],["pln",/^(?:[A-Z][\w']*\.)*[A-Za-z][\w']*/],["pun",/^[^\d\t-\r "'A-Za-z]+/]]),["hs"]); 3 | -------------------------------------------------------------------------------- /www/release/CHANGES-0.4.1.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: dependencies 4 | --- 5 | 6 |
7 | 8 |

Intercooler 0.4.1 Changes

9 | 10 |

Intercooler.js v0.4.0 was released on July 4th, 2014

11 | 12 |

Change List

13 | 14 | 19 | 20 |
21 | -------------------------------------------------------------------------------- /www/js/google-code-prettify/lang-erlang.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t-\r ]+/,null,"\t\n\u000b\u000c\r "],["str",/^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["lit",/^[a-z]\w*/],["lit",/^'(?:[^\n\f\r'\\]|\\[^&])+'?/,null,"'"],["lit",/^\?[^\t\n ({]+/,null,"?"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\n]*/],["kwd",/^(?:module|attributes|do|let|in|letrec|apply|call|primop|case|of|end|when|fun|try|catch|receive|after|char|integer|float,atom,string,var)\b/], 2 | ["kwd",/^-[_a-z]+/],["typ",/^[A-Z_]\w*/],["pun",/^[,.;]/]]),["erlang","erl"]); 3 | -------------------------------------------------------------------------------- /www/attributes/ic-transition.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-transition 4 | --- 5 | 6 |
7 | 8 |
9 |
10 | 11 |

ic-transition - The transition attribute

12 | 13 |

Summary

14 | 15 |

The ic-transition attribute can specify the transition to use when replacing an element

16 | 17 | 18 |

Syntax

19 | 20 |

Currently only two values are supported: fade and none

21 | 22 |
23 |
24 |
-------------------------------------------------------------------------------- /www/js/google-code-prettify/lang-tcl.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^{+/,a,"{"],["clo",/^}+/,a,"}"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:after|append|apply|array|break|case|catch|continue|error|eval|exec|exit|expr|for|foreach|if|incr|info|proc|return|set|switch|trace|uplevel|upvar|while)\b/,a],["lit",/^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i],["lit", 3 | /^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["tcl"]); 4 | -------------------------------------------------------------------------------- /www/js/google-code-prettify/prettify.css: -------------------------------------------------------------------------------- 1 | .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} -------------------------------------------------------------------------------- /www/js/google-code-prettify/lang-r.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["str",/^'(?:[^'\\]|\\[\S\s])*(?:'|$)/,null,"'"]],[["com",/^#.*/],["kwd",/^(?:if|else|for|while|repeat|in|next|break|return|switch|function)(?![\w.])/],["lit",/^0[Xx][\dA-Fa-f]+([Pp]\d+)?[Li]?/],["lit",/^[+-]?(\d+(\.\d+)?|\.\d+)([Ee][+-]?\d+)?[Li]?/],["lit",/^(?:NULL|NA(?:_(?:integer|real|complex|character)_)?|Inf|TRUE|FALSE|NaN|\.\.(?:\.|\d+))(?![\w.])/], 2 | ["pun",/^(?:<>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|[!*+/^]|%.*?%|[$=@~]|:{1,3}|[(),;?[\]{}])/],["pln",/^(?:[A-Za-z]+[\w.]*|\.[^\W\d][\w.]*)(?![\w.])/],["str",/^`.+`/]]),["r","s","R","S","Splus"]); 3 | -------------------------------------------------------------------------------- /www/js/google-code-prettify/lang-pascal.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^'(?:[^\n\r'\\]|\\.)*(?:'|$)/,a,"'"],["pln",/^\s+/,a," \r\n\t\u00a0"]],[["com",/^\(\*[\S\s]*?(?:\*\)|$)|^{[\S\s]*?(?:}|$)/,a],["kwd",/^(?:absolute|and|array|asm|assembler|begin|case|const|constructor|destructor|div|do|downto|else|end|external|for|forward|function|goto|if|implementation|in|inline|interface|interrupt|label|mod|not|object|of|or|packed|procedure|program|record|repeat|set|shl|shr|then|to|type|unit|until|uses|var|virtual|while|with|xor)\b/i,a], 3 | ["lit",/^(?:true|false|self|nil)/i,a],["pln",/^[a-z][^\W_]*/i,a],["lit",/^(?:\$[\da-f]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)/i,a,"0123456789"],["pun",/^.[^\s\w$'./@]*/,a]]),["pascal"]); 4 | -------------------------------------------------------------------------------- /www/_plugins/nav_tags.rb: -------------------------------------------------------------------------------- 1 | require 'digest/md5' 2 | 3 | module Jekyll 4 | class ActiveTag < Liquid::Tag 5 | def initialize(tag_name, text, tokens) 6 | super 7 | @text = text 8 | end 9 | def render(context) 10 | nav = context.registers[:page]['nav'] || '' 11 | 'active' if nav.include? @text.chop 12 | end 13 | end 14 | class HideTag < Liquid::Tag 15 | def initialize(tag_name, text, tokens) 16 | super 17 | @text = text 18 | end 19 | def render(context) 20 | nav = context.registers[:page]['nav'] || '' 21 | 'hide' unless nav.include? @text.chop 22 | end 23 | end 24 | end 25 | 26 | Liquid::Template.register_tag('active', Jekyll::ActiveTag) 27 | Liquid::Template.register_tag('unless', Jekyll::HideTag) 28 | -------------------------------------------------------------------------------- /www/js/google-code-prettify/lang-lisp.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,a,"("],["clo",/^\)+/,a,")"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,a], 3 | ["lit",/^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["cl","el","lisp","lsp","scm","ss","rkt"]); 4 | -------------------------------------------------------------------------------- /www/js/google-code-prettify/lang-css.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n\u000c"]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]+)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//], 2 | ["com",/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}\b/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); 3 | -------------------------------------------------------------------------------- /www/js/google-code-prettify/lang-mumps.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:[^"]|\\.)*"/,null,'"']],[["com",/^;[^\n\r]*/,null,";"],["dec",/^\$(?:d|device|ec|ecode|es|estack|et|etrap|h|horolog|i|io|j|job|k|key|p|principal|q|quit|st|stack|s|storage|sy|system|t|test|tl|tlevel|tr|trestart|x|y|z[a-z]*|a|ascii|c|char|d|data|e|extract|f|find|fn|fnumber|g|get|j|justify|l|length|na|name|o|order|p|piece|ql|qlength|qs|qsubscript|q|query|r|random|re|reverse|s|select|st|stack|t|text|tr|translate|nan)\b/i, 2 | null],["kwd",/^(?:[^$]b|break|c|close|d|do|e|else|f|for|g|goto|h|halt|h|hang|i|if|j|job|k|kill|l|lock|m|merge|n|new|o|open|q|quit|r|read|s|set|tc|tcommit|tre|trestart|tro|trollback|ts|tstart|u|use|v|view|w|write|x|xecute)\b/i,null],["lit",/^[+-]?(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?/i],["pln",/^[a-z][^\W_]*/i],["pun",/^[^\w\t\n\r"$%;^\xa0]|_/]]),["mumps"]); 3 | -------------------------------------------------------------------------------- /www/js/google-code-prettify/lang-scala.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:""(?:""?(?!")|[^"\\]|\\.)*"{0,3}|(?:[^\n\r"\\]|\\.)*"?)/,null,'"'],["lit",/^`(?:[^\n\r\\`]|\\.)*`?/,null,"`"],["pun",/^[!#%&(--:-@[-^{-~]+/,null,"!#%&()*+,-:;<=>?@[\\]^{|}~"]],[["str",/^'(?:[^\n\r'\\]|\\(?:'|[^\n\r']+))'/],["lit",/^'[$A-Z_a-z][\w$]*(?![\w$'])/],["kwd",/^(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|object|override|package|private|protected|requires|return|sealed|super|throw|trait|try|type|val|var|while|with|yield)\b/], 2 | ["lit",/^(?:true|false|null|this)\b/],["lit",/^(?:0(?:[0-7]+|x[\da-f]+)l?|(?:0|[1-9]\d*)(?:(?:\.\d+)?(?:e[+-]?\d+)?f?|l?)|\\.\d+(?:e[+-]?\d+)?f?)/i],["typ",/^[$_]*[A-Z][\d$A-Z_]*[a-z][\w$]*/],["pln",/^[$A-Z_a-z][\w$]*/],["com",/^\/(?:\/.*|\*(?:\/|\**[^*/])*(?:\*+\/?)?)/],["pun",/^(?:\.+|\/)/]]),["scala"]); 3 | -------------------------------------------------------------------------------- /www/attributes/ic-always-update.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-always-update 4 | --- 5 | 6 |
7 | 8 |
9 |
10 | 11 |

ic-always-update - The Always Update Attribute

12 | 13 |

Summary

14 | 15 |

The ic-always-update attribute forces an element to always update the DOM when new content 16 | is downloaded, even if the current content is identical to the downloaded content.

17 | 18 |

This can be useful if you want to clean non-DOM related state (such as checkboxes) after an operation causes 19 | an update.

20 | 21 |

Syntax

22 | 23 |

The value of this attribute can be either true or false

24 | 25 |

Dependencies

26 | 27 |

No effect.

28 | 29 |
30 |
31 |
-------------------------------------------------------------------------------- /www/js/google-code-prettify/lang-dart.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"]],[["com",/^#!.*/],["kwd",/^\b(?:import|library|part of|part|as|show|hide)\b/i],["com",/^\/\/.*/],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["kwd",/^\b(?:class|interface)\b/i],["kwd",/^\b(?:assert|break|case|catch|continue|default|do|else|finally|for|if|in|is|new|return|super|switch|this|throw|try|while)\b/i],["kwd",/^\b(?:abstract|const|extends|factory|final|get|implements|native|operator|set|static|typedef|var)\b/i], 2 | ["typ",/^\b(?:bool|double|dynamic|int|num|object|string|void)\b/i],["kwd",/^\b(?:false|null|true)\b/i],["str",/^r?'''[\S\s]*?[^\\]'''/],["str",/^r?"""[\S\s]*?[^\\]"""/],["str",/^r?'('|[^\n\f\r]*?[^\\]')/],["str",/^r?"("|[^\n\f\r]*?[^\\]")/],["pln",/^[$_a-z]\w*/i],["pun",/^[!%&*+/:<-?^|~-]/],["lit",/^\b0x[\da-f]+/i],["lit",/^\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i],["lit",/^\b\.\d+(?:e[+-]?\d+)?/i],["pun",/^[(),.;[\]{}]/]]), 3 | ["dart"]); 4 | -------------------------------------------------------------------------------- /www/_includes/action_common.html: -------------------------------------------------------------------------------- 1 |

Any content that is returned will be used to replace the content of the current element (or, more commonly, another 2 | element, via the ic-target attribute, see below). An empty 3 | response will be interpreted as a No-Op. See Intercooler Responses for 4 | more info.

5 | 6 |

Since it is common for an action to replace a different element than the one that the action occured 7 | on, you may want to use the ic-target attribute to target 8 | a different element for replacement.

9 | 10 |

What is the Default Action?

11 | 12 |

The default action depends on the type of an HTML element:

13 | 14 | 19 | -------------------------------------------------------------------------------- /www/js/google-code-prettify/lang-apollo.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\n\r]*/,null,"#"],["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/, 2 | null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[ES]?BANK=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[!-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["apollo","agc","aea"]); 3 | -------------------------------------------------------------------------------- /www/attributes/ic-verb.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-verb 4 | --- 5 | 6 |
7 | 8 |
9 |
10 | 11 |

ic-verb - The Verb Attribute

12 | 13 |

Summary

14 | 15 |

The ic-verb attribute tells Intercooler to use a different HTTP verb when issuing 16 | a request than it would otherwise.

17 | 18 |

This can be useful in cases where, for example, you want to reuse a form for both editing and 19 | creating new models, and need to select the appropriate verb.

20 | 21 |

Syntax

22 | 23 |

The value of the ic-verb attribute should be one of:

24 | 25 |
    26 |
  • GET
  • 27 |
  • POST
  • 28 |
  • PUT
  • 29 |
  • DELETE
  • 30 |
31 | 32 |

Dependencies

33 | 34 |

ic-verb attribute has no effect on dependencies.

35 | 36 |
37 |
38 |
-------------------------------------------------------------------------------- /www/js/google-code-prettify/lang-ml.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["com",/^#(?:if[\t\n\r \xa0]+(?:[$_a-z][\w']*|``[^\t\n\r`]*(?:``|$))|else|endif|light)/i,null,"#"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])(?:'|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\(\*[\S\s]*?\*\))/],["kwd",/^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/], 2 | ["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^(?:[_a-z][\w']*[!#?]?|``[^\t\n\r`]*(?:``|$))/i],["pun",/^[^\w\t\n\r "'\xa0]+/]]),["fs","ml"]); 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2010-2012 Google, Inc. http://intercoolerjs.org 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /www/release/upgrade-steps-0.3.0.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: dependencies 4 | --- 5 |
6 | 7 |
8 |
9 | 10 |

Intercooler 0.2.0 → 0.3.x Upgrade Guide

11 | 12 |

Fresh on the heels of saying that we were adopting Semantic Versioning in 0.2.0, we 13 | promptly violated Semantic Versioning.

14 | 15 |

Last time, promise! ☺

16 | 17 |

Upgrade Steps

18 | 19 |

Here are steps to upgrade from Intercooler 0.2.0 to 0.3.0:

20 | 21 |
    22 |
  1. Rename the ic-load-on attribute to ic-trigger-on.
  2. 23 |
  3. All intercooler events that were previously named ic.* should be reversed to *.ic - this 24 | is more consistent with jQuery event name spacing.
  4. 25 |
  5. All logging related methods, setLogger, log, setLogLevel and 26 | logLevels were removed from the API and should be replaced by jQuery event listeners for the 27 | log.ic event.
  6. 28 |
29 | 30 |

Not too bad, but still, sorry about that!

31 | 32 |
33 |
34 | 35 |
-------------------------------------------------------------------------------- /www/js/google-code-prettify/lang-n.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:'(?:[^\n\r'\\]|\\.)*'|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,a,'"'],["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,a,"#"],["pln",/^\s+/,a," \r\n\t\u00a0"]],[["str",/^@"(?:[^"]|"")*(?:"|$)/,a],["str",/^<#[^#>]*(?:#>|$)/,a],["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,a],["com",/^\/\/[^\n\r]*/,a],["com",/^\/\*[\S\s]*?(?:\*\/|$)/, 3 | a],["kwd",/^(?:abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b/, 4 | a],["typ",/^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/,a],["lit",/^@[$_a-z][\w$@]*/i,a],["typ",/^@[A-Z]+[a-z][\w$@]*/,a],["pln",/^'?[$_a-z][\w$@]*/i,a],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,a,"0123456789"],["pun",/^.[^\s\w"-$'./@`]*/,a]]),["n","nemerle"]); 5 | -------------------------------------------------------------------------------- /www/js/google-code-prettify/lang-vhdl.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"]],[["str",/^(?:[box]?"(?:[^"]|"")*"|'.')/i],["com",/^--[^\n\r]*/],["kwd",/^(?:abs|access|after|alias|all|and|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|mod|nand|new|next|nor|not|null|of|on|open|or|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|rem|report|return|rol|ror|select|severity|shared|signal|sla|sll|sra|srl|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with|xnor|xor)(?=[^\w-]|$)/i, 2 | null],["typ",/^(?:bit|bit_vector|character|boolean|integer|real|time|string|severity_level|positive|natural|signed|unsigned|line|text|std_u?logic(?:_vector)?)(?=[^\w-]|$)/i,null],["typ",/^'(?:active|ascending|base|delayed|driving|driving_value|event|high|image|instance_name|last_active|last_event|last_value|left|leftof|length|low|path_name|pos|pred|quiet|range|reverse_range|right|rightof|simple_name|stable|succ|transaction|val|value)(?=[^\w-]|$)/i,null],["lit",/^\d+(?:_\d+)*(?:#[\w.\\]+#(?:[+-]?\d+(?:_\d+)*)?|(?:\.\d+(?:_\d+)*)?(?:e[+-]?\d+(?:_\d+)*)?)/i], 3 | ["pln",/^(?:[a-z]\w*|\\[^\\]*\\)/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'\xa0-]*/]]),["vhdl","vhd"]); 4 | -------------------------------------------------------------------------------- /www/js/google-code-prettify/lang-clj.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Google Inc. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | var a=null; 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^[([{]+/,a,"([{"],["clo",/^[)\]}]+/,a,")]}"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:def|if|do|let|quote|var|fn|loop|recur|throw|try|monitor-enter|monitor-exit|defmacro|defn|defn-|macroexpand|macroexpand-1|for|doseq|dosync|dotimes|and|or|when|not|assert|doto|proxy|defstruct|first|rest|cons|defprotocol|deftype|defrecord|reify|defmulti|defmethod|meta|with-meta|ns|in-ns|create-ns|import|intern|refer|alias|namespace|resolve|ref|deref|refset|new|set!|memfn|to-array|into-array|aset|gen-class|reduce|map|filter|find|nil?|empty?|hash-map|hash-set|vec|vector|seq|flatten|reverse|assoc|dissoc|list|list?|disj|get|union|difference|intersection|extend|extend-type|extend-protocol|prn)\b/,a], 18 | ["typ",/^:[\dA-Za-z-]+/]]),["clj"]); 19 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function (grunt) { 2 | 3 | // Project configuration. 4 | grunt.initConfig({ 5 | pkg: grunt.file.readJSON('package.json'), 6 | uglify: { 7 | options: { 8 | banner: '/*! <%= pkg.name %> <%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd") %> */\n' 9 | }, 10 | build: { 11 | src: 'src/intercooler.js', 12 | dest: 'www/release/intercooler-<%= pkg.version %>.min.js' 13 | } 14 | }, 15 | "regex-replace": { 16 | "update-test-ref": { //specify a target with any name 17 | src: ['www/release/unit-tests-<%= pkg.version %>.html'], 18 | actions: [ 19 | { 20 | name: 'lib ref', 21 | search: "../src/intercooler.js", 22 | replace: './intercooler-<%= pkg.version %>.js', 23 | flags: 'g' 24 | } 25 | ] 26 | } 27 | } 28 | }); 29 | 30 | // Load the plugin that provides the "uglify" task. 31 | grunt.loadNpmTasks('grunt-contrib-uglify'); 32 | grunt.loadNpmTasks('grunt-regex-replace'); 33 | 34 | grunt.registerTask('release', "Releases a new version of the library", function () { 35 | grunt.file.copy("src/intercooler.js", 'www/release/intercooler-' + grunt.config.get('pkg').version + '.js'); 36 | grunt.file.copy("test/unit_tests.html", 'www/release/unit-tests-' + grunt.config.get('pkg').version + '.html'); 37 | grunt.task.run('uglify'); 38 | grunt.task.run('regex-replace'); 39 | }); 40 | 41 | // Default task(s). 42 | grunt.registerTask('default', ['release']); 43 | 44 | }; 45 | -------------------------------------------------------------------------------- /www/attributes/ic-confirm.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-confirm 4 | --- 5 | 6 |
7 | 8 |
9 |
10 | 11 |

ic-confirm - The Confirm Attribute

12 | 13 |

Summary

14 | 15 |

The ic-confirm attribute tells Intercooler to confirm the action with the user using the 16 | string of the attribute and the javascript confirm() function.

17 | 18 |

This can be useful when you want to confirm destructive operations, such as a delete.

19 | 20 |

Syntax

21 | 22 |

The value of the ic-verb attribute should be a string asking the user to confirm the given action.

23 | 24 |

Dependencies

25 | 26 |

The ic-confirm attribute has no effect on dependencies.

27 | 28 |

Example

29 | 30 |
31 |   <button ic-post-to="/target_url" ic-confirm="Are you sure?">Click Me!</button>
32 |       
33 | 34 | 35 |
36 | 46 | 47 |
48 | 49 | 50 |
51 |
52 |
-------------------------------------------------------------------------------- /www/attributes/ic-limit-children.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-limit-children 4 | --- 5 | 6 |
7 | 8 |
9 |
10 | 11 |

ic-limit-children - The Limit Children Attribute

12 | 13 |

Summary

14 | 15 |

The ic-limit-children allows you to limit the number of children an element can have 16 | after a ic-append-from or ic-prepend-from fires.

17 | 18 |

Syntax

19 | 20 |

The value of the attribute should be a valid integer.

21 | 22 |

Example

23 | 24 |

Here is a simple example, using a poll interval to update:

25 | 26 |
27 |   <ul ic-append-from="/list_src" ic-poll="2s" ic-limit-children="5"></ul>
28 |       
29 | 30 | 31 |
32 | 49 |
    50 |
    51 | 52 |
    53 |
    54 |
    -------------------------------------------------------------------------------- /www/tutorials/flash.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: tutorial 4 | --- 5 | 6 |
    7 | 8 |
    9 |
    10 | 11 |

    Making the Rails Flash Intercooler Friendly

    12 | 13 |

    This tutorial will show you how to make the Rails flash and IntercoolerJS play well together.

    14 | 15 |

    Video

    16 | 17 |
    18 | 19 |
    20 | 21 |

    Outline

    22 | 23 |

    Here are the basic steps

    24 | 25 |
      26 |
    • 27 | Extract your flash message content to a ERB partial, with a div around the partial include. 28 |
    • 29 |
    • 30 | Create a route to the partial that is rendered using the render :partial technique in rails. 31 |
    • 32 |
    • 33 | Make the surrounding div add new flash messages from the new route using the 34 | ic-append-from and 35 | ic-deps attributes. 36 |
    • 37 |
    38 | 39 |

    Git Diff

    40 | 41 |

    Here is a diff of the changes:

    42 | 43 | 44 | https://github.com/LeadDyno/intercooler-tutorial-app/commit/afba53a5d78b5d79ac352f83ddf62ee5585a7d5e 45 | 46 | 47 |
    48 |
    49 |
    -------------------------------------------------------------------------------- /www/tutorials/bulk_ops.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: tutorial 4 | --- 5 | 6 |
    7 | 8 |
    9 |
    10 | 11 |

    Bulk Operations

    12 | 13 |

    This tutorial will show you how to implement bulk operations on a table using IntercoolerJS.

    14 | 15 |

    Video

    16 | 17 |
    18 | 19 |
    20 | 21 |

    Outline

    22 | 23 |

    Here are the steps for implementing bulk operations

    24 | 25 |
      26 |
    • 27 | Extract a partial of the table and wrap it in a form that uses the ic-src attribute to 28 | re-render the table. Give the form a useful ID. 29 |
    • 30 |
    • 31 | Add bulk operation buttons that post to the same URL that the table sources from using the 32 | ic-post-to attribute, and include the 33 | checked rows by using the ic-post-to. 34 |
    • 35 |
    36 | 37 |

    Git Diff

    38 | 39 |

    Here is a diff showing what's necessary to implement the bulk operations:

    40 | 41 | 42 | https://github.com/LeadDyno/intercooler-tutorial-app/commit/0f3499cdf8896180fa50fe9dac48a88315d82256 43 | 44 | 45 |
    46 |
    47 |
    -------------------------------------------------------------------------------- /www/js/google-code-prettify/lang-vb.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0\u2028\u2029]+/,null,"\t\n\r \u00a0\u2028\u2029"],["str",/^(?:["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})(?:["\u201c\u201d]c|$)|["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})*(?:["\u201c\u201d]|$))/i,null,'"\u201c\u201d'],["com",/^['\u2018\u2019](?:_(?:\r\n?|[^\r]?)|[^\n\r_\u2028\u2029])*/,null,"'\u2018\u2019"]],[["kwd",/^(?:addhandler|addressof|alias|and|andalso|ansi|as|assembly|auto|boolean|byref|byte|byval|call|case|catch|cbool|cbyte|cchar|cdate|cdbl|cdec|char|cint|class|clng|cobj|const|cshort|csng|cstr|ctype|date|decimal|declare|default|delegate|dim|directcast|do|double|each|else|elseif|end|endif|enum|erase|error|event|exit|finally|for|friend|function|get|gettype|gosub|goto|handles|if|implements|imports|in|inherits|integer|interface|is|let|lib|like|long|loop|me|mod|module|mustinherit|mustoverride|mybase|myclass|namespace|new|next|not|notinheritable|notoverridable|object|on|option|optional|or|orelse|overloads|overridable|overrides|paramarray|preserve|private|property|protected|public|raiseevent|readonly|redim|removehandler|resume|return|select|set|shadows|shared|short|single|static|step|stop|string|structure|sub|synclock|then|throw|to|try|typeof|unicode|until|variant|wend|when|while|with|withevents|writeonly|xor|endif|gosub|let|variant|wend)\b/i, 2 | null],["com",/^rem\b.*/i],["lit",/^(?:true\b|false\b|nothing\b|\d+(?:e[+-]?\d+[dfr]?|[dfilrs])?|(?:&h[\da-f]+|&o[0-7]+)[ils]?|\d*\.\d+(?:e[+-]?\d+)?[dfr]?|#\s+(?:\d+[/-]\d+[/-]\d+(?:\s+\d+:\d+(?::\d+)?(\s*(?:am|pm))?)?|\d+:\d+(?::\d+)?(\s*(?:am|pm))?)\s+#)/i],["pln",/^(?:(?:[a-z]|_\w)\w*(?:\[[!#%&@]+])?|\[(?:[a-z]|_\w)\w*])/i],["pun",/^[^\w\t\n\r "'[\]\xa0\u2018\u2019\u201c\u201d\u2028\u2029]+/],["pun",/^(?:\[|])/]]),["vb","vbs"]); 3 | -------------------------------------------------------------------------------- /www/js/google-code-prettify/lang-sql.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/,null,"\"'"]],[["com",/^(?:--[^\n\r]*|\/\*[\S\s]*?(?:\*\/|$))/],["kwd",/^(?:add|all|alter|and|any|apply|as|asc|authorization|backup|begin|between|break|browse|bulk|by|cascade|case|check|checkpoint|close|clustered|coalesce|collate|column|commit|compute|connect|constraint|contains|containstable|continue|convert|create|cross|current|current_date|current_time|current_timestamp|current_user|cursor|database|dbcc|deallocate|declare|default|delete|deny|desc|disk|distinct|distributed|double|drop|dummy|dump|else|end|errlvl|escape|except|exec|execute|exists|exit|fetch|file|fillfactor|following|for|foreign|freetext|freetexttable|from|full|function|goto|grant|group|having|holdlock|identity|identitycol|identity_insert|if|in|index|inner|insert|intersect|into|is|join|key|kill|left|like|lineno|load|match|matched|merge|natural|national|nocheck|nonclustered|nocycle|not|null|nullif|of|off|offsets|on|open|opendatasource|openquery|openrowset|openxml|option|or|order|outer|over|partition|percent|pivot|plan|preceding|precision|primary|print|proc|procedure|public|raiserror|read|readtext|reconfigure|references|replication|restore|restrict|return|revoke|right|rollback|rowcount|rowguidcol|rows?|rule|save|schema|select|session_user|set|setuser|shutdown|some|start|statistics|system_user|table|textsize|then|to|top|tran|transaction|trigger|truncate|tsequal|unbounded|union|unique|unpivot|update|updatetext|use|user|using|values|varying|view|waitfor|when|where|while|with|within|writetext|xml)(?=[^\w-]|$)/i, 2 | null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^[_a-z][\w-]*/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'+\xa0-]*/]]),["sql"]); 3 | -------------------------------------------------------------------------------- /www/attributes/ic-indicator.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-indicator 4 | --- 5 | 6 |
    7 | 8 |
    9 |
    10 | 11 |

    ic-indicator - The Indicator Attribute

    12 | 13 |

    Summary

    14 | 15 |

    The indicator attribute can be used to show an indicator while a request is in process.

    16 | 17 |

    Syntax

    18 | 19 |

    The value of the attribute should be a valid selector of the indicator element to show

    20 | 21 |

    You can also use the ic-indicator CSS class on elements within an element 22 | to specify an indicator.

    23 | 24 |

    Finally, you can use the ic-indicator attribute on a parent of multiple elements, and all 25 | elements will use the parent indicator.

    26 | 27 |

    Example

    28 | 29 |

    Here is a simple example of an indicator next to a button:

    30 | 31 |
    32 |   <button ic-post-to="/target_url" ic-indicator="#indicator">
    33 |     Click Me!
    34 |   </button>
    35 | 
    36 |   <i id="indicator" class="fa fa-spinner fa-spin" style="display:none"></i>
    37 | 
    38 | 39 | 40 |
    41 | 51 | 52 | 55 | 56 | 57 |
    58 | 59 |
    60 |
    61 |
    -------------------------------------------------------------------------------- /www/tutorials/infinite.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: tutorial 4 | --- 5 | 6 |
    7 | 8 |
    9 |
    10 | 11 |

    Infinite Scroll

    12 | 13 |

    This tutorial will show you how to implement infinite scroll with only a few lines of IntercoolerJS.

    14 | 15 |

    Video

    16 | 17 |
    18 | 19 |
    20 | 21 |

    Outline

    22 | 23 |

    Here are the steps for implementing infinite scroll

    24 | 25 |
      26 |
    • 27 | Extract a partial of the row rendering for your table, and add an id to the enclosing tbody so 28 | we can target it for appending. 29 |
    • 30 |
    • 31 | Add an empty span to the last element in the table that uses the 32 | ic-append-from, 33 | ic-target, and 34 | ic-trigger-on 35 | attributes to trigger appending to the table body. 36 |
    • 37 |
    38 | 39 |

    Git Diff

    40 | 41 |

    Here is a diff between the will-paginate code and Intercooler code:

    42 | 43 | 44 | https://github.com/LeadDyno/intercooler-tutorial-app/commit/13daf988bc86c5da1e62fea8def155e3e8ea5307 45 | 46 | 47 |
    48 |
    49 |
    -------------------------------------------------------------------------------- /www/release/CHANGES-0.4.0.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: dependencies 4 | --- 5 | 6 |
    7 | 8 |

    Intercooler 0.4.0 Changes

    9 | 10 |

    Intercooler.js v0.4.0 was released on June 19th, 2014

    11 | 12 |

    Change List

    13 | 14 | 23 | 24 |

    Comments

    25 | 26 |

    27 | The big enhancement in this release (small code change, but big functionality boost!) is the X-IC-Trigger 28 | response header, which finally solves a tricky problem I've been wrestling with: How do you communicate server side state 29 | changes that have client-side UI ramifications that fall outside the usual Intercooler request-and-replace 30 | partial view flow? 31 |

    32 | 33 |

    This new mechanism allows you to cleanly separate your server side and client-side logic even in cases where the 34 | simple content-swapping approach isn't enough.

    35 | 36 |

    A great example is if you want to hide a modal if and only if a form in the modal submits valid data to the 37 | server. You can now easily fire an server.accountCreated event (as an example) from the server side 38 | and respond to that on the client side by hiding the modal. Clean, crisp and very little code!

    39 | 40 |

    You can download the latest intercooler.js from the Downloads page.

    41 | 42 |

    Enjoy!

    43 | 44 |
    45 | -------------------------------------------------------------------------------- /www/tutorials/inline_validation.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: tutorial 4 | --- 5 | 6 |
    7 | 8 |
    9 |
    10 | 11 |

    Inline Validation

    12 | 13 |

    This tutorial will show you how to implement inline server-side field validation in Rails with only a few lines 14 | of IntercoolerJS.

    15 | 16 |

    Video

    17 | 18 |
    19 | 20 |
    21 | 22 |

    Outline

    23 | 24 |

    Here are the steps for implementing inline validation

    25 | 26 |
      27 |
    • 28 | Extract a partial of the input div, and wrap it with a new div with an ID so 29 | we can target it for appending. 30 |
    • 31 |
    • 32 | Create an route that will render the partial input and implement non-updating validation 33 | in the controller. 34 |
    • 35 |
    • 36 | Add the ic-post-to annotation to the input and target the wrapping div with an 37 | ic-target annotation. To make the transition look right, use the ic-transition 38 | attribute with the value "none". 39 |
    • 40 |
    41 | 42 |

    Git Diff

    43 | 44 |

    Here's a diff between the standard rails form code and the IntercoolerJS inline validation version:

    45 | 46 | 47 | https://github.com/LeadDyno/intercooler-tutorial-app/commit/b94118fbb5cb0ccd065c6e27d316de3e29313bce 48 | 49 | 50 |
    51 |
    52 |
    -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Intercooler.js 2 | 3 | ## What it is 4 | 5 | Intercooler is a [PVC](http://intercoolerjs.org/why.html) framework that allows 6 | you to add AJAX to your application with declarative HTML5-style bindings and 7 | REST-ful URLs, giving web applications a richer UX with a minimum of code. 8 | 9 | ## What that means 10 | 11 | It makes AJAX simple, you don't even need to write any JavaScript! Here's an 12 | example of a basic `POST` request: 13 | 14 | // When this is clicked, a post request is sent to /example 15 | 18 | 19 | // When a post request is sent to /example, the response goes here 20 | 21 | 22 | ## How to use 23 | 24 | Intercooler depends on JQuery and can be installed like this: 25 | 26 | 27 | 28 | 29 | Or you can [download the latest 30 | version](http://intercoolerjs.org/download.html) and embed it locally. 31 | 32 | ## More examples 33 | 34 | ### Polling 35 | 36 | Send a `GET` request to "/visitors/count" every two seconds and update the 37 | innerHTML to the response: 38 | 39 |
    40 | There are currently 42 users online. 41 |
    42 | 43 | ### Adding input 44 | 45 | This AJAX includes the value of `#password` in it's request. 46 | 47 | Enter a password: 48 | 49 | 52 | 53 |
    54 | Your hashed password will go here 55 |
    56 | 57 | 58 | Learn more at [intercoolerjs.org](http://intercoolerjs.org) (there's lots 59 | more!). 60 | 61 | ## Versioning 62 | 63 | We have adopted [Semantic Versioning](http://semver.org/) for IntercoolerJS as of the 0.2.0 release. -------------------------------------------------------------------------------- /www/Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | aws-sdk (1.30.0) 5 | json (~> 1.4) 6 | nokogiri (>= 1.4.4) 7 | uuidtools (~> 2.1) 8 | blankslate (2.1.2.4) 9 | capistrano (2.15.4) 10 | highline 11 | net-scp (>= 1.0.0) 12 | net-sftp (>= 2.0.0) 13 | net-ssh (>= 2.0.14) 14 | net-ssh-gateway (>= 1.1.0) 15 | capistrano-s3 (0.2.7) 16 | aws-sdk 17 | capistrano 18 | mime-types 19 | classifier (1.3.3) 20 | fast-stemmer (>= 1.0.0) 21 | colorator (0.1) 22 | commander (4.1.5) 23 | highline (~> 1.6.11) 24 | fast-stemmer (1.0.2) 25 | ffi (1.9.3) 26 | highline (1.6.20) 27 | jekyll (1.4.2) 28 | classifier (~> 1.3) 29 | colorator (~> 0.1) 30 | commander (~> 4.1.3) 31 | liquid (~> 2.5.2) 32 | listen (~> 1.3) 33 | maruku (~> 0.7.0) 34 | pygments.rb (~> 0.5.0) 35 | redcarpet (~> 2.3.0) 36 | safe_yaml (~> 0.9.7) 37 | toml (~> 0.1.0) 38 | json (1.8.1) 39 | liquid (2.5.4) 40 | listen (1.3.1) 41 | rb-fsevent (>= 0.9.3) 42 | rb-inotify (>= 0.9) 43 | rb-kqueue (>= 0.2) 44 | maruku (0.7.0) 45 | mime-types (2.0) 46 | mini_portile (0.5.2) 47 | net-scp (1.1.2) 48 | net-ssh (>= 2.6.5) 49 | net-sftp (2.1.2) 50 | net-ssh (>= 2.6.5) 51 | net-ssh (2.7.0) 52 | net-ssh-gateway (1.2.0) 53 | net-ssh (>= 2.6.5) 54 | nokogiri (1.6.1) 55 | mini_portile (~> 0.5.0) 56 | parslet (1.5.0) 57 | blankslate (~> 2.0) 58 | posix-spawn (0.3.8) 59 | pygments.rb (0.5.4) 60 | posix-spawn (~> 0.3.6) 61 | yajl-ruby (~> 1.1.0) 62 | rb-fsevent (0.9.3) 63 | rb-inotify (0.9.3) 64 | ffi (>= 0.5.0) 65 | rb-kqueue (0.2.0) 66 | ffi (>= 0.5.0) 67 | redcarpet (2.3.0) 68 | safe_yaml (0.9.7) 69 | toml (0.1.0) 70 | parslet (~> 1.5.0) 71 | uuidtools (2.1.4) 72 | yajl-ruby (1.1.0) 73 | 74 | PLATFORMS 75 | ruby 76 | 77 | DEPENDENCIES 78 | capistrano (= 2.15.4) 79 | capistrano-s3 80 | jekyll 81 | -------------------------------------------------------------------------------- /www/attributes/ic-delete-from.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-delete-from 4 | --- 5 | 6 |
    7 | 8 |
    9 |
    10 | 11 |

    ic-delete-from - The Delete-To Attribute

    12 | 13 |

    Summary

    14 | 15 |

    The ic-delete-from attribute binds the default action (see below) of HTML element to a 16 | DELETE to the given URL. For example, on a button, when the button is clicked, an 17 | AJAX DELETE will be issued to the given URL.

    18 | 19 | {% include action_common.html %} 20 | 21 |

    Syntax

    22 | 23 |

    The value of the attribute should be a valid relative path (e.g. ic-delete-from="/foo/bar").

    24 | 25 |

    Dependencies

    26 | 27 |

    ic-delete-from implies a dependency on its path, and Intercooler will issue requests for elements 28 | whenever it detects an action that the path depends on. See Dependencies for 29 | more information.

    30 | 31 |

    Example

    32 | 33 |

    Here is a simple example, with a span that depends on the updated URL:

    34 | 35 |
    36 |         <button class="btn btn-lg btn-primary" ic-delete-from="/delete_me">Delete Me!</button>
    37 |       
    38 | 39 | 40 |
    41 | 57 | 58 |
    59 | 60 |
    61 |
    62 |
    -------------------------------------------------------------------------------- /www/attributes/ic-put-to.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-put-to 4 | --- 5 | 6 |
    7 | 8 |
    9 |
    10 | 11 |

    ic-put-to - The Put-To Attribute

    12 | 13 |

    Summary

    14 | 15 |

    The ic-put-to attribute binds the default action (see below) of HTML element to a 16 | PUT to the given URL. For example, on a button, when the button is clicked, an 17 | AJAX PUT will be issued to the given URL.

    18 | 19 | {% include action_common.html %} 20 | 21 |

    Syntax

    22 | 23 |

    The value of the attribute should be a valid relative path (e.g. ic-put-to="/foo/bar").

    24 | 25 |

    Dependencies

    26 | 27 |

    ic-put-to implies a dependency on its path, and Intercooler will issue requests for elements 28 | whenever it detects an action that the path depends on. See Dependencies for 29 | more information.

    30 | 31 |

    Example

    32 | 33 |

    Here is a simple example, with a span that depends on the updated URL:

    34 | 35 |
    36 |   <button ic-put-to="/target_url">Click Me!</button>
    37 | 
    38 |   <span ic-src="/target_url">You haven't clicked yet...</span>
    39 |       
    40 | 41 | 42 |
    43 | 57 | 58 | You haven't clicked yet... 59 |
    60 | 61 |
    62 |
    63 |
    -------------------------------------------------------------------------------- /www/attributes/ic-include.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-include 4 | --- 5 | 6 |
    7 | 8 |
    9 |
    10 | 11 |

    ic-include - The Include Attribute

    12 | 13 |

    Summary

    14 | 15 |

    The ic-include attribute tells Intercooler to include additional parameters in a request that 16 | it makes to the server, allowing you to pass up additional UI information to the server..

    17 | 18 |

    Syntax

    19 | 20 |

    The value of the ic-include attribute is a CSS/JQuery element selector.

    21 | 22 |

    Dependencies

    23 | 24 |

    ic-include has no effect on dependencies.

    25 | 26 |

    Example

    27 | 28 |

    In this example, the button includes the value of the input when it POSTs to the server.

    29 | 30 |
    31 |   <div ic-src="/update">Please Enter A Name...</div>
    32 |   <input id="name" name="name"/>
    33 |   <button ic-post-to="/update" ic-include="#name">Upload Name</button>
    34 |       
    35 | 36 |

    Note that the response to the button click is the content to swap in for the div, not the button.

    37 | 38 |
    39 | 57 |
    Please Enter A Name...
    58 | 59 | 60 |
    61 | 62 |
    63 |
    64 |
    -------------------------------------------------------------------------------- /www/attributes/ic-post-to.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-post-to 4 | --- 5 | 6 |
    7 | 8 |
    9 |
    10 | 11 |

    ic-post-to - The Post-To Attribute

    12 | 13 |

    Summary

    14 | 15 |

    The ic-post-to attribute binds the default action (see below) of HTML element to a 16 | POST to the given URL. For example, on a button, when the button is clicked, an 17 | AJAX POST will be issued to the given URL.

    18 | 19 | {% include action_common.html %} 20 | 21 |

    Syntax

    22 | 23 |

    The value of the attribute should be a valid relative path (e.g. ic-post-to="/foo/bar").

    24 | 25 |

    Dependencies

    26 | 27 |

    ic-post-to implies a dependency on its path, and Intercooler will issue requests for elements 28 | whenever it detects an action that the path depends on. See Dependencies for 29 | more information.

    30 | 31 |

    Example

    32 | 33 |

    Here is a simple example, with a span that depends on the updated URL:

    34 | 35 |
    36 |   <button ic-post-to="/target_url">Click Me!</button>
    37 | 
    38 |   <span ic-src="/target_url">You haven't clicked yet...</span>
    39 |       
    40 | 41 | 42 |
    43 | 57 | 58 | You haven't clicked yet... 59 |
    60 | 61 |
    62 |
    63 |
    -------------------------------------------------------------------------------- /www/attributes/ic-poll.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-poll 4 | --- 5 | 6 |
    7 | 8 |
    9 |
    10 | 11 |

    ic-poll - The Poll Attribute

    12 | 13 |

    Summary

    14 | 15 |

    The ic-poll attribute tells Intercooler to poll the URL given by a ic-src 16 | attribute on a given interval, updating the element if it has changed.

    17 | 18 |

    Note that Intercooler will not replace the element unless its SHA256 fingerprint has changed, to prevent 19 | blinky-blink UIs.

    20 | 21 |

    Also, you may find the ic-transition attribute useful 22 | if you wish to change how the result is swapped in.

    23 | 24 |

    Syntax

    25 | 26 |

    The value of the attribute should a valid integer, followed by the string "s" (for seconds) or "ms" (for 27 | milliseconds). (e.g. ic-poll="100ms" indicates that the server should be polled every 100 milliseconds.)

    28 | 29 |

    Dependencies

    30 | 31 |

    ic-poll has no dependency implications.

    32 | 33 |

    Example

    34 | 35 |

    Here is a simple example of a poll interval:

    36 | 37 |
    38 |   <div ic-src="/seconds" ic-poll="2s">You have been on this page for 0 seconds...</div>
    39 |       
    40 | 41 | 42 |
    43 | 55 |
    You have been on this page for 0 seconds...
    56 |
    57 | 58 |
    59 |
    60 |
    -------------------------------------------------------------------------------- /www/attributes/ic-trigger-on.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-trigger-on 4 | --- 5 | 6 |
    7 | 8 |
    9 |
    10 | 11 |

    ic-trigger-on - The Load On Attribute

    12 | 13 |

    Summary

    14 | 15 |

    The ic-trigger-on attribute tells Intercooler to load the content of a ic-src attribute 16 | when a given event occurs.

    17 | 18 |

    This can be used to implement infinite scrolling, lazy loading of elements, etc.

    19 | 20 |

    Syntax

    21 | 22 |

    The value of the attribute should be a valid JQuery event:

    23 | 24 | http://api.jquery.com/category/events/ 25 | 26 |

    Also supported is the special event scrolled-into-view, which will fire when an element 27 | first scrolls into view.

    28 | 29 |

    Dependencies

    30 | 31 |

    ic-target has no effect on dependencies..

    32 | 33 |

    Simple Example

    34 | 35 |

    Here is a simple button that updates a div on click:

    36 | 37 |
    38 |   <h2>Scroll Down To Load <i class="fa fa-arrow-down" style="margin-bottom:150%"></i> </h2>
    39 | 
    40 |   <h2 ic-src="/get_it" ic-trigger-on="scrolled-into-view">
    41 |     Not Loaded Yet...
    42 |   </h2>
    43 | 
    44 | 45 |

    Note that the response to the button click is the content to swap in for the div, not the button.

    46 | 47 |
    48 | 59 | 60 |

    Scroll Down To Load

    61 | 62 |

    63 | Not Loaded Yet... 64 |

    65 |
    66 | 67 | 68 |
    69 |
    70 |
    -------------------------------------------------------------------------------- /www/why.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: why 4 | --- 5 | 6 |
    7 | 8 |
    9 |
    10 | 11 |

    Why Use Intercooler?

    12 | 13 |

    The primary advantage of Intercooler is simplicity.

    14 | 15 |

    Using simple, declarative attributes you can build rich, interactive user 16 | interfaces in your application while avoiding the overhead (and sometimes, overkill) of 17 | MVC frameworks.

    18 | 19 |

    With intercooler.js, you don't need client-side models, routing, validation, rendering, factories, 20 | dependency injection, etc, eliminating a major source of complexity, inconsistency and 21 | security problems in your application.

    22 | 23 |

    How Does Intercooler Work?

    24 | 25 |

    Intercooler is a Partial View Controller framework: it communicates with the 26 | server via AJAX, but rather than using JSON responses, it uses fragments of HTML (i.e. Partial Views), 27 | which are then loaded into the DOM directly.

    28 | 29 |

    This is in contrast with older, more traditional MVC frameworks such as 30 | Ember.js or Angular.js, which use 31 | JSON and client-side rendering.

    32 | 33 |

    Here is a diagram showing a PVC request:

    34 | 35 |

    36 | 37 |

    38 | 39 |

    The AJAX response content is a partial bit of HTML, and it is swapped into the DOM directly.

    40 | 41 |

    Examples of some PVC frameworks are Turbolinks and 42 | pjax.

    43 | 44 |

    Intercooler formalizes this pattern using simple, declarative attributes, making PVC-style programing 45 | easy, flexible and fun.

    46 | 47 | 48 |

    Sound good? On to the Introduction →

    49 | 50 |
    51 |
    52 | 53 |
    -------------------------------------------------------------------------------- /www/attributes/ic-get-from.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-get-from 4 | --- 5 | 6 |
    7 | 8 |
    9 |
    10 | 11 |

    ic-get-from - The Post-To Attribute

    12 | 13 |

    Summary

    14 | 15 |

    The ic-get-from attribute binds the default action (see below) of HTML element to a 16 | GET to the given URL. For example, on a button, when the button is clicked, an 17 | AJAX GET will be issued to the given URL.

    18 | 19 | {% include action_common.html %} 20 | 21 |

    Syntax

    22 | 23 |

    The value of the attribute should be a valid relative path (e.g. ic-get-from="/foo/bar").

    24 | 25 |

    Dependencies

    26 | 27 |

    ic-get-from implies a dependency on its path, and Intercooler will issue requests for elements 28 | whenever it detects an action that the path depends on. See Dependencies for 29 | more information.

    30 | 31 |

    Example

    32 | 33 |

    Here is a simple example, with a span that depends on the updated URL:

    34 | 35 |
    36 |   <button ic-get-from="/target_url" ic-target="#target-span">
    37 |     Click Me!
    38 |   </button>
    39 | 
    40 |   <span id="target-span">
    41 |     You haven't clicked yet...
    42 |   </span>
    43 | 
    44 | 45 | 46 |
    47 | 58 | 59 | 64 | 65 | 66 | You haven't clicked yet... 67 | 68 |
    69 | 70 |
    71 |
    72 |
    -------------------------------------------------------------------------------- /www/attributes/ic-style-src.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-style-src 4 | --- 5 | 6 |
    7 | 8 |
    9 |
    10 | 11 |

    ic-style-src - The Style Source Attribute

    12 | 13 |

    Summary

    14 | 15 |

    The ic-style-src attribute binds a given HTML element's style attribute to a URL. It does not cause any 16 | requests to happen by itself, but it can respond to events caused by other attributes.

    17 | 18 |

    When Intercooler issues a request for an element with an ic-style-src, it will issue a GET 19 | and will replace the current element's style value with resulting text fragment.

    20 | 21 |

    Syntax

    22 | 23 |

    The value of the attribute should be a valid style attribute name, followed by a colon, then a valid relative 24 | path 25 | (e.g. ic-style-src="color:/foo/bar").

    26 | 27 |

    Dependencies

    28 | 29 |

    ic-style-src implies a mutation to any dependency on its path, and Intercooler will issue 30 | GET requests for elements that depend on that path after the POST completes.

    31 | 32 |

    See Dependencies for more information.

    33 | 34 |

    Example

    35 | 36 |

    Here is a simple example, using a poll interval to update:

    37 | 38 |
    39 |   <div ic-style-src="color:/color" ic-poll="200ms">I'm turning red!</div>
    40 |       
    41 | 42 | 43 |
    44 | 57 |
    Help! I'm turning red!
    58 |
    59 | 60 |
    61 |
    62 |
    -------------------------------------------------------------------------------- /www/tutorials/click_to_load.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: tutorial 4 | --- 5 | 6 |
    7 | 8 |
    9 |
    10 | 11 |

    Click To Load

    12 | 13 |

    This tutorial will show you how to implement "Click To Load" behavior with only a few lines of IntercoolerJS. 14 | It builds on the previous Infinite Scroll tutorial.

    15 | 16 |

    Video

    17 | 18 |
    19 | 20 |
    21 | 22 |

    Outline

    23 | 24 |

    Here are the steps for implementing inifinite scroll

    25 | 26 |
      27 |
    • 28 | Extract a partial of the row rendering for your table, and add an id to the enclosing tbody so 29 | we can target it for appending. 30 |
    • 31 |
    • 32 | Add a hidden input to the last row of the table that is rendered, with the name page and 33 | value of the next page to load 34 |
    • 35 |
    • 36 | Add a button after the table that uses the 37 | ic-append-from, 38 | ic-target, and 39 | ic-trigger-on 40 | attributes to trigger appending to the table body, and that includes the hidden input using the 41 | ic-include tag to include the last hidden 42 | input in the table. 43 |
    • 44 |
    45 | 46 |

    Git Diff

    47 | 48 |

    Here is a diff between infinite scroll and click-to-load:

    49 | 50 | 51 | https://github.com/LeadDyno/intercooler-tutorial-app/commit/11322f35cda1a7c9fa480f845b43cb28e162f64a 52 | 53 | 54 |
    55 |
    56 |
    -------------------------------------------------------------------------------- /www/attributes/ic-deps.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-deps 4 | --- 5 | 6 |
    7 | 8 |
    9 |
    10 | 11 |

    ic-deps - The Dependencies Attribute

    12 | 13 |

    Summary

    14 | 15 |

    The ic-deps attribute tells Intercooler that an element depends on a given path and should be 16 | updated if a change to that path is detected.

    17 | 18 |

    Syntax

    19 | 20 |

    The value of the ic-deps attribute is a comma-separated list of paths that the element depends on. 21 | Note that the special single character "*" indicates that an element depends on all detected 22 | changed.

    23 | 24 |

    Dependencies

    25 | 26 |

    ic-deps adds the dependencies it specifies to the element it is on.

    27 | 28 |

    Example

    29 | 30 |

    Here is a simple element that depends on any changes:

    31 | 32 |
    33 |   <button ic-post-to="/path/1">Button 1</button>
    34 |   <button ic-post-to="/path/2">Button 2</button>
    35 |   <div ic-src="/src" ic-deps="*">0 Clicks</div>
    36 |       
    37 | 38 | 39 |
    40 | 68 | 69 | 70 |
    0 Clicks
    71 |
    72 | 73 |
    74 |
    75 |
    -------------------------------------------------------------------------------- /www/tutorials/crud.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: tutorial 4 | --- 5 | 6 |
    7 | 8 |
    9 |
    10 | 11 |

    Adding AJAX to a Rails CRUD UI With Intercooler

    12 | 13 |

    This tutorial will show you how to add AJAX to a Rails CRUD UI using Intercooler.

    14 | 15 |

    Video

    16 | 17 |
    18 | 19 |
    20 | 21 |

    Outline

    22 | 23 |

    Here are the steps for converting a Rails CRUD UI into an AJAX UI

    24 | 25 |
      26 |
    • 27 | Add a reference to the the IntercoolerJS library from the download page. 28 |
    • 29 |
    • 30 | Update the edit button to use the ic-get-from and 31 | ic-target attributes. 32 |
    • 33 |
    • 34 | Update the controller to not render layouts for intercooler requests by using the ic-request 35 | parameter. 36 |
    • 37 |
    • 38 | Update the save button to use the ic-put-to and 39 | ic-target attributes. 40 |
    • 41 |
    • 42 | Update the controller's update method to render partials correct.y 43 |
    • 44 |
    • 45 | Set the location of the browser using the X-IC-SetLocation header. 46 |
    • 47 |
    • 48 | Update the new and create UI and controller code in a similar manner. 49 |
    • 50 |
    51 | 52 |

    Git Diff

    53 | 54 |

    Here is a diff between the standard Rails code and Intercooler-powered code:

    55 | 56 | 57 | https://github.com/LeadDyno/intercooler-tutorial-app/commit/b425ad671746c34039bd84fc76bb7c11d6537b24 58 | 59 | 60 |
    61 |
    62 |
    -------------------------------------------------------------------------------- /www/attributes/ic-attr-src.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-attr-src 4 | --- 5 | 6 |
    7 | 8 |
    9 |
    10 | 11 |

    ic-attr-src - The Attribute Source Attribute

    12 | 13 |

    Summary

    14 | 15 |

    The ic-attr-src attribute binds a given HTML element's attribute to a URL. It does not cause any 16 | requests to happen by itself, but it can respond to events caused by other attributes.

    17 | 18 |

    When Intercooler issues a request for an element with an ic-attr-src, it will issue a GET 19 | and will replace the current element attribute value with resulting text fragment.

    20 | 21 |

    Syntax

    22 | 23 |

    The value of the attribute should be a valid attribute name, followed by a colon, then a valid relative 24 | path 25 | (e.g. ic-attr-src="style:/foo/bar").

    26 | 27 |

    Dependencies

    28 | 29 |

    ic-attr-src implies a dependency on its path, and Intercooler will issue requests for elements 30 | whenever it detects an action that the path depends on. See Dependencies for 31 | more information.

    32 | 33 |

    Example

    34 | 35 |

    Here is a simple example, using a poll interval to update:

    36 | 37 |
    38 |   <div ic-style-src="style:/style" ic-poll="1s">Cause you move to a different sound</div>
    39 |       
    40 | 41 | 42 |
    43 | 64 |
    Cause you move to a different sound
    65 |
    66 | 67 |
    68 |
    69 |
    -------------------------------------------------------------------------------- /www/attributes/ic-src.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-src 4 | --- 5 | 6 |
    7 | 8 |
    9 |
    10 | 11 |

    ic-src - The Source Attribute

    12 | 13 |

    Summary

    14 | 15 |

    The ic-src attribute binds a given HTML element to a URL. It does not cause any requests to happen 16 | by itself, but it can respond to events caused by other attributes, such as 17 | ic-poll or 18 | ic-post-to.

    19 | 20 |

    When Intercooler issues a request for an element with an ic-src, it will issue a GET 21 | and will replace the current elements content with resulting HTML fragment, if it is different than the 22 | current content.

    23 | 24 |

    Syntax

    25 | 26 |

    The value of the attribute should be a valid relative path (e.g. ic-src="/foo/bar").

    27 | 28 |

    The value of the attribute may also include a fragment identifier (e.g. ic-src="/foo#bar"). 29 | In this case, everything on the page except the element whose ID matches the fragment identifier is ignored.

    30 | 31 |

    Dependencies

    32 | 33 |

    ic-src implies a dependency on its path, and Intercooler will issue requests for elements 34 | whenever it detects an action that the path depends on. See Dependencies for 35 | more information.

    36 | 37 |

    Example

    38 | 39 |

    Here is a simple example, using a poll interval to update:

    40 | 41 |
    42 |   <div ic-src="/seconds" ic-poll="5s">You have been on this page for 0 seconds...</div>
    43 |       
    44 | 45 | 46 |
    47 | 59 |
    You have been on this page for 0 seconds...
    60 |
    61 | 62 |
    63 |
    64 |
    65 | -------------------------------------------------------------------------------- /www/css/site.css: -------------------------------------------------------------------------------- 1 | .body-wrapper { 2 | margin-top: 55px !important; 3 | } 4 | 5 | .jumbotron { 6 | padding-bottom:32px !important; 7 | padding-top: 42px !important; 8 | } 9 | 10 | h1, h2, h3, h4 { 11 | font-family: 'Crete Round', 'Helvetica Neue', Helvetica, Arial, sans-serif; 12 | } 13 | 14 | .navbar-brand { 15 | padding-top: 20px; 16 | font-family: 'Crete Round', 'Helvetica Neue', Helvetica, Arial, sans-serif; 17 | font-size: 16pt; 18 | } 19 | 20 | p { 21 | font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; 22 | font-size: 14pt; 23 | } 24 | 25 | ul { 26 | margin-top: 16px; 27 | margin-bottom: 16px; 28 | } 29 | 30 | li { 31 | font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; 32 | font-size: 13pt; 33 | margin-top: 4px; 34 | } 35 | 36 | body { 37 | font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; 38 | font-size: 14pt; 39 | } 40 | 41 | .red { 42 | color: red; 43 | } 44 | 45 | .live-demo { 46 | position: relative; 47 | border: 1px solid #d3d3d3; 48 | border-radius: 5px; 49 | padding: 28px; 50 | margin: 36px; 51 | } 52 | 53 | .live-demo:before { 54 | position: absolute; 55 | content: "Live Demo"; 56 | font-weight: bold; 57 | top: -15px; 58 | left: 10px; 59 | padding: 2px 4px; 60 | background-color: white; 61 | } 62 | 63 | pre { 64 | width: 70%; 65 | margin: 8px auto; 66 | } 67 | 68 | code { 69 | color: #008800; 70 | background-color: #f5f5f5; 71 | } 72 | 73 | .navbar-nav>li>a { 74 | padding-left: 10px; 75 | padding-right: 10px; 76 | } 77 | 78 | .tutorial-overview { 79 | padding: 8px 12px; 80 | } 81 | 82 | .intercooler-dot { 83 | color: #26628E; 84 | } 85 | .intercooler-js { 86 | color: #8EB3D0; 87 | } 88 | 89 | #icon1 { 90 | margin-right:24px; 91 | display: inline-block; 92 | } 93 | 94 | #icon2 { 95 | display: none; 96 | } 97 | 98 | #little-lib { 99 | font-size: 14px; 100 | position: relative; 101 | top: 12px; 102 | left: -12px 103 | } 104 | 105 | @media (max-width: 992px) { 106 | #icon1 { 107 | display: none; 108 | } 109 | 110 | #icon2 { 111 | height: 60px; 112 | margin-right: 10px; 113 | display: inline-block; 114 | } 115 | 116 | #little-lib { 117 | font-size: 14px; 118 | position: inherit; 119 | display: block; 120 | margin-top: 14px; 121 | } 122 | } 123 | 124 | @media screen and (min-width: 0px) and (max-width: 992px) { 125 | .jumbotron h1, .jumbotron .h1 { 126 | font-size: 40px; 127 | } 128 | } -------------------------------------------------------------------------------- /www/tutorials/index.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: tutorial 4 | --- 5 | 6 |
    7 | 8 |
    9 |
    10 | 11 |

    Intercooler Tutorials

    12 | 13 |

    Tutorial 0: Using Intercooler and Turbolinks

    14 | 15 |
    16 |

    To use intercooler with Turbolinks in Rails, you will need to enable the jquery-turbolinks gem. 17 |

    18 | 19 |

    See this 21 | diff on 22 | github for the template.

    23 |
    24 | 25 |

    Tutorial 1: Adding AJAX To A Rails CRUD UI

    26 | 27 |
    28 |

    This tutorial will show you how to add AJAX to a Rails CRUD UI using IntercoolerJS.

    29 | 30 | Go To Tutorial... 31 |
    32 | 33 |

    Tutorial 2: Making the Rails Flash Work

    34 | 35 |
    36 |

    This tutorial will show you how to fix the Rails flash so that it works properly in IntercoolerJS.

    37 | 38 | Go To Tutorial... 39 |
    40 | 41 |

    Tutorial 3: Infinite Scroll

    42 | 43 |
    44 |

    This tutorial will show you how to implement infinite scroll in IntercoolerJS.

    45 | 46 | Go To Tutorial... 47 |
    48 | 49 |

    Tutorial 4: Click To Load

    50 | 51 |
    52 |

    This tutorial converts the previous infinite scroll UI into a click-based "Load More" UI.

    53 | 54 | Go To Tutorial... 55 |
    56 | 57 |

    Tutorial 5: Bulk Operations

    58 | 59 |
    60 |

    This tutorial shows you how to update multiple rows in a table UI using IntercoolerJS.

    61 | 62 | Go To Tutorial... 63 |
    64 | 65 |

    Tutorial 6: Inline Validation

    66 | 67 |
    68 |

    This tutorial shows you how to implement inline server-side validation of input using IntercoolerJS.

    69 | 70 | Go To Tutorial... 71 |
    72 | 73 |
    74 |
    75 |
    -------------------------------------------------------------------------------- /www/attributes/ic-append-from.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-append-from 4 | --- 5 | 6 |
    7 | 8 |
    9 |
    10 | 11 |

    ic-append-from - The Append From Attribute

    12 | 13 |

    Summary

    14 | 15 |

    The ic-append-from attribute binds a given HTML element's children to a URL. It does not 16 | cause any requests to happen by itself, but it can respond to events caused by other attributes.

    17 | 18 |

    When Intercooler issues a request for an element with an ic-append-from, it will issue a 19 | GET 20 | and will append the resulting HTML fragment as children of the current element. If you wish to limit the total 21 | number of children on of an element, you can use the ic-limit-children 23 | attribute.

    24 | 25 |

    Note that with these attributes, you will often want to take advantage of the ic-last-refresh parameter 26 | that Intercooler includes in its requests. See Requests & Responses for more information.

    27 | 28 |

    Syntax

    29 | 30 |

    The value of the attribute should be a valid relative path (e.g. ic-append-from="/foo/bar").

    31 | 32 |

    Dependencies

    33 | 34 |

    ic-append-from implies a dependency on its path, and Intercooler will issue requests for elements 35 | whenever it detects an action that the path depends on. See Dependencies for 36 | more information.

    37 | 38 | 39 |

    Example

    40 | 41 |

    Here is a simple example, using a poll interval to update:

    42 | 43 |
    44 |   <ul ic-append-from="/list_src" ic-poll="2s" ic-limit-children="5"></ul>
    45 |       
    46 | 47 | 48 |
    49 | 66 |
      67 |
      68 | 69 |
      70 |
      71 |
      -------------------------------------------------------------------------------- /www/attributes/ic-prepend-from.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-prepend-from 4 | --- 5 | 6 |
      7 | 8 |
      9 |
      10 | 11 |

      ic-prepend-from - The Prepend From Attribute

      12 | 13 |

      Summary

      14 | 15 |

      The ic-prepend-from attribute binds a given HTML element's children to a URL. It does not 16 | cause any requests to happen by itself, but it can respond to events caused by other attributes.

      17 | 18 |

      When Intercooler issues a request for an element with an ic-prepend-from, it will issue a 19 | GET 20 | and will prepend the resulting HTML fragment as children of the current element. If you wish to limit the total 21 | number of children on of an element, you can use the ic-limit-children 23 | attribute.

      24 | 25 |

      Note that with these attributes, you will often want to take advantage of the ic-last-refresh parameter 26 | that Intercooler includes in its requests. See Requests & Responses for more information.

      27 | 28 |

      Syntax

      29 | 30 |

      The value of the attribute should be a valid relative path (e.g. ic-prepend-from="/foo/bar").

      31 | 32 |

      Dependencies

      33 | 34 |

      ic-prepend-from implies a dependency on its path, and Intercooler will issue requests for elements 35 | whenever it detects an action that the path depends on. See Dependencies for 36 | more information.

      37 | 38 | 39 |

      Example

      40 | 41 |

      Here is a simple example, using a poll interval to update:

      42 | 43 |
      44 |   <ul ic-prepend-from="/list_src" ic-poll="2s" ic-limit-children="5"></ul>
      45 |       
      46 | 47 | 48 |
      49 | 66 |
        67 |
        68 | 69 |
        70 |
        71 |
        -------------------------------------------------------------------------------- /www/dependencies.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: dependencies 4 | --- 5 |
        6 | 7 |
        8 |
        9 | 10 |

        Intercooler Dependencies

        11 | 12 |

        One of the novel features of Intercooler is its dependency framework. This is how Intercooler figures out 13 | what elements to refresh and when, based on user input, poll intervals, etc.

        14 | 15 |

        The core concept in Intercooler is to use server paths to encode dependencies. The idea is fairly 16 | straight forward, given a REST-ful understanding of web addressses:

        17 | 18 |
        If an element reads its value (i.e. issues a GET) from a given server path, and 19 | an action updates that path (i.e. issues a POST to it), then we should refresh the 20 | element after the action occurs.
        21 | 22 |

        So, as a simple example, consider this button and div:

        23 | 24 |
         25 | 
         26 |   <button ic-post-to="/example/path">A Button</button>
         27 | 
         28 |   <div ic-src="/example/path">A Div</div>
         29 |      
        30 | 31 |

        Here the div depends on the button, because they share a path with one another. When 32 | Intercooler issues a POST to the given path (on a user click), upon completion, 33 | it will issue a GET to the same path, and replace the div with the new content, if it 34 | is different. 35 |

        36 | 37 |

        What Paths Depend On What?

        38 | 39 |

        It's all very simple when the POST and GET are to the same path, but what if 40 | they aren't? What if the post is to /jobs/2341/start and the get is from /jobs/2341? 41 | Or vice-versa?

        42 | 43 |

        Our answer is as follows:

        44 | 45 |
        Two server paths express a dependency if either path is the starting path of the other.
        46 | 47 |

        So:

        48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 |
        Path UpdatedPath ReadDependency?
        /foo/barNO
        /foo/fooYES
        /foo/bar/fooYES
        /foo/foo/barYES
        /foo/foo#barYES
        /foo/doh/foo/barNO
        /foo#doh/foo#barNO
        95 | 96 |

        Explicit Dependencies

        97 | 98 |

        The dependencies above are managed implicitly by Intercooler and, with reasonable layout of your restful 99 | URLs, should handle many cases. However, there are inevitably going to be times when you need to 100 | express dependencies explicitly. In Intercooler, you can use the 101 | ic-deps attribute to express additional paths that an 102 | element depends on.

        103 | 104 |
        105 |
        106 | 107 |
        108 | -------------------------------------------------------------------------------- /www/attributes/ic-target.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-target 4 | --- 5 | 6 |
        7 | 8 |
        9 |
        10 | 11 |

        ic-target - The Target Attribute

        12 | 13 |

        Summary

        14 | 15 |

        The ic-target attribute tells Intercooler the response from a request should be used to replace 16 | a different element than the current one. This is commonly used with action attributes, for example to make 17 | a button replace a div in the UI.

        18 | 19 |

        Syntax

        20 | 21 |

        The value of the ic-target attribute should be a valid CSS/JQuery selector.

        22 | 23 |

        Dependencies

        24 | 25 |

        ic-target has no effect on dependencies..

        26 | 27 |

        Button Example

        28 | 29 |

        Here is a simple button that updates a div on click:

        30 | 31 |
         32 |   <div id="target">0 Clicks</div>
         33 |   <button ic-post-to="/update" ic-target="#target">Update Div</button>
         34 |       
        35 | 36 |

        Note that the response to the button click is the content to swap in for the div, not the button.

        37 | 38 |
        39 | 51 |
        0 Clicks
        52 | 53 |
        54 | 55 |

        Input Example

        56 | 57 |

        Here is an example of an input that posts its input to the server to validate it, replacing the 58 | enclosing div (using standard Boostrap error classes.)

        59 | 60 |
         61 |   <div id="emailDiv">
         62 |     <div class="form-group">
         63 |       <label class="control-label">Enter Email:</label>
         64 |       <input type="text" class="form-control" name="email" ic-post-to="/verify_email" ic-target="#emailDiv">
         65 |     </div>
         66 |   </div>
         67 | 
        68 | 69 | 70 |
        71 | 91 | 92 |
        93 |
        94 | 95 | 96 |
        97 |
        98 | Tab out of the input to trigger a post... 99 |
        100 | 101 |
        102 |
        103 |
        -------------------------------------------------------------------------------- /www/download.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: download 4 | --- 5 |
        6 | 7 |
        8 |
        9 |

        Downloads

        10 |
        11 |
        12 | 13 |
        14 |
        15 |

        S3 latest

        16 |
         17 | 
         18 |   <script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
         19 |   <script src="https://s3.amazonaws.com/intercoolerjs.org/release/intercooler-0.4.1.min.js">
         20 |   </script>
         21 |       
        22 |
        23 |
        24 | 25 |
        26 |
        27 |

        Releases

        28 | 67 | 76 |
        77 |
        78 | 79 |
        80 |
        81 |

        Newsgroup

        82 |

        83 | https://groups.google.com/forum/#!forum/intercooler-js 84 |

        85 |
        86 |
        87 | 88 |
        89 |
        90 |

        Github

        91 |

        92 | https://github.com/LeadDyno/intercooler-js 93 |

        94 |
        95 |
        96 | 97 |
        98 |
        99 |

        Rails Demo Application

        100 |

        101 | Source: https://github.com/LeadDyno/intercooler-js-demo-rails-app 102 |

        103 |

        104 | On Heroku: http://intercoolerjs.herokuapp.com/ (Running on a single free dyno, probably slammed... :)) 105 |

        106 |
        107 |
        108 | 109 |
        -------------------------------------------------------------------------------- /www/index.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 |
        5 |
        6 |
        7 |
        8 | 9 |
        10 |
        11 |

        12 | intercooler.js 13 |

        14 | 15 |

        16 | Add AJAX to your web application using simple, declarative HTML attributes. 17 |

        18 | 19 |
        20 |
        21 |
        22 |
        23 | 24 | 45 | 46 | 47 | 48 |
        49 |
        50 |
        51 |
        52 | Intercooler v0.4.1 has been released! Join our newsgroup to stay up to date. 53 |
        54 |
         55 |   <-- This button posts to the /example/click
         56 |          URL when it is clicked -->
         57 |   <button ic-post-to="/example/click">
         58 |     Click Me!
         59 |   </button>
         60 | 
         61 |   <-- This span is bound to a URL that returns an updated
         62 |       version of the span when the button is clicked -->
         63 |   <span ic-src="/example/click">
         64 |      You have not yet clicked the button
         65 |   </span>
         66 | 		      
        67 | 68 | 69 |
        70 | 88 |   89 | You have not yet clicked the button 90 |
        91 | 92 |
        93 |
        94 |
        95 | 96 |
        97 | 98 |
        99 |
        100 | 101 |
        102 |

        Declarative

        103 | 104 |

        With Intercooler you can use easy to understand, declarative attributes to bind your HTML elements to 105 | AJAX end points.

        106 | 107 |

        Intercooler is a pragmatic library, however, so you can drop into javascript when it's necessary.

        108 |
        109 | 110 |
        111 |

        Incremental

        112 | 113 |

        You can use Intercooler for as much or as little of your application as you like.

        114 | 115 |

        No need to wholesale adopt a new framework to start adding AJAX functionality to your application!

        116 |
        117 | 118 |
        119 |

        Plays Well With Others

        120 | 121 |

        Intercooler is a little library built to play well with other web technologies, like AngularJS, EmberJS and Turbolinks.

        122 | 123 |

        Use the right tool for the particular job: Intercooler won't get in the way.

        124 | 125 |
        126 | 127 |
        128 |
        129 | 130 |
        131 |
        132 |
        133 |

        Dependency Detection

        134 | 135 |

        Intercooler uses pattern matching in your URLs to detect and refresh dependencies between HTML 136 | elements. Typically it will do the right thing without much work on your part. And, if you need 137 | to add or ignore dependencies, Intercooler allows you to do that as well.

        138 |
        139 | 140 |
        141 | 142 |

        Framework Agnostic

        143 | 144 |

        Although it was inspired by Partials 145 | in Rails, IntercoolerJS works equally well with any back end platform.

        146 | 147 |

        IntercoolerJS works great with any HTML/CSS framework, but was designed with Bootstrap 148 | in mind, making it easy to create dynamic UIs using the standard, simple Bootstrap techniques.

        149 |
        150 | 151 | 152 |
        153 |

        Open

        154 | 155 |

        IntercoolerJS was designed to be open and extensible so, when push comes to shove, you can customise 156 | pretty much any part of the it you need to.

        157 |
        158 |
        159 |
        160 | 161 | 162 | -------------------------------------------------------------------------------- /www/extending.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: extending 4 | --- 5 |
        6 | 7 |
        8 |
        9 |

        Intercooler JS API

        10 | 11 |

        Intercooler has a few different extension points. You can call a few direct methods on the global 12 | Intercooler object, and you can also listen for intercooler related events.

        13 | 14 |

        API

        15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 28 | 53 | 54 | 55 | 58 | 64 | 65 | 66 | 69 | 80 | 81 | 82 | 85 | 88 | 89 | 90 |
        MethodDescription
        26 | Intercooler.defineTransition(transition) 27 | 29 | Lets you add a new transtion, which should implement the newContent, remove, 30 | hide and show methods: 31 |
         32 |   Intercooler.defineTransition('fadeSlow', {
         33 |       newContent : function(parent, newContent, isReverse, after){
         34 |         parent.fadeOut('slow', function(){
         35 |           parent.html(newContent);
         36 |           after();
         37 |           parent.fadeIn('slow');
         38 |         })
         39 |       },
         40 |       remove : function(elt) {
         41 |         elt.fadeOut('slow', function(){ elt.remove(); })
         42 |       },
         43 |       show : function(elt) {
         44 |         elt.fadeIn('slow');
         45 |       },
         46 |       hide : function(elt) {
         47 |         elt.fadeOut('slow');
         48 |       }
         49 |     });
         50 | 
         51 | 
        52 |
        56 | Intercooler.defaultTransition(name) 57 | 59 | Lets you set the default transition to use 60 |
         61 |   Intercooler.defaultTransition('none');
         62 | 
        63 |
        67 | Intercooler.addURLHandler(handler) 68 | 70 | Lets you add a client side mock URL handler for testing/prototyping: 71 |
         72 |   Intercooler.addURLHandler({
         73 |     'url': '/update',
         74 |     'get' : function() {
         75 |       return 'Here's some content!"
         76 |     },
         77 |   });
         78 | 
        79 |
        83 | Intercooler.refresh(eltOrPath) 84 | If the argument is an element, it will issue a new AJAX request. If it is a string path, it will issue 86 | a request for all dependent elements. 87 |
        91 | 92 |

        Events

        93 | 94 |

        Intercooler fires the following events on elements:

        95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 108 | 112 | 113 | 114 | 117 | 120 | 121 | 122 | 125 | 128 | 129 | 130 | 133 | 137 | 138 | 139 | 142 | 145 | 146 | 147 | 150 | 153 | 154 | 155 | 158 | 161 | 162 | 163 | 166 | 169 | 170 | 171 |
        EventDescription
        106 | log.ic(evt, msg, level, elt) 107 | 109 | Event fired when log messages occur internally in intercooler (can be used to debug specific 110 | DOM elements.) 111 |
        115 | beforeHeaders.ic(evt, elt, xhr) 116 | 118 | Triggered before intercooler headers are processed. 119 |
        123 | afterHeaders.ic(evt, elt, xhr) 124 | 126 | Triggered after intercooler headers are processed. 127 |
        131 | beforeSend.ic(evt, elt, data) 132 | 134 | Triggered before sending an intercooler AJAX request to the server. The second argument to the event is 135 | the data hash, and can be added or removed from to change the values sent to the server. 136 |
        140 | success.ic(evt, elt, data, textStatus, xhr) 141 | 143 | Triggered after a successful intercooler request is received 144 |
        148 | error.ic(evt, elt, req, status, str) 149 | 151 | Triggered after an error occurs during an intercooler request 152 |
        156 | complete.ic(evt, elt, data) 157 | 159 | Triggered after an intercooler request completes, regardless of status 160 |
        164 | onPoll.ic(evt, elt) 165 | 167 | Triggered before a poll request is dispatched 168 |
        172 | 173 |

        Example

        174 | 175 |

        Here is some code that uses the BlockUI library to block the UI when an intercooler request 176 | is in flight:

        177 | 178 |
        179 |         $(function(){
        180 |           $('.btn').on('beforeSend.ic', function(){
        181 |             $.blockUI();
        182 |           }).on('complete.ic', function(){
        183 |             $.unblockUI();
        184 |           });
        185 |         })
        186 |       
        187 | 188 |
        189 |
        190 | 191 |
        -------------------------------------------------------------------------------- /www/_layouts/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | intercooler.js - Simple, declarative AJAX using HTML attributes 18 | 19 | 20 | 21 | 22 | 23 | 26 | 27 | 28 | 29 | 33 | 34 | 35 | 36 | 42 | 43 | 44 | 45 | 46 | 47 |
        48 | 112 |
        113 | 114 |
        115 | {{content}} 116 |
        117 | 118 |
        119 |
        120 | 126 |
        127 | 135 | 136 | 137 | -------------------------------------------------------------------------------- /www/attributes/all.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > all 4 | --- 5 | 6 |
        7 | 8 |
        9 |
        10 |

        Intercooler.JS Attribute Reference

        11 |
        12 |
        13 | 14 |
        15 |
        16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 31 | 32 | 33 | 34 | 39 | 40 | 41 | 42 | 47 | 48 | 49 | 50 | 52 | 53 | 54 | 55 | 56 | 58 | 59 | 60 | 61 | 62 | 64 | 65 | 66 | 67 | 68 | 73 | 74 | 75 | 76 | 77 | 82 | 83 | 84 | 85 | 86 | 91 | 92 | 93 | 94 | 95 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 111 | 112 | 113 | 114 | 115 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 133 | 134 | 135 | 136 | 137 | 139 | 140 | 141 | 142 | 143 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 156 | 157 | 158 | 159 |
        AttributeDescription
        ic-srcThis attribute allows you to bind an element to a given URL. Once it is bound, when a change occurs that 28 | Intercooler recognizes as affecting the URL (or given an event such as a poll), Intercooler will issue 29 | a GET to the URL and replace the element with the new content, if it is different. 30 |
        ic-style-srcLike ic-src, this attribute allows you bind to a URL. However, this attribute binds a 35 | style attribute to a URL. The syntax is "style-attribute:url". For 36 | example, 37 | to bind the color of an element to "/color/random", you would say 38 | ic-style-src="color:/color/random"
        ic-attr-srcLike ic-style-src, this attribute allows you bind to a URL. However, this attribute binds 43 | an attribute value to a URL. The syntax is "attribute:url". For 44 | example, 45 | to bind the style of an element to "/style/random", you would say 46 | ic-attr-src="style:/style/random"
        ic-prepend-fromWhen triggered this attribute will issue a GET and prepend all content returned to the 51 | children of the element it is on.
        ic-append-fromWhen triggered this attribute will issue a GET and append all content returned to the 57 | children of the element it is on.
        ic-limit-childrenLimits the number of children that an element is allowed to have after an ic-prepend-from or 63 | ic-append-from fires.
        ic-get-fromThis attribute allows you to bind the "action" of an element to a given URL. Once it is bound, when an 69 | "action" occurs (e.g. clicking a button) Intercooler will issue 70 | a GET to the URL and replace the element with the new content, if it is different. 71 | Intercooler will detect any other elements that the GET effects and automatically refresh them. 72 |
        ic-post-toThis attribute allows you to bind the "action" of an element to a given URL. Once it is bound, when an 78 | "action" occurs (e.g. clicking a button) Intercooler will issue 79 | a POST to the URL and replace the element with the new content, if it is different. 80 | Intercooler will detect any other elements that the POST effects and automatically refresh them. 81 |
        ic-put-toThis attribute allows you to bind the "action" of an element to a given URL. Once it is bound, when an 87 | "action" occurs (e.g. clicking a button) Intercooler will issue 88 | a PUT to the URL and replace the element with the new content, if it is different. 89 | Intercooler will detect any other elements that the PUT effects and automatically refresh them. 90 |
        ic-delete-fromThis attribute allows you to bind the "action" of an element to a given URL. Once it is bound, when an 96 | "action" occurs (e.g. clicking a button) Intercooler will issue 97 | a DELETE to the URL and replace the element with the new content, if it is different. 98 | Intercooler will detect any other elements that the DELETE effects and automatically refresh them. 99 |
        ic-confirmThis attribute can be used to confirm an action with a user before proceeding.
        ic-targetThis attribute is often used with an action attribute (e.g. ic-post-to) in order to target 110 | the content of another element for replacement.
        ic-includeA selector attribute that can be used to include additional input with an action request (e.g. can be 116 | used to include a form with an unrelated button.)
        ic-transitionControls the transition used when replacing an element.
        ic-indicatorThis attribute can be used to show a progress indicator while an Intercooler AJAX request is in flight.
        ic-pollThis attribute tells Intercooler to poll the source URL for the element it is on in a given interval, 132 | expressed as milliseconds or seconds. (e.g. '500ms' or '2s')
        ic-trigger-onThis attributes changes the event on which the element is loaded via ic-src. It can be 138 | used to implement lazy loading of images or charts, infinite scrolling, etc.
        ic-depsThis attribute allows you to express additional path dependencies for a given element, beyond the 144 | implied ones.
        ic-verbThis attribute allows you to override the HTTP verb to use in a request.
        ic-always-updateThis attribute allows force an element to always update the DOM with content after an intercooler 155 | request, even if the content is identical to the current DOM content.
        160 | 161 | 162 |
        163 |
        164 | 165 |
        -------------------------------------------------------------------------------- /www/responses.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: responses 4 | --- 5 |
        6 | 7 |
        8 |
        9 | 10 |

        Intercooler Requests & Responses

        11 | 12 |

        Intercooler makes AJAX requests to various paths when certain events occur (e.g. A button with a 13 | ic-post-to attribute is clicked, or a polling interval occurs.) and expects a response 14 | of a certain format (typically an HTML fragment). Below we describe both the request and response formats.

        15 | 16 |

        Intercooler Requests

        17 | 18 |

        19 | Intercooler requests can come take four different forms: 20 |

        21 | 22 |
          23 |
        • GET - Typically created due to a refresh of an ic-src attribute.
        • 24 |
        • POST - Created by an element with a ic-post-to attribute.
        • 25 |
        • PUT - Created by an element with a ic-put-to attribute.
        • 26 |
        • DELETE - Created by an element with a ic-delete-from attribute.
        • 27 |
        28 | 29 |

        30 | Because not all browsers support PUT and DELETE requests in AJAX, Intercooler 31 | uses the Rails convention and adds a _method parameter to the request. 32 |

        33 | 34 |

        Standard Parameters

        35 | 36 |

        37 | Intercooler requests include a few standard parameters: 38 |

        39 | 40 |
          41 |
        • ic-request - This will always be true for Intercooler-based requests.
        • 42 |
        • ic-last-refresh - This is a timestamp of the last time the target element was refreshed. 43 | This can be used to calculate time-sensitive UI updates (e.g. appending to a list of messages.)
        • 44 |
        • ic-fingerprint - The SHA256 fingerprint of the current content. This can be used to avoid 45 | sending down unnecessary updates, caching, etc.
        • 46 |
        47 | 48 |

        Request Headers

        49 | 50 |

        51 | Intercooler requests include a few request headers: 52 |

        53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 66 | 69 | 70 | 71 | 74 | 78 | 79 | 80 |
        HeaderDescription
        64 | X-IC-Request 65 | 67 | Set to true 68 |
        72 | X-HTTP-Method-Override 73 | 75 | Set to the HTTP Method type (e.g. DELETE) for the request, to communicate the actual 76 | request type to the server if it cannot be directly supported by the client. 77 |
        81 | 82 | 83 |

        Additional Parameters

        84 | 85 |

        86 | Also included in the request is the form value of the element that is initiating the request. So, if 87 | the element is an input, it will include its name/value in the request. If it is a form, it will include 88 | the names/values of all inputs within the form. 89 |

        90 | 91 |

        92 | You can also include other parameters using the ic-include attribute. 93 |

        94 | 95 |

        Intercooler Responses

        96 | 97 |

        Intercooler responses are typically HTML fragments. In the typical case, a fragment of HTML will be returned. 98 | Here is a simple example of a response body:

        99 | 100 |
        101 | 
        102 |   <div>Here Is Some Content!<div>
        103 |       
        104 | 105 |

        This would be swapped in as the body of the element that initiated the request.

        106 | 107 |

        The returned content can contain Intercooler attributes itself, which will be all wired up.

        108 | 109 |

        You can control the exact style of the swap using the 110 | ic-transition attribute, and you can 111 | control the element that will be swapped out via the request by using the 112 | ic-target attribute.

        113 | 114 |

        Empty Bodies

        115 | 116 |

        Intercooler interprets an empty body in a request as a No-Op, and will do nothing in response.

        117 | 118 | 119 |

        Intercooler HTTP Response Headers

        120 | 121 |

        Sadly, not all UI patterns can be elegantly captured via straight element swapping. Occasionally 122 | you need to invoke a bit more client side javascript, let other elements know to refresh themselves, 123 | redirect the user entirely, etc.

        124 | 125 |

        To handle these situations, Intercooler responses have at their disposal some custom HTTP headers. These 126 | headers can be used to instruct intercooler to perform additional work : 127 |

        128 | 129 |

        The following Intercooler response headers are available:

        130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 143 | 147 | 148 | 149 | 152 | 157 | 158 | 159 | 162 | 165 | 166 | 167 | 170 | 173 | 174 | 175 | 178 | 181 | 182 | 183 | 186 | 189 | 190 | 191 | 194 | 197 | 198 | 199 | 202 | 205 | 206 | 207 | 210 | 213 | 214 | 215 | 218 | 221 | 222 | 223 |
        HeaderDescription
        141 | X-IC-Trigger 142 | 144 | Allows you to trigger a JQuery event handler on the client 145 | side 146 |
        150 | X-IC-Trigger-Data 151 | 153 | Allows you to pass JSON data to the event triggered by the X-IC-Trigger header. Note that 154 | extraParameters passed to the event are treated as an argument list if the data is a JSON 155 | array. See the JQuery trigger() documentation for more information. 156 |
        160 | X-IC-Refresh 161 | 163 | A comma separated list of dependency paths to refresh. 164 |
        168 | X-IC-Redirect 169 | 171 | Causes a client-side redirect to the given URL. 172 |
        176 | X-IC-Script 177 | 179 | Allows you to evaluate arbitrary javascript. 180 |
        184 | X-IC-CancelPolling 185 | 187 | Cancels any polling associated with the target element. 188 |
        192 | X-IC-Open 193 | 195 | Opens a new window at the given location. 196 |
        200 | X-IC-SetLocation (Experimental) 201 | 203 | Pushes a new location (still in development) 204 |
        208 | X-IC-Transition 209 | 211 | Overrides the elements normal transition. 212 |
        216 | X-IC-Remove 217 | 219 | Removes the target element. 220 |
        224 | 225 | 226 |
        227 |
        228 | 229 |
        -------------------------------------------------------------------------------- /test/sandbox.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Intercooler.JS - The Javascript-optional AJAX library 12 | 13 | 14 | 15 | 16 | 17 | 20 | 21 | 22 | 23 | 27 | 28 | 29 | 35 | 36 | 54 | 55 | 56 | 57 | 58 |
        59 |
        60 |

        IntercoolerJS Sandbox

        61 |
        62 | 63 |
        64 | 65 |
        66 |
        67 | 68 |

        Sample

        69 | 70 | Polling interval: 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 |
        NameCount
        Foo1
        86 |
        87 |
        88 | 89 | 256 |
        257 | 258 |
        259 |
        260 |
        261 |
        262 |
        263 |
        264 |
        265 |
        266 | 267 | 268 | -------------------------------------------------------------------------------- /www/examples.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: examples 4 | --- 5 | 92 | 93 |
        94 | 95 |
        96 |
        97 |

        Intercooler.JS Examples

        98 |

        Below are some examples of Intercooler functionality, each with a working demo below the code sample.

        99 |
        100 |
        101 | 102 |
        103 |
        104 | 105 |

        Polling

        106 |

        This is a simple div that polls an http endpoint for updates every 1 second

        107 | 108 |

        Code

        109 |
        110 |   <div ic-src="/polling_div" ic-poll="1s">Sample Polling Div. Value is 0</div>
        111 |       
        112 | 113 |

        Live Example

        114 | 115 |
        Sample Polling Div. Value is 0
        116 |
        117 |
        118 | 119 |
        120 | 121 |
        122 |
        123 |

        Manual Update

        124 | 125 |

        This is a div that is refreshed explicitly using events and the Intercooler library

        126 | 127 |

        Code

        128 |
        129 | 
        130 |   <div id="manual-update" ic-src="/manual_div">Sample Manual Div. Value is 0</div>
        131 |   <button onclick="Intercooler.refresh($('#manual-update'));">Update It!</button>
        132 |       
        133 | 134 |

        Live Example

        135 | 136 |
        Sample Manual Div. Value is 0
        137 | 138 |
        139 |
        140 | 141 |
        142 | 143 |
        144 |
        145 |

        Dependency Detection

        146 | 147 |

        This is a div that is refreshed automatically when the button is clicked due to the fact that it depends 148 | on a URL that the button targets for update.

        149 | 150 |

        Code

        151 |
        152 | 
        153 |         <div ic-src="/dependency_div">Sample Dependency Dectection. You have clicked 0 times</div>
        154 |         <button ic-post-to="/dependency_div">Increment Counter</button>
        155 |       
        156 | 157 |

        Live Example

        158 | 159 |
        Sample Dependency Dectection. You have clicked 0 times
        160 | 161 |
        162 |
        163 | 164 |
        165 | 166 |
        167 |
        168 |

        CSS Value Targeting

        169 | 170 |

        You may want to target the value of an style attribute with an endpoint for a smoother UI experience. Below is an 171 | example targeting the 'width' attribute of the style on the progress bar, allowing for smooth easing as it updates.

        172 | 173 |

        Code

        174 |
        175 | 
        176 |   <div class="progress progress-striped active">
        177 |     <div class="progress-bar" ic-style-src="width:/progress_bar" ic-poll="2s" style="width:1%"></div>
        178 |   </div>
        179 |       
        180 | 181 |

        Live Example

        182 | 183 |
        184 |
        185 |
        186 |
        187 |
        188 | 189 |
        190 | 191 |
        192 |
        193 |

        Attribute Value Targeting

        194 | 195 |

        You may want to target the value of an attribute with an endpoint for a smoother UI experience. Below 196 | we update the entire style block of the element

        197 |

        Code

        198 |
        199 | 
        200 |   <div class="progress progress-striped active">
        201 |     <div class="progress-bar" ic-attr-src="style:/attr_update" ic-poll="2s" style="width:1%">Here is some text!</div>
        202 |   </div>
        203 |       
        204 | 205 |

        Live Example

        206 | 207 |
        Here is some text!
        208 |
        209 |
        210 | 211 |
        212 | 213 |
        214 |
        215 |

        Input Binding Example

        216 | 217 |

        This example binds two inputs to two different endpoints. The div below them then depends on a parent path, but sources from 218 | a different URL. When you change the value in the inputs (tab out) the div below will update.

        219 | 220 |

        Code

        221 |
        222 |   <form role="form">
        223 |     <div class="form-group">
        224 |       <label>First Name</label>
        225 |       <input type="text" name="first_name" class="form-control" placeholder="Enter Your First Name" ic-post-to="/contacts/1/first_name">
        226 |     </div>
        227 |     <div class="form-group">
        228 |       <label>Last Name</label>
        229 |       <input type="text" name="last_name" class="form-control" placeholder="Enter Your Last Name" ic-post-to="/contacts/1/last_name">
        230 |     </div>
        231 |   </form>
        232 |   <div ic-src="/contacts/1/info_div" ic-deps="/contacts/1">Nothing Entered Yet...</div>
        233 |       
        234 | 235 |

        Live Example

        236 |
        237 |
        238 | 239 | 240 |
        241 |
        242 | 243 | 244 |
        245 |
        246 |
        Nothing Entered Yet...
        247 |
        248 |
        249 | 250 |
        251 | 252 |
        253 |
        254 |

        Input Validation Example

        255 | 256 |

        Intercooler.js makes it easy to do incremental inline form element validations against your server. Below 257 | is an example that will only allow properly formatted emails.

        258 | 259 |

        Code

        260 |
        261 |   <div class="form-group" ic-post-to="/contacts/2/email" ic-transition="none">
        262 |     <label>Enter An Email</label>
        263 |     <input type="text" name="email" class="form-control" placeholder="Enter An Email">
        264 |   </div>
        265 |       
        266 | 267 |

        Live Example

        268 |
        269 |
        270 | 271 | 272 |
        273 |
        274 |
        275 |
        276 | 277 |
        278 | 279 |
        280 |
        281 |
        282 |
        283 |
        284 |
        285 |
        -------------------------------------------------------------------------------- /www/release/intercooler-0.0.1-prealpha-1.min.js: -------------------------------------------------------------------------------- 1 | /*! intercooler 0.0.1-prealpha-1 2014-02-17 */ 2 | "use strict";var Intercooler=Intercooler||function(){function fp(a){return CryptoJS.SHA1(a.html()).toString()}function levelPrefix(a){return a==_DEBUG?"IC DEBUG: ":a==_INFO?"IC INFO: ":a==_WARN?"IC WARN: ":a==_ERROR?"IC ERROR: ":"IC UNKNOWN: "}function log(a,b){var c=b||_INFO,d=_loggingLevel||_ERROR;_logger&&c>=d&&(null==_loggingGrep||_loggingGrep.test(a))&&_logger.log(levelPrefix(c),a)}function uuid(){var a=(new Date).getTime(),b="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(a+16*Math.random())%16|0;return a=Math.floor(a/16),("x"==b?c:7&c|8).toString(16)});return b}function icSelectorFor(a){return"[ic-id='"+a.attr("ic-id")+"']"}function parseInterval(a){return log("POLL: Parsing interval string "+a,_DEBUG),"null"==a||"false"==a||""==a?null:a.lastIndexOf("ms")==a.length-2?parseInt(a.substr(0,a.length-2)):a.lastIndexOf("s")==a.length-1?1e3*parseInt(a.substr(0,a.length-1)):1e3}function getTarget(a){return a.attr("ic-target")?$(a.attr("ic-target")):a}function processHeaders(elt,xhr){if(xhr.getResponseHeader("X-ic-refresh")){var pathsToRefresh=xhr.getResponseHeader("X-ic-refresh").split(",");log("IC HEADER: refreshing "+pathsToRefresh,_DEBUG),$.each(pathsToRefresh,function(a,b){refreshDependencies(b.replace(/ /g,""),elt)})}else if(xhr.getResponseHeader("X-ic-script"))log("IC HEADER: evaling "+xhr.getResponseHeader("X-ic-script"),_DEBUG),eval(xhr.getResponseHeader("X-ic-script"));else if(xhr.getResponseHeader("X-ic-redirect"))log("IC HEADER: redirecting to "+xhr.getResponseHeader("X-ic-redirect"),_DEBUG),window.location=xhr.getResponseHeader("X-ic-redirect");else if(xhr.getResponseHeader("X-ic-open"))log("IC HEADER: opening "+xhr.getResponseHeader("X-ic-open"),_DEBUG),window.open(xhr.getResponseHeader("X-ic-open"));else if(xhr.getResponseHeader("X-ic-remove")&&(log("IC HEADER REMOVE COMMAND"),elt)){var target=getTarget(elt);log("IC REMOVING: "+target.html(),_DEBUG),"none"==target.attr("ic-transition")?target.remove():target.fadeOut("fast",function(){target.remove()})}return!0}function handleTestResponse(a,b,c){var d={};c&&c.headers&&(d=c.headers);var e="";c&&("string"==typeof c||c instanceof String?e=c:("string"==typeof c.body||c.body instanceof String)&&(e=c.body)),processHeaders(a,{getResponseHeader:function(a){return d[a]}}),b(e,"",a)}function handleRemoteRequest(a,b,c,d,e){"PUT"==b&&(d+="&_method=PUT"),"DELETE"==b&&(d+="&_method=DELETE");for(var f=0,g=_urlHandlers.length;g>f;f++){var h=_urlHandlers[f],i=null;if(null==h.url||new RegExp(h.url.replace(/\*/g,".*").replace(/\//g,"\\/")).test(c))return"GET"==b&&h.get&&(h.get&&(i=h.get(c,parseParams(d))),handleTestResponse(a,e,i)),"POST"==b&&(h.post&&(i=h.post(c,parseParams(d))),handleTestResponse(a,e,i)),"PUT"==b&&(h.put&&(i=h.put(c,parseParams(d))),handleTestResponse(a,e,i)),"DELETE"==b&&(h.delete&&(i=h.delete(c,parseParams(d))),handleTestResponse(a,e,i)),void 0}_remote.ajax({type:b,url:c,data:d,dataType:"text",success:function(b,c,d){processHeaders(a,d)&&e(b,c,a,d)},error:function(a,b,c){log("An error occurred: "+c,_ERROR)}})}function parseParams(a){var b,c=/([^&=]+)=?([^&]*)/g,d=function(a){return decodeURIComponent(a.replace(/\+/g," "))},e={};if(a)for("?"==a.substr(0,1)&&(a=a.substr(1));b=c.exec(a);){var f=d(b[1]),g=d(b[2]);void 0!==e[f]?($.isArray(e[f])||(e[f]=[e[f]]),e[f].push(g)):e[f]=g}return e}function processInclude(str){if(0==str.indexOf("$"))return eval(str).serialize();if(str.indexOf(":")){var name=str.split(":")[0],val=str.split(":")[1],result=eval(val);if(result)return encodeURIComponent(name)+"="+encodeURIComponent(result.toString())}return""}function processIncludes(a){for(var b="",c=a.split(","),d=0,e=c.length;e>d;d++)b+="&"+processInclude(c[d]);return b}function getParametersForElement(a){var b=getTarget(a),c="ic-request=true";return c+=a.closest("form").length>0?"&"+a.closest("form").serialize():"&"+a.serialize(),b.attr("id")&&(c+="&ic-element-id="+b.attr("id")),b.attr("name")&&(c+="&ic-element-name="+b.attr("name")),b.attr("ic-id")&&(c+="&ic-id="+b.attr("ic-id")),b.attr("ic-id")&&(c+="&ic-id="+b.attr("ic-id")),b.attr("ic-last-refresh")&&(c+="&ic-last-refresh="+b.attr("ic-last-refresh")),b.attr("ic-fingerprint")&&(c+="&ic-fingerprint="+b.attr("ic-fingerprint")),a.attr("ic-include")&&(c+=processIncludes(a.attr("ic-include"))),log("PARAMS: Returning parameters "+c+" for "+a),c}function maybeSetIntercoolerInfo(a){var b=getTarget(a);if(!b.data("ic-id")){var c=fp(a),d=uuid(),e=(new Date).getTime();b.attr("ic-id",d),b.attr("ic-last-refresh",e),b.attr("ic-fingerprint",c)}}function withAttrs(a,b){$.each(a,function(a,c){b(c)})}function processSources(a){withAttrs(_SRC_ATTRS,function(b){$(a).is("["+b+"]")&&maybeSetIntercoolerInfo($(a)),$(a).find("["+b+"]").each(function(){maybeSetIntercoolerInfo($(this))})})}function startPolling(a){var b=parseInterval(a.attr("ic-poll"));if(null!=b){var c=icSelectorFor(a);log("POLL: Starting poll for element "+c,_DEBUG);var d=setInterval(function(){var a=$(c);0==a.length?(log("POLL: Clearing poll for element "+c,_DEBUG),clearTimeout(d)):updateElement(a)},b)}}function processPolling(a){$(a).is("[ic-poll]")&&(maybeSetIntercoolerInfo($(a)),startPolling(a)),$(a).find("[ic-poll]").each(function(){maybeSetIntercoolerInfo($(this)),startPolling($(this))})}function isDependent(a,b){return a&&b&&(0==b.indexOf(a)||0==a.indexOf(b))}function refreshDependencies(a,b){withAttrs(_SRC_ATTRS,function(c){$("["+c+"]").each(function(){isDependent(a,$(this).attr(c))?(null==b||$(b)[0]!=$(this)[0])&&updateElement($(this)):(isDependent(a,$(this).attr("ic-deps"))||"*"==$(this).attr("ic-deps"))&&(null==b||$(b)[0]!=$(this)[0])&&updateElement($(this))})})}function verbFor(a){return"ic-post-to"==a?"POST":"ic-put-to"==a?"PUT":"ic-delete-from"==a?"DELETE":"POST"}function initButtonDestination(a,b){var c=$(a).attr(b);$(a).click(function(d){d.preventDefault(),handleRemoteRequest(a,verbFor(b),c,getParametersForElement(a),function(b){processICResponse(b,a),refreshDependencies(c)})})}function initInputDestination(a,b){var c=$(a).attr(b);$(a).change(function(){handleRemoteRequest(a,verbFor(b),c,getParametersForElement(a),function(b){processICResponse(b,a),refreshDependencies(c)})})}function initDestination(a,b){$(a).is("button, a, div, span")?initButtonDestination(a,b):$(a).is("input, select")&&initInputDestination(a,b)}function processDestinations(a){withAttrs(_DEST_ATTRS,function(b){$(a).is("["+b+"]")&&(maybeSetIntercoolerInfo($(a)),initDestination(a,b)),$(a).find("["+b+"]").each(function(){maybeSetIntercoolerInfo($(this)),initDestination($(this),b)})})}function processNodes(a){processSources(a),processPolling(a),processDestinations(a)}function processICResponse(a,b){if(a&&""!=a){log("IC RESPONSE: Received: "+a,_DEBUG);var c=$(a),d=getTarget(b);maybeSetIntercoolerInfo(c),c.attr("ic-fingerprint")!=d.attr("ic-fingerprint")?"none"==d.attr("ic-transition")?(d.replaceWith(c),processNodes(c),log("IC RESPONSE: Replacing "+d.html()+" with "+c.html(),_DEBUG)):d.fadeOut("fast",function(){c.hide(),d.replaceWith(c),log("IC RESPONSE: Replacing "+d.html()+" with "+c.html(),_DEBUG),processNodes(c),c.fadeIn("slow")}):c.remove()}}function updateElement(a){var b=a;if(b.attr("ic-src"))handleRemoteRequest(a,"GET",b.attr("ic-src"),getParametersForElement(b),function(a){processICResponse(a,b)});else if(b.attr("ic-text-src"))handleRemoteRequest(a,"GET",b.attr("ic-text-src"),getParametersForElement(b),function(a){a!=b.text()&&b.fadeOut("fast",function(){b.text(a),b.fadeIn("fast")})});else if(b.attr("ic-prepend-from"))handleRemoteRequest(a,"GET",b.attr("ic-prepend-from"),getParametersForElement(b),function(a){var c=$(a);if(c.is("tr")?c.children().hide():c.hide(),b.prepend(c),log("elt is "),log(b),c.is("tr")?c.children().slideDown():c.slideDown(),processNodes(c),b.attr("ic-limit-children")){var d=parseInt(b.attr("ic-limit-children"));b.children().length>d&&b.children().slice(d,b.children().length).remove()}});else if(b.attr("ic-append-from"))handleRemoteRequest(a,"GET",b.attr("ic-append-from"),getParametersForElement(b),function(a){var c=$(a);if(c.hide(),b.append(c),c.is("tr")?c.children().slideDown():c.slideDown(),processNodes(c),b.attr("ic-limit-children")){var d=parseInt(b.attr("ic-limit-children"));b.children().length>d&&b.children().slice(0,b.children().length-d).remove()}});else if(b.attr("ic-style-src")){var c=b.attr("ic-style-src").split(":");handleRemoteRequest(a,"GET",c[1],getParametersForElement(b),function(a){b.css(c[0],a)})}else if(b.attr("ic-attr-src")){var d=b.attr("ic-attr-src").split(":");handleRemoteRequest(a,"GET",d[1],getParametersForElement(b),function(a){b.attr(d[0],a)})}}var _DEBUG=1,_INFO=2,_WARN=3,_ERROR=4,_SRC_ATTRS=["ic-src","ic-style-src","ic-attr-src","ic-prepend-from","ic-append-from","ic-text-src"],_DEST_ATTRS=["ic-post-to","ic-put-to","ic-delete-from"],_remote=$,_urlHandlers=[],_logger=window.console,_loggingLevel=null,_loggingGrep=null,CryptoJS=CryptoJS||function(a,b){var c={},d=c.lib={},e=function(){},f=d.Base={extend:function(a){e.prototype=this;var b=new e;return a&&b.mixIn(a),b.hasOwnProperty("init")||(b.init=function(){b.$super.init.apply(this,arguments)}),b.init.prototype=b,b.$super=this,b},create:function(){var a=this.extend();return a.init.apply(a,arguments),a},init:function(){},mixIn:function(a){for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}},g=d.WordArray=f.extend({init:function(a,c){a=this.words=a||[],this.sigBytes=c!=b?c:4*a.length},toString:function(a){return(a||i).stringify(this)},concat:function(a){var b=this.words,c=a.words,d=this.sigBytes;if(a=a.sigBytes,this.clamp(),d%4)for(var e=0;a>e;e++)b[d+e>>>2]|=(c[e>>>2]>>>24-8*(e%4)&255)<<24-8*((d+e)%4);else if(65535e;e+=4)b[d+e>>>2]=c[e>>>2];else b.push.apply(b,c);return this.sigBytes+=a,this},clamp:function(){var b=this.words,c=this.sigBytes;b[c>>>2]&=4294967295<<32-8*(c%4),b.length=a.ceil(c/4)},clone:function(){var a=f.clone.call(this);return a.words=this.words.slice(0),a},random:function(b){for(var c=[],d=0;b>d;d+=4)c.push(4294967296*a.random()|0);return new g.init(c,b)}}),h=c.enc={},i=h.Hex={stringify:function(a){var b=a.words;a=a.sigBytes;for(var c=[],d=0;a>d;d++){var e=b[d>>>2]>>>24-8*(d%4)&255;c.push((e>>>4).toString(16)),c.push((15&e).toString(16))}return c.join("")},parse:function(a){for(var b=a.length,c=[],d=0;b>d;d+=2)c[d>>>3]|=parseInt(a.substr(d,2),16)<<24-4*(d%8);return new g.init(c,b/2)}},j=h.Latin1={stringify:function(a){var b=a.words;a=a.sigBytes;for(var c=[],d=0;a>d;d++)c.push(String.fromCharCode(b[d>>>2]>>>24-8*(d%4)&255));return c.join("")},parse:function(a){for(var b=a.length,c=[],d=0;b>d;d++)c[d>>>2]|=(255&a.charCodeAt(d))<<24-8*(d%4);return new g.init(c,b)}},k=h.Utf8={stringify:function(a){try{return decodeURIComponent(escape(j.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data")}},parse:function(a){return j.parse(unescape(encodeURIComponent(a)))}},l=d.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new g.init,this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=k.parse(a)),this._data.concat(a),this._nDataBytes+=a.sigBytes},_process:function(b){var c=this._data,d=c.words,e=c.sigBytes,f=this.blockSize,h=e/(4*f),h=b?a.ceil(h):a.max((0|h)-this._minBufferSize,0);if(b=h*f,e=a.min(4*b,e),b){for(var i=0;b>i;i+=f)this._doProcessBlock(d,i);i=d.splice(0,b),c.sigBytes-=e}return new g.init(i,e)},clone:function(){var a=f.clone.call(this);return a._data=this._data.clone(),a},_minBufferSize:0});d.Hasher=l.extend({cfg:f.extend(),init:function(a){this.cfg=this.cfg.extend(a),this.reset()},reset:function(){l.reset.call(this),this._doReset()},update:function(a){return this._append(a),this._process(),this},finalize:function(a){return a&&this._append(a),this._doFinalize()},blockSize:16,_createHelper:function(a){return function(b,c){return new a.init(c).finalize(b)}},_createHmacHelper:function(a){return function(b,c){return new m.HMAC.init(a,c).finalize(b)}}});var m=c.algo={};return c}(Math);return function(){var a=CryptoJS,b=a.lib,c=b.WordArray,d=b.Hasher,e=[],b=a.algo.SHA1=d.extend({_doReset:function(){this._hash=new c.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(a,b){for(var c=this._hash.words,d=c[0],f=c[1],g=c[2],h=c[3],i=c[4],j=0;80>j;j++){if(16>j)e[j]=0|a[b+j];else{var k=e[j-3]^e[j-8]^e[j-14]^e[j-16];e[j]=k<<1|k>>>31}k=(d<<5|d>>>27)+i+e[j],k=20>j?k+((f&g|~f&h)+1518500249):40>j?k+((f^g^h)+1859775393):60>j?k+((f&g|f&h|g&h)-1894007588):k+((f^g^h)-899497514),i=h,h=g,g=f<<30|f>>>2,f=d,d=k}c[0]=c[0]+d|0,c[1]=c[1]+f|0,c[2]=c[2]+g|0,c[3]=c[3]+h|0,c[4]=c[4]+i|0},_doFinalize:function(){var a=this._data,b=a.words,c=8*this._nDataBytes,d=8*a.sigBytes;return b[d>>>5]|=128<<24-d%32,b[(d+64>>>9<<4)+14]=Math.floor(c/4294967296),b[(d+64>>>9<<4)+15]=c,a.sigBytes=4*b.length,this._process(),this._hash},clone:function(){var a=d.clone.call(this);return a._hash=this._hash.clone(),a}});a.SHA1=d._createHelper(b),a.HmacSHA1=d._createHmacHelper(b)}(),$(function(){processNodes("body")}),{refresh:function(a){return updateElement(a),Intercooler},addURLHandler:function(a){if(!a.url)throw"Handlers must include a URL pattern";return _urlHandlers.push(a),Intercooler},setRemote:function(a){return _remote=a,Intercooler},setLogger:function(a,b,c){return _logger=a,b&&(_loggingLevel=b),c&&(_loggingGrep=c),Intercooler},log:function(a,b){return log(a,b),Intercooler},setLogLevel:function(a){return _loggingLevel=a,Intercooler},logLevels:{DEBUG:_DEBUG,INFO:_INFO,WARNING:_WARN,ERROR:_ERROR}}}(); -------------------------------------------------------------------------------- /www/release/intercooler-0.3.0.min.js: -------------------------------------------------------------------------------- 1 | /*! intercooler 0.3.0 2014-04-29 */ 2 | "use strict";var Intercooler=Intercooler||function(){function _defineTransition(a,b){null==b.newContent&&(b.newContent=function(a,b,c,d){a.html(b),d()}),null==b.remove&&(b.remove=function(a){a.remove()}),null==b.show&&(b.show=function(a){a.show()}),null==b.hide&&(b.hide=function(a){a.hide()}),_transitions[a]=b}function fingerprint(a){if(null==a||void 0==a)return 0;var b,c,d,e=a.toString(),f=0;if(0==e.length)return f;for(b=0,d=e.length;d>b;b++)c=e.charCodeAt(b),f=(f<<5)-f+c,f|=0;return f}function log(a,b,c){null==a&&(a=$("body")),a.trigger("log.ic",b,c,a)}function uuid(){return _UUID++}function icSelectorFor(a){return"[ic-id='"+getIntercoolerId(a)+"']"}function findById(a){return $("#"+a)}function parseInterval(a){return log(null,"POLL: Parsing interval string "+a,"DEBUG"),"null"==a||"false"==a||""==a?null:a.lastIndexOf("ms")==a.length-2?parseInt(a.substr(0,a.length-2)):a.lastIndexOf("s")==a.length-1?1e3*parseInt(a.substr(0,a.length-1)):1e3}function initScrollHandler(){null==_scrollHandler&&(_scrollHandler=function(){$("[ic-trigger-on='scrolled-into-view']").each(function(){isScrolledIntoView($(this))&&1!=$(this).data("ic-scrolled-into-view-loaded")&&($(this).data("ic-scrolled-into-view-loaded",!0),fireICRequest($(this)))})},$(window).scroll(_scrollHandler))}function getTarget(a){return a.attr("ic-target")&&0!=a.attr("ic-target").indexOf("this.")?$(a.attr("ic-target")):a}function processHeaders(elt,xhr,pop){elt.trigger("beforeHeaders.ic",elt,xhr);var target=null;if(xhr.getResponseHeader("X-IC-Refresh")){var pathsToRefresh=xhr.getResponseHeader("X-IC-Refresh").split(",");log(elt,"IC HEADER: refreshing "+pathsToRefresh,"DEBUG"),$.each(pathsToRefresh,function(a,b){refreshDependencies(b.replace(/ /g,""),elt)})}if(xhr.getResponseHeader("X-IC-Script")&&(log(elt,"IC HEADER: evaling "+xhr.getResponseHeader("X-IC-Script"),"DEBUG"),eval(xhr.getResponseHeader("X-IC-Script"))),xhr.getResponseHeader("X-IC-Redirect")&&(log(elt,"IC HEADER: redirecting to "+xhr.getResponseHeader("X-IC-Redirect"),"DEBUG"),window.location=xhr.getResponseHeader("X-IC-Redirect")),"true"==xhr.getResponseHeader("X-IC-CancelPolling")&&cancelPolling(elt),xhr.getResponseHeader("X-IC-Open")&&(log(elt,"IC HEADER: opening "+xhr.getResponseHeader("X-IC-Open"),"DEBUG"),window.open(xhr.getResponseHeader("X-IC-Open"))),xhr.getResponseHeader("X-IC-SetLocation")&&1!=pop&&(log(elt,"IC HEADER: pushing "+xhr.getResponseHeader("X-IC-SetLocation"),"DEBUG"),_historySupport.pushUrl(xhr.getResponseHeader("X-IC-SetLocation"),elt)),xhr.getResponseHeader("X-IC-Transition")&&(log(elt,"IC HEADER: setting transition to "+xhr.getResponseHeader("X-IC-Transition"),"DEBUG"),target=getTarget(elt),target.data("ic-tmp-transition",xhr.getResponseHeader("X-IC-Transition"))),xhr.getResponseHeader("X-IC-Remove")&&elt){target=getTarget(elt),log(elt,"IC REMOVE","DEBUG");var transition=getTransition(elt,target);transition.remove(target)}return elt.trigger("afterHeaders.ic",elt,xhr),!0}function handleTestResponse(a,b,c){var d=findIndicator(a),e=getTransition(d,d);d.length>0&&e.show(d);var f={};c&&c.headers&&(f=c.headers);var g="";c&&("string"==typeof c||c instanceof String?g=c:("string"==typeof c.body||c.body instanceof String)&&(g=c.body)),processHeaders(a,{getResponseHeader:function(a){return f[a]}}),b(g,"",a),d.length>0&&e.hide(d)}function beforeRequest(a){a.addClass("disabled")}function afterRequest(a){a.removeClass("disabled")}function replaceOrAddMethod(a,b){var c=/(&|^)_method=[^&]*/,d="&_method="+b;return c.test(a)?a.replace(c,d):a+"&"+d}function handleRemoteRequest(a,b,c,d,e){d=replaceOrAddMethod(d,b);for(var f=d.indexOf("&ic-handle-pop=true")>=0,g=0,h=_urlHandlers.length;h>g;g++){var i=_urlHandlers[g],j=null;if(null==i.url||new RegExp(i.url.replace(/\*/g,".*").replace(/\//g,"\\/")).test(c))return"GET"==b&&i.get&&(i.get&&(j=i.get(c,parseParams(d))),handleTestResponse(a,e,j)),"POST"==b&&(i.post&&(j=i.post(c,parseParams(d))),handleTestResponse(a,e,j)),"PUT"==b&&(i.put&&(j=i.put(c,parseParams(d))),handleTestResponse(a,e,j)),"DELETE"==b&&(i.delete&&(j=i.delete(c,parseParams(d))),handleTestResponse(a,e,j)),void 0}beforeRequest(a);var k=findIndicator(a),l=getTransition(k,k);k.length>0&&l.show(k),_remote.ajax({type:b,url:c,data:d,dataType:"text",headers:{Accept:"text/html-partial, */*; q=0.9"},beforeSend:function(b,c){a.trigger("beforeSend.ic",a,d,c,b)},success:function(b,c,d){a.trigger("success.ic",a,b,c,d);var g=getTarget(a);g.data("ic-tmp-transition",a.attr("ic-transition")),processHeaders(a,d,f)&&e(b,c,a,d),g.data("ic-tmp-transition",null)},error:function(b,c,d){a.trigger("error.ic",a,c,d,b),log(a,"An error occurred: "+d,"ERROR")},complete:function(b,c){a.trigger("complete.ic",a,d,c,b),k.length>0&&l.hide(k),afterRequest(a)}})}function findIndicator(a){var b=null;if($(a).attr("ic-indicator"))b=$($(a).attr("ic-indicator")).first();else if(b=$(a).find(".ic-indicator").first(),0==b.length){var c=$(a).closest("[ic-indicator]");c.length>0&&(b=$(c.first().attr("ic-indicator")).first())}return b}function parseParams(a){var b,c=/([^&=]+)=?([^&]*)/g,d=function(a){return decodeURIComponent(a.replace(/\+/g," "))},e={};if(a)for("?"==a.substr(0,1)&&(a=a.substr(1));b=c.exec(a);){var f=d(b[1]),g=d(b[2]);void 0!==e[f]?($.isArray(e[f])||(e[f]=[e[f]]),e[f].push(g)):e[f]=g}return e}function processIncludes(a){var b="";return $(a).each(function(){b+="&"+$(this).serialize()}),b}function getParametersForElement(a){var b=getTarget(a),c="ic-request=true";return c+=a.closest("form").length>0?"&"+a.closest("form").serialize():"&"+a.serialize(),a.attr("id")&&(c+="&ic-element-id="+a.attr("id")),a.attr("name")&&(c+="&ic-element-name="+a.attr("name")),b.attr("ic-id")&&(c+="&ic-id="+b.attr("ic-id")),b.attr("ic-last-refresh")&&(c+="&ic-last-refresh="+b.attr("ic-last-refresh")),b.attr("ic-fingerprint")&&(c+="&ic-fingerprint="+b.attr("ic-fingerprint")),a.attr("ic-include")&&(c+=processIncludes(a.attr("ic-include"))),log(a,"PARAMS: Returning parameters "+c+" for "+a,"DEBUG"),c}function maybeSetIntercoolerInfo(a){var b=getTarget(a);log(a,"Setting IC info","DEBUG"),getIntercoolerId(b),maybeSetIntercoolerMetadata(b)}function updateIntercoolerMetaData(a){a.attr("ic-fingerprint",fingerprint(a.html())),a.attr("ic-last-refresh",(new Date).getTime())}function maybeSetIntercoolerMetadata(a){a.attr("ic-fingerprint")||updateIntercoolerMetaData(a)}function getIntercoolerId(a){return a.attr("ic-id")||a.attr("ic-id",uuid()),a.attr("ic-id")}function processNodes(a){processMacros(a),processSources(a),processPolling(a),processTriggerOn(a)}function processSources(a){$(a).is("[ic-src]")&&maybeSetIntercoolerInfo($(a)),$(a).find("[ic-src]").each(function(){maybeSetIntercoolerInfo($(this))})}function startPolling(a){if(null==a.data("ic-poll-interval-id")){var b=parseInterval(a.attr("ic-poll"));if(null!=b){var c=icSelectorFor(a);log(a,"POLL: Starting poll for element "+c,"DEBUG");var d=setInterval(function(){var b=$(c);a.trigger("onPoll.ic",b),0==b.length?(log(a,"POLL: Clearing poll for element "+c,"DEBUG"),clearTimeout(d)):fireICRequest(b)},b);a.data("ic-poll-interval-id",d)}}}function cancelPolling(a){null!=a.data("ic-poll-interval-id")&&clearTimeout(a.data("ic-poll-interval-id"))}function processPolling(a){$(a).is("[ic-poll]")&&(maybeSetIntercoolerInfo($(a)),startPolling(a)),$(a).find("[ic-poll]").each(function(){maybeSetIntercoolerInfo($(this)),startPolling($(this))})}function refreshDependencies(a,b){log(b,"Refreshing Dependencies for "+a,"DEBUG"),$("[ic-src]").each(function(){var c=!1;"GET"==verbFor($(this))&&"ignore"!=$(this).attr("ic-deps")&&(isDependent(a,$(this).attr("ic-src"))?(null==b||$(b)[0]!=$(this)[0])&&(fireICRequest($(this)),c=!0):(isDependent(a,$(this).attr("ic-deps"))||"*"==$(this).attr("ic-deps"))&&(null==b||$(b)[0]!=$(this)[0])&&(fireICRequest($(this)),c=!0)),c||log($(this),"Does not depend on "+a,"DEBUG")})}function isDependent(a,b){return a&&b&&(0==b.indexOf(a)||0==a.indexOf(b))}function verbFor(a){return a.attr("ic-verb")?a.attr("ic-verb").toUpperCase():"GET"}function eventFor(a,b){return"default"==a?$(b).is("button")?"click":$(b).is("form")?"submit":$(b).is(":input")?"change":"click":a}function preventDefault(a){return a.is("form")||a.is(":submit")&&1==a.closest("form").length}function handleTriggerOn(a){$(a).attr("ic-trigger-on")&&("load"==$(a).attr("ic-trigger-on")?fireICRequest(a):"scrolled-into-view"==$(a).attr("ic-trigger-on")?(initScrollHandler(),setTimeout(function(){$(window).trigger("scroll")},100)):$(a).on(eventFor($(a).attr("ic-trigger-on"),$(a)),function(b){return fireICRequest($(a)),refreshDependencies($(a).attr("ic-src"),$(a)),preventDefault(a)?(b.preventDefault(),!1):!0}))}function processTriggerOn(a){handleTriggerOn(a),$(a).find("[ic-trigger-on]").each(function(){handleTriggerOn($(this))})}function processMacros(a){$.each(_MACROS,function(b,c){$(a).is("["+c+"]")&&processMacro(c,$(a)),$(a).find("["+c+"]").each(function(){processMacro(c,$(this))})})}function processMacro(a,b){"ic-post-to"==a&&(setIfAbsent(b,"ic-src",b.attr("ic-post-to")),setIfAbsent(b,"ic-verb","POST"),setIfAbsent(b,"ic-trigger-on","default"),setIfAbsent(b,"ic-deps","ignore")),"ic-put-to"==a&&(setIfAbsent(b,"ic-src",b.attr("ic-put-to")),setIfAbsent(b,"ic-verb","PUT"),setIfAbsent(b,"ic-trigger-on","default"),setIfAbsent(b,"ic-deps","ignore")),"ic-get-from"==a&&(setIfAbsent(b,"ic-src",b.attr("ic-get-from")),setIfAbsent(b,"ic-trigger-on","default"),setIfAbsent(b,"ic-deps","ignore")),"ic-delete-from"==a&&(setIfAbsent(b,"ic-src",b.attr("ic-delete-from")),setIfAbsent(b,"ic-verb","DELETE"),setIfAbsent(b,"ic-trigger-on","default"),setIfAbsent(b,"ic-deps","ignore"));var c=null,d=null;if("ic-style-src"==a){c=b.attr("ic-style-src").split(":");var e=c[0];d=c[1],setIfAbsent(b,"ic-src",d),setIfAbsent(b,"ic-target","this.style."+e)}if("ic-attr-src"==a){c=b.attr("ic-attr-src").split(":");var f=c[0];d=c[1],setIfAbsent(b,"ic-src",d),setIfAbsent(b,"ic-target","this."+f)}"ic-prepend-from"==a&&(setIfAbsent(b,"ic-src",b.attr("ic-prepend-from")),setIfAbsent(b,"ic-transition","prepend")),"ic-append-from"==a&&(setIfAbsent(b,"ic-src",b.attr("ic-append-from")),setIfAbsent(b,"ic-transition","append"))}function setIfAbsent(a,b,c){null==a.attr(b)&&a.attr(b,c)}function isScrolledIntoView(a){var b=$(window).scrollTop(),c=b+$(window).height(),d=$(a).offset().top,e=d+$(a).height();return e>=b&&c>=d&&c>=e&&d>=b}function getTransition(a,b){var c=null;return a.attr("ic-transition")&&(c=_transitions[a.attr("ic-transition")]),b.attr("ic-transition")&&(c=_transitions[b.attr("ic-transition")]),b.data("ic-tmp-transition")&&(c=_transitions[b.data("ic-tmp-transition")]),null==c&&(c=_transitions[_defaultTransition]),null==c&&(c=_transitions.none),c}function processICResponse(a,b){if(a&&/\S/.test(a)){log(b,"IC RESPONSE: Received: "+a,"DEBUG");var c=getTarget(b),d=$("
        ").html(a);if(processMacros(d),fingerprint(d.html())!=c.attr("ic-fingerprint")||"true"==c.attr("ic-always-update")){var e=getTransition(b,c);e.newContent(c,a,!1,function(){processNodes(c),updateIntercoolerMetaData(c)})}d.remove()}}function getStyleTarget(a){return a.attr("ic-target")&&0==a.attr("ic-target").indexOf("this.style.")?a.attr("ic-target").substr(11):null}function getAttrTarget(a){return a.attr("ic-target")&&0==a.attr("ic-target").indexOf("this.")?a.attr("ic-target").substr(5):null}function fireICRequest(a){var b=getStyleTarget(a),c=b?null:getAttrTarget(a);a.attr("ic-src")&&handleRemoteRequest(a,verbFor(a),a.attr("ic-src"),getParametersForElement(a),function(d){b?a.css(b,d):c?a.attr(c,d):processICResponse(d,a)})}var _MACROS=["ic-get-from","ic-post-to","ic-put-to","ic-delete-from","ic-style-src","ic-attr-src","ic-prepend-from","ic-append-from"],_remote=$,_urlHandlers=[],_scrollHandler=null,_UUID=1,_transitions={},_defaultTransition="fadeFast";_defineTransition("none",{}),_defineTransition("fadeFast",{newContent:function(a,b,c,d){a.fadeOut("fast",function(){a.html(b),d(),a.fadeIn("fast")})},remove:function(a){a.fadeOut("fast",function(){a.remove()})},show:function(a){a.fadeIn("fast")},hide:function(a){a.fadeOut("fast")}}),_defineTransition("prepend",{newContent:function(a,b,c,d){var e=$(b);if(e.hide(),a.prepend(e),d(),e.fadeIn(),a.attr("ic-limit-children")){var f=parseInt(a.attr("ic-limit-children"));a.children().length>f&&a.children().slice(f,a.children().length).remove()}}}),_defineTransition("append",{newContent:function(a,b,c,d){var e=$(b);if(e.hide(),a.append(e),d(),e.fadeIn(),a.attr("ic-limit-children")){var f=parseInt(a.attr("ic-limit-children"));a.children().length>f&&a.children().slice(0,a.children().length-f).remove()}}});var _historySupport={stateCache:null,popping:!1,getRestorationURL:function(a){return a.attr("ic-restore-from")?a.attr("ic-restore-from"):window.location.pathname+window.location.search+window.location.hash},onPageLoad:function(){if(_historySupport.stateCache={"ic-setlocation":!0,"restore-from":window.location.pathname+window.location.search+window.location.hash,timestamp:(new Date).getTime()},null==window.onpopstate||1!=window.onpopstate["ic-on-pop-state-handler"]){var a=window.onpopstate;window.onpopstate=function(b){_historySupport.handlePop(b)||a&&a(b)},window.onpopstate["ic-on-pop-state-handler"]=!0}},pushUrl:function(a,b){log(b,"IC HISTORY: pushing location "+a,"DEBUG");var c=getTarget(b),d=c.attr("id");if(null==d)return log(b,"To support history for a given element, you must have a valid id attribute on the element","ERROR"),void 0;_historySupport.initHistory(b);var e={"ic-setlocation":!0,"id-to-restore":d.toString(),"restore-from":a,timestamp:(new Date).getTime()};b.trigger("pushUrl.ic",c,e),window.history.pushState(e,"",a)},initHistory:function(a){if(_historySupport.stateCache){var b=getTarget(a),c=b.attr("id");_historySupport.stateCache["id-to-restore"]=c.toString(),window.history.replaceState(_historySupport.stateCache),_historySupport.stateCache=null}},handlePop:function(a){var b=a.state;if(b&&b["ic-setlocation"]){var c=findById(b["id-to-restore"]),d=getParametersForElement(c);return d+="&ic-handle-pop=true",handleRemoteRequest(c,"GET",b["restore-from"],d,function(a){c.trigger("handlePop.ic",c,a),processICResponse(a,c)}),!0}return!1}};return $(function(){processNodes("body"),_historySupport.onPageLoad()}),{refresh:function(a){return"string"==typeof a||a instanceof String?refreshDependencies(a):fireICRequest(a),Intercooler},defaultTransition:function(a){_defaultTransition=a},defineTransition:function(a,b){_defineTransition(a,b)},addURLHandler:function(a){if(!a.url)throw"Handlers must include a URL pattern";return _urlHandlers.push(a),Intercooler},setRemote:function(a){return _remote=a,Intercooler}}}(); -------------------------------------------------------------------------------- /www/js/google-code-prettify/prettify.js: -------------------------------------------------------------------------------- 1 | !function(){var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; 2 | (function(){function S(a){function d(e){var b=e.charCodeAt(0);if(b!==92)return b;var a=e.charAt(1);return(b=r[a])?b:"0"<=a&&a<="7"?parseInt(e.substring(1),8):a==="u"||a==="x"?parseInt(e.substring(2),16):e.charCodeAt(1)}function g(e){if(e<32)return(e<16?"\\x0":"\\x")+e.toString(16);e=String.fromCharCode(e);return e==="\\"||e==="-"||e==="]"||e==="^"?"\\"+e:e}function b(e){var b=e.substring(1,e.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),e=[],a= 3 | b[0]==="^",c=["["];a&&c.push("^");for(var a=a?1:0,f=b.length;a122||(l<65||h>90||e.push([Math.max(65,h)|32,Math.min(l,90)|32]),l<97||h>122||e.push([Math.max(97,h)&-33,Math.min(l,122)&-33]))}}e.sort(function(e,a){return e[0]-a[0]||a[1]-e[1]});b=[];f=[];for(a=0;ah[0]&&(h[1]+1>h[0]&&c.push("-"),c.push(g(h[1])));c.push("]");return c.join("")}function s(e){for(var a=e.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),c=a.length,d=[],f=0,h=0;f=2&&e==="["?a[f]=b(l):e!=="\\"&&(a[f]=l.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return a.join("")}for(var x=0,m=!1,j=!1,k=0,c=a.length;k=5&&"lang-"===w.substring(0,5))&&!(t&&typeof t[1]==="string"))f=!1,w="src";f||(r[z]=w)}h=c;c+=z.length;if(f){f=t[1];var l=z.indexOf(f),B=l+f.length;t[2]&&(B=z.length-t[2].length,l=B-f.length);w=w.substring(5);H(j+h,z.substring(0,l),g,k);H(j+h+l,f,I(w,f),k);H(j+h+B,z.substring(B),g,k)}else k.push(j+h,w)}a.g=k}var b={},s;(function(){for(var g=a.concat(d),j=[],k={},c=0,i=g.length;c=0;)b[n.charAt(e)]=r;r=r[1];n=""+r;k.hasOwnProperty(n)||(j.push(r),k[n]=q)}j.push(/[\S\s]/);s=S(j)})();var x=d.length;return g}function v(a){var d=[],g=[];a.tripleQuotedStrings?d.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?d.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, 10 | q,"'\"`"]):d.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&g.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var b=a.hashComments;b&&(a.cStyleComments?(b>1?d.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):d.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),g.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,q])):d.push(["com", 11 | /^#[^\n\r]*/,q,"#"]));a.cStyleComments&&(g.push(["com",/^\/\/[^\n\r]*/,q]),g.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));if(b=a.regexLiterals){var s=(b=b>1?"":"\n\r")?".":"[\\S\\s]";g.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+("/(?=[^/*"+b+"])(?:[^/\\x5B\\x5C"+b+"]|\\x5C"+s+"|\\x5B(?:[^\\x5C\\x5D"+b+"]|\\x5C"+ 12 | s+")*(?:\\x5D|$))+/")+")")])}(b=a.types)&&g.push(["typ",b]);b=(""+a.keywords).replace(/^ | $/g,"");b.length&&g.push(["kwd",RegExp("^(?:"+b.replace(/[\s,]+/g,"|")+")\\b"),q]);d.push(["pln",/^\s+/,q," \r\n\t\u00a0"]);b="^.[^\\s\\w.$@'\"`/\\\\]*";a.regexLiterals&&(b+="(?!s*/)");g.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/, 13 | q],["pun",RegExp(b),q]);return C(d,g)}function J(a,d,g){function b(a){var c=a.nodeType;if(c==1&&!x.test(a.className))if("br"===a.nodeName)s(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)b(a);else if((c==3||c==4)&&g){var d=a.nodeValue,i=d.match(m);if(i)c=d.substring(0,i.index),a.nodeValue=c,(d=d.substring(i.index+i[0].length))&&a.parentNode.insertBefore(j.createTextNode(d),a.nextSibling),s(a),c||a.parentNode.removeChild(a)}}function s(a){function b(a,c){var d= 14 | c?a.cloneNode(!1):a,e=a.parentNode;if(e){var e=b(e,1),g=a.nextSibling;e.appendChild(d);for(var i=g;i;i=g)g=i.nextSibling,e.appendChild(i)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),d;(d=a.parentNode)&&d.nodeType===1;)a=d;c.push(a)}for(var x=/(?:^|\s)nocode(?:\s|$)/,m=/\r\n?|\n/,j=a.ownerDocument,k=j.createElement("li");a.firstChild;)k.appendChild(a.firstChild);for(var c=[k],i=0;i=0;){var b=d[g];F.hasOwnProperty(b)?D.console&&console.warn("cannot override language handler %s",b):F[b]=a}}function I(a,d){if(!a||!F.hasOwnProperty(a))a=/^\s*=l&&(b+=2);g>=B&&(r+=2)}}finally{if(f)f.style.display=h}}catch(u){D.console&&console.log(u&&u.stack||u)}}var D=window,y=["break,continue,do,else,for,if,return,while"],E=[[y,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], 18 | "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],M=[E,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],N=[E,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"], 19 | O=[N,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],E=[E,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],P=[y,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], 20 | Q=[y,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],W=[y,"as,assert,const,copy,drop,enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"],y=[y,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/, 21 | V=/\S/,X=v({keywords:[M,O,E,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",P,Q,y],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),F={};p(X,["default-code"]);p(C([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-", 22 | /^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);p(C([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/], 23 | ["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);p(C([],[["atv",/^[\S\s]+/]]),["uq.val"]);p(v({keywords:M,hashComments:!0,cStyleComments:!0,types:R}),["c","cc","cpp","cxx","cyc","m"]);p(v({keywords:"null,true,false"}),["json"]);p(v({keywords:O,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:R}), 24 | ["cs"]);p(v({keywords:N,cStyleComments:!0}),["java"]);p(v({keywords:y,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]);p(v({keywords:P,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]);p(v({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]);p(v({keywords:Q, 25 | hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]);p(v({keywords:E,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]);p(v({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);p(v({keywords:W,cStyleComments:!0,multilineStrings:!0}),["rc","rs","rust"]); 26 | p(C([],[["str",/^[\S\s]+/]]),["regex"]);var Y=D.PR={createSimpleLexer:C,registerLangHandler:p,sourceDecorator:v,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:D.prettyPrintOne=function(a,d,g){var b=document.createElement("div");b.innerHTML="
        "+a+"
        ";b=b.firstChild;g&&J(b,g,!0);K({h:d,j:g,c:b,i:1}); 27 | return b.innerHTML},prettyPrint:D.prettyPrint=function(a,d){function g(){for(var b=D.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;ib;b++)c=e.charCodeAt(b),f=(f<<5)-f+c,f|=0;return f}function log(a,b,c){null==a&&(a=$("body")),a.trigger("log.ic",b,c,a)}function uuid(){return _UUID++}function icSelectorFor(a){return"[ic-id='"+getIntercoolerId(a)+"']"}function findById(a){return $("#"+a)}function parseInterval(a){return log(null,"POLL: Parsing interval string "+a,"DEBUG"),"null"==a||"false"==a||""==a?null:a.lastIndexOf("ms")==a.length-2?parseInt(a.substr(0,a.length-2)):a.lastIndexOf("s")==a.length-1?1e3*parseInt(a.substr(0,a.length-1)):1e3}function initScrollHandler(){null==_scrollHandler&&(_scrollHandler=function(){$("[ic-trigger-on='scrolled-into-view']").each(function(){isScrolledIntoView($(this))&&1!=$(this).data("ic-scrolled-into-view-loaded")&&($(this).data("ic-scrolled-into-view-loaded",!0),fireICRequest($(this)))})},$(window).scroll(_scrollHandler))}function getTarget(a){return a.attr("ic-target")&&0!=a.attr("ic-target").indexOf("this.")?$(a.attr("ic-target")):a}function processHeaders(elt,xhr,pop){elt.trigger("beforeHeaders.ic",elt,xhr);var target=null;if(xhr.getResponseHeader("X-IC-Refresh")){var pathsToRefresh=xhr.getResponseHeader("X-IC-Refresh").split(",");log(elt,"IC HEADER: refreshing "+pathsToRefresh,"DEBUG"),$.each(pathsToRefresh,function(a,b){refreshDependencies(b.replace(/ /g,""),elt)})}if(xhr.getResponseHeader("X-IC-Script")&&(log(elt,"IC HEADER: evaling "+xhr.getResponseHeader("X-IC-Script"),"DEBUG"),eval(xhr.getResponseHeader("X-IC-Script"))),xhr.getResponseHeader("X-IC-Redirect")&&(log(elt,"IC HEADER: redirecting to "+xhr.getResponseHeader("X-IC-Redirect"),"DEBUG"),window.location=xhr.getResponseHeader("X-IC-Redirect")),"true"==xhr.getResponseHeader("X-IC-CancelPolling")&&cancelPolling(elt),xhr.getResponseHeader("X-IC-Open")&&(log(elt,"IC HEADER: opening "+xhr.getResponseHeader("X-IC-Open"),"DEBUG"),window.open(xhr.getResponseHeader("X-IC-Open"))),xhr.getResponseHeader("X-IC-SetLocation")&&1!=pop&&(log(elt,"IC HEADER: pushing "+xhr.getResponseHeader("X-IC-SetLocation"),"DEBUG"),_historySupport.pushUrl(xhr.getResponseHeader("X-IC-SetLocation"),elt)),xhr.getResponseHeader("X-IC-Transition")&&(log(elt,"IC HEADER: setting transition to "+xhr.getResponseHeader("X-IC-Transition"),"DEBUG"),target=getTarget(elt),target.data("ic-tmp-transition",xhr.getResponseHeader("X-IC-Transition"))),xhr.getResponseHeader("X-IC-Remove")&&elt){target=getTarget(elt),log(elt,"IC REMOVE","DEBUG");var transition=getTransition(elt,target);transition.remove(target)}return elt.trigger("afterHeaders.ic",elt,xhr),!0}function handleTestResponse(a,b,c){var d=findIndicator(a),e=getTransition(d,d);d.length>0&&e.show(d);var f={};c&&c.headers&&(f=c.headers);var g="";c&&("string"==typeof c||c instanceof String?g=c:("string"==typeof c.body||c.body instanceof String)&&(g=c.body)),processHeaders(a,{getResponseHeader:function(a){return f[a]}}),b(g,"",a),d.length>0&&e.hide(d)}function beforeRequest(a){a.addClass("disabled")}function afterRequest(a){a.removeClass("disabled")}function replaceOrAddMethod(a,b){var c=/(&|^)_method=[^&]*/,d="&_method="+b;return c.test(a)?a.replace(c,d):a+"&"+d}function handleRemoteRequest(a,b,c,d,e){d=replaceOrAddMethod(d,b);for(var f=d.indexOf("&ic-handle-pop=true")>=0,g=0,h=_urlHandlers.length;h>g;g++){var i=_urlHandlers[g],j=null;if(null==i.url||new RegExp(i.url.replace(/\*/g,".*").replace(/\//g,"\\/")).test(c))return"GET"==b&&i.get&&(i.get&&(j=i.get(c,parseParams(d))),handleTestResponse(a,e,j)),"POST"==b&&(i.post&&(j=i.post(c,parseParams(d))),handleTestResponse(a,e,j)),"PUT"==b&&(i.put&&(j=i.put(c,parseParams(d))),handleTestResponse(a,e,j)),"DELETE"==b&&(i.delete&&(j=i.delete(c,parseParams(d))),handleTestResponse(a,e,j)),void 0}beforeRequest(a);var k=findIndicator(a),l=getTransition(k,k);k.length>0&&l.show(k),_remote.ajax({type:b,url:c,data:d,dataType:"text",headers:{Accept:"text/html-partial, */*; q=0.9"},beforeSend:function(b,c){a.trigger("beforeSend.ic",a,d,c,b)},success:function(b,c,d){a.trigger("success.ic",a,b,c,d);var g=getTarget(a);g.data("ic-tmp-transition",a.attr("ic-transition")),processHeaders(a,d,f)&&e(b,c,a,d),g.data("ic-tmp-transition",null)},error:function(b,c,d){a.trigger("error.ic",a,c,d,b),log(a,"An error occurred: "+d,"ERROR")},complete:function(b,c){a.trigger("complete.ic",a,d,c,b),k.length>0&&l.hide(k),afterRequest(a)}})}function findIndicator(a){var b=null;if($(a).attr("ic-indicator"))b=$($(a).attr("ic-indicator")).first();else if(b=$(a).find(".ic-indicator").first(),0==b.length){var c=$(a).closest("[ic-indicator]");c.length>0&&(b=$(c.first().attr("ic-indicator")).first())}return b}function parseParams(a){var b,c=/([^&=]+)=?([^&]*)/g,d=function(a){return decodeURIComponent(a.replace(/\+/g," "))},e={};if(a)for("?"==a.substr(0,1)&&(a=a.substr(1));b=c.exec(a);){var f=d(b[1]),g=d(b[2]);void 0!==e[f]?($.isArray(e[f])||(e[f]=[e[f]]),e[f].push(g)):e[f]=g}return e}function processIncludes(a){var b="";return $(a).each(function(){b+="&"+$(this).serialize()}),b}function getParametersForElement(a){var b=getTarget(a),c="ic-request=true";return c+=a.closest("form").length>0?"&"+a.closest("form").serialize():"&"+a.serialize(),a.attr("id")&&(c+="&ic-element-id="+a.attr("id")),a.attr("name")&&(c+="&ic-element-name="+a.attr("name")),b.attr("ic-id")&&(c+="&ic-id="+b.attr("ic-id")),b.attr("ic-last-refresh")&&(c+="&ic-last-refresh="+b.attr("ic-last-refresh")),b.attr("ic-fingerprint")&&(c+="&ic-fingerprint="+b.attr("ic-fingerprint")),a.attr("ic-include")&&(c+=processIncludes(a.attr("ic-include"))),log(a,"PARAMS: Returning parameters "+c+" for "+a,"DEBUG"),c}function maybeSetIntercoolerInfo(a){var b=getTarget(a);log(a,"Setting IC info","DEBUG"),getIntercoolerId(b),maybeSetIntercoolerMetadata(b)}function updateIntercoolerMetaData(a){a.attr("ic-fingerprint",fingerprint(a.html())),a.attr("ic-last-refresh",(new Date).getTime())}function maybeSetIntercoolerMetadata(a){a.attr("ic-fingerprint")||updateIntercoolerMetaData(a)}function getIntercoolerId(a){return a.attr("ic-id")||a.attr("ic-id",uuid()),a.attr("ic-id")}function processNodes(a){processMacros(a),processSources(a),processPolling(a),processTriggerOn(a)}function processSources(a){$(a).is("[ic-src]")&&maybeSetIntercoolerInfo($(a)),$(a).find("[ic-src]").each(function(){maybeSetIntercoolerInfo($(this))})}function startPolling(a){if(null==a.data("ic-poll-interval-id")){var b=parseInterval(a.attr("ic-poll"));if(null!=b){var c=icSelectorFor(a);log(a,"POLL: Starting poll for element "+c,"DEBUG");var d=setInterval(function(){var b=$(c);a.trigger("onPoll.ic",b),0==b.length?(log(a,"POLL: Clearing poll for element "+c,"DEBUG"),clearTimeout(d)):fireICRequest(b)},b);a.data("ic-poll-interval-id",d)}}}function cancelPolling(a){null!=a.data("ic-poll-interval-id")&&clearTimeout(a.data("ic-poll-interval-id"))}function processPolling(a){$(a).is("[ic-poll]")&&(maybeSetIntercoolerInfo($(a)),startPolling(a)),$(a).find("[ic-poll]").each(function(){maybeSetIntercoolerInfo($(this)),startPolling($(this))})}function refreshDependencies(a,b){log(b,"Refreshing Dependencies for "+a,"DEBUG"),$("[ic-src]").each(function(){var c=!1;"GET"==verbFor($(this))&&"ignore"!=$(this).attr("ic-deps")&&(isDependent(a,$(this).attr("ic-src"))?(null==b||$(b)[0]!=$(this)[0])&&(fireICRequest($(this)),c=!0):(isDependent(a,$(this).attr("ic-deps"))||"*"==$(this).attr("ic-deps"))&&(null==b||$(b)[0]!=$(this)[0])&&(fireICRequest($(this)),c=!0)),c||log($(this),"Does not depend on "+a,"DEBUG")})}function isDependent(a,b){return a&&b&&(0==b.indexOf(a)||0==a.indexOf(b))}function verbFor(a){return a.attr("ic-verb")?a.attr("ic-verb").toUpperCase():"GET"}function eventFor(a,b){return"default"==a?$(b).is("button")?"click":$(b).is("form")?"submit":$(b).is(":input")?"change":"click":a}function preventDefault(a){return a.is("form")||a.is(":submit")&&1==a.closest("form").length}function handleTriggerOn(a){$(a).attr("ic-trigger-on")&&("load"==$(a).attr("ic-trigger-on")?fireICRequest(a):"scrolled-into-view"==$(a).attr("ic-trigger-on")?(initScrollHandler(),setTimeout(function(){$(window).trigger("scroll")},100)):$(a).on(eventFor($(a).attr("ic-trigger-on"),$(a)),function(b){return fireICRequest($(a)),refreshDependencies($(a).attr("ic-src"),$(a)),preventDefault(a)?(b.preventDefault(),!1):!0}))}function processTriggerOn(a){handleTriggerOn(a),$(a).find("[ic-trigger-on]").each(function(){handleTriggerOn($(this))})}function processMacros(a){$.each(_MACROS,function(b,c){$(a).is("["+c+"]")&&processMacro(c,$(a)),$(a).find("["+c+"]").each(function(){processMacro(c,$(this))})})}function processMacro(a,b){"ic-post-to"==a&&(setIfAbsent(b,"ic-src",b.attr("ic-post-to")),setIfAbsent(b,"ic-verb","POST"),setIfAbsent(b,"ic-trigger-on","default"),setIfAbsent(b,"ic-deps","ignore")),"ic-put-to"==a&&(setIfAbsent(b,"ic-src",b.attr("ic-put-to")),setIfAbsent(b,"ic-verb","PUT"),setIfAbsent(b,"ic-trigger-on","default"),setIfAbsent(b,"ic-deps","ignore")),"ic-get-from"==a&&(setIfAbsent(b,"ic-src",b.attr("ic-get-from")),setIfAbsent(b,"ic-trigger-on","default"),setIfAbsent(b,"ic-deps","ignore")),"ic-delete-from"==a&&(setIfAbsent(b,"ic-src",b.attr("ic-delete-from")),setIfAbsent(b,"ic-verb","DELETE"),setIfAbsent(b,"ic-trigger-on","default"),setIfAbsent(b,"ic-deps","ignore"));var c=null,d=null;if("ic-style-src"==a){c=b.attr("ic-style-src").split(":");var e=c[0];d=c[1],setIfAbsent(b,"ic-src",d),setIfAbsent(b,"ic-target","this.style."+e)}if("ic-attr-src"==a){c=b.attr("ic-attr-src").split(":");var f=c[0];d=c[1],setIfAbsent(b,"ic-src",d),setIfAbsent(b,"ic-target","this."+f)}"ic-prepend-from"==a&&(setIfAbsent(b,"ic-src",b.attr("ic-prepend-from")),setIfAbsent(b,"ic-transition","prepend")),"ic-append-from"==a&&(setIfAbsent(b,"ic-src",b.attr("ic-append-from")),setIfAbsent(b,"ic-transition","append"))}function setIfAbsent(a,b,c){null==a.attr(b)&&a.attr(b,c)}function isScrolledIntoView(a){var b=$(window).scrollTop(),c=b+$(window).height(),d=$(a).offset().top,e=d+$(a).height();return e>=b&&c>=d&&c>=e&&d>=b}function getTransition(a,b){var c=null;return a.attr("ic-transition")&&(c=_transitions[a.attr("ic-transition")]),b.attr("ic-transition")&&(c=_transitions[b.attr("ic-transition")]),b.data("ic-tmp-transition")&&(c=_transitions[b.data("ic-tmp-transition")]),null==c&&(c=_transitions[_defaultTransition]),null==c&&(c=_transitions.none),c}function processICResponse(a,b){if(a&&/\S/.test(a)){log(b,"IC RESPONSE: Received: "+a,"DEBUG");var c=getTarget(b),d=$("
        ").html(a);if(processMacros(d),fingerprint(d.html())!=c.attr("ic-fingerprint")||"true"==c.attr("ic-always-update")){var e=getTransition(b,c);e.newContent(c,a,!1,function(){processNodes(c),updateIntercoolerMetaData(c)})}d.remove()}}function getStyleTarget(a){return a.attr("ic-target")&&0==a.attr("ic-target").indexOf("this.style.")?a.attr("ic-target").substr(11):null}function getAttrTarget(a){return a.attr("ic-target")&&0==a.attr("ic-target").indexOf("this.")?a.attr("ic-target").substr(5):null}function fireICRequest(a){var b=getStyleTarget(a),c=b?null:getAttrTarget(a);a.attr("ic-src")&&handleRemoteRequest(a,verbFor(a),a.attr("ic-src"),getParametersForElement(a),function(d){b?a.css(b,d):c?a.attr(c,d):processICResponse(d,a)})}var _MACROS=["ic-get-from","ic-post-to","ic-put-to","ic-delete-from","ic-style-src","ic-attr-src","ic-prepend-from","ic-append-from"],_remote=$,_urlHandlers=[],_scrollHandler=null,_UUID=1,_transitions={},_defaultTransition="fadeFast";_defineTransition("none",{}),_defineTransition("fadeFast",{newContent:function(a,b,c,d){a.fadeOut("fast",function(){a.html(b),d(),a.fadeIn("fast")})},remove:function(a){a.fadeOut("fast",function(){a.remove()})},show:function(a){a.fadeIn("fast")},hide:function(a){a.fadeOut("fast")}}),_defineTransition("prepend",{newContent:function(a,b,c,d){var e=$(b);if(e.hide(),a.prepend(e),d(),e.fadeIn(),a.attr("ic-limit-children")){var f=parseInt(a.attr("ic-limit-children"));a.children().length>f&&a.children().slice(f,a.children().length).remove()}}}),_defineTransition("append",{newContent:function(a,b,c,d){var e=$(b);if(e.hide(),a.append(e),d(),e.fadeIn(),a.attr("ic-limit-children")){var f=parseInt(a.attr("ic-limit-children"));a.children().length>f&&a.children().slice(0,a.children().length-f).remove()}}});var _historySupport={stateCache:null,popping:!1,getRestorationURL:function(a){return a.attr("ic-restore-from")?a.attr("ic-restore-from"):window.location.pathname+window.location.search+window.location.hash},onPageLoad:function(){if(_historySupport.stateCache={"ic-setlocation":!0,"restore-from":window.location.pathname+window.location.search+window.location.hash,timestamp:(new Date).getTime()},null==window.onpopstate||1!=window.onpopstate["ic-on-pop-state-handler"]){var a=window.onpopstate;window.onpopstate=function(b){_historySupport.handlePop(b)||a&&a(b)},window.onpopstate["ic-on-pop-state-handler"]=!0}},pushUrl:function(a,b){log(b,"IC HISTORY: pushing location "+a,"DEBUG");var c=getTarget(b),d=c.attr("id");if(null==d)return log(b,"To support history for a given element, you must have a valid id attribute on the element","ERROR"),void 0;_historySupport.initHistory(b);var e={"ic-setlocation":!0,"id-to-restore":d.toString(),"restore-from":a,timestamp:(new Date).getTime()};b.trigger("pushUrl.ic",c,e),window.history.pushState(e,"",a)},initHistory:function(a){if(_historySupport.stateCache){var b=getTarget(a),c=b.attr("id");_historySupport.stateCache["id-to-restore"]=c.toString(),window.history.replaceState(_historySupport.stateCache,"",_historySupport.stateCache["restore-from"]),_historySupport.stateCache=null}},handlePop:function(a){var b=a.state;if(b&&b["ic-setlocation"]){var c=findById(b["id-to-restore"]),d=getParametersForElement(c);return d+="&ic-handle-pop=true",handleRemoteRequest(c,"GET",b["restore-from"],d,function(a){c.trigger("handlePop.ic",c,a),processICResponse(a,c)}),!0}return!1}};return $(function(){processNodes("body"),_historySupport.onPageLoad()}),{refresh:function(a){return"string"==typeof a||a instanceof String?refreshDependencies(a):fireICRequest(a),Intercooler},defaultTransition:function(a){_defaultTransition=a},defineTransition:function(a,b){_defineTransition(a,b)},addURLHandler:function(a){if(!a.url)throw"Handlers must include a URL pattern";return _urlHandlers.push(a),Intercooler},setRemote:function(a){return _remote=a,Intercooler}}}(); --------------------------------------------------------------------------------