jquery.urianchor
Advanced tools
Comparing version 1.2.2 to 1.3.0
/* | ||
* jQuery plugin to manage the URI anchor component ("hash fragmant") | ||
* Jquery plugin for state managment through the URI anchor (hash fragment) | ||
* | ||
* Copyright (c) 2013-2015 Michael S. Mikowski | ||
* Copyright (c) 2013 Michael S. Mikowski | ||
* (mike[dot]mikowski[at]gmail[dotcom]) | ||
@@ -13,3 +13,2 @@ * | ||
* 1.2.1 - Updated documentaiton, minor bug fixes | ||
* 1.2.2 - npm version bump | ||
* | ||
@@ -16,0 +15,0 @@ */ |
{ | ||
"name": "jquery.urianchor", | ||
"version": "1.2.2", | ||
"description": "uriAnchor jQuery plugin - SPA URI routing made simple. Use this plugin to provide sophisticated routing to your SPA. Used in many commercial SPAs and featured in a best-selling book on SPAs.", | ||
"version": "1.3.0", | ||
"description": "uriAnchor jQuery plugin - SPA URI management made simple. Use this plugin to manage dependent and independent parameters in the hash fragment of the URI. It has been designed and updated over five commercial SPA projects and is featured in the book [Single page web applications - JavaScript end-to-end](http://manning.com/mikowski). It provides the capability to make the URI fragment your application state API. Bookmarks, browser history, the back button, and the forward button can all be made to act as the user expects.", | ||
"main": "jquery.uriAnchor.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
129
README.md
@@ -5,36 +5,13 @@ # uriAnchor # | ||
A jQuery plugin for management of the URI hash fragment (all text in the URL after the first '#' character). | ||
A jQuery plugin for management of the URI hash component. | ||
Use this plugin to manage dependent and independent variables in the hash fragment of the URI. It has been designed and updated over five commercial SPA projects and is featured in the book [Single page web applications - JavaScript end-to-end](http://manning.com/mikowski). It provides the capability to make the URI fragment your application state API. Bookmarks, browser history, the back button, and the forward button can all be made to act as the user expects while enabling you to update only the part of the page that has changed. | ||
Use this plugin to manage dependent and independent variables in the hash | ||
fragment of the URI. It has been designed and updated over five commercial | ||
SPA projects and is featured in the book | ||
[Single page web applications, JavaScript end-to-end][1] | ||
It provides the capability to make the URI fragment your application state | ||
API. Bookmarks, browser history, the back button, and the forward button | ||
can all be made to act as the user expects while enabling you to update | ||
only the part of the page that has changed. | ||
## Replace Backbone with something much more robust ## | ||
The plugin, used with a few other well-chosen tools, form a fantastic basis for a lean, easy to use SPA architecture as detailed in the [the book](http://manning.com/mikowski)(http://manning.com/mikowski). Here are the recommended tools: | ||
- AJAX: Use **native jQuery** AJAX methods. | ||
- Promises: Use **native jQuery** promise methods. | ||
- Model Events: Use the **jQuery plugin** [jquery.event.gevent](https://www.npmjs.com/package/jquery.event.gevent) as a unified event mechanism. This eliminates having to manage multiple event types in your SPA. | ||
- Routing: Use the **jQuery plugin** [jquery.urianchor](https://www.npmjs.com/package/jquery.urianchor) for much more robust routing, including support to independent and dependent parameters. | ||
- Touch interface: Use the **jQuery plugin** [jquery.event.ue](https://www.npmjs.com/package/jquery.event.ue) to handle touch and mouse events. | ||
- Data Model: Use the **focused library** [taffyDB](https://github.com/typicaljoe/taffydb/) for superior and more flexible client side data management. | ||
- Templating: Use **focused library** [Dust](http://linkedin.github.io/dustjs/) for much more useful templates that don't tempt you to intermingle display methods with application logic. | ||
This suite of tools has all the capabilities of modern framework libraries but, when used correctly, can vastly improve flexibility and testability. It takes advantage jQuery's excellent built-in tools instead of competing with them. | ||
## Release Notes ## | ||
### Copyright (c) ### | ||
2013-2015 Michael S. Mikowski (mike[dot]mikowski[at]gmail[dotcom]) | ||
### License ### | ||
Dual licensed under the MIT or GPL Version 2 | ||
http://jquery.org/license | ||
### Version 1.1.0-3 ### | ||
These are the first releases registered with jQuery plugins. | ||
### Versions 1.2.1, 1.2.2 ### | ||
Documentation updates, minor bug fixes. | ||
## Methods ## | ||
@@ -137,7 +114,7 @@ | ||
- `delimit_char` : Delimiter between independent args. Default is `&`. | ||
- `delimit_kv_char`: Delimiter between key and value of independent args. Default is `=`. | ||
- `sub_delimit_char` : Delimiter between independent and dependent args. Defaults is `:`. | ||
* `dep_delimit_char` : Delimiter between key-value pairs in dependent args. Default is `|`. | ||
- `dep_kv_delimit_char` : Delimiter between key and value of dependent args. Default is ',' | ||
- `delimit_char` : Delimiters independent args. Default is `&`. | ||
- `delimit_kv_char`: Delimiters key and value of independent args. Default is `=`. | ||
- `sub_delimit_char` : Delimiters independent and dependent args. Defaults is `:`. | ||
- `dep_delimit_char` : Delimiters key-value pairs in dependent args. Default is `|`. | ||
- `dep_kv_delimit_char` : Delimits key and value of dependent args. Default is ',' | ||
@@ -153,3 +130,3 @@ Boolean values ( as part of a key-value pair ) are convert into the stings 'true' or 'false'. | ||
$uriAnchor.configModule({ | ||
$.uriAnchor.configModule({ | ||
schema_map : { | ||
@@ -173,3 +150,2 @@ page : { profile : true, pdf : true }, | ||
### $.uriAnchor.makeAnchorMap | ||
@@ -179,23 +155,23 @@ | ||
Parses URI anchor and returns as map | ||
Parses URI anchor and returns as map | ||
#### Arguments | ||
none | ||
none | ||
#### Environment | ||
Expects the document.location browser object | ||
Expects the document.location browser object | ||
#### Settings | ||
none | ||
none | ||
#### Returns | ||
Map | ||
Map | ||
#### Throws | ||
none | ||
none | ||
@@ -243,2 +219,52 @@ | ||
## Avoid complex 'SPA framework' libraries ## | ||
jQuery used with this and a few other well-chosen tools forms | ||
a fantastic basis for a lean, easy to use SPA architecture | ||
as detailed in [Single page web applications, JavaScript end-to-end][1]. | ||
Here are the recommended tools: | ||
| Capability | Tool | Notes | | ||
| ------------ | ------------------- | ----------------------------------| | ||
| AJAX | jQuery native | Use jQuery AJAX methods. | | ||
| Promises | jQuery native | Use jQuery promise methods. | | ||
| Model Events | [Global Events][2] | jQuery plugin eliminates having | | ||
| | | to manage multiple event types. | | ||
| Touch | [Unified events][3] | Unify desktop and touch events. | | ||
| Routing | [uriAnchor][4] | jQuery plugin for robust routing. | | ||
| | | Includes support for dependent | | ||
| | | and independent query arguments. | | ||
| Data Model | [taffyDB][5] | A powerful and flexible SQL-like | | ||
| | | client data management tool. | | ||
| SVG | [D3][7] | Great for easy graphs and charts | | ||
| | [SVG][8] | Low-level jQuery plugin | | ||
| Templates | [Dust][9] | Uses a powerful template DSL that | | ||
| | | minimizes chances to intemingle | | ||
| | | business and display logic. | | ||
This suite of tools has all the capabilities of a bleeding-edge | ||
SPA "framework" library within the reliable and mature jQuery ecosystem. | ||
It can provide an application that is significantly more flexible and | ||
testable since display logic can easily be decoupled from business logic. | ||
Finally, it leverages jQuery's maturity, performance, and excellent | ||
tools instead of competing with them. | ||
## Release Notes ## | ||
### Copyright (c)### | ||
2013 Michael S. Mikowski (mike[dot]mikowski[at]gmail[dotcom]) | ||
### License ### | ||
Dual licensed under the MIT or GPL Version 2 | ||
http://jquery.org/license | ||
### Version 1.1.0-3 ### | ||
These are the first releases registered with jQuery plugins. | ||
### Version 1.2.1 ### | ||
Updated documentation, fixed minor bug. | ||
### Version 1.3.0 ### | ||
Updated documentation. | ||
## TODO ## | ||
@@ -254,4 +280,13 @@ | ||
Cheers, Mike | ||
## END ## | ||
END | ||
[1]:http://manning.com/mikowski | ||
[2]:https://github.com/mmikowski/jquery.event.gevent | ||
[3]:https://github.com/mmikowski/jquery.event.ue | ||
[4]:https://github.com/mmikowski/urianchor | ||
[5]:https://github.com/typicaljoe/taffydb | ||
[6]:http://linkedin.github.io/dustjs | ||
[7]:https://github.com/mbostock/d3 | ||
[8]:http://keith-wood.name/svg.html | ||
[9]:http://linkedin.github.io/dustjs | ||
27918
286
470