Skip to content
Browse files

Pushing version 0.7.5

  • Loading branch information...
1 parent d456f7b commit ec821bbdd1cab46918c4a86a70c5055508258af8 @endor endor committed
Showing with 221 additions and 227 deletions.
  1. +2 −0 HISTORY.md
  2. +0 −6 lib/min/plugins/sammy.cache-0.7.4.min.js
  3. +5 −0 lib/min/plugins/sammy.cache-0.7.5.min.js
  4. +3 −4 lib/min/plugins/sammy.cache-latest.min.js
  5. +0 −5 lib/min/plugins/sammy.data_location_proxy-0.7.4.min.js
  6. +5 −0 lib/min/plugins/sammy.data_location_proxy-0.7.5.min.js
  7. +3 −3 lib/min/plugins/sammy.data_location_proxy-latest.min.js
  8. +0 −5 lib/min/plugins/sammy.ejs-0.7.4.min.js
  9. +5 −0 lib/min/plugins/sammy.ejs-0.7.5.min.js
  10. +3 −3 lib/min/plugins/sammy.ejs-latest.min.js
  11. +0 −5 lib/min/plugins/sammy.exceptional-0.7.4.min.js
  12. +5 −0 lib/min/plugins/sammy.exceptional-0.7.5.min.js
  13. +3 −3 lib/min/plugins/sammy.exceptional-latest.min.js
  14. +0 −5 lib/min/plugins/sammy.flash-0.7.4.min.js
  15. +5 −0 lib/min/plugins/sammy.flash-0.7.5.min.js
  16. +3 −3 lib/min/plugins/sammy.flash-latest.min.js
  17. +0 −5 lib/min/plugins/sammy.form-0.7.4.min.js
  18. +5 −0 lib/min/plugins/sammy.form-0.7.5.min.js
  19. +3 −3 lib/min/plugins/sammy.form-latest.min.js
  20. +0 −5 lib/min/plugins/sammy.form_2_json-0.7.4.min.js
  21. +5 −0 lib/min/plugins/sammy.form_2_json-0.7.5.min.js
  22. +3 −3 lib/min/plugins/sammy.form_2_json-latest.min.js
  23. +0 −5 lib/min/plugins/sammy.googleanalytics-0.7.4.min.js
  24. +5 −0 lib/min/plugins/sammy.googleanalytics-0.7.5.min.js
  25. +3 −3 lib/min/plugins/sammy.googleanalytics-latest.min.js
  26. +0 −5 lib/min/plugins/sammy.haml-0.7.4.min.js
  27. +5 −0 lib/min/plugins/sammy.haml-0.7.5.min.js
  28. +3 −3 lib/min/plugins/sammy.haml-latest.min.js
  29. +0 −5 lib/min/plugins/sammy.handlebars-0.7.4.min.js
  30. +5 −0 lib/min/plugins/sammy.handlebars-0.7.5.min.js
  31. +3 −3 lib/min/plugins/sammy.handlebars-latest.min.js
  32. +0 −5 lib/min/plugins/sammy.hogan-0.7.4.min.js
  33. +5 −0 lib/min/plugins/sammy.hogan-0.7.5.min.js
  34. +3 −3 lib/min/plugins/sammy.hogan-latest.min.js
  35. +0 −5 lib/min/plugins/sammy.hoptoad-0.7.4.min.js
  36. +5 −0 lib/min/plugins/sammy.hoptoad-0.7.5.min.js
  37. +3 −3 lib/min/plugins/sammy.hoptoad-latest.min.js
  38. +0 −5 lib/min/plugins/sammy.json-0.7.4.min.js
  39. +5 −0 lib/min/plugins/sammy.json-0.7.5.min.js
  40. +3 −3 lib/min/plugins/sammy.json-latest.min.js
  41. +0 −5 lib/min/plugins/sammy.kissmetrics-0.7.4.min.js
  42. +5 −0 lib/min/plugins/sammy.kissmetrics-0.7.5.min.js
  43. +3 −3 lib/min/plugins/sammy.kissmetrics-latest.min.js
  44. +0 −5 lib/min/plugins/sammy.meld-0.7.4.min.js
  45. +5 −0 lib/min/plugins/sammy.meld-0.7.5.min.js
  46. +3 −3 lib/min/plugins/sammy.meld-latest.min.js
  47. +0 −5 lib/min/plugins/sammy.mixpanel-0.7.4.min.js
  48. +5 −0 lib/min/plugins/sammy.mixpanel-0.7.5.min.js
  49. +3 −3 lib/min/plugins/sammy.mixpanel-latest.min.js
  50. +0 −5 lib/min/plugins/sammy.mustache-0.7.4.min.js
  51. +5 −0 lib/min/plugins/sammy.mustache-0.7.5.min.js
  52. +3 −3 lib/min/plugins/sammy.mustache-latest.min.js
  53. +0 −5 lib/min/plugins/sammy.nested_params-0.7.4.min.js
  54. +5 −0 lib/min/plugins/sammy.nested_params-0.7.5.min.js
  55. +3 −3 lib/min/plugins/sammy.nested_params-latest.min.js
  56. +0 −5 lib/min/plugins/sammy.oauth2-0.7.4.min.js
  57. +5 −0 lib/min/plugins/sammy.oauth2-0.7.5.min.js
  58. +3 −3 lib/min/plugins/sammy.oauth2-latest.min.js
  59. +0 −5 lib/min/plugins/sammy.path_location_proxy-0.7.4.min.js
  60. +5 −0 lib/min/plugins/sammy.path_location_proxy-0.7.5.min.js
  61. +3 −3 lib/min/plugins/sammy.path_location_proxy-latest.min.js
  62. +0 −5 lib/min/plugins/sammy.pure-0.7.4.min.js
  63. +5 −0 lib/min/plugins/sammy.pure-0.7.5.min.js
  64. +3 −3 lib/min/plugins/sammy.pure-latest.min.js
  65. +0 −5 lib/min/plugins/sammy.push_location_proxy-0.7.4.min.js
  66. +5 −0 lib/min/plugins/sammy.push_location_proxy-0.7.5.min.js
  67. +3 −3 lib/min/plugins/sammy.push_location_proxy-latest.min.js
  68. +0 −5 lib/min/plugins/sammy.storage-0.7.4.min.js
  69. +5 −0 lib/min/plugins/sammy.storage-0.7.5.min.js
  70. +3 −3 lib/min/plugins/sammy.storage-latest.min.js
  71. +0 −5 lib/min/plugins/sammy.template-0.7.4.min.js
  72. +5 −0 lib/min/plugins/sammy.template-0.7.5.min.js
  73. +3 −3 lib/min/plugins/sammy.template-latest.min.js
  74. +0 −5 lib/min/plugins/sammy.title-0.7.4.min.js
  75. +5 −0 lib/min/plugins/sammy.title-0.7.5.min.js
  76. +3 −3 lib/min/plugins/sammy.title-latest.min.js
  77. +0 −5 lib/min/plugins/sammy.tmpl-0.7.4.min.js
  78. +5 −0 lib/min/plugins/sammy.tmpl-0.7.5.min.js
  79. +3 −3 lib/min/plugins/sammy.tmpl-latest.min.js
  80. +0 −8 lib/min/sammy-0.7.4.min.js
  81. +5 −0 lib/min/sammy-0.7.5.min.js
  82. +3 −6 lib/min/sammy-latest.min.js
  83. +2 −2 lib/sammy.js
  84. +1 −1 package.json
