├── .gitignore ├── Gruntfile.js ├── LICENSE ├── README.md ├── RELEASE-CHECKLIST.md ├── bower.json ├── package-lock.json ├── package.json ├── src ├── intercooler-debugger.js └── intercooler.js ├── test ├── gen_tests.rb ├── jQuery1_unit_tests.html ├── jQuery2_unit_tests.html ├── lib │ ├── blanket.min.js │ ├── jquery-1.10.2.js │ ├── jquery-2.2.4.js │ ├── jquery-3.1.1.js │ ├── jquery.mockjax-1.10.2.js │ ├── jquery.mockjax-2.2.1.js │ ├── zepto-1.2.0.min.js │ ├── zepto.data-1.2.0.js │ └── zepto.mockjax-1.2.0.js ├── scratch.html ├── unit_tests.html └── zepto_unit_tests.html └── www ├── .ruby-gemset ├── .ruby-version ├── CNAME ├── Capfile ├── Gemfile ├── Gemfile.lock ├── _config.yml ├── _includes ├── action_common.html ├── events_api.html ├── javascript_api.html ├── request_api.html └── response_api.html ├── _layouts ├── blog.html ├── blog_post.html ├── default.html └── history.html ├── _plugins └── nav_tags.rb ├── _posts ├── 2015-1-27-angular-intercooler-comparison.md ├── 2015-12-28-intercooler-0.9.1-released.md ├── 2015-5-16-there-is-no-need-to-be-complex.md ├── 2016-1-1-intercooler-0.9.2-released.md ├── 2016-1-1-n-reasons-to-try-intercooler-this-year.md ├── 2016-1-15-intercooler-0.9.3-released.md ├── 2016-1-18-rescuing-rest.md ├── 2016-1-29-intercooler-0.9.4-released.md ├── 2016-10-14-full-stack-the-easy-way.md ├── 2016-10-5-how-it-feels-to-learn-intercooler-in-2016.md ├── 2016-11-22-intercooler-1.0.3-released.md ├── 2016-11-28-server-sent-events.md ├── 2016-2-17-api-churn-vs-security.md ├── 2016-3-15-hypertext-hypotext.md ├── 2016-4-22-intercooler-0.9.6-released.md ├── 2016-4-8-intercooler-0.9.5-released.md ├── 2016-5-19-back-to-the-future.md ├── 2016-5-24-twelve-html-attributes.html ├── 2016-5-25-twelve-html-attributes-explained.html ├── 2016-5-8-hatoeas-is-for-humans.md ├── 2016-6-24-intercooler-0.9.7-released.md ├── 2016-9-12-intercooler-1.0.0-released.md ├── 2016-9-26-intercooler-official-soundtrack.md ├── 2016-9-30-intercooler-1.0.1-released.md ├── 2017-01-16-stupid-client-side-tricks.md ├── 2017-10-27-intercooler-1.2.0-released.md ├── 2017-12-15-intercooler-1.2.1-released.md ├── 2017-2-17-intercooler-1.1.0-released.md ├── 2017-6-22-five-reasons-to-consider-the-server-side.md ├── 2018-1-4-a-few-reasons-to-try-intercooler-in-2018.md ├── 2019-11-01-intercooler-1.2.3-released.md ├── 2019-3-29-intercooler-1.2.2-released.md ├── 2020-01-14-taking-HTML-seriously.md └── 2024-12-29-intercooler-1.2.4-released.md ├── angular-to-intercooler-tutorial.html ├── attributes ├── ic-action-target.html ├── ic-action.html ├── ic-add-class.html ├── ic-append-from.html ├── ic-attr-src.html ├── ic-confirm.html ├── ic-delete-from.html ├── ic-deps.html ├── ic-disable-when-doc-hidden.html ├── ic-disable-when-doc-inactive.html ├── ic-enhance.html ├── ic-fix-ids.html ├── ic-get-from.html ├── ic-global-include.html ├── ic-global-indicator.html ├── ic-history-elt.html ├── ic-include.html ├── ic-indicator.html ├── ic-limit-children.html ├── ic-local-vars.html ├── ic-on-beforeSend.html ├── ic-on-beforeTrigger.html ├── ic-on-complete.html ├── ic-on-error.html ├── ic-on-success.html ├── ic-patch-to.html ├── ic-pause-polling.html ├── ic-poll-repeats.html ├── ic-poll.html ├── ic-post-errors-to.html ├── ic-post-to.html ├── ic-prepend-from.html ├── ic-prompt.html ├── ic-push-params.html ├── ic-push-url.html ├── ic-put-to.html ├── ic-remove-after.html ├── ic-remove-class.html ├── ic-replace-target.html ├── ic-scroll-offset.html ├── ic-scroll-to-target.html ├── ic-select-from-response.html ├── ic-src.html ├── ic-sse-src.html ├── ic-style-src.html ├── ic-swap-style.html ├── ic-switch-class.html ├── ic-target.html ├── ic-transform-response.html ├── ic-transition-duration.html ├── ic-trigger-delay.html ├── ic-trigger-from.html ├── ic-trigger-on.html └── ic-verb.html ├── blog.html ├── config └── deploy.rb ├── css └── site.css ├── docs.html ├── download.html ├── dump.rdb ├── examples.html ├── examples ├── activesearch.html ├── bootstrap-dialog.css ├── bootstrap-dialog.js ├── bootstrap3-typeahead.js ├── bootstrap_confirm.html ├── bulkupdate.html ├── clicktoedit.html ├── clicktoload.html ├── debugging.html ├── deleterow.html ├── dependentselect.html ├── history_tab1.html ├── history_tab2.html ├── history_tab3.html ├── index.html ├── infinitescroll.html ├── inlinevalidation.html ├── jobrunner.html ├── lazyload.html ├── modifying_requests.html ├── pause_play.html ├── prototyping.html ├── sortablelist.html └── typeahead.html ├── getting_to_intercooler.html ├── images ├── Intercooler_CMYK.png ├── Intercooler_CMYK_noType.png ├── Intercooler_CMYK_noType_64.png ├── Intercooler_CMYK_noType_ico.png ├── Intercooler_CMYK_noType_square.png ├── Intercooler_K.png ├── Intercooler_K_noType.png ├── Intercooler_reverse.png ├── Intercooler_reverse_noType.png ├── JSchemaTickerwatch.mp4 ├── back_to_the_future.png ├── maxcdn-logo-200px.png ├── pvc_request.svg ├── there-is-no-need-to-be-complex.png └── tokyo.png ├── index.html ├── js └── google-code-prettify │ ├── lang-apollo.js │ ├── lang-basic.js │ ├── lang-clj.js │ ├── lang-css.js │ ├── lang-dart.js │ ├── lang-erlang.js │ ├── lang-go.js │ ├── lang-hs.js │ ├── lang-lisp.js │ ├── lang-llvm.js │ ├── lang-lua.js │ ├── lang-matlab.js │ ├── lang-ml.js │ ├── lang-mumps.js │ ├── lang-n.js │ ├── lang-pascal.js │ ├── lang-proto.js │ ├── lang-r.js │ ├── lang-rd.js │ ├── lang-scala.js │ ├── lang-sql.js │ ├── lang-tcl.js │ ├── lang-tex.js │ ├── lang-vb.js │ ├── lang-vhdl.js │ ├── lang-wiki.js │ ├── lang-xq.js │ ├── lang-yaml.js │ ├── prettify.css │ ├── prettify.js │ ├── run_prettify.js │ └── skins │ └── desert.css ├── reference.html ├── release ├── CHANGES.html ├── blanket.min.js ├── intercooler-0.0.1-prealpha-1.js ├── intercooler-0.0.1-prealpha-1.min.js ├── intercooler-0.0.1.js ├── intercooler-0.0.1.min.js ├── intercooler-0.2.0.js ├── intercooler-0.2.0.min.js ├── intercooler-0.3.0.js ├── intercooler-0.3.0.min.js ├── intercooler-0.3.1.js ├── intercooler-0.3.1.min.js ├── intercooler-0.3.2.js ├── intercooler-0.3.2.min.js ├── intercooler-0.4.0.js ├── intercooler-0.4.0.min.js ├── intercooler-0.4.1.js ├── intercooler-0.4.1.min.js ├── intercooler-0.4.10.js ├── intercooler-0.4.10.min.js ├── intercooler-0.4.5.js ├── intercooler-0.4.5.min.js ├── intercooler-0.4.6.js ├── intercooler-0.4.6.min.js ├── intercooler-0.4.7.js ├── intercooler-0.4.7.min.js ├── intercooler-0.4.8.js ├── intercooler-0.4.8.min.js ├── intercooler-0.4.9.js ├── intercooler-0.4.9.min.js ├── intercooler-0.9.0.js ├── intercooler-0.9.0.min.js ├── intercooler-0.9.1.js ├── intercooler-0.9.1.min.js ├── intercooler-0.9.2.js ├── intercooler-0.9.2.min.js ├── intercooler-0.9.3.js ├── intercooler-0.9.3.min.js ├── intercooler-0.9.4.js ├── intercooler-0.9.4.min.js ├── intercooler-0.9.5.js ├── intercooler-0.9.5.min.js ├── intercooler-0.9.6.js ├── intercooler-0.9.6.min.js ├── intercooler-0.9.7.js ├── intercooler-0.9.7.min.js ├── intercooler-1.0.0.js ├── intercooler-1.0.0.min.js ├── intercooler-1.0.1.js ├── intercooler-1.0.1.min.js ├── intercooler-1.0.2.js ├── intercooler-1.0.2.min.js ├── intercooler-1.0.3.js ├── intercooler-1.0.3.min.js ├── intercooler-1.0.4.js ├── intercooler-1.0.4.min.js ├── intercooler-1.1.0.js ├── intercooler-1.1.0.min.js ├── intercooler-1.1.1.js ├── intercooler-1.1.1.min.js ├── intercooler-1.1.2.js ├── intercooler-1.1.2.min.js ├── intercooler-1.2.0.js ├── intercooler-1.2.0.min.js ├── intercooler-1.2.1.js ├── intercooler-1.2.1.min.js ├── intercooler-1.2.2.js ├── intercooler-1.2.2.min.js ├── intercooler-1.2.3.js ├── intercooler-1.2.3.min.js ├── intercooler-1.2.4.js ├── intercooler-1.2.4.min.js ├── intercooler-debugger.js ├── jQuery1_unit-tests-1.1.0.html ├── jQuery1_unit-tests-1.1.1.html ├── jQuery1_unit-tests-1.1.2.html ├── jQuery1_unit-tests-1.2.0.html ├── jQuery1_unit-tests-1.2.1.html ├── jQuery1_unit-tests-1.2.2.html ├── jQuery1_unit-tests-1.2.3.html ├── jQuery1_unit-tests-1.2.4.html ├── jQuery2_unit-tests-1.1.0.html ├── jQuery2_unit-tests-1.1.1.html ├── jQuery2_unit-tests-1.1.2.html ├── jQuery2_unit-tests-1.2.0.html ├── jQuery2_unit-tests-1.2.1.html ├── jQuery2_unit-tests-1.2.2.html ├── jQuery2_unit-tests-1.2.3.html ├── jQuery2_unit-tests-1.2.4.html ├── jquery.mockjax.js ├── lib │ ├── jquery-1.10.2.js │ ├── jquery-2.2.4.js │ ├── jquery-3.1.1.js │ ├── jquery.mockjax-1.10.2.js │ ├── jquery.mockjax-2.2.1.js │ ├── zepto-1.2.0.min.js │ ├── zepto.data-1.2.0.js │ └── zepto.mockjax-1.2.0.js ├── unit-tests-0.3.0.html ├── unit-tests-0.3.1.html ├── unit-tests-0.3.2.html ├── unit-tests-0.4.0.html ├── unit-tests-0.4.1.html ├── unit-tests-0.4.10.html ├── unit-tests-0.4.5.html ├── unit-tests-0.4.6.html ├── unit-tests-0.4.7.html ├── unit-tests-0.4.8.html ├── unit-tests-0.4.9.html ├── unit-tests-0.9.0.html ├── unit-tests-0.9.1.html ├── unit-tests-0.9.2.html ├── unit-tests-0.9.3.html ├── unit-tests-0.9.4.html ├── unit-tests-0.9.5.html ├── unit-tests-0.9.6.html ├── unit-tests-0.9.7.html ├── unit-tests-1.0.0.html ├── unit-tests-1.0.1.html ├── unit-tests-1.0.2.html ├── unit-tests-1.0.3.html ├── unit-tests-1.0.4.html ├── unit-tests-1.1.0.html ├── unit-tests-1.1.1.html ├── unit-tests-1.1.2.html ├── unit-tests-1.1.2.min.html ├── unit-tests-1.2.0.html ├── unit-tests-1.2.0.min.html ├── unit-tests-1.2.1.html ├── unit-tests-1.2.1.min.html ├── unit-tests-1.2.2.html ├── unit-tests-1.2.2.min.html ├── unit-tests-1.2.3.html ├── unit-tests-1.2.3.min.html ├── unit-tests-1.2.4.html ├── unit-tests-1.2.4.min.html ├── upgrade-steps-0.3.0.html ├── zepto_unit-tests-1.1.0.html ├── zepto_unit-tests-1.1.1.html ├── zepto_unit-tests-1.1.2.html ├── zepto_unit-tests-1.2.0.html ├── zepto_unit-tests-1.2.1.html ├── zepto_unit-tests-1.2.2.html ├── zepto_unit-tests-1.2.3.html └── zepto_unit-tests-1.2.4.html ├── tutorials ├── bulk_ops.html ├── click_to_load.html ├── crud.html ├── flash.html ├── index.html ├── infinite.html └── inline_validation.html └── why.html /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .DS_Store 3 | intercooler-js.iml 4 | www/.last_published 5 | www/_site/ 6 | node_modules 7 | rails-demo 8 | 9 | # Dist folder is only for deployment to bower/npm/etc... 10 | # Dist should contain unversioned files as bower/npm/etc is what does the versioning for these files 11 | /dist/* 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2010-2015 LeadDyno, 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | ## htmx 6 | 7 | intercooler 2.0 (renamed to htmx 1.0) has been released. It is smaller, more expressive and no longer has a 8 | dependency on jQuery. 9 | 10 | You can view the new website here: 11 | 12 | [http://htmx.org](http://htmx.org) 13 | 14 | And the new repo here: 15 | 16 | [https://github.com/bigskysoftware/htmx](https://github.com/bigskysoftware/htmx) 17 | 18 | --- 19 | 20 | ## Introduction 21 | 22 | Intercooler is a small (6.74KB gzipped) [jQuery](https://jquery.com/) or [zepto.js](http://intercoolerjs.org/docs.html#zepto) based library that allows you to add AJAX to 23 | your application using HTML attributes. 24 | 25 | Here is an example: 26 | 27 | ```html 28 | 30 | 33 | ``` 34 | 35 | Despite this simplicity, intercooler supports quite a bit of functionality: 36 | 37 | * It allows you to [specify the UI event](http://intercoolerjs.org/docs.html#triggers) that triggers the AJAX request 38 | * It makes [progress indicators](http://intercoolerjs.org/docs.html#progress) very simple to add 39 | * It supports many [custom HTTP response headers](http://intercoolerjs.org/docs.html#responses) for things like client-side redirection 40 | * It has a [REST-ful dependency mechanism](http://intercoolerjs.org/docs.html#dependencies) 41 | * It has simple [AJAX history & back-button support](http://intercoolerjs.org/docs.html#history) 42 | * It provides a [rich event model](http://intercoolerjs.org/docs.html#events) 43 | * [And much more...](http://intercoolerjs.org/docs.html) 44 | 45 | These features allow you to build modern web applications with little fuss, using a simple and intuitive REST-ful architecture that ensures good performance, excellent user experience and a minimum of complexity. 46 | 47 | It also is very easy to incrementally retrofit intercooler into existing web applications to add AJAX functionality where 48 | it is most valuable. 49 | 50 | Full documentation is available on the [main intercooler website](http://intercoolerjs.org/) 51 | 52 | ## Installing 53 | 54 | Intercooler can be downloaded or hot-linked [from the downloads page](http://intercoolerjs.org/download.html). 55 | 56 | Or installed via bower: 57 | 58 | ```javascript 59 | "dependencies": { 60 | "intercooler-js" : "1.2.0" 61 | } 62 | ``` 63 | 64 | Intercooler depends on [jQuery](https://jquery.com/) v1.10.0 or higher. 65 | 66 | ## License 67 | 68 | Intercooler is licenced under the [MIT License](https://raw.githubusercontent.com/LeadDyno/intercooler-js/master/LICENSE) 69 | 70 | ## Official Theme Music 71 | 72 | [Rober Parker](https://robertparkerofficial.bandcamp.com/) 73 | 74 | ## Contributing 75 | 76 | To contribute a change to intercooler: 77 | 78 | * Fork the main intercooler repository 79 | * Create a new feature branch based on the `development` branch with a reasonably descriptive name (e.g. `fix_http_get_parameter_overriding`) 80 | * Implement your fix 81 | * Add a test to `/test/unit_tests.html`. (It's pretty easy!) 82 | * Create a pull request for that branch against `development` in the main repository 83 | 84 | Thank you to [all the contributors](https://github.com/LeadDyno/intercooler-js/graphs/contributors)! 85 | 86 | 🕊️🕊️🕊️ 87 | -------------------------------------------------------------------------------- /RELEASE-CHECKLIST.md: -------------------------------------------------------------------------------- 1 | ## Intercooler Release Checklist 2 | 3 | ### Ready 4 | * Ensure correct version numbers are in `bower.json` and `package.json` 5 | * Run `ruby gen_tests.rb` in the `/tests` directory to ensure all tests are up to date 6 | * Run /node_modules/.bin/grunt to generate latest version of intercooler release and tests 7 | * Search and replace current version for new version in `/www` 8 | * Do not replace in `download.html`, `CHANGES.html`, and `www/release` 9 | 10 | ### Aim 11 | 12 | * Ensure there is an entry in `CHANGES.html` with a proper anchor 13 | * Add an entry in `downloads.html` for the new release, that points to the proper files in `/releases` 14 | * _OPTIONAL:_ Hide an older release by moving it to the `#older` list 15 | * Create a blog post for the release in `www/_posts` 16 | * Run **ALL** test files in Chrome, Firefox and Safari browsers (run jekyll locally) 17 | 18 | ### Fire! 19 | 20 | * Run `git tag vRELEASEVERSION` 21 | * Checkout `master` and merge `development` 22 | * Run `git push origin --tags` 23 | * Run `npm publish` to publish to NPM 24 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "intercooler-js", 3 | "version":"1.2.4", 4 | "homepage": "https://github.com/LeadDyno/intercooler-js", 5 | "main": "src/intercooler.js", 6 | "license": "MIT", 7 | "ignore": [ 8 | "**/.*", 9 | "build", 10 | "speed", 11 | "test", 12 | "*.md", 13 | "AUTHORS.txt", 14 | "Gruntfile.js", 15 | "package.json", 16 | "www" 17 | ], 18 | "keywords": [ 19 | "intercooler", 20 | "ajax", 21 | "intercoolerjs" 22 | ], 23 | "dependencies": { 24 | "jquery": ">=1.10.0" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "intercooler", 3 | "version": "1.2.4", 4 | "description": "Making AJAX as easy as anchor tags", 5 | "homepage": "http://intercoolerjs.org", 6 | "author": { 7 | "name": "LeadDyno, LLC", 8 | "url": "http://www.leaddyno.com" 9 | }, 10 | "keywords": [ 11 | "ajax", 12 | "anchor", 13 | "attribute" 14 | ], 15 | "license": "MIT", 16 | "main": "dist/intercooler.js", 17 | "repository": { 18 | "type": "git", 19 | "url": "git://github.com/LeadDyno/intercooler-js" 20 | }, 21 | "devDependencies": { 22 | "grunt": "^1.0.0", 23 | "grunt-contrib-jshint": "^1.0.0", 24 | "grunt-contrib-nodeunit": "^1.0.0", 25 | "grunt-contrib-uglify": "^2.0.0", 26 | "grunt-regex-replace": "^0.3.0", 27 | "grunt-umd": "^2.3.6" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /test/gen_tests.rb: -------------------------------------------------------------------------------- 1 | VARIANTS = 2 | { 3 | 'zepto' => 4 | ' 5 | 6 | 16 | ', 17 | 18 | 'jQuery1' => 19 | ' 20 | ', 21 | 22 | 'jQuery2' => 23 | ' 24 | ', 25 | 26 | 'jQuery3' => 27 | ' 28 | ' 29 | } 30 | 31 | VARIANTS.each do |name, script| 32 | output = '' 33 | in_script = false 34 | File.open('unit_tests.html').each do |line| 35 | if in_script 36 | if line.include? "" 37 | output += script 38 | in_script = false 39 | end 40 | else 41 | if line.include? "" 42 | in_script = true 43 | else 44 | output += line 45 | end 46 | end 47 | end 48 | File.write("#{name}_unit_tests.html", output) 49 | end 50 | 51 | -------------------------------------------------------------------------------- /test/lib/zepto.data-1.2.0.js: -------------------------------------------------------------------------------- 1 | // Zepto.js 2 | // (c) 2010-2016 Thomas Fuchs 3 | // Zepto.js may be freely distributed under the MIT license. 4 | 5 | // The following code is heavily inspired by jQuery's $.fn.data() 6 | 7 | ;(function($){ 8 | var data = {}, dataAttr = $.fn.data, camelize = $.camelCase, 9 | exp = $.expando = 'Zepto' + (+new Date()), emptyArray = [] 10 | 11 | // Get value from node: 12 | // 1. first try key as given, 13 | // 2. then try camelized key, 14 | // 3. fall back to reading "data-*" attribute. 15 | function getData(node, name) { 16 | var id = node[exp], store = id && data[id] 17 | if (name === undefined) return store || setData(node) 18 | else { 19 | if (store) { 20 | if (name in store) return store[name] 21 | var camelName = camelize(name) 22 | if (camelName in store) return store[camelName] 23 | } 24 | return dataAttr.call($(node), name) 25 | } 26 | } 27 | 28 | // Store value under camelized key on node 29 | function setData(node, name, value) { 30 | var id = node[exp] || (node[exp] = ++$.uuid), 31 | store = data[id] || (data[id] = attributeData(node)) 32 | if (name !== undefined) store[camelize(name)] = value 33 | return store 34 | } 35 | 36 | // Read all "data-*" attributes from a node 37 | function attributeData(node) { 38 | var store = {} 39 | $.each(node.attributes || emptyArray, function(i, attr){ 40 | if (attr.name.indexOf('data-') == 0) 41 | store[camelize(attr.name.replace('data-', ''))] = 42 | $.zepto.deserializeValue(attr.value) 43 | }) 44 | return store 45 | } 46 | 47 | $.fn.data = function(name, value) { 48 | return value === undefined ? 49 | // set multiple values via object 50 | $.isPlainObject(name) ? 51 | this.each(function(i, node){ 52 | $.each(name, function(key, value){ setData(node, key, value) }) 53 | }) : 54 | // get value from first element 55 | (0 in this ? getData(this[0], name) : undefined) : 56 | // set value on all elements 57 | this.each(function(){ setData(this, name, value) }) 58 | } 59 | 60 | $.data = function(elem, name, value) { 61 | return $(elem).data(name, value) 62 | } 63 | 64 | $.hasData = function(elem) { 65 | var id = elem[exp], store = id && data[id] 66 | return store ? !$.isEmptyObject(store) : false 67 | } 68 | 69 | $.fn.removeData = function(names) { 70 | if (typeof names == 'string') names = names.split(/\s+/) 71 | return this.each(function(){ 72 | var id = this[exp], store = id && data[id] 73 | if (store) $.each(names || store, function(key){ 74 | delete store[names ? camelize(this) : key] 75 | }) 76 | }) 77 | } 78 | 79 | // Generate extended `remove` and `empty` functions 80 | ;['remove', 'empty'].forEach(function(methodName){ 81 | var origFn = $.fn[methodName] 82 | $.fn[methodName] = function() { 83 | var elements = this.find('*') 84 | if (methodName === 'remove') elements = elements.add(this) 85 | elements.removeData() 86 | return origFn.call(this) 87 | } 88 | }) 89 | })(Zepto) -------------------------------------------------------------------------------- /test/scratch.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 21 |
27 | 28 | 38 | 39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | 47 |
48 |

