├── .gitignore
├── .ruby-gemset
├── .ruby-version
├── Gemfile
├── Gemfile.lock
├── README.md
├── config.rb
├── rememberState.jquery.json
└── source
├── fonts
├── Archivo.eot
├── Archivo.svg
├── Archivo.ttf
└── Archivo.woff
├── images
└── masks.png
├── index.haml
├── javascripts
├── all.js
├── jquery.js
├── jquery.remember-state.js
├── jquery.remember-state.pack.js
├── qunit.js
└── tests.js
├── layouts
├── layout.haml
└── test.haml
├── stylesheets
├── application.sass
├── mixins.sass
├── qunit.css
└── whitespace-reset.scss
└── test.haml
/.gitignore:
--------------------------------------------------------------------------------
1 | # See http://help.github.com/ignore-files/ for more about ignoring files.
2 | #
3 | # If you find yourself ignoring temporary files generated by your text editor
4 | # or operating system, you probably want to add a global ignore instead:
5 | # git config --global core.excludesfile ~/.gitignore_global
6 |
7 | # Ignore bundler config
8 | /.bundle
9 |
10 | # Ignore the build directory
11 | /build
12 |
13 | # Ignore Sass' cache
14 | /.sass-cache
15 |
--------------------------------------------------------------------------------
/.ruby-gemset:
--------------------------------------------------------------------------------
1 | jquery_remember_state
2 |
--------------------------------------------------------------------------------
/.ruby-version:
--------------------------------------------------------------------------------
1 | 2.0.0
2 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | # If you have OpenSSL installed, we recommend updating
2 | # the following line to use "https"
3 | source 'http://rubygems.org'
4 |
5 | gem "middleman", "~>3.0.14"
--------------------------------------------------------------------------------
/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GEM
2 | remote: http://rubygems.org/
3 | specs:
4 | activesupport (3.2.13)
5 | i18n (= 0.6.1)
6 | multi_json (~> 1.0)
7 | chunky_png (1.2.8)
8 | coffee-script (2.2.0)
9 | coffee-script-source
10 | execjs
11 | coffee-script-source (1.3.3)
12 | compass (0.12.2)
13 | chunky_png (~> 1.2)
14 | fssm (>= 0.2.7)
15 | sass (~> 3.1)
16 | execjs (1.4.0)
17 | multi_json (~> 1.0)
18 | fssm (0.2.10)
19 | haml (4.0.3)
20 | tilt
21 | hike (1.2.3)
22 | http_router (0.10.2)
23 | rack (>= 1.0.0)
24 | url_mount (~> 0.2.1)
25 | i18n (0.6.1)
26 | listen (0.7.3)
27 | maruku (0.6.1)
28 | syntax (>= 1.0.0)
29 | middleman (3.0.14)
30 | middleman-core (= 3.0.14)
31 | middleman-more (= 3.0.14)
32 | middleman-sprockets (~> 3.1.0)
33 | middleman-core (3.0.14)
34 | activesupport (~> 3.2.6)
35 | bundler (~> 1.1)
36 | listen (~> 0.7.3)
37 | rack (~> 1.4.1)
38 | rack-test (~> 0.6.1)
39 | rb-fsevent (~> 0.9.3)
40 | thor (~> 0.15.4)
41 | tilt (~> 1.3.6)
42 | middleman-more (3.0.14)
43 | coffee-script (~> 2.2.0)
44 | coffee-script-source (~> 1.3.3)
45 | compass (>= 0.12.2)
46 | execjs (~> 1.4.0)
47 | haml (>= 3.1.6)
48 | i18n (~> 0.6.0, < 0.6.2)
49 | maruku (~> 0.6.0)
50 | middleman-core (= 3.0.14)
51 | padrino-helpers (= 0.10.7)
52 | sass (>= 3.1.20)
53 | uglifier (~> 1.2.6)
54 | middleman-sprockets (3.1.4)
55 | middleman-core (>= 3.0.14)
56 | middleman-more (>= 3.0.14)
57 | sprockets (~> 2.1)
58 | sprockets-helpers (~> 1.0.0)
59 | sprockets-sass (~> 1.0.0)
60 | multi_json (1.8.0)
61 | padrino-core (0.10.7)
62 | activesupport (~> 3.2.0)
63 | http_router (~> 0.10.2)
64 | sinatra (~> 1.3.1)
65 | thor (~> 0.15.2)
66 | tilt (~> 1.3.0)
67 | padrino-helpers (0.10.7)
68 | i18n (~> 0.6)
69 | padrino-core (= 0.10.7)
70 | rack (1.4.5)
71 | rack-protection (1.5.0)
72 | rack
73 | rack-test (0.6.2)
74 | rack (>= 1.0)
75 | rb-fsevent (0.9.3)
76 | sass (3.2.10)
77 | sinatra (1.3.6)
78 | rack (~> 1.4)
79 | rack-protection (~> 1.3)
80 | tilt (~> 1.3, >= 1.3.3)
81 | sprockets (2.10.0)
82 | hike (~> 1.2)
83 | multi_json (~> 1.0)
84 | rack (~> 1.0)
85 | tilt (~> 1.1, != 1.3.0)
86 | sprockets-helpers (1.0.1)
87 | sprockets (~> 2.0)
88 | sprockets-sass (1.0.1)
89 | sprockets (~> 2.0)
90 | tilt (~> 1.1)
91 | syntax (1.0.0)
92 | thor (0.15.4)
93 | tilt (1.3.7)
94 | uglifier (1.2.7)
95 | execjs (>= 0.3.0)
96 | multi_json (~> 1.3)
97 | url_mount (0.2.1)
98 | rack
99 |
100 | PLATFORMS
101 | ruby
102 |
103 | DEPENDENCIES
104 | middleman (~> 3.0.14)
105 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # jQuery form remember state plugin
2 |
3 | ## Version: 1.4.1
4 |
5 | When called on a form element, localStorage is used to remember the values that have been input up to the point of either saving or unloading. (closing window, navigating away, etc.) If localStorage isn't available, nothing is bound or stored.
6 |
7 | By default, the plugin looks for an element with a class of remember_state within the form to show a note indicating there is stored data that can be repopulated by clicking on the anchor within the remember_state container. If the element doesn't exist, it is created and prepended to the form. You can override the selector and the HTML that is prepended in the options object you pass to the plugin.
8 |
9 | ### Options
10 |
11 | clearOnSubmit: true // Removes localStorage object when form submitted. Default is true
12 | noticeDialog: $("
").html("Restore") // A newly created HTML element to represent the notice box prepended to the form. Must include an anchor for the user to choose to restore state
13 | noticeSelector: ".remember_state" // If your noticeDialog already exists in the form, pass its selector here and clear out the noticeDialog option by setting it to false.
14 | noticeConfirmSelector: "a" // Selector to use relative to the notice dialog to bind the confirm action to.
15 | noticeCancelSelector: "" // Selector to use relative to the notice dialog to bind the cancel action to.
16 | objName: "unique_form_name" // Specify a name for the localStorage object. If none is supplied, the form's ID will be used. If no ID is available, the plugin will fail, issuing a log explaining why.
17 | ignore: null // Supply an array of name attributes for form controls that you'd like to ignore.
18 |
19 | ### Usage
20 |
21 | ```javascript
22 | $("form").rememberState("my_object_name");
23 | ```
24 | To restore the saved form state manually rather than use a notice dialog:
25 |
26 | ```javascript
27 | $("form").rememberState("restoreState");
28 | ```
29 |
30 | If you'd like to save the form's state manually, call the rememberState method on the form after you've initialized it and pass it a string of save, like this:
31 |
32 | ```javascript
33 | $("form").rememberState("save");
34 | ```
35 |
36 | There is also a teardown method for removing the bound events for a particular form. Passing a second argument of true will also destroy the localStorage object for that form.
37 |
38 | ```javascript
39 | $("form").rememberState("destroy", true);
40 | ```
41 |
42 |
43 | ### Notes
44 |
45 | To trigger the deletion of a form's localStorage object from outside the plugin, trigger the reset_state event on the form element by using $("form").trigger("reset_state");
46 |
47 | ### Latest site design by [Daniel Ariza](http://danielariza.com)
48 |
--------------------------------------------------------------------------------
/config.rb:
--------------------------------------------------------------------------------
1 | ###
2 | # Compass
3 | ###
4 |
5 | # Susy grids in Compass
6 | # First: gem install susy
7 | # require 'susy'
8 |
9 | # Change Compass configuration
10 | # compass_config do |config|
11 | # config.output_style = :compact
12 | # end
13 |
14 | ###
15 | # Page options, layouts, aliases and proxies
16 | ###
17 |
18 | # Per-page layout changes:
19 | #
20 | # With no layout
21 | # page "/path/to/file.html", :layout => false
22 | #
23 | # With alternative layout
24 | # page "/path/to/file.html", :layout => :otherlayout
25 | #
26 | # A path which all have the same layout
27 | # with_layout :admin do
28 | # page "/admin/*"
29 | # end
30 |
31 | # Proxy (fake) files
32 | # page "/this-page-has-no-template.html", :proxy => "/template-file.html" do
33 | # @which_fake_page = "Rendering a fake page with a variable"
34 | # end
35 |
36 | ###
37 | # Helpers
38 | ###
39 |
40 | # Automatic image dimensions on image_tag helper
41 | # activate :automatic_image_sizes
42 |
43 | # Methods defined in the helpers block are available in templates
44 | # helpers do
45 | # def some_helper
46 | # "Helping"
47 | # end
48 | # end
49 |
50 | set :css_dir, 'stylesheets'
51 |
52 | set :js_dir, 'javascripts'
53 |
54 | set :images_dir, 'images'
55 |
56 | # Build-specific configuration
57 | configure :build do
58 | # For example, change the Compass output style for deployment
59 | activate :minify_css
60 |
61 | # Minify Javascript on build
62 | # activate :minify_javascript
63 |
64 | # Enable cache buster
65 | # activate :cache_buster
66 |
67 | # Use relative URLs
68 | activate :relative_assets
69 |
70 | # Compress PNGs after build
71 | # First: gem install middleman-smusher
72 | # require "middleman-smusher"
73 | # activate :smusher
74 |
75 | # Or use a different image path
76 | # set :http_path, "/Content/images/"
77 | end
78 |
--------------------------------------------------------------------------------
/rememberState.jquery.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "rememberState",
3 | "title": "rememberState",
4 | "description": "Remember and restore form state using localStorage",
5 | "keywords": ["form", "localStorage"],
6 | "version": "1.4.1",
7 | "author": {
8 | "name": "shaneriley",
9 | "email": "shane@shaneriley.com",
10 | "url": "http://shaneriley.com"
11 | },
12 | "maintainers": [{
13 | "name": "shaneriley",
14 | "email":"shane@shaneriley.com",
15 | "url": "http://shaneriley.com"
16 | }],
17 | "licenses": [{
18 | "type": "MIT",
19 | "url": "http://opensource.org/licenses/MIT"
20 | }],
21 | "bugs": "https://github.com/shaneriley/jquery_remember_state/issues",
22 | "homepage": "http:/shaneriley.com/jquery/remember_state",
23 | "docs": "https://github.com/shaneriley/jquery_remember_state",
24 | "dependencies": {
25 | "jquery": ">=1.5"
26 | }
27 | }
28 |
29 |
--------------------------------------------------------------------------------
/source/fonts/Archivo.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shaneriley/jquery_remember_state/430b525367c27016876af5be2a9c0a7066106ef9/source/fonts/Archivo.eot
--------------------------------------------------------------------------------
/source/fonts/Archivo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/source/fonts/Archivo.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shaneriley/jquery_remember_state/430b525367c27016876af5be2a9c0a7066106ef9/source/fonts/Archivo.ttf
--------------------------------------------------------------------------------
/source/fonts/Archivo.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shaneriley/jquery_remember_state/430b525367c27016876af5be2a9c0a7066106ef9/source/fonts/Archivo.woff
--------------------------------------------------------------------------------
/source/images/masks.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shaneriley/jquery_remember_state/430b525367c27016876af5be2a9c0a7066106ef9/source/images/masks.png
--------------------------------------------------------------------------------
/source/index.haml:
--------------------------------------------------------------------------------
1 | - content_for :head do
2 | :javascript
3 | $(function() {
4 | $("form").rememberState({
5 | objName: "personal_info",
6 | ignore: ["bio"],
7 | noticeDialog: $("form div"),
8 | noticeConfirmSelector: "a:first",
9 | noticeCancelSelector: "a:last"
10 | }).submit(false);
11 | });
12 |
13 | %main
14 | %section
15 | %header
16 | %h1 jQuery rememberState
17 | %h2 Remember and restore form state using localStorage
18 | %p
19 | by
20 | = link_to "Shane Riley", "http://shaneriley.com", rel: "author"
21 |
22 | %aside
23 | %p Version: 1.4.1
24 | %h2 Source
25 | %ul
26 | %li= link_to "jquery.remember-state.js", "https://raw.github.com/shaneriley/jquery_remember_state/master/source/javascripts/jquery.remember-state.js"
27 | %li= link_to "jquery.remember-state.pack.js", "https://raw.github.com/shaneriley/jquery_remember_state/master/source/javascripts/jquery.remember-state.pack.js"
28 | = link_to "View the source on GitHub", "http://github.com/shaneriley/jquery_remember_state"
29 |
30 | %article
31 | %p When called on a form element, localStorage is used to remember the values that have been input up to the point of either saving or unloading. (closing window, navigating away, etc.) If localStorage isn't available, nothing is bound or stored.
32 | %p By default, the plugin looks for an element with a class of remember_state within the form to show a note indicating there is stored data that can be repopulated by clicking on the anchor within the remember_state container. If the element doesn't exist, it is created and prepended to the form. You can override the selector and the HTML that is prepended in the options object you pass to the plugin.
33 |
34 | %h3 Options
35 | %code
36 | %mark // Removes localStorage object when form submitted.
37 | clearOnSubmit: true
38 | %mark // A newly created HTML element to represent the notice box prepended to the form. Must include an anchor for the user to choose to restore state
39 | &= "noticeDialog: $(\"\").html(\"Restore\")"
40 | %mark // If your noticeDialog already exists in the form, pass its selector here and clear out the noticeDialog option by setting it to false.
41 | noticeSelector: ".remember_state"
42 | %mark // Selector to use relative to the notice dialog to bind the confirm action to.
43 | noticeConfirmSelector: "a"
44 | %mark // Selector to use relative to the notice dialog to bind the cancel action to.
45 | noticeCancelSelector: ""
46 | %mark // Specify a name for the localStorage object. If none is supplied, the form's ID will be used. If no ID is available, the plugin will fail, issuing a log explaining why.
47 | objName: "unique_form_name"
48 | %mark // Supply an array of name attributes for form controls that you'd like to ignore.
49 | ignore: null
50 |
51 | %h3 Usage
52 | %code $("form").rememberState("my_object_name");
53 |
54 | %p To restore the saved form state manually rather than use a notice dialog:
55 | %code $("form").rememberState("restoreState");
56 | %p If you'd like to save the form's state manually, call the rememberState method on the form after you've initialized it and pass it a string of save, like this:
57 | %code $("form").rememberState("save");
58 | %p There is also a teardown method for removing the bound events for a particular form. Passing a second argument of true will also destroy the localStorage object for that form.
59 | %code $("form").rememberState("destroy", true);
60 |
61 | %h3 Notes
62 | %p To trigger the deletion of a form's localStorage object from outside the plugin, trigger the reset_state event on the form element by using $("form").trigger("reset_state");
63 |
64 | %h3
65 | Latest site design by
66 | = link_to "Daniel Ariza", "http://danielariza.com"
67 |
68 | %section
69 | %form(action="" method="post")
70 | %div
71 | %p Would you like to restore your previously entered info?
72 | = link_to "Yes", "#"
73 | = link_to "No", "#"
74 | %h1 Example
75 | %p Fill in some of the fields and refresh the page to see rememberState in action
76 | %fieldset
77 | %dl
78 | %dt
79 | %label(for="first_name") First Name
80 | %dd
81 | %input#first_name(type="text" name="first_name")
82 | %dl
83 | %dt
84 | %label(for="last_name") Last Name
85 | %dd
86 | %input#last_name(type="text" name="last_name")
87 | %dl
88 | %dt
89 | %label(for="gender_female") Gender
90 | %dd
91 | %ul
92 | %li
93 | %label
94 | %input#gender_female(type="radio" name="gender" value="Female")
95 | Female
96 | %li
97 | %label
98 | %input#gender_male(type="radio" name="gender" value="Male")
99 | Male
100 | %dl
101 | %dt
102 | %label(for="marital_status") Marital Status
103 | %dd
104 | %select#marital_status(name="marital_status")
105 | %option(selected value="Single") Single
106 | %option(value="Married") Married
107 | %option(value="Divorced") Divorced
108 | %option(value="Separated") Separated
109 | %dl
110 | %dt
111 | %label(for="bio") Bio
112 | %dd
113 | %textarea#bio(name="bio" rows="8" cols="40")
114 | %dl
115 | %dt
116 | %label(for="interests_video_games") Interests
117 | %dd
118 | %ul
119 | %li
120 | %label
121 | %input#interests_video_games(type="checkbox" name="video_games" value="Video games")
122 | Video games
123 | %li
124 | %label
125 | %input#interests_beach_walks(type="checkbox" name="beach_walks" value="Long walks on the beach")
126 | Long walks on the beach
127 | %li
128 | %label
129 | %input#interests_dendrophilia(type="checkbox" name="dendrophilia" value="Dendrophilia")
130 | Dendrophilia
131 | %dl
132 | %dt
133 | %label(for="relationship_type") Looking for
134 | %dd
135 | %select#relationship_type(name="relationship_type" multiple)
136 | %optgroup(label="Man")
137 | %option(value="m_w") seeking women
138 | %option(value="m_m") seeking men
139 | %optgroup(label="Woman")
140 | %option(value="w_m") seeking men
141 | %option(value="w_w") seeking women
142 | %input(type="submit" value="Save")
143 | %input(type="reset" value="Delete")
144 |
--------------------------------------------------------------------------------
/source/javascripts/all.js:
--------------------------------------------------------------------------------
1 | //= require_tree .
--------------------------------------------------------------------------------
/source/javascripts/jquery.js:
--------------------------------------------------------------------------------
1 | /*! jQuery v1.9.1 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license
2 | //@ sourceMappingURL=jquery.min.map
3 | */(function(e,t){var n,r,i=typeof t,o=e.document,a=e.location,s=e.jQuery,u=e.$,l={},c=[],p="1.9.1",f=c.concat,d=c.push,h=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,b=function(e,t){return new b.fn.init(e,t,r)},x=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^[\],:{}\s]*$/,E=/(?:^|:|,)(?:\s*\[)+/g,S=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,j=/^-ms-/,D=/-([\da-z])/gi,L=function(e,t){return t.toUpperCase()},H=function(e){(o.addEventListener||"load"===e.type||"complete"===o.readyState)&&(q(),b.ready())},q=function(){o.addEventListener?(o.removeEventListener("DOMContentLoaded",H,!1),e.removeEventListener("load",H,!1)):(o.detachEvent("onreadystatechange",H),e.detachEvent("onload",H))};b.fn=b.prototype={jquery:p,constructor:b,init:function(e,n,r){var i,a;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof b?n[0]:n,b.merge(this,b.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:o,!0)),C.test(i[1])&&b.isPlainObject(n))for(i in n)b.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(a=o.getElementById(i[2]),a&&a.parentNode){if(a.id!==i[2])return r.find(e);this.length=1,this[0]=a}return this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):b.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),b.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return h.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return b.each(this,e,t)},ready:function(e){return b.ready.promise().done(e),this},slice:function(){return this.pushStack(h.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(b.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:d,sort:[].sort,splice:[].splice},b.fn.init.prototype=b.fn,b.extend=b.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||b.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(o=arguments[u]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(b.isPlainObject(r)||(n=b.isArray(r)))?(n?(n=!1,a=e&&b.isArray(e)?e:[]):a=e&&b.isPlainObject(e)?e:{},s[i]=b.extend(c,a,r)):r!==t&&(s[i]=r));return s},b.extend({noConflict:function(t){return e.$===b&&(e.$=u),t&&e.jQuery===b&&(e.jQuery=s),b},isReady:!1,readyWait:1,holdReady:function(e){e?b.readyWait++:b.ready(!0)},ready:function(e){if(e===!0?!--b.readyWait:!b.isReady){if(!o.body)return setTimeout(b.ready);b.isReady=!0,e!==!0&&--b.readyWait>0||(n.resolveWith(o,[b]),b.fn.trigger&&b(o).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===b.type(e)},isArray:Array.isArray||function(e){return"array"===b.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==b.type(e)||e.nodeType||b.isWindow(e))return!1;try{if(e.constructor&&!y.call(e,"constructor")&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||y.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=b.buildFragment([e],t,i),i&&b(i).remove(),b.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=b.trim(n),n&&k.test(n.replace(S,"@").replace(A,"]").replace(E,"")))?Function("return "+n)():(b.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||b.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&b.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(j,"ms-").replace(D,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:v&&!v.call("\ufeff\u00a0")?function(e){return null==e?"":v.call(e)}:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?b.merge(n,"string"==typeof e?[e]:e):d.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(g)return g.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return f.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),b.isFunction(e)?(r=h.call(arguments,2),i=function(){return e.apply(n||this,r.concat(h.call(arguments)))},i.guid=e.guid=e.guid||b.guid++,i):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===b.type(r)){o=!0;for(u in r)b.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,b.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(b(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),b.ready.promise=function(t){if(!n)if(n=b.Deferred(),"complete"===o.readyState)setTimeout(b.ready);else if(o.addEventListener)o.addEventListener("DOMContentLoaded",H,!1),e.addEventListener("load",H,!1);else{o.attachEvent("onreadystatechange",H),e.attachEvent("onload",H);var r=!1;try{r=null==e.frameElement&&o.documentElement}catch(i){}r&&r.doScroll&&function a(){if(!b.isReady){try{r.doScroll("left")}catch(e){return setTimeout(a,50)}q(),b.ready()}}()}return n.promise(t)},b.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=b.type(e);return b.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=b(o);var _={};function F(e){var t=_[e]={};return b.each(e.match(w)||[],function(e,n){t[n]=!0}),t}b.Callbacks=function(e){e="string"==typeof e?_[e]||F(e):b.extend({},e);var n,r,i,o,a,s,u=[],l=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=u.length,n=!0;u&&o>a;a++)if(u[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,u&&(l?l.length&&c(l.shift()):r?u=[]:p.disable())},p={add:function(){if(u){var t=u.length;(function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=u.length:r&&(s=t,c(r))}return this},remove:function(){return u&&b.each(arguments,function(e,t){var r;while((r=b.inArray(t,u,r))>-1)u.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?b.inArray(e,u)>-1:!(!u||!u.length)},empty:function(){return u=[],this},disable:function(){return u=l=r=t,this},disabled:function(){return!u},lock:function(){return l=t,r||p.disable(),this},locked:function(){return!l},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!u||i&&!l||(n?l.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},b.extend({Deferred:function(e){var t=[["resolve","done",b.Callbacks("once memory"),"resolved"],["reject","fail",b.Callbacks("once memory"),"rejected"],["notify","progress",b.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return b.Deferred(function(n){b.each(t,function(t,o){var a=o[0],s=b.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&b.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?b.extend(e,r):r}},i={};return r.pipe=r.then,b.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=h.call(arguments),r=n.length,i=1!==r||e&&b.isFunction(e.promise)?r:0,o=1===i?e:b.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?h.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,u,l;if(r>1)for(s=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&b.isFunction(n[t].promise)?n[t].promise().done(a(t,l,n)).fail(o.reject).progress(a(t,u,s)):--i;return i||o.resolveWith(l,n),o.promise()}}),b.support=function(){var t,n,r,a,s,u,l,c,p,f,d=o.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="
a",n=d.getElementsByTagName("*"),r=d.getElementsByTagName("a")[0],!n||!r||!n.length)return{};s=o.createElement("select"),l=s.appendChild(o.createElement("option")),a=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={getSetAttribute:"t"!==d.className,leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:"/a"===r.getAttribute("href"),opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:!!a.value,optSelected:l.selected,enctype:!!o.createElement("form").enctype,html5Clone:"<:nav>"!==o.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===o.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!l.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}a=o.createElement("input"),a.setAttribute("value",""),t.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),t.radioValue="t"===a.value,a.setAttribute("checked","t"),a.setAttribute("name","t"),u=o.createDocumentFragment(),u.appendChild(a),t.appendChecked=a.checked,t.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;return d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip,b(function(){var n,r,a,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",u=o.getElementsByTagName("body")[0];u&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",u.appendChild(n).appendChild(d),d.innerHTML="