View
2 HISTORY.md
@@ -1,3 +1,5 @@
+== 0.7.5 [2/22/2014]
+
New:
- Allow for different selectors in the push location proxy and only bind them within the app's element [kevingessner]
View
6 lib/min/plugins/sammy.cache-0.7.4.min.js
@@ -1,6 +0,0 @@
-// -- Sammy.js -- /plugins/sammy.cache.js
-// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:12 -0500
-// deprecated
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).MemoryCacheProxy=e(window.jQuery,window.Sammy)})(function(e,t){return t.MemoryCacheProxy=function(e){this._cache=e||{}},e.extend(t.MemoryCacheProxy.prototype,{exists:function(e){return typeof this._cache[e]!="undefined"},set:function(e,t){return this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(e){delete this._cache[e]}}),t.DataCacheProxy=function(t,n){t=t||{},this.$element=n,e.each(t,function(e,t){n.data("cache."+e,t)})},e.extend(t.DataCacheProxy.prototype,{exists:function(e){return typeof this.$element.data("cache."+e)!="undefined"},set:function(e,t){return this.$element.data("cache."+e,t)},get:function(e){return this.$element.data("cache."+e)},clear:function(e){this.$element.removeData("cache."+e)}}),t.Cache=function(n,r){n.log("**WARNING:** This version of Sammy.Cache has been deprecated in favor of using the version in Sammy.Storage and will be removed in 1.0"),r=="data"?this.cache_proxy=new t.DataCacheProxy({},this.$element()):this.cache_proxy=new t.MemoryCacheProxy({}),n.cache_partials=!0,e.extend(n,{cache:function(t,n){return typeof n=="undefined"?this.cache_proxy.get(t):e.isFunction(n)&&!this.cache_proxy.exists(t)?this.cache_proxy.set(t,n.apply(this)):this.cache_proxy.set(t,n)},clearCache:function(e){return this.cache_proxy.clear(e)}}),n.helpers({cache:function(e,t){return this.app.cache(e,t)}})},t.MemoryCacheProxy});
View
5 lib/min/plugins/sammy.cache-0.7.5.min.js
@@ -0,0 +1,5 @@
+// -- Sammy.js -- /plugins/sammy.cache.js
+// http://sammyjs.org
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:10 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).MemoryCacheProxy=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.MemoryCacheProxy=function(initial){this._cache=initial||{}};$.extend(Sammy.MemoryCacheProxy.prototype,{exists:function(name){return typeof this._cache[name]!="undefined"},set:function(name,value){return this._cache[name]=value},get:function(name){return this._cache[name]},clear:function(name){delete this._cache[name]}});Sammy.DataCacheProxy=function(initial,$element){initial=initial||{};this.$element=$element;$.each(initial,function(key,value){$element.data("cache."+key,value)})};$.extend(Sammy.DataCacheProxy.prototype,{exists:function(name){return typeof this.$element.data("cache."+name)!="undefined"},set:function(name,value){return this.$element.data("cache."+name,value)},get:function(name){return this.$element.data("cache."+name)},clear:function(name){this.$element.removeData("cache."+name)}});Sammy.Cache=function(app,proxy){app.log("**WARNING:** This version of Sammy.Cache has been deprecated in favor of using the version in Sammy.Storage and will be removed in 1.0");if(proxy=="data"){this.cache_proxy=new Sammy.DataCacheProxy({},this.$element())}else{this.cache_proxy=new Sammy.MemoryCacheProxy({})}app.cache_partials=true;$.extend(app,{cache:function(name,value){if(typeof value=="undefined"){return this.cache_proxy.get(name)}else if($.isFunction(value)&&!this.cache_proxy.exists(name)){return this.cache_proxy.set(name,value.apply(this))}else{return this.cache_proxy.set(name,value)}},clearCache:function(name){return this.cache_proxy.clear(name)}});app.helpers({cache:function(name,value){return this.app.cache(name,value)}})};return Sammy.MemoryCacheProxy});
View
7 lib/min/plugins/sammy.cache-latest.min.js
@@ -1,6 +1,5 @@
// -- Sammy.js -- /plugins/sammy.cache.js
// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:12 -0500
-// deprecated
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).MemoryCacheProxy=e(window.jQuery,window.Sammy)})(function(e,t){return t.MemoryCacheProxy=function(e){this._cache=e||{}},e.extend(t.MemoryCacheProxy.prototype,{exists:function(e){return typeof this._cache[e]!="undefined"},set:function(e,t){return this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(e){delete this._cache[e]}}),t.DataCacheProxy=function(t,n){t=t||{},this.$element=n,e.each(t,function(e,t){n.data("cache."+e,t)})},e.extend(t.DataCacheProxy.prototype,{exists:function(e){return typeof this.$element.data("cache."+e)!="undefined"},set:function(e,t){return this.$element.data("cache."+e,t)},get:function(e){return this.$element.data("cache."+e)},clear:function(e){this.$element.removeData("cache."+e)}}),t.Cache=function(n,r){n.log("**WARNING:** This version of Sammy.Cache has been deprecated in favor of using the version in Sammy.Storage and will be removed in 1.0"),r=="data"?this.cache_proxy=new t.DataCacheProxy({},this.$element()):this.cache_proxy=new t.MemoryCacheProxy({}),n.cache_partials=!0,e.extend(n,{cache:function(t,n){return typeof n=="undefined"?this.cache_proxy.get(t):e.isFunction(n)&&!this.cache_proxy.exists(t)?this.cache_proxy.set(t,n.apply(this)):this.cache_proxy.set(t,n)},clearCache:function(e){return this.cache_proxy.clear(e)}}),n.helpers({cache:function(e,t){return this.app.cache(e,t)}})},t.MemoryCacheProxy});
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:10 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).MemoryCacheProxy=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.MemoryCacheProxy=function(initial){this._cache=initial||{}};$.extend(Sammy.MemoryCacheProxy.prototype,{exists:function(name){return typeof this._cache[name]!="undefined"},set:function(name,value){return this._cache[name]=value},get:function(name){return this._cache[name]},clear:function(name){delete this._cache[name]}});Sammy.DataCacheProxy=function(initial,$element){initial=initial||{};this.$element=$element;$.each(initial,function(key,value){$element.data("cache."+key,value)})};$.extend(Sammy.DataCacheProxy.prototype,{exists:function(name){return typeof this.$element.data("cache."+name)!="undefined"},set:function(name,value){return this.$element.data("cache."+name,value)},get:function(name){return this.$element.data("cache."+name)},clear:function(name){this.$element.removeData("cache."+name)}});Sammy.Cache=function(app,proxy){app.log("**WARNING:** This version of Sammy.Cache has been deprecated in favor of using the version in Sammy.Storage and will be removed in 1.0");if(proxy=="data"){this.cache_proxy=new Sammy.DataCacheProxy({},this.$element())}else{this.cache_proxy=new Sammy.MemoryCacheProxy({})}app.cache_partials=true;$.extend(app,{cache:function(name,value){if(typeof value=="undefined"){return this.cache_proxy.get(name)}else if($.isFunction(value)&&!this.cache_proxy.exists(name)){return this.cache_proxy.set(name,value.apply(this))}else{return this.cache_proxy.set(name,value)}},clearCache:function(name){return this.cache_proxy.clear(name)}});app.helpers({cache:function(name,value){return this.app.cache(name,value)}})};return Sammy.MemoryCacheProxy});
View
5 lib/min/plugins/sammy.data_location_proxy-0.7.4.min.js
@@ -1,5 +0,0 @@
-// -- Sammy.js -- /plugins/sammy.data_location_proxy.js
-// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:12 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).DataLocationProxy=e(window.jQuery,window.Sammy)})(function(e,t){return t.DataLocationProxy=function(e,t,n){this.app=e,this.data_name=t||"sammy-location",this.href_attribute=n},e.extend(t.DataLocationProxy.prototype,{bind:function(){var t=this;this.app.$element().bind("setData",function(n,r,i){r==t.data_name&&(t.app.$element().each(function(){e.data(this,t.data_name,i)}),t.app.trigger("location-changed"))}),this.href_attribute&&this.app.$element().delegate("["+this.href_attribute+"]","click",function(n){n.preventDefault(),t.setLocation(e(this).attr(t.href_attribute))})},unbind:function(){this.href_attribute&&this.app.$element().undelegate("["+this.href_attribute+"]","click"),this.app.$element().unbind("setData")},getLocation:function(){return this.app.$element().data(this.data_name)||""},setLocation:function(e){return this.app.$element().data(this.data_name,e)}}),t.DataLocationProxy});
View
5 lib/min/plugins/sammy.data_location_proxy-0.7.5.min.js
@@ -0,0 +1,5 @@
+// -- Sammy.js -- /plugins/sammy.data_location_proxy.js
+// http://sammyjs.org
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:10 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).DataLocationProxy=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.DataLocationProxy=function(app,data_name,href_attribute){this.app=app;this.data_name=data_name||"sammy-location";this.href_attribute=href_attribute};$.extend(Sammy.DataLocationProxy.prototype,{bind:function(){var proxy=this;this.app.$element().bind("setData",function(e,key,value){if(key==proxy.data_name){proxy.app.$element().each(function(){$.data(this,proxy.data_name,value)});proxy.app.trigger("location-changed")}});if(this.href_attribute){this.app.$element().delegate("["+this.href_attribute+"]","click",function(e){e.preventDefault();proxy.setLocation($(this).attr(proxy.href_attribute))})}},unbind:function(){if(this.href_attribute){this.app.$element().undelegate("["+this.href_attribute+"]","click")}this.app.$element().unbind("setData")},getLocation:function(){return this.app.$element().data(this.data_name)||""},setLocation:function(new_location){return this.app.$element().data(this.data_name,new_location)}});return Sammy.DataLocationProxy});
View
6 lib/min/plugins/sammy.data_location_proxy-latest.min.js
@@ -1,5 +1,5 @@
// -- Sammy.js -- /plugins/sammy.data_location_proxy.js
// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:12 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).DataLocationProxy=e(window.jQuery,window.Sammy)})(function(e,t){return t.DataLocationProxy=function(e,t,n){this.app=e,this.data_name=t||"sammy-location",this.href_attribute=n},e.extend(t.DataLocationProxy.prototype,{bind:function(){var t=this;this.app.$element().bind("setData",function(n,r,i){r==t.data_name&&(t.app.$element().each(function(){e.data(this,t.data_name,i)}),t.app.trigger("location-changed"))}),this.href_attribute&&this.app.$element().delegate("["+this.href_attribute+"]","click",function(n){n.preventDefault(),t.setLocation(e(this).attr(t.href_attribute))})},unbind:function(){this.href_attribute&&this.app.$element().undelegate("["+this.href_attribute+"]","click"),this.app.$element().unbind("setData")},getLocation:function(){return this.app.$element().data(this.data_name)||""},setLocation:function(e){return this.app.$element().data(this.data_name,e)}}),t.DataLocationProxy});
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:10 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).DataLocationProxy=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.DataLocationProxy=function(app,data_name,href_attribute){this.app=app;this.data_name=data_name||"sammy-location";this.href_attribute=href_attribute};$.extend(Sammy.DataLocationProxy.prototype,{bind:function(){var proxy=this;this.app.$element().bind("setData",function(e,key,value){if(key==proxy.data_name){proxy.app.$element().each(function(){$.data(this,proxy.data_name,value)});proxy.app.trigger("location-changed")}});if(this.href_attribute){this.app.$element().delegate("["+this.href_attribute+"]","click",function(e){e.preventDefault();proxy.setLocation($(this).attr(proxy.href_attribute))})}},unbind:function(){if(this.href_attribute){this.app.$element().undelegate("["+this.href_attribute+"]","click")}this.app.$element().unbind("setData")},getLocation:function(){return this.app.$element().data(this.data_name)||""},setLocation:function(new_location){return this.app.$element().data(this.data_name,new_location)}});return Sammy.DataLocationProxy});
View
5 lib/min/plugins/sammy.ejs-0.7.4.min.js
@@ -1,5 +0,0 @@
-// -- Sammy.js -- /plugins/sammy.ejs.js
-// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:12 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy","ejs"],e):(window.Sammy=window.Sammy||{}).EJS=e(window.jQuery,window.Sammy,window.EJS)})(function(e,t,n){return t.EJS=function(e,t){var r=function(e,t,r){return typeof r=="undefined"&&(r=e),(new n({text:e,name:r})).render(t)};t||(t="ejs"),e.helper(t,r)},t.EJS});
View
5 lib/min/plugins/sammy.ejs-0.7.5.min.js
@@ -0,0 +1,5 @@
+// -- Sammy.js -- /plugins/sammy.ejs.js
+// http://sammyjs.org
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:11 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy","ejs"],factory)}else{(window.Sammy=window.Sammy||{}).EJS=factory(window.jQuery,window.Sammy,window.EJS)}})(function($,Sammy,EJS){Sammy.EJS=function(app,method_alias){var template=function(template,data,name){if(typeof name=="undefined"){name=template}return new EJS({text:template,name:name}).render(data)};if(!method_alias){method_alias="ejs"}app.helper(method_alias,template)};return Sammy.EJS});
View
6 lib/min/plugins/sammy.ejs-latest.min.js
@@ -1,5 +1,5 @@
// -- Sammy.js -- /plugins/sammy.ejs.js
// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:12 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy","ejs"],e):(window.Sammy=window.Sammy||{}).EJS=e(window.jQuery,window.Sammy,window.EJS)})(function(e,t,n){return t.EJS=function(e,t){var r=function(e,t,r){return typeof r=="undefined"&&(r=e),(new n({text:e,name:r})).render(t)};t||(t="ejs"),e.helper(t,r)},t.EJS});
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:11 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy","ejs"],factory)}else{(window.Sammy=window.Sammy||{}).EJS=factory(window.jQuery,window.Sammy,window.EJS)}})(function($,Sammy,EJS){Sammy.EJS=function(app,method_alias){var template=function(template,data,name){if(typeof name=="undefined"){name=template}return new EJS({text:template,name:name}).render(data)};if(!method_alias){method_alias="ejs"}app.helper(method_alias,template)};return Sammy.EJS});
View
5 lib/min/plugins/sammy.exceptional-0.7.4.min.js
@@ -1,5 +0,0 @@
-// -- Sammy.js -- /plugins/sammy.exceptional.js
-// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:12 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).Exceptional=e(window.jQuery,window.Sammy)})(function(e,t){return t.Exceptional=function(e,t){t=t||window.Exceptional,e.bind("error",function(e,n){n&&n.error&&t.handle(n.error.message,window.location.href,"0")})},t.Exceptional});
View
5 lib/min/plugins/sammy.exceptional-0.7.5.min.js
@@ -0,0 +1,5 @@
+// -- Sammy.js -- /plugins/sammy.exceptional.js
+// http://sammyjs.org
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:11 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).Exceptional=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.Exceptional=function(app,errorReporter){errorReporter=errorReporter||window.Exceptional;app.bind("error",function(e,data){if(data&&data.error){errorReporter.handle(data.error.message,window.location.href,"0")}})};return Sammy.Exceptional});
View
6 lib/min/plugins/sammy.exceptional-latest.min.js
@@ -1,5 +1,5 @@
// -- Sammy.js -- /plugins/sammy.exceptional.js
// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:12 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).Exceptional=e(window.jQuery,window.Sammy)})(function(e,t){return t.Exceptional=function(e,t){t=t||window.Exceptional,e.bind("error",function(e,n){n&&n.error&&t.handle(n.error.message,window.location.href,"0")})},t.Exceptional});
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:11 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).Exceptional=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.Exceptional=function(app,errorReporter){errorReporter=errorReporter||window.Exceptional;app.bind("error",function(e,data){if(data&&data.error){errorReporter.handle(data.error.message,window.location.href,"0")}})};return Sammy.Exceptional});
View
5 lib/min/plugins/sammy.flash-0.7.4.min.js
@@ -1,5 +0,0 @@
-// -- Sammy.js -- /plugins/sammy.flash.js
-// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:12 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).Flash=e(window.jQuery,window.Sammy)})(function(e,t){return t.FlashHash=function(){this.now={}},e.extend(t.FlashHash.prototype,{toHTML:function(){var e=this._renderUL();return this.clear(),e},clear:function(){this._clearHash(this),this._clearHash(this.now)},_onRedirect:function(){this._clearHash(this.now)},_clearHash:function(e){var t;for(t in e)t!=="now"&&e.hasOwnProperty(t)&&delete e[t]},_renderUL:function(){return'<ul class="flash">'+this._renderLIs(this)+this._renderLIs(this.now)+"</ul>"},_renderLIs:function(e){var n="",r;for(r in e)e[r]&&r!=="now"&&e.hasOwnProperty(r)&&(n=n+'<li class="'+r+'">'+e[r]+"</li>");return t.log("rendered flash: "+n),n}}),t.Flash=function(e){e.flash=new t.FlashHash,e.helper("flash",function(e,t){return arguments.length===0?this.app.flash:(arguments.length===2&&(this.app.flash[e]=t),this.app.flash[e])}),e.helper("flashNow",function(e,t){return arguments.length===0?this.app.flash.now:(arguments.length===2&&(this.app.flash.now[e]=t),this.app.flash.now[e])}),e.bind("redirect",function(){this.app.flash._onRedirect()})},t.Flash});
View
5 lib/min/plugins/sammy.flash-0.7.5.min.js
@@ -0,0 +1,5 @@
+// -- Sammy.js -- /plugins/sammy.flash.js
+// http://sammyjs.org
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:11 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).Flash=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.FlashHash=function(){this.now={}};$.extend(Sammy.FlashHash.prototype,{toHTML:function(){var result=this._renderUL();this.clear();return result},clear:function(){this._clearHash(this);this._clearHash(this.now)},_onRedirect:function(){this._clearHash(this.now)},_clearHash:function(hash){var key;for(key in hash){if(key!=="now"&&hash.hasOwnProperty(key)){delete hash[key]}}},_renderUL:function(){return'<ul class="flash">'+this._renderLIs(this)+this._renderLIs(this.now)+"</ul>"},_renderLIs:function(hash){var result="",key;for(key in hash){if(hash[key]&&key!=="now"&&hash.hasOwnProperty(key)){result=result+'<li class="'+key+'">'+hash[key]+"</li>"}}Sammy.log("rendered flash: "+result);return result}});Sammy.Flash=function(app){app.flash=new Sammy.FlashHash;app.helper("flash",function(key,value){if(arguments.length===0){return this.app.flash}else if(arguments.length===2){this.app.flash[key]=value}return this.app.flash[key]});app.helper("flashNow",function(key,value){if(arguments.length===0){return this.app.flash.now}else if(arguments.length===2){this.app.flash.now[key]=value}return this.app.flash.now[key]});app.bind("redirect",function(){this.app.flash._onRedirect()})};return Sammy.Flash});
View
6 lib/min/plugins/sammy.flash-latest.min.js
@@ -1,5 +1,5 @@
// -- Sammy.js -- /plugins/sammy.flash.js
// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:12 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).Flash=e(window.jQuery,window.Sammy)})(function(e,t){return t.FlashHash=function(){this.now={}},e.extend(t.FlashHash.prototype,{toHTML:function(){var e=this._renderUL();return this.clear(),e},clear:function(){this._clearHash(this),this._clearHash(this.now)},_onRedirect:function(){this._clearHash(this.now)},_clearHash:function(e){var t;for(t in e)t!=="now"&&e.hasOwnProperty(t)&&delete e[t]},_renderUL:function(){return'<ul class="flash">'+this._renderLIs(this)+this._renderLIs(this.now)+"</ul>"},_renderLIs:function(e){var n="",r;for(r in e)e[r]&&r!=="now"&&e.hasOwnProperty(r)&&(n=n+'<li class="'+r+'">'+e[r]+"</li>");return t.log("rendered flash: "+n),n}}),t.Flash=function(e){e.flash=new t.FlashHash,e.helper("flash",function(e,t){return arguments.length===0?this.app.flash:(arguments.length===2&&(this.app.flash[e]=t),this.app.flash[e])}),e.helper("flashNow",function(e,t){return arguments.length===0?this.app.flash.now:(arguments.length===2&&(this.app.flash.now[e]=t),this.app.flash.now[e])}),e.bind("redirect",function(){this.app.flash._onRedirect()})},t.Flash});
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:11 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).Flash=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.FlashHash=function(){this.now={}};$.extend(Sammy.FlashHash.prototype,{toHTML:function(){var result=this._renderUL();this.clear();return result},clear:function(){this._clearHash(this);this._clearHash(this.now)},_onRedirect:function(){this._clearHash(this.now)},_clearHash:function(hash){var key;for(key in hash){if(key!=="now"&&hash.hasOwnProperty(key)){delete hash[key]}}},_renderUL:function(){return'<ul class="flash">'+this._renderLIs(this)+this._renderLIs(this.now)+"</ul>"},_renderLIs:function(hash){var result="",key;for(key in hash){if(hash[key]&&key!=="now"&&hash.hasOwnProperty(key)){result=result+'<li class="'+key+'">'+hash[key]+"</li>"}}Sammy.log("rendered flash: "+result);return result}});Sammy.Flash=function(app){app.flash=new Sammy.FlashHash;app.helper("flash",function(key,value){if(arguments.length===0){return this.app.flash}else if(arguments.length===2){this.app.flash[key]=value}return this.app.flash[key]});app.helper("flashNow",function(key,value){if(arguments.length===0){return this.app.flash.now}else if(arguments.length===2){this.app.flash.now[key]=value}return this.app.flash.now[key]});app.bind("redirect",function(){this.app.flash._onRedirect()})};return Sammy.Flash});
View
5 lib/min/plugins/sammy.form-0.7.4.min.js
@@ -1,5 +0,0 @@
-// -- Sammy.js -- /plugins/sammy.form.js
-// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:12 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).Form=e(window.jQuery,window.Sammy)})(function(e,t){function n(t,n){return typeof n=="undefined"?"":(e.isFunction(n)&&(n=n.apply(t)),n.toString())}function r(t,r,i){var s="<";return s+=t,typeof r!="undefined"&&e.each(r,function(e,t){t!==null&&(s+=" "+e+"='",s+=n(r,t).replace(/\'/g,"'"),s+="'")}),i===!1?s+=">":typeof i!="undefined"?(s+=">",s+=n(this,i),s+="</"+t+">"):s+=" />",s}return t.FormBuilder=function(e,t){this.name=e,this.object=t},e.extend(t.FormBuilder.prototype,{open:function(t){return r("form",e.extend({method:"post",action:"#/"+this.name+"s"},t),!1)},close:function(){return"</form>"},label:function(t,n,i){var s={"for":this._attributesForKeyPath(t).name};return r("label",e.extend(s,i),n)},hidden:function(t,n){return n=e.extend({type:"hidden"},this._attributesForKeyPath(t),n),r("input",n)},text:function(t,n){return n=e.extend({type:"text"},this._attributesForKeyPath(t),n),r("input",n)},textarea:function(t,n){var i;return n=e.extend(this._attributesForKeyPath(t),n),i=n.value,delete n.value,r("textarea",n,i)},password:function(t,n){return this.text(t,e.extend({type:"password"},n))},select:function(t,i,s){var o="",u;return s=e.extend(this._attributesForKeyPath(t),s),u=s.value,delete s.value,e.each(i,function(t,i){var s,a,f;e.isArray(i)?(s=i[1],a=i[0]):(s=i,a=i),f={value:n(this.object,s)},s===u&&(f.selected="selected"),o+=r("option",f,a)}),r("select",s,o)},radio:function(t,i,s){var o;return s=e.extend(this._attributesForKeyPath(t),s),o=s.value,s.value=n(this.object,i),o==s.value&&(s.checked="checked"),r("input",e.extend({type:"radio"},s))},checkbox:function(t,n,r){var i="";return r||(r={}),r.hidden_element!==!1&&(i+=this.hidden(t,{value:!n})),delete r.hidden_element,i+=this.radio(t,n,e.extend({type:"checkbox"},r)),i},submit:function(t){return r("input",e.extend({type:"submit"},t))},_attributesForKeyPath:function(t){var r=this,i=e.isArray(t)?t:t.split(/\./),s=r.name,o=r.object,u=r.name;return e.each(i,function(e,t){typeof o=="undefined"||o===""?o="":typeof t=="number"||t.match(/^\d+$/)?o=o[parseInt(t,10)]:o=o[t],s+="["+t+"]",u+="-"+t}),{name:s,value:n(r.object,o),"class":u}}}),t.Form=function(n){n.helpers({simple_element:r,formFor:function(n,r,i){var s;return e.isFunction(r)&&(i=r,r=this[n]),s=new t.FormBuilder(n,r),i.apply(this,[s]),s}})},t.Form});
View
5 lib/min/plugins/sammy.form-0.7.5.min.js
@@ -0,0 +1,5 @@
+// -- Sammy.js -- /plugins/sammy.form.js
+// http://sammyjs.org
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:11 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).Form=factory(window.jQuery,window.Sammy)}})(function($,Sammy){function getStringContent(object,content){if(typeof content==="undefined"){return""}else if($.isFunction(content)){content=content.apply(object)}return content.toString()}function simple_element(tag,attributes,content){var html="<";html+=tag;if(typeof attributes!="undefined"){$.each(attributes,function(key,value){if(value!==null){html+=" "+key+"='";html+=getStringContent(attributes,value).replace(/\'/g,"'");html+="'"}})}if(content===false){html+=">"}else if(typeof content!="undefined"){html+=">";html+=getStringContent(this,content);html+="</"+tag+">"}else{html+=" />"}return html}Sammy.FormBuilder=function(name,object){this.name=name;this.object=object};$.extend(Sammy.FormBuilder.prototype,{open:function(attributes){return simple_element("form",$.extend({method:"post",action:"#/"+this.name+"s"},attributes),false)},close:function(){return"</form>"},label:function(keypath,content,attributes){var attrs={"for":this._attributesForKeyPath(keypath).name};return simple_element("label",$.extend(attrs,attributes),content)},hidden:function(keypath,attributes){attributes=$.extend({type:"hidden"},this._attributesForKeyPath(keypath),attributes);return simple_element("input",attributes)},text:function(keypath,attributes){attributes=$.extend({type:"text"},this._attributesForKeyPath(keypath),attributes);return simple_element("input",attributes)},textarea:function(keypath,attributes){var current;attributes=$.extend(this._attributesForKeyPath(keypath),attributes);current=attributes.value;delete attributes["value"];return simple_element("textarea",attributes,current)},password:function(keypath,attributes){return this.text(keypath,$.extend({type:"password"},attributes))},select:function(keypath,options,attributes){var option_html="",selected;attributes=$.extend(this._attributesForKeyPath(keypath),attributes);selected=attributes.value;delete attributes["value"];$.each(options,function(i,option){var value,text,option_attrs;if($.isArray(option)){value=option[1];text=option[0]}else{value=option;text=option}option_attrs={value:getStringContent(this.object,value)};if(value===selected){option_attrs.selected="selected"}option_html+=simple_element("option",option_attrs,text)});return simple_element("select",attributes,option_html)},radio:function(keypath,value,attributes){var selected;attributes=$.extend(this._attributesForKeyPath(keypath),attributes);selected=attributes.value;attributes.value=getStringContent(this.object,value);if(selected==attributes.value){attributes.checked="checked"}return simple_element("input",$.extend({type:"radio"},attributes))},checkbox:function(keypath,value,attributes){var content="";if(!attributes){attributes={}}if(attributes.hidden_element!==false){content+=this.hidden(keypath,{value:!value})}delete attributes["hidden_element"];content+=this.radio(keypath,value,$.extend({type:"checkbox"},attributes));return content},submit:function(attributes){return simple_element("input",$.extend({type:"submit"},attributes))},_attributesForKeyPath:function(keypath){var builder=this,keys=$.isArray(keypath)?keypath:keypath.split(/\./),name=builder.name,value=builder.object,class_name=builder.name;$.each(keys,function(i,key){if(typeof value==="undefined"||value===""){value=""}else if(typeof key=="number"||key.match(/^\d+$/)){value=value[parseInt(key,10)]}else{value=value[key]}name+="["+key+"]";class_name+="-"+key});return{name:name,value:getStringContent(builder.object,value),"class":class_name}}});Sammy.Form=function(app){app.helpers({simple_element:simple_element,formFor:function(name,object,content_callback){var builder;if($.isFunction(object)){content_callback=object;object=this[name]}builder=new Sammy.FormBuilder(name,object);content_callback.apply(this,[builder]);return builder}})};return Sammy.Form});
View
6 lib/min/plugins/sammy.form-latest.min.js
@@ -1,5 +1,5 @@
// -- Sammy.js -- /plugins/sammy.form.js
// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:12 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).Form=e(window.jQuery,window.Sammy)})(function(e,t){function n(t,n){return typeof n=="undefined"?"":(e.isFunction(n)&&(n=n.apply(t)),n.toString())}function r(t,r,i){var s="<";return s+=t,typeof r!="undefined"&&e.each(r,function(e,t){t!==null&&(s+=" "+e+"='",s+=n(r,t).replace(/\'/g,"'"),s+="'")}),i===!1?s+=">":typeof i!="undefined"?(s+=">",s+=n(this,i),s+="</"+t+">"):s+=" />",s}return t.FormBuilder=function(e,t){this.name=e,this.object=t},e.extend(t.FormBuilder.prototype,{open:function(t){return r("form",e.extend({method:"post",action:"#/"+this.name+"s"},t),!1)},close:function(){return"</form>"},label:function(t,n,i){var s={"for":this._attributesForKeyPath(t).name};return r("label",e.extend(s,i),n)},hidden:function(t,n){return n=e.extend({type:"hidden"},this._attributesForKeyPath(t),n),r("input",n)},text:function(t,n){return n=e.extend({type:"text"},this._attributesForKeyPath(t),n),r("input",n)},textarea:function(t,n){var i;return n=e.extend(this._attributesForKeyPath(t),n),i=n.value,delete n.value,r("textarea",n,i)},password:function(t,n){return this.text(t,e.extend({type:"password"},n))},select:function(t,i,s){var o="",u;return s=e.extend(this._attributesForKeyPath(t),s),u=s.value,delete s.value,e.each(i,function(t,i){var s,a,f;e.isArray(i)?(s=i[1],a=i[0]):(s=i,a=i),f={value:n(this.object,s)},s===u&&(f.selected="selected"),o+=r("option",f,a)}),r("select",s,o)},radio:function(t,i,s){var o;return s=e.extend(this._attributesForKeyPath(t),s),o=s.value,s.value=n(this.object,i),o==s.value&&(s.checked="checked"),r("input",e.extend({type:"radio"},s))},checkbox:function(t,n,r){var i="";return r||(r={}),r.hidden_element!==!1&&(i+=this.hidden(t,{value:!n})),delete r.hidden_element,i+=this.radio(t,n,e.extend({type:"checkbox"},r)),i},submit:function(t){return r("input",e.extend({type:"submit"},t))},_attributesForKeyPath:function(t){var r=this,i=e.isArray(t)?t:t.split(/\./),s=r.name,o=r.object,u=r.name;return e.each(i,function(e,t){typeof o=="undefined"||o===""?o="":typeof t=="number"||t.match(/^\d+$/)?o=o[parseInt(t,10)]:o=o[t],s+="["+t+"]",u+="-"+t}),{name:s,value:n(r.object,o),"class":u}}}),t.Form=function(n){n.helpers({simple_element:r,formFor:function(n,r,i){var s;return e.isFunction(r)&&(i=r,r=this[n]),s=new t.FormBuilder(n,r),i.apply(this,[s]),s}})},t.Form});
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:11 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).Form=factory(window.jQuery,window.Sammy)}})(function($,Sammy){function getStringContent(object,content){if(typeof content==="undefined"){return""}else if($.isFunction(content)){content=content.apply(object)}return content.toString()}function simple_element(tag,attributes,content){var html="<";html+=tag;if(typeof attributes!="undefined"){$.each(attributes,function(key,value){if(value!==null){html+=" "+key+"='";html+=getStringContent(attributes,value).replace(/\'/g,"'");html+="'"}})}if(content===false){html+=">"}else if(typeof content!="undefined"){html+=">";html+=getStringContent(this,content);html+="</"+tag+">"}else{html+=" />"}return html}Sammy.FormBuilder=function(name,object){this.name=name;this.object=object};$.extend(Sammy.FormBuilder.prototype,{open:function(attributes){return simple_element("form",$.extend({method:"post",action:"#/"+this.name+"s"},attributes),false)},close:function(){return"</form>"},label:function(keypath,content,attributes){var attrs={"for":this._attributesForKeyPath(keypath).name};return simple_element("label",$.extend(attrs,attributes),content)},hidden:function(keypath,attributes){attributes=$.extend({type:"hidden"},this._attributesForKeyPath(keypath),attributes);return simple_element("input",attributes)},text:function(keypath,attributes){attributes=$.extend({type:"text"},this._attributesForKeyPath(keypath),attributes);return simple_element("input",attributes)},textarea:function(keypath,attributes){var current;attributes=$.extend(this._attributesForKeyPath(keypath),attributes);current=attributes.value;delete attributes["value"];return simple_element("textarea",attributes,current)},password:function(keypath,attributes){return this.text(keypath,$.extend({type:"password"},attributes))},select:function(keypath,options,attributes){var option_html="",selected;attributes=$.extend(this._attributesForKeyPath(keypath),attributes);selected=attributes.value;delete attributes["value"];$.each(options,function(i,option){var value,text,option_attrs;if($.isArray(option)){value=option[1];text=option[0]}else{value=option;text=option}option_attrs={value:getStringContent(this.object,value)};if(value===selected){option_attrs.selected="selected"}option_html+=simple_element("option",option_attrs,text)});return simple_element("select",attributes,option_html)},radio:function(keypath,value,attributes){var selected;attributes=$.extend(this._attributesForKeyPath(keypath),attributes);selected=attributes.value;attributes.value=getStringContent(this.object,value);if(selected==attributes.value){attributes.checked="checked"}return simple_element("input",$.extend({type:"radio"},attributes))},checkbox:function(keypath,value,attributes){var content="";if(!attributes){attributes={}}if(attributes.hidden_element!==false){content+=this.hidden(keypath,{value:!value})}delete attributes["hidden_element"];content+=this.radio(keypath,value,$.extend({type:"checkbox"},attributes));return content},submit:function(attributes){return simple_element("input",$.extend({type:"submit"},attributes))},_attributesForKeyPath:function(keypath){var builder=this,keys=$.isArray(keypath)?keypath:keypath.split(/\./),name=builder.name,value=builder.object,class_name=builder.name;$.each(keys,function(i,key){if(typeof value==="undefined"||value===""){value=""}else if(typeof key=="number"||key.match(/^\d+$/)){value=value[parseInt(key,10)]}else{value=value[key]}name+="["+key+"]";class_name+="-"+key});return{name:name,value:getStringContent(builder.object,value),"class":class_name}}});Sammy.Form=function(app){app.helpers({simple_element:simple_element,formFor:function(name,object,content_callback){var builder;if($.isFunction(object)){content_callback=object;object=this[name]}builder=new Sammy.FormBuilder(name,object);content_callback.apply(this,[builder]);return builder}})};return Sammy.Form});
View
5 lib/min/plugins/sammy.form_2_json-0.7.4.min.js
@@ -1,5 +0,0 @@
-// -- Sammy.js -- /plugins/sammy.form_2_json.js
-// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:12 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).Form2JSON=e(window.jQuery,window.Sammy)})(function(e,t){return function(){function e(n){var r=[],i=n.firstChild;while(i){if(i.nodeName.match(/INPUT|SELECT|TEXTAREA/i)){var s=t(i);s!==null&&r.push({name:i.name,value:s})}else{var o=e(i);r=r.concat(o)}i=i.nextSibling}return r}function t(e){switch(e.nodeName){case"INPUT":case"TEXTAREA":switch(e.type.toLowerCase()){case"radio":case"checkbox":if(e.checked)return e.value;break;case"button":case"reset":case"submit":case"image":return"";default:return e.value}break;case"SELECT":return n(e);default:}return null}function n(e){var t=e.multiple;if(!t)return e.value;var n=[];for(var r=e.getElementsByTagName("option"),i=0,s=r.length;i<s;i++)r[i].selected&&n.push(r[i].value);return n}window.form2object=function(t,n,r){if(typeof r=="undefined"||r==null)r=!0;if(typeof n=="undefined"||n==null)n=".";t=typeof t=="string"?document.getElementById(t):t;var i=e(t),s={},o={};for(var u=0;u<i.length;u++){var a=i[u].value;if(r&&a==="")continue;var f=i[u].name,l=f.split(n),c=s,h="";for(var p=0;p<l.length;p++){var d=l[p],v="";if(d.indexOf("[]")>-1&&p==l.length-1)h=v=d.substr(0,d.indexOf("[")),c[v]||(c[v]=[]),c[v].push(a);else if(d.indexOf("[")>-1){v=d.substr(0,d.indexOf("["));var m=d.replace(/^[a-z]+\[|\]$/gi,"");h=h+v+m,o[h]||(o[h]={}),c[v]||(c[v]=[]),p==l.length-1?c[v].push(a):o[h][m]||(c[v].push({}),o[h][m]=c[v][c[v].length-1]),c=o[h][m]}else p<l.length-1?(c[d]||(c[d]={}),c=c[d]):c[d]=a}}return s},window.form2json=window.form2object}(),t.Form2JSON=function(e){e._parseFormParams=function(e){return form2object(e[0])}},t.Form2JSON});
View
5 lib/min/plugins/sammy.form_2_json-0.7.5.min.js
@@ -0,0 +1,5 @@
+// -- Sammy.js -- /plugins/sammy.form_2_json.js
+// http://sammyjs.org
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:11 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).Form2JSON=factory(window.jQuery,window.Sammy)}})(function($,Sammy){(function(){window.form2object=function(rootNode,delimiter,skipEmpty){if(typeof skipEmpty=="undefined"||skipEmpty==null)skipEmpty=true;if(typeof delimiter=="undefined"||delimiter==null)delimiter=".";rootNode=typeof rootNode=="string"?document.getElementById(rootNode):rootNode;var formValues=getFormValues(rootNode);var result={};var arrays={};for(var i=0;i<formValues.length;i++){var value=formValues[i].value;if(skipEmpty&&value==="")continue;var name=formValues[i].name;var nameParts=name.split(delimiter);var currResult=result;var arrayKey="";for(var j=0;j<nameParts.length;j++){var namePart=nameParts[j];var arrName="";if(namePart.indexOf("[]")>-1&&j==nameParts.length-1){arrayKey=arrName=namePart.substr(0,namePart.indexOf("["));if(!currResult[arrName])currResult[arrName]=[];currResult[arrName].push(value)}else{if(namePart.indexOf("[")>-1){arrName=namePart.substr(0,namePart.indexOf("["));var arrIdx=namePart.replace(/^[a-z]+\[|\]$/gi,"");arrayKey=arrayKey+arrName+arrIdx;if(!arrays[arrayKey])arrays[arrayKey]={};if(!currResult[arrName])currResult[arrName]=[];if(j==nameParts.length-1){currResult[arrName].push(value)}else{if(!arrays[arrayKey][arrIdx]){currResult[arrName].push({});arrays[arrayKey][arrIdx]=currResult[arrName][currResult[arrName].length-1]}}currResult=arrays[arrayKey][arrIdx]}else{if(j<nameParts.length-1){if(!currResult[namePart])currResult[namePart]={};currResult=currResult[namePart]}else{currResult[namePart]=value}}}}}return result};function getFormValues(rootNode){var result=[];var currentNode=rootNode.firstChild;while(currentNode){if(currentNode.nodeName.match(/INPUT|SELECT|TEXTAREA/i)){var fieldValue=getFieldValue(currentNode);if(fieldValue!==null)result.push({name:currentNode.name,value:fieldValue})}else{var subresult=getFormValues(currentNode);result=result.concat(subresult)}currentNode=currentNode.nextSibling}return result}function getFieldValue(fieldNode){switch(fieldNode.nodeName){case"INPUT":case"TEXTAREA":switch(fieldNode.type.toLowerCase()){case"radio":case"checkbox":if(fieldNode.checked)return fieldNode.value;break;case"button":case"reset":case"submit":case"image":return"";break;default:return fieldNode.value;break}break;case"SELECT":return getSelectedOptionValue(fieldNode);break;default:break}return null}function getSelectedOptionValue(selectNode){var multiple=selectNode.multiple;if(!multiple)return selectNode.value;var result=[];for(var options=selectNode.getElementsByTagName("option"),i=0,l=options.length;i<l;i++){if(options[i].selected)result.push(options[i].value)}return result}window.form2json=window.form2object})();Sammy.Form2JSON=function(app){app._parseFormParams=function(form){return form2object(form[0])}};return Sammy.Form2JSON});
View
6 lib/min/plugins/sammy.form_2_json-latest.min.js
@@ -1,5 +1,5 @@
// -- Sammy.js -- /plugins/sammy.form_2_json.js
// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:12 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).Form2JSON=e(window.jQuery,window.Sammy)})(function(e,t){return function(){function e(n){var r=[],i=n.firstChild;while(i){if(i.nodeName.match(/INPUT|SELECT|TEXTAREA/i)){var s=t(i);s!==null&&r.push({name:i.name,value:s})}else{var o=e(i);r=r.concat(o)}i=i.nextSibling}return r}function t(e){switch(e.nodeName){case"INPUT":case"TEXTAREA":switch(e.type.toLowerCase()){case"radio":case"checkbox":if(e.checked)return e.value;break;case"button":case"reset":case"submit":case"image":return"";default:return e.value}break;case"SELECT":return n(e);default:}return null}function n(e){var t=e.multiple;if(!t)return e.value;var n=[];for(var r=e.getElementsByTagName("option"),i=0,s=r.length;i<s;i++)r[i].selected&&n.push(r[i].value);return n}window.form2object=function(t,n,r){if(typeof r=="undefined"||r==null)r=!0;if(typeof n=="undefined"||n==null)n=".";t=typeof t=="string"?document.getElementById(t):t;var i=e(t),s={},o={};for(var u=0;u<i.length;u++){var a=i[u].value;if(r&&a==="")continue;var f=i[u].name,l=f.split(n),c=s,h="";for(var p=0;p<l.length;p++){var d=l[p],v="";if(d.indexOf("[]")>-1&&p==l.length-1)h=v=d.substr(0,d.indexOf("[")),c[v]||(c[v]=[]),c[v].push(a);else if(d.indexOf("[")>-1){v=d.substr(0,d.indexOf("["));var m=d.replace(/^[a-z]+\[|\]$/gi,"");h=h+v+m,o[h]||(o[h]={}),c[v]||(c[v]=[]),p==l.length-1?c[v].push(a):o[h][m]||(c[v].push({}),o[h][m]=c[v][c[v].length-1]),c=o[h][m]}else p<l.length-1?(c[d]||(c[d]={}),c=c[d]):c[d]=a}}return s},window.form2json=window.form2object}(),t.Form2JSON=function(e){e._parseFormParams=function(e){return form2object(e[0])}},t.Form2JSON});
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:11 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).Form2JSON=factory(window.jQuery,window.Sammy)}})(function($,Sammy){(function(){window.form2object=function(rootNode,delimiter,skipEmpty){if(typeof skipEmpty=="undefined"||skipEmpty==null)skipEmpty=true;if(typeof delimiter=="undefined"||delimiter==null)delimiter=".";rootNode=typeof rootNode=="string"?document.getElementById(rootNode):rootNode;var formValues=getFormValues(rootNode);var result={};var arrays={};for(var i=0;i<formValues.length;i++){var value=formValues[i].value;if(skipEmpty&&value==="")continue;var name=formValues[i].name;var nameParts=name.split(delimiter);var currResult=result;var arrayKey="";for(var j=0;j<nameParts.length;j++){var namePart=nameParts[j];var arrName="";if(namePart.indexOf("[]")>-1&&j==nameParts.length-1){arrayKey=arrName=namePart.substr(0,namePart.indexOf("["));if(!currResult[arrName])currResult[arrName]=[];currResult[arrName].push(value)}else{if(namePart.indexOf("[")>-1){arrName=namePart.substr(0,namePart.indexOf("["));var arrIdx=namePart.replace(/^[a-z]+\[|\]$/gi,"");arrayKey=arrayKey+arrName+arrIdx;if(!arrays[arrayKey])arrays[arrayKey]={};if(!currResult[arrName])currResult[arrName]=[];if(j==nameParts.length-1){currResult[arrName].push(value)}else{if(!arrays[arrayKey][arrIdx]){currResult[arrName].push({});arrays[arrayKey][arrIdx]=currResult[arrName][currResult[arrName].length-1]}}currResult=arrays[arrayKey][arrIdx]}else{if(j<nameParts.length-1){if(!currResult[namePart])currResult[namePart]={};currResult=currResult[namePart]}else{currResult[namePart]=value}}}}}return result};function getFormValues(rootNode){var result=[];var currentNode=rootNode.firstChild;while(currentNode){if(currentNode.nodeName.match(/INPUT|SELECT|TEXTAREA/i)){var fieldValue=getFieldValue(currentNode);if(fieldValue!==null)result.push({name:currentNode.name,value:fieldValue})}else{var subresult=getFormValues(currentNode);result=result.concat(subresult)}currentNode=currentNode.nextSibling}return result}function getFieldValue(fieldNode){switch(fieldNode.nodeName){case"INPUT":case"TEXTAREA":switch(fieldNode.type.toLowerCase()){case"radio":case"checkbox":if(fieldNode.checked)return fieldNode.value;break;case"button":case"reset":case"submit":case"image":return"";break;default:return fieldNode.value;break}break;case"SELECT":return getSelectedOptionValue(fieldNode);break;default:break}return null}function getSelectedOptionValue(selectNode){var multiple=selectNode.multiple;if(!multiple)return selectNode.value;var result=[];for(var options=selectNode.getElementsByTagName("option"),i=0,l=options.length;i<l;i++){if(options[i].selected)result.push(options[i].value)}return result}window.form2json=window.form2object})();Sammy.Form2JSON=function(app){app._parseFormParams=function(form){return form2object(form[0])}};return Sammy.Form2JSON});
View
5 lib/min/plugins/sammy.googleanalytics-0.7.4.min.js
@@ -1,5 +0,0 @@
-// -- Sammy.js -- /plugins/sammy.googleanalytics.js
-// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:13 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).GoogleAnalytics=e(window.jQuery,window.Sammy)})(function(e,t){return t.GoogleAnalytics=function(e,t){function i(){r=!1}function s(){r=!0}function o(e){typeof n!="undefined"?n._trackPageview(e):typeof _gaq!="undefined"&&_gaq.push(["_trackPageview",e])}var n=t||window.pageTracker,r=!0;this.helpers({noTrack:function(){i()},track:function(e){(typeof n!="undefined"||typeof _gaq!="undefined")&&r&&(this.log("tracking google analytics",e),o(e))}}),this.bind("event-context-after",function(){var e=this.app.last_location[1];e&&(this.track(e),s())})},t.GoogleAnalytics});
View
5 lib/min/plugins/sammy.googleanalytics-0.7.5.min.js
@@ -0,0 +1,5 @@
+// -- Sammy.js -- /plugins/sammy.googleanalytics.js
+// http://sammyjs.org
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:11 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).GoogleAnalytics=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.GoogleAnalytics=function(app,tracker){var _tracker=tracker||window.pageTracker,trackerName="send",shouldTrack=true;if(typeof tracker=="string"||tracker instanceof String){trackerName=tracker+".send"}function disableTracking(){shouldTrack=false}function enableTracking(){shouldTrack=true}function trackPageview(path){if(typeof ga=="function"){ga(trackerName,"pageview",{page:path})}else if(typeof _gaq!="undefined"){_gaq.push(["_trackPageview",path])}else if(typeof _tracker!="undefined"){_tracker._trackPageview(path)}}this.helpers({noTrack:function(){disableTracking()},track:function(path){if((typeof _tracker!="undefined"||typeof _gaq!="undefined"||typeof ga=="function")&&shouldTrack){this.log("tracking google analytics",path);trackPageview(path)}}});this.bind("event-context-after",function(){var path=this.app.last_location[1];if(path){this.track(path);enableTracking()}})};return Sammy.GoogleAnalytics});
View
6 lib/min/plugins/sammy.googleanalytics-latest.min.js
@@ -1,5 +1,5 @@
// -- Sammy.js -- /plugins/sammy.googleanalytics.js
// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:13 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).GoogleAnalytics=e(window.jQuery,window.Sammy)})(function(e,t){return t.GoogleAnalytics=function(e,t){function i(){r=!1}function s(){r=!0}function o(e){typeof n!="undefined"?n._trackPageview(e):typeof _gaq!="undefined"&&_gaq.push(["_trackPageview",e])}var n=t||window.pageTracker,r=!0;this.helpers({noTrack:function(){i()},track:function(e){(typeof n!="undefined"||typeof _gaq!="undefined")&&r&&(this.log("tracking google analytics",e),o(e))}}),this.bind("event-context-after",function(){var e=this.app.last_location[1];e&&(this.track(e),s())})},t.GoogleAnalytics});
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:11 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).GoogleAnalytics=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.GoogleAnalytics=function(app,tracker){var _tracker=tracker||window.pageTracker,trackerName="send",shouldTrack=true;if(typeof tracker=="string"||tracker instanceof String){trackerName=tracker+".send"}function disableTracking(){shouldTrack=false}function enableTracking(){shouldTrack=true}function trackPageview(path){if(typeof ga=="function"){ga(trackerName,"pageview",{page:path})}else if(typeof _gaq!="undefined"){_gaq.push(["_trackPageview",path])}else if(typeof _tracker!="undefined"){_tracker._trackPageview(path)}}this.helpers({noTrack:function(){disableTracking()},track:function(path){if((typeof _tracker!="undefined"||typeof _gaq!="undefined"||typeof ga=="function")&&shouldTrack){this.log("tracking google analytics",path);trackPageview(path)}}});this.bind("event-context-after",function(){var path=this.app.last_location[1];if(path){this.track(path);enableTracking()}})};return Sammy.GoogleAnalytics});
View
5 lib/min/plugins/sammy.haml-0.7.4.min.js
@@ -1,5 +0,0 @@
-// -- Sammy.js -- /plugins/sammy.haml.js
-// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:13 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy","haml"],e):(window.Sammy=window.Sammy||{}).Haml=e(window.jQuery,window.Sammy,window.Haml)})(function(e,t,n){return t.Haml=function(t,r){var i={},s=function(t,r,s){typeof s=="undefined"&&(s=t);var o=i[s];return o||(o=i[s]=n(t)),o(e.extend({},this,r))};r||(r="haml"),t.helper(r,s)},t.Haml});
View
5 lib/min/plugins/sammy.haml-0.7.5.min.js
@@ -0,0 +1,5 @@
+// -- Sammy.js -- /plugins/sammy.haml.js
+// http://sammyjs.org
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:12 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy","haml"],factory)}else{(window.Sammy=window.Sammy||{}).Haml=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.Haml=function(app,method_alias){var haml_cache={};var haml=function(template,data,name){if(typeof name=="undefined"){name=template}var fn=haml_cache[name];if(!fn){fn=haml_cache[name]=Haml(template)}return fn($.extend({},this,data))};if(!method_alias){method_alias="haml"}app.helper(method_alias,haml)};return Sammy.Haml});
View
6 lib/min/plugins/sammy.haml-latest.min.js
@@ -1,5 +1,5 @@
// -- Sammy.js -- /plugins/sammy.haml.js
// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:13 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy","haml"],e):(window.Sammy=window.Sammy||{}).Haml=e(window.jQuery,window.Sammy,window.Haml)})(function(e,t,n){return t.Haml=function(t,r){var i={},s=function(t,r,s){typeof s=="undefined"&&(s=t);var o=i[s];return o||(o=i[s]=n(t)),o(e.extend({},this,r))};r||(r="haml"),t.helper(r,s)},t.Haml});
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:12 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy","haml"],factory)}else{(window.Sammy=window.Sammy||{}).Haml=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.Haml=function(app,method_alias){var haml_cache={};var haml=function(template,data,name){if(typeof name=="undefined"){name=template}var fn=haml_cache[name];if(!fn){fn=haml_cache[name]=Haml(template)}return fn($.extend({},this,data))};if(!method_alias){method_alias="haml"}app.helper(method_alias,haml)};return Sammy.Haml});
View
5 lib/min/plugins/sammy.handlebars-0.7.4.min.js
@@ -1,5 +0,0 @@
-// -- Sammy.js -- /plugins/sammy.handlebars.js
-// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:13 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy","handlebars"],e):(window.Sammy=window.Sammy||{}).Handlebars=e(window.jQuery,window.Sammy,window.Handlebars)})(function(e,t,n){return t.Handlebars=function(t,r){var i={},s=function(t,r,s,o){typeof o=="undefined"&&(o=t);var u=i[o];return u||(u=i[o]=n.compile(t)),r=e.extend({},this,r),s=e.extend({},r.partials,s),u(r,{partials:s})};r||(r="handlebars"),t.helper(r,s)},t.Handlebars});
View
5 lib/min/plugins/sammy.handlebars-0.7.5.min.js
@@ -0,0 +1,5 @@
+// -- Sammy.js -- /plugins/sammy.handlebars.js
+// http://sammyjs.org
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:12 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy","handlebars"],factory)}else{(window.Sammy=window.Sammy||{}).Handlebars=factory(window.jQuery,window.Sammy)}})(function($,Sammy,Handlebars){Handlebars=Handlebars||window.Handlebars;Sammy.Handlebars=function(app,method_alias){var handlebars_cache={};var handlebars=function(template,data,partials,name){if(typeof name=="undefined"){name=template}var fn=handlebars_cache[name];if(!fn){fn=handlebars_cache[name]=Handlebars.compile(template)}data=$.extend({},this,data);partials=$.extend({},data.partials,partials);return fn(data,{partials:partials})};if(!method_alias){method_alias="handlebars"}app.helper(method_alias,handlebars)};return Sammy.Handlebars});
View
6 lib/min/plugins/sammy.handlebars-latest.min.js
@@ -1,5 +1,5 @@
// -- Sammy.js -- /plugins/sammy.handlebars.js
// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:13 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy","handlebars"],e):(window.Sammy=window.Sammy||{}).Handlebars=e(window.jQuery,window.Sammy,window.Handlebars)})(function(e,t,n){return t.Handlebars=function(t,r){var i={},s=function(t,r,s,o){typeof o=="undefined"&&(o=t);var u=i[o];return u||(u=i[o]=n.compile(t)),r=e.extend({},this,r),s=e.extend({},r.partials,s),u(r,{partials:s})};r||(r="handlebars"),t.helper(r,s)},t.Handlebars});
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:12 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy","handlebars"],factory)}else{(window.Sammy=window.Sammy||{}).Handlebars=factory(window.jQuery,window.Sammy)}})(function($,Sammy,Handlebars){Handlebars=Handlebars||window.Handlebars;Sammy.Handlebars=function(app,method_alias){var handlebars_cache={};var handlebars=function(template,data,partials,name){if(typeof name=="undefined"){name=template}var fn=handlebars_cache[name];if(!fn){fn=handlebars_cache[name]=Handlebars.compile(template)}data=$.extend({},this,data);partials=$.extend({},data.partials,partials);return fn(data,{partials:partials})};if(!method_alias){method_alias="handlebars"}app.helper(method_alias,handlebars)};return Sammy.Handlebars});
View
5 lib/min/plugins/sammy.hogan-0.7.4.min.js
@@ -1,5 +0,0 @@
-// -- Sammy.js -- /plugins/sammy.hogan.js
-// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:13 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy","hogan"],e):(window.Sammy=window.Sammy||{}).Hogan=e(window.jQuery,window.Sammy,window.Hogan)})(function(e,t){return t.Hogan=function(t,n){var r={},i=function(t,n,i){var s=r[s];return s||(s=Hogan.compile(t)),n=e.extend({},this,n),i=e.extend({},n.partials,i),s.render(n,i)};n||(n="hogan"),t.helper(n,i)},t.Hogan});
View
5 lib/min/plugins/sammy.hogan-0.7.5.min.js
@@ -0,0 +1,5 @@
+// -- Sammy.js -- /plugins/sammy.hogan.js
+// http://sammyjs.org
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:12 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy","hogan"],factory)}else{(window.Sammy=window.Sammy||{}).Hogan=factory(window.jQuery,window.Sammy,window.Hogan)}})(function($,Sammy){Sammy.Hogan=function(app,method_alias){var cached_templates={};var hogan=function(template,data,partials){var compiled_template=cached_templates[compiled_template];if(!compiled_template){compiled_template=Hogan.compile(template)}data=$.extend({},this,data);partials=$.extend({},data.partials,partials);return compiled_template.render(data,partials)};if(!method_alias){method_alias="hogan"}app.helper(method_alias,hogan)};return Sammy.Hogan});
View
6 lib/min/plugins/sammy.hogan-latest.min.js
@@ -1,5 +1,5 @@
// -- Sammy.js -- /plugins/sammy.hogan.js
// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:13 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy","hogan"],e):(window.Sammy=window.Sammy||{}).Hogan=e(window.jQuery,window.Sammy,window.Hogan)})(function(e,t){return t.Hogan=function(t,n){var r={},i=function(t,n,i){var s=r[s];return s||(s=Hogan.compile(t)),n=e.extend({},this,n),i=e.extend({},n.partials,i),s.render(n,i)};n||(n="hogan"),t.helper(n,i)},t.Hogan});
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:12 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy","hogan"],factory)}else{(window.Sammy=window.Sammy||{}).Hogan=factory(window.jQuery,window.Sammy,window.Hogan)}})(function($,Sammy){Sammy.Hogan=function(app,method_alias){var cached_templates={};var hogan=function(template,data,partials){var compiled_template=cached_templates[compiled_template];if(!compiled_template){compiled_template=Hogan.compile(template)}data=$.extend({},this,data);partials=$.extend({},data.partials,partials);return compiled_template.render(data,partials)};if(!method_alias){method_alias="hogan"}app.helper(method_alias,hogan)};return Sammy.Hogan});
View
5 lib/min/plugins/sammy.hoptoad-0.7.4.min.js
@@ -1,5 +0,0 @@
-// -- Sammy.js -- /plugins/sammy.hoptoad.js
-// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:13 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).Hoptoad=e(window.jQuery,window.Sammy)})(function(e,t){return t.Hoptoad=function(e,t){t=t||window.Hoptoad,e.bind("error",function(e,n){n&&n.error&&t.notify(n.error)})},t.Hoptoad});
View
5 lib/min/plugins/sammy.hoptoad-0.7.5.min.js
@@ -0,0 +1,5 @@
+// -- Sammy.js -- /plugins/sammy.hoptoad.js
+// http://sammyjs.org
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:12 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).Hoptoad=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.Hoptoad=function(app,errorReporter){errorReporter=errorReporter||window.Hoptoad;app.bind("error",function(e,data){if(data&&data.error){errorReporter.notify(data.error)}})};return Sammy.Hoptoad});
View
6 lib/min/plugins/sammy.hoptoad-latest.min.js
@@ -1,5 +1,5 @@
// -- Sammy.js -- /plugins/sammy.hoptoad.js
// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:13 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).Hoptoad=e(window.jQuery,window.Sammy)})(function(e,t){return t.Hoptoad=function(e,t){t=t||window.Hoptoad,e.bind("error",function(e,n){n&&n.error&&t.notify(n.error)})},t.Hoptoad});
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:12 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).Hoptoad=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.Hoptoad=function(app,errorReporter){errorReporter=errorReporter||window.Hoptoad;app.bind("error",function(e,data){if(data&&data.error){errorReporter.notify(data.error)}})};return Sammy.Hoptoad});
View
5 lib/min/plugins/sammy.json-0.7.4.min.js
@@ -1,5 +0,0 @@
-// -- Sammy.js -- /plugins/sammy.json.js
-// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:13 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).JSON=e(window.jQuery,window.Sammy)})(function($,Sammy){return window.JSON||(window.JSON={}),function(){function f(e){return e<10?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return typeof t=="string"?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,i,s,o=gap,u,a=t[e];a&&typeof a=="object"&&typeof a.toJSON=="function"&&(a=a.toJSON(e)),typeof rep=="function"&&(a=rep.call(t,e,a));switch(typeof a){case"string":return quote(a);case"number":return isFinite(a)?String(a):"null";case"boolean":case"null":return String(a);case"object":if(!a)return"null";gap+=indent,u=[];if(Object.prototype.toString.apply(a)==="[object Array]"){s=a.length;for(n=0;n<s;n+=1)u[n]=str(n,a)||"null";return i=u.length===0?"[]":gap?"[\n"+gap+u.join(",\n"+gap)+"\n"+o+"]":"["+u.join(",")+"]",gap=o,i}if(rep&&typeof rep=="object"){s=rep.length;for(n=0;n<s;n+=1)r=rep[n],typeof r=="string"&&(i=str(r,a),i&&u.push(quote(r)+(gap?": ":":")+i))}else for(r in a)Object.hasOwnProperty.call(a,r)&&(i=str(r,a),i&&u.push(quote(r)+(gap?": ":":")+i));return i=u.length===0?"{}":gap?"{\n"+gap+u.join(",\n"+gap)+"\n"+o+"}":"{"+u.join(",")+"}",gap=o,i}}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(e){return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z"},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(e){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;typeof JSON.stringify!="function"&&(JSON.stringify=function(e,t,n){var r;gap="",indent="";if(typeof n=="number")for(r=0;r<n;r+=1)indent+=" ";else typeof n=="string"&&(indent=n);rep=t;if(!t||typeof t=="function"||typeof t=="object"&&typeof t.length=="number")return str("",{"":e});throw new Error("JSON.stringify")}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){function walk(e,t){var n,r,i=e[t];if(i&&typeof i=="object")for(n in i)Object.hasOwnProperty.call(i,n)&&(r=walk(i,n),r!==undefined?i[n]=r:delete i[n]);return reviver.call(e,t,i)}var j;cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}(),Sammy.JSON=function(e){e.helpers({json:function(e){return typeof e=="string"?JSON.parse(e):JSON.stringify(e)}})},Sammy.JSON});
View
5 lib/min/plugins/sammy.json-0.7.5.min.js
@@ -0,0 +1,5 @@
+// -- Sammy.js -- /plugins/sammy.json.js
+// http://sammyjs.org
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:12 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).JSON=factory(window.jQuery,window.Sammy)}})(function($,Sammy){if(!window.JSON){window.JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z"};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else if(typeof space==="string"){indent=space}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}})();Sammy.JSON=function(app){app.helpers({json:function(object){if(typeof object=="string"){return JSON.parse(object)}else{return JSON.stringify(object)}}})};return Sammy.JSON});
View
6 lib/min/plugins/sammy.json-latest.min.js
@@ -1,5 +1,5 @@
// -- Sammy.js -- /plugins/sammy.json.js
// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:13 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).JSON=e(window.jQuery,window.Sammy)})(function($,Sammy){return window.JSON||(window.JSON={}),function(){function f(e){return e<10?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return typeof t=="string"?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,i,s,o=gap,u,a=t[e];a&&typeof a=="object"&&typeof a.toJSON=="function"&&(a=a.toJSON(e)),typeof rep=="function"&&(a=rep.call(t,e,a));switch(typeof a){case"string":return quote(a);case"number":return isFinite(a)?String(a):"null";case"boolean":case"null":return String(a);case"object":if(!a)return"null";gap+=indent,u=[];if(Object.prototype.toString.apply(a)==="[object Array]"){s=a.length;for(n=0;n<s;n+=1)u[n]=str(n,a)||"null";return i=u.length===0?"[]":gap?"[\n"+gap+u.join(",\n"+gap)+"\n"+o+"]":"["+u.join(",")+"]",gap=o,i}if(rep&&typeof rep=="object"){s=rep.length;for(n=0;n<s;n+=1)r=rep[n],typeof r=="string"&&(i=str(r,a),i&&u.push(quote(r)+(gap?": ":":")+i))}else for(r in a)Object.hasOwnProperty.call(a,r)&&(i=str(r,a),i&&u.push(quote(r)+(gap?": ":":")+i));return i=u.length===0?"{}":gap?"{\n"+gap+u.join(",\n"+gap)+"\n"+o+"}":"{"+u.join(",")+"}",gap=o,i}}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(e){return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z"},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(e){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;typeof JSON.stringify!="function"&&(JSON.stringify=function(e,t,n){var r;gap="",indent="";if(typeof n=="number")for(r=0;r<n;r+=1)indent+=" ";else typeof n=="string"&&(indent=n);rep=t;if(!t||typeof t=="function"||typeof t=="object"&&typeof t.length=="number")return str("",{"":e});throw new Error("JSON.stringify")}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){function walk(e,t){var n,r,i=e[t];if(i&&typeof i=="object")for(n in i)Object.hasOwnProperty.call(i,n)&&(r=walk(i,n),r!==undefined?i[n]=r:delete i[n]);return reviver.call(e,t,i)}var j;cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}(),Sammy.JSON=function(e){e.helpers({json:function(e){return typeof e=="string"?JSON.parse(e):JSON.stringify(e)}})},Sammy.JSON});
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:12 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).JSON=factory(window.jQuery,window.Sammy)}})(function($,Sammy){if(!window.JSON){window.JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z"};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else if(typeof space==="string"){indent=space}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}})();Sammy.JSON=function(app){app.helpers({json:function(object){if(typeof object=="string"){return JSON.parse(object)}else{return JSON.stringify(object)}}})};return Sammy.JSON});
View
5 lib/min/plugins/sammy.kissmetrics-0.7.4.min.js
@@ -1,5 +0,0 @@
-// -- Sammy.js -- /plugins/sammy.kissmetrics.js
-// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:14 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).JSON=e(window.jQuery,window.Sammy)})(function(e,t){return t.KISSmetrics=function(e){function n(){t=!1}function r(){t=!0}var t=!0;this.helpers({doNotTrackKISSmetrics:function(){n()},trackKISSmetrics:function(e){typeof window._kmq!="undefined"&&t&&(this.log("tracking KISSmetrics",e),window._kmq.push(["record",e]))}}),this.bind("event-context-after",function(){var e=this.app.last_location[1];e&&(this.trackKISSmetrics(e),r())})},t.KISSmetrics});
View
5 lib/min/plugins/sammy.kissmetrics-0.7.5.min.js
@@ -0,0 +1,5 @@
+// -- Sammy.js -- /plugins/sammy.kissmetrics.js
+// http://sammyjs.org
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:12 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).JSON=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.KISSmetrics=function(app){var shouldTrack=true;function disableTracking(){shouldTrack=false}function enableTracking(){shouldTrack=true}this.helpers({doNotTrackKISSmetrics:function(){disableTracking()},trackKISSmetrics:function(path){if(typeof window._kmq!="undefined"&&shouldTrack){this.log("tracking KISSmetrics",path);window._kmq.push(["record",path])}}});this.bind("event-context-after",function(){var path=this.app.last_location[1];if(path){this.trackKISSmetrics(path);enableTracking()}})};return Sammy.KISSmetrics});
View
6 lib/min/plugins/sammy.kissmetrics-latest.min.js
@@ -1,5 +1,5 @@
// -- Sammy.js -- /plugins/sammy.kissmetrics.js
// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:14 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).JSON=e(window.jQuery,window.Sammy)})(function(e,t){return t.KISSmetrics=function(e){function n(){t=!1}function r(){t=!0}var t=!0;this.helpers({doNotTrackKISSmetrics:function(){n()},trackKISSmetrics:function(e){typeof window._kmq!="undefined"&&t&&(this.log("tracking KISSmetrics",e),window._kmq.push(["record",e]))}}),this.bind("event-context-after",function(){var e=this.app.last_location[1];e&&(this.trackKISSmetrics(e),r())})},t.KISSmetrics});
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:12 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).JSON=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.KISSmetrics=function(app){var shouldTrack=true;function disableTracking(){shouldTrack=false}function enableTracking(){shouldTrack=true}this.helpers({doNotTrackKISSmetrics:function(){disableTracking()},trackKISSmetrics:function(path){if(typeof window._kmq!="undefined"&&shouldTrack){this.log("tracking KISSmetrics",path);window._kmq.push(["record",path])}}});this.bind("event-context-after",function(){var path=this.app.last_location[1];if(path){this.trackKISSmetrics(path);enableTracking()}})};return Sammy.KISSmetrics});
View
5 lib/min/plugins/sammy.meld-0.7.4.min.js
@@ -1,5 +0,0 @@
-// -- Sammy.js -- /plugins/sammy.meld.js
-// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:14 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).Meld=e(window.jQuery,window.Sammy)})(function(e,t){return t.Meld=function(t,n){var r={selector:function(e){return"."+e},remove_false:!0},i=function(t,n,s){var o=e(t);s=e.extend(r,s||{}),typeof n=="string"?o.html(n):e.each(n,function(t,n){var r=s.selector(t),u=o.filter(r),a,f,l=!1,c=o.index(u);u.length===0&&(u=o.find(r));if(u.length>0)if(e.isArray(n)){a=e("<div/>"),u.is("ol, ul")?(l=!0,f=u.children("li:first"),f.length==0&&(f=e("<li/>"))):u.children().length==1?(l=!0,f=u.children(":first").clone()):f=u.clone();for(var h=0;h<n.length;h++)a.append(i(f.clone(),n[h],s));if(l)u.html(a.html());else if(u[0]==o[0])o=e(a.html());else if(c>=0){var p=[c,1];p=p.concat(a.children().get()),o.splice.apply(o,p)}}else s.remove_false&&n===!1?o.splice(c,1):typeof n=="object"?u.is(":empty")?u.attr(n,!0):u.html(i(u.html(),n,s)):u.html(n.toString());else o.attr(t,n,!0)});var u=o;return u};n||(n="meld"),t.helper(n,i)},t.Meld});
View
5 lib/min/plugins/sammy.meld-0.7.5.min.js
@@ -0,0 +1,5 @@
+// -- Sammy.js -- /plugins/sammy.meld.js
+// http://sammyjs.org
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:13 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).Meld=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.Meld=function(app,method_alias){var default_options={selector:function(k){return"."+k},remove_false:true};var meld=function(template,data,options){var $template=$(template);options=$.extend(default_options,options||{});if(typeof data==="string"){$template.html(data)}else{$.each(data,function(key,value){var selector=options.selector(key),$sub=$template.filter(selector),$container,$item,is_list=false,subindex=$template.index($sub);if($sub.length===0){$sub=$template.find(selector)}if($sub.length>0){if($.isArray(value)){$container=$("<div/>");if($sub.is("ol, ul")){is_list=true;$item=$sub.children("li:first");if($item.length==0){$item=$("<li/>")}}else if($sub.children().length==1){is_list=true;$item=$sub.children(":first").clone()}else{$item=$sub.clone()}for(var i=0;i<value.length;i++){$container.append(meld($item.clone(),value[i],options))}if(is_list){$sub.html($container.html())}else if($sub[0]==$template[0]){$template=$($container.html())}else if(subindex>=0){var args=[subindex,1];args=args.concat($container.children().get());$template.splice.apply($template,args)}}else if(options.remove_false&&value===false){$template.splice(subindex,1)}else if(typeof value==="object"){if($sub.is(":empty")){$sub.attr(value,true)}else{$sub.html(meld($sub.html(),value,options))}}else{$sub.html(value.toString())}}else{$template.attr(key,value,true)}})}var dom=$template;return dom};if(!method_alias)method_alias="meld";app.helper(method_alias,meld)};return Sammy.Meld});
View
6 lib/min/plugins/sammy.meld-latest.min.js
@@ -1,5 +1,5 @@
// -- Sammy.js -- /plugins/sammy.meld.js
// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:14 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).Meld=e(window.jQuery,window.Sammy)})(function(e,t){return t.Meld=function(t,n){var r={selector:function(e){return"."+e},remove_false:!0},i=function(t,n,s){var o=e(t);s=e.extend(r,s||{}),typeof n=="string"?o.html(n):e.each(n,function(t,n){var r=s.selector(t),u=o.filter(r),a,f,l=!1,c=o.index(u);u.length===0&&(u=o.find(r));if(u.length>0)if(e.isArray(n)){a=e("<div/>"),u.is("ol, ul")?(l=!0,f=u.children("li:first"),f.length==0&&(f=e("<li/>"))):u.children().length==1?(l=!0,f=u.children(":first").clone()):f=u.clone();for(var h=0;h<n.length;h++)a.append(i(f.clone(),n[h],s));if(l)u.html(a.html());else if(u[0]==o[0])o=e(a.html());else if(c>=0){var p=[c,1];p=p.concat(a.children().get()),o.splice.apply(o,p)}}else s.remove_false&&n===!1?o.splice(c,1):typeof n=="object"?u.is(":empty")?u.attr(n,!0):u.html(i(u.html(),n,s)):u.html(n.toString());else o.attr(t,n,!0)});var u=o;return u};n||(n="meld"),t.helper(n,i)},t.Meld});
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:13 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).Meld=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.Meld=function(app,method_alias){var default_options={selector:function(k){return"."+k},remove_false:true};var meld=function(template,data,options){var $template=$(template);options=$.extend(default_options,options||{});if(typeof data==="string"){$template.html(data)}else{$.each(data,function(key,value){var selector=options.selector(key),$sub=$template.filter(selector),$container,$item,is_list=false,subindex=$template.index($sub);if($sub.length===0){$sub=$template.find(selector)}if($sub.length>0){if($.isArray(value)){$container=$("<div/>");if($sub.is("ol, ul")){is_list=true;$item=$sub.children("li:first");if($item.length==0){$item=$("<li/>")}}else if($sub.children().length==1){is_list=true;$item=$sub.children(":first").clone()}else{$item=$sub.clone()}for(var i=0;i<value.length;i++){$container.append(meld($item.clone(),value[i],options))}if(is_list){$sub.html($container.html())}else if($sub[0]==$template[0]){$template=$($container.html())}else if(subindex>=0){var args=[subindex,1];args=args.concat($container.children().get());$template.splice.apply($template,args)}}else if(options.remove_false&&value===false){$template.splice(subindex,1)}else if(typeof value==="object"){if($sub.is(":empty")){$sub.attr(value,true)}else{$sub.html(meld($sub.html(),value,options))}}else{$sub.html(value.toString())}}else{$template.attr(key,value,true)}})}var dom=$template;return dom};if(!method_alias)method_alias="meld";app.helper(method_alias,meld)};return Sammy.Meld});
View
5 lib/min/plugins/sammy.mixpanel-0.7.4.min.js
@@ -1,5 +0,0 @@
-// -- Sammy.js -- /plugins/sammy.mixpanel.js
-// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:14 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).Flash=e(window.jQuery,window.Sammy)})(function(e,t){return t.Mixpanel=function(e){function n(){t=!1}function r(){t=!0}var t=!0;this.helpers({doNotTrackMixpanel:function(){n()},trackMixpanel:function(e){typeof window.mixpanel!="undefined"&&t&&(this.log("tracking mixpanel",e),window.mixpanel.track(e))}}),this.bind("event-context-after",function(){var e=this.app.last_location[1];e&&(this.trackMixpanel(e),r())})},t.Mixpanel});
View
5 lib/min/plugins/sammy.mixpanel-0.7.5.min.js
@@ -0,0 +1,5 @@
+// -- Sammy.js -- /plugins/sammy.mixpanel.js
+// http://sammyjs.org
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:13 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).Flash=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.Mixpanel=function(app){var shouldTrack=true;function disableTracking(){shouldTrack=false}function enableTracking(){shouldTrack=true}this.helpers({doNotTrackMixpanel:function(){disableTracking()},trackMixpanel:function(path){if(typeof window.mixpanel!="undefined"&&shouldTrack){this.log("tracking mixpanel",path);window.mixpanel.track(path)}}});this.bind("event-context-after",function(){var path=this.app.last_location[1];if(path){this.trackMixpanel(path);enableTracking()}})};return Sammy.Mixpanel});
View
6 lib/min/plugins/sammy.mixpanel-latest.min.js
@@ -1,5 +1,5 @@
// -- Sammy.js -- /plugins/sammy.mixpanel.js
// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:14 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).Flash=e(window.jQuery,window.Sammy)})(function(e,t){return t.Mixpanel=function(e){function n(){t=!1}function r(){t=!0}var t=!0;this.helpers({doNotTrackMixpanel:function(){n()},trackMixpanel:function(e){typeof window.mixpanel!="undefined"&&t&&(this.log("tracking mixpanel",e),window.mixpanel.track(e))}}),this.bind("event-context-after",function(){var e=this.app.last_location[1];e&&(this.trackMixpanel(e),r())})},t.Mixpanel});
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:13 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).Flash=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.Mixpanel=function(app){var shouldTrack=true;function disableTracking(){shouldTrack=false}function enableTracking(){shouldTrack=true}this.helpers({doNotTrackMixpanel:function(){disableTracking()},trackMixpanel:function(path){if(typeof window.mixpanel!="undefined"&&shouldTrack){this.log("tracking mixpanel",path);window.mixpanel.track(path)}}});this.bind("event-context-after",function(){var path=this.app.last_location[1];if(path){this.trackMixpanel(path);enableTracking()}})};return Sammy.Mixpanel});
View
5 lib/min/plugins/sammy.mustache-0.7.4.min.js
@@ -1,5 +0,0 @@
-// -- Sammy.js -- /plugins/sammy.mustache.js
-// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:14 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy","mustache"],e):(window.Sammy=window.Sammy||{}).Mustache=e(window.jQuery,window.Sammy,window.Mustache)})(function(e,t,n){return t.Mustache=function(t,r){var i=function(t,r,i){return r=e.extend({},this,r),i=e.extend({},r.partials,i),n.to_html(t,r,i)};r||(r="mustache"),t.helper(r,i)},t.Mustache});
View
5 lib/min/plugins/sammy.mustache-0.7.5.min.js
@@ -0,0 +1,5 @@
+// -- Sammy.js -- /plugins/sammy.mustache.js
+// http://sammyjs.org
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:13 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy","mustache"],factory)}else{(window.Sammy=window.Sammy||{}).Mustache=factory(window.jQuery,window.Sammy,window.Mustache)}})(function($,Sammy,Mustache){Sammy.Mustache=function(app,method_alias){var mustache=function(template,data,partials){data=$.extend({},this,data);partials=$.extend({},data.partials,partials);return Mustache.to_html(template,data,partials)};if(!method_alias){method_alias="mustache"}app.helper(method_alias,mustache)};return Sammy.Mustache});
View
6 lib/min/plugins/sammy.mustache-latest.min.js
@@ -1,5 +1,5 @@
// -- Sammy.js -- /plugins/sammy.mustache.js
// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:14 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy","mustache"],e):(window.Sammy=window.Sammy||{}).Mustache=e(window.jQuery,window.Sammy,window.Mustache)})(function(e,t,n){return t.Mustache=function(t,r){var i=function(t,r,i){return r=e.extend({},this,r),i=e.extend({},r.partials,i),n.to_html(t,r,i)};r||(r="mustache"),t.helper(r,i)},t.Mustache});
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:13 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy","mustache"],factory)}else{(window.Sammy=window.Sammy||{}).Mustache=factory(window.jQuery,window.Sammy,window.Mustache)}})(function($,Sammy,Mustache){Sammy.Mustache=function(app,method_alias){var mustache=function(template,data,partials){data=$.extend({},this,data);partials=$.extend({},data.partials,partials);return Mustache.to_html(template,data,partials)};if(!method_alias){method_alias="mustache"}app.helper(method_alias,mustache)};return Sammy.Mustache});
View
5 lib/min/plugins/sammy.nested_params-0.7.4.min.js
@@ -1,5 +0,0 @@
-// -- Sammy.js -- /plugins/sammy.nested_params.js
-// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:14 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).NestedParams=e(window.jQuery,window.Sammy)})(function(e,t){function n(e){return e=unescape(e),e==="true"?!0:e==="false"?!1:e}function r(t,i,s){var o,u,a;if(i.match(/^[^\[]+$/))t[i]=n(s);else if(o=i.match(/^([^\[]+)\[\](.*)$/)){u=o[1],a=o[2];if(t[u]&&!e.isArray(t[u]))throw"400 Bad Request";if(a){o=a.match(/^\[([^\]]+)\](.*)$/);if(!o)throw"400 Bad Request";t[u]?t[u][t[u].length-1][o[1]]?t[u].push(r({},o[1]+o[2],s)):e.extend(!0,t[u][t[u].length-1],r({},o[1]+o[2],s)):t[u]=[r({},o[1]+o[2],s)]}else t[u]?t[u].push(n(s)):t[u]=[n(s)]}else if(o=i.match(/^([^\[]+)\[([^\[]+)\](.*)$/)){u=o[1],a=o[2]+o[3];if(t[u]&&e.isArray(t[u]))throw"400 Bad Request";t[u]?e.extend(!0,t[u],r(t[u],a,s)):t[u]=r({},a,s)}return t}return t.NestedParams=function(e){e._parseParamPair=r},t.NestedParams});
View
5 lib/min/plugins/sammy.nested_params-0.7.5.min.js
@@ -0,0 +1,5 @@
+// -- Sammy.js -- /plugins/sammy.nested_params.js
+// http://sammyjs.org
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:13 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).NestedParams=factory(window.jQuery,window.Sammy)}})(function($,Sammy){function parseValue(value){value=unescape(value);if(value==="true"){return true}else if(value==="false"){return false}else{return value}}function parseNestedParam(params,field_name,field_value){var match,name,rest;if(field_name.match(/^[^\[]+$/)){params[field_name]=parseValue(field_value)}else if(match=field_name.match(/^([^\[]+)\[\](.*)$/)){name=match[1];rest=match[2];if(params[name]&&!$.isArray(params[name])){throw"400 Bad Request"}if(rest){match=rest.match(/^\[([^\]]+)\](.*)$/);if(!match){throw"400 Bad Request"}if(params[name]){if(params[name][params[name].length-1][match[1]]){params[name].push(parseNestedParam({},match[1]+match[2],field_value))}else{$.extend(true,params[name][params[name].length-1],parseNestedParam({},match[1]+match[2],field_value))}}else{params[name]=[parseNestedParam({},match[1]+match[2],field_value)]}}else{if(params[name]){params[name].push(parseValue(field_value))}else{params[name]=[parseValue(field_value)]}}}else if(match=field_name.match(/^([^\[]+)\[([^\[]+)\](.*)$/)){name=match[1];rest=match[2]+match[3];if(params[name]&&$.isArray(params[name])){throw"400 Bad Request"}if(params[name]){$.extend(true,params[name],parseNestedParam(params[name],rest,field_value))}else{params[name]=parseNestedParam({},rest,field_value)}}return params}Sammy.NestedParams=function(app){app._parseParamPair=parseNestedParam};return Sammy.NestedParams});
View
6 lib/min/plugins/sammy.nested_params-latest.min.js
@@ -1,5 +1,5 @@
// -- Sammy.js -- /plugins/sammy.nested_params.js
// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:14 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).NestedParams=e(window.jQuery,window.Sammy)})(function(e,t){function n(e){return e=unescape(e),e==="true"?!0:e==="false"?!1:e}function r(t,i,s){var o,u,a;if(i.match(/^[^\[]+$/))t[i]=n(s);else if(o=i.match(/^([^\[]+)\[\](.*)$/)){u=o[1],a=o[2];if(t[u]&&!e.isArray(t[u]))throw"400 Bad Request";if(a){o=a.match(/^\[([^\]]+)\](.*)$/);if(!o)throw"400 Bad Request";t[u]?t[u][t[u].length-1][o[1]]?t[u].push(r({},o[1]+o[2],s)):e.extend(!0,t[u][t[u].length-1],r({},o[1]+o[2],s)):t[u]=[r({},o[1]+o[2],s)]}else t[u]?t[u].push(n(s)):t[u]=[n(s)]}else if(o=i.match(/^([^\[]+)\[([^\[]+)\](.*)$/)){u=o[1],a=o[2]+o[3];if(t[u]&&e.isArray(t[u]))throw"400 Bad Request";t[u]?e.extend(!0,t[u],r(t[u],a,s)):t[u]=r({},a,s)}return t}return t.NestedParams=function(e){e._parseParamPair=r},t.NestedParams});
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:13 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).NestedParams=factory(window.jQuery,window.Sammy)}})(function($,Sammy){function parseValue(value){value=unescape(value);if(value==="true"){return true}else if(value==="false"){return false}else{return value}}function parseNestedParam(params,field_name,field_value){var match,name,rest;if(field_name.match(/^[^\[]+$/)){params[field_name]=parseValue(field_value)}else if(match=field_name.match(/^([^\[]+)\[\](.*)$/)){name=match[1];rest=match[2];if(params[name]&&!$.isArray(params[name])){throw"400 Bad Request"}if(rest){match=rest.match(/^\[([^\]]+)\](.*)$/);if(!match){throw"400 Bad Request"}if(params[name]){if(params[name][params[name].length-1][match[1]]){params[name].push(parseNestedParam({},match[1]+match[2],field_value))}else{$.extend(true,params[name][params[name].length-1],parseNestedParam({},match[1]+match[2],field_value))}}else{params[name]=[parseNestedParam({},match[1]+match[2],field_value)]}}else{if(params[name]){params[name].push(parseValue(field_value))}else{params[name]=[parseValue(field_value)]}}}else if(match=field_name.match(/^([^\[]+)\[([^\[]+)\](.*)$/)){name=match[1];rest=match[2]+match[3];if(params[name]&&$.isArray(params[name])){throw"400 Bad Request"}if(params[name]){$.extend(true,params[name],parseNestedParam(params[name],rest,field_value))}else{params[name]=parseNestedParam({},rest,field_value)}}return params}Sammy.NestedParams=function(app){app._parseParamPair=parseNestedParam};return Sammy.NestedParams});
View
5 lib/min/plugins/sammy.oauth2-0.7.4.min.js
@@ -1,5 +0,0 @@
-// -- Sammy.js -- /plugins/sammy.oauth2.js
-// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:14 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).OAuth2=e(window.jQuery,window.Sammy)})(function(e,t){return t.OAuth2=function(t){function n(e){var t=e.match(/#(.*)$/)[1],n=t.split("&"),r={},i,s=n.length;for(i=0;i<s;i+=1){var o=n[i].split("=");r[o[0]]=o[1].replace(/\+/g," ")}return r}t.use("JSON"),this.authorize="/oauth/authorize",this.helper("requireOAuth",function(e){if(!this.app.getAccessToken())return this.redirect(this.app.authorize+"?state="+escape(this.path)),!1;e&&e.apply(this)}),this.helper("loseAccessToken",function(){this.app.loseAccessToken()}),this.requireOAuth=function(e){this.before(e||{},function(e){return e.requireOAuth()})},this.getAccessToken=function(){return this.session("oauth.token")},this.setAccessToken=function(e){this.session("oauth.token",e),this.trigger("oauth.connected")},this.loseAccessToken=function(){this.session("oauth.token",null),this.trigger("oauth.disconnected")},e(document).ajaxSend(function(e,n){var r=t.getAccessToken();r&&n.setRequestHeader("Authorization","OAuth "+r)});var r;this.bind("run",function(e,t){r=t.start_url||"#",this.app.getAccessToken()&&this.trigger("oauth.connected")}),this.before(/#(access_token=|[^\\].*\&access_token=)/,function(e){var t=n(e.path);return this.app.setAccessToken(t.access_token),e.redirect(t.state.length===0?this.app.start_url:unescape(t.state)),!1}).get(/#(access_token=|[^\\].*\&access_token=)/,function(e){}),this.before(/#(error=|[^\\].*\&error=)/,function(e){var t=n(e.path),r=t.error_description||"Access denined";return e.trigger("oauth.denied",{code:t.error,message:r}),!1}).get(/#(error=|[^\\].*\&error=)/,function(e){})},t.OAuth2});
View
5 lib/min/plugins/sammy.oauth2-0.7.5.min.js
@@ -0,0 +1,5 @@
+// -- Sammy.js -- /plugins/sammy.oauth2.js
+// http://sammyjs.org
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:13 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).OAuth2=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.OAuth2=function(app){app.use("JSON");this.authorize="/oauth/authorize";this.helper("requireOAuth",function(cb){if(this.app.getAccessToken()){if(cb){cb.apply(this)}}else{this.redirect(this.app.authorize+"?state="+escape(this.path));return false}});this.helper("loseAccessToken",function(){this.app.loseAccessToken()});this.requireOAuth=function(options){this.before(options||{},function(context){return context.requireOAuth()})};this.getAccessToken=function(){return this.session("oauth.token")};this.setAccessToken=function(token){this.session("oauth.token",token);this.trigger("oauth.connected")};this.loseAccessToken=function(){this.session("oauth.token",null);this.trigger("oauth.disconnected")};$(document).ajaxSend(function(evt,xhr){var token=app.getAccessToken();if(token){xhr.setRequestHeader("Authorization","OAuth "+token)}});function parseParams(path){var hash=path.match(/#(.*)$/)[1];var pairs=hash.split("&"),params={};var i,len=pairs.length;for(i=0;i<len;i+=1){var splat=pairs[i].split("=");params[splat[0]]=splat[1].replace(/\+/g," ")}return params}var start_url;this.bind("run",function(evt,params){start_url=params.start_url||"#";if(this.app.getAccessToken()){this.trigger("oauth.connected")}});this.before(/#(access_token=|[^\\].*\&access_token=)/,function(context){var params=parseParams(context.path);this.app.setAccessToken(params.access_token);context.redirect(params.state.length===0?this.app.start_url:unescape(params.state));return false}).get(/#(access_token=|[^\\].*\&access_token=)/,function(context){});this.before(/#(error=|[^\\].*\&error=)/,function(context){var params=parseParams(context.path);var message=params.error_description||"Access denined";context.trigger("oauth.denied",{code:params.error,message:message});return false}).get(/#(error=|[^\\].*\&error=)/,function(context){})};return Sammy.OAuth2});
View
6 lib/min/plugins/sammy.oauth2-latest.min.js
@@ -1,5 +1,5 @@
// -- Sammy.js -- /plugins/sammy.oauth2.js
// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:14 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).OAuth2=e(window.jQuery,window.Sammy)})(function(e,t){return t.OAuth2=function(t){function n(e){var t=e.match(/#(.*)$/)[1],n=t.split("&"),r={},i,s=n.length;for(i=0;i<s;i+=1){var o=n[i].split("=");r[o[0]]=o[1].replace(/\+/g," ")}return r}t.use("JSON"),this.authorize="/oauth/authorize",this.helper("requireOAuth",function(e){if(!this.app.getAccessToken())return this.redirect(this.app.authorize+"?state="+escape(this.path)),!1;e&&e.apply(this)}),this.helper("loseAccessToken",function(){this.app.loseAccessToken()}),this.requireOAuth=function(e){this.before(e||{},function(e){return e.requireOAuth()})},this.getAccessToken=function(){return this.session("oauth.token")},this.setAccessToken=function(e){this.session("oauth.token",e),this.trigger("oauth.connected")},this.loseAccessToken=function(){this.session("oauth.token",null),this.trigger("oauth.disconnected")},e(document).ajaxSend(function(e,n){var r=t.getAccessToken();r&&n.setRequestHeader("Authorization","OAuth "+r)});var r;this.bind("run",function(e,t){r=t.start_url||"#",this.app.getAccessToken()&&this.trigger("oauth.connected")}),this.before(/#(access_token=|[^\\].*\&access_token=)/,function(e){var t=n(e.path);return this.app.setAccessToken(t.access_token),e.redirect(t.state.length===0?this.app.start_url:unescape(t.state)),!1}).get(/#(access_token=|[^\\].*\&access_token=)/,function(e){}),this.before(/#(error=|[^\\].*\&error=)/,function(e){var t=n(e.path),r=t.error_description||"Access denined";return e.trigger("oauth.denied",{code:t.error,message:r}),!1}).get(/#(error=|[^\\].*\&error=)/,function(e){})},t.OAuth2});
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:13 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).OAuth2=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.OAuth2=function(app){app.use("JSON");this.authorize="/oauth/authorize";this.helper("requireOAuth",function(cb){if(this.app.getAccessToken()){if(cb){cb.apply(this)}}else{this.redirect(this.app.authorize+"?state="+escape(this.path));return false}});this.helper("loseAccessToken",function(){this.app.loseAccessToken()});this.requireOAuth=function(options){this.before(options||{},function(context){return context.requireOAuth()})};this.getAccessToken=function(){return this.session("oauth.token")};this.setAccessToken=function(token){this.session("oauth.token",token);this.trigger("oauth.connected")};this.loseAccessToken=function(){this.session("oauth.token",null);this.trigger("oauth.disconnected")};$(document).ajaxSend(function(evt,xhr){var token=app.getAccessToken();if(token){xhr.setRequestHeader("Authorization","OAuth "+token)}});function parseParams(path){var hash=path.match(/#(.*)$/)[1];var pairs=hash.split("&"),params={};var i,len=pairs.length;for(i=0;i<len;i+=1){var splat=pairs[i].split("=");params[splat[0]]=splat[1].replace(/\+/g," ")}return params}var start_url;this.bind("run",function(evt,params){start_url=params.start_url||"#";if(this.app.getAccessToken()){this.trigger("oauth.connected")}});this.before(/#(access_token=|[^\\].*\&access_token=)/,function(context){var params=parseParams(context.path);this.app.setAccessToken(params.access_token);context.redirect(params.state.length===0?this.app.start_url:unescape(params.state));return false}).get(/#(access_token=|[^\\].*\&access_token=)/,function(context){});this.before(/#(error=|[^\\].*\&error=)/,function(context){var params=parseParams(context.path);var message=params.error_description||"Access denined";context.trigger("oauth.denied",{code:params.error,message:message});return false}).get(/#(error=|[^\\].*\&error=)/,function(context){})};return Sammy.OAuth2});
View
5 lib/min/plugins/sammy.path_location_proxy-0.7.4.min.js
@@ -1,5 +0,0 @@
-// -- Sammy.js -- /plugins/sammy.path_location_proxy.js
-// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:14 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).PathLocationProxy=e(window.jQuery,window.Sammy)})(function(e,t){return t.PathLocationProxy=function(e){this.app=e},e.extend(t.PathLocationProxy.prototype,{bind:function(){},unbind:function(){},getLocation:function(){return[window.location.pathname,window.location.search].join("")},setLocation:function(e){return window.location=e}}),t.PathLocationProxy});
View
5 lib/min/plugins/sammy.path_location_proxy-0.7.5.min.js
@@ -0,0 +1,5 @@
+// -- Sammy.js -- /plugins/sammy.path_location_proxy.js
+// http://sammyjs.org
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:13 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).PathLocationProxy=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.PathLocationProxy=function(app){this.app=app};$.extend(Sammy.PathLocationProxy.prototype,{bind:function(){},unbind:function(){},getLocation:function(){return[window.location.pathname,window.location.search].join("")},setLocation:function(new_location){return window.location=new_location}});return Sammy.PathLocationProxy});
View
6 lib/min/plugins/sammy.path_location_proxy-latest.min.js
@@ -1,5 +1,5 @@
// -- Sammy.js -- /plugins/sammy.path_location_proxy.js
// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:14 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).PathLocationProxy=e(window.jQuery,window.Sammy)})(function(e,t){return t.PathLocationProxy=function(e){this.app=e},e.extend(t.PathLocationProxy.prototype,{bind:function(){},unbind:function(){},getLocation:function(){return[window.location.pathname,window.location.search].join("")},setLocation:function(e){return window.location=e}}),t.PathLocationProxy});
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:13 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).PathLocationProxy=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.PathLocationProxy=function(app){this.app=app};$.extend(Sammy.PathLocationProxy.prototype,{bind:function(){},unbind:function(){},getLocation:function(){return[window.location.pathname,window.location.search].join("")},setLocation:function(new_location){return window.location=new_location}});return Sammy.PathLocationProxy});
View
5 lib/min/plugins/sammy.pure-0.7.4.min.js
@@ -1,5 +0,0 @@
-// -- Sammy.js -- /plugins/sammy.pure.js
-// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:15 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy","pure"],e):(window.Sammy=window.Sammy||{}).Pure=e(window.jQuery,window.Sammy)})(function(e,t){return t.Pure=function(t,n){var r=function(t,n,r){return e(t).autoRender(n,r)};n||(n="pure"),t.helper(n,r)},t.Pure});
View
5 lib/min/plugins/sammy.pure-0.7.5.min.js
@@ -0,0 +1,5 @@
+// -- Sammy.js -- /plugins/sammy.pure.js
+// http://sammyjs.org
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:13 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy","pure"],factory)}else{(window.Sammy=window.Sammy||{}).Pure=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.Pure=function(app,method_alias){var pure=function(template,data,directives){return $(template).autoRender(data,directives)};if(!method_alias){method_alias="pure"}app.helper(method_alias,pure)};return Sammy.Pure});
View
6 lib/min/plugins/sammy.pure-latest.min.js
@@ -1,5 +1,5 @@
// -- Sammy.js -- /plugins/sammy.pure.js
// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:15 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy","pure"],e):(window.Sammy=window.Sammy||{}).Pure=e(window.jQuery,window.Sammy)})(function(e,t){return t.Pure=function(t,n){var r=function(t,n,r){return e(t).autoRender(n,r)};n||(n="pure"),t.helper(n,r)},t.Pure});
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:13 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy","pure"],factory)}else{(window.Sammy=window.Sammy||{}).Pure=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.Pure=function(app,method_alias){var pure=function(template,data,directives){return $(template).autoRender(data,directives)};if(!method_alias){method_alias="pure"}app.helper(method_alias,pure)};return Sammy.Pure});
View
5 lib/min/plugins/sammy.push_location_proxy-0.7.4.min.js
@@ -1,5 +0,0 @@
-// -- Sammy.js -- /plugins/sammy.push_location_proxy.js
-// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:15 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).PushLocationProxy=e(window.jQuery,window.Sammy)})(function(e,t){return t.PushLocationProxy=function(e){this.app=e},e.extend(t.PushLocationProxy.prototype,{bind:function(){var t=this;e(window).bind("popstate",function(e){t.app.trigger("location-changed")}),e("a").live("click",function(n){location.hostname==this.hostname&&(n.preventDefault(),t.setLocation(e(this).attr("href")),t.app.trigger("location-changed"))})},unbind:function(){e("a").unbind("click"),e(window).unbind("popstate")},getLocation:function(){return window.location.pathname},setLocation:function(e){history.pushState({path:this.path},"",e)}}),t.PushLocationProxy});
View
5 lib/min/plugins/sammy.push_location_proxy-0.7.5.min.js
@@ -0,0 +1,5 @@
+// -- Sammy.js -- /plugins/sammy.push_location_proxy.js
+// http://sammyjs.org
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:14 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).PushLocationProxy=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.PushLocationProxy=function(app,selector){this.app=app;this.selector=selector||"a"};$.extend(Sammy.PushLocationProxy.prototype,{bind:function(){var proxy=this;$(window).bind("popstate",function(e){proxy.app.trigger("location-changed")});this.app.$element().on("click",this.selector,function(e){if(location.hostname==this.hostname){e.preventDefault();proxy.setLocation($(this).attr("href"));proxy.app.trigger("location-changed")}})},unbind:function(){this.app.$element().off("click",this.selector);$(window).unbind("popstate")},getLocation:function(){return window.location.pathname},setLocation:function(new_location){history.pushState({path:this.path},"",new_location)}});return Sammy.PushLocationProxy});
View
6 lib/min/plugins/sammy.push_location_proxy-latest.min.js
@@ -1,5 +1,5 @@
// -- Sammy.js -- /plugins/sammy.push_location_proxy.js
// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:15 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).PushLocationProxy=e(window.jQuery,window.Sammy)})(function(e,t){return t.PushLocationProxy=function(e){this.app=e},e.extend(t.PushLocationProxy.prototype,{bind:function(){var t=this;e(window).bind("popstate",function(e){t.app.trigger("location-changed")}),e("a").live("click",function(n){location.hostname==this.hostname&&(n.preventDefault(),t.setLocation(e(this).attr("href")),t.app.trigger("location-changed"))})},unbind:function(){e("a").unbind("click"),e(window).unbind("popstate")},getLocation:function(){return window.location.pathname},setLocation:function(e){history.pushState({path:this.path},"",e)}}),t.PushLocationProxy});
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:14 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).PushLocationProxy=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.PushLocationProxy=function(app,selector){this.app=app;this.selector=selector||"a"};$.extend(Sammy.PushLocationProxy.prototype,{bind:function(){var proxy=this;$(window).bind("popstate",function(e){proxy.app.trigger("location-changed")});this.app.$element().on("click",this.selector,function(e){if(location.hostname==this.hostname){e.preventDefault();proxy.setLocation($(this).attr("href"));proxy.app.trigger("location-changed")}})},unbind:function(){this.app.$element().off("click",this.selector);$(window).unbind("popstate")},getLocation:function(){return window.location.pathname},setLocation:function(new_location){history.pushState({path:this.path},"",new_location)}});return Sammy.PushLocationProxy});
View
5 lib/min/plugins/sammy.storage-0.7.4.min.js
@@ -1,5 +0,0 @@
-// -- Sammy.js -- /plugins/sammy.storage.js
-// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:15 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).Storage=e(window.jQuery,window.Sammy)})(function(e,t){return t.Store=function(n){var r=this;this.options=n||{},this.name=this.options.name||"store",this.element=this.options.element||"body",this.$element=e(this.element),e.isArray(this.options.type)?e.each(this.options.type,function(e,n){if(t.Store.isAvailable(n))return r.type=n,!1}):this.type=this.options.type||"memory",this.meta_key=this.options.meta_key||"__keys__",this.storage=new t.Store[t.Store.stores[this.type]](this.name,this.element,this.options)},t.Store.stores={memory:"Memory",data:"Data",local:"LocalStorage",session:"SessionStorage",cookie:"Cookie"},e.extend(t.Store.prototype,{isAvailable:function(){return e.isFunction(this.storage.isAvailable)?this.storage.isAvailable():!0},exists:function(e){return this.storage.exists(e)},set:function(e,t){var n=typeof t=="string"?t:JSON.stringify(t);return e=e.toString(),this.storage.set(e,n),e!=this.meta_key&&(this._addKey(e),this.$element.trigger("set-"+this.name,{key:e,value:t}),this.$element.trigger("set-"+this.name+"-"+e,{key:e,value:t})),t},get:function(e){var t=this.storage.get(e);if(typeof t=="undefined"||t==null||t=="")return t;try{return JSON.parse(t)}catch(n){return t}},clear:function(e){return this._removeKey(e),this.storage.clear(e)},clearAll:function(){var e=this;this.each(function(t,n){e.clear(t)})},keys:function(){return this.get(this.meta_key)||[]},each:function(e){var t=0,n=this.keys(),r;for(t;t<n.length;t++){r=e(n[t],this.get(n[t]));if(r===!1)return!1}},filter:function(e){var t=[];return this.each(function(n,r){return e(n,r)&&t.push([n,r]),!0}),t},first:function(e){var t=!1;return this.each(function(n,r){if(e(n,r))return t=[n,r],!1}),t},fetch:function(e,t){return this.exists(e)?this.get(e):this.set(e,t.apply(this))},load:function(t,n,r){var i=this;e.get(n,function(e){i.set(t,e),r&&r.apply(this,[e])})},_addKey:function(t){var n=this.keys();e.inArray(t,n)==-1&&n.push(t),this.set(this.meta_key,n)},_removeKey:function(t){var n=this.keys(),r=e.inArray(t,n);r!=-1&&n.splice(r,1),this.set(this.meta_key,n)}}),t.Store.isAvailable=function(e){try{return t.Store[t.Store.stores[e]].prototype.isAvailable()}catch(n){return!1}},t.Store.Memory=function(e,n){this.name=e,this.element=n,this.namespace=[this.element,this.name].join("."),t.Store.Memory.store=t.Store.Memory.store||{},t.Store.Memory.store[this.namespace]=t.Store.Memory.store[this.namespace]||{},this.store=t.Store.Memory.store[this.namespace]},e.extend(t.Store.Memory.prototype,{isAvailable:function(){return!0},exists:function(e){return typeof this.store[e]!="undefined"},set:function(e,t){return this.store[e]=t},get:function(e){return this.store[e]},clear:function(e){delete this.store[e]}}),t.Store.Data=function(t,n){this.name=t,this.element=n,this.$element=e(n)},e.extend(t.Store.Data.prototype,{isAvailable:function(){return!0},exists:function(e){return!!this.$element.data(this._key(e))},set:function(e,t){return this.$element.data(this._key(e),t)},get:function(e){return this.$element.data(this._key(e))},clear:function(e){this.$element.removeData(this._key(e))},_key:function(e){return["store",this.name,e].join(".")}}),t.Store.LocalStorage=function(e,t){this.name=e,this.element=t},e.extend(t.Store.LocalStorage.prototype,{isAvailable:function(){return"localStorage"in window&&window.location.protocol!="file:"},exists:function(e){return this.get(e)!=null},set:function(e,t){return window.localStorage.setItem(this._key(e),t)},get:function(e){return window.localStorage.getItem(this._key(e))},clear:function(e){window.localStorage.removeItem(this._key(e))},_key:function(e){return["store",this.element,this.name,e].join(".")}}),t.Store.SessionStorage=function(e,t){this.name=e,this.element=t},e.extend(t.Store.SessionStorage.prototype,{isAvailable:function(){return"sessionStorage"in window&&window.location.protocol!="file:"&&e.isFunction(window.sessionStorage.setItem)},exists:function(e){return this.get(e)!=null},set:function(e,t){return window.sessionStorage.setItem(this._key(e),t)},get:function(e){var t=window.sessionStorage.getItem(this._key(e));return t&&typeof t.value!="undefined"&&(t=t.value),t},clear:function(e){window.sessionStorage.removeItem(this._key(e))},_key:function(e){return["store",this.element,this.name,e].join(".")}}),t.Store.Cookie=function(e,t,n){this.name=e,this.element=t,this.options=n||{},this.path=this.options.path||"/",this.expires_in=this.options.expires_in||1209600},e.extend(t.Store.Cookie.prototype,{isAvailable:function(){return"cookie"in document&&window.location.protocol!="file:"},exists:function(e){return this.get(e)!=null},set:function(e,t){return this._setCookie(e,t)},get:function(e){return this._getCookie(e)},clear:function(e){this._setCookie(e,"",-1)},_key:function(e){return["store",this.element,this.name,e].join(".")},_getCookie:function(e){var t=this._key(e).replace(/(\.|\*|\(|\)|\[|\])/g,"\\$1"),n=document.cookie.match("(^|;\\s)"+t+"=([^;]*)(;|$)");return n?n[2]:null},_setCookie:function(e,t,n){n||(n=this.expires_in*1e3);var r=new Date;r.setTime(r.getTime()+n);var i=[this._key(e),"=",t,"; expires=",r.toGMTString(),"; path=",this.path].join("");document.cookie=i}}),t.Storage=function(n){this.use(t.JSON),this.stores=this.stores||{},this.store=function(n,r){if(typeof this.stores[n]=="undefined"){var i="clear"+n.substr(0,1).toUpperCase()+n.substr(1);this.stores[n]=new t.Store(e.extend({name:n,element:this.element_selector},r||{})),this[n]=function(t,r){return typeof r=="undefined"?this.stores[n].get(t):e.isFunction(r)?this.stores[n].fetch(t,r):this.stores[n].set(t,r)},this[i]=function(){return this.stores[n].clearAll()},this.helper(n,function(){return this.app[n].apply(this.app,arguments)}),this.helper(i,function(){return this.app[i]()})}return this.stores[n]},this.helpers({store:function(){return this.app.store.apply(this.app,arguments)}})},t.Session=function(n,r){this.use(t.Storage),this.store("session",e.extend({type:["local","cookie","memory"]},r))},t.Cache=function(n,r){this.use(t.Storage),this.cache_partials=!0,this.store("cache",e.extend({type:["local","session","memory"]},r))},t.Storage});
View
5 lib/min/plugins/sammy.storage-0.7.5.min.js
@@ -0,0 +1,5 @@
+// -- Sammy.js -- /plugins/sammy.storage.js
+// http://sammyjs.org
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:14 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).Storage=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.Store=function(options){var store=this;this.options=options||{};this.name=this.options.name||"store";this.element=this.options.element||"body";this.$element=$(this.element);if($.isArray(this.options.type)){$.each(this.options.type,function(i,type){if(Sammy.Store.isAvailable(type)){store.type=type;return false}})}else{this.type=this.options.type||"memory"}this.meta_key=this.options.meta_key||"__keys__";this.storage=new Sammy.Store[Sammy.Store.stores[this.type]](this.name,this.element,this.options)};Sammy.Store.stores={memory:"Memory",data:"Data",local:"LocalStorage",session:"SessionStorage",cookie:"Cookie"};$.extend(Sammy.Store.prototype,{isAvailable:function(){if($.isFunction(this.storage.isAvailable)){return this.storage.isAvailable()}else{return true}},exists:function(key){return this.storage.exists(key)},set:function(key,value){var string_value=typeof value=="string"?value:JSON.stringify(value);key=key.toString();this.storage.set(key,string_value);if(key!=this.meta_key){this._addKey(key);this.$element.trigger("set-"+this.name,{key:key,value:value});this.$element.trigger("set-"+this.name+"-"+key,{key:key,value:value})}return value},get:function(key){var value=this.storage.get(key);if(typeof value=="undefined"||value==null||value==""){return value}try{return JSON.parse(value)}catch(e){return value}},clear:function(key){this._removeKey(key);return this.storage.clear(key)},clearAll:function(){var self=this;this.each(function(key,value){self.clear(key)})},keys:function(){return this.get(this.meta_key)||[]},each:function(callback){var i=0,keys=this.keys(),returned;for(i;i<keys.length;i++){returned=callback(keys[i],this.get(keys[i]));if(returned===false){return false}}},filter:function(callback){var found=[];this.each(function(key,value){if(callback(key,value)){found.push([key,value])}return true});return found},first:function(callback){var found=false;this.each(function(key,value){if(callback(key,value)){found=[key,value];return false}});return found},fetch:function(key,callback){if(!this.exists(key)){return this.set(key,callback.apply(this))}else{return this.get(key)}},load:function(key,path,callback){var s=this;$.get(path,function(response){s.set(key,response);if(callback){callback.apply(this,[response])}})},_addKey:function(key){var keys=this.keys();if($.inArray(key,keys)==-1){keys.push(key)}this.set(this.meta_key,keys)},_removeKey:function(key){var keys=this.keys();var index=$.inArray(key,keys);if(index!=-1){keys.splice(index,1)}this.set(this.meta_key,keys)}});Sammy.Store.isAvailable=function(type){try{return Sammy.Store[Sammy.Store.stores[type]].prototype.isAvailable()}catch(e){return false}};Sammy.Store.Memory=function(name,element){this.name=name;this.element=element;this.namespace=[this.element,this.name].join(".");Sammy.Store.Memory.store=Sammy.Store.Memory.store||{};Sammy.Store.Memory.store[this.namespace]=Sammy.Store.Memory.store[this.namespace]||{};this.store=Sammy.Store.Memory.store[this.namespace]};$.extend(Sammy.Store.Memory.prototype,{isAvailable:function(){return true},exists:function(key){return typeof this.store[key]!="undefined"},set:function(key,value){return this.store[key]=value},get:function(key){return this.store[key]},clear:function(key){delete this.store[key]}});Sammy.Store.Data=function(name,element){this.name=name;this.element=element;this.$element=$(element)};$.extend(Sammy.Store.Data.prototype,{isAvailable:function(){return true},exists:function(key){return!!this.$element.data(this._key(key))},set:function(key,value){return this.$element.data(this._key(key),value)},get:function(key){return this.$element.data(this._key(key))},clear:function(key){this.$element.removeData(this._key(key))},_key:function(key){return["store",this.name,key].join(".")}});Sammy.Store.LocalStorage=function(name,element){this.name=name;this.element=element};$.extend(Sammy.Store.LocalStorage.prototype,{isAvailable:function(){return"localStorage"in window&&window.location.protocol!="file:"},exists:function(key){return this.get(key)!=null},set:function(key,value){return window.localStorage.setItem(this._key(key),value)},get:function(key){return window.localStorage.getItem(this._key(key))},clear:function(key){window.localStorage.removeItem(this._key(key))},_key:function(key){return["store",this.element,this.name,key].join(".")}});Sammy.Store.SessionStorage=function(name,element){this.name=name;this.element=element};$.extend(Sammy.Store.SessionStorage.prototype,{isAvailable:function(){return"sessionStorage"in window&&window.location.protocol!="file:"&&$.isFunction(window.sessionStorage.setItem)},exists:function(key){return this.get(key)!=null},set:function(key,value){return window.sessionStorage.setItem(this._key(key),value)},get:function(key){var value=window.sessionStorage.getItem(this._key(key));if(value&&typeof value.value!="undefined"){value=value.value}return value},clear:function(key){window.sessionStorage.removeItem(this._key(key))},_key:function(key){return["store",this.element,this.name,key].join(".")}});Sammy.Store.Cookie=function(name,element,options){this.name=name;this.element=element;this.options=options||{};this.path=this.options.path||"/";this.expires_in=this.options.expires_in||14*24*60*60};$.extend(Sammy.Store.Cookie.prototype,{isAvailable:function(){return"cookie"in document&&window.location.protocol!="file:"},exists:function(key){return this.get(key)!=null},set:function(key,value){return this._setCookie(key,value)},get:function(key){return this._getCookie(key)},clear:function(key){this._setCookie(key,"",-1)},_key:function(key){return["store",this.element,this.name,key].join(".")},_getCookie:function(key){var escaped=this._key(key).replace(/(\.|\*|\(|\)|\[|\])/g,"\\$1");var match=document.cookie.match("(^|;\\s)"+escaped+"=([^;]*)(;|$)");return match?match[2]:null},_setCookie:function(key,value,expires){if(!expires){expires=this.expires_in*1e3}var date=new Date;date.setTime(date.getTime()+expires);var set_cookie=[this._key(key),"=",value,"; expires=",date.toGMTString(),"; path=",this.path].join("");document.cookie=set_cookie}});Sammy.Storage=function(app){this.use(Sammy.JSON);this.stores=this.stores||{};this.store=function(name,options){if(typeof this.stores[name]=="undefined"){var clear_method_name="clear"+name.substr(0,1).toUpperCase()+name.substr(1);this.stores[name]=new Sammy.Store($.extend({name:name,element:this.element_selector},options||{}));this[name]=function(key,value){if(typeof value=="undefined"){return this.stores[name].get(key)}else if($.isFunction(value)){return this.stores[name].fetch(key,value)}else{return this.stores[name].set(key,value)}};this[clear_method_name]=function(){return this.stores[name].clearAll()};this.helper(name,function(){return this.app[name].apply(this.app,arguments)});this.helper(clear_method_name,function(){return this.app[clear_method_name]()})}return this.stores[name]};this.helpers({store:function(){return this.app.store.apply(this.app,arguments)}})};Sammy.Session=function(app,options){this.use(Sammy.Storage);this.store("session",$.extend({type:["local","cookie","memory"]},options))};Sammy.Cache=function(app,options){this.use(Sammy.Storage);this.cache_partials=true;this.store("cache",$.extend({type:["local","session","memory"]},options))};return Sammy.Storage});
View
6 lib/min/plugins/sammy.storage-latest.min.js
@@ -1,5 +1,5 @@
// -- Sammy.js -- /plugins/sammy.storage.js
// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:15 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).Storage=e(window.jQuery,window.Sammy)})(function(e,t){return t.Store=function(n){var r=this;this.options=n||{},this.name=this.options.name||"store",this.element=this.options.element||"body",this.$element=e(this.element),e.isArray(this.options.type)?e.each(this.options.type,function(e,n){if(t.Store.isAvailable(n))return r.type=n,!1}):this.type=this.options.type||"memory",this.meta_key=this.options.meta_key||"__keys__",this.storage=new t.Store[t.Store.stores[this.type]](this.name,this.element,this.options)},t.Store.stores={memory:"Memory",data:"Data",local:"LocalStorage",session:"SessionStorage",cookie:"Cookie"},e.extend(t.Store.prototype,{isAvailable:function(){return e.isFunction(this.storage.isAvailable)?this.storage.isAvailable():!0},exists:function(e){return this.storage.exists(e)},set:function(e,t){var n=typeof t=="string"?t:JSON.stringify(t);return e=e.toString(),this.storage.set(e,n),e!=this.meta_key&&(this._addKey(e),this.$element.trigger("set-"+this.name,{key:e,value:t}),this.$element.trigger("set-"+this.name+"-"+e,{key:e,value:t})),t},get:function(e){var t=this.storage.get(e);if(typeof t=="undefined"||t==null||t=="")return t;try{return JSON.parse(t)}catch(n){return t}},clear:function(e){return this._removeKey(e),this.storage.clear(e)},clearAll:function(){var e=this;this.each(function(t,n){e.clear(t)})},keys:function(){return this.get(this.meta_key)||[]},each:function(e){var t=0,n=this.keys(),r;for(t;t<n.length;t++){r=e(n[t],this.get(n[t]));if(r===!1)return!1}},filter:function(e){var t=[];return this.each(function(n,r){return e(n,r)&&t.push([n,r]),!0}),t},first:function(e){var t=!1;return this.each(function(n,r){if(e(n,r))return t=[n,r],!1}),t},fetch:function(e,t){return this.exists(e)?this.get(e):this.set(e,t.apply(this))},load:function(t,n,r){var i=this;e.get(n,function(e){i.set(t,e),r&&r.apply(this,[e])})},_addKey:function(t){var n=this.keys();e.inArray(t,n)==-1&&n.push(t),this.set(this.meta_key,n)},_removeKey:function(t){var n=this.keys(),r=e.inArray(t,n);r!=-1&&n.splice(r,1),this.set(this.meta_key,n)}}),t.Store.isAvailable=function(e){try{return t.Store[t.Store.stores[e]].prototype.isAvailable()}catch(n){return!1}},t.Store.Memory=function(e,n){this.name=e,this.element=n,this.namespace=[this.element,this.name].join("."),t.Store.Memory.store=t.Store.Memory.store||{},t.Store.Memory.store[this.namespace]=t.Store.Memory.store[this.namespace]||{},this.store=t.Store.Memory.store[this.namespace]},e.extend(t.Store.Memory.prototype,{isAvailable:function(){return!0},exists:function(e){return typeof this.store[e]!="undefined"},set:function(e,t){return this.store[e]=t},get:function(e){return this.store[e]},clear:function(e){delete this.store[e]}}),t.Store.Data=function(t,n){this.name=t,this.element=n,this.$element=e(n)},e.extend(t.Store.Data.prototype,{isAvailable:function(){return!0},exists:function(e){return!!this.$element.data(this._key(e))},set:function(e,t){return this.$element.data(this._key(e),t)},get:function(e){return this.$element.data(this._key(e))},clear:function(e){this.$element.removeData(this._key(e))},_key:function(e){return["store",this.name,e].join(".")}}),t.Store.LocalStorage=function(e,t){this.name=e,this.element=t},e.extend(t.Store.LocalStorage.prototype,{isAvailable:function(){return"localStorage"in window&&window.location.protocol!="file:"},exists:function(e){return this.get(e)!=null},set:function(e,t){return window.localStorage.setItem(this._key(e),t)},get:function(e){return window.localStorage.getItem(this._key(e))},clear:function(e){window.localStorage.removeItem(this._key(e))},_key:function(e){return["store",this.element,this.name,e].join(".")}}),t.Store.SessionStorage=function(e,t){this.name=e,this.element=t},e.extend(t.Store.SessionStorage.prototype,{isAvailable:function(){return"sessionStorage"in window&&window.location.protocol!="file:"&&e.isFunction(window.sessionStorage.setItem)},exists:function(e){return this.get(e)!=null},set:function(e,t){return window.sessionStorage.setItem(this._key(e),t)},get:function(e){var t=window.sessionStorage.getItem(this._key(e));return t&&typeof t.value!="undefined"&&(t=t.value),t},clear:function(e){window.sessionStorage.removeItem(this._key(e))},_key:function(e){return["store",this.element,this.name,e].join(".")}}),t.Store.Cookie=function(e,t,n){this.name=e,this.element=t,this.options=n||{},this.path=this.options.path||"/",this.expires_in=this.options.expires_in||1209600},e.extend(t.Store.Cookie.prototype,{isAvailable:function(){return"cookie"in document&&window.location.protocol!="file:"},exists:function(e){return this.get(e)!=null},set:function(e,t){return this._setCookie(e,t)},get:function(e){return this._getCookie(e)},clear:function(e){this._setCookie(e,"",-1)},_key:function(e){return["store",this.element,this.name,e].join(".")},_getCookie:function(e){var t=this._key(e).replace(/(\.|\*|\(|\)|\[|\])/g,"\\$1"),n=document.cookie.match("(^|;\\s)"+t+"=([^;]*)(;|$)");return n?n[2]:null},_setCookie:function(e,t,n){n||(n=this.expires_in*1e3);var r=new Date;r.setTime(r.getTime()+n);var i=[this._key(e),"=",t,"; expires=",r.toGMTString(),"; path=",this.path].join("");document.cookie=i}}),t.Storage=function(n){this.use(t.JSON),this.stores=this.stores||{},this.store=function(n,r){if(typeof this.stores[n]=="undefined"){var i="clear"+n.substr(0,1).toUpperCase()+n.substr(1);this.stores[n]=new t.Store(e.extend({name:n,element:this.element_selector},r||{})),this[n]=function(t,r){return typeof r=="undefined"?this.stores[n].get(t):e.isFunction(r)?this.stores[n].fetch(t,r):this.stores[n].set(t,r)},this[i]=function(){return this.stores[n].clearAll()},this.helper(n,function(){return this.app[n].apply(this.app,arguments)}),this.helper(i,function(){return this.app[i]()})}return this.stores[n]},this.helpers({store:function(){return this.app.store.apply(this.app,arguments)}})},t.Session=function(n,r){this.use(t.Storage),this.store("session",e.extend({type:["local","cookie","memory"]},r))},t.Cache=function(n,r){this.use(t.Storage),this.cache_partials=!0,this.store("cache",e.extend({type:["local","session","memory"]},r))},t.Storage});
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:14 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).Storage=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.Store=function(options){var store=this;this.options=options||{};this.name=this.options.name||"store";this.element=this.options.element||"body";this.$element=$(this.element);if($.isArray(this.options.type)){$.each(this.options.type,function(i,type){if(Sammy.Store.isAvailable(type)){store.type=type;return false}})}else{this.type=this.options.type||"memory"}this.meta_key=this.options.meta_key||"__keys__";this.storage=new Sammy.Store[Sammy.Store.stores[this.type]](this.name,this.element,this.options)};Sammy.Store.stores={memory:"Memory",data:"Data",local:"LocalStorage",session:"SessionStorage",cookie:"Cookie"};$.extend(Sammy.Store.prototype,{isAvailable:function(){if($.isFunction(this.storage.isAvailable)){return this.storage.isAvailable()}else{return true}},exists:function(key){return this.storage.exists(key)},set:function(key,value){var string_value=typeof value=="string"?value:JSON.stringify(value);key=key.toString();this.storage.set(key,string_value);if(key!=this.meta_key){this._addKey(key);this.$element.trigger("set-"+this.name,{key:key,value:value});this.$element.trigger("set-"+this.name+"-"+key,{key:key,value:value})}return value},get:function(key){var value=this.storage.get(key);if(typeof value=="undefined"||value==null||value==""){return value}try{return JSON.parse(value)}catch(e){return value}},clear:function(key){this._removeKey(key);return this.storage.clear(key)},clearAll:function(){var self=this;this.each(function(key,value){self.clear(key)})},keys:function(){return this.get(this.meta_key)||[]},each:function(callback){var i=0,keys=this.keys(),returned;for(i;i<keys.length;i++){returned=callback(keys[i],this.get(keys[i]));if(returned===false){return false}}},filter:function(callback){var found=[];this.each(function(key,value){if(callback(key,value)){found.push([key,value])}return true});return found},first:function(callback){var found=false;this.each(function(key,value){if(callback(key,value)){found=[key,value];return false}});return found},fetch:function(key,callback){if(!this.exists(key)){return this.set(key,callback.apply(this))}else{return this.get(key)}},load:function(key,path,callback){var s=this;$.get(path,function(response){s.set(key,response);if(callback){callback.apply(this,[response])}})},_addKey:function(key){var keys=this.keys();if($.inArray(key,keys)==-1){keys.push(key)}this.set(this.meta_key,keys)},_removeKey:function(key){var keys=this.keys();var index=$.inArray(key,keys);if(index!=-1){keys.splice(index,1)}this.set(this.meta_key,keys)}});Sammy.Store.isAvailable=function(type){try{return Sammy.Store[Sammy.Store.stores[type]].prototype.isAvailable()}catch(e){return false}};Sammy.Store.Memory=function(name,element){this.name=name;this.element=element;this.namespace=[this.element,this.name].join(".");Sammy.Store.Memory.store=Sammy.Store.Memory.store||{};Sammy.Store.Memory.store[this.namespace]=Sammy.Store.Memory.store[this.namespace]||{};this.store=Sammy.Store.Memory.store[this.namespace]};$.extend(Sammy.Store.Memory.prototype,{isAvailable:function(){return true},exists:function(key){return typeof this.store[key]!="undefined"},set:function(key,value){return this.store[key]=value},get:function(key){return this.store[key]},clear:function(key){delete this.store[key]}});Sammy.Store.Data=function(name,element){this.name=name;this.element=element;this.$element=$(element)};$.extend(Sammy.Store.Data.prototype,{isAvailable:function(){return true},exists:function(key){return!!this.$element.data(this._key(key))},set:function(key,value){return this.$element.data(this._key(key),value)},get:function(key){return this.$element.data(this._key(key))},clear:function(key){this.$element.removeData(this._key(key))},_key:function(key){return["store",this.name,key].join(".")}});Sammy.Store.LocalStorage=function(name,element){this.name=name;this.element=element};$.extend(Sammy.Store.LocalStorage.prototype,{isAvailable:function(){return"localStorage"in window&&window.location.protocol!="file:"},exists:function(key){return this.get(key)!=null},set:function(key,value){return window.localStorage.setItem(this._key(key),value)},get:function(key){return window.localStorage.getItem(this._key(key))},clear:function(key){window.localStorage.removeItem(this._key(key))},_key:function(key){return["store",this.element,this.name,key].join(".")}});Sammy.Store.SessionStorage=function(name,element){this.name=name;this.element=element};$.extend(Sammy.Store.SessionStorage.prototype,{isAvailable:function(){return"sessionStorage"in window&&window.location.protocol!="file:"&&$.isFunction(window.sessionStorage.setItem)},exists:function(key){return this.get(key)!=null},set:function(key,value){return window.sessionStorage.setItem(this._key(key),value)},get:function(key){var value=window.sessionStorage.getItem(this._key(key));if(value&&typeof value.value!="undefined"){value=value.value}return value},clear:function(key){window.sessionStorage.removeItem(this._key(key))},_key:function(key){return["store",this.element,this.name,key].join(".")}});Sammy.Store.Cookie=function(name,element,options){this.name=name;this.element=element;this.options=options||{};this.path=this.options.path||"/";this.expires_in=this.options.expires_in||14*24*60*60};$.extend(Sammy.Store.Cookie.prototype,{isAvailable:function(){return"cookie"in document&&window.location.protocol!="file:"},exists:function(key){return this.get(key)!=null},set:function(key,value){return this._setCookie(key,value)},get:function(key){return this._getCookie(key)},clear:function(key){this._setCookie(key,"",-1)},_key:function(key){return["store",this.element,this.name,key].join(".")},_getCookie:function(key){var escaped=this._key(key).replace(/(\.|\*|\(|\)|\[|\])/g,"\\$1");var match=document.cookie.match("(^|;\\s)"+escaped+"=([^;]*)(;|$)");return match?match[2]:null},_setCookie:function(key,value,expires){if(!expires){expires=this.expires_in*1e3}var date=new Date;date.setTime(date.getTime()+expires);var set_cookie=[this._key(key),"=",value,"; expires=",date.toGMTString(),"; path=",this.path].join("");document.cookie=set_cookie}});Sammy.Storage=function(app){this.use(Sammy.JSON);this.stores=this.stores||{};this.store=function(name,options){if(typeof this.stores[name]=="undefined"){var clear_method_name="clear"+name.substr(0,1).toUpperCase()+name.substr(1);this.stores[name]=new Sammy.Store($.extend({name:name,element:this.element_selector},options||{}));this[name]=function(key,value){if(typeof value=="undefined"){return this.stores[name].get(key)}else if($.isFunction(value)){return this.stores[name].fetch(key,value)}else{return this.stores[name].set(key,value)}};this[clear_method_name]=function(){return this.stores[name].clearAll()};this.helper(name,function(){return this.app[name].apply(this.app,arguments)});this.helper(clear_method_name,function(){return this.app[clear_method_name]()})}return this.stores[name]};this.helpers({store:function(){return this.app.store.apply(this.app,arguments)}})};Sammy.Session=function(app,options){this.use(Sammy.Storage);this.store("session",$.extend({type:["local","cookie","memory"]},options))};Sammy.Cache=function(app,options){this.use(Sammy.Storage);this.cache_partials=true;this.store("cache",$.extend({type:["local","session","memory"]},options))};return Sammy.Storage});
View
5 lib/min/plugins/sammy.template-0.7.4.min.js
@@ -1,5 +0,0 @@
-// -- Sammy.js -- /plugins/sammy.template.js
-// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:15 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).Template=e(window.jQuery,window.Sammy)})(function(e,t){var n={},r=function(e,t,r,i){var s,o;if(n[e])s=n[e];else{if(typeof t=="undefined")return!1;i&&i.escape_html===!1?o='",$1,"':o='",h($1),"',s=n[e]=new Function("obj",'var ___$$$___=[],print=function(){___$$$___.push.apply(___$$$___,arguments);};with(obj){___$$$___.push("'+String(t).replace(/[\r\t\n]/g," ").replace(/\"/g,'\\"').split("<%").join(" ").replace(/((^|%>)[^\t]*)/g,"$1\r").replace(/\t=(.*?)%>/g,o).replace(/\t!(.*?)%>/g,'",$1,"').split(" ").join('");').split("%>").join('___$$$___.push("').split("\r").join("")+"\");}return ___$$$___.join('');")}return typeof r!="undefined"?s(r):s};return t.Template=function(t,n){var i=function(t,n,i,s){return typeof i=="undefined"&&(i=t),typeof s=="undefined"&&typeof i=="object"&&(s=i,i=t),r(i,t,e.extend({},this,n),s)};n||(n="template"),t.helper(n,i)},t.Template});
View
5 lib/min/plugins/sammy.template-0.7.5.min.js
@@ -0,0 +1,5 @@
+// -- Sammy.js -- /plugins/sammy.template.js
+// http://sammyjs.org
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:14 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).Template=factory(window.jQuery,window.Sammy)}})(function($,Sammy){var srender_cache={};var srender=function(name,template,data,options){var fn,escaped_string;if(srender_cache[name]){fn=srender_cache[name]}else{if(typeof template=="undefined"){return false}if(options&&options.escape_html===false){escaped_string='",$1,"'}else{escaped_string='",h($1),"'}fn=srender_cache[name]=new Function("obj","var ___$$$___=[],print=function(){___$$$___.push.apply(___$$$___,arguments);};"+'with(obj){___$$$___.push("'+String(template).replace(/[\r\t\n]/g," ").replace(/\"/g,'\\"').split("<%").join(" ").replace(/((^|%>)[^\t]*)/g,"$1\r").replace(/\t=(.*?)%>/g,escaped_string).replace(/\t!(.*?)%>/g,'",$1,"').split(" ").join('");').split("%>").join('___$$$___.push("').split("\r").join("")+"\");}return ___$$$___.join('');")}if(typeof data!="undefined"){return fn(data)}else{return fn}};Sammy.Template=function(app,method_alias){var template=function(template,data,name,options){if(typeof name=="undefined"){name=template}if(typeof options=="undefined"&&typeof name=="object"){options=name;name=template}return srender(name,template,$.extend({},this,data),options)};if(!method_alias){method_alias="template"}app.helper(method_alias,template)};return Sammy.Template});
View
6 lib/min/plugins/sammy.template-latest.min.js
@@ -1,5 +1,5 @@
// -- Sammy.js -- /plugins/sammy.template.js
// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:15 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).Template=e(window.jQuery,window.Sammy)})(function(e,t){var n={},r=function(e,t,r,i){var s,o;if(n[e])s=n[e];else{if(typeof t=="undefined")return!1;i&&i.escape_html===!1?o='",$1,"':o='",h($1),"',s=n[e]=new Function("obj",'var ___$$$___=[],print=function(){___$$$___.push.apply(___$$$___,arguments);};with(obj){___$$$___.push("'+String(t).replace(/[\r\t\n]/g," ").replace(/\"/g,'\\"').split("<%").join(" ").replace(/((^|%>)[^\t]*)/g,"$1\r").replace(/\t=(.*?)%>/g,o).replace(/\t!(.*?)%>/g,'",$1,"').split(" ").join('");').split("%>").join('___$$$___.push("').split("\r").join("")+"\");}return ___$$$___.join('');")}return typeof r!="undefined"?s(r):s};return t.Template=function(t,n){var i=function(t,n,i,s){return typeof i=="undefined"&&(i=t),typeof s=="undefined"&&typeof i=="object"&&(s=i,i=t),r(i,t,e.extend({},this,n),s)};n||(n="template"),t.helper(n,i)},t.Template});
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:14 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).Template=factory(window.jQuery,window.Sammy)}})(function($,Sammy){var srender_cache={};var srender=function(name,template,data,options){var fn,escaped_string;if(srender_cache[name]){fn=srender_cache[name]}else{if(typeof template=="undefined"){return false}if(options&&options.escape_html===false){escaped_string='",$1,"'}else{escaped_string='",h($1),"'}fn=srender_cache[name]=new Function("obj","var ___$$$___=[],print=function(){___$$$___.push.apply(___$$$___,arguments);};"+'with(obj){___$$$___.push("'+String(template).replace(/[\r\t\n]/g," ").replace(/\"/g,'\\"').split("<%").join(" ").replace(/((^|%>)[^\t]*)/g,"$1\r").replace(/\t=(.*?)%>/g,escaped_string).replace(/\t!(.*?)%>/g,'",$1,"').split(" ").join('");').split("%>").join('___$$$___.push("').split("\r").join("")+"\");}return ___$$$___.join('');")}if(typeof data!="undefined"){return fn(data)}else{return fn}};Sammy.Template=function(app,method_alias){var template=function(template,data,name,options){if(typeof name=="undefined"){name=template}if(typeof options=="undefined"&&typeof name=="object"){options=name;name=template}return srender(name,template,$.extend({},this,data),options)};if(!method_alias){method_alias="template"}app.helper(method_alias,template)};return Sammy.Template});
View
5 lib/min/plugins/sammy.title-0.7.4.min.js
@@ -1,5 +0,0 @@
-// -- Sammy.js -- /plugins/sammy.title.js
-// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:15 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).Title=e(window.jQuery,window.Sammy)})(function(e,t){return t.Title=function(){this.setTitle=function(t){e.isFunction(t)?this.title_function=t:this.title_function=function(e){return[t,e].join(" ")}},this.helper("title",function(){var t=e.makeArray(arguments).join(" ");this.app.title_function&&(t=this.app.title_function(t)),document.title=t})},t.Title});
View
5 lib/min/plugins/sammy.title-0.7.5.min.js
@@ -0,0 +1,5 @@
+// -- Sammy.js -- /plugins/sammy.title.js
+// http://sammyjs.org
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:14 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).Title=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.Title=function(){this.setTitle=function(title){if(!$.isFunction(title)){this.title_function=function(additional_title){return[title,additional_title].join(" ")}}else{this.title_function=title}};this.helper("title",function(){var new_title=$.makeArray(arguments).join(" ");if(this.app.title_function){new_title=this.app.title_function(new_title)}document.title=new_title})};return Sammy.Title});
View
6 lib/min/plugins/sammy.title-latest.min.js
@@ -1,5 +1,5 @@
// -- Sammy.js -- /plugins/sammy.title.js
// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:15 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy"],e):(window.Sammy=window.Sammy||{}).Title=e(window.jQuery,window.Sammy)})(function(e,t){return t.Title=function(){this.setTitle=function(t){e.isFunction(t)?this.title_function=t:this.title_function=function(e){return[t,e].join(" ")}},this.helper("title",function(){var t=e.makeArray(arguments).join(" ");this.app.title_function&&(t=this.app.title_function(t)),document.title=t})},t.Title});
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:14 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy"],factory)}else{(window.Sammy=window.Sammy||{}).Title=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.Title=function(){this.setTitle=function(title){if(!$.isFunction(title)){this.title_function=function(additional_title){return[title,additional_title].join(" ")}}else{this.title_function=title}};this.helper("title",function(){var new_title=$.makeArray(arguments).join(" ");if(this.app.title_function){new_title=this.app.title_function(new_title)}document.title=new_title})};return Sammy.Title});
View
5 lib/min/plugins/sammy.tmpl-0.7.4.min.js
@@ -1,5 +0,0 @@
-// -- Sammy.js -- /plugins/sammy.tmpl.js
-// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:16 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy","jquery.tmpl"],e):(window.Sammy=window.Sammy||{}).Tmpl=e(window.jQuery,window.Sammy)})(function(e,t){return t.Tmpl=function(t,n){var r=function(t,n,r){var i=t;e.template[i]||e.template(i,t),n=e.extend({},this,n),r=e.extend({},n.partials,r);for(partial in r)e.template[partial]||e.template(partial,r[partial]);return e.tmpl(i,e.extend({},this,n))};n||(n="tmpl"),t.helper(n,r)},t.Tmpl});
View
5 lib/min/plugins/sammy.tmpl-0.7.5.min.js
@@ -0,0 +1,5 @@
+// -- Sammy.js -- /plugins/sammy.tmpl.js
+// http://sammyjs.org
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:14 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy","jquery.tmpl"],factory)}else{(window.Sammy=window.Sammy||{}).Tmpl=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.Tmpl=function(app,method_alias){var template=function(template,data,partials){var name=template;if(!$.template[name]){$.template(name,template)}data=$.extend({},this,data);partials=$.extend({},data.partials,partials);for(partial in partials){if(!$.template[partial]){$.template(partial,partials[partial])}}return $.tmpl(name,$.extend({},this,data))};if(!method_alias){method_alias="tmpl"}app.helper(method_alias,template)};return Sammy.Tmpl});
View
6 lib/min/plugins/sammy.tmpl-latest.min.js
@@ -1,5 +1,5 @@
// -- Sammy.js -- /plugins/sammy.tmpl.js
// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:16 -0500
-(function(e){typeof define=="function"&&define.amd?define(["jquery","sammy","jquery.tmpl"],e):(window.Sammy=window.Sammy||{}).Tmpl=e(window.jQuery,window.Sammy)})(function(e,t){return t.Tmpl=function(t,n){var r=function(t,n,r){var i=t;e.template[i]||e.template(i,t),n=e.extend({},this,n),r=e.extend({},n.partials,r);for(partial in r)e.template[partial]||e.template(partial,r[partial]);return e.tmpl(i,e.extend({},this,n))};n||(n="tmpl"),t.helper(n,r)},t.Tmpl});
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:14 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","sammy","jquery.tmpl"],factory)}else{(window.Sammy=window.Sammy||{}).Tmpl=factory(window.jQuery,window.Sammy)}})(function($,Sammy){Sammy.Tmpl=function(app,method_alias){var template=function(template,data,partials){var name=template;if(!$.template[name]){$.template(name,template)}data=$.extend({},this,data);partials=$.extend({},data.partials,partials);for(partial in partials){if(!$.template[partial]){$.template(partial,partials[partial])}}return $.tmpl(name,$.extend({},this,data))};if(!method_alias){method_alias="tmpl"}app.helper(method_alias,template)};return Sammy.Tmpl});
View
8 lib/min/sammy-0.7.4.min.js
@@ -1,8 +0,0 @@
-// -- Sammy.js -- /sammy.js
-// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:16 -0500
-// name: sammy
-// version: 0.7.4
-// Sammy.js / http://sammyjs.org
-(function(e,t){(function(n){typeof define=="function"&&define.amd?define(["jquery"],n):e.sammy=t.Sammy=n(e)})(function(e){var n,r="([^/]+)",i=/:([\w\d]+)/g,s=/\?([^#]*)?$/,o=function(e){return Array.prototype.slice.call(e)},u=function(e){return Object.prototype.toString.call(e)==="[object Function]"},a=function(e){return Object.prototype.toString.call(e)==="[object Array]"},f=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},l=function(e){return decodeURIComponent((e||"").replace(/\+/g," "))},c=encodeURIComponent,h=function(e){return String(e).replace(/&(?!\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},p=function(e){return function(){return this.route.apply(this,[e].concat(Array.prototype.slice.call(arguments)))}},d={},v=!!t.history&&!!history.pushState,m=[];return n=function(){var t=o(arguments),r,i;n.apps=n.apps||{};if(t.length===0||t[0]&&u(t[0]))return n.apply(n,["body"].concat(t));if(typeof (i=t.shift())=="string")return r=n.apps[i]||new n.Application,r.element_selector=i,t.length>0&&e.each(t,function(e,t){r.use(t)}),r.element_selector!=i&&delete n.apps[i],n.apps[r.element_selector]=r,r},n.VERSION="0.7.4",n.addLogger=function(e){m.push(e)},n.log=function(){var t=o(arguments);t.unshift("["+Date()+"]"),e.each(m,function(e,r){r.apply(n,t)})},typeof t.console!="undefined"?u(t.console.log.apply)?n.addLogger(function(){t.console.log.apply(t.console,arguments)}):n.addLogger(function(){t.console.log(arguments)}):typeof console!="undefined"&&n.addLogger(function(){console.log.apply(console,arguments)}),e.extend(n,{makeArray:o,isFunction:u,isArray:a}),n.Object=function(t){return e.extend(this,t||{})},e.extend(n.Object.prototype,{escapeHTML:h,h:h,toHash:function(){var t={};return e.each(this,function(e,n){u(n)||(t[e]=n)}),t},toHTML:function(){var t="";return e.each(this,function(e,n){u(n)||(t+="<strong>"+e+"</strong> "+n+"<br />")}),t},keys:function(e){var t=[];for(var n in this)(!u(this[n])||!e)&&t.push(n);return t},has:function(t){return this[t]&&e.trim(this[t].toString())!==""},join:function(){var e=o(arguments),t=e.shift();return e.join(t)},log:function(){n.log.apply(n,arguments)},toString:function(t){var n=[];return e.each(this,function(e,r){(!u(r)||t)&&n.push('"'+e+'": '+r.toString())}),"Sammy.Object: {"+n.join(",")+"}"}}),n.targetIsThisWindow=function(r){var i=e(r.target).attr("target");return!i||i===t.name||i==="_self"?!0:i==="_blank"?!1:i==="top"&&t===t.top?!0:!1},n.DefaultLocationProxy=function(e,t){this.app=e,this.is_native=!1,this.has_history=v,this._startPolling(t)},n.DefaultLocationProxy.fullPath=function(e){var t=e.toString().match(/^[^#]*(#.+)$/),n=t?t[1]:"";return[e.pathname,e.search,n].join("")},e.extend(n.DefaultLocationProxy.prototype,{bind:function(){var r=this,i=this.app,s=n.DefaultLocationProxy;e(t).bind("hashchange."+this.app.eventNamespace(),function(e,n){r.is_native===!1&&!n&&(r.is_native=!0,t.clearInterval(s._interval),s._interval=null),i.trigger("location-changed")}),v&&!i.disable_push_state&&(e(t).bind("popstate."+this.app.eventNamespace(),function(e){i.trigger("location-changed")}),e(document).delegate("a","click.history-"+this.app.eventNamespace(),function(e){if(e.isDefaultPrevented()||e.metaKey||e.ctrlKey)return;var o=s.fullPath(this);if(this.hostname==t.location.hostname&&i.lookupRoute("get",o)&&n.targetIsThisWindow(e))return e.preventDefault(),r.setLocation(o),!1})),s._bindings||(s._bindings=0),s._bindings++},unbind:function(){e(t).unbind("hashchange."+this.app.eventNamespace()),e(t).unbind("popstate."+this.app.eventNamespace()),e(document).undelegate("a","click.history-"+this.app.eventNamespace()),n.DefaultLocationProxy._bindings--,n.DefaultLocationProxy._bindings<=0&&(t.clearInterval(n.DefaultLocationProxy._interval),n.DefaultLocationProxy._interval=null)},getLocation:function(){return n.DefaultLocationProxy.fullPath(t.location)},setLocation:function(e){/^([^#\/]|$)/.test(e)&&(v&&!this.app.disable_push_state?e="/"+e:e="#!/"+e);if(e!=this.getLocation()){if(!(v&&!this.app.disable_push_state&&/^\//.test(e)))return t.location=e;history.pushState({path:e},t.title,e),this.app.trigger("location-changed")}},_startPolling:function(r){var i=this;if(!n.DefaultLocationProxy._interval){r||(r=10);var s=function(){var r=i.getLocation();(typeof n.DefaultLocationProxy._last_location=="undefined"||r!=n.DefaultLocationProxy._last_location)&&t.setTimeout(function(){e(t).trigger("hashchange",[!0])},0),n.DefaultLocationProxy._last_location=r};s(),n.DefaultLocationProxy._interval=t.setInterval(s,r)}}}),n.Application=function(e){var t=this;this.routes={},this.listeners=new n.Object({}),this.arounds=[],this.befores=[],this.namespace=(new Date).getTime()+"-"+parseInt(Math.random()*1e3,10),this.context_prototype=function(){n.EventContext.apply(this,arguments)},this.context_prototype.prototype=new n.EventContext,u(e)&&e.apply(this,[this]),this._location_proxy||this.setLocationProxy(new n.DefaultLocationProxy(this,this.run_interval_every)),this.debug&&this.bindToAllEvents(function(e,n){t.log(t.toString(),e.cleaned_type,n||{})})},n.Application.prototype=e.extend({},n.Object.prototype,{ROUTE_VERBS:["get","post","put","delete"],APP_EVENTS:["run","unload","lookup-route","run-route","route-found","event-context-before","event-context-after","changed","error","check-form-submission","redirect","location-changed"],_last_route:null,_location_proxy:null,_running:!1,element_selector:"body",debug:!1,raise_errors:!1,run_interval_every:50,disable_push_state:!1,template_engine:null,toString:function(){return"Sammy.Application:"+this.element_selector},$element:function(t){return t?e(this.element_selector).find(t):e(this.element_selector)},use:function(){var e=o(arguments),t=e.shift(),r=t||"";try{e.unshift(this),typeof t=="string"&&(r="Sammy."+t,t=n[t]),t.apply(this,e)}catch(i){typeof t=="undefined"?this.error("Plugin Error: called use() but plugin ("+r.toString()+") is not defined",i):u(t)?this.error("Plugin Error",i):this.error("Plugin Error: called use() but '"+r.toString()+"' is not a function",i)}return this},setLocationProxy:function(e){var t=this._location_proxy;this._location_proxy=e,this.isRunning()&&(t&&t.unbind(),this._location_proxy.bind())},log:function(){n.log.apply(n,Array.prototype.concat.apply([this.element_selector],arguments))},route:function(t,n){var s=this,o=[],a,f,l=Array.prototype.slice.call(arguments,2);l.length===0&&u(n)&&(n=t,l=[n],t="any"),t=t.toLowerCase();if(n.constructor==String){i.lastIndex=0;while((f=i.exec(n))!==null)o.push(f[1]);n=new RegExp(n.replace(i,r)+"$")}return e.each(l,function(e,t){typeof t=="string"&&(l[e]=s[t])}),a=function(e){var t={verb:e,path:n,callback:l,param_names:o};s.routes[e]=s.routes[e]||[],s.routes[e].push(t)},t==="any"?e.each(this.ROUTE_VERBS,function(e,t){a(t)}):a(t),this},get:p("get"),post:p("post"),put:p("put"),del:p("delete"),any:p("any"),mapRoutes:function(t){var n=this;return e.each(t,function(e,t){n.route.apply(n,t)}),this},eventNamespace:function(){return["sammy-app",this.namespace].join("-")},bind:function(e,t,n){var r=this;typeof n=="undefined"&&(n=t);var i=function(){var e,t,i;e=arguments[0],i=arguments[1],i&&i.context?(t=i.context,delete i.context):t=new r.context_prototype(r,"bind",e.type,i,e.target),e.cleaned_type=e.type.replace(r.eventNamespace(),""),n.apply(t,[e,i])};return this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(i),this.isRunning()&&this._listen(e,i),this},trigger:function(e,t){return this.$element().trigger([e,this.eventNamespace()].join("."),[t]),this},refresh:function(){return this.last_location=null,this.trigger("location-changed"),this},before:function(e,t){return u(e)&&(t=e,e={}),this.befores.push([e,t]),this},after:function(e){return this.bind("event-context-after",e)},around:function(e){return this.arounds.push(e),this},onComplete:function(e){return this._onComplete=e,this},isRunning:function(){return this._running},helpers:function(t){return e.extend(this.context_prototype.prototype,t),this},helper:function(e,t){return this.context_prototype.prototype[e]=t,this},run:function(r){if(this.isRunning())return!1;var i=this;return e.each(this.listeners.toHash(),function(t,n){e.each(n,function(e,n){i._listen(t,n)})}),this.trigger("run",{start_url:r}),this._running=!0,this.last_location=null,!/\#(.+)/.test(this.getLocation())&&typeof r!="undefined"&&this.setLocation(r),this._checkLocation(),this._location_proxy.bind(),this.bind("location-changed",function(){i._checkLocation()}),this.bind("submit",function(t){if(!n.targetIsThisWindow(t))return!0;var r=i._checkFormSubmission(e(t.target).closest("form"));return r===!1?t.preventDefault():!1}),e(t).bind("unload",function(){i.unload()}),this.trigger("changed")},unload:function(){if(!this.isRunning())return!1;var t=this;return this.trigger("unload"),this._location_proxy.unbind(),this.$element().unbind("submit").removeClass(t.eventNamespace()),e.each(this.listeners.toHash(),function(n,r){e.each(r,function(e,r){t._unlisten(n,r)})}),this._running=!1,this},destroy:function(){return this.unload(),delete n.apps[this.element_selector],this},bindToAllEvents:function(t){var n=this;return e.each(this.APP_EVENTS,function(e,r){n.bind(r,t)}),e.each(this.listeners.keys(!0),function(r,i){e.inArray(i,n.APP_EVENTS)==-1&&n.bind(i,t)}),this},routablePath:function(e){return e.replace(s,"")},lookupRoute:function(e,t){var n=this,r=!1,i=0,s,o;if(typeof this.routes[e]!="undefined"){s=this.routes[e].length;for(;i<s;i++){o=this.routes[e][i];if(n.routablePath(t).match(o.path)){r=o;break}}}return r},runRoute:function(t,n,r,i){var s=this,o=this.lookupRoute(t,n),u,a,f,c,h,p,d,v,m;this.debug&&this.log("runRoute",[t,n].join(" ")),this.trigger("run-route",{verb:t,path:n,params:r}),typeof r=="undefined"&&(r={}),e.extend(r,this._parseQueryString(n));if(o){this.trigger("route-found",{route:o}),(v=o.path.exec(this.routablePath(n)))!==null&&(v.shift(),e.each(v,function(e,t){o.param_names[e]?r[o.param_names[e]]=l(t):(r.splat||(r.splat=[]),r.splat.push(l(t)))})),u=new this.context_prototype(this,t,n,r,i),f=this.arounds.slice(0),h=this.befores.slice(0),d=[u],r.splat&&(d=d.concat(r.splat)),a=function(){var e,t,n;while(h.length>0){p=h.shift();if(s.contextMatchesOptions(u,p[0])){e=p[1].apply(u,[u]);if(e===!1)return!1}}return s.last_route=o,u.trigger("event-context-before",{context:u}),typeof o.callback=="function"&&(o.callback=[o.callback]),o.callback&&o.callback.length&&(t=-1,n=function(){t++,o.callback[t]?e=o.callback[t].apply(u,d):s._onComplete&&typeof (s._onComplete==="function")&&s._onComplete(u)},d.push(n),n()),u.trigger("event-context-after",{context:u}),e},e.each(f.reverse(),function(e,t){var n=a;a=function(){return t.apply(u,[n])}});try{m=a()}catch(g){this.error(["500 Error",t,n].join(" "),g)}return m}return this.notFound(t,n)},contextMatchesOptions:function(t,n,r){var i=n;if(typeof i=="string"||f(i))i={path:i};typeof r=="undefined"&&(r=!0);if(e.isEmptyObject(i))return!0;if(a(i.path)){var s,o,u,l;s=[];for(o=0,l=i.path.length;o<l;o+=1)u=e.extend({},i,{path:i.path[o]}),s.push(this.contextMatchesOptions(t,u));var c=e.inArray(!0,s)>-1?!0:!1;return r?c:!c}if(i.only)return this.contextMatchesOptions(t,i.only,!0);if(i.except)return this.contextMatchesOptions(t,i.except,!1);var h=!0,p=!0;return i.path&&(f(i.path)||(i.path=new RegExp(i.path.toString()+"$")),h=i.path.test(t.path)),i.verb&&(typeof i.verb=="string"?p=i.verb===t.verb:p=i.verb.indexOf(t.verb)>-1),r?p&&h:!p||!h},getLocation:function(){return this._location_proxy.getLocation()},setLocation:function(e){return this._location_proxy.setLocation(e)},swap:function(e,t){var n=this.$element().html(e);return u(t)&&t(e),n},templateCache:function(e,t){return typeof t!="undefined"?d[e]=t:d[e]},clearTemplateCache:function(){return d={}},notFound:function(e,t){var n=this.error(["404 Not Found",e,t].join(" "));return e==="get"?n:!0},error:function(e,t){t||(t=new Error),t.message=[e,t.message].join(" "),this.trigger("error",{message:t.message,error:t});if(this.raise_errors)throw t;this.log(t.message,t)},_checkLocation:function(){var e,t;e=this.getLocation();if(!this.last_location||this.last_location[0]!="get"||this.last_location[1]!=e)this.last_location=["get",e],t=this.runRoute("get",e);return t},_getFormVerb:function(t){var n=e(t),r,i;i=n.find('input[name="_method"]'),i.length>0&&(r=i.val()),r||(r=n[0].getAttribute("method"));if(!r||r==="")r="get";return e.trim(r.toString().toLowerCase())},_checkFormSubmission:function(t){var n,r,i,s,o;return this.trigger("check-form-submission",{form:t}),n=e(t),r=n.attr("action")||"",i=this._getFormVerb(n),this.debug&&this.log("_checkFormSubmission",n,r,i),i==="get"?(s=this._serializeFormParams(n),s!==""&&(r+="?"+s),this.setLocation(r),o=!1):(s=e.extend({},this._parseFormParams(n)),o=this.runRoute(i,r,s,t.get(0))),typeof o=="undefined"?!1:o},_serializeFormParams:function(e){var t="",n=e.serializeArray(),r;if(n.length>0){t=this._encodeFormPair(n[0].name,n[0].value);for(r=1;r<n.length;r++)t=t+"&"+this._encodeFormPair(n[r].name,n[r].value)}return t},_encodeFormPair:function(e,t){return c(e)+"="+c(t)},_parseFormParams:function(e){var t={},n=e.serializeArray(),r;for(r=0;r<n.length;r++)t=this._parseParamPair(t,n[r].name,n[r].value);return t},_parseQueryString:function(e){var t={},n,r,i,o;n=e.match(s);if(n&&n[1]){r=n[1].split("&");for(o=0;o<r.length;o++)i=r[o].split("="),t=this._parseParamPair(t,l(i[0]),l(i[1]||""))}return t},_parseParamPair:function(e,t,n){return typeof e[t]!="undefined"?a(e[t])?e[t].push(n):e[t]=[e[t],n]:e[t]=n,e},_listen:function(e,t){return this.$element().bind([e,this.eventNamespace()].join("."),t)},_unlisten:function(e,t){return this.$element().unbind([e,this.eventNamespace()].join("."),t)}}),n.RenderContext=function(e){this.event_context=e,this.callbacks=[],this.previous_content=null,this.content=null,this.next_engine=!1,this.waiting=!1},n.RenderContext.prototype=e.extend({},n.Object.prototype,{then:function(e){if(!u(e)){if(!(typeof e=="string"&&e in this.event_context))return this;var n=this.event_context[e];e=function(e){return n.apply(this.event_context,[e])}}var r=this;return this.waiting?this.callbacks.push(e):(this.wait(),t.setTimeout(function(){var t=e.apply(r,[r.content,r.previous_content]);t!==!1&&r.next(t)},0)),this},wait:function(){this.waiting=!0},next:function(e){this.waiting=!1,typeof e!="undefined"&&(this.previous_content=this.content,this.content=e),this.callbacks.length>0&&this.then(this.callbacks.shift())},load:function(t,n,r){var i=this;return this.then(function(){var s,o,a,f;u(n)?(r=n,n={}):n=e.extend({},n),r&&this.then(r);if(typeof t=="string")return a=t.match(/\.json$/)||n.json,s=a?n.cache===!0:n.cache!==!1,i.next_engine=i.event_context.engineFor(t),delete n.cache,delete n.json,n.engine&&(i.next_engine=n.engine,delete n.engine),s&&(o=this.event_context.app.templateCache(t))?o:(this.wait(),e.ajax(e.extend({url:t,data:{},dataType:a?"json":"text",type:"get",success:function(e){s&&i.event_context.app.templateCache(t,e),i.next(e)}},n)),!1);if(t.nodeType)return t.innerHTML;if(t.selector)return i.next_engine=t.attr("data-engine"),n.clone===!1?t.remove()[0].innerHTML.toString():t[0].innerHTML.toString()})},loadPartials:function(e){var t;if(e){this.partials=this.partials||{};for(t in e)(function(t,n){t.load(e[n]).then(function(e){this.partials[n]=e})})(this,t)}return this},render:function(e,t,n,r){return u(e)&&!t?this.then(e):(u(t)?(r=n,n=t,t=null):n&&!u(n)&&(r=n,n=null),this.loadPartials(r).load(e).interpolate(t,e).then(n))},partial:function(e,t,n,r){return u(n)?this.render(e,t,r).swap(n):u(t)?this.render(e,{},n).swap(t):this.render(e,t,n).swap()},send:function(){var e=this,t=o(arguments),n=t.shift();return a(t[0])&&(t=t[0]),this.then(function(r){return t.push(function(t){e.next(t)}),e.wait(),n.apply(n,t),!1})},collect:function(t,n,r){var i=this,s=function(){u(t)&&(n=t,t=this.content);var r=[],s=!1;return e.each(t,function(e,t){var o=n.apply(i,[e,t]);return o.jquery&&o.length==1&&(o=o[0],s=!0),r.push(o),o}),s?r:r.join("")};return r?s():this.then(s)},renderEach:function(t,n,r,i){return a(n)&&(i=r,r=n,n=null),this.load(t).then(function(s){var o=this;r||(r=a(this.previous_content)?this.previous_content:[]);if(!i)return this.collect(r,function(e,r){var i={},o=this.next_engine||t;return n?i[n]=r:i=r,this.event_context.interpolate(s,i,o)},!0);e.each(r,function(e,r){var u={},a=this.next_engine||t;n?u[n]=r:u=r,i(r,o.event_context.interpolate(s,u,a))})})},interpolate:function(e,t,n){var r=this;return this.then(function(i,s){!e&&s&&(e=s),this.next_engine&&(t=this.next_engine,this.next_engine=!1);var o=r.event_context.interpolate(i,e,t,this.partials);return n?s+o:o})},swap:function(e){return this.then(function(t){return this.event_context.swap(t,e),t}).trigger("changed",{})},appendTo:function(t){return this.then(function(n){e(t).append(n)}).trigger("changed",{})},prependTo:function(t){return this.then(function(n){e(t).prepend(n)}).trigger("changed",{})},replace:function(t){return this.then(function(n){e(t).html(n)}).trigger("changed",{})},trigger:function(e,t){return this.then(function(n){return typeof t=="undefined"&&(t={content:n}),this.event_context.trigger(e,t),n})}}),n.EventContext=function(e,t,r,i,s){this.app=e,this.verb=t,this.path=r,this.params=new n.Object(i),this.target=s},n.EventContext.prototype=e.extend({},n.Object.prototype,{$element:function(){return this.app.$element(o(arguments).shift())},engineFor:function(e){var t=this,n;if(u(e))return e;e=(e||t.app.template_engine).toString();if(n=e.match(/\.([^\.\?\#]+)$/))e=n[1];return e&&u(t[e])?t[e]:t.app.template_engine?this.engineFor(t.app.template_engine):function(e,t){return e}},interpolate:function(e,t,n,r){return this.engineFor(n).apply(this,[e,t,r])},render:function(e,t,r,i){return(new n.RenderContext(this)).render(e,t,r,i)},renderEach:function(e,t,r,i){return(new n.RenderContext(this)).renderEach(e,t,r,i)},load:function(e,t,r){return(new n.RenderContext(this)).load(e,t,r)},loadPartials:function(e){return(new n.RenderContext(this)).loadPartials(e)},partial:function(e,t,r,i){return(new n.RenderContext(this)).partial(e,t,r,i)},send:function(){var e=new n.RenderContext(this);return e.send.apply(e,arguments)},redirect:function(){var t,n=o(arguments),r=this.app.getLocation(),i=n.length;if(i>1){var s=0,u=[],a=[],f={},l=!1;for(;s<i;s++)typeof n[s]=="string"?u.push(n[s]):(e.extend(f,n[s]),l=!0);t=u.join("/");if(l){for(var c in f)a.push(this.app._encodeFormPair(c,f[c]));t+="?"+a.join("&")}}else t=n[0];this.trigger("redirect",{to:t}),this.app.last_location=[this.verb,this.path],this.app.setLocation(t),(new RegExp(t)).test(r)&&this.app.trigger("location-changed")},trigger:function(e,t){return typeof t=="undefined"&&(t={}),t.context||(t.context=this),this.app.trigger(e,t)},eventNamespace:function(){return this.app.eventNamespace()},swap:function(e,t){return this.app.swap(e,t)},notFound:function(){return this.app.notFound(this.verb,this.path)},json:function(t){return e.parseJSON(t)},toString:function(){return"Sammy.EventContext: "+[this.verb,this.path,this.params].join(" ")}}),n})})(jQuery,window);
View
5 lib/min/sammy-0.7.5.min.js
@@ -0,0 +1,5 @@
+// -- Sammy.js -- /sammy.js
+// http://sammyjs.org
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:15 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory)}else{jQuery.sammy=window.Sammy=factory(jQuery)}})(function($){var Sammy,PATH_REPLACER="([^/]+)",PATH_NAME_MATCHER=/:([\w\d]+)/g,QUERY_STRING_MATCHER=/\?([^#]*)?$/,_makeArray=function(nonarray){return Array.prototype.slice.call(nonarray)},_isFunction=function(obj){return Object.prototype.toString.call(obj)==="[object Function]"},_isArray=function(obj){return Object.prototype.toString.call(obj)==="[object Array]"},_isRegExp=function(obj){return Object.prototype.toString.call(obj)==="[object RegExp]"},_decode=function(str){return decodeURIComponent((str||"").replace(/\+/g," "))},_encode=encodeURIComponent,_escapeHTML=function(s){return String(s).replace(/&(?!\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},_routeWrapper=function(verb){return function(){return this.route.apply(this,[verb].concat(Array.prototype.slice.call(arguments)))}},_template_cache={},_has_history=!!(window.history&&history.pushState),loggers=[];Sammy=function(){var args=_makeArray(arguments),app,selector;Sammy.apps=Sammy.apps||{};if(args.length===0||args[0]&&_isFunction(args[0])){return Sammy.apply(Sammy,["body"].concat(args))}else if(typeof(selector=args.shift())=="string"){app=Sammy.apps[selector]||new Sammy.Application;app.element_selector=selector;if(args.length>0){$.each(args,function(i,plugin){app.use(plugin)})}if(app.element_selector!=selector){delete Sammy.apps[selector]}Sammy.apps[app.element_selector]=app;return app}};Sammy.VERSION="0.7.5";Sammy.addLogger=function(logger){loggers.push(logger)};Sammy.log=function(){var args=_makeArray(arguments);args.unshift("["+Date()+"]");$.each(loggers,function(i,logger){logger.apply(Sammy,args)})};if(typeof window.console!="undefined"){if(typeof window.console.log==="function"&&_isFunction(window.console.log.apply)){Sammy.addLogger(function(){window.console.log.apply(window.console,arguments)})}else{Sammy.addLogger(function(){window.console.log(arguments)})}}else if(typeof console!="undefined"){Sammy.addLogger(function(){console.log.apply(console,arguments)})}$.extend(Sammy,{makeArray:_makeArray,isFunction:_isFunction,isArray:_isArray});Sammy.Object=function(obj){return $.extend(this,obj||{})};$.extend(Sammy.Object.prototype,{escapeHTML:_escapeHTML,h:_escapeHTML,toHash:function(){var json={};$.each(this,function(k,v){if(!_isFunction(v)){json[k]=v}});return json},toHTML:function(){var display="";$.each(this,function(k,v){if(!_isFunction(v)){display+="<strong>"+k+"</strong> "+v+"<br />"}});return display},keys:function(attributes_only){var keys=[];for(var property in this){if(!_isFunction(this[property])||!attributes_only){keys.push(property)}}return keys},has:function(key){return this[key]&&$.trim(this[key].toString())!==""},join:function(){var args=_makeArray(arguments);var delimiter=args.shift();return args.join(delimiter)},log:function(){Sammy.log.apply(Sammy,arguments)},toString:function(include_functions){var s=[];$.each(this,function(k,v){if(!_isFunction(v)||include_functions){s.push('"'+k+'": '+v.toString())}});return"Sammy.Object: {"+s.join(",")+"}"}});Sammy.targetIsThisWindow=function targetIsThisWindow(event,tagName){var targetElement=$(event.target).closest(tagName);if(targetElement.length===0){return true}var targetWindow=targetElement.attr("target");if(!targetWindow||targetWindow===window.name||targetWindow==="_self"){return true}if(targetWindow==="_blank"){return false}if(targetWindow==="top"&&window===window.top){return true}return false};Sammy.DefaultLocationProxy=function(app,run_interval_every){this.app=app;this.is_native=false;this.has_history=_has_history;this._startPolling(run_interval_every)};Sammy.DefaultLocationProxy.fullPath=function(location_obj){var matches=location_obj.toString().match(/^[^#]*(#.+)$/);var hash=matches?matches[1]:"";return[location_obj.pathname,location_obj.search,hash].join("")};$.extend(Sammy.DefaultLocationProxy.prototype,{bind:function(){var proxy=this,app=this.app,lp=Sammy.DefaultLocationProxy;$(window).bind("hashchange."+this.app.eventNamespace(),function(e,non_native){if(proxy.is_native===false&&!non_native){proxy.is_native=true;window.clearInterval(lp._interval);lp._interval=null}app.trigger("location-changed")});if(_has_history&&!app.disable_push_state){$(window).bind("popstate."+this.app.eventNamespace(),function(e){app.trigger("location-changed")});$(document).delegate("a","click.history-"+this.app.eventNamespace(),function(e){if(e.isDefaultPrevented()||e.metaKey||e.ctrlKey){return}var full_path=lp.fullPath(this),hostname=this.hostname?this.hostname:function(a){var l=document.createElement("a");l.href=a.href;return l.hostname}(this);if(hostname==window.location.hostname&&app.lookupRoute("get",full_path)&&Sammy.targetIsThisWindow(e,"a")){e.preventDefault();proxy.setLocation(full_path);return false}})}if(!lp._bindings){lp._bindings=0}lp._bindings++},unbind:function(){$(window).unbind("hashchange."+this.app.eventNamespace());$(window).unbind("popstate."+this.app.eventNamespace());$(document).undelegate("a","click.history-"+this.app.eventNamespace());Sammy.DefaultLocationProxy._bindings--;if(Sammy.DefaultLocationProxy._bindings<=0){window.clearInterval(Sammy.DefaultLocationProxy._interval);Sammy.DefaultLocationProxy._interval=null}},getLocation:function(){return Sammy.DefaultLocationProxy.fullPath(window.location)},setLocation:function(new_location){if(/^([^#\/]|$)/.test(new_location)){if(_has_history&&!this.app.disable_push_state){new_location="/"+new_location}else{new_location="#!/"+new_location}}if(new_location!=this.getLocation()){if(_has_history&&!this.app.disable_push_state&&/^\//.test(new_location)){history.pushState({path:new_location},window.title,new_location);this.app.trigger("location-changed")}else{return window.location=new_location}}},_startPolling:function(every){var proxy=this;if(!Sammy.DefaultLocationProxy._interval){if(!every){every=10}var hashCheck=function(){var current_location=proxy.getLocation();if(typeof Sammy.DefaultLocationProxy._last_location=="undefined"||current_location!=Sammy.DefaultLocationProxy._last_location){window.setTimeout(function(){$(window).trigger("hashchange",[true])},0)}Sammy.DefaultLocationProxy._last_location=current_location};hashCheck();Sammy.DefaultLocationProxy._interval=window.setInterval(hashCheck,every)}}});Sammy.Application=function(app_function){var app=this;this.routes={};this.listeners=new Sammy.Object({});this.arounds=[];this.befores=[];this.namespace=(new Date).getTime()+"-"+parseInt(Math.random()*1e3,10);this.context_prototype=function(){Sammy.EventContext.apply(this,arguments)};this.context_prototype.prototype=new Sammy.EventContext;if(_isFunction(app_function)){app_function.apply(this,[this])}if(!this._location_proxy){this.setLocationProxy(new Sammy.DefaultLocationProxy(this,this.run_interval_every))}if(this.debug){this.bindToAllEvents(function(e,data){app.log(app.toString(),e.cleaned_type,data||{})})}};Sammy.Application.prototype=$.extend({},Sammy.Object.prototype,{ROUTE_VERBS:["get","post","put","delete"],APP_EVENTS:["run","unload","lookup-route","run-route","route-found","event-context-before","event-context-after","changed","error","check-form-submission","redirect","location-changed"],_last_route:null,_location_proxy:null,_running:false,element_selector:"body",debug:false,raise_errors:false,run_interval_every:50,disable_push_state:false,template_engine:null,toString:function(){return"Sammy.Application:"+this.element_selector},$element:function(selector){return selector?$(this.element_selector).find(selector):$(this.element_selector)},use:function(){var args=_makeArray(arguments),plugin=args.shift(),plugin_name=plugin||"";try{args.unshift(this);if(typeof plugin=="string"){plugin_name="Sammy."+plugin;plugin=Sammy[plugin]}plugin.apply(this,args)}catch(e){if(typeof plugin==="undefined"){this.error("Plugin Error: called use() but plugin ("+plugin_name.toString()+") is not defined",e)}else if(!_isFunction(plugin)){this.error("Plugin Error: called use() but '"+plugin_name.toString()+"' is not a function",e)}else{this.error("Plugin Error",e)}}return this},setLocationProxy:function(new_proxy){var original_proxy=this._location_proxy;this._location_proxy=new_proxy;if(this.isRunning()){if(original_proxy){original_proxy.unbind()}this._location_proxy.bind()}},log:function(){Sammy.log.apply(Sammy,Array.prototype.concat.apply([this.element_selector],arguments))},route:function(verb,path){var app=this,param_names=[],add_route,path_match,callback=Array.prototype.slice.call(arguments,2);if(callback.length===0&&_isFunction(path)){callback=[path];path=verb;verb="any"}verb=verb.toLowerCase();if(path.constructor==String){PATH_NAME_MATCHER.lastIndex=0;while((path_match=PATH_NAME_MATCHER.exec(path))!==null){param_names.push(path_match[1])}path=new RegExp(path.replace(PATH_NAME_MATCHER,PATH_REPLACER)+"$")}$.each(callback,function(i,cb){if(typeof cb==="string"){callback[i]=app[cb]}});add_route=function(with_verb){var r={verb:with_verb,path:path,callback:callback,param_names:param_names};app.routes[with_verb]=app.routes[with_verb]||[];app.routes[with_verb].push(r)};if(verb==="any"){$.each(this.ROUTE_VERBS,function(i,v){add_route(v)})}else{add_route(verb)}return this},get:_routeWrapper("get"),post:_routeWrapper("post"),put:_routeWrapper("put"),del:_routeWrapper("delete"),any:_routeWrapper("any"),mapRoutes:function(route_array){var app=this;$.each(route_array,function(i,route_args){app.route.apply(app,route_args)});return this},eventNamespace:function(){return["sammy-app",this.namespace].join("-")},bind:function(name,data,callback){var app=this;if(typeof callback=="undefined"){callback=data}var listener_callback=function(){var e,context,data;e=arguments[0];data=arguments[1];if(data&&data.context){context=data.context;delete data.context}else{context=new app.context_prototype(app,"bind",e.type,data,e.target)}e.cleaned_type=e.type.replace(app.eventNamespace(),"");callback.apply(context,[e,data])};if(!this.listeners[name]){this.listeners[name]=[]}this.listeners[name].push(listener_callback);if(this.isRunning()){this._listen(name,listener_callback)}return this},trigger:function(name,data){this.$element().trigger([name,this.eventNamespace()].join("."),[data]);return this},refresh:function(){this.last_location=null;this.trigger("location-changed");return this},before:function(options,callback){if(_isFunction(options)){callback=options;options={}}this.befores.push([options,callback]);return this},after:function(callback){return this.bind("event-context-after",callback)},around:function(callback){this.arounds.push(callback);return this},onComplete:function(callback){this._onComplete=callback;return this},isRunning:function(){return this._running},helpers:function(extensions){$.extend(this.context_prototype.prototype,extensions);return this},helper:function(name,method){this.context_prototype.prototype[name]=method;return this},run:function(start_url){if(this.isRunning()){return false}var app=this;$.each(this.listeners.toHash(),function(name,callbacks){$.each(callbacks,function(i,listener_callback){app._listen(name,listener_callback)})});this.trigger("run",{start_url:start_url});this._running=true;this.last_location=null;if(!/\#(.+)/.test(this.getLocation())&&typeof start_url!="undefined"){this.setLocation(start_url)}this._checkLocation();this._location_proxy.bind();this.bind("location-changed",function(){app._checkLocation()});this.bind("submit",function(e){if(!Sammy.targetIsThisWindow(e,"form")){return true}var returned=app._checkFormSubmission($(e.target).closest("form"));return returned===false?e.preventDefault():false});$(window).bind("unload",function(){app.unload()});return this.trigger("changed")},unload:function(){if(!this.isRunning()){return false}var app=this;this.trigger("unload");this._location_proxy.unbind();this.$element().unbind("submit").removeClass(app.eventNamespace());$.each(this.listeners.toHash(),function(name,listeners){$.each(listeners,function(i,listener_callback){app._unlisten(name,listener_callback)})});this._running=false;return this},destroy:function(){this.unload();delete Sammy.apps[this.element_selector];return this},bindToAllEvents:function(callback){var app=this;$.each(this.APP_EVENTS,function(i,e){app.bind(e,callback)});$.each(this.listeners.keys(true),function(i,name){if($.inArray(name,app.APP_EVENTS)==-1){app.bind(name,callback)}});return this},routablePath:function(path){return path.replace(QUERY_STRING_MATCHER,"")},lookupRoute:function(verb,path){var app=this,routed=false,i=0,l,route;if(typeof this.routes[verb]!="undefined"){l=this.routes[verb].length;for(;i<l;i++){route=this.routes[verb][i];if(app.routablePath(path).match(route.path)){routed=route;break}}}return routed},runRoute:function(verb,path,params,target){var app=this,route=this.lookupRoute(verb,path),context,wrapped_route,arounds,around,befores,before,callback_args,path_params,final_returned;if(this.debug){this.log("runRoute",[verb,path].join(" "))}this.trigger("run-route",{verb:verb,path:path,params:params});if(typeof params=="undefined"){params={}}$.extend(params,this._parseQueryString(path));if(route){this.trigger("route-found",{route:route});if((path_params=route.path.exec(this.routablePath(path)))!==null){path_params.shift();$.each(path_params,function(i,param){if(route.param_names[i]){params[route.param_names[i]]=_decode(param)}else{if(!params.splat){params.splat=[]}params.splat.push(_decode(param))}})}context=new this.context_prototype(this,verb,path,params,target);arounds=this.arounds.slice(0);befores=this.befores.slice(0);callback_args=[context];if(params.splat){callback_args=callback_args.concat(params.splat)}wrapped_route=function(){var returned,i,nextRoute;while(befores.length>0){before=befores.shift();if(app.contextMatchesOptions(context,before[0])){returned=before[1].apply(context,[context]);if(returned===false){return false}}}app.last_route=route;context.trigger("event-context-before",{context:context});if(typeof route.callback==="function"){route.callback=[route.callback]}if(route.callback&&route.callback.length){i=-1;nextRoute=function(){i++;if(route.callback[i]){returned=route.callback[i].apply(context,callback_args)}else if(app._onComplete&&typeof(app._onComplete==="function")){app._onComplete(context)}};callback_args.push(nextRoute);nextRoute()}context.trigger("event-context-after",{context:context});return returned};$.each(arounds.reverse(),function(i,around){var last_wrapped_route=wrapped_route;wrapped_route=function(){return around.apply(context,[last_wrapped_route])}});try{final_returned=wrapped_route()}catch(e){this.error(["500 Error",verb,path].join(" "),e)}return final_returned}else{return this.notFound(verb,path)}},contextMatchesOptions:function(context,match_options,positive){var options=match_options;if(typeof options==="string"||_isRegExp(options)){options={path:options}}if(typeof positive==="undefined"){positive=true}if($.isEmptyObject(options)){return true}if(_isArray(options.path)){var results,numopt,opts,len;results=[];for(numopt=0,len=options.path.length;numopt<len;numopt+=1){opts=$.extend({},options,{path:options.path[numopt]});results.push(this.contextMatchesOptions(context,opts))}var matched=$.inArray(true,results)>-1?true:false;return positive?matched:!matched}if(options.only){return this.contextMatchesOptions(context,options.only,true)}else if(options.except){return this.contextMatchesOptions(context,options.except,false)}var path_matched=true,verb_matched=true;if(options.path){if(!_isRegExp(options.path)){options.path=new RegExp(options.path.toString()+"$")}path_matched=options.path.test(context.path)}if(options.verb){if(typeof options.verb==="string"){verb_matched=options.verb===context.verb}else{verb_matched=options.verb.indexOf(context.verb)>-1}}return positive?verb_matched&&path_matched:!(verb_matched&&path_matched)},getLocation:function(){return this._location_proxy.getLocation()},setLocation:function(new_location){return this._location_proxy.setLocation(new_location)},swap:function(content,callback){var $el=this.$element().html(content);if(_isFunction(callback)){callback(content)}return $el},templateCache:function(key,value){if(typeof value!="undefined"){return _template_cache[key]=value}else{return _template_cache[key]}},clearTemplateCache:function(){return _template_cache={}},notFound:function(verb,path){var ret=this.error(["404 Not Found",verb,path].join(" "));return verb==="get"?ret:true},error:function(message,original_error){if(!original_error){original_error=new Error}original_error.message=[message,original_error.message].join(" ");this.trigger("error",{message:original_error.message,error:original_error});if(this.raise_errors){throw original_error}else{this.log(original_error.message,original_error)}},_checkLocation:function(){var location,returned;location=this.getLocation();if(!this.last_location||this.last_location[0]!="get"||this.last_location[1]!=location){this.last_location=["get",location];returned=this.runRoute("get",location)}return returned},_getFormVerb:function(form){var $form=$(form),verb,$_method;$_method=$form.find('input[name="_method"]');if($_method.length>0){verb=$_method.val()}if(!verb){verb=$form[0].getAttribute("method")}if(!verb||verb===""){verb="get"}return $.trim(verb.toString().toLowerCase())},_checkFormSubmission:function(form){var $form,path,verb,params,returned;this.trigger("check-form-submission",{form:form});$form=$(form);path=$form.attr("action")||"";verb=this._getFormVerb($form);if(this.debug){this.log("_checkFormSubmission",$form,path,verb)}if(verb==="get"){params=this._serializeFormParams($form);if(params!==""){path+="?"+params}this.setLocation(path);returned=false}else{params=$.extend({},this._parseFormParams($form));returned=this.runRoute(verb,path,params,form.get(0))}return typeof returned=="undefined"?false:returned},_serializeFormParams:function($form){var queryString="",fields=$form.serializeArray(),i;if(fields.length>0){queryString=this._encodeFormPair(fields[0].name,fields[0].value);for(i=1;i<fields.length;i++){queryString=queryString+"&"+this._encodeFormPair(fields[i].name,fields[i].value)}}return queryString},_encodeFormPair:function(name,value){return _encode(name)+"="+_encode(value)},_parseFormParams:function($form){var params={},form_fields=$form.serializeArray(),i;for(i=0;i<form_fields.length;i++){params=this._parseParamPair(params,form_fields[i].name,form_fields[i].value)}return params},_parseQueryString:function(path){var params={},parts,pairs,pair,i;parts=path.match(QUERY_STRING_MATCHER);if(parts&&parts[1]){pairs=parts[1].split("&");for(i=0;i<pairs.length;i++){pair=pairs[i].split("=");params=this._parseParamPair(params,_decode(pair[0]),_decode(pair[1]||""))}}return params},_parseParamPair:function(params,key,value){if(typeof params[key]!=="undefined"){if(_isArray(params[key])){params[key].push(value)}else{params[key]=[params[key],value]}}else{params[key]=value}return params},_listen:function(name,callback){return this.$element().bind([name,this.eventNamespace()].join("."),callback)},_unlisten:function(name,callback){return this.$element().unbind([name,this.eventNamespace()].join("."),callback)}});Sammy.RenderContext=function(event_context){this.event_context=event_context;this.callbacks=[];this.previous_content=null;this.content=null;this.next_engine=false;this.waiting=false};Sammy.RenderContext.prototype=$.extend({},Sammy.Object.prototype,{then:function(callback){if(!_isFunction(callback)){if(typeof callback==="string"&&callback in this.event_context){var helper=this.event_context[callback];callback=function(content){return helper.apply(this.event_context,[content])}}else{return this}}var context=this;if(this.waiting){this.callbacks.push(callback)}else{this.wait();window.setTimeout(function(){var returned=callback.apply(context,[context.content,context.previous_content]);if(returned!==false){context.next(returned)}},0)}return this},wait:function(){this.waiting=true},next:function(content){this.waiting=false;if(typeof content!=="undefined"){this.previous_content=this.content;this.content=content}if(this.callbacks.length>0){this.then(this.callbacks.shift())}},load:function(location,options,callback){var context=this;return this.then(function(){var should_cache,cached,is_json,location_array;if(_isFunction(options)){callback=options;options={}}else{options=$.extend({},options)}if(callback){this.then(callback)}if(typeof location==="string"){is_json=location.match(/\.json(\?|$)/)||options.json;should_cache=is_json?options.cache===true:options.cache!==false;context.next_engine=context.event_context.engineFor(location);delete options.cache;delete options.json;if(options.engine){context.next_engine=options.engine;delete options.engine}if(should_cache&&(cached=this.event_context.app.templateCache(location))){return cached}this.wait();$.ajax($.extend({url:location,data:{},dataType:is_json?"json":"text",type:"get",success:function(data){if(should_cache){context.event_context.app.templateCache(location,data)}context.next(data)}},options));return false}else{if(location.nodeType){return location.innerHTML}if(location.selector){context.next_engine=location.attr("data-engine");if(options.clone===false){return location.remove()[0].innerHTML.toString()}else{return location[0].innerHTML.toString()}}}})},loadPartials:function(partials){var name;if(partials){this.partials=this.partials||{};for(name in partials){(function(context,name){context.load(partials[name]).then(function(template){this.partials[name]=template})})(this,name)}}return this},render:function(location,data,callback,partials){if(_isFunction(location)&&!data){return this.then(location)}else{if(_isFunction(data)){partials=callback;callback=data;data=null}else if(callback&&!_isFunction(callback)){partials=callback;callback=null}return this.loadPartials(partials).load(location).interpolate(data,location).then(callback)}},partial:function(location,data,callback,partials){if(_isFunction(callback)){return this.render(location,data,partials).swap(callback)}else if(_isFunction(data)){return this.render(location,{},callback).swap(data)}else{return this.render(location,data,callback).swap()}},send:function(){var context=this,args=_makeArray(arguments),fun=args.shift();if(_isArray(args[0])){args=args[0]}return this.then(function(content){args.push(function(response){context.next(response)});context.wait();fun.apply(fun,args);return false})},collect:function(array,callback,now){var context=this;var coll=function(){if(_isFunction(array)){callback=array;array=this.content}var contents=[],doms=false;$.each(array,function(i,item){var returned=callback.apply(context,[i,item]);if(returned.jquery&&returned.length==1){returned=returned[0];doms=true}contents.push(returned);return returned});return doms?contents:contents.join("")};return now?coll():this.then(coll)},renderEach:function(location,name,data,callback){if(_isArray(name)){callback=data;data=name;name=null}return this.load(location).then(function(content){var rctx=this;if(!data){data=_isArray(this.previous_content)?this.previous_content:[]}if(callback){$.each(data,function(i,value){var idata={},engine=this.next_engine||location;if(name){idata[name]=value}else{idata=value}callback(value,rctx.event_context.interpolate(content,idata,engine))})}else{return this.collect(data,function(i,value){var idata={},engine=this.next_engine||location;if(name){idata[name]=value}else{idata=value}return this.event_context.interpolate(content,idata,engine)},true)}})},interpolate:function(data,engine,retain){var context=this;return this.then(function(content,prev){if(!data&&prev){data=prev}if(this.next_engine){engine=this.next_engine;this.next_engine=false}var rendered=context.event_context.interpolate(content,data,engine,this.partials);return retain?prev+rendered:rendered})},swap:function(callback){return this.then(function(content){this.event_context.swap(content,callback);return content}).trigger("changed",{})},appendTo:function(selector){return this.then(function(content){$(selector).append(content)}).trigger("changed",{})},prependTo:function(selector){return this.then(function(content){$(selector).prepend(content)}).trigger("changed",{})},replace:function(selector){return this.then(function(content){$(selector).html(content)}).trigger("changed",{})},trigger:function(name,data){return this.then(function(content){if(typeof data=="undefined"){data={content:content}}this.event_context.trigger(name,data);return content})}});Sammy.EventContext=function(app,verb,path,params,target){this.app=app;this.verb=verb;this.path=path;this.params=new Sammy.Object(params);this.target=target};Sammy.EventContext.prototype=$.extend({},Sammy.Object.prototype,{$element:function(){return this.app.$element(_makeArray(arguments).shift())},engineFor:function(engine){var context=this,engine_match;if(_isFunction(engine)){return engine}engine=(engine||context.app.template_engine).toString();if(engine_match=engine.match(/\.([^\.\?\#]+)(\?|$)/)){engine=engine_match[1]}if(engine&&_isFunction(context[engine])){return context[engine]}if(context.app.template_engine){return this.engineFor(context.app.template_engine)}return function(content,data){return content}},interpolate:function(content,data,engine,partials){return this.engineFor(engine).apply(this,[content,data,partials])},render:function(location,data,callback,partials){return new Sammy.RenderContext(this).render(location,data,callback,partials)},renderEach:function(location,name,data,callback){return new Sammy.RenderContext(this).renderEach(location,name,data,callback)},load:function(location,options,callback){return new Sammy.RenderContext(this).load(location,options,callback)},loadPartials:function(partials){return new Sammy.RenderContext(this).loadPartials(partials)},partial:function(location,data,callback,partials){return new Sammy.RenderContext(this).partial(location,data,callback,partials)},send:function(){var rctx=new Sammy.RenderContext(this);return rctx.send.apply(rctx,arguments)},redirect:function(){var to,args=_makeArray(arguments),current_location=this.app.getLocation(),l=args.length;if(l>1){var i=0,paths=[],pairs=[],params={},has_params=false;for(;i<l;i++){if(typeof args[i]=="string"){paths.push(args[i])}else{$.extend(params,args[i]);has_params=true}}to=paths.join("/");if(has_params){for(var k in params){pairs.push(this.app._encodeFormPair(k,params[k]))}to+="?"+pairs.join("&")}}else{to=args[0]}this.trigger("redirect",{to:to});this.app.last_location=[this.verb,this.path];this.app.setLocation(to);if(new RegExp(to).test(current_location)){this.app.trigger("location-changed")}},trigger:function(name,data){if(typeof data=="undefined"){data={}}if(!data.context){data.context=this}return this.app.trigger(name,data)},eventNamespace:function(){return this.app.eventNamespace()},swap:function(contents,callback){return this.app.swap(contents,callback)},notFound:function(){return this.app.notFound(this.verb,this.path)},json:function(string){return $.parseJSON(string)},toString:function(){return"Sammy.EventContext: "+[this.verb,this.path,this.params].join(" ")}});return Sammy});
View
9 lib/min/sammy-latest.min.js
@@ -1,8 +1,5 @@
// -- Sammy.js -- /sammy.js
// http://sammyjs.org
-// Version: 0.7.4
-// Built: 2013-01-27 13:34:16 -0500
-// name: sammy
-// version: 0.7.4
-// Sammy.js / http://sammyjs.org
-(function(e,t){(function(n){typeof define=="function"&&define.amd?define(["jquery"],n):e.sammy=t.Sammy=n(e)})(function(e){var n,r="([^/]+)",i=/:([\w\d]+)/g,s=/\?([^#]*)?$/,o=function(e){return Array.prototype.slice.call(e)},u=function(e){return Object.prototype.toString.call(e)==="[object Function]"},a=function(e){return Object.prototype.toString.call(e)==="[object Array]"},f=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},l=function(e){return decodeURIComponent((e||"").replace(/\+/g," "))},c=encodeURIComponent,h=function(e){return String(e).replace(/&(?!\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},p=function(e){return function(){return this.route.apply(this,[e].concat(Array.prototype.slice.call(arguments)))}},d={},v=!!t.history&&!!history.pushState,m=[];return n=function(){var t=o(arguments),r,i;n.apps=n.apps||{};if(t.length===0||t[0]&&u(t[0]))return n.apply(n,["body"].concat(t));if(typeof (i=t.shift())=="string")return r=n.apps[i]||new n.Application,r.element_selector=i,t.length>0&&e.each(t,function(e,t){r.use(t)}),r.element_selector!=i&&delete n.apps[i],n.apps[r.element_selector]=r,r},n.VERSION="0.7.4",n.addLogger=function(e){m.push(e)},n.log=function(){var t=o(arguments);t.unshift("["+Date()+"]"),e.each(m,function(e,r){r.apply(n,t)})},typeof t.console!="undefined"?u(t.console.log.apply)?n.addLogger(function(){t.console.log.apply(t.console,arguments)}):n.addLogger(function(){t.console.log(arguments)}):typeof console!="undefined"&&n.addLogger(function(){console.log.apply(console,arguments)}),e.extend(n,{makeArray:o,isFunction:u,isArray:a}),n.Object=function(t){return e.extend(this,t||{})},e.extend(n.Object.prototype,{escapeHTML:h,h:h,toHash:function(){var t={};return e.each(this,function(e,n){u(n)||(t[e]=n)}),t},toHTML:function(){var t="";return e.each(this,function(e,n){u(n)||(t+="<strong>"+e+"</strong> "+n+"<br />")}),t},keys:function(e){var t=[];for(var n in this)(!u(this[n])||!e)&&t.push(n);return t},has:function(t){return this[t]&&e.trim(this[t].toString())!==""},join:function(){var e=o(arguments),t=e.shift();return e.join(t)},log:function(){n.log.apply(n,arguments)},toString:function(t){var n=[];return e.each(this,function(e,r){(!u(r)||t)&&n.push('"'+e+'": '+r.toString())}),"Sammy.Object: {"+n.join(",")+"}"}}),n.targetIsThisWindow=function(r){var i=e(r.target).attr("target");return!i||i===t.name||i==="_self"?!0:i==="_blank"?!1:i==="top"&&t===t.top?!0:!1},n.DefaultLocationProxy=function(e,t){this.app=e,this.is_native=!1,this.has_history=v,this._startPolling(t)},n.DefaultLocationProxy.fullPath=function(e){var t=e.toString().match(/^[^#]*(#.+)$/),n=t?t[1]:"";return[e.pathname,e.search,n].join("")},e.extend(n.DefaultLocationProxy.prototype,{bind:function(){var r=this,i=this.app,s=n.DefaultLocationProxy;e(t).bind("hashchange."+this.app.eventNamespace(),function(e,n){r.is_native===!1&&!n&&(r.is_native=!0,t.clearInterval(s._interval),s._interval=null),i.trigger("location-changed")}),v&&!i.disable_push_state&&(e(t).bind("popstate."+this.app.eventNamespace(),function(e){i.trigger("location-changed")}),e(document).delegate("a","click.history-"+this.app.eventNamespace(),function(e){if(e.isDefaultPrevented()||e.metaKey||e.ctrlKey)return;var o=s.fullPath(this);if(this.hostname==t.location.hostname&&i.lookupRoute("get",o)&&n.targetIsThisWindow(e))return e.preventDefault(),r.setLocation(o),!1})),s._bindings||(s._bindings=0),s._bindings++},unbind:function(){e(t).unbind("hashchange."+this.app.eventNamespace()),e(t).unbind("popstate."+this.app.eventNamespace()),e(document).undelegate("a","click.history-"+this.app.eventNamespace()),n.DefaultLocationProxy._bindings--,n.DefaultLocationProxy._bindings<=0&&(t.clearInterval(n.DefaultLocationProxy._interval),n.DefaultLocationProxy._interval=null)},getLocation:function(){return n.DefaultLocationProxy.fullPath(t.location)},setLocation:function(e){/^([^#\/]|$)/.test(e)&&(v&&!this.app.disable_push_state?e="/"+e:e="#!/"+e);if(e!=this.getLocation()){if(!(v&&!this.app.disable_push_state&&/^\//.test(e)))return t.location=e;history.pushState({path:e},t.title,e),this.app.trigger("location-changed")}},_startPolling:function(r){var i=this;if(!n.DefaultLocationProxy._interval){r||(r=10);var s=function(){var r=i.getLocation();(typeof n.DefaultLocationProxy._last_location=="undefined"||r!=n.DefaultLocationProxy._last_location)&&t.setTimeout(function(){e(t).trigger("hashchange",[!0])},0),n.DefaultLocationProxy._last_location=r};s(),n.DefaultLocationProxy._interval=t.setInterval(s,r)}}}),n.Application=function(e){var t=this;this.routes={},this.listeners=new n.Object({}),this.arounds=[],this.befores=[],this.namespace=(new Date).getTime()+"-"+parseInt(Math.random()*1e3,10),this.context_prototype=function(){n.EventContext.apply(this,arguments)},this.context_prototype.prototype=new n.EventContext,u(e)&&e.apply(this,[this]),this._location_proxy||this.setLocationProxy(new n.DefaultLocationProxy(this,this.run_interval_every)),this.debug&&this.bindToAllEvents(function(e,n){t.log(t.toString(),e.cleaned_type,n||{})})},n.Application.prototype=e.extend({},n.Object.prototype,{ROUTE_VERBS:["get","post","put","delete"],APP_EVENTS:["run","unload","lookup-route","run-route","route-found","event-context-before","event-context-after","changed","error","check-form-submission","redirect","location-changed"],_last_route:null,_location_proxy:null,_running:!1,element_selector:"body",debug:!1,raise_errors:!1,run_interval_every:50,disable_push_state:!1,template_engine:null,toString:function(){return"Sammy.Application:"+this.element_selector},$element:function(t){return t?e(this.element_selector).find(t):e(this.element_selector)},use:function(){var e=o(arguments),t=e.shift(),r=t||"";try{e.unshift(this),typeof t=="string"&&(r="Sammy."+t,t=n[t]),t.apply(this,e)}catch(i){typeof t=="undefined"?this.error("Plugin Error: called use() but plugin ("+r.toString()+") is not defined",i):u(t)?this.error("Plugin Error",i):this.error("Plugin Error: called use() but '"+r.toString()+"' is not a function",i)}return this},setLocationProxy:function(e){var t=this._location_proxy;this._location_proxy=e,this.isRunning()&&(t&&t.unbind(),this._location_proxy.bind())},log:function(){n.log.apply(n,Array.prototype.concat.apply([this.element_selector],arguments))},route:function(t,n){var s=this,o=[],a,f,l=Array.prototype.slice.call(arguments,2);l.length===0&&u(n)&&(n=t,l=[n],t="any"),t=t.toLowerCase();if(n.constructor==String){i.lastIndex=0;while((f=i.exec(n))!==null)o.push(f[1]);n=new RegExp(n.replace(i,r)+"$")}return e.each(l,function(e,t){typeof t=="string"&&(l[e]=s[t])}),a=function(e){var t={verb:e,path:n,callback:l,param_names:o};s.routes[e]=s.routes[e]||[],s.routes[e].push(t)},t==="any"?e.each(this.ROUTE_VERBS,function(e,t){a(t)}):a(t),this},get:p("get"),post:p("post"),put:p("put"),del:p("delete"),any:p("any"),mapRoutes:function(t){var n=this;return e.each(t,function(e,t){n.route.apply(n,t)}),this},eventNamespace:function(){return["sammy-app",this.namespace].join("-")},bind:function(e,t,n){var r=this;typeof n=="undefined"&&(n=t);var i=function(){var e,t,i;e=arguments[0],i=arguments[1],i&&i.context?(t=i.context,delete i.context):t=new r.context_prototype(r,"bind",e.type,i,e.target),e.cleaned_type=e.type.replace(r.eventNamespace(),""),n.apply(t,[e,i])};return this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(i),this.isRunning()&&this._listen(e,i),this},trigger:function(e,t){return this.$element().trigger([e,this.eventNamespace()].join("."),[t]),this},refresh:function(){return this.last_location=null,this.trigger("location-changed"),this},before:function(e,t){return u(e)&&(t=e,e={}),this.befores.push([e,t]),this},after:function(e){return this.bind("event-context-after",e)},around:function(e){return this.arounds.push(e),this},onComplete:function(e){return this._onComplete=e,this},isRunning:function(){return this._running},helpers:function(t){return e.extend(this.context_prototype.prototype,t),this},helper:function(e,t){return this.context_prototype.prototype[e]=t,this},run:function(r){if(this.isRunning())return!1;var i=this;return e.each(this.listeners.toHash(),function(t,n){e.each(n,function(e,n){i._listen(t,n)})}),this.trigger("run",{start_url:r}),this._running=!0,this.last_location=null,!/\#(.+)/.test(this.getLocation())&&typeof r!="undefined"&&this.setLocation(r),this._checkLocation(),this._location_proxy.bind(),this.bind("location-changed",function(){i._checkLocation()}),this.bind("submit",function(t){if(!n.targetIsThisWindow(t))return!0;var r=i._checkFormSubmission(e(t.target).closest("form"));return r===!1?t.preventDefault():!1}),e(t).bind("unload",function(){i.unload()}),this.trigger("changed")},unload:function(){if(!this.isRunning())return!1;var t=this;return this.trigger("unload"),this._location_proxy.unbind(),this.$element().unbind("submit").removeClass(t.eventNamespace()),e.each(this.listeners.toHash(),function(n,r){e.each(r,function(e,r){t._unlisten(n,r)})}),this._running=!1,this},destroy:function(){return this.unload(),delete n.apps[this.element_selector],this},bindToAllEvents:function(t){var n=this;return e.each(this.APP_EVENTS,function(e,r){n.bind(r,t)}),e.each(this.listeners.keys(!0),function(r,i){e.inArray(i,n.APP_EVENTS)==-1&&n.bind(i,t)}),this},routablePath:function(e){return e.replace(s,"")},lookupRoute:function(e,t){var n=this,r=!1,i=0,s,o;if(typeof this.routes[e]!="undefined"){s=this.routes[e].length;for(;i<s;i++){o=this.routes[e][i];if(n.routablePath(t).match(o.path)){r=o;break}}}return r},runRoute:function(t,n,r,i){var s=this,o=this.lookupRoute(t,n),u,a,f,c,h,p,d,v,m;this.debug&&this.log("runRoute",[t,n].join(" ")),this.trigger("run-route",{verb:t,path:n,params:r}),typeof r=="undefined"&&(r={}),e.extend(r,this._parseQueryString(n));if(o){this.trigger("route-found",{route:o}),(v=o.path.exec(this.routablePath(n)))!==null&&(v.shift(),e.each(v,function(e,t){o.param_names[e]?r[o.param_names[e]]=l(t):(r.splat||(r.splat=[]),r.splat.push(l(t)))})),u=new this.context_prototype(this,t,n,r,i),f=this.arounds.slice(0),h=this.befores.slice(0),d=[u],r.splat&&(d=d.concat(r.splat)),a=function(){var e,t,n;while(h.length>0){p=h.shift();if(s.contextMatchesOptions(u,p[0])){e=p[1].apply(u,[u]);if(e===!1)return!1}}return s.last_route=o,u.trigger("event-context-before",{context:u}),typeof o.callback=="function"&&(o.callback=[o.callback]),o.callback&&o.callback.length&&(t=-1,n=function(){t++,o.callback[t]?e=o.callback[t].apply(u,d):s._onComplete&&typeof (s._onComplete==="function")&&s._onComplete(u)},d.push(n),n()),u.trigger("event-context-after",{context:u}),e},e.each(f.reverse(),function(e,t){var n=a;a=function(){return t.apply(u,[n])}});try{m=a()}catch(g){this.error(["500 Error",t,n].join(" "),g)}return m}return this.notFound(t,n)},contextMatchesOptions:function(t,n,r){var i=n;if(typeof i=="string"||f(i))i={path:i};typeof r=="undefined"&&(r=!0);if(e.isEmptyObject(i))return!0;if(a(i.path)){var s,o,u,l;s=[];for(o=0,l=i.path.length;o<l;o+=1)u=e.extend({},i,{path:i.path[o]}),s.push(this.contextMatchesOptions(t,u));var c=e.inArray(!0,s)>-1?!0:!1;return r?c:!c}if(i.only)return this.contextMatchesOptions(t,i.only,!0);if(i.except)return this.contextMatchesOptions(t,i.except,!1);var h=!0,p=!0;return i.path&&(f(i.path)||(i.path=new RegExp(i.path.toString()+"$")),h=i.path.test(t.path)),i.verb&&(typeof i.verb=="string"?p=i.verb===t.verb:p=i.verb.indexOf(t.verb)>-1),r?p&&h:!p||!h},getLocation:function(){return this._location_proxy.getLocation()},setLocation:function(e){return this._location_proxy.setLocation(e)},swap:function(e,t){var n=this.$element().html(e);return u(t)&&t(e),n},templateCache:function(e,t){return typeof t!="undefined"?d[e]=t:d[e]},clearTemplateCache:function(){return d={}},notFound:function(e,t){var n=this.error(["404 Not Found",e,t].join(" "));return e==="get"?n:!0},error:function(e,t){t||(t=new Error),t.message=[e,t.message].join(" "),this.trigger("error",{message:t.message,error:t});if(this.raise_errors)throw t;this.log(t.message,t)},_checkLocation:function(){var e,t;e=this.getLocation();if(!this.last_location||this.last_location[0]!="get"||this.last_location[1]!=e)this.last_location=["get",e],t=this.runRoute("get",e);return t},_getFormVerb:function(t){var n=e(t),r,i;i=n.find('input[name="_method"]'),i.length>0&&(r=i.val()),r||(r=n[0].getAttribute("method"));if(!r||r==="")r="get";return e.trim(r.toString().toLowerCase())},_checkFormSubmission:function(t){var n,r,i,s,o;return this.trigger("check-form-submission",{form:t}),n=e(t),r=n.attr("action")||"",i=this._getFormVerb(n),this.debug&&this.log("_checkFormSubmission",n,r,i),i==="get"?(s=this._serializeFormParams(n),s!==""&&(r+="?"+s),this.setLocation(r),o=!1):(s=e.extend({},this._parseFormParams(n)),o=this.runRoute(i,r,s,t.get(0))),typeof o=="undefined"?!1:o},_serializeFormParams:function(e){var t="",n=e.serializeArray(),r;if(n.length>0){t=this._encodeFormPair(n[0].name,n[0].value);for(r=1;r<n.length;r++)t=t+"&"+this._encodeFormPair(n[r].name,n[r].value)}return t},_encodeFormPair:function(e,t){return c(e)+"="+c(t)},_parseFormParams:function(e){var t={},n=e.serializeArray(),r;for(r=0;r<n.length;r++)t=this._parseParamPair(t,n[r].name,n[r].value);return t},_parseQueryString:function(e){var t={},n,r,i,o;n=e.match(s);if(n&&n[1]){r=n[1].split("&");for(o=0;o<r.length;o++)i=r[o].split("="),t=this._parseParamPair(t,l(i[0]),l(i[1]||""))}return t},_parseParamPair:function(e,t,n){return typeof e[t]!="undefined"?a(e[t])?e[t].push(n):e[t]=[e[t],n]:e[t]=n,e},_listen:function(e,t){return this.$element().bind([e,this.eventNamespace()].join("."),t)},_unlisten:function(e,t){return this.$element().unbind([e,this.eventNamespace()].join("."),t)}}),n.RenderContext=function(e){this.event_context=e,this.callbacks=[],this.previous_content=null,this.content=null,this.next_engine=!1,this.waiting=!1},n.RenderContext.prototype=e.extend({},n.Object.prototype,{then:function(e){if(!u(e)){if(!(typeof e=="string"&&e in this.event_context))return this;var n=this.event_context[e];e=function(e){return n.apply(this.event_context,[e])}}var r=this;return this.waiting?this.callbacks.push(e):(this.wait(),t.setTimeout(function(){var t=e.apply(r,[r.content,r.previous_content]);t!==!1&&r.next(t)},0)),this},wait:function(){this.waiting=!0},next:function(e){this.waiting=!1,typeof e!="undefined"&&(this.previous_content=this.content,this.content=e),this.callbacks.length>0&&this.then(this.callbacks.shift())},load:function(t,n,r){var i=this;return this.then(function(){var s,o,a,f;u(n)?(r=n,n={}):n=e.extend({},n),r&&this.then(r);if(typeof t=="string")return a=t.match(/\.json$/)||n.json,s=a?n.cache===!0:n.cache!==!1,i.next_engine=i.event_context.engineFor(t),delete n.cache,delete n.json,n.engine&&(i.next_engine=n.engine,delete n.engine),s&&(o=this.event_context.app.templateCache(t))?o:(this.wait(),e.ajax(e.extend({url:t,data:{},dataType:a?"json":"text",type:"get",success:function(e){s&&i.event_context.app.templateCache(t,e),i.next(e)}},n)),!1);if(t.nodeType)return t.innerHTML;if(t.selector)return i.next_engine=t.attr("data-engine"),n.clone===!1?t.remove()[0].innerHTML.toString():t[0].innerHTML.toString()})},loadPartials:function(e){var t;if(e){this.partials=this.partials||{};for(t in e)(function(t,n){t.load(e[n]).then(function(e){this.partials[n]=e})})(this,t)}return this},render:function(e,t,n,r){return u(e)&&!t?this.then(e):(u(t)?(r=n,n=t,t=null):n&&!u(n)&&(r=n,n=null),this.loadPartials(r).load(e).interpolate(t,e).then(n))},partial:function(e,t,n,r){return u(n)?this.render(e,t,r).swap(n):u(t)?this.render(e,{},n).swap(t):this.render(e,t,n).swap()},send:function(){var e=this,t=o(arguments),n=t.shift();return a(t[0])&&(t=t[0]),this.then(function(r){return t.push(function(t){e.next(t)}),e.wait(),n.apply(n,t),!1})},collect:function(t,n,r){var i=this,s=function(){u(t)&&(n=t,t=this.content);var r=[],s=!1;return e.each(t,function(e,t){var o=n.apply(i,[e,t]);return o.jquery&&o.length==1&&(o=o[0],s=!0),r.push(o),o}),s?r:r.join("")};return r?s():this.then(s)},renderEach:function(t,n,r,i){return a(n)&&(i=r,r=n,n=null),this.load(t).then(function(s){var o=this;r||(r=a(this.previous_content)?this.previous_content:[]);if(!i)return this.collect(r,function(e,r){var i={},o=this.next_engine||t;return n?i[n]=r:i=r,this.event_context.interpolate(s,i,o)},!0);e.each(r,function(e,r){var u={},a=this.next_engine||t;n?u[n]=r:u=r,i(r,o.event_context.interpolate(s,u,a))})})},interpolate:function(e,t,n){var r=this;return this.then(function(i,s){!e&&s&&(e=s),this.next_engine&&(t=this.next_engine,this.next_engine=!1);var o=r.event_context.interpolate(i,e,t,this.partials);return n?s+o:o})},swap:function(e){return this.then(function(t){return this.event_context.swap(t,e),t}).trigger("changed",{})},appendTo:function(t){return this.then(function(n){e(t).append(n)}).trigger("changed",{})},prependTo:function(t){return this.then(function(n){e(t).prepend(n)}).trigger("changed",{})},replace:function(t){return this.then(function(n){e(t).html(n)}).trigger("changed",{})},trigger:function(e,t){return this.then(function(n){return typeof t=="undefined"&&(t={content:n}),this.event_context.trigger(e,t),n})}}),n.EventContext=function(e,t,r,i,s){this.app=e,this.verb=t,this.path=r,this.params=new n.Object(i),this.target=s},n.EventContext.prototype=e.extend({},n.Object.prototype,{$element:function(){return this.app.$element(o(arguments).shift())},engineFor:function(e){var t=this,n;if(u(e))return e;e=(e||t.app.template_engine).toString();if(n=e.match(/\.([^\.\?\#]+)$/))e=n[1];return e&&u(t[e])?t[e]:t.app.template_engine?this.engineFor(t.app.template_engine):function(e,t){return e}},interpolate:function(e,t,n,r){return this.engineFor(n).apply(this,[e,t,r])},render:function(e,t,r,i){return(new n.RenderContext(this)).render(e,t,r,i)},renderEach:function(e,t,r,i){return(new n.RenderContext(this)).renderEach(e,t,r,i)},load:function(e,t,r){return(new n.RenderContext(this)).load(e,t,r)},loadPartials:function(e){return(new n.RenderContext(this)).loadPartials(e)},partial:function(e,t,r,i){return(new n.RenderContext(this)).partial(e,t,r,i)},send:function(){var e=new n.RenderContext(this);return e.send.apply(e,arguments)},redirect:function(){var t,n=o(arguments),r=this.app.getLocation(),i=n.length;if(i>1){var s=0,u=[],a=[],f={},l=!1;for(;s<i;s++)typeof n[s]=="string"?u.push(n[s]):(e.extend(f,n[s]),l=!0);t=u.join("/");if(l){for(var c in f)a.push(this.app._encodeFormPair(c,f[c]));t+="?"+a.join("&")}}else t=n[0];this.trigger("redirect",{to:t}),this.app.last_location=[this.verb,this.path],this.app.setLocation(t),(new RegExp(t)).test(r)&&this.app.trigger("location-changed")},trigger:function(e,t){return typeof t=="undefined"&&(t={}),t.context||(t.context=this),this.app.trigger(e,t)},eventNamespace:function(){return this.app.eventNamespace()},swap:function(e,t){return this.app.swap(e,t)},notFound:function(){return this.app.notFound(this.verb,this.path)},json:function(t){return e.parseJSON(t)},toString:function(){return"Sammy.EventContext: "+[this.verb,this.path,this.params].join(" ")}}),n})})(jQuery,window);
+// Version: 0.7.5
+// Built: 2014-02-22 10:57:15 +0200
+(function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory)}else{jQuery.sammy=window.Sammy=factory(jQuery)}})(function($){var Sammy,PATH_REPLACER="([^/]+)",PATH_NAME_MATCHER=/:([\w\d]+)/g,QUERY_STRING_MATCHER=/\?([^#]*)?$/,_makeArray=function(nonarray){return Array.prototype.slice.call(nonarray)},_isFunction=function(obj){return Object.prototype.toString.call(obj)==="[object Function]"},_isArray=function(obj){return Object.prototype.toString.call(obj)==="[object Array]"},_isRegExp=function(obj){return Object.prototype.toString.call(obj)==="[object RegExp]"},_decode=function(str){return decodeURIComponent((str||"").replace(/\+/g," "))},_encode=encodeURIComponent,_escapeHTML=function(s){return String(s).replace(/&(?!\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},_routeWrapper=function(verb){return function(){return this.route.apply(this,[verb].concat(Array.prototype.slice.call(arguments)))}},_template_cache={},_has_history=!!(window.history&&history.pushState),loggers=[];Sammy=function(){var args=_makeArray(arguments),app,selector;Sammy.apps=Sammy.apps||{};if(args.length===0||args[0]&&_isFunction(args[0])){return Sammy.apply(Sammy,["body"].concat(args))}else if(typeof(selector=args.shift())=="string"){app=Sammy.apps[selector]||new Sammy.Application;app.element_selector=selector;if(args.length>0){$.each(args,function(i,plugin){app.use(plugin)})}if(app.element_selector!=selector){delete Sammy.apps[selector]}Sammy.apps[app.element_selector]=app;return app}};Sammy.VERSION="0.7.5";Sammy.addLogger=function(logger){loggers.push(logger)};Sammy.log=function(){var args=_makeArray(arguments);args.unshift("["+Date()+"]");$.each(loggers,function(i,logger){logger.apply(Sammy,args)})};if(typeof window.console!="undefined"){if(typeof window.console.log==="function"&&_isFunction(window.console.log.apply)){Sammy.addLogger(function(){window.console.log.apply(window.console,arguments)})}else{Sammy.addLogger(function(){window.console.log(arguments)})}}else if(typeof console!="undefined"){Sammy.addLogger(function(){console.log.apply(console,arguments)})}$.extend(Sammy,{makeArray:_makeArray,isFunction:_isFunction,isArray:_isArray});Sammy.Object=function(obj){return $.extend(this,obj||{})};$.extend(Sammy.Object.prototype,{escapeHTML:_escapeHTML,h:_escapeHTML,toHash:function(){var json={};$.each(this,function(k,v){if(!_isFunction(v)){json[k]=v}});return json},toHTML:function(){var display="";$.each(this,function(k,v){if(!_isFunction(v)){display+="<strong>"+k+"</strong> "+v+"<br />"}});return display},keys:function(attributes_only){var keys=[];for(var property in this){if(!_isFunction(this[property])||!attributes_only){keys.push(property)}}return keys},has:function(key){return this[key]&&$.trim(this[key].toString())!==""},join:function(){var args=_makeArray(arguments);var delimiter=args.shift();return args.join(delimiter)},log:function(){Sammy.log.apply(Sammy,arguments)},toString:function(include_functions){var s=[];$.each(this,function(k,v){if(!_isFunction(v)||include_functions){s.push('"'+k+'": '+v.toString())}});return"Sammy.Object: {"+s.join(",")+"}"}});Sammy.targetIsThisWindow=function targetIsThisWindow(event,tagName){var targetElement=$(event.target).closest(tagName);if(targetElement.length===0){return true}var targetWindow=targetElement.attr("target");if(!targetWindow||targetWindow===window.name||targetWindow==="_self"){return true}if(targetWindow==="_blank"){return false}if(targetWindow==="top"&&window===window.top){return true}return false};Sammy.DefaultLocationProxy=function(app,run_interval_every){this.app=app;this.is_native=false;this.has_history=_has_history;this._startPolling(run_interval_every)};Sammy.DefaultLocationProxy.fullPath=function(location_obj){var matches=location_obj.toString().match(/^[^#]*(#.+)$/);var hash=matches?matches[1]:"";return[location_obj.pathname,location_obj.search,hash].join("")};$.extend(Sammy.DefaultLocationProxy.prototype,{bind:function(){var proxy=this,app=this.app,lp=Sammy.DefaultLocationProxy;$(window).bind("hashchange."+this.app.eventNamespace(),function(e,non_native){if(proxy.is_native===false&&!non_native){proxy.is_native=true;window.clearInterval(lp._interval);lp._interval=null}app.trigger("location-changed")});if(_has_history&&!app.disable_push_state){$(window).bind("popstate."+this.app.eventNamespace(),function(e){app.trigger("location-changed")});$(document).delegate("a","click.history-"+this.app.eventNamespace(),function(e){if(e.isDefaultPrevented()||e.metaKey||e.ctrlKey){return}var full_path=lp.fullPath(this),hostname=this.hostname?this.hostname:function(a){var l=document.createElement("a");l.href=a.href;return l.hostname}(this);if(hostname==window.location.hostname&&app.lookupRoute("get",full_path)&&Sammy.targetIsThisWindow(e,"a")){e.preventDefault();proxy.setLocation(full_path);return false}})}if(!lp._bindings){lp._bindings=0}lp._bindings++},unbind:function(){$(window).unbind("hashchange."+this.app.eventNamespace());$(window).unbind("popstate."+this.app.eventNamespace());$(document).undelegate("a","click.history-"+this.app.eventNamespace());Sammy.DefaultLocationProxy._bindings--;if(Sammy.DefaultLocationProxy._bindings<=0){window.clearInterval(Sammy.DefaultLocationProxy._interval);Sammy.DefaultLocationProxy._interval=null}},getLocation:function(){return Sammy.DefaultLocationProxy.fullPath(window.location)},setLocation:function(new_location){if(/^([^#\/]|$)/.test(new_location)){if(_has_history&&!this.app.disable_push_state){new_location="/"+new_location}else{new_location="#!/"+new_location}}if(new_location!=this.getLocation()){if(_has_history&&!this.app.disable_push_state&&/^\//.test(new_location)){history.pushState({path:new_location},window.title,new_location);this.app.trigger("location-changed")}else{return window.location=new_location}}},_startPolling:function(every){var proxy=this;if(!Sammy.DefaultLocationProxy._interval){if(!every){every=10}var hashCheck=function(){var current_location=proxy.getLocation();if(typeof Sammy.DefaultLocationProxy._last_location=="undefined"||current_location!=Sammy.DefaultLocationProxy._last_location){window.setTimeout(function(){$(window).trigger("hashchange",[true])},0)}Sammy.DefaultLocationProxy._last_location=current_location};hashCheck();Sammy.DefaultLocationProxy._interval=window.setInterval(hashCheck,every)}}});Sammy.Application=function(app_function){var app=this;this.routes={};this.listeners=new Sammy.Object({});this.arounds=[];this.befores=[];this.namespace=(new Date).getTime()+"-"+parseInt(Math.random()*1e3,10);this.context_prototype=function(){Sammy.EventContext.apply(this,arguments)};this.context_prototype.prototype=new Sammy.EventContext;if(_isFunction(app_function)){app_function.apply(this,[this])}if(!this._location_proxy){this.setLocationProxy(new Sammy.DefaultLocationProxy(this,this.run_interval_every))}if(this.debug){this.bindToAllEvents(function(e,data){app.log(app.toString(),e.cleaned_type,data||{})})}};Sammy.Application.prototype=$.extend({},Sammy.Object.prototype,{ROUTE_VERBS:["get","post","put","delete"],APP_EVENTS:["run","unload","lookup-route","run-route","route-found","event-context-before","event-context-after","changed","error","check-form-submission","redirect","location-changed"],_last_route:null,_location_proxy:null,_running:false,element_selector:"body",debug:false,raise_errors:false,run_interval_every:50,disable_push_state:false,template_engine:null,toString:function(){return"Sammy.Application:"+this.element_selector},$element:function(selector){return selector?$(this.element_selector).find(selector):$(this.element_selector)},use:function(){var args=_makeArray(arguments),plugin=args.shift(),plugin_name=plugin||"";try{args.unshift(this);if(typeof plugin=="string"){plugin_name="Sammy."+plugin;plugin=Sammy[plugin]}plugin.apply(this,args)}catch(e){if(typeof plugin==="undefined"){this.error("Plugin Error: called use() but plugin ("+plugin_name.toString()+") is not defined",e)}else if(!_isFunction(plugin)){this.error("Plugin Error: called use() but '"+plugin_name.toString()+"' is not a function",e)}else{this.error("Plugin Error",e)}}return this},setLocationProxy:function(new_proxy){var original_proxy=this._location_proxy;this._location_proxy=new_proxy;if(this.isRunning()){if(original_proxy){original_proxy.unbind()}this._location_proxy.bind()}},log:function(){Sammy.log.apply(Sammy,Array.prototype.concat.apply([this.element_selector],arguments))},route:function(verb,path){var app=this,param_names=[],add_route,path_match,callback=Array.prototype.slice.call(arguments,2);if(callback.length===0&&_isFunction(path)){callback=[path];path=verb;verb="any"}verb=verb.toLowerCase();if(path.constructor==String){PATH_NAME_MATCHER.lastIndex=0;while((path_match=PATH_NAME_MATCHER.exec(path))!==null){param_names.push(path_match[1])}path=new RegExp(path.replace(PATH_NAME_MATCHER,PATH_REPLACER)+"$")}$.each(callback,function(i,cb){if(typeof cb==="string"){callback[i]=app[cb]}});add_route=function(with_verb){var r={verb:with_verb,path:path,callback:callback,param_names:param_names};app.routes[with_verb]=app.routes[with_verb]||[];app.routes[with_verb].push(r)};if(verb==="any"){$.each(this.ROUTE_VERBS,function(i,v){add_route(v)})}else{add_route(verb)}return this},get:_routeWrapper("get"),post:_routeWrapper("post"),put:_routeWrapper("put"),del:_routeWrapper("delete"),any:_routeWrapper("any"),mapRoutes:function(route_array){var app=this;$.each(route_array,function(i,route_args){app.route.apply(app,route_args)});return this},eventNamespace:function(){return["sammy-app",this.namespace].join("-")},bind:function(name,data,callback){var app=this;if(typeof callback=="undefined"){callback=data}var listener_callback=function(){var e,context,data;e=arguments[0];data=arguments[1];if(data&&data.context){context=data.context;delete data.context}else{context=new app.context_prototype(app,"bind",e.type,data,e.target)}e.cleaned_type=e.type.replace(app.eventNamespace(),"");callback.apply(context,[e,data])};if(!this.listeners[name]){this.listeners[name]=[]}this.listeners[name].push(listener_callback);if(this.isRunning()){this._listen(name,listener_callback)}return this},trigger:function(name,data){this.$element().trigger([name,this.eventNamespace()].join("."),[data]);return this},refresh:function(){this.last_location=null;this.trigger("location-changed");return this},before:function(options,callback){if(_isFunction(options)){callback=options;options={}}this.befores.push([options,callback]);return this},after:function(callback){return this.bind("event-context-after",callback)},around:function(callback){this.arounds.push(callback);return this},onComplete:function(callback){this._onComplete=callback;return this},isRunning:function(){return this._running},helpers:function(extensions){$.extend(this.context_prototype.prototype,extensions);return this},helper:function(name,method){this.context_prototype.prototype[name]=method;return this},run:function(start_url){if(this.isRunning()){return false}var app=this;$.each(this.listeners.toHash(),function(name,callbacks){$.each(callbacks,function(i,listener_callback){app._listen(name,listener_callback)})});this.trigger("run",{start_url:start_url});this._running=true;this.last_location=null;if(!/\#(.+)/.test(this.getLocation())&&typeof start_url!="undefined"){this.setLocation(start_url)}this._checkLocation();this._location_proxy.bind();this.bind("location-changed",function(){app._checkLocation()});this.bind("submit",function(e){if(!Sammy.targetIsThisWindow(e,"form")){return true}var returned=app._checkFormSubmission($(e.target).closest("form"));return returned===false?e.preventDefault():false});$(window).bind("unload",function(){app.unload()});return this.trigger("changed")},unload:function(){if(!this.isRunning()){return false}var app=this;this.trigger("unload");this._location_proxy.unbind();this.$element().unbind("submit").removeClass(app.eventNamespace());$.each(this.listeners.toHash(),function(name,listeners){$.each(listeners,function(i,listener_callback){app._unlisten(name,listener_callback)})});this._running=false;return this},destroy:function(){this.unload();delete Sammy.apps[this.element_selector];return this},bindToAllEvents:function(callback){var app=this;$.each(this.APP_EVENTS,function(i,e){app.bind(e,callback)});$.each(this.listeners.keys(true),function(i,name){if($.inArray(name,app.APP_EVENTS)==-1){app.bind(name,callback)}});return this},routablePath:function(path){return path.replace(QUERY_STRING_MATCHER,"")},lookupRoute:function(verb,path){var app=this,routed=false,i=0,l,route;if(typeof this.routes[verb]!="undefined"){l=this.routes[verb].length;for(;i<l;i++){route=this.routes[verb][i];if(app.routablePath(path).match(route.path)){routed=route;break}}}return routed},runRoute:function(verb,path,params,target){var app=this,route=this.lookupRoute(verb,path),context,wrapped_route,arounds,around,befores,before,callback_args,path_params,final_returned;if(this.debug){this.log("runRoute",[verb,path].join(" "))}this.trigger("run-route",{verb:verb,path:path,params:params});if(typeof params=="undefined"){params={}}$.extend(params,this._parseQueryString(path));if(route){this.trigger("route-found",{route:route});if((path_params=route.path.exec(this.routablePath(path)))!==null){path_params.shift();$.each(path_params,function(i,param){if(route.param_names[i]){params[route.param_names[i]]=_decode(param)}else{if(!params.splat){params.splat=[]}params.splat.push(_decode(param))}})}context=new this.context_prototype(this,verb,path,params,target);arounds=this.arounds.slice(0);befores=this.befores.slice(0);callback_args=[context];if(params.splat){callback_args=callback_args.concat(params.splat)}wrapped_route=function(){var returned,i,nextRoute;while(befores.length>0){before=befores.shift();if(app.contextMatchesOptions(context,before[0])){returned=before[1].apply(context,[context]);if(returned===false){return false}}}app.last_route=route;context.trigger("event-context-before",{context:context});if(typeof route.callback==="function"){route.callback=[route.callback]}if(route.callback&&route.callback.length){i=-1;nextRoute=function(){i++;if(route.callback[i]){returned=route.callback[i].apply(context,callback_args)}else if(app._onComplete&&typeof(app._onComplete==="function")){app._onComplete(context)}};callback_args.push(nextRoute);nextRoute()}context.trigger("event-context-after",{context:context});return returned};$.each(arounds.reverse(),function(i,around){var last_wrapped_route=wrapped_route;wrapped_route=function(){return around.apply(context,[last_wrapped_route])}});try{final_returned=wrapped_route()}catch(e){this.error(["500 Error",verb,path].join(" "),e)}return final_returned}else{return this.notFound(verb,path)}},contextMatchesOptions:function(context,match_options,positive){var options=match_options;if(typeof options==="string"||_isRegExp(options)){options={path:options}}if(typeof positive==="undefined"){positive=true}if($.isEmptyObject(options)){return true}if(_isArray(options.path)){var results,numopt,opts,len;results=[];for(numopt=0,len=options.path.length;numopt<len;numopt+=1){opts=$.extend({},options,{path:options.path[numopt]});results.push(this.contextMatchesOptions(context,opts))}var matched=$.inArray(true,results)>-1?true:false;return positive?matched:!matched}if(options.only){return this.contextMatchesOptions(context,options.only,true)}else if(options.except){return this.contextMatchesOptions(context,options.except,false)}var path_matched=true,verb_matched=true;if(options.path){if(!_isRegExp(options.path)){options.path=new RegExp(options.path.toString()+"$")}path_matched=options.path.test(context.path)}if(options.verb){if(typeof options.verb==="string"){verb_matched=options.verb===context.verb}else{verb_matched=options.verb.indexOf(context.verb)>-1}}return positive?verb_matched&&path_matched:!(verb_matched&&path_matched)},getLocation:function(){return this._location_proxy.getLocation()},setLocation:function(new_location){return this._location_proxy.setLocation(new_location)},swap:function(content,callback){var $el=this.$element().html(content);if(_isFunction(callback)){callback(content)}return $el},templateCache:function(key,value){if(typeof value!="undefined"){return _template_cache[key]=value}else{return _template_cache[key]}},clearTemplateCache:function(){return _template_cache={}},notFound:function(verb,path){var ret=this.error(["404 Not Found",verb,path].join(" "));return verb==="get"?ret:true},error:function(message,original_error){if(!original_error){original_error=new Error}original_error.message=[message,original_error.message].join(" ");this.trigger("error",{message:original_error.message,error:original_error});if(this.raise_errors){throw original_error}else{this.log(original_error.message,original_error)}},_checkLocation:function(){var location,returned;location=this.getLocation();if(!this.last_location||this.last_location[0]!="get"||this.last_location[1]!=location){this.last_location=["get",location];returned=this.runRoute("get",location)}return returned},_getFormVerb:function(form){var $form=$(form),verb,$_method;$_method=$form.find('input[name="_method"]');if($_method.length>0){verb=$_method.val()}if(!verb){verb=$form[0].getAttribute("method")}if(!verb||verb===""){verb="get"}return $.trim(verb.toString().toLowerCase())},_checkFormSubmission:function(form){var $form,path,verb,params,returned;this.trigger("check-form-submission",{form:form});$form=$(form);path=$form.attr("action")||"";verb=this._getFormVerb($form);if(this.debug){this.log("_checkFormSubmission",$form,path,verb)}if(verb==="get"){params=this._serializeFormParams($form);if(params!==""){path+="?"+params}this.setLocation(path);returned=false}else{params=$.extend({},this._parseFormParams($form));returned=this.runRoute(verb,path,params,form.get(0))}return typeof returned=="undefined"?false:returned},_serializeFormParams:function($form){var queryString="",fields=$form.serializeArray(),i;if(fields.length>0){queryString=this._encodeFormPair(fields[0].name,fields[0].value);for(i=1;i<fields.length;i++){queryString=queryString+"&"+this._encodeFormPair(fields[i].name,fields[i].value)}}return queryString},_encodeFormPair:function(name,value){return _encode(name)+"="+_encode(value)},_parseFormParams:function($form){var params={},form_fields=$form.serializeArray(),i;for(i=0;i<form_fields.length;i++){params=this._parseParamPair(params,form_fields[i].name,form_fields[i].value)}return params},_parseQueryString:function(path){var params={},parts,pairs,pair,i;parts=path.match(QUERY_STRING_MATCHER);if(parts&&parts[1]){pairs=parts[1].split("&");for(i=0;i<pairs.length;i++){pair=pairs[i].split("=");params=this._parseParamPair(params,_decode(pair[0]),_decode(pair[1]||""))}}return params},_parseParamPair:function(params,key,value){if(typeof params[key]!=="undefined"){if(_isArray(params[key])){params[key].push(value)}else{params[key]=[params[key],value]}}else{params[key]=value}return params},_listen:function(name,callback){return this.$element().bind([name,this.eventNamespace()].join("."),callback)},_unlisten:function(name,callback){return this.$element().unbind([name,this.eventNamespace()].join("."),callback)}});Sammy.RenderContext=function(event_context){this.event_context=event_context;this.callbacks=[];this.previous_content=null;this.content=null;this.next_engine=false;this.waiting=false};Sammy.RenderContext.prototype=$.extend({},Sammy.Object.prototype,{then:function(callback){if(!_isFunction(callback)){if(typeof callback==="string"&&callback in this.event_context){var helper=this.event_context[callback];callback=function(content){return helper.apply(this.event_context,[content])}}else{return this}}var context=this;if(this.waiting){this.callbacks.push(callback)}else{this.wait();window.setTimeout(function(){var returned=callback.apply(context,[context.content,context.previous_content]);if(returned!==false){context.next(returned)}},0)}return this},wait:function(){this.waiting=true},next:function(content){this.waiting=false;if(typeof content!=="undefined"){this.previous_content=this.content;this.content=content}if(this.callbacks.length>0){this.then(this.callbacks.shift())}},load:function(location,options,callback){var context=this;return this.then(function(){var should_cache,cached,is_json,location_array;if(_isFunction(options)){callback=options;options={}}else{options=$.extend({},options)}if(callback){this.then(callback)}if(typeof location==="string"){is_json=location.match(/\.json(\?|$)/)||options.json;should_cache=is_json?options.cache===true:options.cache!==false;context.next_engine=context.event_context.engineFor(location);delete options.cache;delete options.json;if(options.engine){context.next_engine=options.engine;delete options.engine}if(should_cache&&(cached=this.event_context.app.templateCache(location))){return cached}this.wait();$.ajax($.extend({url:location,data:{},dataType:is_json?"json":"text",type:"get",success:function(data){if(should_cache){context.event_context.app.templateCache(location,data)}context.next(data)}},options));return false}else{if(location.nodeType){return location.innerHTML}if(location.selector){context.next_engine=location.attr("data-engine");if(options.clone===false){return location.remove()[0].innerHTML.toString()}else{return location[0].innerHTML.toString()}}}})},loadPartials:function(partials){var name;if(partials){this.partials=this.partials||{};for(name in partials){(function(context,name){context.load(partials[name]).then(function(template){this.partials[name]=template})})(this,name)}}return this},render:function(location,data,callback,partials){if(_isFunction(location)&&!data){return this.then(location)}else{if(_isFunction(data)){partials=callback;callback=data;data=null}else if(callback&&!_isFunction(callback)){partials=callback;callback=null}return this.loadPartials(partials).load(location).interpolate(data,location).then(callback)}},partial:function(location,data,callback,partials){if(_isFunction(callback)){return this.render(location,data,partials).swap(callback)}else if(_isFunction(data)){return this.render(location,{},callback).swap(data)}else{return this.render(location,data,callback).swap()}},send:function(){var context=this,args=_makeArray(arguments),fun=args.shift();if(_isArray(args[0])){args=args[0]}return this.then(function(content){args.push(function(response){context.next(response)});context.wait();fun.apply(fun,args);return false})},collect:function(array,callback,now){var context=this;var coll=function(){if(_isFunction(array)){callback=array;array=this.content}var contents=[],doms=false;$.each(array,function(i,item){var returned=callback.apply(context,[i,item]);if(returned.jquery&&returned.length==1){returned=returned[0];doms=true}contents.push(returned);return returned});return doms?contents:contents.join("")};return now?coll():this.then(coll)},renderEach:function(location,name,data,callback){if(_isArray(name)){callback=data;data=name;name=null}return this.load(location).then(function(content){var rctx=this;if(!data){data=_isArray(this.previous_content)?this.previous_content:[]}if(callback){$.each(data,function(i,value){var idata={},engine=this.next_engine||location;if(name){idata[name]=value}else{idata=value}callback(value,rctx.event_context.interpolate(content,idata,engine))})}else{return this.collect(data,function(i,value){var idata={},engine=this.next_engine||location;if(name){idata[name]=value}else{idata=value}return this.event_context.interpolate(content,idata,engine)},true)}})},interpolate:function(data,engine,retain){var context=this;return this.then(function(content,prev){if(!data&&prev){data=prev}if(this.next_engine){engine=this.next_engine;this.next_engine=false}var rendered=context.event_context.interpolate(content,data,engine,this.partials);return retain?prev+rendered:rendered})},swap:function(callback){return this.then(function(content){this.event_context.swap(content,callback);return content}).trigger("changed",{})},appendTo:function(selector){return this.then(function(content){$(selector).append(content)}).trigger("changed",{})},prependTo:function(selector){return this.then(function(content){$(selector).prepend(content)}).trigger("changed",{})},replace:function(selector){return this.then(function(content){$(selector).html(content)}).trigger("changed",{})},trigger:function(name,data){return this.then(function(content){if(typeof data=="undefined"){data={content:content}}this.event_context.trigger(name,data);return content})}});Sammy.EventContext=function(app,verb,path,params,target){this.app=app;this.verb=verb;this.path=path;this.params=new Sammy.Object(params);this.target=target};Sammy.EventContext.prototype=$.extend({},Sammy.Object.prototype,{$element:function(){return this.app.$element(_makeArray(arguments).shift())},engineFor:function(engine){var context=this,engine_match;if(_isFunction(engine)){return engine}engine=(engine||context.app.template_engine).toString();if(engine_match=engine.match(/\.([^\.\?\#]+)(\?|$)/)){engine=engine_match[1]}if(engine&&_isFunction(context[engine])){return context[engine]}if(context.app.template_engine){return this.engineFor(context.app.template_engine)}return function(content,data){return content}},interpolate:function(content,data,engine,partials){return this.engineFor(engine).apply(this,[content,data,partials])},render:function(location,data,callback,partials){return new Sammy.RenderContext(this).render(location,data,callback,partials)},renderEach:function(location,name,data,callback){return new Sammy.RenderContext(this).renderEach(location,name,data,callback)},load:function(location,options,callback){return new Sammy.RenderContext(this).load(location,options,callback)},loadPartials:function(partials){return new Sammy.RenderContext(this).loadPartials(partials)},partial:function(location,data,callback,partials){return new Sammy.RenderContext(this).partial(location,data,callback,partials)},send:function(){var rctx=new Sammy.RenderContext(this);return rctx.send.apply(rctx,arguments)},redirect:function(){var to,args=_makeArray(arguments),current_location=this.app.getLocation(),l=args.length;if(l>1){var i=0,paths=[],pairs=[],params={},has_params=false;for(;i<l;i++){if(typeof args[i]=="string"){paths.push(args[i])}else{$.extend(params,args[i]);has_params=true}}to=paths.join("/");if(has_params){for(var k in params){pairs.push(this.app._encodeFormPair(k,params[k]))}to+="?"+pairs.join("&")}}else{to=args[0]}this.trigger("redirect",{to:to});this.app.last_location=[this.verb,this.path];this.app.setLocation(to);if(new RegExp(to).test(current_location)){this.app.trigger("location-changed")}},trigger:function(name,data){if(typeof data=="undefined"){data={}}if(!data.context){data.context=this}return this.app.trigger(name,data)},eventNamespace:function(){return this.app.eventNamespace()},swap:function(contents,callback){return this.app.swap(contents,callback)},notFound:function(){return this.app.notFound(this.verb,this.path)},json:function(string){return $.parseJSON(string)},toString:function(){return"Sammy.EventContext: "+[this.verb,this.path,this.params].join(" ")}});return Sammy});
View
4 lib/sammy.js
@@ -1,5 +1,5 @@
// name: sammy
-// version: 0.7.4
+// version: 0.7.5
// Sammy.js / http://sammyjs.org
@@ -86,7 +86,7 @@
}
};
- Sammy.VERSION = '0.7.4';
+ Sammy.VERSION = '0.7.5';
// Add to the global logger pool. Takes a function that accepts an
// unknown number of arguments and should print them or send them somewhere
View
2 package.json
@@ -1,6 +1,6 @@
{
"name": "sammy",
- "version": "0.7.4",
+ "version": "0.7.5",
"maintainers": [{"name":"Aaron Quint", "web": "http://www.quirkey.com"}],
"description": "Sammy is a RESTful Evented JavaScript framework built on top of jQuery",
"keywords": ["framework", "jquery", "sammy"],

0 comments on commit ec821bb

Please sign in to comment.
Something went wrong with that request. Please try again.