Hello World...

49 |
50 | 51 | 52 | -------------------------------------------------------------------------------- /www/.ruby-gemset: -------------------------------------------------------------------------------- 1 | intercoolerjs-www 2 | -------------------------------------------------------------------------------- /www/.ruby-version: -------------------------------------------------------------------------------- 1 | ruby-2.4.4 2 | -------------------------------------------------------------------------------- /www/CNAME: -------------------------------------------------------------------------------- 1 | intercoolerjs.org -------------------------------------------------------------------------------- /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 -------------------------------------------------------------------------------- /www/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'capistrano', '2.15.4' 4 | gem 'jekyll' 5 | gem 'capistrano-s3' 6 | -------------------------------------------------------------------------------- /www/Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | addressable (2.5.2) 5 | public_suffix (>= 2.0.2, < 4.0) 6 | aws-sdk (2.11.169) 7 | aws-sdk-resources (= 2.11.169) 8 | aws-sdk-core (2.11.169) 9 | aws-sigv4 (~> 1.0) 10 | jmespath (~> 1.0) 11 | aws-sdk-resources (2.11.169) 12 | aws-sdk-core (= 2.11.169) 13 | aws-sigv4 (1.0.3) 14 | capistrano (2.15.4) 15 | highline 16 | net-scp (>= 1.0.0) 17 | net-sftp (>= 2.0.0) 18 | net-ssh (>= 2.0.14) 19 | net-ssh-gateway (>= 1.1.0) 20 | capistrano-s3 (2.3.0) 21 | aws-sdk (~> 2.6) 22 | capistrano (>= 2) 23 | mime-types 24 | colorator (1.1.0) 25 | concurrent-ruby (1.1.3) 26 | em-websocket (0.5.1) 27 | eventmachine (>= 0.12.9) 28 | http_parser.rb (~> 0.6.0) 29 | eventmachine (1.2.7) 30 | ffi (1.9.25) 31 | forwardable-extended (2.6.0) 32 | highline (2.0.0) 33 | http_parser.rb (0.6.0) 34 | i18n (0.9.5) 35 | concurrent-ruby (~> 1.0) 36 | jekyll (3.8.5) 37 | addressable (~> 2.4) 38 | colorator (~> 1.0) 39 | em-websocket (~> 0.5) 40 | i18n (~> 0.7) 41 | jekyll-sass-converter (~> 1.0) 42 | jekyll-watch (~> 2.0) 43 | kramdown (~> 1.14) 44 | liquid (~> 4.0) 45 | mercenary (~> 0.3.3) 46 | pathutil (~> 0.9) 47 | rouge (>= 1.7, < 4) 48 | safe_yaml (~> 1.0) 49 | jekyll-sass-converter (1.5.2) 50 | sass (~> 3.4) 51 | jekyll-watch (2.1.2) 52 | listen (~> 3.0) 53 | jmespath (1.4.0) 54 | kramdown (1.17.0) 55 | liquid (4.0.1) 56 | listen (3.1.5) 57 | rb-fsevent (~> 0.9, >= 0.9.4) 58 | rb-inotify (~> 0.9, >= 0.9.7) 59 | ruby_dep (~> 1.2) 60 | mercenary (0.3.6) 61 | mime-types (3.2.2) 62 | mime-types-data (~> 3.2015) 63 | mime-types-data (3.2018.0812) 64 | net-scp (1.2.1) 65 | net-ssh (>= 2.6.5) 66 | net-sftp (2.1.2) 67 | net-ssh (>= 2.6.5) 68 | net-ssh (5.0.2) 69 | net-ssh-gateway (2.0.0) 70 | net-ssh (>= 4.0.0) 71 | pathutil (0.16.2) 72 | forwardable-extended (~> 2.6) 73 | public_suffix (3.0.3) 74 | rb-fsevent (0.10.3) 75 | rb-inotify (0.9.10) 76 | ffi (>= 0.5.0, < 2) 77 | rouge (3.3.0) 78 | ruby_dep (1.5.0) 79 | safe_yaml (1.0.4) 80 | sass (3.7.2) 81 | sass-listen (~> 4.0.0) 82 | sass-listen (4.0.0) 83 | rb-fsevent (~> 0.9, >= 0.9.4) 84 | rb-inotify (~> 0.9, >= 0.9.7) 85 | 86 | PLATFORMS 87 | ruby 88 | 89 | DEPENDENCIES 90 | capistrano (= 2.15.4) 91 | capistrano-s3 92 | jekyll 93 | 94 | BUNDLED WITH 95 | 1.16.4 96 | -------------------------------------------------------------------------------- /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 | - vendor 9 | -------------------------------------------------------------------------------- /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 | 20 |

Using Real HTTP Methods

21 | 22 |

By default, intercooler uses POST's for all non-GET requests, due to older browser 23 | limitations. It includes the _method parameter and the X-HTTP-Method-Override headers 24 | that indicate the intended HTTP method, but some server-side infrastructure might not understand these conventions.

25 | 26 |

If you wish to use the actual HTTP method and forgo older browser support, you can use the following meta tag 27 | in your head tag:

28 | 29 |
<meta name="intercoolerjs:use-actual-http-method" content="true"/>
-------------------------------------------------------------------------------- /www/_layouts/blog.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 |
6 | 7 |
8 |
9 |
10 | 11 |

{{ page.title }}
{{ page.date | date: "%-d %B %Y" }}

12 | 13 |
14 | 15 |
16 | {{content}} 17 |
18 |
19 |
20 |
21 |
-------------------------------------------------------------------------------- /www/_layouts/blog_post.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: blog 3 | --- 4 | 5 | {{content}} 6 |
7 |
8 |

| The Comments Section |

