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 |
15 |
input, select - A value change.
16 |
form - A form submission.
17 |
Everything else - A click.
18 |
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:
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 | 
--------------------------------------------------------------------------------
/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.
--------------------------------------------------------------------------------
/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!
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.
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 |
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:
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 |
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 |
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.
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:
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:
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.
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.
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 |
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.
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.
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:
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.
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.
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.
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.
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:
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 |
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.
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.
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.
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.
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.
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.
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:
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:
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 |
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
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.
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:
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:
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 |
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.
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:
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.)
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.
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.
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.
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.
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 |
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.
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.
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.
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:
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:
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:
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.
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:
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.
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
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!
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 |
Rename the ic-load-on attribute to ic-trigger-on.
23 |
All intercooler events that were previously named ic.* should be reversed to *.ic - this
24 | is more consistent with jQuery event name spacing.
25 |
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.
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:
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:
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:
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."