diff --git a/.gitignore b/.gitignore
index 9daa824..0bc7c71 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
.DS_Store
node_modules
+bower_components
diff --git a/.travis.yml b/.travis.yml
index baa0031..20fd86b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,3 +1,3 @@
language: node_js
node_js:
- - 0.8
+ - 0.10
diff --git a/Gruntfile.js b/Gruntfile.js
index 4dae092..5ccdd80 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -2,8 +2,8 @@ module.exports = function(grunt) {
grunt.initConfig({
- // Meta informations
- pkg: grunt.file.readJSON('package.json'),
+ pkg: grunt.file.readJSON('bower.json'),
+
meta: {
banner: '/*\n' +
' * <%= pkg.title || pkg.name %> - v<%= pkg.version %>\n' +
@@ -14,6 +14,21 @@ module.exports = function(grunt) {
' * MIT License\n' +
' */\n'
},
+
+ bump: {
+ options: {
+ files: ['bower.json', 'github.jquery.json'],
+ commit: true,
+ commitMessage: 'Release v%VERSION%',
+ commitFiles: ['bower.json', 'github.jquery.json', 'dist'],
+ createTag: true,
+ tagName: '%VERSION%',
+ tagMessage: '',
+ push: true,
+ pushTo: 'origin'
+ }
+ },
+
concat: {
options: {
banner: '<%= meta.banner %>'
@@ -27,7 +42,7 @@ module.exports = function(grunt) {
lintspaces: {
all: {
src: [
- '*', 'src/*', 'spec/*', 'demo/*', 'assets/base.css'
+ '*', 'src/*', 'spec/*', 'demo/*', 'assets/base.css', '!package.json'
],
options: {
newline: true,
@@ -64,8 +79,6 @@ module.exports = function(grunt) {
}
},
- // Run JSHint, concat, minify and send it to the dist folder
- // any time a file is added, changed or deleted
watch: {
files: ['**/*'],
tasks: ['jshint', 'concat', 'uglify'],
@@ -73,6 +86,7 @@ module.exports = function(grunt) {
});
+ grunt.loadNpmTasks('grunt-bump');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-jshint');
@@ -81,6 +95,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-lintspaces');
grunt.registerTask('default', ['lintspaces', 'jshint', 'concat', 'uglify']);
+ grunt.registerTask('release', ['bump-only:patch', 'default', 'bump-commit']);
grunt.registerTask('test', ['lintspaces', 'jshint', 'jasmine']);
};
diff --git a/README.md b/README.md
index 4439817..2cb5712 100644
--- a/README.md
+++ b/README.md
@@ -1,19 +1,51 @@
-# jQuery Github [](https://travis-ci.org/zenorocha/jquery-github)
+# jQuery Github
-[](http://zenorocha.github.com/jquery-github/)
+[](http://bower.io/search/?q=jquery-github)
+[](https://travis-ci.org/zenorocha/jquery-github)
+[](https://david-dm.org/zenorocha/jquery-github#info=devDependencies)
+
+[](http://zenorocha.github.io/jquery-github/)
+
+> A jQuery plugin to display your Github Repositories.
+
+## Browser Support
+
+We do care about it.
+
+ |  |  |  | 
+--- | --- | --- | --- | --- |
+IE 8+ ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ |
+
+## Getting started
+
+Three quick start options are available:
+
+* [Download latest release](https://github.com/zenorocha/jquery-github/releases)
+* Clone the repo: `git@github.com:zenorocha/jquery-github.git`
+* Install with [Bower](http://bower.io): `bower install jquery-github`
+
+## Setup
+
+Use [Bower](http://bower.io) to fetch all dependencies:
+
+```sh
+$ bower install
+```
+
+Now you're ready to go!
## Usage
Create an attribute called `data-repo`:
```html
-
+
```
Include jQuery:
```html
-
+
```
Include plugin's CSS and JS:
@@ -45,23 +77,11 @@ $("[data-repo]").github({
});
```
-#### iconStars
-
-*Type: `Boolean` Default: `true`*
-
-Display the number of stars in a repository.
-
-#### iconForks
-
-*Type: `Boolean` Default: `true`*
-
-Display the number of forks in a repository.
-
-#### iconIssues
-
-*Type: `Boolean` Default: `false`*
-
-Display the number of issues in a repository.
+Attribute | Type | Default | Description
+--- | --- | --- | ---
+`iconStars` | *Boolean* | `true` | Displays the number of stars in a repository.
+`iconForks` | *Boolean* | `true` | Displays the number of forks in a repository.
+`iconIssues` | *Boolean* | `false` | Displays the number of issues in a repository.
## Structure
@@ -76,7 +96,6 @@ The basic structure of the project is given in the following way:
|-- dist/
| |-- jquery.boilerplate.js
| |-- jquery.boilerplate.min.js
-|-- lib/
|-- src/
| |-- jquery.boilerplate.coffee
| |-- jquery.boilerplate.js
@@ -93,6 +112,10 @@ The basic structure of the project is given in the following way:
Contains CSS and Font files to create that lovely Github box.
+#### bower_components/
+
+Contains all dependencies like jQuery and Zepto.
+
#### [demo/](https://github.com/zenorocha/jquery-github/tree/master/demo)
Contains a simple HTML file to demonstrate the plugin.
@@ -101,10 +124,6 @@ Contains a simple HTML file to demonstrate the plugin.
This is where the generated files are stored once Grunt runs JSHint and other stuff.
-#### [lib/](https://github.com/zenorocha/jquery-github/tree/master/lib)
-
-Contains libraries like jQuery and Zepto.
-
#### [src/](https://github.com/zenorocha/jquery-github/tree/master/src)
Contains the files responsible for the plugin.
@@ -170,13 +189,17 @@ No problem, [@ricardobeat](https://github.com/ricardobeat) already did one. Chec
No problem, [@igorlima](https://github.com/igorlima) already did that. Check [demo/index-zepto.html](https://github.com/zenorocha/jquery-github/tree/master/demo/index-zepto.html).
+**Prefer AngularJS instead of jQuery?**
+
+No problem, [@lucasconstantino](https://github.com/lucasconstantino) already did that. Check [his fork](https://github.com/lucasconstantino/angular-github-repo)!
+
## Contributing
Check [CONTRIBUTING.md](https://github.com/zenorocha/jquery-github/blob/master/CONTRIBUTING.md).
## History
-Check [Release](https://github.com/zenorocha/jquery-github/releases) list.
+Check [Releases](https://github.com/zenorocha/jquery-github/releases) for detailed changelog.
## Credits
diff --git a/bower.json b/bower.json
new file mode 100644
index 0000000..f804d76
--- /dev/null
+++ b/bower.json
@@ -0,0 +1,19 @@
+{
+ "name": "jquery-github",
+ "version": "0.4.0",
+ "homepage": "https://github.com/zenorocha/jquery-github",
+ "authors": [
+ "Zeno Rocha "
+ ],
+ "description": "A jQuery plugin to display your Github Repositories.",
+ "main": "src/jquery.github.js",
+ "keywords": [
+ "jquery",
+ "github"
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "jquery": "^2.1.1",
+ "zepto": "^1.1.4"
+ }
+}
diff --git a/demo/index-zepto.html b/demo/index-zepto.html
index 8e9833c..db9f5cd 100644
--- a/demo/index-zepto.html
+++ b/demo/index-zepto.html
@@ -24,8 +24,8 @@ jQuery Github
@@ -34,8 +34,7 @@ jQuery Github
-
-
+
+
diff --git a/dist/jquery.github.js b/dist/jquery.github.js
index 220967d..27e6de9 100644
--- a/dist/jquery.github.js
+++ b/dist/jquery.github.js
@@ -1,180 +1,152 @@
/*
- * jQuery Github - v0.3.2
+ * jquery-github - v0.4.0
* A jQuery plugin to display your Github Repositories.
- * https://github.com/zenorocha/jquery-github/
+ * https://github.com/zenorocha/jquery-github
*
- * Copyright (c) 2013
+ * Copyright (c) 2014
* MIT License
*/
// -- Github Repository --------------------------------------------------------
function GithubRepo( repo ) {
this.description = repo.description;
- this.forks = repo.forks;
+ this.forks = repo.forks_count;
this.name = repo.name;
this.open_issues = repo.open_issues;
this.pushed_at = repo.pushed_at;
this.url = repo.url;
- this.watchers = repo.watchers;
+ this.stargazers = repo.stargazers_count;
}
// Parses HTML template
GithubRepo.prototype.toHTML = function () {
- var self = this;
-
- self.pushed_at = self._parsePushedDate( self.pushed_at ),
- self.url = self._parseURL( self.url );
+ this.pushed_at = this._parsePushedDate( this.pushed_at ),
+ this.url = this._parseURL( this.url );
return $(
"" +
"" +
"
" +
- "
" + self.description + " — Read More
" +
+ "
" + this.description + " — Read More
" +
"
" +
"
" +
- "
Latest commit to master on " + self.pushed_at + "
" +
- "
" +
+ "
Latest commit to master on " + this.pushed_at + "
" +
+ "
" +
"
" +
"
");
};
// Parses pushed_at with date format
GithubRepo.prototype._parsePushedDate = function ( pushed_at ) {
- var self = this,
- date = new Date( pushed_at );
+ var date = new Date( pushed_at );
return date.getDate() + "/" + ( date.getMonth() + 1 ) + "/" + date.getFullYear();
};
// Parses URL to be friendly
GithubRepo.prototype._parseURL = function ( url ) {
- var self = this;
-
return url.replace( "api.", "" ).replace( "repos/", "" );
};
// -- Github Plugin ------------------------------------------------------------
function Github( element, options ) {
- var self = this,
- defaults = {
+ var defaults = {
iconStars: true,
iconForks: true,
iconIssues: false
};
- self.element = element;
- self.$container = $( element );
- self.repo = self.$container.attr( "data-repo" );
+ this.element = element;
+ this.$container = $( element );
+ this.repo = this.$container.attr( "data-repo" );
- self.options = $.extend( {}, defaults, options ) ;
+ this.options = $.extend( {}, defaults, options ) ;
- self._defaults = defaults;
+ this._defaults = defaults;
- self.init();
- self.displayIcons();
+ this.init();
+ this.displayIcons();
}
// Initializer
Github.prototype.init = function () {
- var self = this,
- cached = self.getCache();
+ var cached = this.getCache();
if ( cached !== null ) {
- self.applyTemplate( JSON.parse( cached ) );
- }
- else {
- self.requestData( self.repo );
+ this.applyTemplate( JSON.parse( cached ) );
+ return;
}
+
+ this.requestData( this.repo );
};
// Display or hide icons
Github.prototype.displayIcons = function () {
- $iconStars = $( ".repo-stars" );
- $iconForks = $( ".repo-forks" );
- $iconIssues = $( ".repo-issues" );
-
- if ( this.options.iconStars ) {
- $iconStars.css( "display", "inline-block" );
- } else {
- $iconStars.css( "display", "none" );
- }
-
- if ( this.options.iconForks ) {
- $iconForks.css( "display", "inline-block" );
- } else {
- $iconForks.css( "display", "none" );
- }
-
- if ( this.options.iconIssues ) {
- $iconIssues.css( "display", "inline-block" );
- } else {
- $iconIssues.css( "display", "none" );
- }
+ var options = this.options,
+ $iconStars = $( ".repo-stars" ),
+ $iconForks = $( ".repo-forks" ),
+ $iconIssues = $( ".repo-issues" );
+
+ $iconStars.css( "display", options.iconStars ? "inline-block" : "none" );
+ $iconForks.css( "display", options.iconForks ? "inline-block" : "none" );
+ $iconIssues.css( "display", options.iconIssues ? "inline-block" : "none" );
};
// Request repositories from Github
Github.prototype.requestData = function ( repo ) {
- var self = this;
+ var that = this;
$.ajax({
url: "https://api.github.com/repos/" + repo,
dataType: "jsonp",
success: function( results ) {
- var result_data = results.data;
+ var result_data = results.data,
+ isFailling = results.meta.status >= 400 && result_data.message;
- // Handle API failures
- if ( results.meta.status >= 400 && result_data.message ) {
- self.handleErrorRequest( result_data );
- }
- else {
- self.handleSuccessfulRequest( result_data );
+ if ( isFailling ) {
+ that.handleErrorRequest( result_data );
+ return;
}
+
+ that.handleSuccessfulRequest( result_data );
}
});
};
// Handle Errors requests
Github.prototype.handleErrorRequest = function ( result_data ) {
- var self = this;
-
console.warn( result_data.message );
return;
};
// Handle Successful request
Github.prototype.handleSuccessfulRequest = function ( result_data ) {
- var self = this;
-
- self.applyTemplate( result_data );
- self.setCache( result_data );
+ this.applyTemplate( result_data );
+ this.setCache( result_data );
};
// Stores repostories in sessionStorage if available
Github.prototype.setCache = function ( result_data ) {
- var self = this;
-
// Cache data
if ( window.sessionStorage ) {
- window.sessionStorage.setItem( "gh-repos:" + self.repo, JSON.stringify( result_data ) );
+ window.sessionStorage.setItem( "gh-repos:" + this.repo, JSON.stringify( result_data ) );
}
};
// Grab cached results
Github.prototype.getCache = function() {
- var self = this;
-
if ( window.sessionStorage ) {
- return window.sessionStorage.getItem( "gh-repos:" + self.repo );
+ return window.sessionStorage.getItem( "gh-repos:" + this.repo );
}
else {
return false;
@@ -183,11 +155,10 @@ Github.prototype.getCache = function() {
// Apply results to HTML template
Github.prototype.applyTemplate = function ( repo ) {
- var self = this,
- githubRepo = new GithubRepo( repo ),
- $widget = githubRepo.toHTML();
+ var githubRepo = new GithubRepo( repo ),
+ $widget = githubRepo.toHTML();
- $widget.appendTo( self.$container );
+ $widget.appendTo( this.$container );
};
// -- Attach plugin to jQuery's prototype --------------------------------------
diff --git a/dist/jquery.github.min.js b/dist/jquery.github.min.js
index 87920e9..4d06fc4 100644
--- a/dist/jquery.github.min.js
+++ b/dist/jquery.github.min.js
@@ -1,9 +1,9 @@
/*
- * jQuery Github - v0.3.2
+ * jquery-github - v0.4.0
* A jQuery plugin to display your Github Repositories.
- * https://github.com/zenorocha/jquery-github/
+ * https://github.com/zenorocha/jquery-github
*
- * Copyright (c) 2013
+ * Copyright (c) 2014
* MIT License
*/
-function GithubRepo(s){this.description=s.description,this.forks=s.forks,this.name=s.name,this.open_issues=s.open_issues,this.pushed_at=s.pushed_at,this.url=s.url,this.watchers=s.watchers}function Github(s,t){var e=this,o={iconStars:!0,iconForks:!0,iconIssues:!1};e.element=s,e.$container=$(s),e.repo=e.$container.attr("data-repo"),e.options=$.extend({},o,t),e._defaults=o,e.init(),e.displayIcons()}GithubRepo.prototype.toHTML=function(){var s=this;return s.pushed_at=s._parsePushedDate(s.pushed_at),s.url=s._parseURL(s.url),$(""+"
"+"
"+s.description+" — Read More
"+"
"+"
"+"
Latest commit to master on "+s.pushed_at+"
"+"
"+"
"+"
")},GithubRepo.prototype._parsePushedDate=function(s){var t=new Date(s);return t.getDate()+"/"+(t.getMonth()+1)+"/"+t.getFullYear()},GithubRepo.prototype._parseURL=function(s){return s.replace("api.","").replace("repos/","")},Github.prototype.init=function(){var s=this,t=s.getCache();null!==t?s.applyTemplate(JSON.parse(t)):s.requestData(s.repo)},Github.prototype.displayIcons=function(){$iconStars=$(".repo-stars"),$iconForks=$(".repo-forks"),$iconIssues=$(".repo-issues"),this.options.iconStars?$iconStars.css("display","inline-block"):$iconStars.css("display","none"),this.options.iconForks?$iconForks.css("display","inline-block"):$iconForks.css("display","none"),this.options.iconIssues?$iconIssues.css("display","inline-block"):$iconIssues.css("display","none")},Github.prototype.requestData=function(s){var t=this;$.ajax({url:"https://api.github.com/repos/"+s,dataType:"jsonp",success:function(s){var e=s.data;s.meta.status>=400&&e.message?t.handleErrorRequest(e):t.handleSuccessfulRequest(e)}})},Github.prototype.handleErrorRequest=function(s){console.warn(s.message)},Github.prototype.handleSuccessfulRequest=function(s){var t=this;t.applyTemplate(s),t.setCache(s)},Github.prototype.setCache=function(s){var t=this;window.sessionStorage&&window.sessionStorage.setItem("gh-repos:"+t.repo,JSON.stringify(s))},Github.prototype.getCache=function(){var s=this;return window.sessionStorage?window.sessionStorage.getItem("gh-repos:"+s.repo):!1},Github.prototype.applyTemplate=function(s){var t=this,e=new GithubRepo(s),o=e.toHTML();o.appendTo(t.$container)},function(s){s.fn.github=function(t){return this.each(function(){s(this).data("plugin_github")||s(this).data("plugin_github",new Github(this,t))})}}(window.jQuery||window.Zepto,window);
\ No newline at end of file
+function GithubRepo(a){this.description=a.description,this.forks=a.forks_count,this.name=a.name,this.open_issues=a.open_issues,this.pushed_at=a.pushed_at,this.url=a.url,this.stargazers=a.stargazers_count}function Github(a,b){var c={iconStars:!0,iconForks:!0,iconIssues:!1};this.element=a,this.$container=$(a),this.repo=this.$container.attr("data-repo"),this.options=$.extend({},c,b),this._defaults=c,this.init(),this.displayIcons()}GithubRepo.prototype.toHTML=function(){return this.pushed_at=this._parsePushedDate(this.pushed_at),this.url=this._parseURL(this.url),$(""+this.description+" — Read More
Latest commit to master on "+this.pushed_at+"
")},GithubRepo.prototype._parsePushedDate=function(a){var b=new Date(a);return b.getDate()+"/"+(b.getMonth()+1)+"/"+b.getFullYear()},GithubRepo.prototype._parseURL=function(a){return a.replace("api.","").replace("repos/","")},Github.prototype.init=function(){var a=this.getCache();return null!==a?void this.applyTemplate(JSON.parse(a)):void this.requestData(this.repo)},Github.prototype.displayIcons=function(){var a=this.options,b=$(".repo-stars"),c=$(".repo-forks"),d=$(".repo-issues");b.css("display",a.iconStars?"inline-block":"none"),c.css("display",a.iconForks?"inline-block":"none"),d.css("display",a.iconIssues?"inline-block":"none")},Github.prototype.requestData=function(a){var b=this;$.ajax({url:"https://api.github.com/repos/"+a,dataType:"jsonp",success:function(a){var c=a.data,d=a.meta.status>=400&&c.message;return d?void b.handleErrorRequest(c):void b.handleSuccessfulRequest(c)}})},Github.prototype.handleErrorRequest=function(a){console.warn(a.message)},Github.prototype.handleSuccessfulRequest=function(a){this.applyTemplate(a),this.setCache(a)},Github.prototype.setCache=function(a){window.sessionStorage&&window.sessionStorage.setItem("gh-repos:"+this.repo,JSON.stringify(a))},Github.prototype.getCache=function(){return window.sessionStorage?window.sessionStorage.getItem("gh-repos:"+this.repo):!1},Github.prototype.applyTemplate=function(a){var b=new GithubRepo(a),c=b.toHTML();c.appendTo(this.$container)},function(a){a.fn.github=function(b){return this.each(function(){a(this).data("plugin_github")||a(this).data("plugin_github",new Github(this,b))})}}(window.jQuery||window.Zepto,window);
\ No newline at end of file
diff --git a/github.jquery.json b/github.jquery.json
index 4ab80ff..4e3a30c 100644
--- a/github.jquery.json
+++ b/github.jquery.json
@@ -7,7 +7,7 @@
"repositories",
"git"
],
- "version": "0.3.2",
+ "version": "0.4.0",
"author": {
"name": "Zeno Rocha",
"url": "https://github.com/zenorocha"
diff --git a/lib/jquery.min.js b/lib/jquery.min.js
deleted file mode 100644
index 50d1b22..0000000
--- a/lib/jquery.min.js
+++ /dev/null
@@ -1,4 +0,0 @@
-/*! jQuery v1.9.0 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license */(function(e,t){"use strict";function n(e){var t=e.length,n=st.type(e);return st.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}function r(e){var t=Tt[e]={};return st.each(e.match(lt)||[],function(e,n){t[n]=!0}),t}function i(e,n,r,i){if(st.acceptData(e)){var o,a,s=st.expando,u="string"==typeof n,l=e.nodeType,c=l?st.cache:e,f=l?e[s]:e[s]&&s;if(f&&c[f]&&(i||c[f].data)||!u||r!==t)return f||(l?e[s]=f=K.pop()||st.guid++:f=s),c[f]||(c[f]={},l||(c[f].toJSON=st.noop)),("object"==typeof n||"function"==typeof n)&&(i?c[f]=st.extend(c[f],n):c[f].data=st.extend(c[f].data,n)),o=c[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[st.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[st.camelCase(n)])):a=o,a}}function o(e,t,n){if(st.acceptData(e)){var r,i,o,a=e.nodeType,u=a?st.cache:e,l=a?e[st.expando]:st.expando;if(u[l]){if(t&&(r=n?u[l]:u[l].data)){st.isArray(t)?t=t.concat(st.map(t,st.camelCase)):t in r?t=[t]:(t=st.camelCase(t),t=t in r?[t]:t.split(" "));for(i=0,o=t.length;o>i;i++)delete r[t[i]];if(!(n?s:st.isEmptyObject)(r))return}(n||(delete u[l].data,s(u[l])))&&(a?st.cleanData([e],!0):st.support.deleteExpando||u!=u.window?delete u[l]:u[l]=null)}}}function a(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(Nt,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:wt.test(r)?st.parseJSON(r):r}catch(o){}st.data(e,n,r)}else r=t}return r}function s(e){var t;for(t in e)if(("data"!==t||!st.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function u(){return!0}function l(){return!1}function c(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function f(e,t,n){if(t=t||0,st.isFunction(t))return st.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return st.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=st.grep(e,function(e){return 1===e.nodeType});if(Wt.test(t))return st.filter(t,r,!n);t=st.filter(t,r)}return st.grep(e,function(e){return st.inArray(e,t)>=0===n})}function p(e){var t=zt.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function d(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function h(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function g(e){var t=nn.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function m(e,t){for(var n,r=0;null!=(n=e[r]);r++)st._data(n,"globalEval",!t||st._data(t[r],"globalEval"))}function y(e,t){if(1===t.nodeType&&st.hasData(e)){var n,r,i,o=st._data(e),a=st._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)st.event.add(t,n,s[n][r])}a.data&&(a.data=st.extend({},a.data))}}function v(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!st.support.noCloneEvent&&t[st.expando]){r=st._data(t);for(i in r.events)st.removeEvent(t,i,r.handle);t.removeAttribute(st.expando)}"script"===n&&t.text!==e.text?(h(t).text=e.text,g(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),st.support.html5Clone&&e.innerHTML&&!st.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Zt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}function b(e,n){var r,i,o=0,a=e.getElementsByTagName!==t?e.getElementsByTagName(n||"*"):e.querySelectorAll!==t?e.querySelectorAll(n||"*"):t;if(!a)for(a=[],r=e.childNodes||e;null!=(i=r[o]);o++)!n||st.nodeName(i,n)?a.push(i):st.merge(a,b(i,n));return n===t||n&&st.nodeName(e,n)?st.merge([e],a):a}function x(e){Zt.test(e.type)&&(e.defaultChecked=e.checked)}function T(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Nn.length;i--;)if(t=Nn[i]+n,t in e)return t;return r}function w(e,t){return e=t||e,"none"===st.css(e,"display")||!st.contains(e.ownerDocument,e)}function N(e,t){for(var n,r=[],i=0,o=e.length;o>i;i++)n=e[i],n.style&&(r[i]=st._data(n,"olddisplay"),t?(r[i]||"none"!==n.style.display||(n.style.display=""),""===n.style.display&&w(n)&&(r[i]=st._data(n,"olddisplay",S(n.nodeName)))):r[i]||w(n)||st._data(n,"olddisplay",st.css(n,"display")));for(i=0;o>i;i++)n=e[i],n.style&&(t&&"none"!==n.style.display&&""!==n.style.display||(n.style.display=t?r[i]||"":"none"));return e}function C(e,t,n){var r=mn.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function k(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;4>o;o+=2)"margin"===n&&(a+=st.css(e,n+wn[o],!0,i)),r?("content"===n&&(a-=st.css(e,"padding"+wn[o],!0,i)),"margin"!==n&&(a-=st.css(e,"border"+wn[o]+"Width",!0,i))):(a+=st.css(e,"padding"+wn[o],!0,i),"padding"!==n&&(a+=st.css(e,"border"+wn[o]+"Width",!0,i)));return a}function E(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=ln(e),a=st.support.boxSizing&&"border-box"===st.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=un(e,t,o),(0>i||null==i)&&(i=e.style[t]),yn.test(i))return i;r=a&&(st.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+k(e,t,n||(a?"border":"content"),r,o)+"px"}function S(e){var t=V,n=bn[e];return n||(n=A(e,t),"none"!==n&&n||(cn=(cn||st("