9 |
10 |
11 | 31 | -------------------------------------------------------------------------------- /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/_posts/2015-1-27-angular-intercooler-comparison.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: blog_post 3 | nav: blog 4 | --- 5 | 6 | This tutorial walks through the [Angular JS](https://docs.angularjs.org/tutorial/step_00) tutorial and shows 7 | you the corresponding intercooler concepts. 8 | 9 | #### Bootstrapping 10 | To bootstrap intercooler, include the source from the [download page](/download.html). 11 | 12 | ####Injectors 13 | There are no injectors in intercooler. 14 | 15 | ####Scopes 16 | There are no scopes in intercooler. 17 | 18 | ####Static Templates 19 | There are no templates in intercooler. 20 | 21 | ####Angular Dynamic Templates 22 | There are no templates in intercooler. 23 | 24 | ####Models 25 | There are no models in intercooler. 26 | 27 | ####Controllers 28 | There are no controllers in intercooler. 29 | 30 | ####Modules 31 | There are no modules in intercooler. 32 | 33 | ####Filtering Repeaters 34 | There are no filtering repeaters in intercooler. 35 | 36 | ####Two-way Data Binding 37 | There is no two-way data binding in intercooler. 38 | 39 | ####XHRs & Dependency Injection 40 | 41 | You don't need to deal with XHRs in intercooler. 42 | 43 | There is no dependency injection in intercooler. 44 | 45 | ####Prefix Naming Convention 46 | 47 | There is no prefix naming convention in intercooler. 48 | 49 | There are no minification issues in intercooler. 50 | 51 | ####Routing & Multiple Views 52 | 53 | There is no routing in intercooler. 54 | 55 | There is nothing special about multiple views in intercooler. 56 | 57 | ####Filters 58 | 59 | There are no filters in intercooler. 60 | 61 | ####Event Handlers 62 | 63 | There is not a custom event mechanism in intercooler. Just use JQuery. 64 | 65 | ####REST and Custom Services 66 | 67 | There is nothing special about REST-ful end points in intercooler. 68 | 69 | There is no need for a custom services in intercooler. 70 | 71 | ####Applying Animations 72 | 73 | Use the `ic-adding` and `ic-removing` classes and CSS3 animations to specify an animation in intercooler. 74 | 75 | ## The End 76 | 77 | That's it! You now know how Angular and intercooler compare with one another, and how to port 78 | an Angular application to intercooler! 79 | -------------------------------------------------------------------------------- /www/_posts/2015-12-28-intercooler-0.9.1-released.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: blog_post 3 | nav: blog 4 | --- 5 | 6 | I have released intercooler v0.9.1, available on the main site, as well as through bower. 7 | 8 | 9 | 10 | This is mostly a bug-fix release, but it does contain one new attribute, the ic-action attribute I discussed earlier: 11 | 12 | 13 | 14 | This lets you implement purely client-side actions in intercooler without a server request: 15 | 16 | 17 | 18 | This would fade out and then remove the closest div to the button, using the proper callback mechanism in jQuery. Documentation and examples are here: 19 | 20 | 21 | 22 | This concludes the client-side functionality of intercooler (everything else should be done using standard jQuery techniques) :) 23 | 24 | The remaining outstanding items on the road to 1.0 are: 25 | 26 | * [https://github.com/intercoolerjs/intercooler-js/issues/60](https://github.com/intercoolerjs/intercooler-js/issues/60) - an option for a data-prefix 27 | * [https://github.com/intercoolerjs/intercooler-js/issues/54](https://github.com/intercoolerjs/intercooler-js/issues/54) - File upload handling 28 | 29 | I hope to have both of these done at some point in January, and we can all have a big 1.0 launch party: -------------------------------------------------------------------------------- /www/_posts/2015-5-16-there-is-no-need-to-be-complex.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: blog_post 3 | nav: blog 4 | --- 5 | 6 | ![There is no need to be complex](/images/there-is-no-need-to-be-complex.png) -------------------------------------------------------------------------------- /www/_posts/2016-1-1-intercooler-0.9.2-released.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: blog_post 3 | nav: blog 4 | --- 5 | 6 | I have released intercooler v0.9.2, available on the main site, as well as through bower. 7 | 8 | 9 | 10 | The big change in this release is that intercooler now has support for file upload. 11 | 12 | 13 | 14 | I also made a slight tweak to the semantics of the ic-action attribute to make it more compatible with jQuery 15 | actions: 16 | 17 | 18 | 19 | **The Road to 1.0** 20 | 21 | I'm hoping to be able to find some time today to finish my last pre-1.0 item: 22 | 23 | * [https://github.com/intercoolerjs/intercooler-js/issues/60](https://github.com/intercoolerjs/intercooler-js/issues/60) - an option for a data-prefix 24 | 25 | When I'm done with that I will release a v0.9.3, which will be intercooler 1.0-alpha1. 26 | 27 | **A Blog!** 28 | 29 | Finally, I'm happy to announce that I have set up a blog on the intercooler website: 30 | 31 | 32 | 33 | I'd love to have intercooler users contribute posts (particularly about how to user intercooler on various server-side 34 | platforms). If you'd like to contribute, simply fork the intercooler codebase and add a markdown file here: 35 | 36 | [https://github.com/intercoolerjs/intercooler-js/tree/master/www/_posts](https://github.com/intercoolerjs/intercooler-js/tree/master/www/_posts) 37 | 38 | Then issue a pull request and I'll merge it and publish it out. 39 | 40 | Happy New Year! 41 | 42 | Carson 43 | [@carson_gross](https://twitter.com/carson_gross) -------------------------------------------------------------------------------- /www/_posts/2016-1-15-intercooler-0.9.3-released.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: blog_post 3 | nav: blog 4 | --- 5 | 6 | I have released intercooler v0.9.3, available on the main site, as well as through bower. 7 | 8 | 9 | 10 | Intercooler now supports for the `data-*` prefix on attributes via the `` meta-tag. 11 | 12 | I also introduced the beforeAjaxSend.ic(event, settings) event, which allows programmers to modify the setting hash passed 13 | to `$.ajax()` to do thinks like add headers, set content type, remove parameters, etc. 14 | 15 | Full release notes are here: 16 | 17 | 18 | 19 | **The Road to 1.0** 20 | 21 | v0.9.3 is the first release candidate for intercooler v1.0. My goal is to release v1.0 by the end of February. 22 | 23 | Carson / [@carson_gross](https://twitter.com/carson_gross) -------------------------------------------------------------------------------- /www/_posts/2016-1-29-intercooler-0.9.4-released.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: blog_post 3 | nav: blog 4 | --- 5 | 6 | I have released intercooler v0.9.4, available on the main site, as well as through bower. 7 | 8 | 9 | 10 | This is a bug fix release. 11 | 12 | **The Road to 1.0** 13 | 14 | v0.9.4 is the second release candidate for intercooler v1.0. My goal is to release v1.0 near the end of February. 15 | 16 | Carson / [@carson_gross](https://twitter.com/carson_gross) -------------------------------------------------------------------------------- /www/_posts/2016-10-5-how-it-feels-to-learn-intercooler-in-2016.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: blog_post 3 | nav: blog 4 | --- 5 | 6 | A hilarious blog post by [@jjperezaguinaga](https://twitter.com/jjperezaguinaga) entitled 7 | [“How it feels to learn Javascript in 2016”](https://hackernoon.com/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f#.bc2f5n47k) 8 | has sparked quite a bit of discussion. 9 | 10 | In the same vein I'd like to offer: 11 | 12 | ### How it feels to learn intercooler.js in 2016 13 | 14 | Hey, I got this new web project, but to be honest I haven’t coded much web in a few years and I’ve heard the 15 | landscape changed a bit. You are the most up-to date web dev around here right? 16 | 17 | *-Nope. I'm just an old web dev guy, but I do have a library I use for front end stuff* 18 | 19 | Cool. I need to create a page that displays the latest activity from the users, so I just need to get the data from the 20 | REST endpoint and display it in some sort of filterable table, and update it if anything changes in the server. I was 21 | thinking maybe using jQuery to fetch and display the data? 22 | 23 | *-Ah, it's easier than that now. You can just use HTML and a few intercooler.js attributes instead of JSON* 24 | 25 | Oh, OK. What's intercooler.js? 26 | 27 | *-A library built on top of jQuery that lets you hook AJAX requests into your DOM with HTML attributes.* 28 | 29 | That sounds neat. Can I use intercooler.js to display data from the server? 30 | 31 | *-Yep. Just return bits of HTML from your end points.* 32 | 33 | Wait, HTML? Just like normal web requests? 34 | 35 | *-Yep.* 36 | 37 | What’s wrong with HTML? 38 | 39 | *-Nothing, man. [HTML is great.](http://intercoolerjs.org/2016/01/18/rescuing-rest.html) Use it.* 40 | 41 | Right. OK, so how do I install it? 42 | 43 | *-Just include it along with jQuery, the usual way.* 44 | 45 | Oh, jQuery! I can still use that? 46 | 47 | *-Of course, man.* 48 | 49 | But I need to update this data if anything changes on the server. 50 | 51 | *-Sounds like you might want to use the [ic-poll](http://intercoolerjs.org/attributes/ic-poll.html) attribute.* 52 | 53 | Huh. OK. Anything else? 54 | 55 | *-Nah, man. Docs are [here](http://intercoolerjs.org/docs.html). Pretty much everything you used to know about webdev still applies, just use bits of 56 | HTML rather than whole documents. Oh, also, there is an 57 | [official music to program in intercooler.js](http://intercoolerjs.org/2016/09/26/intercooler-official-soundtrack.html) 58 | with, if you are interested.* 59 | 60 | Umm... OK. Thanks? 61 | 62 | *-Yep. Cheers.* 63 | 64 | Carson / [@carson_gross](https://twitter.com/carson_gross) -------------------------------------------------------------------------------- /www/_posts/2016-11-22-intercooler-1.0.3-released.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: blog_post 3 | nav: blog 4 | --- 5 | 6 | I have released intercooler v1.0.3, available on the main site, as well as through bower and NPM. 7 | 8 | 9 | 10 | The changes in this release are: 11 | 12 | * Added the `ic-action-target` attribute, allowing for a distinct target for the `ic-action` attribute. 13 | * Added the `ic-sse-src` attribute, allowing intercooler to utilize [Server Sent Events](/docs.html#sse) 14 | * Added the `ic-swap-style` attribute, making append/prepend explicit attribute-driven behaviors. 15 | * The `ic-poll` attribute now does not ignore dependencies. 16 | 17 | Carson / [@carson_gross](https://twitter.com/carson_gross) -------------------------------------------------------------------------------- /www/_posts/2016-4-22-intercooler-0.9.6-released.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: blog_post 3 | nav: blog 4 | --- 5 | 6 | I have released intercooler v0.9.6, available on the main site, as well as through bower. 7 | 8 | 9 | 10 | The changes in this release are: 11 | 12 | * Support for invocation of global functions in the [ic-action](/attributes/ic-action.html) attribute. 13 | * We now include the URL of the AJAX request that caused an error when we post errors to the server via the 14 | [ic-post-errors](/attributes/ic-post-errors-to.html) attribute. 15 | * For browser compatibility reasons, intercooler sends all non-GET AJAX requests at a POST, with standard 16 | metadata for frameworks to use to interpret the actual action. If you wish to use the actual HTTP method 17 | (e.g. `DELETE`) you can now set the meta tag value `intercoolerjs:use-actual-http-method` to `true` 18 | 19 | 20 | **The Road to 1.0** 21 | 22 | v0.9.6 is the fourth release candidate for intercooler v1.0. My goal is to release v1.0 in June. 23 | 24 | Carson / [@carson_gross](https://twitter.com/carson_gross) -------------------------------------------------------------------------------- /www/_posts/2016-4-8-intercooler-0.9.5-released.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: blog_post 3 | nav: blog 4 | --- 5 | 6 | I have released intercooler v0.9.5, available on the main site, as well as through bower. 7 | 8 | 9 | 10 | There is a potentially breaking change in this release: I have removed the `ic-last-refresh` parameter from 11 | requests. This was a poorly thought out feature and was causing some unintentional cache-busting on GETs 12 | issued by intercooler. 13 | 14 | There are also a few bug fixes in this release. 15 | 16 | **The Road to 1.0** 17 | 18 | v0.9.5 is the third release candidate for intercooler v1.0. My goal is to release v1.0 this summer. 19 | 20 | Carson / [@carson_gross](https://twitter.com/carson_gross) -------------------------------------------------------------------------------- /www/_posts/2016-5-19-back-to-the-future.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: blog_post 3 | nav: blog 4 | title: Back to the future 5 | --- 6 | 7 | They say a picture is worth a thousand words. 8 | 9 | Let's test that theory. 10 | 11 | 12 | 13 | ( A visual response to [/r/webdev/comments/4iphv4/12_year_of_progress/](https://www.reddit.com/r/webdev/comments/4iphv4/12_year_of_progress/) ) -------------------------------------------------------------------------------- /www/_posts/2016-5-24-twelve-html-attributes.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: blog_post 3 | nav: blog 4 | title: Twelve HTML Attributes 5 | --- 6 | 7 |

This little live stock quote app was built using intercooler and SparkJava by some 8 | UCSC students I have been working with.

9 | 10 |

It required only twelve intercooler attributes and two lines of javascript.

11 | 12 | 13 | 14 |

The source for this app is here.

-------------------------------------------------------------------------------- /www/_posts/2016-6-24-intercooler-0.9.7-released.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: blog_post 3 | nav: blog 4 | --- 5 | 6 | I have released intercooler v0.9.7, available on the main site, as well as through bower. 7 | 8 | 9 | 10 | The changes in this release are: 11 | 12 | * Support for setting title with the `X-IC-Title` response header 13 | * Support for reading and writing local variables stored in `localStorage` using 14 | the `ic-local-vars` attribute and `X-IC-Set-Local-Vars` response header. 15 | * Support the `autofocus` attribute in intercooler AJAX responses. 16 | 17 | **The Road to 1.0** 18 | 19 | v0.9.7 is the fourth release candidate for intercooler v1.0. My goal now is to release v1.0 in July or August, 20 | depending on how exploration of DOM-merging goes. 21 | 22 | Carson / [@carson_gross](https://twitter.com/carson_gross) -------------------------------------------------------------------------------- /www/_posts/2016-9-26-intercooler-official-soundtrack.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: blog_post 3 | nav: blog 4 | --- 5 | 6 | ## The Official Soundtrack of intercooler.js Programming 7 | 8 | After much research, I'm happy to announce that we have scientifically determined the optimal music to accompany 9 | programming in intercooler.js: 10 | 11 |
12 | 13 |
14 | 15 | Robert Parker's approach to music appropriately captures the spirit of intercooler's approach to web development: reaching 16 | back to take the best from the past, but adding a new, modern and unironic (mostly) take on it. 17 | 18 | [Just right.](http://i0.kym-cdn.com/photos/images/original/001/070/061/d96.jpg) 19 | 20 | Please support him here: 21 | 22 | [https://robertparkerofficial.bandcamp.com/](https://robertparkerofficial.bandcamp.com/) 23 | 24 | You can listen to his stuff on soundcloud: 25 | 26 | [https://soundcloud.com/robertparkerofficial](https://soundcloud.com/robertparkerofficial) 27 | 28 | Carson / [@carson_gross](https://twitter.com/carson_gross) -------------------------------------------------------------------------------- /www/_posts/2016-9-30-intercooler-1.0.1-released.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: blog_post 3 | nav: blog 4 | --- 5 | 6 | I have released intercooler v1.0.2, available on the main site, as well as through bower and NPM. 7 | 8 | 9 | 10 | The changes in this release are: 11 | 12 | * We now try to include the value of the button clicked when submitting a form by including the focused button value, if any. 13 | * Thanks to OvermindDL1's build work, we now play well with the Node ecosystem 14 | 15 | 16 | Carson / [@carson_gross](https://twitter.com/carson_gross) -------------------------------------------------------------------------------- /www/_posts/2017-10-27-intercooler-1.2.0-released.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: blog_post 3 | nav: blog 4 | --- 5 | 6 | I have released intercooler v1.2.0, available on the main site, as well as through bower and NPM. 7 | 8 | 9 | 10 | 11 | Changes in this release are: 12 | 13 | * `ic-disable-when-doc-hidden` and `ic-disable-when-doc-inactive` attributes allow you to pause polling when a browser 14 | isn't active 15 | * `ic-fix-ids` tells intercooler to make id's unique in a document dynamically 16 | * Better support for last-clicked elements in forms 17 | * Added `timeout:` syntax for `ic-trigger-on` attribute 18 | * Added four additional local action attributes: 19 | * ic-action-beforeSend 20 | * ic-action-success 21 | * ic-action-error 22 | * ic-action-complete 23 | 24 | These actions are fired during the jQuery AJAX life cycle. 25 | 26 | Enjoy, and thanks for using intercooler! 27 | 28 | Carson / [@carson_gross](https://twitter.com/carson_gross) -------------------------------------------------------------------------------- /www/_posts/2017-12-15-intercooler-1.2.1-released.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: blog_post 3 | nav: blog 4 | --- 5 | 6 | I have released intercooler v1.2.1, available on the main site, as well as through bower and NPM. 7 | 8 | 9 | 10 | 11 | Changes in this release are: 12 | 13 | * Added the once modifier to the ic-trigger-on 14 | attribute, to allow an event to trigger one and only one request. 15 | * Added the ic-transform-response attribute to 16 | allow transforming JSON responses from a server into HTML on the client side. 17 | 18 | * Fixed a bug that prevented ic-on-beforeTrigger from 19 | working properly 20 | 21 | Enjoy, and thanks for using intercooler! 22 | 23 | Carson / [@carson_gross](https://twitter.com/carson_gross) -------------------------------------------------------------------------------- /www/_posts/2017-2-17-intercooler-1.1.0-released.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: blog_post 3 | nav: blog 4 | --- 5 | 6 | I have released intercooler v1.1.1, available on the main site, as well as through bower and NPM. 7 | 8 | 9 | 10 | 11 | ### zepto.js Support! 12 | 13 | The biggest change in this release is that we now support [zepto](http://zeptojs.com/) as an alternative to jQuery 14 | as a base library. Zepto + intercooler comes in at ~18kB total, allowing you to build intercooler-based applications 15 | with a smaller javascript infrastructure than [almost all the other major javascript libraries](https://gist.github.com/Restuta/cda69e50a853aa64912d) 16 | out there (vue.js is 23kB), and, of course, you won't need to write much additional javascript at all, so your total 17 | javascript footprint can be quite small while still providing the user experience modern web sites require. 18 | 19 | Other changes in this release are: 20 | 21 | * We respect intercooler response headers even when error response codes are sent to the client (e.g. `X-IC-Redirect` on a 401 response) 22 | * We support a timed value (e.g. "200ms") for the `X-IC-Remove` header, to allow a CSS transition 23 | * We serialize javascript objects used in `ic-include` JSON form, allowing for more complex data to be included in requests 24 | * We now include form values when a form causes a GET 25 | * We now have unit tests running against jQuery v1, v2 and v3 26 | * jQuery 3 is now the documented option 27 | 28 | Carson / [@carson_gross](https://twitter.com/carson_gross) -------------------------------------------------------------------------------- /www/_posts/2019-11-01-intercooler-1.2.3-released.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: blog_post 3 | nav: blog 4 | --- 5 | 6 | I have released intercooler v1.2.3, available on the main site, as well as through bower and NPM. 7 | 8 | 9 | 10 | Changes in this release are: 11 | 12 | * `ic-trigger-on` now supports multiple event names, separated by commas 13 | * The `ic-sse-with-credentials` attribute enables SSE requests to be made with credentials 14 | * The `ic-push-params` attribute allows you to include parameter values in the pushed URL 15 | * Bug fixes 16 | 17 | Enjoy, and thanks for using intercooler! 18 | 19 | Carson -------------------------------------------------------------------------------- /www/_posts/2019-3-29-intercooler-1.2.2-released.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: blog_post 3 | nav: blog 4 | --- 5 | 6 | I have released intercooler v1.2.2, available on the main site, as well as through bower and NPM. 7 | 8 | 9 | 10 | 11 | Changes in this release are: 12 | 13 | * Added [ic-enhance](/attributes/ic-enhance.html) attribute, which enhances standard anchor and form tags with the 14 | intercooler equivalent attributes, allowing for graceful degradation in non-javascript environments. 15 | * Added [ic-global-indicator](/attributes/ic-global-indicator.html) attribute, which sets a global indicator to be 16 | shown when a request is in flight, even along side any local indicators specified by the triggering element. 17 | * Added [ic-switch-class](/attributes/ic-switch-class.html) attribute, which switches a class between siblings when 18 | an intercooler request is caused within one. This can be uses, for example, to update the "active" state of tabs 19 | without replacing the tab UI. 20 | * LeadDyno.startPolling() and LeadDyno.stopPolling() were added to the Javascript API 21 | * Added `X-IC-Title-Encoded` response header to handle URI encoded titles for international users 22 | * Removed the legacy debugger 23 | * Bug fixes 24 | 25 | Enjoy, and thanks for using intercooler! 26 | 27 | Carson / [@carson_gross](https://twitter.com/carson_gross) -------------------------------------------------------------------------------- /www/_posts/2024-12-29-intercooler-1.2.4-released.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: blog_post 3 | nav: blog 4 | --- 5 | 6 | I have released intercooler v1.2.4, available on the main site, as well as through bower and NPM. 7 | 8 | 9 | 10 | Changes in this release are: 11 | 12 | * A bug in SSE support that allowed multiple listeners for the same even was fixed 13 | * Chained property access in the `ic-action` attribute is now supported 14 | * Multiple query parameters with the same name are now supported for local anchors 15 | 16 | Enjoy, and thanks for using intercooler! 17 | 18 | Carson 19 | -------------------------------------------------------------------------------- /www/angular-to-intercooler-tutorial.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: why 4 | --- 5 | 6 |
7 | 8 |
9 |
10 | 11 |
12 |

Angular To Intercooler: An Introduction

13 | 14 |

This tutorial walks through the Angular JS 15 | tutorial and shows you the corresponding intercoolerjs concepts.

16 | 17 |

Bootstrapping

18 |

To bootstrap intercooler, include the source from the download page.

19 | 20 |

Injectors

21 |

There are no injectors in intercooler.

22 | 23 |

Scopes

24 |

There are no scopes in intercooler.

25 | 26 |

Static Templates

27 |

There are no templates in intercooler.

28 | 29 |

Angular Dynamic Templates

30 |

There are no templates in intercooler.

31 | 32 |

Models

33 |

There are no models in intercooler.

34 | 35 |

Controllers

36 |

There are no controllers in intercooler.

37 | 38 |

Modules

39 |

There are no modules in intercooler.

40 | 41 |

Filtering Repeaters

42 |

There are no filtering repeaters in intercooler.

43 | 44 |

Two-way Data Binding

45 |

There is no two-way data binding in intercooler.

46 | 47 |

XHRs & Dependency Injection

48 | 49 |

You don't need to deal with XHRs in intercooler.

50 | 51 |

There is no dependency injection in intercooler.

52 | 53 |

Prefix Naming Convention

54 | 55 |

There is no prefix naming convention in intercooler.

56 | 57 |

There are no minification issues in intercooler.

58 | 59 |

Routing & Multiple Views

60 | 61 |

There is no routing in intercooler.

62 | 63 |

There is nothing special about multiple views in intercooler.

64 | 65 |

Filters

66 | 67 |

There are no filters in intercooler.

68 | 69 |

Event Handlers

70 | 71 |

There is not a custom event mechanism in intercooler. Just use JQuery.

72 | 73 |

REST and Custom Services

74 | 75 |

There is nothing special about REST-ful end points in intercooler.

76 | 77 |

There is no need for a custom services in intercooler.

78 | 79 |

Applying Animations

80 | 81 |

Use the ic-adding and ic-removing classes and CSS3 animations to specify an animation in intercooler.

82 | 83 |

The End

84 | 85 |

That's it! You now know how Angular and intercooler compare with one another, and how to port 86 | an Angular application to intercooler!

87 | 88 |
89 |
90 |
91 |
-------------------------------------------------------------------------------- /www/attributes/ic-action-target.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-action-target 4 | --- 5 | 6 |
7 | 8 |
9 |
10 | 11 |

ic-action-target - The Action Target Attribute

12 | 13 |

Summary

14 | 15 |

The ic-action-target overrides the standard ic-target 16 | attribute when deciding what element to target with the ic-action 17 | attribute. 18 |

19 | 20 |

Syntax

21 | 22 |

The value of the ic-action-target attribute can be:

23 |
    24 |
  • The string this, indicating that the element that the ic-action-target attribute 25 | is on is the target
  • 26 |
  • The string closest followed by a valid CSS selector, indicating that the 27 | closest parent to the element satisfying the given css selector is the 28 | target (e.g. closest tr
  • 29 |
  • The string find followed by a valid CSS selector, indicating that the 30 | closest child satisfying the given css selector is the target (e.g. closest .indicator-elt
  • 31 |
  • A valid global CSS selector
  • 32 |
33 | 34 |

This attribute may be placed on parent elements, allowing you to specify behavior across 35 | multiple elements.

36 | 37 |

Dependencies

38 | 39 |

ic-action-target has no effect on dependencies.

40 | 41 |
42 |
43 |
44 | -------------------------------------------------------------------------------- /www/attributes/ic-add-class.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-add-class 4 | --- 5 | 6 |
7 | 8 |
9 |
10 | 11 |

ic-add-class - The Add Class Attribute

12 | 13 |

Summary

14 | 15 |

The ic-add-class attribute allows you to add classes to an element after a specified delay.

16 | 17 |

Syntax

18 | 19 |

The value of the attribute can be either a valid CSS class name, a valid CSS class name followed by a colon 20 | followed by a time delay, or a comma separated list of either of these.

21 | 22 |

Dependencies

23 | 24 |

The ic-add-class attribute has no effect on dependencies.

25 | 26 |

Example

27 | 28 |

Here is a simple example, which adds a 'fadeRed' class after 2 seconds and takes 10 seconds to 29 | complete the transition.

30 | 31 |
32 |         <h3 ic-add-class="fadeRed">This Will Fade Red</h3>
33 |       
34 | 35 | 41 |
42 |

This Will Fade Red

43 |
44 | 45 |
46 |
47 |
-------------------------------------------------------------------------------- /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 |

Syntax

26 | 27 |

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

28 | 29 |

Dependencies

30 | 31 |

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

34 | 35 | 36 |

Example

37 | 38 |

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

39 | 40 |
41 |   <ul ic-append-from="/list_src" ic-poll="2s" ic-limit-children="5"></ul>
42 |       
43 | 44 | 45 |
46 | 63 |
    64 |
    65 | 66 |
    67 |
    68 |
    -------------------------------------------------------------------------------- /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-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 | 25 |

    This attribute may be placed on parent elements, allowing you to specify behavior across 26 | multiple elements.

    27 | 28 |

    Dependencies

    29 | 30 |

    The ic-confirm attribute has no effect on dependencies.

    31 | 32 |

    Example

    33 | 34 |
    35 |   <button ic-post-to="/target_url" ic-confirm="Are you sure?">Click Me!</button>
    36 |       
    37 | 38 | 39 |
    40 | 46 | 47 |
    48 | 49 |
    50 |
    51 |
    -------------------------------------------------------------------------------- /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 | 51 | 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 |

    To disable dependencies on an element, you can use ic-deps="ignore"

    25 | 26 |

    Dependencies

    27 | 28 |

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

    29 | 30 |

    Example

    31 | 32 |

    Here is a simple element that depends on any changes:

    33 | 34 |
    35 |   <button ic-post-to="/path/1">Button 1</button>
    36 |   <button ic-post-to="/path/2">Button 2</button>
    37 |   <div ic-src="/src" ic-deps="*">0 Clicks</div>
    38 |       
    39 | 40 | 41 |
    42 | 70 | 71 | 72 |
    0 Clicks
    73 |
    74 | 75 |
    76 |
    77 |
    -------------------------------------------------------------------------------- /www/attributes/ic-disable-when-doc-hidden.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-disable-when-doc-hidden 4 | --- 5 | 6 |
    7 | 8 |
    9 |
    10 | 11 |

    ic-disable-when-doc-hidden - Disable When Document Hidden Attribute

    12 | 13 |

    Summary

    14 | 15 |

    The ic-disable-when-doc-hidden attribute tells Intercooler to not to issue a given request if the 16 | document is currently hidden, as determined by the document.hidden property. This allows you to 17 | pause polling, for example, when a document is in an inactive tab, or the screen saver is running.

    18 | 19 |

    Syntax

    20 | 21 |

    The value of the attribute should be true or false

    22 | 23 |

    Dependencies

    24 | 25 |

    ic-disable-when-doc-hidden has no dependency implications.

    26 | 27 |
    28 |
    29 |
    -------------------------------------------------------------------------------- /www/attributes/ic-disable-when-doc-inactive.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-disable-when-doc-inactive 4 | --- 5 | 6 |
    7 | 8 |
    9 |
    10 | 11 |

    ic-disable-when-doc-inactive - Disable When Document Hidden Attribute

    12 | 13 |

    Summary

    14 | 15 |

    The ic-disable-when-doc-inactive attribute tells Intercooler to not to issue a given request if the 16 | document does not have focus, as determined by the document.hasFocus() property. This allows you to 17 | pause polling, for example, when a document is not focused. If you wish for polling to occur even if the window 18 | is inactive (but still potentially visible), consider using the 19 | 20 | ic-disable-when-document-hidden 21 | 22 | attribute instead.

    23 | 24 |

    Syntax

    25 | 26 |

    The value of the attribute should be true or false

    27 | 28 |

    Dependencies

    29 | 30 |

    ic-disable-when-doc-inactive has no dependency implications.

    31 | 32 |
    33 |
    34 |
    -------------------------------------------------------------------------------- /www/attributes/ic-enhance.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-enhance 4 | --- 5 | 6 |
    7 | 8 |
    9 |
    10 | 11 |

    ic-enhance - The Enhance Attribute

    12 | 13 |

    Summary

    14 | 15 |

    The ic-enhance attribute tells intercooler to enhance all anchor tags (links) and form tags 16 | found below the attribute, causing them to issue AJAX requests rather than their standard behavior.

    17 | 18 |

    For anchor tags this means that the href is copied over to ic-src, the 19 | ic-push-url attribute is set to true, and the ic-deps attribute 20 | is set to ignore so no dependent requests are generated for it.

    21 | 22 |

    Only local references will be enhanced. Anchor tags that point to other sites, or that reference fragment 23 | ids will not be modified.

    24 | 25 |

    For form tags this means that the action is copied over to ic-src, the 26 | ic-verb attribute is set to method attribute, and the ic-deps attribute 27 | is set to false so no dependent requests are generated for it.

    28 | 29 |

    In both cases, intercooler attributes can be overridden or added directly to the element if you so wish.

    30 | 31 |

    Syntax

    32 | 33 |

    The value of the attribute should be true or false.

    34 | 35 |

    Dependencies

    36 | 37 |

    ic-enhance has no effect on dependencies.

    38 | 39 |

    Example

    40 | 41 | Below is a live demo of an achor tag that has been enhanced. Note that it is a standard anchor tag, but 42 | if you click on it it will issue an AJAX request and update the navigation bar. 43 | 44 |
    45 |       <div ic-enhance="true">
    46 |         <h3>Here is an enhanced link</h3>
    47 |         <a href="/ic-enhance">A Link</a>
    48 |       </div>
    49 |       
    50 | 51 |
    52 | 62 | 63 |
    64 |

    Here is an enhanced link

    65 | A Link 66 |
    67 |
    68 | 69 |
    70 |
    71 |
    -------------------------------------------------------------------------------- /www/attributes/ic-fix-ids.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-fix-ids 4 | --- 5 | 6 |
    7 | 8 |
    9 |
    10 | 11 |

    ic-fix-ids - The Fix IDs Attribute

    12 | 13 |

    Summary

    14 | 15 |

    The ic-fix-ids attribute tells Intercooler to replace the IDs of any added elements 16 | with globally unique IDs so that they don't conflict with any existing IDs on the page.

    17 | 18 |

    Syntax

    19 | 20 |

    The value of the ic-fix-ids attribute should be "true", or it should be omitted entirely.

    21 | 22 |

    This attribute may be placed on parent elements, allowing you to specify behavior across 23 | multiple elements.

    24 | 25 |

    Dependencies

    26 | 27 |

    ic-fix-ids attribute has no effect on dependencies.

    28 | 29 |
    30 |
    31 |
    -------------------------------------------------------------------------------- /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 Get-From 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-global-include.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-include 4 | --- 5 | 6 |
    7 | 8 |
    9 |
    10 | 11 |

    ic-global-include - The Global Include Attribute

    12 | 13 |

    Summary

    14 | 15 |

    The ic-global-include attribute tells Intercooler to include additional parameters in 16 | all requests that 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-global-include attribute can either be a CSS/JQuery element selector of elements 21 | to include in the request or a JSON object of name/value pairs to include. If it is a JSON object, it must 22 | satisfy the jQuery parseJSON() requirements.

    23 | 24 |

    This attribute may be placed on any element in the document and will be included with all intercooler requests.

    25 | 26 |

    Dependencies

    27 | 28 |

    ic-global-include has no effect on dependencies.

    29 | 30 |

    Example

    31 | 32 |

    In this example, the input specifies it should be included on all requests to the server.

    33 | 34 |
    35 |   <div ic-src="/update">Please Enter A Name...</div>
    36 | 
    37 |   <input id="name" name="name" ic-global-include="#name"/>
    38 | 
    39 |   <button ic-post-to="/update">Upload Name</button>
    40 |       
    41 | 42 |

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

    43 | 44 |
    45 | 65 |
    Please Enter A Name...
    66 | 67 | 68 |
    69 | 70 |
    71 |
    72 |
    -------------------------------------------------------------------------------- /www/attributes/ic-global-indicator.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-indicator 4 | --- 5 | 6 |
    7 | 8 |
    9 |
    10 | 11 |

    ic-indicator - The Global Indicator Attribute

    12 | 13 |

    Summary

    14 | 15 |

    The global indicator attribute can be used to show an indicator while a request is in process. This 16 | indicator will be shown in addition to any local request indicators otherwise specified.

    17 | 18 |

    Syntax

    19 | 20 |

    The value of the attribute should be a valid selector of the indicator element to show, or 21 | false if you wish for an element to not show a global indicator specified on a 22 | parent element.

    23 | 24 |

    Example

    25 | 26 |
    27 |   <div ic-global-indicator="#indicator">
    28 |     <button ic-post-to="/target_url" >
    29 |       Click Me!
    30 |       <i class="fa fa-spinner fa-spin ic-indicator" style="display:none"></i>
    31 |     </button>
    32 |     <br/>
    33 |     Global Indicator: <i id="indicator" class="fa fa-spinner fa-spin" style="display:none"></i>
    34 |   </div>
    35 | 
    36 | 37 | 38 |
    39 | 45 | 46 |
    47 | 51 | 52 |
    53 | 54 | Global Indicator: 55 |
    56 |
    57 |
    58 |
    59 |
    -------------------------------------------------------------------------------- /www/attributes/ic-history-elt.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-history-elt 4 | --- 5 | 6 |
    7 | 8 |
    9 |
    10 | 11 |

    ic-history-elt - The History Element

    12 | 13 |

    Summary

    14 | 15 |

    The ic-history-elt attribute tells intercooler the element to take a snapshot of when storing 16 | history entries, as well as the element to restore history snapshots into.

    17 | 18 |

    Typically this attribute is placed on an element that is present on every page in your web application, so it 19 | is always possible to restore history.

    20 | 21 |

    Syntax

    22 | 23 |

    The value of this attribute should always be true

    24 | 25 |

    Dependencies

    26 | 27 |

    No effect.

    28 | 29 |
    30 |
    31 |
    -------------------------------------------------------------------------------- /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 can either be a CSS/JQuery element selector of elements 21 | to include in the request or a JSON object of name/value pairs to include. If it is a JSON object, it must 22 | satisfy the jQuery parseJSON() requirements.

    23 | 24 |

    This attribute may be placed on parent elements, allowing you to specify behavior across 25 | multiple elements.

    26 | 27 |

    Dependencies

    28 | 29 |

    ic-include has no effect on dependencies.

    30 | 31 |

    Example

    32 | 33 |

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

    34 | 35 |
    36 |   <div ic-src="/update">Please Enter A Name...</div>
    37 |   <input id="name" name="name"/>
    38 |   <button ic-post-to="/update" ic-include="#name">Upload Name</button>
    39 |       
    40 | 41 |

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

    42 | 43 |
    44 | 64 |
    Please Enter A Name...
    65 | 66 | 67 |
    68 | 69 |
    70 |
    71 |
    -------------------------------------------------------------------------------- /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 |

    This attribute may be placed on parent elements, allowing you to specify behavior across 25 | multiple elements.

    26 | 27 |

    CSS-based Indicators

    28 | 29 |

    Normally request indicators are show via the $.show() function. If you wish to use a CSS 30 | transition instead, you can add the ic-use-transition class to the indicator instead. If 31 | this class is on the indicator, it will be removed while a request is in flight and then 32 | readded when the request is over.

    33 | 34 |

    Examples

    35 | 36 |

    Show/Hide Example

    37 | 38 |

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

    39 | 40 |
    41 |   <button ic-post-to="/target_url" ic-indicator="#indicator">
    42 |     Click Me!
    43 |   </button>
    44 | 
    45 |   <i id="indicator" class="fa fa-spinner fa-spin" style="display:none"></i>
    46 | 
    47 | 48 | 49 |
    50 | 56 | 57 | 60 | 61 | 62 |
    63 | 64 |

    CSS Example

    65 | 66 |

    Here is a simple example of an indicator next to a button that uses a CSS transition:

    67 | 68 |
    69 |   <button ic-post-to="/target_url" ic-indicator="#indicator">
    70 |     Click Me!
    71 |   </button>
    72 | 
    73 |   <i id="indicator" class="fa fa-spinner fa-spin ic-use-transition"></i>
    74 | 
    75 | 76 | 77 |
    78 | 89 | 90 | 93 | 94 | 95 |
    96 | 97 |
    98 |
    99 |
    -------------------------------------------------------------------------------- /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 | 48 |
      49 |
      50 | 51 |
      52 |
      53 |
      -------------------------------------------------------------------------------- /www/attributes/ic-local-vars.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-local-vars 4 | --- 5 | 6 |
      7 | 8 |
      9 |
      10 | 11 |

      ic-local-vars - The Local Vars Attribute

      12 | 13 |

      Summary

      14 | 15 |

      The ic-local-vars attribute tells Intercooler to include parameters from localStorage 16 | in your intercooler requests. This can be used to maintain local state that is persistent and not encoded 17 | directly in the DOM.

      18 | 19 |

      Syntax

      20 | 21 |

      The value of the ic-local-vars attribute is a comma separated list of string names that will be 22 | used to index into the localStorage object.

      23 | 24 |

      This attribute may be placed on parent elements, allowing you to specify behavior across 25 | multiple elements.

      26 | 27 |

      Note that the X-IC-Set-Local-Vars response header can be used to write values into localStorage

      28 | 29 |

      Dependencies

      30 | 31 |

      ic-local-vars has no effect on dependencies.

      32 | 33 |

      Example

      34 | 35 |

      In this example, the button includes a local variable when it POSTs to the server.

      36 | 37 |
      38 |   <button ic-post-to="/update" ic-local-var="foo">Upload Local Var</button>
      39 |       
      40 | 41 |
      42 |
      43 |
      44 | -------------------------------------------------------------------------------- /www/attributes/ic-on-beforeSend.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-on-beforeSend 4 | --- 5 | 6 |
      7 | 8 |
      9 |
      10 | 11 |

      ic-on-beforeSend - JQuery AJAX Request life cycle attribute

      12 | 13 |

      Summary

      14 | 15 |

      This attribute is a javascript expression that will be evaluated before an AJAX request is initiated on behalf 16 | of Intercooler. It corresponds to the beforeSend property in JQuery's ajax() method. 17 |

      18 | 19 |

      Syntax

      20 | 21 |

      This attribute is a valid javascript expression, evaluated within an isolated scope.

      22 | 23 |

      This attribute may be placed on parent elements, allowing you to specify behavior across 24 | multiple elements.

      25 | 26 |

      Available symbols are:

      27 |
        28 |
      • data - The data to be send to the server
      • 29 |
      • settings - The AJAX settings object
      • 30 |
      • xhr - The XHR object
      • 31 |
      32 | 33 |

      The ic-on-beforeSend can be placed on an parent element, allowing general request processing 34 | for an entire page. Intercooler will find the closest element with this attribute and evaluate it.

      35 | 36 |
      37 |
      38 |
      -------------------------------------------------------------------------------- /www/attributes/ic-on-beforeTrigger.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-on-beforeSend 4 | --- 5 | 6 |
      7 | 8 |
      9 |
      10 | 11 |

      ic-on-beforeTrigger - JQuery AJAX Request life cycle attribute

      12 | 13 |

      Summary

      14 | 15 |

      This attribute is a javascript expression that will be evaluated before an AJAX request is initiated on behalf 16 | of Intercooler. It is evaluated before the normal intercooler trigger logic is executed. If the expression returns 17 | false, intercooler will not execute the triggered action. 18 |

      19 | 20 |

      Syntax

      21 | 22 |

      This attribute is a valid javascript expression, evaluated within an isolated scope.

      23 | 24 |

      This attribute may be placed on parent elements, allowing you to specify behavior across 25 | multiple elements.

      26 | 27 |

      Available symbols are:

      28 |
        29 |
      • evt - The jQuery event object
      • 30 |
      • elt - The element that was triggered
      • 31 |
      32 | 33 |

      The ic-on-beforeTrigger can be placed on an parent element, allowing general request processing 34 | for an entire page. Intercooler will find the closest element with this attribute and evaluate it.

      35 | 36 |
      37 |
      38 |
      -------------------------------------------------------------------------------- /www/attributes/ic-on-complete.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-on-beforeSend 4 | --- 5 | 6 |
      7 | 8 |
      9 |
      10 | 11 |

      ic-on-complete - JQuery AJAX Request life cycle attribute

      12 | 13 |

      Summary

      14 | 15 |

      This attribute is a javascript expression that will be evaluated after an AJAX request is completed 16 | on behalf of Intercooler, regardless of status. It corresponds to the complete property in 17 | JQuery's ajax() method.

      18 | 19 |

      Syntax

      20 | 21 |

      This attribute is a valid javascript expression, evaluated within an isolated scope.

      22 | 23 |

      This attribute may be placed on parent elements, allowing you to specify behavior across 24 | multiple elements.

      25 | 26 |

      Available symbols are:

      27 | 28 |
        29 |
      • status - The AJAX status object
      • 30 |
      • xhr - The XHR object
      • 31 |
      32 | 33 |

      The ic-on-complete can be placed on an parent element, allowing general request processing 34 | for an entire page. Intercooler will find the closest element with this attribute and evaluate it.

      35 | 36 |
      37 | 38 | 39 |
      40 |
      -------------------------------------------------------------------------------- /www/attributes/ic-on-error.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-on-beforeSend 4 | --- 5 | 6 |
      7 | 8 |
      9 |
      10 | 11 |

      ic-on-error - JQuery AJAX Request life cycle attribute

      12 | 13 |

      Summary

      14 | 15 |

      This attribute is a javascript expression that will be evaluated after an erroneous AJAX request is completed 16 | on behalf 17 | of Intercooler. It corresponds to the error property in JQuery's ajax() method.

      18 | 19 |

      Syntax

      20 | 21 |

      This attribute is a valid javascript expression, evaluated within an isolated scope.

      22 | 23 |

      This attribute may be placed on parent elements, allowing you to specify behavior across 24 | multiple elements.

      25 | 26 |

      Available symbols are:

      27 | 28 |
        29 |
      • status - Possible values (besides null) are "timeout", "error", "abort", and "parsererror"
      • 30 |
      • str - Textual portion of the HTTP status, such as "Not Found" or "Internal Server Error."
      • 31 |
      • xhr - The XHR object
      • 32 |
      33 | 34 |

      The ic-on-error can be placed on an parent element, allowing general request processing 35 | for an entire page. Intercooler will find the closest element with this attribute and evaluate it.

      36 | 37 |
      38 | 39 | 40 |
      41 |
      -------------------------------------------------------------------------------- /www/attributes/ic-on-success.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-on-beforeSend 4 | --- 5 | 6 |
      7 | 8 |
      9 |
      10 | 11 |

      ic-on-success - JQuery AJAX Request life cycle attribute

      12 | 13 |

      Summary

      14 | 15 |

      This attribute is a javascript expression that will be evaluated after a successful AJAX request is completed 16 | on behalf 17 | of Intercooler. It corresponds to the success property in JQuery's ajax() method.

      18 | 19 |

      Syntax

      20 | 21 |

      This attribute is a valid javascript expression, evaluated within an isolated scope.

      22 | 23 |

      This attribute may be placed on parent elements, allowing you to specify behavior across 24 | multiple elements.

      25 | 26 |

      Available symbols are:

      27 | 28 |
        29 |
      • data - The data to be send to the server
      • 30 |
      • textStatus - The AJAX textStatus
      • 31 |
      • xhr - The XHR object
      • 32 |
      33 | 34 |

      35 | Returning false from this expression will halt Intercooler's normal request processing and 36 | prevent content swapping. 37 |

      38 | 39 |

      The ic-on-success can be placed on an parent element, allowing general request processing 40 | for an entire page. Intercooler will find the closest element with this attribute and evaluate it.

      41 | 42 |
      43 | 44 | 45 |
      46 |
      -------------------------------------------------------------------------------- /www/attributes/ic-patch-to.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-patch-to 4 | --- 5 | 6 |
      7 | 8 |
      9 |
      10 | 11 |

      ic-patch-to - The Patch-To Attribute

      12 | 13 |

      Summary

      14 | 15 |

      The ic-patch-to attribute binds the default action (see below) of HTML element to a 16 | PATCH to the given URL. For example, on a button, when the button is clicked, an 17 | AJAX PATCH 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-patch-to="/foo/bar").

      24 | 25 |

      Dependencies

      26 | 27 |

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

      ic-pause-polling - The Pause Polling Attribute

      12 | 13 |

      Summary

      14 | 15 |

      The ic-pause-polling attribute tells Intercooler to not poll in the presence of an ic-poll 16 | attribute. This can be used to implement a Pause/Play UI.

      17 | 18 |

      Syntax

      19 | 20 |

      The value of the attribute should be true or false

      21 | 22 |

      Dependencies

      23 | 24 |

      ic-pause-polling has no dependency implications.

      25 | 26 |

      Example

      27 | 28 |

      Here is a simple Pause/Play UI that starts in a paused state, and can be started by clicking the play 29 | button:

      30 | 31 |
      32 |   <div ic-prepend-from="/poll" ic-poll="1s" ic-target="#content" ic-pause-polling="true">
      33 |     <div>
      34 |       <div class="btn btn-default" ic-post-to="/play"><i class="fa fa-play"></i></div>
      35 |       <div class="btn btn-default" ic-post-to="/pause"><i class="fa fa-pause"></i></div>
      36 |     </div>
      37 |     <div id="content" ic-limit-children="5">
      38 |     </div>
      39 |   </div>
      40 |       
      41 | 42 | 43 |
      44 | 67 |
      68 |
      69 |
      70 |
      71 |
      72 |
      73 |
      74 |
      75 |
      76 | 77 |
      78 |
      79 |
      -------------------------------------------------------------------------------- /www/attributes/ic-poll-repeats.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-poll-repeats 4 | --- 5 | 6 |
      7 | 8 |
      9 |
      10 | 11 |

      ic-poll-repeats - The Poll Repeats Attribute

      12 | 13 |

      Summary

      14 | 15 |

      The ic-poll-repeats attribute is used in conjuction with the ic-poll 16 | attribute. It tells Intercooler to repeat the poll up to a specified number.

      17 | 18 |

      Syntax

      19 | 20 |

      The value of the attribute should a valid integer.

      21 | 22 |

      Dependencies

      23 | 24 |

      ic-poll-repeats is only functional when using the ic-poll attribute.

      25 | 26 |

      Example

      27 | 28 |

      Here is a simple example of a poll repeat:

      29 | 30 |
      31 |   <div ic-src="/seconds" ic-poll="2s" ic-poll-repeats="5">You have been on this page for 0 seconds...</div>
      32 |       
      33 | 34 | 35 |
      36 | 48 |
      You have been on this page for 0 seconds...
      49 |
      50 | 51 |
      52 |
      53 |
      -------------------------------------------------------------------------------- /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.

      17 | 18 |

      Syntax

      19 | 20 |

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

      22 | 23 |

      Dependencies

      24 | 25 |

      ic-poll has no dependency implications.

      26 | 27 |

      Example

      28 | 29 |

      Here is a simple example of a poll interval:

      30 | 31 |
      32 |   <div ic-src="/seconds" ic-poll="2s">You have been on this page for 0 seconds...</div>
      33 |       
      34 | 35 | 36 |
      37 | 49 |
      You have been on this page for 0 seconds...
      50 |
      51 | 52 |
      53 |
      54 |
      -------------------------------------------------------------------------------- /www/attributes/ic-post-errors-to.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-post-errors-to 4 | --- 5 | 6 |
      7 | 8 |
      9 |
      10 | 11 |

      ic-post-errors-to - The Post-Errors-To Attribute

      12 | 13 |

      Summary

      14 | 15 |

      The ic-post-errors-to attribute tells Intercooler to post all errors that occur during requests 16 | and content swapping to a given URL, typically for server side logging.

      17 | 18 |

      This attribute is typically specified on the body tag of your web application.

      19 | 20 |

      Syntax

      21 | 22 |

      The value of the attribute should be a valid URL (e.g. "/errors").

      23 | 24 |

      Dependencies

      25 | 26 |

      ic-post-errors-to has no dependency implications.

      27 | 28 |

      Example

      29 | 30 |

      Here is a simple example usage. All errors that occur within the body will be posted to the /errors 31 | url

      32 | 33 |
      34 |   <body ic-post-errors-to="/errors">
      35 |     ...
      36 |   </body>
      37 |       
      38 | 39 | 40 |
      41 |
      42 |
      -------------------------------------------------------------------------------- /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 | 56 | 57 | You haven't clicked yet... 58 |
      59 | 60 |
      61 |
      62 |
      -------------------------------------------------------------------------------- /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 |

      Syntax

      26 | 27 |

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

      28 | 29 |

      Dependencies

      30 | 31 |

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

      34 | 35 | 36 |

      Example

      37 | 38 |

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

      39 | 40 |
      41 |   <ul ic-prepend-from="/list_src" ic-poll="2s" ic-limit-children="5"></ul>
      42 |       
      43 | 44 | 45 |
      46 | 63 |
        64 |
        65 | 66 |
        67 |
        68 |
        -------------------------------------------------------------------------------- /www/attributes/ic-prompt.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-prompt 4 | --- 5 | 6 |
        7 | 8 |
        9 |
        10 | 11 |

        ic-prompt - The Prompt Attribute

        12 | 13 |

        Summary

        14 | 15 |

        The ic-prompt attribute tells Intercooler to prompt the user for input before issuing an AJAX 16 | request. The input is included in the ic-prompt-value parameter of the request. If you wish 17 | to change this, you can use the ic-prompt-name attribute to override it.

        18 | 19 |

        If the user cancels the prompt, no request will be made.

        20 | 21 |

        Syntax

        22 | 23 |

        The value of the ic-prompt attribute should be a string prompting the user for input.

        24 | 25 |

        This attribute may be placed on parent elements, allowing you to specify behavior across 26 | multiple elements.

        27 | 28 |

        Dependencies

        29 | 30 |

        The ic-prompt attribute has no effect on dependencies.

        31 | 32 |

        Example

        33 | 34 |
        35 |   <button ic-post-to="/target_url" ic-prompt="What's your name?">Click Me!</button>
        36 |       
        37 | 38 | 39 |
        40 | 49 | 50 |
        51 | 52 |
        53 |
        54 |
        -------------------------------------------------------------------------------- /www/attributes/ic-push-params.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-push-params 4 | --- 5 | 6 |
        7 | 8 |
        9 |
        10 | 11 |

        ic-push-params - The Push Parameters Attribute

        12 | 13 |

        Summary

        14 | 15 |

        The ic-push-parameters attribute tells intercooler to push additional parameters along with 16 | the url when the ic-push-url parameter is used.

        17 | 18 |

        This can be useful if you want to include parameters in the URL in the navigation bar, such as the search 19 | term in a search dialog.

        20 | 21 |

        Syntax

        22 | 23 |

        The value of this attribute is a comma separated list of names of parameters to push in the URL

        24 | 25 |

        This attribute may be placed on parent elements, allowing you to specify behavior across 26 | multiple elements.

        27 | 28 |

        Dependencies

        29 | 30 |

        No effect.

        31 | 32 |

        Example

        33 | 34 |

        Here is a simple example, which pushes an input value called example when 35 | the form submits

        36 | 37 |
        38 |       
        39 | 40 | 41 |
        42 | 52 |
        53 | 54 | 55 |
        56 |
        57 | 58 | 59 |
        60 |
        61 |
        -------------------------------------------------------------------------------- /www/attributes/ic-push-url.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-push-url 4 | --- 5 | 6 |
        7 | 8 |
        9 |
        10 | 11 |

        ic-push-url - The Push URL Attribute

        12 | 13 |

        Summary

        14 | 15 |

        The ic-push-url attribute tells intercooler to push the location of the ajax request associated 16 | with the current element into the location bar.

        17 | 18 |

        This can be useful if you want to support the back button after an intercooler request replaces some content 19 | on a page.

        20 | 21 |

        Syntax

        22 | 23 |

        The value of this attribute can be either true or false

        24 | 25 |

        This attribute may be placed on parent elements, allowing you to specify behavior across 26 | multiple elements.

        27 | 28 |

        Dependencies

        29 | 30 |

        No effect.

        31 | 32 |
        33 |
        34 |
        -------------------------------------------------------------------------------- /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 | 56 | 57 | You haven't clicked yet... 58 |
        59 | 60 |
        61 |
        62 |
        -------------------------------------------------------------------------------- /www/attributes/ic-remove-after.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-remove-after 4 | --- 5 | 6 |
        7 | 8 |
        9 |
        10 | 11 |

        ic-remove-after - The Remove After Attribute

        12 | 13 |

        Summary

        14 | 15 |

        The ic-remove-after attribute tells Intercooler to remove the element it is on after a given 16 | interval.

        17 | 18 |

        Syntax

        19 | 20 |

        The value of the attribute should a valid integer, followed by the string "s" (for seconds) or "ms" (for 21 | milliseconds). (e.g. ic-remove-after="1500ms" indicates that the element should be removed after 1500 milliseconds.)

        22 | 23 |

        Dependencies

        24 | 25 |

        ic-remove-after has no dependency implications.

        26 | 27 |

        Example

        28 | 29 |

        Here is a simple example of a span removal:

        30 | 31 |
        32 |     <a  ic-post-to="/remove_after" ic-target="#flash-span">Click Me!</a> <span id="flash-span"></span>
        33 |       
        34 | 35 | 36 |
        37 | 43 | Click Me! 44 |
        45 | 46 |
        47 |
        48 |
        -------------------------------------------------------------------------------- /www/attributes/ic-remove-class.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-remove-class 4 | --- 5 | 6 |
        7 | 8 |
        9 |
        10 | 11 |

        ic-remove-class - The Remove Class Attribute

        12 | 13 |

        Summary

        14 | 15 |

        The ic-remove-class attribute allows you to remove classes from an element after a specified delay.

        16 | 17 |

        Syntax

        18 | 19 |

        The value of the attribute can be either a valid CSS class name, a valid CSS class name followed by a colon 20 | followed by a time delay, or a comma separated list of either of these.

        21 | 22 |

        Dependencies

        23 | 24 |

        The ic-remove-class attribute has no effect on dependencies.

        25 | 26 |

        Example

        27 | 28 |

        Here is a simple example, which removes an 'icRed' class after 2 seconds and takes 10 seconds to 29 | complete the transition.

        30 | 31 |
        32 |         <h3 class="example icRed" ic-remove-class="icRed:2s">This Will Fade Red</h3>
        33 |       
        34 | 35 | 43 |
        44 |

        This Will Fade From Red To Black

        45 |
        46 | 47 |
        48 |
        49 |
        50 | -------------------------------------------------------------------------------- /www/attributes/ic-replace-target.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-replace-taret 4 | --- 5 | 6 |
        7 | 8 |
        9 |
        10 | 11 |

        ic-replace-target - The Replace Target Attribute

        12 | 13 |

        Summary

        14 | 15 |

        The ic-replace-target attribute tells Intercooler the target element of the intercooler request 16 | should be replaced entirely with the server response, rather than replacing the inner HTML of the target.

        17 | 18 |

        This is useful in cases where you cannot wrap an element around a potential target easily, such as 19 | table rows.

        20 | 21 |

        Syntax

        22 | 23 |

        The value of the ic-target attribute should be "true", or it should be omitted entirely.

        24 | 25 |

        This attribute may be placed on parent elements, allowing you to specify behavior across 26 | multiple elements.

        27 | 28 |

        Dependencies

        29 | 30 |

        ic-replace-target has no effect on dependencies..

        31 | 32 |

        Example

        33 | 34 |

        Here is a simple button that replaces an entire div, rather than just the content in the div. 35 | You can tell by the lack of border afterwards.

        36 | 37 |
        38 |   <div id="target" style="border: 1px solid red">Before</div>
        39 |   <button ic-post-to="/update" ic-target="#target" ic-replace-target="true">Update Div</button>
        40 |       
        41 | 42 |

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

        43 | 44 |
        45 | 53 |
        Before
        54 | 55 |
        56 | 57 |
        58 |
        59 |
        -------------------------------------------------------------------------------- /www/attributes/ic-scroll-offset.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-scroll-offset 4 | --- 5 | 6 |
        7 | 8 |
        9 |
        10 | 11 |

        ic-scroll-offset - The Scroll Offset Attribute

        12 | 13 |

        Summary

        14 | 15 |

        The ic-scroll-offset attribute tells Intercooler to apply an offset when scrolling to a given target. 16 | This can be useful when you need an element to be positioned offest from the top of the viewport when using 17 | the ic-scroll-to-target attribute.

        18 | 19 |

        Syntax

        20 | 21 |

        The value of the attribute should a valid integer

        22 | 23 |

        Dependencies

        24 | 25 |

        ic-scroll-offset has no dependency implications.

        26 | 27 |
        28 |
        29 |
        -------------------------------------------------------------------------------- /www/attributes/ic-scroll-to-target.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-scroll-to-target 4 | --- 5 | 6 |
        7 | 8 |
        9 |
        10 | 11 |

        ic-scroll-to-target - The Scroll To Target Attribute

        12 | 13 |

        Summary

        14 | 15 |

        The ic-scroll-to-target attribute tells Intercooler to scroll the top of the target element 16 | into the viewport, if it is not visible. This can be paired with the ic-scroll-offset attribute 17 | to fine tune exactly what position is scrolled to.

        18 | 19 |

        Syntax

        20 | 21 |

        The value of this attribute can be either true or false

        22 | 23 |

        Dependencies

        24 | 25 |

        ic-scroll-to-target has no dependency implications.

        26 | 27 |
        28 |
        29 |
        -------------------------------------------------------------------------------- /www/attributes/ic-select-from-response.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-select-from-response 4 | --- 5 | 6 |
        7 | 8 |
        9 |
        10 | 11 |

        ic-select-from-response - The Response Selector Attribute

        12 | 13 |

        Summary

        14 | 15 |

        The response selector attribute can be used to select the element to take the inner HTML from in a 16 | a server response.

        17 | 18 |

        Syntax

        19 | 20 |

        The value of the attribute should be a valid selector of the element to take the content from.

        21 | 22 |

        This attribute may be placed on parent elements, allowing you to specify behavior across 23 | multiple elements.

        24 | 25 |

        Example

        26 | 27 |

        Here is a simple example of a response selector filtering a full HTML document for a list:

        28 | 29 |
        30 | 36 | 37 | 41 | 42 |
          43 |
        • Initial Item 1
        • 44 |
        • Initial Item 3
        • 45 |
        46 |
        47 | 48 |
        49 |
        50 |
        -------------------------------------------------------------------------------- /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 |

        Dependencies

        29 | 30 |

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

        33 | 34 |

        Example

        35 | 36 |

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

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

        ic-sse-src - The Server Sent Event Source Attribute

        12 | 13 |

        Summary

        14 | 15 |

        The ic-sse-src attribute binds a given HTML element to a given 16 | Server Sent Event 17 | source.

        18 | 19 |

        When the Server Sent Event source sends a message, the content of that message will be swapped into the 20 | element the attribute is on, using the swap strategy specified.

        21 | 22 |

        When the Server Sent Event source sends an event, any child elements listening for that event will 23 | be triggered.

        24 | 25 |

        See the documentation for more details.

        26 | 27 |

        Syntax

        28 | 29 |

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

        30 | 31 |

        Dependencies

        32 | 33 |

        ic-sse-src has no effect on dependencies.

        34 | 35 |
        36 |
        37 |
        -------------------------------------------------------------------------------- /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 | 56 |
        Help! I'm turning red!
        57 |
        58 | 59 |
        60 |
        61 |
        -------------------------------------------------------------------------------- /www/attributes/ic-swap-style.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-swap-style 4 | --- 5 | 6 |
        7 | 8 |
        9 |
        10 | 11 |

        ic-swap-style - The Swap Style Attribute

        12 | 13 |

        Summary

        14 | 15 |

        The ic-swap-style attribute tells intercooler how to swap content received from the server into 16 | the target element.

        17 | 18 |

        Syntax

        19 | 20 |

        The value of the attribute should be one of 'replace', 'append', 'prepend'

        21 | 22 |

        Dependencies

        23 | 24 |

        ic-swap-style has no effect on dependencies.

        25 | 26 |
        27 |
        28 |
        29 | -------------------------------------------------------------------------------- /www/attributes/ic-switch-class.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-switch-class 4 | --- 5 | 6 |
        7 | 8 |
        9 |
        10 | 11 |

        ic-switch-class - The Switch Class Attribute

        12 | 13 |

        Summary

        14 | 15 |

        The ic-switch-class attribute allows you to switch classes 16 | between elements after a response has been received. This allows you to 17 | for example update a tab state without replacing the tabs in the server 18 | response.

        19 | 20 |

        Syntax

        21 | 22 |

        The value of this attribute should be the name of the class to be switched between sibling 23 | elements and the attribute should be placed on the parent element.

        24 | 25 |

        Dependencies

        26 | 27 |

        The ic-switch-class attribute has no effect on dependencies.

        28 | 29 |

        Example

        30 | 31 |

        Here is a simple bootstrap tab example. Note that the body of the tabbed UI is 32 | replaced with new HTML, but the tabs are not, since we are targeting #content. 33 | The tabs update based on switching the class active between them.

        34 | 35 |
        36 |         <ul class="nav nav-tabs" ic-target="#content" ic-switch-class="active">
        37 |           <li class="active"><a ic-get-from="/tab1">Tab1</a></li>
        38 |           <li><a ic-get-from="/tab2">Tab2</a></li>
        39 |           <li><a ic-get-from="/tab3">Tab3</a></li>
        40 |         </ul>
        41 |         <div id="content">
        42 |           Tab 1
        43 |         </div>
        44 |       
        45 | 46 |
        47 | 55 | 56 | 61 |
        62 | Tab 1 63 |
        64 | 65 |
        66 | 67 |
        68 |
        69 |
        70 | -------------------------------------------------------------------------------- /www/attributes/ic-transform-response.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-transform-response 4 | --- 5 | 6 |
        7 | 8 |
        9 |
        10 | 11 |

        ic-transform-response - Transform Response attribute

        12 | 13 |

        Summary

        14 | 15 |

        This attribute is a javascript expression that will be evaluated after a response is received, allowing the 16 | client side to transform the given response (e.g. from JSON to HTML)

        17 | 18 |

        Syntax

        19 | 20 |

        This attribute is a valid javascript expression, evaluated within an isolated scope.

        21 | 22 |

        This attribute may be placed on parent elements, allowing you to specify behavior across 23 | multiple elements.

        24 | 25 |

        Available symbols are:

        26 | 27 |
          28 |
        • content - The string content of the server response
        • 29 |
        • url - The URL that the content came from
        • 30 |
        • elt - The element that triggered the request
        • 31 |
        32 | 33 |

        The ic-transform-response attribute can be placed on an parent element, allowing general request processing 34 | for an entire page. Intercooler will find the closest element with this attribute and evaluate it.

        35 | 36 |

        Note that, due to the way intercooler evaluates expressions, you must include a return statement in this attribute to return the value.

        37 | 38 |

        Example

        39 | 40 |

        Here is a simple example, using a poll interval to update a list coming from a JSON end point and ic-transform-response 41 | to convert that JSON into HTML:

        42 | 43 |
        44 |         <ul ic-get-from="/ips"
        45 |             ic-poll="1s"
        46 |             ic-transform-response="return jsonToHTML(content)">
        47 |           <li>No Data Yet...</li>
        48 |         </ul>
        49 |       
        50 | 51 | 52 |
        53 | 81 | 82 |

        IP Addresses:

        83 |
          86 |
        • No Data Yet...
        • 87 |
        88 |
        89 | 90 |
        91 | 92 |
        93 |
        -------------------------------------------------------------------------------- /www/attributes/ic-transition-duration.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-transition-duration 4 | --- 5 | 6 |
        7 | 8 |
        9 |
        10 | 11 |

        ic-transition-duration - The Poll Attribute

        12 | 13 |

        Summary

        14 | 15 |

        The ic-transition-duration attribute tells Intercooler to wait the specified amount of time 16 | after applying the ic-transitioning class to the target element and then executing the content swap, 17 | which gives a CSS transition time to complete.

        18 | 19 |

        Syntax

        20 | 21 |

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

        23 | 24 |

        Dependencies

        25 | 26 |

        ic-transition-duration has no dependency implications.

        27 | 28 |

        Example

        29 | 30 | 31 |

        Here is a simple example, where the inner content is faded in and out on a button:

        32 | 33 |
        34 |   <style>
        35 |     #transition-2 span {
        36 |       transition: all .9s;
        37 |     }
        38 | 
        39 |     #transition-2.ic-transitioning span {
        40 |       opacity: 0;
        41 |     }
        42 |   </style>
        43 | 
        44 |   <a id="transition-2" ic-transition-duration="1s" class="btn btn-primary" ic-post-to="/transition_2"><span>Click Me!</span></a>
        45 | 
        46 |   
        47 | 48 |
        49 | 58 | 59 | 65 | Click Me! 66 |
        67 | 68 | 69 |
        70 |
        71 |
        -------------------------------------------------------------------------------- /www/attributes/ic-trigger-delay.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-trigger-on 4 | --- 5 | 6 |
        7 | 8 |
        9 |
        10 | 11 |

        ic-trigger-delay - The Trigger Delay Attribute

        12 | 13 |

        Summary

        14 | 15 |

        The ic-trigger-delay attribute tells Intercooler to delay the firing of a request in response 16 | to a trigger until the specified time interval has passed. If the trigger occurs again before the interval 17 | is complete, the earlier trigger will cancel and new trigger will begin waiting for the specified interval.

        18 | 19 |

        Syntax

        20 | 21 |

        The value of the attribute should a valid integer, followed by the string "s" (for seconds) or "ms" (for 22 | milliseconds). (e.g. ic-trigger-delay="100ms" indicates intercooler will delay firing the request for 23 | 100 milliseconds after the trigger has occurred.)

        24 | 25 |

        Dependencies

        26 | 27 |

        ic-trigger-delay has no dependency implications.

        28 | 29 |

        Simple Example

        30 | 31 |

        Here is a text box that updates a div with its content after a delay:

        32 | 33 |
        34 |   <input type="text" name="text"
        35 |          ic-post-to="/text" ic-trigger-on="keypress" ic-trigger-delay="500ms"
        36 |          ic-target="#text-div" ic-indicator="#indicator"/>
        37 |   <i id="indicator" class="fa fa-spinner fa-spin" style="display:none"></i>
        38 |   <br/>
        39 |   Text: <div id="text-div"></div>
        40 | 
        41 | 42 |
        43 | 53 | 54 | 57 | 58 |
        59 | Text:
        60 |
        61 | 62 | 63 |
        64 |
        65 |
        66 | -------------------------------------------------------------------------------- /www/attributes/ic-trigger-from.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: attributes > ic-trigger-from 4 | --- 5 | 6 |
        7 | 8 |
        9 |
        10 | 11 |

        ic-trigger-from - The Trigger From Attribute

        12 | 13 |

        Summary

        14 | 15 |

        The ic-trigger-from attribute tells Intercooler to watch another element in the DOM for 16 | events that will trigger a request.

        17 | 18 |

        Syntax

        19 | 20 |

        The value of the attribute should be either document, window or a valid 21 | jQuery selector for the element.

        22 | 23 |

        Dependencies

        24 | 25 |

        ic-trigger-from has no effect on dependencies.

        26 | 27 |

        Simple Example

        28 | 29 |

        Here is a div that is triggered by the click event of an otherwise unrelated button:

        30 | 31 |
        32 |   <button id="myButton">Click Me</button>
        33 |   <div ic-get-from="/get_it" ic-trigger-from="#myButton">
        34 |     Not Loaded Yet...
        35 |   </div>
        36 | 
        37 | 38 |
        39 | 44 | 45 | 46 |
        47 | Not Loaded Yet... 48 | 49 |
        50 |
        51 | 52 |
        53 |
        54 |
        55 | -------------------------------------------------------------------------------- /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 Trigger 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 |

        The special event scrolled-into-view will fire when an element first scrolls into view.

        27 | 28 |

        The special event timeout allows you to trigger the request after a given interval (e.g. 29 | timeout:400ms will fire after 400 milliseconds

        30 | 31 |

        The changed modifier can be added after the event name and a space. Intercooler will only trigger a request 32 | if the value of the element in question has changed if this modifier is present.

        33 | 34 |

        The once modifier can be added after the event name and a space. Intercooler will only trigger a request 35 | once for the given event if this modifier is present.

        36 | 37 |

        Server Sent Events

        38 | 39 |

        If a parent element has an ic-sse-src attribute on it, it is possible to use server sent 40 | events to trigger an element by using the sse: prefix, followed by the event name.

        41 | 42 |

        See the documentation for more details.

        43 | 44 |

        Dependencies

        45 | 46 |

        ic-trigger-on has no effect on dependencies.

        47 | 48 |

        Multiple Events

        49 | 50 |

        ic-trigger-on supports multiple events, separated by a comma: click, change

        51 | 52 |

        Simple Example

        53 | 54 |

        Here is a div with a header tag near the bottom that issues a request once it is scrolled into view:

        55 | 56 |
        57 |   <h2>Scroll Down To Load <i class="fa fa-arrow-down" style="margin-bottom:150%"></i> </h2>
        58 | 
        59 |   <h2 ic-src="/get_it" ic-trigger-on="scrolled-into-view">
        60 |     Not Loaded Yet...
        61 |   </h2>
        62 | 
        63 | 64 |
        65 | 74 | 75 |

        Scroll Down To Load

        76 | 77 |

        78 | Not Loaded Yet... 79 |

        80 |
        81 |
        82 |
        83 |
        84 | -------------------------------------------------------------------------------- /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/blog.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: blog 4 | --- 5 | 6 |
        7 | 8 |
        9 |
        10 |
        11 | 12 |

        I Regret Nothing. Nothing.
        13 | The Intercooler Blog 14 |

        15 |
        16 |
        17 |
        18 |
        19 | 20 |
        21 |
        22 |
        23 | 24 | 25 | 34 | 35 |
        36 |
        37 |
        38 |
        -------------------------------------------------------------------------------- /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/dump.rdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigskysoftware/intercooler-js/8ac13742f2948c272e4d4f7eb6b609c75b4a0735/www/dump.rdb -------------------------------------------------------------------------------- /www/examples.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 |
        5 | 6 |
        7 |
        8 | 9 |

        Obsolete Examples Page

        10 | 11 |

        This page is no longer up to date.

        12 | 13 |

        Redirecting to the New Examples Page in 3 seconds...

        14 | 15 | 23 |
        24 |
        25 |
        26 | -------------------------------------------------------------------------------- /www/examples/bootstrap-dialog.css: -------------------------------------------------------------------------------- 1 | .bootstrap-dialog { 2 | /* dialog types */ 3 | /** 4 | * Icon animation 5 | * Copied from font-awesome: http://fontawesome.io/ 6 | **/ 7 | /** End of icon animation **/ 8 | } 9 | .bootstrap-dialog .modal-header { 10 | border-top-left-radius: 4px; 11 | border-top-right-radius: 4px; 12 | } 13 | .bootstrap-dialog .bootstrap-dialog-title { 14 | color: #fff; 15 | display: inline-block; 16 | font-size: 16px; 17 | } 18 | .bootstrap-dialog .bootstrap-dialog-message { 19 | font-size: 14px; 20 | } 21 | .bootstrap-dialog .bootstrap-dialog-button-icon { 22 | margin-right: 3px; 23 | } 24 | .bootstrap-dialog .bootstrap-dialog-close-button { 25 | font-size: 20px; 26 | float: right; 27 | filter: alpha(opacity=90); 28 | -moz-opacity: 0.9; 29 | -khtml-opacity: 0.9; 30 | opacity: 0.9; 31 | } 32 | .bootstrap-dialog .bootstrap-dialog-close-button:hover { 33 | cursor: pointer; 34 | filter: alpha(opacity=100); 35 | -moz-opacity: 1; 36 | -khtml-opacity: 1; 37 | opacity: 1; 38 | } 39 | .bootstrap-dialog.type-default .modal-header { 40 | background-color: #fff; 41 | } 42 | .bootstrap-dialog.type-default .bootstrap-dialog-title { 43 | color: #333; 44 | } 45 | .bootstrap-dialog.type-info .modal-header { 46 | background-color: #5bc0de; 47 | } 48 | .bootstrap-dialog.type-primary .modal-header { 49 | background-color: #428bca; 50 | } 51 | .bootstrap-dialog.type-success .modal-header { 52 | background-color: #5cb85c; 53 | } 54 | .bootstrap-dialog.type-warning .modal-header { 55 | background-color: #f0ad4e; 56 | } 57 | .bootstrap-dialog.type-danger .modal-header { 58 | background-color: #d9534f; 59 | } 60 | .bootstrap-dialog.size-large .bootstrap-dialog-title { 61 | font-size: 24px; 62 | } 63 | .bootstrap-dialog.size-large .bootstrap-dialog-close-button { 64 | font-size: 30px; 65 | } 66 | .bootstrap-dialog.size-large .bootstrap-dialog-message { 67 | font-size: 18px; 68 | } 69 | .bootstrap-dialog .icon-spin { 70 | display: inline-block; 71 | -moz-animation: spin 2s infinite linear; 72 | -o-animation: spin 2s infinite linear; 73 | -webkit-animation: spin 2s infinite linear; 74 | animation: spin 2s infinite linear; 75 | } 76 | @-moz-keyframes spin { 77 | 0% { 78 | -moz-transform: rotate(0deg); 79 | } 80 | 100% { 81 | -moz-transform: rotate(359deg); 82 | } 83 | } 84 | @-webkit-keyframes spin { 85 | 0% { 86 | -webkit-transform: rotate(0deg); 87 | } 88 | 100% { 89 | -webkit-transform: rotate(359deg); 90 | } 91 | } 92 | @-o-keyframes spin { 93 | 0% { 94 | -o-transform: rotate(0deg); 95 | } 96 | 100% { 97 | -o-transform: rotate(359deg); 98 | } 99 | } 100 | @-ms-keyframes spin { 101 | 0% { 102 | -ms-transform: rotate(0deg); 103 | } 104 | 100% { 105 | -ms-transform: rotate(359deg); 106 | } 107 | } 108 | @keyframes spin { 109 | 0% { 110 | transform: rotate(0deg); 111 | } 112 | 100% { 113 | transform: rotate(359deg); 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /www/examples/debugging.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: tutorial 4 | --- 5 | 6 |
        7 | 8 |
        9 |
        10 | 11 |

        Debugging Intercooler

        12 | 13 |

        This example shows some of the features of the intercooler debugger. The debugger 14 | can be launched by including the following javascript:

        15 |
        16 | <script>
        17 |   $.getScript("https://intercoolerreleases-leaddynocom.netdna-ssl.com/intercooler-debugger.js");
        18 | </script>
        19 | 20 |

        21 | 22 |

        23 | 24 |

        The buttons below will all show up in the "Elements" tab of the debugger. If you click on the element it will 25 | highlight the element in the UI and show you the intercooler related details, including the target.

        26 | 27 |

        The "Log" tab will include all the log messages that intercooler generates, with links back to the elements that 28 | generate them.

        29 | 30 |

        Finally, the "Errors" tab will include any error states that intercooler detects. In this case, there are two: 31 | Button 2 has a bad target, and Button 3 has a bad indicator.

        32 | 33 |

        Note that the "server side" implementation is mocked out using mockjax, so you can see the entire 34 | implementation. Click the "Source Code" tab to see the code.

        35 | 36 |
        37 | 42 |
        43 | 44 |
        45 |
        46 | 47 | 48 | 49 | 50 | 51 |
        52 | Click A Button! 53 |
        54 | 55 | 72 |
        73 |
        74 |
        
        75 |         
        76 |
        77 | 78 |
        79 | 82 | 83 |
        84 |
        85 | -------------------------------------------------------------------------------- /www/examples/history_tab1.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: history 3 | nav: tutorial 4 | --- 5 | 6 |
        7 | 12 |
        13 |

        Tab 1

        14 | Click Me! 15 |
        16 |
        -------------------------------------------------------------------------------- /www/examples/history_tab2.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: history 3 | nav: tutorial 4 | --- 5 | 6 |
        7 | 12 |
        13 |

        Tab 2

        14 | Click Me! 15 |
        16 |
        -------------------------------------------------------------------------------- /www/examples/history_tab3.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: history 3 | nav: tutorial 4 | --- 5 | 6 |
        7 | 12 |
        13 |

        Tab 3

        14 | Click Me! 15 |
        16 |
        -------------------------------------------------------------------------------- /www/examples/lazyload.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: tutorial 4 | --- 5 | 6 |
        7 | 8 |
        9 |
        10 | 11 |

        Lazy Loading A Div

        12 | 13 |

        This example lazily loads an expensive to calculate graph in a div within the page, allowing the 14 | page to respond immediately.

        15 | 16 |

        Note that the "server side" implementation is mocked out using mockjax, so you can see the entire 17 | implementation. Click the "Source Code" tab to see the code.

        18 | 19 |

        Explanation

        20 | 21 |
          22 |
        • 23 | A div within the page loads a graph from another URL using the 24 | ic-get-from 25 | attribute. In order to trigger the loading when the page loads, the 26 | ic-trigger-on 27 | attribute is set to "load". 28 |
        • 29 |
        • A progress spinner is in the div when it is first rendered, to let the user know that the 30 | lazily loaded content is in flight
        • 31 |
        32 | 33 |

        Demo

        34 | 35 |
        36 | 44 |
        45 | 46 |
        47 |
        48 | 49 |

        Tokyo Climate Graph

        50 | 51 |
        52 | Loading Graph... 53 |
        54 | 55 | 63 | 64 | 78 |
        79 |
        80 |
        
        81 |         
        82 |
        83 |
        84 | 85 | 88 | 89 |
        90 |
        91 | -------------------------------------------------------------------------------- /www/examples/prototyping.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: tutorial 4 | --- 5 | 6 |
        7 | 8 |

        Local Prototyping & Content

        9 | 10 |

        If you wish to prototype intercooler interfaces locally, with no server, or if you wish to avoid server round 11 | trips for certain elements, you can take advantage of the prototyping system built into intercooler:

        12 | 13 |
          14 |
        • 15 | Demarcate a section of HTML to be ignored by intercooler by applying the ic-ignore class to it. 16 | No content will be processed in this section, so you can use intercooler attributes without risk of triggering 17 | things like polling, event support, etc. 18 |
        • 19 |
        • 20 | Within this section, you can create elements with unique ID's that hold the prototype HTML content you want 21 | swapped in via an intercooler request. 22 |
        • 23 |
        • 24 | In your active UI, you can refer to these elements using a 25 | fragment identifier corresponding to the 26 | element's ID. 27 |
        • 28 |
        • 29 | You can use ic-local-* attributes to return status codes or custom intercooler headers to 30 | more fully simulate server requests. 31 |
        • 32 |
        • 33 | Depending on where you are in development, you may want to hide the ic-ignore section, to better 34 | visually simulate your UX. 35 |
        • 36 |
        37 | 38 |

        Using this technique, you can build prototype or local-content UX with no Javascript whatsoever!

        39 | 40 |
        41 | 49 |
        50 | 51 |
        52 |
        53 | 54 |
        55 |
        Click me
        56 |
        Don't Click me
        57 |
        58 | 59 | 60 |
        61 |

        HTML For Responses:

        62 | 63 |
        64 | 65 |
        66 | Hello, world 67 |
        68 | 69 |
        70 | Goodbye, world 71 |
        72 |
        73 | 74 |
        75 | 76 |
        77 |
        
        78 |     
        79 | 80 | 83 | 84 |
        85 |
        -------------------------------------------------------------------------------- /www/getting_to_intercooler.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: docs 4 | --- 5 | 10 |
        11 | 12 |
        13 |
        14 |

        Getting To Intercooler

        15 | 16 |

        Consider the humble anchor tag, foundation of the web:

        17 | 18 |

        <a href="http://www.google.com">Click Me</a>

        19 | 20 |

        This bit of HTML tells the browser:

        21 | 22 |
        "When the user clicks on this anchor tag, issue an HTTP GET to http://www.google.com and replace 23 | the current page with the response."
        24 | 25 |

        Let's break this sentence down into its components:

        26 | 27 |
        "When [the user clicks on] this 28 | [anchor tag], issue an [HTTP GET to http://www.google.com] and replace 29 | [the current page] with the response."
        30 | 31 |

        Intercooler generalizes each of these components:

        32 | 33 |
          34 |
        • 35 | [the user clicks on] - ic-trigger-on lets you specify the event that 36 | causes the request. 37 |
        • 38 |
        • 39 | [anchor tag] - Intercooler attributes work on any element, not just 40 | anchor tags. 41 |
        • 42 |
        • 43 | [HTTP GET to http://www.google.com] - Using the ic-post-to, 44 | ic-put-to, ic-delete-from and ic-get-from attributes, you can make 45 | use of the full catalog of HTTP actions. 46 |
        • 47 |
        • 48 | [the current page] - You can use the ic-target attribute 49 | to target any particular element for replacement. 50 |
        • 51 |
        52 | 53 |

        To give a general form to the original statement:

        54 | 55 |
        "When X this 56 | Y, issue a Z and replace 57 | P with the response."
        58 | 59 |

        This generalization and extension of the traditional patterns of web development lets you create 60 | rich user interaction while minimizing the associated conceptual and complexity burdens. As you peruse 61 | the examples section you will be surprised how many UX patterns normally associated with heavy javascript 62 | can be implemented using this simple pattern.

        63 | 64 |

        See the documentation to find out everything you can do with Intercooler.

        65 | 66 |
        67 |
        68 | 69 |
        -------------------------------------------------------------------------------- /www/images/Intercooler_CMYK.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigskysoftware/intercooler-js/8ac13742f2948c272e4d4f7eb6b609c75b4a0735/www/images/Intercooler_CMYK.png -------------------------------------------------------------------------------- /www/images/Intercooler_CMYK_noType.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigskysoftware/intercooler-js/8ac13742f2948c272e4d4f7eb6b609c75b4a0735/www/images/Intercooler_CMYK_noType.png -------------------------------------------------------------------------------- /www/images/Intercooler_CMYK_noType_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigskysoftware/intercooler-js/8ac13742f2948c272e4d4f7eb6b609c75b4a0735/www/images/Intercooler_CMYK_noType_64.png -------------------------------------------------------------------------------- /www/images/Intercooler_CMYK_noType_ico.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigskysoftware/intercooler-js/8ac13742f2948c272e4d4f7eb6b609c75b4a0735/www/images/Intercooler_CMYK_noType_ico.png -------------------------------------------------------------------------------- /www/images/Intercooler_CMYK_noType_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigskysoftware/intercooler-js/8ac13742f2948c272e4d4f7eb6b609c75b4a0735/www/images/Intercooler_CMYK_noType_square.png -------------------------------------------------------------------------------- /www/images/Intercooler_K.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigskysoftware/intercooler-js/8ac13742f2948c272e4d4f7eb6b609c75b4a0735/www/images/Intercooler_K.png -------------------------------------------------------------------------------- /www/images/Intercooler_K_noType.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigskysoftware/intercooler-js/8ac13742f2948c272e4d4f7eb6b609c75b4a0735/www/images/Intercooler_K_noType.png -------------------------------------------------------------------------------- /www/images/Intercooler_reverse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigskysoftware/intercooler-js/8ac13742f2948c272e4d4f7eb6b609c75b4a0735/www/images/Intercooler_reverse.png -------------------------------------------------------------------------------- /www/images/Intercooler_reverse_noType.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigskysoftware/intercooler-js/8ac13742f2948c272e4d4f7eb6b609c75b4a0735/www/images/Intercooler_reverse_noType.png -------------------------------------------------------------------------------- /www/images/JSchemaTickerwatch.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigskysoftware/intercooler-js/8ac13742f2948c272e4d4f7eb6b609c75b4a0735/www/images/JSchemaTickerwatch.mp4 -------------------------------------------------------------------------------- /www/images/back_to_the_future.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigskysoftware/intercooler-js/8ac13742f2948c272e4d4f7eb6b609c75b4a0735/www/images/back_to_the_future.png -------------------------------------------------------------------------------- /www/images/maxcdn-logo-200px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigskysoftware/intercooler-js/8ac13742f2948c272e4d4f7eb6b609c75b4a0735/www/images/maxcdn-logo-200px.png -------------------------------------------------------------------------------- /www/images/there-is-no-need-to-be-complex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigskysoftware/intercooler-js/8ac13742f2948c272e4d4f7eb6b609c75b4a0735/www/images/there-is-no-need-to-be-complex.png -------------------------------------------------------------------------------- /www/images/tokyo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bigskysoftware/intercooler-js/8ac13742f2948c272e4d4f7eb6b609c75b4a0735/www/images/tokyo.png -------------------------------------------------------------------------------- /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/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-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 | -------------------------------------------------------------------------------- /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-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/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/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-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/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-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-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-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 | -------------------------------------------------------------------------------- /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-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-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/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 | -------------------------------------------------------------------------------- /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-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-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/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/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/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-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-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-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-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/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/skins/desert.css: -------------------------------------------------------------------------------- 1 | /* desert scheme ported from vim to google prettify */ 2 | pre.prettyprint { display: block; background-color: #333 } 3 | pre .nocode { background-color: none; color: #000 } 4 | pre .str { color: #ffa0a0 } /* string - pink */ 5 | pre .kwd { color: #f0e68c; font-weight: bold } 6 | pre .com { color: #87ceeb } /* comment - skyblue */ 7 | pre .typ { color: #98fb98 } /* type - lightgreen */ 8 | pre .lit { color: #cd5c5c } /* literal - darkred */ 9 | pre .pun { color: #fff } /* punctuation */ 10 | pre .pln { color: #fff } /* plaintext */ 11 | pre .tag { color: #f0e68c; font-weight: bold } /* html/xml tag - lightyellow */ 12 | pre .atn { color: #bdb76b; font-weight: bold } /* attribute name - khaki */ 13 | pre .atv { color: #ffa0a0 } /* attribute value - pink */ 14 | pre .dec { color: #98fb98 } /* decimal - lightgreen */ 15 | 16 | /* Specify class=linenums on a pre to get line numbering */ 17 | ol.linenums { margin-top: 0; margin-bottom: 0; color: #AEAEAE } /* IE indents via margin-left */ 18 | li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8 { list-style-type: none } 19 | /* Alternate shading for lines */ 20 | li.L1,li.L3,li.L5,li.L7,li.L9 { } 21 | 22 | @media print { 23 | pre.prettyprint { background-color: none } 24 | pre .str, code .str { color: #060 } 25 | pre .kwd, code .kwd { color: #006; font-weight: bold } 26 | pre .com, code .com { color: #600; font-style: italic } 27 | pre .typ, code .typ { color: #404; font-weight: bold } 28 | pre .lit, code .lit { color: #044 } 29 | pre .pun, code .pun { color: #440 } 30 | pre .pln, code .pln { color: #000 } 31 | pre .tag, code .tag { color: #006; font-weight: bold } 32 | pre .atn, code .atn { color: #404 } 33 | pre .atv, code .atv { color: #060 } 34 | } -------------------------------------------------------------------------------- /www/release/lib/zepto.data-1.2.0.js: -------------------------------------------------------------------------------- 1 | // Zepto.js 2 | // (c) 2010-2016 Thomas Fuchs 3 | // Zepto.js may be freely distributed under the MIT license. 4 | 5 | // The following code is heavily inspired by jQuery's $.fn.data() 6 | 7 | ;(function($){ 8 | var data = {}, dataAttr = $.fn.data, camelize = $.camelCase, 9 | exp = $.expando = 'Zepto' + (+new Date()), emptyArray = [] 10 | 11 | // Get value from node: 12 | // 1. first try key as given, 13 | // 2. then try camelized key, 14 | // 3. fall back to reading "data-*" attribute. 15 | function getData(node, name) { 16 | var id = node[exp], store = id && data[id] 17 | if (name === undefined) return store || setData(node) 18 | else { 19 | if (store) { 20 | if (name in store) return store[name] 21 | var camelName = camelize(name) 22 | if (camelName in store) return store[camelName] 23 | } 24 | return dataAttr.call($(node), name) 25 | } 26 | } 27 | 28 | // Store value under camelized key on node 29 | function setData(node, name, value) { 30 | var id = node[exp] || (node[exp] = ++$.uuid), 31 | store = data[id] || (data[id] = attributeData(node)) 32 | if (name !== undefined) store[camelize(name)] = value 33 | return store 34 | } 35 | 36 | // Read all "data-*" attributes from a node 37 | function attributeData(node) { 38 | var store = {} 39 | $.each(node.attributes || emptyArray, function(i, attr){ 40 | if (attr.name.indexOf('data-') == 0) 41 | store[camelize(attr.name.replace('data-', ''))] = 42 | $.zepto.deserializeValue(attr.value) 43 | }) 44 | return store 45 | } 46 | 47 | $.fn.data = function(name, value) { 48 | return value === undefined ? 49 | // set multiple values via object 50 | $.isPlainObject(name) ? 51 | this.each(function(i, node){ 52 | $.each(name, function(key, value){ setData(node, key, value) }) 53 | }) : 54 | // get value from first element 55 | (0 in this ? getData(this[0], name) : undefined) : 56 | // set value on all elements 57 | this.each(function(){ setData(this, name, value) }) 58 | } 59 | 60 | $.data = function(elem, name, value) { 61 | return $(elem).data(name, value) 62 | } 63 | 64 | $.hasData = function(elem) { 65 | var id = elem[exp], store = id && data[id] 66 | return store ? !$.isEmptyObject(store) : false 67 | } 68 | 69 | $.fn.removeData = function(names) { 70 | if (typeof names == 'string') names = names.split(/\s+/) 71 | return this.each(function(){ 72 | var id = this[exp], store = id && data[id] 73 | if (store) $.each(names || store, function(key){ 74 | delete store[names ? camelize(this) : key] 75 | }) 76 | }) 77 | } 78 | 79 | // Generate extended `remove` and `empty` functions 80 | ;['remove', 'empty'].forEach(function(methodName){ 81 | var origFn = $.fn[methodName] 82 | $.fn[methodName] = function() { 83 | var elements = this.find('*') 84 | if (methodName === 'remove') elements = elements.add(this) 85 | elements.removeData() 86 | return origFn.call(this) 87 | } 88 | }) 89 | })(Zepto) -------------------------------------------------------------------------------- /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/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/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/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/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/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/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/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. 38 |
        • 39 |
        40 | 41 |

        Git Diff

        42 | 43 |

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

        44 | 45 | 46 | https://github.com/LeadDyno/intercooler-tutorial-app/commit/b94118fbb5cb0ccd065c6e27d316de3e29313bce 47 | 48 | 49 |
        50 |
        51 |
        -------------------------------------------------------------------------------- /www/why.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | nav: why 4 | --- 5 | 6 |
        7 | 8 |
        9 |
        10 | 11 |
        12 |

        Why Use Intercooler?

        13 | 14 |

        In a word: simplicity.

        15 | 16 |

        With intercooler you can add AJAX to your application without using client-side models, routing, validation, 17 | rendering, factories or dependency injection.

        18 | 19 |

        In fact, you don't need to write any javascript at all.

        20 | 21 |

        How Does That Work?

        22 | 23 |

        Intercooler is a natural extension of HTML: simple attributes with a familiar syntax are all that is 24 | required to add AJAX requests to your application.

        25 | 26 |

        Intercooler does use javascript to communicate with a server, but the events triggering the requests are 27 | described with HTML attributes (or are simply implied) rather than with imperative javascript.

        28 | 29 |

        Rather than expecting a JSON response from the server, intercooler expects HTML. This HTML is then loaded 30 | into the DOM directly.

        31 | 32 |

        This is in contrast with Javascript MVC frameworks such as Ember.js or 33 | Angular.js, which typically use JSON as a data transport and have much 34 | more involved client-side binding and rendering.

        35 | 36 |

        Below is a diagram showing an intercooler request:

        37 | 38 |

        39 | 40 |

        41 | 42 |

        The AJAX response is a bit of HTML generated by the server, which is swapped into the DOM in place of the 43 | existing 44 | content.

        45 | 46 |

        This technique is fast and simple.

        47 | 48 |

        Intercooler was inspired by Turbolinks and, particularly, 49 | by the 50 | excellent pjax library.

        51 | 52 |

        The Zen of Intercooler

        53 | 54 |

        "The minimum complexity compatible with user joy."

        55 | 56 |
        57 |
        58 |
        59 | 60 |
        --------------------------------------------------------------------------------