junior-rails 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in junior-rails.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 semmin
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,66 @@
1
+ # Junior::Rails
2
+
3
+ `junior-rails` packages [awesome Junior](http://justspamjustin.github.com/junior/#home) front-end framework files and integrates it into Rails apps.
4
+
5
+ ### Currently only works in Rails 3.1+ with asset pipeline enabled
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ gem 'junior-rails'
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ ## Usage
18
+
19
+ After installing the gem, add Junior assets to your manifest files:
20
+
21
+ # application.js
22
+ //= require junior_manifest
23
+
24
+ OR in case if don't want to include certain files (let's say you already have `modernizr` in your app), you can require files individually:
25
+
26
+ # application.js
27
+ //= require modernizr.custom.15848
28
+ //= require zepto.min
29
+ //= require zepto.flickable.min
30
+ //= require lodash.min
31
+ //= require backbone-min
32
+ //= require junior
33
+
34
+ Junior CSS files
35
+
36
+ # application.css
37
+ /*...
38
+ *= require junior_manifest
39
+ */
40
+
41
+ OR require individually:
42
+
43
+ # application.css
44
+ /*...
45
+ *= require ratchet
46
+ *= require junior
47
+ */
48
+
49
+ ## Acknowledgements
50
+
51
+ Heavily influenced by [jquery-rails](https://github.com/rails/jquery-rails)
52
+
53
+ ## Contributing
54
+
55
+ 1. If any of libraries in `vendor/assets` is out of date, feel free to put in a pull request with new version of the library.
56
+ 2. Since `junior.js` version is not stated clearly, `JUNIOR_VERSION` constant in `version.rb` is SHA1 hash of `junior.js`. It can be calculated using `sha1_version_generator.rb` located in the root of the gem:
57
+
58
+ ```shell
59
+ ruby sha1_version_generator.rb vendor/assets/javascripts/junior.js
60
+ ```
61
+
62
+ 1. Fork it
63
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
64
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
65
+ 4. Push to the branch (`git push origin my-new-feature`)
66
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'junior-rails/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "junior-rails"
8
+ gem.version = Junior::Rails::VERSION
9
+ gem.authors = ["semmin", "stoplion"]
10
+ gem.email = ["sbagreev@gmail.com", "stoplion@gmail.com"]
11
+ gem.description = %q{Adds Junior front end framework to Rails app}
12
+ gem.summary = %q{Packages Junior framework files and adds it to Rails app.}
13
+ gem.homepage = ""
14
+
15
+ gem.files = `git ls-files`.split($/)
16
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
+ gem.require_paths = ["lib"]
19
+
20
+ gem.add_dependency "railties", ">= 3.1"
21
+ end
@@ -0,0 +1,9 @@
1
+ require "junior-rails/version"
2
+ require "junior-rails/railtie"
3
+ require "junior-rails/engine"
4
+
5
+ module Junior
6
+ module Rails
7
+ # Your code goes here...
8
+ end
9
+ end
@@ -0,0 +1,6 @@
1
+ module Junior
2
+ module Rails
3
+ class Engine < ::Rails::Engine
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,15 @@
1
+ module Junior
2
+ module Rails
3
+ class Railtie < ::Rails::Railtie
4
+ config.before_configuration do
5
+ if config.action_view.javascript_expansions
6
+ junior_js_defaults = %w(modernizr.custom.15848 zepto.min zepto.flickable.min lodash.min backbone-min junior junior_manifest)
7
+ junior_css_defaults = %w(ratchet junior junior_manifest)
8
+
9
+ config.action_view.javascript_expansions[:junior_js_assets] = junior_js_defaults
10
+ config.action_view.stylesheet_expansions[:junior_css_assets] = junior_css_defaults
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,11 @@
1
+ module Junior
2
+ module Rails
3
+ VERSION = "0.0.1"
4
+ BACKBONE_VERSION = "0.9.2"
5
+ JUNIOR_VERSION = "967aa8dfb48c7c554e1e4640c1ed2e7fb1aba731"
6
+ LODASAH_VERSION = "1.0.0"
7
+ MODERNIZR_VERSION = "2.6.2"
8
+ ZIPTO_FLICKABLE_VERSION = "1.0.4"
9
+ ZIPTO_VERSION = "1.0rc1"
10
+ end
11
+ end
@@ -0,0 +1,18 @@
1
+ # Computes the SHA1 hash of any file (passed
2
+ # on the command line)
3
+
4
+ require 'digest'
5
+
6
+ sha1 = Digest::SHA1.new
7
+
8
+ File.open(ARGV[0]) do|file|
9
+ buffer = ''
10
+
11
+ # Read the file 512 bytes at a time
12
+ while not file.eof
13
+ file.read(512, buffer)
14
+ sha1.update(buffer)
15
+ end
16
+ end
17
+
18
+ puts sha1 # Implicitly calls to_s
@@ -0,0 +1,38 @@
1
+ // Backbone.js 0.9.2
2
+
3
+ // (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc.
4
+ // Backbone may be freely distributed under the MIT license.
5
+ // For all details and documentation:
6
+ // http://backbonejs.org
7
+ (function(){var l=this,y=l.Backbone,z=Array.prototype.slice,A=Array.prototype.splice,g;g="undefined"!==typeof exports?exports:l.Backbone={};g.VERSION="0.9.2";var f=l._;!f&&"undefined"!==typeof require&&(f=require("underscore"));var i=l.jQuery||l.Zepto||l.ender;g.setDomLibrary=function(a){i=a};g.noConflict=function(){l.Backbone=y;return this};g.emulateHTTP=!1;g.emulateJSON=!1;var p=/\s+/,k=g.Events={on:function(a,b,c){var d,e,f,g,j;if(!b)return this;a=a.split(p);for(d=this._callbacks||(this._callbacks=
8
+ {});e=a.shift();)f=(j=d[e])?j.tail:{},f.next=g={},f.context=c,f.callback=b,d[e]={tail:g,next:j?j.next:f};return this},off:function(a,b,c){var d,e,h,g,j,q;if(e=this._callbacks){if(!a&&!b&&!c)return delete this._callbacks,this;for(a=a?a.split(p):f.keys(e);d=a.shift();)if(h=e[d],delete e[d],h&&(b||c))for(g=h.tail;(h=h.next)!==g;)if(j=h.callback,q=h.context,b&&j!==b||c&&q!==c)this.on(d,j,q);return this}},trigger:function(a){var b,c,d,e,f,g;if(!(d=this._callbacks))return this;f=d.all;a=a.split(p);for(g=
9
+ z.call(arguments,1);b=a.shift();){if(c=d[b])for(e=c.tail;(c=c.next)!==e;)c.callback.apply(c.context||this,g);if(c=f){e=c.tail;for(b=[b].concat(g);(c=c.next)!==e;)c.callback.apply(c.context||this,b)}}return this}};k.bind=k.on;k.unbind=k.off;var o=g.Model=function(a,b){var c;a||(a={});b&&b.parse&&(a=this.parse(a));if(c=n(this,"defaults"))a=f.extend({},c,a);b&&b.collection&&(this.collection=b.collection);this.attributes={};this._escapedAttributes={};this.cid=f.uniqueId("c");this.changed={};this._silent=
10
+ {};this._pending={};this.set(a,{silent:!0});this.changed={};this._silent={};this._pending={};this._previousAttributes=f.clone(this.attributes);this.initialize.apply(this,arguments)};f.extend(o.prototype,k,{changed:null,_silent:null,_pending:null,idAttribute:"id",initialize:function(){},toJSON:function(){return f.clone(this.attributes)},get:function(a){return this.attributes[a]},escape:function(a){var b;if(b=this._escapedAttributes[a])return b;b=this.get(a);return this._escapedAttributes[a]=f.escape(null==
11
+ b?"":""+b)},has:function(a){return null!=this.get(a)},set:function(a,b,c){var d,e;f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b);c||(c={});if(!d)return this;d instanceof o&&(d=d.attributes);if(c.unset)for(e in d)d[e]=void 0;if(!this._validate(d,c))return!1;this.idAttribute in d&&(this.id=d[this.idAttribute]);var b=c.changes={},h=this.attributes,g=this._escapedAttributes,j=this._previousAttributes||{};for(e in d){a=d[e];if(!f.isEqual(h[e],a)||c.unset&&f.has(h,e))delete g[e],(c.silent?this._silent:
12
+ b)[e]=!0;c.unset?delete h[e]:h[e]=a;!f.isEqual(j[e],a)||f.has(h,e)!=f.has(j,e)?(this.changed[e]=a,c.silent||(this._pending[e]=!0)):(delete this.changed[e],delete this._pending[e])}c.silent||this.change(c);return this},unset:function(a,b){(b||(b={})).unset=!0;return this.set(a,null,b)},clear:function(a){(a||(a={})).unset=!0;return this.set(f.clone(this.attributes),a)},fetch:function(a){var a=a?f.clone(a):{},b=this,c=a.success;a.success=function(d,e,f){if(!b.set(b.parse(d,f),a))return!1;c&&c(b,d)};
13
+ a.error=g.wrapError(a.error,b,a);return(this.sync||g.sync).call(this,"read",this,a)},save:function(a,b,c){var d,e;f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b);c=c?f.clone(c):{};if(c.wait){if(!this._validate(d,c))return!1;e=f.clone(this.attributes)}a=f.extend({},c,{silent:!0});if(d&&!this.set(d,c.wait?a:c))return!1;var h=this,i=c.success;c.success=function(a,b,e){b=h.parse(a,e);if(c.wait){delete c.wait;b=f.extend(d||{},b)}if(!h.set(b,c))return false;i?i(h,a):h.trigger("sync",h,a,c)};c.error=g.wrapError(c.error,
14
+ h,c);b=this.isNew()?"create":"update";b=(this.sync||g.sync).call(this,b,this,c);c.wait&&this.set(e,a);return b},destroy:function(a){var a=a?f.clone(a):{},b=this,c=a.success,d=function(){b.trigger("destroy",b,b.collection,a)};if(this.isNew())return d(),!1;a.success=function(e){a.wait&&d();c?c(b,e):b.trigger("sync",b,e,a)};a.error=g.wrapError(a.error,b,a);var e=(this.sync||g.sync).call(this,"delete",this,a);a.wait||d();return e},url:function(){var a=n(this,"urlRoot")||n(this.collection,"url")||t();
15
+ return this.isNew()?a:a+("/"==a.charAt(a.length-1)?"":"/")+encodeURIComponent(this.id)},parse:function(a){return a},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return null==this.id},change:function(a){a||(a={});var b=this._changing;this._changing=!0;for(var c in this._silent)this._pending[c]=!0;var d=f.extend({},a.changes,this._silent);this._silent={};for(c in d)this.trigger("change:"+c,this,this.get(c),a);if(b)return this;for(;!f.isEmpty(this._pending);){this._pending=
16
+ {};this.trigger("change",this,a);for(c in this.changed)!this._pending[c]&&!this._silent[c]&&delete this.changed[c];this._previousAttributes=f.clone(this.attributes)}this._changing=!1;return this},hasChanged:function(a){return!arguments.length?!f.isEmpty(this.changed):f.has(this.changed,a)},changedAttributes:function(a){if(!a)return this.hasChanged()?f.clone(this.changed):!1;var b,c=!1,d=this._previousAttributes,e;for(e in a)if(!f.isEqual(d[e],b=a[e]))(c||(c={}))[e]=b;return c},previous:function(a){return!arguments.length||
17
+ !this._previousAttributes?null:this._previousAttributes[a]},previousAttributes:function(){return f.clone(this._previousAttributes)},isValid:function(){return!this.validate(this.attributes)},_validate:function(a,b){if(b.silent||!this.validate)return!0;var a=f.extend({},this.attributes,a),c=this.validate(a,b);if(!c)return!0;b&&b.error?b.error(this,c,b):this.trigger("error",this,c,b);return!1}});var r=g.Collection=function(a,b){b||(b={});b.model&&(this.model=b.model);b.comparator&&(this.comparator=b.comparator);
18
+ this._reset();this.initialize.apply(this,arguments);a&&this.reset(a,{silent:!0,parse:b.parse})};f.extend(r.prototype,k,{model:o,initialize:function(){},toJSON:function(a){return this.map(function(b){return b.toJSON(a)})},add:function(a,b){var c,d,e,g,i,j={},k={},l=[];b||(b={});a=f.isArray(a)?a.slice():[a];c=0;for(d=a.length;c<d;c++){if(!(e=a[c]=this._prepareModel(a[c],b)))throw Error("Can't add an invalid model to a collection");g=e.cid;i=e.id;j[g]||this._byCid[g]||null!=i&&(k[i]||this._byId[i])?
19
+ l.push(c):j[g]=k[i]=e}for(c=l.length;c--;)a.splice(l[c],1);c=0;for(d=a.length;c<d;c++)(e=a[c]).on("all",this._onModelEvent,this),this._byCid[e.cid]=e,null!=e.id&&(this._byId[e.id]=e);this.length+=d;A.apply(this.models,[null!=b.at?b.at:this.models.length,0].concat(a));this.comparator&&this.sort({silent:!0});if(b.silent)return this;c=0;for(d=this.models.length;c<d;c++)if(j[(e=this.models[c]).cid])b.index=c,e.trigger("add",e,this,b);return this},remove:function(a,b){var c,d,e,g;b||(b={});a=f.isArray(a)?
20
+ a.slice():[a];c=0;for(d=a.length;c<d;c++)if(g=this.getByCid(a[c])||this.get(a[c]))delete this._byId[g.id],delete this._byCid[g.cid],e=this.indexOf(g),this.models.splice(e,1),this.length--,b.silent||(b.index=e,g.trigger("remove",g,this,b)),this._removeReference(g);return this},push:function(a,b){a=this._prepareModel(a,b);this.add(a,b);return a},pop:function(a){var b=this.at(this.length-1);this.remove(b,a);return b},unshift:function(a,b){a=this._prepareModel(a,b);this.add(a,f.extend({at:0},b));return a},
21
+ shift:function(a){var b=this.at(0);this.remove(b,a);return b},get:function(a){return null==a?void 0:this._byId[null!=a.id?a.id:a]},getByCid:function(a){return a&&this._byCid[a.cid||a]},at:function(a){return this.models[a]},where:function(a){return f.isEmpty(a)?[]:this.filter(function(b){for(var c in a)if(a[c]!==b.get(c))return!1;return!0})},sort:function(a){a||(a={});if(!this.comparator)throw Error("Cannot sort a set without a comparator");var b=f.bind(this.comparator,this);1==this.comparator.length?
22
+ this.models=this.sortBy(b):this.models.sort(b);a.silent||this.trigger("reset",this,a);return this},pluck:function(a){return f.map(this.models,function(b){return b.get(a)})},reset:function(a,b){a||(a=[]);b||(b={});for(var c=0,d=this.models.length;c<d;c++)this._removeReference(this.models[c]);this._reset();this.add(a,f.extend({silent:!0},b));b.silent||this.trigger("reset",this,b);return this},fetch:function(a){a=a?f.clone(a):{};void 0===a.parse&&(a.parse=!0);var b=this,c=a.success;a.success=function(d,
23
+ e,f){b[a.add?"add":"reset"](b.parse(d,f),a);c&&c(b,d)};a.error=g.wrapError(a.error,b,a);return(this.sync||g.sync).call(this,"read",this,a)},create:function(a,b){var c=this,b=b?f.clone(b):{},a=this._prepareModel(a,b);if(!a)return!1;b.wait||c.add(a,b);var d=b.success;b.success=function(e,f){b.wait&&c.add(e,b);d?d(e,f):e.trigger("sync",a,f,b)};a.save(null,b);return a},parse:function(a){return a},chain:function(){return f(this.models).chain()},_reset:function(){this.length=0;this.models=[];this._byId=
24
+ {};this._byCid={}},_prepareModel:function(a,b){b||(b={});a instanceof o?a.collection||(a.collection=this):(b.collection=this,a=new this.model(a,b),a._validate(a.attributes,b)||(a=!1));return a},_removeReference:function(a){this==a.collection&&delete a.collection;a.off("all",this._onModelEvent,this)},_onModelEvent:function(a,b,c,d){("add"==a||"remove"==a)&&c!=this||("destroy"==a&&this.remove(b,d),b&&a==="change:"+b.idAttribute&&(delete this._byId[b.previous(b.idAttribute)],this._byId[b.id]=b),this.trigger.apply(this,
25
+ arguments))}});f.each("forEach,each,map,reduce,reduceRight,find,detect,filter,select,reject,every,all,some,any,include,contains,invoke,max,min,sortBy,sortedIndex,toArray,size,first,initial,rest,last,without,indexOf,shuffle,lastIndexOf,isEmpty,groupBy".split(","),function(a){r.prototype[a]=function(){return f[a].apply(f,[this.models].concat(f.toArray(arguments)))}});var u=g.Router=function(a){a||(a={});a.routes&&(this.routes=a.routes);this._bindRoutes();this.initialize.apply(this,arguments)},B=/:\w+/g,
26
+ C=/\*\w+/g,D=/[-[\]{}()+?.,\\^$|#\s]/g;f.extend(u.prototype,k,{initialize:function(){},route:function(a,b,c){g.history||(g.history=new m);f.isRegExp(a)||(a=this._routeToRegExp(a));c||(c=this[b]);g.history.route(a,f.bind(function(d){d=this._extractParameters(a,d);c&&c.apply(this,d);this.trigger.apply(this,["route:"+b].concat(d));g.history.trigger("route",this,b,d)},this));return this},navigate:function(a,b){g.history.navigate(a,b)},_bindRoutes:function(){if(this.routes){var a=[],b;for(b in this.routes)a.unshift([b,
27
+ this.routes[b]]);b=0;for(var c=a.length;b<c;b++)this.route(a[b][0],a[b][1],this[a[b][1]])}},_routeToRegExp:function(a){a=a.replace(D,"\\$&").replace(B,"([^/]+)").replace(C,"(.*?)");return RegExp("^"+a+"$")},_extractParameters:function(a,b){return a.exec(b).slice(1)}});var m=g.History=function(){this.handlers=[];f.bindAll(this,"checkUrl")},s=/^[#\/]/,E=/msie [\w.]+/;m.started=!1;f.extend(m.prototype,k,{interval:50,getHash:function(a){return(a=(a?a.location:window.location).href.match(/#(.*)$/))?a[1]:
28
+ ""},getFragment:function(a,b){if(null==a)if(this._hasPushState||b){var a=window.location.pathname,c=window.location.search;c&&(a+=c)}else a=this.getHash();a.indexOf(this.options.root)||(a=a.substr(this.options.root.length));return a.replace(s,"")},start:function(a){if(m.started)throw Error("Backbone.history has already been started");m.started=!0;this.options=f.extend({},{root:"/"},this.options,a);this._wantsHashChange=!1!==this.options.hashChange;this._wantsPushState=!!this.options.pushState;this._hasPushState=
29
+ !(!this.options.pushState||!window.history||!window.history.pushState);var a=this.getFragment(),b=document.documentMode;if(b=E.exec(navigator.userAgent.toLowerCase())&&(!b||7>=b))this.iframe=i('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow,this.navigate(a);this._hasPushState?i(window).bind("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!b?i(window).bind("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,
30
+ this.interval));this.fragment=a;a=window.location;b=a.pathname==this.options.root;if(this._wantsHashChange&&this._wantsPushState&&!this._hasPushState&&!b)return this.fragment=this.getFragment(null,!0),window.location.replace(this.options.root+"#"+this.fragment),!0;this._wantsPushState&&this._hasPushState&&b&&a.hash&&(this.fragment=this.getHash().replace(s,""),window.history.replaceState({},document.title,a.protocol+"//"+a.host+this.options.root+this.fragment));if(!this.options.silent)return this.loadUrl()},
31
+ stop:function(){i(window).unbind("popstate",this.checkUrl).unbind("hashchange",this.checkUrl);clearInterval(this._checkUrlInterval);m.started=!1},route:function(a,b){this.handlers.unshift({route:a,callback:b})},checkUrl:function(){var a=this.getFragment();a==this.fragment&&this.iframe&&(a=this.getFragment(this.getHash(this.iframe)));if(a==this.fragment)return!1;this.iframe&&this.navigate(a);this.loadUrl()||this.loadUrl(this.getHash())},loadUrl:function(a){var b=this.fragment=this.getFragment(a);return f.any(this.handlers,
32
+ function(a){if(a.route.test(b))return a.callback(b),!0})},navigate:function(a,b){if(!m.started)return!1;if(!b||!0===b)b={trigger:b};var c=(a||"").replace(s,"");this.fragment!=c&&(this._hasPushState?(0!=c.indexOf(this.options.root)&&(c=this.options.root+c),this.fragment=c,window.history[b.replace?"replaceState":"pushState"]({},document.title,c)):this._wantsHashChange?(this.fragment=c,this._updateHash(window.location,c,b.replace),this.iframe&&c!=this.getFragment(this.getHash(this.iframe))&&(b.replace||
33
+ this.iframe.document.open().close(),this._updateHash(this.iframe.location,c,b.replace))):window.location.assign(this.options.root+a),b.trigger&&this.loadUrl(a))},_updateHash:function(a,b,c){c?a.replace(a.toString().replace(/(javascript:|#).*$/,"")+"#"+b):a.hash=b}});var v=g.View=function(a){this.cid=f.uniqueId("view");this._configure(a||{});this._ensureElement();this.initialize.apply(this,arguments);this.delegateEvents()},F=/^(\S+)\s*(.*)$/,w="model,collection,el,id,attributes,className,tagName".split(",");
34
+ f.extend(v.prototype,k,{tagName:"div",$:function(a){return this.$el.find(a)},initialize:function(){},render:function(){return this},remove:function(){this.$el.remove();return this},make:function(a,b,c){a=document.createElement(a);b&&i(a).attr(b);c&&i(a).html(c);return a},setElement:function(a,b){this.$el&&this.undelegateEvents();this.$el=a instanceof i?a:i(a);this.el=this.$el[0];!1!==b&&this.delegateEvents();return this},delegateEvents:function(a){if(a||(a=n(this,"events"))){this.undelegateEvents();
35
+ for(var b in a){var c=a[b];f.isFunction(c)||(c=this[a[b]]);if(!c)throw Error('Method "'+a[b]+'" does not exist');var d=b.match(F),e=d[1],d=d[2],c=f.bind(c,this),e=e+(".delegateEvents"+this.cid);""===d?this.$el.bind(e,c):this.$el.delegate(d,e,c)}}},undelegateEvents:function(){this.$el.unbind(".delegateEvents"+this.cid)},_configure:function(a){this.options&&(a=f.extend({},this.options,a));for(var b=0,c=w.length;b<c;b++){var d=w[b];a[d]&&(this[d]=a[d])}this.options=a},_ensureElement:function(){if(this.el)this.setElement(this.el,
36
+ !1);else{var a=n(this,"attributes")||{};this.id&&(a.id=this.id);this.className&&(a["class"]=this.className);this.setElement(this.make(this.tagName,a),!1)}}});o.extend=r.extend=u.extend=v.extend=function(a,b){var c=G(this,a,b);c.extend=this.extend;return c};var H={create:"POST",update:"PUT","delete":"DELETE",read:"GET"};g.sync=function(a,b,c){var d=H[a];c||(c={});var e={type:d,dataType:"json"};c.url||(e.url=n(b,"url")||t());if(!c.data&&b&&("create"==a||"update"==a))e.contentType="application/json",
37
+ e.data=JSON.stringify(b.toJSON());g.emulateJSON&&(e.contentType="application/x-www-form-urlencoded",e.data=e.data?{model:e.data}:{});if(g.emulateHTTP&&("PUT"===d||"DELETE"===d))g.emulateJSON&&(e.data._method=d),e.type="POST",e.beforeSend=function(a){a.setRequestHeader("X-HTTP-Method-Override",d)};"GET"!==e.type&&!g.emulateJSON&&(e.processData=!1);return i.ajax(f.extend(e,c))};g.wrapError=function(a,b,c){return function(d,e){e=d===b?e:d;a?a(b,e,c):b.trigger("error",b,e,c)}};var x=function(){},G=function(a,
38
+ b,c){var d;d=b&&b.hasOwnProperty("constructor")?b.constructor:function(){a.apply(this,arguments)};f.extend(d,a);x.prototype=a.prototype;d.prototype=new x;b&&f.extend(d.prototype,b);c&&f.extend(d,c);d.prototype.constructor=d;d.__super__=a.prototype;return d},n=function(a,b){return!a||!a[b]?null:f.isFunction(a[b])?a[b]():a[b]},t=function(){throw Error('A "url" property or function must be specified');}}).call(this);
@@ -0,0 +1,109 @@
1
+ var Jr = Jr || {};
2
+ (function(Jr){
3
+ Jr.View = Backbone.View.extend({
4
+ delegateEvents: function(events) {
5
+ var key, newKey, oldValue;
6
+ this.events = this.events || events;
7
+ for (key in this.events) {
8
+ if (key.indexOf('click') === 0) {
9
+ if (Modernizr.touch) {
10
+ newKey = key.replace('click', 'touchend');
11
+ oldValue = this.events[key];
12
+ this.events[newKey] = oldValue;
13
+ delete this.events[key];
14
+ }
15
+ }
16
+ }
17
+ return Backbone.View.prototype.delegateEvents.call(this, this.events);
18
+ }
19
+ });
20
+
21
+ Jr.Navigator = {
22
+ backButtonFlag: true,
23
+ history: [],
24
+ directions: {
25
+ UP: 'UP',
26
+ DOWN: 'DOWN',
27
+ LEFT: 'LEFT',
28
+ RIGHT: 'RIGHT'
29
+ },
30
+ opposites: {
31
+ UP: 'DOWN',
32
+ DOWN: 'UP',
33
+ LEFT: 'RIGHT',
34
+ RIGHT: 'LEFT'
35
+ },
36
+ animations: {
37
+ SLIDE_STACK: 'SLIDE_STACK',
38
+ SLIDE_OVER: 'SLIDE_OVER'
39
+ },
40
+ navigate: function(url, opts) {
41
+ this.history.push(opts);
42
+ this.backButtonFlag = false;
43
+ return Backbone.history.navigate(url, opts);
44
+ },
45
+ renderView: function(mainEl, view) {
46
+ var animation, newEl;
47
+ animation = this.history.length > 0 ? this.history[this.history.length -1].animation : null;
48
+ if (animation) {
49
+ newEl = $('<div></div>');
50
+ this.resetContent(newEl, view);
51
+ this.normalRenderView(newEl, view);
52
+ this.animate(mainEl, newEl, animation.type, animation.direction);
53
+ return this.afterAnimation();
54
+ } else {
55
+ this.resetContent(mainEl, view);
56
+ return this.normalRenderView(mainEl, view);
57
+ }
58
+ },
59
+ normalRenderView: function(mainEl, view) {
60
+ return mainEl.append(view.render().el);
61
+ },
62
+ resetContent: function(mainEl) {
63
+ return mainEl.html('');
64
+ },
65
+ afterAnimation: function() {
66
+ var animation, opposite;
67
+ var lastNavigate = this.history.pop();
68
+ animation = lastNavigate.animation;
69
+ opposite = this.opposites[animation.direction];
70
+ lastNavigate.animation.direction = opposite;
71
+ this.history.push(lastNavigate);
72
+ if(this.backButtonFlag) {
73
+ this.history.pop();
74
+ }
75
+ this.backButtonFlag = true;
76
+ },
77
+ animate: function(fromEl, toEl, type, direction) {
78
+ if (this.animations.hasOwnProperty(type)) {
79
+ return this.doAnimation(fromEl, toEl, type, direction);
80
+ } else {
81
+ throw Error("Animation Not Available");
82
+ }
83
+ },
84
+ doAnimation: function(fromEl, toEl, type, direction) {
85
+ var after, next;
86
+ $('#app-container').prepend(toEl);
87
+ toEl.addClass('animate-to-view').addClass(direction).addClass('initial');
88
+ $('#app-container').addClass('animate');
89
+ $('#app-container').addClass(direction);
90
+ next = function() {
91
+ return toEl.removeClass('initial');
92
+ };
93
+ setTimeout(next, 1);
94
+ after = function() {
95
+ fromEl.remove();
96
+ toEl.attr('id', 'app-main');
97
+ toEl.removeClass('animate-to-view').removeClass(direction);
98
+ return $('#app-container').removeClass('animate').removeClass(direction);
99
+ };
100
+ return setTimeout(after, 400);
101
+ }
102
+ };
103
+
104
+ Jr.Router = Backbone.Router.extend({
105
+ renderView: function(view) {
106
+ return Jr.Navigator.renderView($('#app-main'), view);
107
+ }
108
+ });
109
+ })(Jr);
@@ -0,0 +1,6 @@
1
+ //= require modernizr.custom.15848
2
+ //= require zepto.min
3
+ //= require zepto.flickable.min
4
+ //= require lodash.min
5
+ //= require backbone-min
6
+ //= require junior
@@ -0,0 +1,41 @@
1
+ /*!
2
+ Lo-Dash 1.0.0-rc.2 lodash.com/license
3
+ Underscore.js 1.4.3 underscorejs.org/LICENSE
4
+ */
5
+ ;(function(e,t){function s(e){if(e&&"object"==typeof e&&e.__wrapped__)return e;if(!(this instanceof s))return new s(e);this.__wrapped__=e}function o(t,n){return e.eval("(function("+t+"){"+n+"})")}function u(e,t,n){t||(t=0);var r=e.length,i=r-t>=(n||it);if(i)for(var s={},n=t-1;++n<r;){var o=e[n]+"";(Tt.call(s,o)?s[o]:s[o]=[]).push(e[n])}return function(n){if(i){var r=n+"";return Tt.call(s,r)&&-1<W(s[r],n)}return-1<W(e,n,t)}}function a(e){return e.charCodeAt(0)}function f(e,t){var n=e.b,r=t.b,e=e.a,
6
+ t=t.a;if(e!==t){if(e>t||"undefined"==typeof e)return 1;if(e<t||"undefined"==typeof t)return-1}return n<r?-1:1}function l(e,t,n){function i(){var a=arguments,f=o?this:t;return s||(e=t[u]),n.length&&(a=a.length?n.concat(g(a)):n),this instanceof i?(m.prototype=e.prototype,f=new m,m.prototype=r,a=e.apply(f,a),k(a)?a:f):e.apply(f,a)}var s=C(e),o=!n,u=t;return o&&(n=t),s||(t=e),i}function c(e,t){return e?"function"!=typeof e?function(t){return t[e]}:"undefined"!=typeof t?function(n,r,i){return e.call(t
7
+ ,n,r,i)}:e:K}function h(){for(var e={b:"",c:"",e:Kt,f:Jt,g:"",h:Yt,i:en,j:bt,k:"",l:n},t,r=0;t=arguments[r];r++)for(var i in t)e[i]=t[i];t=e.a,e.d=/^[^,]+/.exec(t)[0],r="var i,l="+e.d+",t="+e.d+";if(!"+e.d+")return t;"+e.k+";",e.b?(r+="var m=l.length;i=-1;if(typeof m=='number'){",e.i&&(r+="if(k(l)){l=l.split('')}"),r+="while(++i<m){"+e.b+"}}else {"):e.h&&(r+="var m=l.length;i=-1;if(m&&j(l)){while(++i<m){i+='';"+e.g+"}}else {"),e.e||(r+="var u=typeof l=='function'&&s.call(l,'prototype');");if(e.f&&
8
+ e.l)r+="var q=-1,r=p[typeof l]?n(l):[],m=r.length;while(++q<m){i=r[q];",e.e||(r+="if(!(u&&i=='prototype')){"),r+=e.g+"",e.e||(r+="}");else{r+="for(i in l){";if(!e.e||e.l)r+="if(",e.e||(r+="!(u&&i=='prototype')"),!e.e&&e.l&&(r+="&&"),e.l&&(r+="h.call(l,i)"),r+="){";r+=e.g+";";if(!e.e||e.l)r+="}"}r+="}";if(e.e){r+="var f=l.constructor;";for(i=0;7>i;i++)r+="i='"+e.j[i]+"';if(","constructor"==e.j[i]&&(r+="!(f&&f.prototype===l)&&"),r+="h.call(l,i)){"+e.g+"}"}if(e.b||e.h)r+="}";return r+=e.c+";return t"
9
+ ,o("e,h,j,k,p,n,s","return function("+t+"){"+r+"}")(c,Tt,b,A,on,_t,Ct)}function p(e){return"\\"+un[e]}function d(e){return dn[e]}function v(e){return"function"!=typeof e.toString&&"string"==typeof (e+"")}function m(){}function g(e,t,n){t||(t=0),"undefined"==typeof n&&(n=e?e.length:0);for(var r=-1,n=n-t||0,i=Array(0>n?0:n);++r<n;)i[r]=e[t+r];return i}function y(e){return vn[e]}function b(e){return kt.call(e)==Bt}function w(e){var t=i;if(!e||"object"!=typeof e||b(e))return t;var n=e.constructor;return!
10
+ C(n)&&(!tn||!v(e))||n instanceof n?Qt?(hn(e,function(e,n,r){return t=!Tt.call(r,n),i}),t===i):(hn(e,function(e,n){t=n}),t===i||Tt.call(e,t)):t}function E(e){var t=[];return pn(e,function(e,n){t.push(n)}),t}function S(e,t,n,s,o){if(e==r)return e;n&&(t=i);if(n=k(e)){var u=kt.call(e);if(!rn[u]||tn&&v(e))return e;var a=gn(e)}if(!n||!t)return n?a?g(e):cn({},e):e;n=sn[u];switch(u){case Ft:case It:return new n(+e);case qt:case zt:return new n(e);case Ut:return n(e.source,ct.exec(e))}s||(s=[]),o||(o=[]);
11
+ for(u=s.length;u--;)if(s[u]==e)return o[u];var f=a?n(e.length):{};return s.push(e),o.push(f),(a?wn:pn)(e,function(e,n){f[n]=S(e,t,r,s,o)}),a&&(Tt.call(e,"index")&&(f.index=e.index),Tt.call(e,"input")&&(f.input=e.input)),f}function x(e){var t=[];return hn(e,function(e,n){C(e)&&t.push(n)}),t.sort()}function T(e){var t={};return pn(e,function(e,n){t[e]=n}),t}function N(e,t,s,o){if(e===t)return 0!==e||1/e==1/t;if(e==r||t==r)return e===t;var u=kt.call(e),a=kt.call(t);u==Bt&&(u=Rt),a==Bt&&(a=Rt);if(u!=
12
+ a)return i;switch(u){case Ft:case It:return+e==+t;case qt:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case Ut:case zt:return e==t+""}a=u==jt;if(!a){if(e.__wrapped__||t.__wrapped__)return N(e.__wrapped__||e,t.__wrapped__||t);if(u!=Rt||tn&&(v(e)||v(t)))return i;var u=Zt&&b(e)?Object:e.constructor,f=Zt&&b(t)?Object:t.constructor;if(u!=f&&(!C(u)||!(u instanceof u&&C(f)&&f instanceof f)))return i}s||(s=[]),o||(o=[]);for(u=s.length;u--;)if(s[u]==e)return o[u]==t;var l=n,c=0;s.push(e),o.push(t);if(a){c=e.length
13
+ ;if(l=c==t.length)for(;c--&&(l=N(e[c],t[c],s,o)););return l}return hn(e,function(e,n,r){if(Tt.call(r,n))return c++,l=Tt.call(t,n)&&N(e,t[n],s,o)}),l&&hn(t,function(e,t,n){if(Tt.call(n,t))return l=-1<--c}),l}function C(e){return"function"==typeof e}function k(e){return e?on[typeof e]:i}function L(e){return"number"==typeof e||kt.call(e)==qt}function A(e){return"string"==typeof e||kt.call(e)==zt}function O(e,t,n){var i=arguments,s=0,o=2,u=i[3],a=i[4];n!==rt&&(u=[],a=[],"number"!=typeof n&&(o=i.length
14
+ ));for(;++s<o;)pn(i[s],function(t,n){var i,s,o;if(t&&((s=gn(t))||yn(t))){for(var f=u.length;f--;)if(i=u[f]==t)break;i?e[n]=a[f]:(u.push(t),a.push(o=(o=e[n],s)?gn(o)?o:[]:yn(o)?o:{}),e[n]=O(o,t,rt,u,a))}else t!=r&&(e[n]=t)});return e}function M(e){var t=[];return pn(e,function(e){t.push(e)}),t}function _(e,t,n){var r=-1,s=e?e.length:0,o=i,n=(0>n?Dt(0,s+n):n)||0;return"number"==typeof s?o=-1<(A(e)?e.indexOf(t,n):W(e,t,n)):wn(e,function(e){if(++r>=n)return!(o=e===t)}),o}function D(e,t,r){var i=n,t=c
15
+ (t,r);if(gn(e))for(var r=-1,s=e.length;++r<s&&(i=!!t(e[r],r,e)););else wn(e,function(e,n,r){return i=!!t(e,n,r)});return i}function P(e,t,n){var r=[],t=c(t,n);if(gn(e))for(var n=-1,i=e.length;++n<i;){var s=e[n];t(s,n,e)&&r.push(s)}else wn(e,function(e,n,i){t(e,n,i)&&r.push(e)});return r}function H(e,t,n){var r,t=c(t,n);return wn(e,function(e,n,s){if(t(e,n,s))return r=e,i}),r}function B(e,t,n){var r=-1,i=e?e.length:0,s=Array("number"==typeof i?i:0),t=c(t,n);if(gn(e))for(;++r<i;)s[r]=t(e[r],r,e);else wn
16
+ (e,function(e,n,i){s[++r]=t(e,n,i)});return s}function j(e,t,n){var r=-Infinity,i=-1,s=e?e.length:0,o=r;if(t||!gn(e))t=!t&&A(e)?a:c(t,n),wn(e,function(e,n,i){n=t(e,n,i),n>r&&(r=n,o=e)});else for(;++i<s;)e[i]>o&&(o=e[i]);return o}function F(e,t){return B(e,t+"")}function I(e,t,n,r){var s=3>arguments.length;return t||(t=K),wn(e,function(e,o,u){n=s?(s=i,e):t.call(r,n,e,o,u)}),n}function q(e,t,n,r){var s=e,o=e?e.length:0,u=3>arguments.length;if("number"!=typeof o)var a=bn(e),o=a.length;else en&&A(e)&&
17
+ (s=e.split(""));return t||(t=K),wn(e,function(e,f,l){f=a?a[--o]:--o,n=u?(u=i,s[f]):t.call(r,n,s[f],f,l)}),n}function R(e,t,n){var r,t=c(t,n);if(gn(e))for(var n=-1,i=e.length;++n<i&&!(r=t(e[n],n,e)););else wn(e,function(e,n,i){return!(r=t(e,n,i))});return!!r}function U(e,t,n){if(e){var i=e.length;return t==r||n?e[0]:g(e,0,Pt(Dt(0,t),i))}}function z(e,t){for(var n=-1,r=e?e.length:0,i=[];++n<r;){var s=e[n];gn(s)?Nt.apply(i,t?s:z(s)):i.push(s)}return i}function W(e,t,n){var r=-1,i=e?e.length:0;if("number"==typeof
18
+ n)r=(0>n?Dt(0,i+n):n||0)-1;else if(n)return r=V(e,t),e[r]===t?r:-1;for(;++r<i;)if(e[r]===t)return r;return-1}function X(e,t,n){return g(e,t==r||n?1:Dt(0,t))}function V(e,t,n,r){for(var i=0,s=e?e.length:i,n=n?c(n,r):K,t=n(t);i<s;)r=i+s>>>1,n(e[r])<t?i=r+1:s=r;return i}function $(e,t,n,r){var s=-1,o=e?e.length:0,u=[],a=u;"function"==typeof t&&(r=n,n=t,t=i);var f=!t&&74<o;if(f)var l={};n&&(a=[],n=c(n,r));for(;++s<o;){var r=e[s],h=n?n(r,s,e):r;f&&(a=Tt.call(l,h+"")?l[h]:l[h]=[]);if(t?!s||a[a.length-1
19
+ ]!==h:0>W(a,h))(n||f)&&a.push(h),u.push(r)}return u}function J(e,t){return $t||Lt&&2<arguments.length?Lt.call.apply(Lt,arguments):l(e,t,g(arguments,2))}function K(e){return e}function Q(e){wn(x(e),function(t){var n=s[t]=e[t];s.prototype[t]=function(){var e=[this.__wrapped__];return Nt.apply(e,arguments),e=n.apply(s,e),new s(e)}})}function G(){return this.__wrapped__}var n=!0,r=null,i=!1,Y="object"==typeof exports&&exports,Z="object"==typeof global&&global;Z.global===Z&&(e=Z);var et=[],tt=new function(
20
+ ){},nt=0,rt=tt,it=30,st=e._,ot=/[-?+=!~*%&^<>|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/,ut=/&(?:amp|lt|gt|quot|#x27);/g,at=/\b__p\+='';/g,ft=/\b(__p\+=)''\+/g,lt=/(__e\(.*?\)|\b__t\))\+'';/g,ct=/\w*$/,ht=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g,pt=RegExp("^"+(tt.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),dt=/\$\{((?:(?=\\?)\\?[\s\S])*?)}/g,vt=/<%=([\s\S]+?)%>/g,mt=/($^)/,gt=/[&<>"']/g,yt=/['\n\r\t\u2028\u2029\\]/g,bt="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf"
21
+ .split(" "),wt=Math.ceil,Et=et.concat,St=Math.floor,xt=pt.test(xt=Object.getPrototypeOf)&&xt,Tt=tt.hasOwnProperty,Nt=et.push,Ct=tt.propertyIsEnumerable,kt=tt.toString,Lt=pt.test(Lt=g.bind)&&Lt,At=pt.test(At=Array.isArray)&&At,Ot=e.isFinite,Mt=e.isNaN,_t=pt.test(_t=Object.keys)&&_t,Dt=Math.max,Pt=Math.min,Ht=Math.random,Bt="[object Arguments]",jt="[object Array]",Ft="[object Boolean]",It="[object Date]",qt="[object Number]",Rt="[object Object]",Ut="[object RegExp]",zt="[object String]",Wt=!/1/.test
22
+ (Function("1")),Xt=!!e.attachEvent,Vt=Lt&&!/\n|true/.test(Lt+Xt),$t=Lt&&!Vt,Jt=_t&&(Xt||Vt),Kt,Qt,Gt=(Gt={0:1,length:1},et.splice.call(Gt,0,1),Gt[0]),Yt=n;(function(){function e(){this.x=1}var t=[];e.prototype={valueOf:1,y:1};for(var n in new e)t.push(n);for(n in arguments)Yt=!n;Kt=!/valueOf/.test(t),Qt="x"!=t[0]})(1);var Zt=!b(arguments),en="xx"!="x"[0]+Object("x")[0];try{var tn=("[object Object]",kt.call(document)==Rt)}catch(nn){}var rn={"[object Function]":i};rn[Bt]=rn[jt]=rn[Ft]=rn[It]=rn[qt]=
23
+ rn[Rt]=rn[Ut]=rn[zt]=n;var sn={};sn[jt]=Array,sn[Ft]=Boolean,sn[It]=Date,sn[Rt]=Object,sn[qt]=Number,sn[Ut]=RegExp,sn[zt]=String;var on={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i},un={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};s.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:vt,variable:""};if(Xt||Vt||!Wt)o=Function;var an={a:"o,v,g",k:"for(var a=1,b=typeof g=='number'?2:arguments.length;a<b;a++){if((l=arguments[a])){"
24
+ ,g:"t[i]=l[i]",c:"}}"},fn={a:"d,c,w",k:"c=c&&typeof w=='undefined'?c:e(c,w)",b:"if(c(l[i],i,d)===false)return t",g:"if(c(l[i],i,d)===false)return t"},ln={b:r},cn=h(an);Zt&&(b=function(e){return e?Tt.call(e,"callee"):i});var hn=h(fn,ln,{l:i}),pn=h(fn,ln),dn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},vn=T(dn),mn=h(an,{g:"if(t[i]==null)"+an.g}),gn=At||function(e){return kt.call(e)==jt};C(/x/)&&(C=function(e){return"[object Function]"==kt.call(e)});var yn=xt?function(e){if(!e||"object"!=typeof
25
+ e)return i;var t=e.valueOf,n="function"==typeof t&&(n=xt(t))&&xt(n);return n?e==n||xt(e)==n&&!b(e):w(e)}:w,bn=_t?function(e){return"function"==typeof e&&Ct.call(e,"prototype")?E(e):k(e)?_t(e):[]}:E,wn=h(fn);s.assign=cn,s.bindAll=function(e){for(var t=arguments,n=1<t.length?0:(t=x(e),-1),r=t.length;++n<r;){var i=t[n];e[i]=J(e[i],e)}return e},s.chain=function(e){return new s(e)},s.compact=function(e){for(var t=-1,n=e?e.length:0,r=[];++t<n;){var i=e[t];i&&r.push(i)}return r},s.countBy=function(e,t,n
26
+ ){var r={},t=c(t,n);return wn(e,function(e,n,i){n=t(e,n,i),Tt.call(r,n)?r[n]++:r[n]=1}),r},s.defaults=mn,s.difference=function(e){for(var t=-1,n=e?e.length:0,r=Et.apply(et,arguments),r=u(r,n),i=[];++t<n;){var s=e[t];r(s)||i.push(s)}return i},s.filter=P,s.flatten=z,s.forEach=wn,s.forIn=hn,s.forOwn=pn,s.functions=x,s.groupBy=function(e,t,n){var r={},t=c(t,n);return wn(e,function(e,n,i){n=t(e,n,i),(Tt.call(r,n)?r[n]:r[n]=[]).push(e)}),r},s.initial=function(e,t,n){if(!e)return[];var i=e.length;return g
27
+ (e,0,Pt(Dt(0,i-(t==r||n?1:t||0)),i))},s.intersection=function(e){var t=arguments,n=t.length,r={},i=[];return wn(e,function(e){if(0>W(i,e)){for(var s=n;--s;)if(!(r[s]||(r[s]=u(t[s])))(e))return;i.push(e)}}),i},s.invert=T,s.invoke=function(e,t){var n=g(arguments,2),r="function"==typeof t,i=[];return wn(e,function(e){i.push((r?t:e[t]).apply(e,n))}),i},s.keys=bn,s.map=B,s.max=j,s.merge=O,s.min=function(e,t,n){var r=Infinity,i=-1,s=e?e.length:0,o=r;if(t||!gn(e))t=!t&&A(e)?a:c(t,n),wn(e,function(e,n,i)
28
+ {n=t(e,n,i),n<r&&(r=n,o=e)});else for(;++i<s;)e[i]<o&&(o=e[i]);return o},s.object=function(e,t){for(var n=-1,r=e?e.length:0,i={};++n<r;){var s=e[n];t?i[s]=t[n]:i[s[0]]=s[1]}return i},s.omit=function(e,t,n){var r="function"==typeof t,i={};if(r)t=c(t,n);else var s=Et.apply(et,arguments);return hn(e,function(e,n,o){if(r?!t(e,n,o):0>W(s,n,1))i[n]=e}),i},s.pairs=function(e){var t=[];return pn(e,function(e,n){t.push([n,e])}),t},s.pick=function(e,t,n){var r={};if("function"!=typeof t)for(var i=0,s=Et.apply
29
+ (et,arguments),o=s.length;++i<o;){var u=s[i];u in e&&(r[u]=e[u])}else t=c(t,n),hn(e,function(e,n,i){t(e,n,i)&&(r[n]=e)});return r},s.pluck=F,s.range=function(e,t,n){e=+e||0,n=+n||1,t==r&&(t=e,e=0);for(var i=-1,t=Dt(0,wt((t-e)/n)),s=Array(t);++i<t;)s[i]=e,e+=n;return s},s.reject=function(e,t,n){return t=c(t,n),P(e,function(e,n,r){return!t(e,n,r)})},s.rest=X,s.shuffle=function(e){var t=-1,n=Array(e?e.length:0);return wn(e,function(e){var r=St(Ht()*(++t+1));n[t]=n[r],n[r]=e}),n},s.sortBy=function(e,
30
+ t,n){var r=[],t=c(t,n);wn(e,function(e,n,i){r.push({a:t(e,n,i),b:n,c:e})}),e=r.length;for(r.sort(f);e--;)r[e]=r[e].c;return r},s.tap=function(e,t){return t(e),e},s.times=function(e,t,n){for(var e=+e||0,r=-1,i=Array(e);++r<e;)i[r]=t.call(n,r);return i},s.toArray=function(e){return"number"==typeof (e?e.length:0)?en&&A(e)?e.split(""):g(e):M(e)},s.union=function(){return $(Et.apply(et,arguments))},s.uniq=$,s.values=M,s.where=function(e,t){var n=bn(t);return P(e,function(e){for(var r=n.length;r--;){var i=
31
+ e[n[r]]===t[n[r]];if(!i)break}return!!i})},s.without=function(e){for(var t=-1,n=e?e.length:0,r=u(arguments,1,20),i=[];++t<n;){var s=e[t];r(s)||i.push(s)}return i},s.zip=function(e){for(var t=-1,n=e?j(F(arguments,"length")):0,r=Array(n);++t<n;)r[t]=F(arguments,t);return r},s.collect=B,s.drop=X,s.each=wn,s.extend=cn,s.methods=x,s.select=P,s.tail=X,s.unique=$,Q(s),s.after=function(e,t){return 1>e?t():function(){if(1>--e)return t.apply(this,arguments)}},s.bind=J,s.bindKey=function(e,t){return l(e,t,g
32
+ (arguments,2))},s.clone=S,s.compose=function(){var e=arguments;return function(){for(var t=arguments,n=e.length;n--;)t=[e[n].apply(this,t)];return t[0]}},s.contains=_,s.debounce=function(e,t,n){function i(){a=r,n||(o=e.apply(u,s))}var s,o,u,a;return function(){var r=n&&!a;return s=arguments,u=this,clearTimeout(a),a=setTimeout(i,t),r&&(o=e.apply(u,s)),o}},s.defer=function(e){var n=g(arguments,1);return setTimeout(function(){e.apply(t,n)},1)},s.delay=function(e,n){var r=g(arguments,2);return setTimeout
33
+ (function(){e.apply(t,r)},n)},s.escape=function(e){return e==r?"":(e+"").replace(gt,d)},s.every=D,s.find=H,s.has=function(e,t){return e?Tt.call(e,t):i},s.identity=K,s.indexOf=W,s.isArguments=b,s.isArray=gn,s.isBoolean=function(e){return e===n||e===i||kt.call(e)==Ft},s.isDate=function(e){return kt.call(e)==It},s.isElement=function(e){return e?1===e.nodeType:i},s.isEmpty=function(e){var t=n;if(!e)return t;var r=kt.call(e),s=e.length;return r==jt||r==zt||r==Bt||Zt&&b(e)||r==Rt&&"number"==typeof s&&C
34
+ (e.splice)?!s:(pn(e,function(){return t=i}),t)},s.isEqual=N,s.isFinite=function(e){return Ot(e)&&!Mt(parseFloat(e))},s.isFunction=C,s.isNaN=function(e){return L(e)&&e!=+e},s.isNull=function(e){return e===r},s.isNumber=L,s.isObject=k,s.isPlainObject=yn,s.isRegExp=function(e){return kt.call(e)==Ut},s.isString=A,s.isUndefined=function(e){return"undefined"==typeof e},s.lastIndexOf=function(e,t,n){var r=e?e.length:0;for("number"==typeof n&&(r=(0>n?Dt(0,r+n):Pt(n,r-1))+1);r--;)if(e[r]===t)return r;return-1
35
+ },s.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return Tt.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},s.mixin=Q,s.noConflict=function(){return e._=st,this},s.once=function(e){var t,s=i;return function(){return s?t:(s=n,t=e.apply(this,arguments),e=r,t)}},s.partial=function(e){return l(e,g(arguments,1))},s.random=function(e,t){return e==r&&t==r&&(t=1),e=+e||0,t==r&&(t=e,e=0),e+St(Ht()*((+t||0)-e+1))},s.reduce=I,s.reduceRight=q,s.result=function(e,
36
+ t){var n=e?e[t]:r;return C(n)?e[t]():n},s.size=function(e){var t=e?e.length:0;return"number"==typeof t?t:bn(e).length},s.some=R,s.sortedIndex=V,s.template=function(e,t,n){e||(e=""),n||(n={});var r,i,u=s.templateSettings,a=0,f=n.interpolate||u.interpolate||mt,l="__p+='",c=n.variable||u.variable,h=c;e.replace(RegExp((n.escape||u.escape||mt).source+"|"+f.source+"|"+(f===vt?dt:mt).source+"|"+(n.evaluate||u.evaluate||mt).source+"|$","g"),function(t,n,i,s,o,u){return i||(i=s),l+=e.slice(a,u).replace(yt
37
+ ,p),n&&(l+="'+__e("+n+")+'"),o&&(l+="';"+o+";__p+='"),i&&(l+="'+((__t=("+i+"))==null?'':__t)+'"),r||(r=o||ot.test(n||i)),a=u+t.length,t}),l+="';\n",h||(c="obj",r?l="with("+c+"){"+l+"}":(n=RegExp("(\\(\\s*)"+c+"\\."+c+"\\b","g"),l=l.replace(ht,"$&"+c+".").replace(n,"$1__d"))),l=(r?l.replace(at,""):l).replace(ft,"$1").replace(lt,"$1;"),l="function("+c+"){"+(h?"":c+"||("+c+"={});")+"var __t,__p='',__e=_.escape"+(r?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(h?"":",__d="+
38
+ c+"."+c+"||"+c)+";")+l+"return __p}";try{i=o("_","return "+l)(s)}catch(d){throw d.source=l,d}return t?i(t):(i.source=l,i)},s.throttle=function(e,t){function n(){a=new Date,u=r,s=e.apply(o,i)}var i,s,o,u,a=0;return function(){var f=new Date,l=t-(f-a);return i=arguments,o=this,0>=l?(clearTimeout(u),u=r,a=f,s=e.apply(o,i)):u||(u=setTimeout(n,l)),s}},s.unescape=function(e){return e==r?"":(e+"").replace(ut,y)},s.uniqueId=function(e){return(e==r?"":e+"")+ ++nt},s.wrap=function(e,t){return function(){var n=
39
+ [e];return Nt.apply(n,arguments),t.apply(this,n)}},s.all=D,s.any=R,s.detect=H,s.foldl=I,s.foldr=q,s.include=_,s.inject=I,pn(s,function(e,t){s.prototype[t]||(s.prototype[t]=function(){var t=[this.__wrapped__];return Nt.apply(t,arguments),e.apply(s,t)})}),s.first=U,s.last=function(e,t,n){if(e){var i=e.length;return t==r||n?e[i-1]:g(e,Dt(0,i-t))}},s.take=U,s.head=U,pn(s,function(e,t){s.prototype[t]||(s.prototype[t]=function(t,n){var i=e(this.__wrapped__,t,n);return t==r||n?i:new s(i)})}),s.VERSION="1.0.0-rc.2"
40
+ ,s.prototype.chain=function(){return this},s.prototype.toString=function(){return""+this.__wrapped__},s.prototype.value=G,s.prototype.valueOf=G,wn("pop push reverse shift sort splice unshift".split(" "),function(e){var t=et[e];s.prototype[e]=function(){var e=this.__wrapped__;return t.apply(e,arguments),Gt&&e.length===0&&delete e[0],this}}),wn(["concat","join","slice"],function(e){var t=et[e];s.prototype[e]=function(){var e=t.apply(this.__wrapped__,arguments);return new s(e)}}),typeof define=="function"&&typeof
41
+ define.amd=="object"&&define.amd?(e._=s,define(function(){return s})):Y?"object"==typeof module&&module&&module.exports==Y?(module.exports=s)._=s:Y._=s:e._=s})(this);
@@ -0,0 +1,4 @@
1
+ /* Modernizr 2.6.2 (Custom Build) | MIT & BSD
2
+ * Build: http://modernizr.com/download/#-touch-teststyles-prefixes
3
+ */
4
+ ;window.Modernizr=function(a,b,c){function v(a){i.cssText=a}function w(a,b){return v(l.join(a+";")+(b||""))}function x(a,b){return typeof a===b}function y(a,b){return!!~(""+a).indexOf(b)}function z(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:x(f,"function")?f.bind(d||b):f}return!1}var d="2.6.2",e={},f=b.documentElement,g="modernizr",h=b.createElement(g),i=h.style,j,k={}.toString,l=" -webkit- -moz- -o- -ms- ".split(" "),m={},n={},o={},p=[],q=p.slice,r,s=function(a,c,d,e){var h,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:g+(d+1),l.appendChild(j);return h=["&#173;",'<style id="s',g,'">',a,"</style>"].join(""),l.id=g,(m?l:n).innerHTML+=h,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=f.style.overflow,f.style.overflow="hidden",f.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),f.style.overflow=k),!!i},t={}.hasOwnProperty,u;!x(t,"undefined")&&!x(t.call,"undefined")?u=function(a,b){return t.call(a,b)}:u=function(a,b){return b in a&&x(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=q.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(q.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(q.call(arguments)))};return e}),m.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:s(["@media (",l.join("touch-enabled),("),g,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c};for(var A in m)u(m,A)&&(r=A.toLowerCase(),e[r]=m[A](),p.push((e[r]?"":"no-")+r));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)u(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof enableClasses!="undefined"&&enableClasses&&(f.className+=" "+(b?"":"no-")+a),e[a]=b}return e},v(""),h=j=null,e._version=d,e._prefixes=l,e.testStyles=s,e}(this,this.document);
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Flickable: a Zepto plugin for making elements flickable on a touch device
3
+ * 2012, Tom Longo
4
+ *
5
+ * Licensed under the Whatever License. Use it for whatever you want!
6
+ *
7
+ * @author thetomlongo@gmail.com
8
+ * @version 1.0.4
9
+ *
10
+ * @requires
11
+ * Zepto JavaScript Library
12
+ */
13
+ (function(a){function r(){var c="";for(var d=0;d<3;d++){c+=b.eventLog[d]+" | "}var e="<pre> \n\t\tlast 3 events: "+c+"<br /> \n\t\tstart: {x:"+b.start.x+", y:"+b.start.y+",time: "+b.start.time+"}<br /> \n\t\t\tdelta: {<br /> \n\t\t\tprevPos: {"+b.delta.prevPos.x+", "+b.delta.prevPos.y+"}<br /> \n\t\t\tdist: {"+b.delta.dist.x+", "+b.delta.dist.y+"}<br /> \n\t\t\tdir: {"+b.delta.dir.x+", "+b.delta.dir.y+"}<br /> \n\t\t\t}<br /> \n\t\tend: {<br /> \n\t\t\tspeed: {"+b.end.speed.x+", "+b.end.speed.y+"}<br /> \n\t\t\tflick: {"+b.end.flick.x+", "+b.end.flick.y+"}<br /> \n\t\t\tduration: "+b.end.duration+"<br /> \n\t\t} \n\t\t</pre>";a("#flickableDebugger").html(e)}function q(a){if(h){console.log(a);b.eventLog.splice(0,0,a);r()}}function p(){if(!a("#flickableDebugger").length){h=true;b=c;b.eventLog=[];var d='<div id="flickableDebugger" style="position: fixed; bottom: 0; margin: 0 auto; padding: 10px; width: 100%; background: #000; color: #fff; font-family: courier, sans-serif;">Debugger</div>';a("body").append(d)}}function o(a){var b=document.createElement("div"),c="Khtml Ms O Moz Webkit".split(" "),d=c.length;return function(a){if(a in b.style)return true;a=a.replace(/^[a-z]/,function(a){return a.toUpperCase()});while(d--){if(c[d]+a in b.style){return true}}return false}}function n(a,b){if(!parseInt(b)){var b,c=a.data("segments"),d=m(a,a.data("flickDirection"));d=="y"?b=a.height()/c:b=a.width()/c}return b}function m(a,b){if(b!=="x"&&b!=="y"){a.height()>a.width()?b="y":b="x"}return b}function l(a){var c=a.timeStamp-b.start.time,d=Math.abs(Math.round(b.delta.dist.x/c*100)/100),e=Math.abs(Math.round(b.delta.dist.y/c*100)/100),i=b.delta.dir.x,j=b.delta.dir.y,k=0,l=0;if(d>f){Math.abs(b.delta.dist.x)>=g?k=i:k=0}else if(e>f){Math.abs(b.delta.dist.y)>=g?l=j:l=0}b.end.duration=c;b.end.speed={x:d,y:e};b.end.flick={x:k,y:l};if(h){q("Touch end");r()}}function k(a){var c,d;typeof a.touches[0].pageX!="undefined"?c=a.touches[0].pageX:c=a.pageX;typeof a.touches[0].pageY!="undefined"?d=a.touches[0].pageY:d=a.pageY;var e,f,g=c,i=d,j=c-b.start.x,k=d-b.start.y;if(c>b.delta.prevPos.x){e=1}else if(c<b.delta.prevPos.x){e=-1}else{e=0}if(d>b.delta.prevPos.y){f=1}else if(d<b.delta.prevPos.y){f=-1}else{f=0}b.delta.prevPos={x:g,y:i};b.delta.dist={x:j,y:k};b.delta.dir={x:e,y:f};if(h){r()}}function j(a){var d,e;typeof a.touches[0].pageX!="undefined"?d=a.touches[0].pageX:d=a.pageX;typeof a.touches[0].pageY!="undefined"?e=a.touches[0].pageY:e=a.pageY;b=c;b.start={x:d,y:e,time:a.timeStamp};b.delta.prevPos={x:d,y:e};k(a);if(h){r()}}var b,c={start:{x:0,y:0,time:0},delta:{prevPos:{x:0,y:0},dist:{x:0,y:0},dir:{x:0,y:0}},end:{duration:0,speed:{x:0,y:0},flick:{x:0,y:0}}},d=false,e=0,f=.7,g=5,h=false;var i={init:function(b){var c=a.extend({enableDebugger:false,segments:5,snapSpeed:.3,flickSnapSpeed:.3,flickThreshold:false,segmentPx:"auto",flickDirection:"auto",preventDefault:true,onCreate:false,onFlick:false,onFlickLeft:false,onFlickRight:false,onFlickUp:false,onFlickDown:false,onScroll:false,onScrollNext:false,onScrollPrev:false,onMove:false,onStart:false,onEnd:false},b);return this.each(function(){var b=a(this),e=b.data("isAlive");if(!e){var g=c.segments,i=m(b,c.flickDirection);b.data("isAlive",true).data("pos",0).data("snapSpeed",parseFloat(c.snapSpeed)).data("flickSnapSpeed",parseFloat(c.flickSnapSpeed)).data("segment",0).data("segments",g).data("flickDirection",i).data("segmentPx",n(b,c.segmentPx));a(b).bind({onStart:function(){a(this).flickable("start",c.onStart)},onMove:function(){a(this).flickable("move",c.onMove)},onEnd:function(){a(this).flickable("finished",c.onEnd)},onScroll:function(){a(this).flickable("scrollToSegment",c.onScroll)},onScrollPrev:function(){a(this).flickable("prevSegment",c.onScrollPrev)},onScrollNext:function(){a(this).flickable("nextSegment",c.onScrollNext)},onFlick:function(){a(this).flickable("flick",c.onFlick)},onFlickLeft:function(){a(this).flickable("flickLeft",c.onFlickLeft)},onFlickRight:function(){a(this).flickable("flickRight",c.onFlickRight)},onFlickUp:function(){a(this).flickable("flickUp",c.onFlickUp)},onFlickDown:function(){a(this).flickable("flickDown",c.onFlickDown)},touchstart:function(b){j(b);a(this).trigger("onStart")},touchmove:function(b){if(c.preventDefault){b.preventDefault()}k(b);a(this).trigger("onMove")},touchend:function(b){l(b);a(this).trigger("onEnd")}});if(!o("transform")){d=true}if(parseInt(c.flickThreshold)){f=parseInt(c.flickThreshold)}if(h||c.enableDebugger){p()}b.flickable("create",c.onCreate)}})},create:function(d){var f=a(this);b=c;e++;q("It's alive!");if(!f.attr("id")){f.attr("id","flickable"+e)}f.flickable("scrollToSegment");if(typeof d=="function"){d.call(this,e)}},start:function(c){q("Touch start");var d=a(this),e=parseInt(d.data("segment")),f=parseInt(d.data("segmentPx")),g=-(f*e);d.data("anchor",g);if(typeof c=="function"){c.call(this,b)}},segment:function(b){var c=a(this),d=parseInt(c.data("segments")),e=parseInt(c.data("segment"));if(typeof b!="undefined"){if(b>=d){b=d-1}else if(b<0){b=0}if(b!==e){c.data("segment",b).trigger("onScroll")}else{c.flickable("scrollToSegment")}}return parseInt(c.data("segment"))},move:function(c){var e=a(this),f,g,h=e.data("flickDirection"),i=parseInt(e.data("anchor")),f=i+b.delta.dist[h];if(d){if(h=="y"){e.css("top",f)}else{e.css("left",f)}}else{h=="y"?g="(0,"+f+"px,0)":g="("+f+"px,0,0)";if(typeof document.getElementById(e.attr("id")).style.webkitTransform!="undefined"){document.getElementById(e.attr("id")).style.webkitTransform="translate3d"+g}else if(typeof document.getElementById(e.attr("id")).style.mozTransform!="undefined"){document.getElementById(e.attr("id")).style.mozTransform="translate3d"+g}else{document.getElementById(e.attr("id")).style.transform="translate3d"+g}}a(this).data("pos",f);if(typeof c=="function"){c.call(this,b)}},scrollNext:function(){a(this).trigger("onScrollNext")},scrollPrev:function(){a(this).trigger("onScrollPrev")},nextSegment:function(c){q("Next segment");var d=a(this),e=parseInt(d.data("segment"))+1;d.flickable("segment",e);if(typeof c=="function"){c.call(this,b,e)}},prevSegment:function(c){q("Previous segment");var d=a(this),e=parseInt(d.data("segment"))-1;d.flickable("segment",e);if(typeof c=="function"){c.call(this,b,e)}},flick:function(c){q("You flicked");var d=a(this);switch(b.end.flick.x){case-1:d.trigger("onFlickLeft");break;case 1:d.trigger("onFlickRight");break}switch(b.end.flick.y){case-1:d.trigger("onFlickUp");break;case 1:d.trigger("onFlickDown");break}if(typeof c=="function"){c.call(this,b)}},flickLeft:function(c){q("Flicked left");var d=a(this),e=parseInt(d.data("segment"));d.trigger("onScrollNext");if(typeof c=="function"){c.call(this,b,e)}},flickRight:function(c){q("Flicked right");var d=a(this),e=parseInt(d.data("segment"));d.trigger("onScrollPrev");if(typeof c=="function"){c.call(this,b,e)}},flickUp:function(c){q("Flicked up");var d=a(this),e=parseInt(d.data("segment"));d.trigger("onScrollNext");if(typeof c=="function"){c.call(this,b,e)}},flickDown:function(c){q("Flicked down");var d=a(this),e=parseInt(d.data("segment"));d.trigger("onScrollPrev");if(typeof c=="function"){c.call(this,b,e)}},scrollToSegment:function(c){var e=a(this),f,g=e.data("flickDirection"),h=parseFloat(e.data("snapSpeed")),i=parseFloat(e.data("flickSnapSpeed")),j=parseInt(e.data("segments")),k=parseInt(e.data("segment")),l=parseInt(e.data("segmentPx")),m=-(l*k),n="ease-out";q("Sliding to segment "+k);if(b.end.flick.x||b.end.flick.y){h=i;n="cubic-bezier(0, .70, .35, 1)"}e.data("anchor",m).data("pos",m).data("segment",k);if(d){if(g=="y"){e.anim({top:m},h,n)}else{e.anim({left:m},h,n)}}else{g=="y"?f="0px, "+m+"px, 0px":f=m+"px, 0px, 0px";e.anim({translate3d:f},h,n)}if(typeof c=="function"){c.call(this,b,k)}},finished:function(c){var d=a(this),e=d.data("flickDirection"),f=parseInt(d.data("segments")),g=parseInt(d.data("segment")),h=parseInt(d.data("segmentPx")),i=parseInt(d.data("anchor")),j=parseInt(d.data("pos"));var k;j<0?k=Math.abs(Math.round(j/h)):k=0;q("Nearest segment is "+k);if(typeof c=="function"){c.call(this,b,g)}if(g==k){if(b.end.flick[e]){return d.trigger("onFlick")}}if(k==g+1){d.trigger("onScrollNext")}else if(k==g-1){d.trigger("onScrollPrev")}else{d.flickable("segment",k)}}};a.fn.flickable=function(b){if(i[b]){return i[b].apply(this,Array.prototype.slice.call(arguments,1))}else if(typeof b==="object"||!b){return i.init.apply(this,arguments)}else{a.error("Method "+b+" does not exist")}}})(Zepto)
@@ -0,0 +1,2 @@
1
+ /* Zepto v1.0rc1 - polyfill zepto event detect fx ajax form touch - zeptojs.com/license */
2
+ (function(a){String.prototype.trim===a&&(String.prototype.trim=function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}),Array.prototype.reduce===a&&(Array.prototype.reduce=function(b){if(this===void 0||this===null)throw new TypeError;var c=Object(this),d=c.length>>>0,e=0,f;if(typeof b!="function")throw new TypeError;if(d==0&&arguments.length==1)throw new TypeError;if(arguments.length>=2)f=arguments[1];else do{if(e in c){f=c[e++];break}if(++e>=d)throw new TypeError}while(!0);while(e<d)e in c&&(f=b.call(a,f,c[e],e,c)),e++;return f})})();var Zepto=function(){function A(a){return v.call(a)=="[object Function]"}function B(a){return a instanceof Object}function C(b){var c,d;if(v.call(b)!=="[object Object]")return!1;d=A(b.constructor)&&b.constructor.prototype;if(!d||!hasOwnProperty.call(d,"isPrototypeOf"))return!1;for(c in b);return c===a||hasOwnProperty.call(b,c)}function D(a){return a instanceof Array}function E(a){return typeof a.length=="number"}function F(b){return b.filter(function(b){return b!==a&&b!==null})}function G(a){return a.length>0?[].concat.apply([],a):a}function H(a){return a.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function I(a){return a in i?i[a]:i[a]=new RegExp("(^|\\s)"+a+"(\\s|$)")}function J(a,b){return typeof b=="number"&&!k[H(a)]?b+"px":b}function K(a){var b,c;return h[a]||(b=g.createElement(a),g.body.appendChild(b),c=j(b,"").getPropertyValue("display"),b.parentNode.removeChild(b),c=="none"&&(c="block"),h[a]=c),h[a]}function L(b,d){return d===a?c(b):c(b).filter(d)}function M(a,b,c,d){return A(b)?b.call(a,c,d):b}function N(a,b,d){var e=a%2?b:b.parentNode;e?e.insertBefore(d,a?a==1?e.firstChild:a==2?b:null:b.nextSibling):c(d).remove()}function O(a,b){b(a);for(var c in a.childNodes)O(a.childNodes[c],b)}var a,b,c,d,e=[],f=e.slice,g=window.document,h={},i={},j=g.defaultView.getComputedStyle,k={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},l=/^\s*<(\w+|!)[^>]*>/,m=[1,3,8,9,11],n=["after","prepend","before","append"],o=g.createElement("table"),p=g.createElement("tr"),q={tr:g.createElement("tbody"),tbody:o,thead:o,tfoot:o,td:p,th:p,"*":g.createElement("div")},r=/complete|loaded|interactive/,s=/^\.([\w-]+)$/,t=/^#([\w-]+)$/,u=/^[\w-]+$/,v={}.toString,w={},x,y,z=g.createElement("div");return w.matches=function(a,b){if(!a||a.nodeType!==1)return!1;var c=a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.matchesSelector;if(c)return c.call(a,b);var d,e=a.parentNode,f=!e;return f&&(e=z).appendChild(a),d=~w.qsa(e,b).indexOf(a),f&&z.removeChild(a),d},x=function(a){return a.replace(/-+(.)?/g,function(a,b){return b?b.toUpperCase():""})},y=function(a){return a.filter(function(b,c){return a.indexOf(b)==c})},w.fragment=function(b,d){d===a&&(d=l.test(b)&&RegExp.$1),d in q||(d="*");var e=q[d];return e.innerHTML=""+b,c.each(f.call(e.childNodes),function(){e.removeChild(this)})},w.Z=function(a,b){return a=a||[],a.__proto__=arguments.callee.prototype,a.selector=b||"",a},w.isZ=function(a){return a instanceof w.Z},w.init=function(b,d){if(!b)return w.Z();if(A(b))return c(g).ready(b);if(w.isZ(b))return b;var e;if(D(b))e=F(b);else if(C(b))e=[c.extend({},b)],b=null;else if(m.indexOf(b.nodeType)>=0||b===window)e=[b],b=null;else if(l.test(b))e=w.fragment(b.trim(),RegExp.$1),b=null;else{if(d!==a)return c(d).find(b);e=w.qsa(g,b)}return w.Z(e,b)},c=function(a,b){return w.init(a,b)},c.extend=function(c){return f.call(arguments,1).forEach(function(d){for(b in d)d[b]!==a&&(c[b]=d[b])}),c},w.qsa=function(a,b){var c;return a===g&&t.test(b)?(c=a.getElementById(RegExp.$1))?[c]:e:a.nodeType!==1&&a.nodeType!==9?e:f.call(s.test(b)?a.getElementsByClassName(RegExp.$1):u.test(b)?a.getElementsByTagName(b):a.querySelectorAll(b))},c.isFunction=A,c.isObject=B,c.isArray=D,c.isPlainObject=C,c.inArray=function(a,b,c){return e.indexOf.call(b,a,c)},c.trim=function(a){return a.trim()},c.uuid=0,c.map=function(a,b){var c,d=[],e,f;if(E(a))for(e=0;e<a.length;e++)c=b(a[e],e),c!=null&&d.push(c);else for(f in a)c=b(a[f],f),c!=null&&d.push(c);return G(d)},c.each=function(a,b){var c,d;if(E(a)){for(c=0;c<a.length;c++)if(b.call(a[c],c,a[c])===!1)return a}else for(d in a)if(b.call(a[d],d,a[d])===!1)return a;return a},c.fn={forEach:e.forEach,reduce:e.reduce,push:e.push,indexOf:e.indexOf,concat:e.concat,map:function(a){return c.map(this,function(b,c){return a.call(b,c,b)})},slice:function(){return c(f.apply(this,arguments))},ready:function(a){return r.test(g.readyState)?a(c):g.addEventListener("DOMContentLoaded",function(){a(c)},!1),this},get:function(b){return b===a?f.call(this):this[b]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){this.parentNode!=null&&this.parentNode.removeChild(this)})},each:function(a){return this.forEach(function(b,c){a.call(b,c,b)}),this},filter:function(a){return c([].filter.call(this,function(b){return w.matches(b,a)}))},add:function(a,b){return c(y(this.concat(c(a,b))))},is:function(a){return this.length>0&&w.matches(this[0],a)},not:function(b){var d=[];if(A(b)&&b.call!==a)this.each(function(a){b.call(this,a)||d.push(this)});else{var e=typeof b=="string"?this.filter(b):E(b)&&A(b.item)?f.call(b):c(b);this.forEach(function(a){e.indexOf(a)<0&&d.push(a)})}return c(d)},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){var a=this[0];return a&&!B(a)?a:c(a)},last:function(){var a=this[this.length-1];return a&&!B(a)?a:c(a)},find:function(a){var b;return this.length==1?b=w.qsa(this[0],a):b=this.map(function(){return w.qsa(this,a)}),c(b)},closest:function(a,b){var d=this[0];while(d&&!w.matches(d,a))d=d!==b&&d!==g&&d.parentNode;return c(d)},parents:function(a){var b=[],d=this;while(d.length>0)d=c.map(d,function(a){if((a=a.parentNode)&&a!==g&&b.indexOf(a)<0)return b.push(a),a});return L(b,a)},parent:function(a){return L(y(this.pluck("parentNode")),a)},children:function(a){return L(this.map(function(){return f.call(this.children)}),a)},siblings:function(a){return L(this.map(function(a,b){return f.call(b.parentNode.children).filter(function(a){return a!==b})}),a)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(a){return this.map(function(){return this[a]})},show:function(){return this.each(function(){this.style.display=="none"&&(this.style.display=null),j(this,"").getPropertyValue("display")=="none"&&(this.style.display=K(this.nodeName))})},replaceWith:function(a){return this.before(a).remove()},wrap:function(a){return this.each(function(){c(this).wrapAll(c(a)[0].cloneNode(!1))})},wrapAll:function(a){return this[0]&&(c(this[0]).before(a=c(a)),a.append(this)),this},unwrap:function(){return this.parent().each(function(){c(this).replaceWith(c(this).children())}),this},clone:function(){return c(this.map(function(){return this.cloneNode(!0)}))},hide:function(){return this.css("display","none")},toggle:function(b){return(b===a?this.css("display")=="none":b)?this.show():this.hide()},prev:function(){return c(this.pluck("previousElementSibling"))},next:function(){return c(this.pluck("nextElementSibling"))},html:function(b){return b===a?this.length>0?this[0].innerHTML:null:this.each(function(a){var d=this.innerHTML;c(this).empty().append(M(this,b,a,d))})},text:function(b){return b===a?this.length>0?this[0].textContent:null:this.each(function(){this.textContent=b})},attr:function(c,d){var e;return typeof c=="string"&&d===a?this.length==0||this[0].nodeType!==1?a:c=="value"&&this[0].nodeName=="INPUT"?this.val():!(e=this[0].getAttribute(c))&&c in this[0]?this[0][c]:e:this.each(function(a){if(this.nodeType!==1)return;if(B(c))for(b in c)this.setAttribute(b,c[b]);else this.setAttribute(c,M(this,d,a,this.getAttribute(c)))})},removeAttr:function(a){return this.each(function(){this.nodeType===1&&this.removeAttribute(a)})},prop:function(b,c){return c===a?this[0]?this[0][b]:a:this.each(function(a){this[b]=M(this,c,a,this[b])})},data:function(b,c){var d=this.attr("data-"+H(b),c);return d!==null?d:a},val:function(b){return b===a?this.length>0?this[0].value:a:this.each(function(a){this.value=M(this,b,a,this.value)})},offset:function(){if(this.length==0)return null;var a=this[0].getBoundingClientRect();return{left:a.left+window.pageXOffset,top:a.top+window.pageYOffset,width:a.width,height:a.height}},css:function(c,d){if(d===a&&typeof c=="string")return this.length==0?a:this[0].style[x(c)]||j(this[0],"").getPropertyValue(c);var e="";for(b in c)typeof c[b]=="string"&&c[b]==""?this.each(function(){this.style.removeProperty(H(b))}):e+=H(b)+":"+J(b,c[b])+";";return typeof c=="string"&&(d==""?this.each(function(){this.style.removeProperty(H(c))}):e=H(c)+":"+J(c,d)),this.each(function(){this.style.cssText+=";"+e})},index:function(a){return a?this.indexOf(c(a)[0]):this.parent().children().indexOf(this[0])},hasClass:function(a){return this.length<1?!1:I(a).test(this[0].className)},addClass:function(a){return this.each(function(b){d=[];var e=this.className,f=M(this,a,b,e);f.split(/\s+/g).forEach(function(a){c(this).hasClass(a)||d.push(a)},this),d.length&&(this.className+=(e?" ":"")+d.join(" "))})},removeClass:function(b){return this.each(function(c){if(b===a)return this.className="";d=this.className,M(this,b,c,d).split(/\s+/g).forEach(function(a){d=d.replace(I(a)," ")}),this.className=d.trim()})},toggleClass:function(b,d){return this.each(function(e){var f=M(this,b,e,this.className);(d===a?!c(this).hasClass(f):d)?c(this).addClass(f):c(this).removeClass(f)})}},["width","height"].forEach(function(b){c.fn[b]=function(d){var e,f=b.replace(/./,function(a){return a[0].toUpperCase()});return d===a?this[0]==window?window["inner"+f]:this[0]==g?g.documentElement["offset"+f]:(e=this.offset())&&e[b]:this.each(function(a){var e=c(this);e.css(b,M(this,d,a,e[b]()))})}}),n.forEach(function(a,b){c.fn[a]=function(){var a=c.map(arguments,function(a){return B(a)?a:w.fragment(a)});if(a.length<1)return this;var d=this.length,e=d>1,f=b<2;return this.each(function(c,g){for(var h=0;h<a.length;h++){var i=a[f?a.length-h-1:h];O(i,function(a){a.nodeName!=null&&a.nodeName.toUpperCase()==="SCRIPT"&&(!a.type||a.type==="text/javascript")&&window.eval.call(window,a.innerHTML)}),e&&c<d-1&&(i=i.cloneNode(!0)),N(b,g,i)}})},c.fn[b%2?a+"To":"insert"+(b?"Before":"After")]=function(b){return c(b)[a](this),this}}),w.Z.prototype=c.fn,w.camelize=x,w.uniq=y,c.zepto=w,c}();window.Zepto=Zepto,"$"in window||(window.$=Zepto),function(a){function f(a){return a._zid||(a._zid=d++)}function g(a,b,d,e){b=h(b);if(b.ns)var g=i(b.ns);return(c[f(a)]||[]).filter(function(a){return a&&(!b.e||a.e==b.e)&&(!b.ns||g.test(a.ns))&&(!d||f(a.fn)===f(d))&&(!e||a.sel==e)})}function h(a){var b=(""+a).split(".");return{e:b[0],ns:b.slice(1).sort().join(" ")}}function i(a){return new RegExp("(?:^| )"+a.replace(" "," .* ?")+"(?: |$)")}function j(b,c,d){a.isObject(b)?a.each(b,d):b.split(/\s/).forEach(function(a){d(a,c)})}function k(b,d,e,g,i,k){k=!!k;var l=f(b),m=c[l]||(c[l]=[]);j(d,e,function(c,d){var e=i&&i(d,c),f=e||d,j=function(a){var c=f.apply(b,[a].concat(a.data));return c===!1&&a.preventDefault(),c},l=a.extend(h(c),{fn:d,proxy:j,sel:g,del:e,i:m.length});m.push(l),b.addEventListener(l.e,j,k)})}function l(a,b,d,e){var h=f(a);j(b||"",d,function(b,d){g(a,b,d,e).forEach(function(b){delete c[h][b.i],a.removeEventListener(b.e,b.proxy,!1)})})}function p(b){var c=a.extend({originalEvent:b},b);return a.each(o,function(a,d){c[a]=function(){return this[d]=m,b[a].apply(b,arguments)},c[d]=n}),c}function q(a){if(!("defaultPrevented"in a)){a.defaultPrevented=!1;var b=a.preventDefault;a.preventDefault=function(){this.defaultPrevented=!0,b.call(this)}}}var b=a.zepto.qsa,c={},d=1,e={};e.click=e.mousedown=e.mouseup=e.mousemove="MouseEvents",a.event={add:k,remove:l},a.proxy=function(b,c){if(a.isFunction(b)){var d=function(){return b.apply(c,arguments)};return d._zid=f(b),d}if(typeof c=="string")return a.proxy(b[c],b);throw new TypeError("expected function")},a.fn.bind=function(a,b){return this.each(function(){k(this,a,b)})},a.fn.unbind=function(a,b){return this.each(function(){l(this,a,b)})},a.fn.one=function(a,b){return this.each(function(c,d){k(this,a,b,null,function(a,b){return function(){var c=a.apply(d,arguments);return l(d,b,a),c}})})};var m=function(){return!0},n=function(){return!1},o={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};a.fn.delegate=function(b,c,d){var e=!1;if(c=="blur"||c=="focus")a.iswebkit?c=c=="blur"?"focusout":c=="focus"?"focusin":c:e=!0;return this.each(function(f,g){k(g,c,d,b,function(c){return function(d){var e,f=a(d.target).closest(b,g).get(0);if(f)return e=a.extend(p(d),{currentTarget:f,liveFired:g}),c.apply(f,[e].concat([].slice.call(arguments,1)))}},e)})},a.fn.undelegate=function(a,b,c){return this.each(function(){l(this,b,c,a)})},a.fn.live=function(b,c){return a(document.body).delegate(this.selector,b,c),this},a.fn.die=function(b,c){return a(document.body).undelegate(this.selector,b,c),this},a.fn.on=function(b,c,d){return c==undefined||a.isFunction(c)?this.bind(b,c):this.delegate(c,b,d)},a.fn.off=function(b,c,d){return c==undefined||a.isFunction(c)?this.unbind(b,c):this.undelegate(c,b,d)},a.fn.trigger=function(b,c){return typeof b=="string"&&(b=a.Event(b)),q(b),b.data=c,this.each(function(){"dispatchEvent"in this&&this.dispatchEvent(b)})},a.fn.triggerHandler=function(b,c){var d,e;return this.each(function(f,h){d=p(typeof b=="string"?a.Event(b):b),d.data=c,d.target=h,a.each(g(h,b.type||b),function(a,b){e=b.proxy(d);if(d.isImmediatePropagationStopped())return!1})}),e},"focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout change select keydown keypress keyup error".split(" ").forEach(function(b){a.fn[b]=function(a){return this.bind(b,a)}}),["focus","blur"].forEach(function(b){a.fn[b]=function(a){if(a)this.bind(b,a);else if(this.length)try{this.get(0)[b]()}catch(c){}return this}}),a.Event=function(a,b){var c=document.createEvent(e[a]||"Events"),d=!0;if(b)for(var f in b)f=="bubbles"?d=!!b[f]:c[f]=b[f];return c.initEvent(a,d,!0,null,null,null,null,null,null,null,null,null,null,null,null),c}}(Zepto),function(a){function b(a){var b=this.os={},c=this.browser={},d=a.match(/WebKit\/([\d.]+)/),e=a.match(/(Android)\s+([\d.]+)/),f=a.match(/(iPad).*OS\s([\d_]+)/),g=!f&&a.match(/(iPhone\sOS)\s([\d_]+)/),h=a.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),i=h&&a.match(/TouchPad/),j=a.match(/Kindle\/([\d.]+)/),k=a.match(/Silk\/([\d._]+)/),l=a.match(/(BlackBerry).*Version\/([\d.]+)/);if(c.webkit=!!d)c.version=d[1];e&&(b.android=!0,b.version=e[2]),g&&(b.ios=b.iphone=!0,b.version=g[2].replace(/_/g,".")),f&&(b.ios=b.ipad=!0,b.version=f[2].replace(/_/g,".")),h&&(b.webos=!0,b.version=h[2]),i&&(b.touchpad=!0),l&&(b.blackberry=!0,b.version=l[2]),j&&(b.kindle=!0,b.version=j[1]),k&&(c.silk=!0,c.version=k[1]),!k&&b.android&&a.match(/Kindle Fire/)&&(c.silk=!0)}b.call(a,navigator.userAgent),a.__detect=b}(Zepto),function(a,b){function l(a){return a.toLowerCase()}function m(a){return d?d+a:l(a)}var c="",d,e,f,g={Webkit:"webkit",Moz:"",O:"o",ms:"MS"},h=window.document,i=h.createElement("div"),j=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i,k={};a.each(g,function(a,e){if(i.style[a+"TransitionProperty"]!==b)return c="-"+l(a)+"-",d=e,!1}),k[c+"transition-property"]=k[c+"transition-duration"]=k[c+"transition-timing-function"]=k[c+"animation-name"]=k[c+"animation-duration"]="",a.fx={off:d===b&&i.style.transitionProperty===b,cssPrefix:c,transitionEnd:m("TransitionEnd"),animationEnd:m("AnimationEnd")},a.fn.animate=function(b,c,d,e){return a.isObject(c)&&(d=c.easing,e=c.complete,c=c.duration),c&&(c/=1e3),this.anim(b,c,d,e)},a.fn.anim=function(d,e,f,g){var h,i={},l,m=this,n,o=a.fx.transitionEnd;e===b&&(e=.4),a.fx.off&&(e=0);if(typeof d=="string")i[c+"animation-name"]=d,i[c+"animation-duration"]=e+"s",o=a.fx.animationEnd;else{for(l in d)j.test(l)?(h||(h=[]),h.push(l+"("+d[l]+")")):i[l]=d[l];h&&(i[c+"transform"]=h.join(" ")),!a.fx.off&&typeof d=="object"&&(i[c+"transition-property"]=Object.keys(d).join(", "),i[c+"transition-duration"]=e+"s",i[c+"transition-timing-function"]=f||"linear")}return n=function(b){if(typeof b!="undefined"){if(b.target!==b.currentTarget)return;a(b.target).unbind(o,arguments.callee)}a(this).css(k),g&&g.call(this)},e>0&&this.bind(o,n),setTimeout(function(){m.css(i),e<=0&&setTimeout(function(){m.each(function(){n.call(this)})},0)},0),this},i=null}(Zepto),function($){function triggerAndReturn(a,b,c){var d=$.Event(b);return $(a).trigger(d,c),!d.defaultPrevented}function triggerGlobal(a,b,c,d){if(a.global)return triggerAndReturn(b||document,c,d)}function ajaxStart(a){a.global&&$.active++===0&&triggerGlobal(a,null,"ajaxStart")}function ajaxStop(a){a.global&&!--$.active&&triggerGlobal(a,null,"ajaxStop")}function ajaxBeforeSend(a,b){var c=b.context;if(b.beforeSend.call(c,a,b)===!1||triggerGlobal(b,c,"ajaxBeforeSend",[a,b])===!1)return!1;triggerGlobal(b,c,"ajaxSend",[a,b])}function ajaxSuccess(a,b,c){var d=c.context,e="success";c.success.call(d,a,e,b),triggerGlobal(c,d,"ajaxSuccess",[b,c,a]),ajaxComplete(e,b,c)}function ajaxError(a,b,c,d){var e=d.context;d.error.call(e,c,b,a),triggerGlobal(d,e,"ajaxError",[c,d,a]),ajaxComplete(b,c,d)}function ajaxComplete(a,b,c){var d=c.context;c.complete.call(d,b,a),triggerGlobal(c,d,"ajaxComplete",[b,c]),ajaxStop(c)}function empty(){}function mimeToDataType(a){return a&&(a==htmlType?"html":a==jsonType?"json":scriptTypeRE.test(a)?"script":xmlTypeRE.test(a)&&"xml")||"text"}function appendQuery(a,b){return(a+"&"+b).replace(/[&?]{1,2}/,"?")}function serializeData(a){isObject(a.data)&&(a.data=$.param(a.data)),a.data&&(!a.type||a.type.toUpperCase()=="GET")&&(a.url=appendQuery(a.url,a.data))}function serialize(a,b,c,d){var e=$.isArray(b);$.each(b,function(b,f){d&&(b=c?d:d+"["+(e?"":b)+"]"),!d&&e?a.add(f.name,f.value):(c?$.isArray(f):isObject(f))?serialize(a,f,c,b):a.add(b,f)})}var jsonpID=0,isObject=$.isObject,document=window.document,key,name,rscript=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,scriptTypeRE=/^(?:text|application)\/javascript/i,xmlTypeRE=/^(?:text|application)\/xml/i,jsonType="application/json",htmlType="text/html",blankRE=/^\s*$/;$.active=0,$.ajaxJSONP=function(a){var b="jsonp"+ ++jsonpID,c=document.createElement("script"),d=function(){$(c).remove(),b in window&&(window[b]=empty),ajaxComplete("abort",e,a)},e={abort:d},f;return a.error&&(c.onerror=function(){e.abort(),a.error()}),window[b]=function(d){clearTimeout(f),$(c).remove(),delete window[b],ajaxSuccess(d,e,a)},serializeData(a),c.src=a.url.replace(/=\?/,"="+b),$("head").append(c),a.timeout>0&&(f=setTimeout(function(){e.abort(),ajaxComplete("timeout",e,a)},a.timeout)),e},$.ajaxSettings={type:"GET",beforeSend:empty,success:empty,error:empty,complete:empty,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript",json:jsonType,xml:"application/xml, text/xml",html:htmlType,text:"text/plain"},crossDomain:!1,timeout:0},$.ajax=function(options){var settings=$.extend({},options||{});for(key in $.ajaxSettings)settings[key]===undefined&&(settings[key]=$.ajaxSettings[key]);ajaxStart(settings),settings.crossDomain||(settings.crossDomain=/^([\w-]+:)?\/\/([^\/]+)/.test(settings.url)&&RegExp.$2!=window.location.host);var dataType=settings.dataType,hasPlaceholder=/=\?/.test(settings.url);if(dataType=="jsonp"||hasPlaceholder)return hasPlaceholder||(settings.url=appendQuery(settings.url,"callback=?")),$.ajaxJSONP(settings);settings.url||(settings.url=window.location.toString()),serializeData(settings);var mime=settings.accepts[dataType],baseHeaders={},protocol=/^([\w-]+:)\/\//.test(settings.url)?RegExp.$1:window.location.protocol,xhr=$.ajaxSettings.xhr(),abortTimeout;settings.crossDomain||(baseHeaders["X-Requested-With"]="XMLHttpRequest"),mime&&(baseHeaders.Accept=mime,mime.indexOf(",")>-1&&(mime=mime.split(",",2)[0]),xhr.overrideMimeType&&xhr.overrideMimeType(mime));if(settings.contentType||settings.data&&settings.type.toUpperCase()!="GET")baseHeaders["Content-Type"]=settings.contentType||"application/x-www-form-urlencoded";settings.headers=$.extend(baseHeaders,settings.headers||{}),xhr.onreadystatechange=function(){if(xhr.readyState==4){clearTimeout(abortTimeout);var result,error=!1;if(xhr.status>=200&&xhr.status<300||xhr.status==304||xhr.status==0&&protocol=="file:"){dataType=dataType||mimeToDataType(xhr.getResponseHeader("content-type")),result=xhr.responseText;try{dataType=="script"?(1,eval)(result):dataType=="xml"?result=xhr.responseXML:dataType=="json"&&(result=blankRE.test(result)?null:JSON.parse(result))}catch(e){error=e}error?ajaxError(error,"parsererror",xhr,settings):ajaxSuccess(result,xhr,settings)}else ajaxError(null,"error",xhr,settings)}};var async="async"in settings?settings.async:!0;xhr.open(settings.type,settings.url,async);for(name in settings.headers)xhr.setRequestHeader(name,settings.headers[name]);return ajaxBeforeSend(xhr,settings)===!1?(xhr.abort(),!1):(settings.timeout>0&&(abortTimeout=setTimeout(function(){xhr.onreadystatechange=empty,xhr.abort(),ajaxError(null,"timeout",xhr,settings)},settings.timeout)),xhr.send(settings.data?settings.data:null),xhr)},$.get=function(a,b){return $.ajax({url:a,success:b})},$.post=function(a,b,c,d){return $.isFunction(b)&&(d=d||c,c=b,b=null),$.ajax({type:"POST",url:a,data:b,success:c,dataType:d})},$.getJSON=function(a,b){return $.ajax({url:a,success:b,dataType:"json"})},$.fn.load=function(a,b){if(!this.length)return this;var c=this,d=a.split(/\s/),e;return d.length>1&&(a=d[0],e=d[1]),$.get(a,function(a){c.html(e?$(document.createElement("div")).html(a.replace(rscript,"")).find(e).html():a),b&&b.call(c)}),this};var escape=encodeURIComponent;$.param=function(a,b){var c=[];return c.add=function(a,b){this.push(escape(a)+"="+escape(b))},serialize(c,a,b),c.join("&").replace("%20","+")}}(Zepto),function(a){a.fn.serializeArray=function(){var b=[],c;return a(Array.prototype.slice.call(this.get(0).elements)).each(function(){c=a(this);var d=c.attr("type");this.nodeName.toLowerCase()!="fieldset"&&!this.disabled&&d!="submit"&&d!="reset"&&d!="button"&&(d!="radio"&&d!="checkbox"||this.checked)&&b.push({name:c.attr("name"),value:c.val()})}),b},a.fn.serialize=function(){var a=[];return this.serializeArray().forEach(function(b){a.push(encodeURIComponent(b.name)+"="+encodeURIComponent(b.value))}),a.join("&")},a.fn.submit=function(b){if(b)this.bind("submit",b);else if(this.length){var c=a.Event("submit");this.eq(0).trigger(c),c.defaultPrevented||this.get(0).submit()}return this}}(Zepto),function(a){function d(a){return"tagName"in a?a:a.parentNode}function e(a,b,c,d){var e=Math.abs(a-b),f=Math.abs(c-d);return e>=f?a-b>0?"Left":"Right":c-d>0?"Up":"Down"}function h(){g=null,b.last&&(b.el.trigger("longTap"),b={})}function i(){g&&clearTimeout(g),g=null}var b={},c,f=750,g;a(document).ready(function(){var j,k;a(document.body).bind("touchstart",function(e){j=Date.now(),k=j-(b.last||j),b.el=a(d(e.touches[0].target)),c&&clearTimeout(c),b.x1=e.touches[0].pageX,b.y1=e.touches[0].pageY,k>0&&k<=250&&(b.isDoubleTap=!0),b.last=j,g=setTimeout(h,f)}).bind("touchmove",function(a){i(),b.x2=a.touches[0].pageX,b.y2=a.touches[0].pageY}).bind("touchend",function(a){i(),b.isDoubleTap?(b.el.trigger("doubleTap"),b={}):b.x2&&Math.abs(b.x1-b.x2)>30||b.y2&&Math.abs(b.y1-b.y2)>30?(b.el.trigger("swipe")&&b.el.trigger("swipe"+e(b.x1,b.x2,b.y1,b.y2)),b={}):"last"in b&&(b.el.trigger("tap"),c=setTimeout(function(){c=null,b.el.trigger("singleTap"),b={}},250))}).bind("touchcancel",function(){c&&clearTimeout(c),g&&clearTimeout(g),g=c=null,b={}})}),["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap","singleTap","longTap"].forEach(function(b){a.fn[b]=function(a){return this.bind(b,a)}})}(Zepto);
@@ -0,0 +1,178 @@
1
+ #app-container {
2
+ position: fixed;
3
+ top: 0;
4
+ right: 0;
5
+ bottom: 0;
6
+ left: 0;
7
+ }
8
+
9
+ .animate-to-view {
10
+ width: 100%;
11
+ height: 100%;
12
+ position: absolute;
13
+ top: 0px;
14
+ }
15
+
16
+ #app-container.animate {
17
+ -webkit-transition: all 0.4s;
18
+ -moz-transition: all 0.4s;
19
+ -o-transition: all 0.4s;
20
+ transition: all 0.4s;
21
+ }
22
+
23
+ #app-main, header {
24
+ -webkit-backface-visibility: hidden;
25
+ }
26
+
27
+ #app-container.animate.LEFT #app-main header.bar-title {
28
+ z-index: -1;
29
+ }
30
+
31
+ .header-animated {
32
+ -webkit-transition: all 0.4s;
33
+ -moz-transition: all 0.4s;
34
+ -o-transition: all 0.4s;
35
+ transition: all 0.4s;
36
+ width: 98%;
37
+ position: absolute;
38
+ }
39
+
40
+ .header-animated .title {
41
+ top: -5px;
42
+ }
43
+
44
+ .bar-title .title + [class*="button"]:last-child {
45
+ top: 0px;
46
+ }
47
+
48
+ #app-container.animate .header-animated {
49
+ -webkit-transform: translate3d(0, 0, 1px);
50
+ -moz-transform: translate3d(0, 0, 1px);
51
+ -ms-transform: translate3d(0, 0, 1px);
52
+ -o-transform: translate3d(0, 0, 1px);
53
+ transform: translate3d(0, 0, 1px);
54
+ }
55
+
56
+ .animate-to-view.RIGHT {
57
+ -webkit-transform: translate3d(-100%, 0, 0);
58
+ -moz-transform: translate3d(-100%, 0, 0);
59
+ -ms-transform: translate3d(-100%, 0, 0);
60
+ -o-transform: translate3d(-100%, 0, 0);
61
+ transform: translate3d(-100%, 0, 0);
62
+ }
63
+
64
+ #app-container.animate.RIGHT {
65
+ -webkit-transform: translate3d(100%, 0, 0);
66
+ -moz-transform: translate3d(100%, 0, 0);
67
+ -ms-transform: translate3d(100%, 0, 0);
68
+ -o-transform: translate3d(100%, 0, 0);
69
+ transform: translate3d(100%, 0, 0);
70
+ }
71
+
72
+ .animate-to-view.LEFT {
73
+ -webkit-transform: translate3d(100%, 0, 0);
74
+ -moz-transform: translate3d(100%, 0, 0);
75
+ -ms-transform: translate3d(100%, 0, 0);
76
+ -o-transform: translate3d(100%, 0, 0);
77
+ transform: translate3d(100%, 0, 0);
78
+ }
79
+
80
+ #app-container.animate.LEFT {
81
+ -webkit-transform: translate3d(-100%, 0, 0);
82
+ -moz-transform: translate3d(-100%, 0, 0);
83
+ -ms-transform: translate3d(-100%, 0, 0);
84
+ -o-transform: translate3d(-100%, 0, 0);
85
+ transform: translate3d(-100%, 0, 0);
86
+ }
87
+
88
+ #app-container.animate.LEFT #app-main .header-animated {
89
+ -webkit-transform: translate3d(50%, 0, 0);
90
+ -moz-transform: translate3d(50%, 0, 0);
91
+ -ms-transform: translate3d(50%, 0, 0);
92
+ -o-transform: translate3d(50%, 0, 0);
93
+ transform: translate3d(50%, 0, 0);
94
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
95
+ opacity: 0;
96
+ }
97
+
98
+ .animate-to-view.LEFT.initial .header-animated {
99
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
100
+ opacity: 0;
101
+ }
102
+
103
+ #app-container.animate.RIGHT #app-main .header-animated {
104
+ -webkit-transform: translate3d(-50%, 0, 0);
105
+ -moz-transform: translate3d(-50%, 0, 0);
106
+ -ms-transform: translate3d(-50%, 0, 0);
107
+ -o-transform: translate3d(-50%, 0, 0);
108
+ transform: translate3d(-50%, 0, 0);
109
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
110
+ opacity: 0;
111
+ }
112
+
113
+ .animate-to-view.RIGHT.initial .header-animated {
114
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
115
+ opacity: 0;
116
+ }
117
+
118
+ .animate-to-view.UP {
119
+ -webkit-transform: translate3d(0, 100%, 0);
120
+ -moz-transform: translate3d(0, 100%, 0);
121
+ -ms-transform: translate3d(0, 100%, 0);
122
+ -o-transform: translate3d(0, 100%, 0);
123
+ transform: translate3d(0, 100%, 0);
124
+ }
125
+
126
+ #app-container.animate.UP {
127
+ -webkit-transform: translate3d(0, -100%, 0);
128
+ -moz-transform: translate3d(0, -100%, 0);
129
+ -ms-transform: translate3d(0, -100%, 0);
130
+ -o-transform: translate3d(0, -100%, 0);
131
+ transform: translate3d(0, -100%, 0);
132
+ }
133
+
134
+ #app-container.animate.UP #app-main .header-animated {
135
+ -webkit-transform: translate3d(0, -50% 0);
136
+ -moz-transform: translate3d(0, -50% 0);
137
+ -ms-transform: translate3d(0, -50% 0);
138
+ -o-transform: translate3d(0, -50% 0);
139
+ transform: translate3d(0, -50% 0);
140
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
141
+ opacity: 0;
142
+ }
143
+
144
+ .animate-to-view.UP.initial .header-animated {
145
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
146
+ opacity: 0;
147
+ }
148
+
149
+ .animate-to-view.DOWN {
150
+ -webkit-transform: translate3d(0, -100%, 0);
151
+ -moz-transform: translate3d(0, -100%, 0);
152
+ -ms-transform: translate3d(0, -100%, 0);
153
+ -o-transform: translate3d(0, -100%, 0);
154
+ transform: translate3d(0, -100%, 0);
155
+ }
156
+
157
+ #app-container.animate.DOWN {
158
+ -webkit-transform: translate3d(0, 100%, 0);
159
+ -moz-transform: translate3d(0, 100%, 0);
160
+ -ms-transform: translate3d(0, 100%, 0);
161
+ -o-transform: translate3d(0, 100%, 0);
162
+ transform: translate3d(0, 100%, 0);
163
+ }
164
+
165
+ #app-container.animate.DOWN #app-main .header-animated {
166
+ -webkit-transform: translate3d(0, 50% 0);
167
+ -moz-transform: translate3d(0, 50% 0);
168
+ -ms-transform: translate3d(0, 50% 0);
169
+ -o-transform: translate3d(0, 50% 0);
170
+ transform: translate3d(0, 50% 0);
171
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
172
+ opacity: 0;
173
+ }
174
+
175
+ .animate-to-view.DOWN.initial .header-animated {
176
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
177
+ opacity: 0;
178
+ }