pulse_meter_visualizer 0.4.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. data/.gitignore +19 -0
  2. data/.rbenv-version +1 -0
  3. data/.rspec +1 -0
  4. data/.rvmrc +1 -0
  5. data/.travis.yml +8 -0
  6. data/Gemfile +4 -0
  7. data/LICENSE +22 -0
  8. data/Procfile +3 -0
  9. data/README.md +40 -0
  10. data/Rakefile +72 -0
  11. data/examples/basic.ru +145 -0
  12. data/examples/basic_sensor_data.rb +96 -0
  13. data/lib/pulse_meter/visualize/app.rb +78 -0
  14. data/lib/pulse_meter/visualize/base.rb +15 -0
  15. data/lib/pulse_meter/visualize/coffee/application.coffee +40 -0
  16. data/lib/pulse_meter/visualize/coffee/collections/page_info_list.coffee +17 -0
  17. data/lib/pulse_meter/visualize/coffee/collections/sensor_info_list.coffee +4 -0
  18. data/lib/pulse_meter/visualize/coffee/collections/widget_list.coffee +14 -0
  19. data/lib/pulse_meter/visualize/coffee/extensions.coffee +26 -0
  20. data/lib/pulse_meter/visualize/coffee/models/dinamic_widget.coffee +34 -0
  21. data/lib/pulse_meter/visualize/coffee/models/page_info.coffee +2 -0
  22. data/lib/pulse_meter/visualize/coffee/models/sensor_info.coffee +2 -0
  23. data/lib/pulse_meter/visualize/coffee/models/widget.coffee +54 -0
  24. data/lib/pulse_meter/visualize/coffee/presenters/area.coffee +2 -0
  25. data/lib/pulse_meter/visualize/coffee/presenters/gauge.coffee +11 -0
  26. data/lib/pulse_meter/visualize/coffee/presenters/line.coffee +2 -0
  27. data/lib/pulse_meter/visualize/coffee/presenters/pie.coffee +20 -0
  28. data/lib/pulse_meter/visualize/coffee/presenters/series.coffee +44 -0
  29. data/lib/pulse_meter/visualize/coffee/presenters/table.coffee +10 -0
  30. data/lib/pulse_meter/visualize/coffee/presenters/timeline.coffee +13 -0
  31. data/lib/pulse_meter/visualize/coffee/presenters/widget.coffee +65 -0
  32. data/lib/pulse_meter/visualize/coffee/router.coffee +21 -0
  33. data/lib/pulse_meter/visualize/coffee/views/dynamic_chart.coffee +91 -0
  34. data/lib/pulse_meter/visualize/coffee/views/dynamic_widget.coffee +58 -0
  35. data/lib/pulse_meter/visualize/coffee/views/page_title.coffee +17 -0
  36. data/lib/pulse_meter/visualize/coffee/views/page_titles.coffee +15 -0
  37. data/lib/pulse_meter/visualize/coffee/views/sensor_info_list.coffee +19 -0
  38. data/lib/pulse_meter/visualize/coffee/views/widget.coffee +99 -0
  39. data/lib/pulse_meter/visualize/coffee/views/widget_chart.coffee +13 -0
  40. data/lib/pulse_meter/visualize/coffee/views/widget_list.coffee +15 -0
  41. data/lib/pulse_meter/visualize/dsl/base.rb +131 -0
  42. data/lib/pulse_meter/visualize/dsl/errors.rb +40 -0
  43. data/lib/pulse_meter/visualize/dsl/layout.rb +27 -0
  44. data/lib/pulse_meter/visualize/dsl/page.rb +33 -0
  45. data/lib/pulse_meter/visualize/dsl/sensor.rb +20 -0
  46. data/lib/pulse_meter/visualize/dsl/widget.rb +37 -0
  47. data/lib/pulse_meter/visualize/dsl/widgets/area.rb +20 -0
  48. data/lib/pulse_meter/visualize/dsl/widgets/gauge.rb +12 -0
  49. data/lib/pulse_meter/visualize/dsl/widgets/line.rb +21 -0
  50. data/lib/pulse_meter/visualize/dsl/widgets/pie.rb +16 -0
  51. data/lib/pulse_meter/visualize/dsl/widgets/table.rb +19 -0
  52. data/lib/pulse_meter/visualize/layout.rb +79 -0
  53. data/lib/pulse_meter/visualize/page.rb +25 -0
  54. data/lib/pulse_meter/visualize/public/css/application.css +56 -0
  55. data/lib/pulse_meter/visualize/public/css/bootstrap.css +4883 -0
  56. data/lib/pulse_meter/visualize/public/css/bootstrap.min.css +729 -0
  57. data/lib/pulse_meter/visualize/public/css/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  58. data/lib/pulse_meter/visualize/public/css/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  59. data/lib/pulse_meter/visualize/public/css/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  60. data/lib/pulse_meter/visualize/public/css/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  61. data/lib/pulse_meter/visualize/public/css/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  62. data/lib/pulse_meter/visualize/public/css/images/ui-bg_glass_75_ffffff_1x400.png +0 -0
  63. data/lib/pulse_meter/visualize/public/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  64. data/lib/pulse_meter/visualize/public/css/images/ui-bg_inset-soft_95_fef1ec_1x100.png +0 -0
  65. data/lib/pulse_meter/visualize/public/css/images/ui-icons_222222_256x240.png +0 -0
  66. data/lib/pulse_meter/visualize/public/css/images/ui-icons_2e83ff_256x240.png +0 -0
  67. data/lib/pulse_meter/visualize/public/css/images/ui-icons_454545_256x240.png +0 -0
  68. data/lib/pulse_meter/visualize/public/css/images/ui-icons_888888_256x240.png +0 -0
  69. data/lib/pulse_meter/visualize/public/css/images/ui-icons_cd0a0a_256x240.png +0 -0
  70. data/lib/pulse_meter/visualize/public/css/images/ui-icons_f6cf3b_256x240.png +0 -0
  71. data/lib/pulse_meter/visualize/public/css/jquery-ui-1.8.16.bootstrap.css +1320 -0
  72. data/lib/pulse_meter/visualize/public/favicon.ico +208 -0
  73. data/lib/pulse_meter/visualize/public/img/glyphicons-halflings-white.png +0 -0
  74. data/lib/pulse_meter/visualize/public/img/glyphicons-halflings.png +0 -0
  75. data/lib/pulse_meter/visualize/public/js/application.js +973 -0
  76. data/lib/pulse_meter/visualize/public/js/backbone-min.js +38 -0
  77. data/lib/pulse_meter/visualize/public/js/bootstrap.js +1835 -0
  78. data/lib/pulse_meter/visualize/public/js/jquery-1.7.2.min.js +4 -0
  79. data/lib/pulse_meter/visualize/public/js/jquery-ui-1.8.16.bootstrap.min.js +791 -0
  80. data/lib/pulse_meter/visualize/public/js/jquery-ui-1.8.23.custom.min.js +21 -0
  81. data/lib/pulse_meter/visualize/public/js/jquery-ui-timepicker-addon.js +1687 -0
  82. data/lib/pulse_meter/visualize/public/js/json2.js +487 -0
  83. data/lib/pulse_meter/visualize/public/js/underscore-min.js +32 -0
  84. data/lib/pulse_meter/visualize/sensor.rb +63 -0
  85. data/lib/pulse_meter/visualize/series_extractor.rb +107 -0
  86. data/lib/pulse_meter/visualize/views/main.haml +30 -0
  87. data/lib/pulse_meter/visualize/views/sensors.haml +76 -0
  88. data/lib/pulse_meter/visualize/views/widgets/area.haml +53 -0
  89. data/lib/pulse_meter/visualize/views/widgets/extend_options.haml +11 -0
  90. data/lib/pulse_meter/visualize/views/widgets/gauge.haml +13 -0
  91. data/lib/pulse_meter/visualize/views/widgets/line.haml +54 -0
  92. data/lib/pulse_meter/visualize/views/widgets/pie.haml +13 -0
  93. data/lib/pulse_meter/visualize/views/widgets/table.haml +45 -0
  94. data/lib/pulse_meter/visualize/widget.rb +38 -0
  95. data/lib/pulse_meter/visualize/widgets/gauge.rb +47 -0
  96. data/lib/pulse_meter/visualize/widgets/pie.rb +36 -0
  97. data/lib/pulse_meter/visualize/widgets/timeline.rb +114 -0
  98. data/lib/pulse_meter/visualizer.rb +38 -0
  99. data/lib/pulse_meter_visualizer.rb +2 -0
  100. data/pulse_meter_visualizer.gemspec +41 -0
  101. data/spec/pulse_meter/visualize/app_spec.rb +27 -0
  102. data/spec/pulse_meter/visualize/dsl/layout_spec.rb +64 -0
  103. data/spec/pulse_meter/visualize/dsl/page_spec.rb +62 -0
  104. data/spec/pulse_meter/visualize/dsl/sensor_spec.rb +30 -0
  105. data/spec/pulse_meter/visualize/dsl/widget_spec.rb +6 -0
  106. data/spec/pulse_meter/visualize/dsl/widgets/area_spec.rb +44 -0
  107. data/spec/pulse_meter/visualize/dsl/widgets/gauge_spec.rb +22 -0
  108. data/spec/pulse_meter/visualize/dsl/widgets/line_spec.rb +44 -0
  109. data/spec/pulse_meter/visualize/dsl/widgets/pie_spec.rb +35 -0
  110. data/spec/pulse_meter/visualize/dsl/widgets/table_spec.rb +36 -0
  111. data/spec/pulse_meter/visualize/layout_spec.rb +54 -0
  112. data/spec/pulse_meter/visualize/page_spec.rb +153 -0
  113. data/spec/pulse_meter/visualize/sensor_spec.rb +120 -0
  114. data/spec/pulse_meter/visualize/series_extractor_spec.rb +80 -0
  115. data/spec/pulse_meter/visualize/widgets/area_spec.rb +6 -0
  116. data/spec/pulse_meter/visualize/widgets/gauge_spec.rb +63 -0
  117. data/spec/pulse_meter/visualize/widgets/line_spec.rb +6 -0
  118. data/spec/pulse_meter/visualize/widgets/pie_spec.rb +73 -0
  119. data/spec/pulse_meter/visualize/widgets/table_spec.rb +6 -0
  120. data/spec/pulse_meter/visualizer_spec.rb +42 -0
  121. data/spec/shared_examples/dsl_widget.rb +106 -0
  122. data/spec/shared_examples/widget.rb +97 -0
  123. data/spec/spec_helper.rb +36 -0
  124. metadata +518 -0
@@ -0,0 +1,38 @@
1
+ // Backbone.js 0.9.2
2
+
3
+ // (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc.
4
+ // Backbone may be freely distributed under the MIT license.
5
+ // For all details and documentation:
6
+ // http://backbonejs.org
7
+ (function(){var l=this,y=l.Backbone,z=Array.prototype.slice,A=Array.prototype.splice,g;g="undefined"!==typeof exports?exports:l.Backbone={};g.VERSION="0.9.2";var f=l._;!f&&"undefined"!==typeof require&&(f=require("underscore"));var i=l.jQuery||l.Zepto||l.ender;g.setDomLibrary=function(a){i=a};g.noConflict=function(){l.Backbone=y;return this};g.emulateHTTP=!1;g.emulateJSON=!1;var p=/\s+/,k=g.Events={on:function(a,b,c){var d,e,f,g,j;if(!b)return this;a=a.split(p);for(d=this._callbacks||(this._callbacks=
8
+ {});e=a.shift();)f=(j=d[e])?j.tail:{},f.next=g={},f.context=c,f.callback=b,d[e]={tail:g,next:j?j.next:f};return this},off:function(a,b,c){var d,e,h,g,j,q;if(e=this._callbacks){if(!a&&!b&&!c)return delete this._callbacks,this;for(a=a?a.split(p):f.keys(e);d=a.shift();)if(h=e[d],delete e[d],h&&(b||c))for(g=h.tail;(h=h.next)!==g;)if(j=h.callback,q=h.context,b&&j!==b||c&&q!==c)this.on(d,j,q);return this}},trigger:function(a){var b,c,d,e,f,g;if(!(d=this._callbacks))return this;f=d.all;a=a.split(p);for(g=
9
+ z.call(arguments,1);b=a.shift();){if(c=d[b])for(e=c.tail;(c=c.next)!==e;)c.callback.apply(c.context||this,g);if(c=f){e=c.tail;for(b=[b].concat(g);(c=c.next)!==e;)c.callback.apply(c.context||this,b)}}return this}};k.bind=k.on;k.unbind=k.off;var o=g.Model=function(a,b){var c;a||(a={});b&&b.parse&&(a=this.parse(a));if(c=n(this,"defaults"))a=f.extend({},c,a);b&&b.collection&&(this.collection=b.collection);this.attributes={};this._escapedAttributes={};this.cid=f.uniqueId("c");this.changed={};this._silent=
10
+ {};this._pending={};this.set(a,{silent:!0});this.changed={};this._silent={};this._pending={};this._previousAttributes=f.clone(this.attributes);this.initialize.apply(this,arguments)};f.extend(o.prototype,k,{changed:null,_silent:null,_pending:null,idAttribute:"id",initialize:function(){},toJSON:function(){return f.clone(this.attributes)},get:function(a){return this.attributes[a]},escape:function(a){var b;if(b=this._escapedAttributes[a])return b;b=this.get(a);return this._escapedAttributes[a]=f.escape(null==
11
+ b?"":""+b)},has:function(a){return null!=this.get(a)},set:function(a,b,c){var d,e;f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b);c||(c={});if(!d)return this;d instanceof o&&(d=d.attributes);if(c.unset)for(e in d)d[e]=void 0;if(!this._validate(d,c))return!1;this.idAttribute in d&&(this.id=d[this.idAttribute]);var b=c.changes={},h=this.attributes,g=this._escapedAttributes,j=this._previousAttributes||{};for(e in d){a=d[e];if(!f.isEqual(h[e],a)||c.unset&&f.has(h,e))delete g[e],(c.silent?this._silent:
12
+ b)[e]=!0;c.unset?delete h[e]:h[e]=a;!f.isEqual(j[e],a)||f.has(h,e)!=f.has(j,e)?(this.changed[e]=a,c.silent||(this._pending[e]=!0)):(delete this.changed[e],delete this._pending[e])}c.silent||this.change(c);return this},unset:function(a,b){(b||(b={})).unset=!0;return this.set(a,null,b)},clear:function(a){(a||(a={})).unset=!0;return this.set(f.clone(this.attributes),a)},fetch:function(a){var a=a?f.clone(a):{},b=this,c=a.success;a.success=function(d,e,f){if(!b.set(b.parse(d,f),a))return!1;c&&c(b,d)};
13
+ a.error=g.wrapError(a.error,b,a);return(this.sync||g.sync).call(this,"read",this,a)},save:function(a,b,c){var d,e;f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b);c=c?f.clone(c):{};if(c.wait){if(!this._validate(d,c))return!1;e=f.clone(this.attributes)}a=f.extend({},c,{silent:!0});if(d&&!this.set(d,c.wait?a:c))return!1;var h=this,i=c.success;c.success=function(a,b,e){b=h.parse(a,e);if(c.wait){delete c.wait;b=f.extend(d||{},b)}if(!h.set(b,c))return false;i?i(h,a):h.trigger("sync",h,a,c)};c.error=g.wrapError(c.error,
14
+ h,c);b=this.isNew()?"create":"update";b=(this.sync||g.sync).call(this,b,this,c);c.wait&&this.set(e,a);return b},destroy:function(a){var a=a?f.clone(a):{},b=this,c=a.success,d=function(){b.trigger("destroy",b,b.collection,a)};if(this.isNew())return d(),!1;a.success=function(e){a.wait&&d();c?c(b,e):b.trigger("sync",b,e,a)};a.error=g.wrapError(a.error,b,a);var e=(this.sync||g.sync).call(this,"delete",this,a);a.wait||d();return e},url:function(){var a=n(this,"urlRoot")||n(this.collection,"url")||t();
15
+ return this.isNew()?a:a+("/"==a.charAt(a.length-1)?"":"/")+encodeURIComponent(this.id)},parse:function(a){return a},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return null==this.id},change:function(a){a||(a={});var b=this._changing;this._changing=!0;for(var c in this._silent)this._pending[c]=!0;var d=f.extend({},a.changes,this._silent);this._silent={};for(c in d)this.trigger("change:"+c,this,this.get(c),a);if(b)return this;for(;!f.isEmpty(this._pending);){this._pending=
16
+ {};this.trigger("change",this,a);for(c in this.changed)!this._pending[c]&&!this._silent[c]&&delete this.changed[c];this._previousAttributes=f.clone(this.attributes)}this._changing=!1;return this},hasChanged:function(a){return!arguments.length?!f.isEmpty(this.changed):f.has(this.changed,a)},changedAttributes:function(a){if(!a)return this.hasChanged()?f.clone(this.changed):!1;var b,c=!1,d=this._previousAttributes,e;for(e in a)if(!f.isEqual(d[e],b=a[e]))(c||(c={}))[e]=b;return c},previous:function(a){return!arguments.length||
17
+ !this._previousAttributes?null:this._previousAttributes[a]},previousAttributes:function(){return f.clone(this._previousAttributes)},isValid:function(){return!this.validate(this.attributes)},_validate:function(a,b){if(b.silent||!this.validate)return!0;var a=f.extend({},this.attributes,a),c=this.validate(a,b);if(!c)return!0;b&&b.error?b.error(this,c,b):this.trigger("error",this,c,b);return!1}});var r=g.Collection=function(a,b){b||(b={});b.model&&(this.model=b.model);b.comparator&&(this.comparator=b.comparator);
18
+ this._reset();this.initialize.apply(this,arguments);a&&this.reset(a,{silent:!0,parse:b.parse})};f.extend(r.prototype,k,{model:o,initialize:function(){},toJSON:function(a){return this.map(function(b){return b.toJSON(a)})},add:function(a,b){var c,d,e,g,i,j={},k={},l=[];b||(b={});a=f.isArray(a)?a.slice():[a];c=0;for(d=a.length;c<d;c++){if(!(e=a[c]=this._prepareModel(a[c],b)))throw Error("Can't add an invalid model to a collection");g=e.cid;i=e.id;j[g]||this._byCid[g]||null!=i&&(k[i]||this._byId[i])?
19
+ l.push(c):j[g]=k[i]=e}for(c=l.length;c--;)a.splice(l[c],1);c=0;for(d=a.length;c<d;c++)(e=a[c]).on("all",this._onModelEvent,this),this._byCid[e.cid]=e,null!=e.id&&(this._byId[e.id]=e);this.length+=d;A.apply(this.models,[null!=b.at?b.at:this.models.length,0].concat(a));this.comparator&&this.sort({silent:!0});if(b.silent)return this;c=0;for(d=this.models.length;c<d;c++)if(j[(e=this.models[c]).cid])b.index=c,e.trigger("add",e,this,b);return this},remove:function(a,b){var c,d,e,g;b||(b={});a=f.isArray(a)?
20
+ a.slice():[a];c=0;for(d=a.length;c<d;c++)if(g=this.getByCid(a[c])||this.get(a[c]))delete this._byId[g.id],delete this._byCid[g.cid],e=this.indexOf(g),this.models.splice(e,1),this.length--,b.silent||(b.index=e,g.trigger("remove",g,this,b)),this._removeReference(g);return this},push:function(a,b){a=this._prepareModel(a,b);this.add(a,b);return a},pop:function(a){var b=this.at(this.length-1);this.remove(b,a);return b},unshift:function(a,b){a=this._prepareModel(a,b);this.add(a,f.extend({at:0},b));return a},
21
+ shift:function(a){var b=this.at(0);this.remove(b,a);return b},get:function(a){return null==a?void 0:this._byId[null!=a.id?a.id:a]},getByCid:function(a){return a&&this._byCid[a.cid||a]},at:function(a){return this.models[a]},where:function(a){return f.isEmpty(a)?[]:this.filter(function(b){for(var c in a)if(a[c]!==b.get(c))return!1;return!0})},sort:function(a){a||(a={});if(!this.comparator)throw Error("Cannot sort a set without a comparator");var b=f.bind(this.comparator,this);1==this.comparator.length?
22
+ this.models=this.sortBy(b):this.models.sort(b);a.silent||this.trigger("reset",this,a);return this},pluck:function(a){return f.map(this.models,function(b){return b.get(a)})},reset:function(a,b){a||(a=[]);b||(b={});for(var c=0,d=this.models.length;c<d;c++)this._removeReference(this.models[c]);this._reset();this.add(a,f.extend({silent:!0},b));b.silent||this.trigger("reset",this,b);return this},fetch:function(a){a=a?f.clone(a):{};void 0===a.parse&&(a.parse=!0);var b=this,c=a.success;a.success=function(d,
23
+ e,f){b[a.add?"add":"reset"](b.parse(d,f),a);c&&c(b,d)};a.error=g.wrapError(a.error,b,a);return(this.sync||g.sync).call(this,"read",this,a)},create:function(a,b){var c=this,b=b?f.clone(b):{},a=this._prepareModel(a,b);if(!a)return!1;b.wait||c.add(a,b);var d=b.success;b.success=function(e,f){b.wait&&c.add(e,b);d?d(e,f):e.trigger("sync",a,f,b)};a.save(null,b);return a},parse:function(a){return a},chain:function(){return f(this.models).chain()},_reset:function(){this.length=0;this.models=[];this._byId=
24
+ {};this._byCid={}},_prepareModel:function(a,b){b||(b={});a instanceof o?a.collection||(a.collection=this):(b.collection=this,a=new this.model(a,b),a._validate(a.attributes,b)||(a=!1));return a},_removeReference:function(a){this==a.collection&&delete a.collection;a.off("all",this._onModelEvent,this)},_onModelEvent:function(a,b,c,d){("add"==a||"remove"==a)&&c!=this||("destroy"==a&&this.remove(b,d),b&&a==="change:"+b.idAttribute&&(delete this._byId[b.previous(b.idAttribute)],this._byId[b.id]=b),this.trigger.apply(this,
25
+ arguments))}});f.each("forEach,each,map,reduce,reduceRight,find,detect,filter,select,reject,every,all,some,any,include,contains,invoke,max,min,sortBy,sortedIndex,toArray,size,first,initial,rest,last,without,indexOf,shuffle,lastIndexOf,isEmpty,groupBy".split(","),function(a){r.prototype[a]=function(){return f[a].apply(f,[this.models].concat(f.toArray(arguments)))}});var u=g.Router=function(a){a||(a={});a.routes&&(this.routes=a.routes);this._bindRoutes();this.initialize.apply(this,arguments)},B=/:\w+/g,
26
+ C=/\*\w+/g,D=/[-[\]{}()+?.,\\^$|#\s]/g;f.extend(u.prototype,k,{initialize:function(){},route:function(a,b,c){g.history||(g.history=new m);f.isRegExp(a)||(a=this._routeToRegExp(a));c||(c=this[b]);g.history.route(a,f.bind(function(d){d=this._extractParameters(a,d);c&&c.apply(this,d);this.trigger.apply(this,["route:"+b].concat(d));g.history.trigger("route",this,b,d)},this));return this},navigate:function(a,b){g.history.navigate(a,b)},_bindRoutes:function(){if(this.routes){var a=[],b;for(b in this.routes)a.unshift([b,
27
+ this.routes[b]]);b=0;for(var c=a.length;b<c;b++)this.route(a[b][0],a[b][1],this[a[b][1]])}},_routeToRegExp:function(a){a=a.replace(D,"\\$&").replace(B,"([^/]+)").replace(C,"(.*?)");return RegExp("^"+a+"$")},_extractParameters:function(a,b){return a.exec(b).slice(1)}});var m=g.History=function(){this.handlers=[];f.bindAll(this,"checkUrl")},s=/^[#\/]/,E=/msie [\w.]+/;m.started=!1;f.extend(m.prototype,k,{interval:50,getHash:function(a){return(a=(a?a.location:window.location).href.match(/#(.*)$/))?a[1]:
28
+ ""},getFragment:function(a,b){if(null==a)if(this._hasPushState||b){var a=window.location.pathname,c=window.location.search;c&&(a+=c)}else a=this.getHash();a.indexOf(this.options.root)||(a=a.substr(this.options.root.length));return a.replace(s,"")},start:function(a){if(m.started)throw Error("Backbone.history has already been started");m.started=!0;this.options=f.extend({},{root:"/"},this.options,a);this._wantsHashChange=!1!==this.options.hashChange;this._wantsPushState=!!this.options.pushState;this._hasPushState=
29
+ !(!this.options.pushState||!window.history||!window.history.pushState);var a=this.getFragment(),b=document.documentMode;if(b=E.exec(navigator.userAgent.toLowerCase())&&(!b||7>=b))this.iframe=i('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow,this.navigate(a);this._hasPushState?i(window).bind("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!b?i(window).bind("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,
30
+ this.interval));this.fragment=a;a=window.location;b=a.pathname==this.options.root;if(this._wantsHashChange&&this._wantsPushState&&!this._hasPushState&&!b)return this.fragment=this.getFragment(null,!0),window.location.replace(this.options.root+"#"+this.fragment),!0;this._wantsPushState&&this._hasPushState&&b&&a.hash&&(this.fragment=this.getHash().replace(s,""),window.history.replaceState({},document.title,a.protocol+"//"+a.host+this.options.root+this.fragment));if(!this.options.silent)return this.loadUrl()},
31
+ stop:function(){i(window).unbind("popstate",this.checkUrl).unbind("hashchange",this.checkUrl);clearInterval(this._checkUrlInterval);m.started=!1},route:function(a,b){this.handlers.unshift({route:a,callback:b})},checkUrl:function(){var a=this.getFragment();a==this.fragment&&this.iframe&&(a=this.getFragment(this.getHash(this.iframe)));if(a==this.fragment)return!1;this.iframe&&this.navigate(a);this.loadUrl()||this.loadUrl(this.getHash())},loadUrl:function(a){var b=this.fragment=this.getFragment(a);return f.any(this.handlers,
32
+ function(a){if(a.route.test(b))return a.callback(b),!0})},navigate:function(a,b){if(!m.started)return!1;if(!b||!0===b)b={trigger:b};var c=(a||"").replace(s,"");this.fragment!=c&&(this._hasPushState?(0!=c.indexOf(this.options.root)&&(c=this.options.root+c),this.fragment=c,window.history[b.replace?"replaceState":"pushState"]({},document.title,c)):this._wantsHashChange?(this.fragment=c,this._updateHash(window.location,c,b.replace),this.iframe&&c!=this.getFragment(this.getHash(this.iframe))&&(b.replace||
33
+ this.iframe.document.open().close(),this._updateHash(this.iframe.location,c,b.replace))):window.location.assign(this.options.root+a),b.trigger&&this.loadUrl(a))},_updateHash:function(a,b,c){c?a.replace(a.toString().replace(/(javascript:|#).*$/,"")+"#"+b):a.hash=b}});var v=g.View=function(a){this.cid=f.uniqueId("view");this._configure(a||{});this._ensureElement();this.initialize.apply(this,arguments);this.delegateEvents()},F=/^(\S+)\s*(.*)$/,w="model,collection,el,id,attributes,className,tagName".split(",");
34
+ f.extend(v.prototype,k,{tagName:"div",$:function(a){return this.$el.find(a)},initialize:function(){},render:function(){return this},remove:function(){this.$el.remove();return this},make:function(a,b,c){a=document.createElement(a);b&&i(a).attr(b);c&&i(a).html(c);return a},setElement:function(a,b){this.$el&&this.undelegateEvents();this.$el=a instanceof i?a:i(a);this.el=this.$el[0];!1!==b&&this.delegateEvents();return this},delegateEvents:function(a){if(a||(a=n(this,"events"))){this.undelegateEvents();
35
+ for(var b in a){var c=a[b];f.isFunction(c)||(c=this[a[b]]);if(!c)throw Error('Method "'+a[b]+'" does not exist');var d=b.match(F),e=d[1],d=d[2],c=f.bind(c,this),e=e+(".delegateEvents"+this.cid);""===d?this.$el.bind(e,c):this.$el.delegate(d,e,c)}}},undelegateEvents:function(){this.$el.unbind(".delegateEvents"+this.cid)},_configure:function(a){this.options&&(a=f.extend({},this.options,a));for(var b=0,c=w.length;b<c;b++){var d=w[b];a[d]&&(this[d]=a[d])}this.options=a},_ensureElement:function(){if(this.el)this.setElement(this.el,
36
+ !1);else{var a=n(this,"attributes")||{};this.id&&(a.id=this.id);this.className&&(a["class"]=this.className);this.setElement(this.make(this.tagName,a),!1)}}});o.extend=r.extend=u.extend=v.extend=function(a,b){var c=G(this,a,b);c.extend=this.extend;return c};var H={create:"POST",update:"PUT","delete":"DELETE",read:"GET"};g.sync=function(a,b,c){var d=H[a];c||(c={});var e={type:d,dataType:"json"};c.url||(e.url=n(b,"url")||t());if(!c.data&&b&&("create"==a||"update"==a))e.contentType="application/json",
37
+ e.data=JSON.stringify(b.toJSON());g.emulateJSON&&(e.contentType="application/x-www-form-urlencoded",e.data=e.data?{model:e.data}:{});if(g.emulateHTTP&&("PUT"===d||"DELETE"===d))g.emulateJSON&&(e.data._method=d),e.type="POST",e.beforeSend=function(a){a.setRequestHeader("X-HTTP-Method-Override",d)};"GET"!==e.type&&!g.emulateJSON&&(e.processData=!1);return i.ajax(f.extend(e,c))};g.wrapError=function(a,b,c){return function(d,e){e=d===b?e:d;a?a(b,e,c):b.trigger("error",b,e,c)}};var x=function(){},G=function(a,
38
+ b,c){var d;d=b&&b.hasOwnProperty("constructor")?b.constructor:function(){a.apply(this,arguments)};f.extend(d,a);x.prototype=a.prototype;d.prototype=new x;b&&f.extend(d.prototype,b);c&&f.extend(d,c);d.prototype.constructor=d;d.__super__=a.prototype;return d},n=function(a,b){return!a||!a[b]?null:f.isFunction(a[b])?a[b]():a[b]},t=function(){throw Error('A "url" property or function must be specified');}}).call(this);
@@ -0,0 +1,1835 @@
1
+ /* ===================================================
2
+ * bootstrap-transition.js v2.0.3
3
+ * http://twitter.github.com/bootstrap/javascript.html#transitions
4
+ * ===================================================
5
+ * Copyright 2012 Twitter, Inc.
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ * ========================================================== */
19
+
20
+
21
+ !function ($) {
22
+
23
+ $(function () {
24
+
25
+ "use strict"; // jshint ;_;
26
+
27
+
28
+ /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
29
+ * ======================================================= */
30
+
31
+ $.support.transition = (function () {
32
+
33
+ var transitionEnd = (function () {
34
+
35
+ var el = document.createElement('bootstrap')
36
+ , transEndEventNames = {
37
+ 'WebkitTransition' : 'webkitTransitionEnd'
38
+ , 'MozTransition' : 'transitionend'
39
+ , 'OTransition' : 'oTransitionEnd'
40
+ , 'msTransition' : 'MSTransitionEnd'
41
+ , 'transition' : 'transitionend'
42
+ }
43
+ , name
44
+
45
+ for (name in transEndEventNames){
46
+ if (el.style[name] !== undefined) {
47
+ return transEndEventNames[name]
48
+ }
49
+ }
50
+
51
+ }())
52
+
53
+ return transitionEnd && {
54
+ end: transitionEnd
55
+ }
56
+
57
+ })()
58
+
59
+ })
60
+
61
+ }(window.jQuery);
62
+ /* =========================================================
63
+ * bootstrap-modal.js v2.0.3
64
+ * http://twitter.github.com/bootstrap/javascript.html#modals
65
+ * =========================================================
66
+ * Copyright 2012 Twitter, Inc.
67
+ *
68
+ * Licensed under the Apache License, Version 2.0 (the "License");
69
+ * you may not use this file except in compliance with the License.
70
+ * You may obtain a copy of the License at
71
+ *
72
+ * http://www.apache.org/licenses/LICENSE-2.0
73
+ *
74
+ * Unless required by applicable law or agreed to in writing, software
75
+ * distributed under the License is distributed on an "AS IS" BASIS,
76
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
77
+ * See the License for the specific language governing permissions and
78
+ * limitations under the License.
79
+ * ========================================================= */
80
+
81
+
82
+ !function ($) {
83
+
84
+ "use strict"; // jshint ;_;
85
+
86
+
87
+ /* MODAL CLASS DEFINITION
88
+ * ====================== */
89
+
90
+ var Modal = function (content, options) {
91
+ this.options = options
92
+ this.$element = $(content)
93
+ .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
94
+ }
95
+
96
+ Modal.prototype = {
97
+
98
+ constructor: Modal
99
+
100
+ , toggle: function () {
101
+ return this[!this.isShown ? 'show' : 'hide']()
102
+ }
103
+
104
+ , show: function () {
105
+ var that = this
106
+ , e = $.Event('show')
107
+
108
+ this.$element.trigger(e)
109
+
110
+ if (this.isShown || e.isDefaultPrevented()) return
111
+
112
+ $('body').addClass('modal-open')
113
+
114
+ this.isShown = true
115
+
116
+ escape.call(this)
117
+ backdrop.call(this, function () {
118
+ var transition = $.support.transition && that.$element.hasClass('fade')
119
+
120
+ if (!that.$element.parent().length) {
121
+ that.$element.appendTo(document.body) //don't move modals dom position
122
+ }
123
+
124
+ that.$element
125
+ .show()
126
+
127
+ if (transition) {
128
+ that.$element[0].offsetWidth // force reflow
129
+ }
130
+
131
+ that.$element.addClass('in')
132
+
133
+ transition ?
134
+ that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
135
+ that.$element.trigger('shown')
136
+
137
+ })
138
+ }
139
+
140
+ , hide: function (e) {
141
+ e && e.preventDefault()
142
+
143
+ var that = this
144
+
145
+ e = $.Event('hide')
146
+
147
+ this.$element.trigger(e)
148
+
149
+ if (!this.isShown || e.isDefaultPrevented()) return
150
+
151
+ this.isShown = false
152
+
153
+ $('body').removeClass('modal-open')
154
+
155
+ escape.call(this)
156
+
157
+ this.$element.removeClass('in')
158
+
159
+ $.support.transition && this.$element.hasClass('fade') ?
160
+ hideWithTransition.call(this) :
161
+ hideModal.call(this)
162
+ }
163
+
164
+ }
165
+
166
+
167
+ /* MODAL PRIVATE METHODS
168
+ * ===================== */
169
+
170
+ function hideWithTransition() {
171
+ var that = this
172
+ , timeout = setTimeout(function () {
173
+ that.$element.off($.support.transition.end)
174
+ hideModal.call(that)
175
+ }, 500)
176
+
177
+ this.$element.one($.support.transition.end, function () {
178
+ clearTimeout(timeout)
179
+ hideModal.call(that)
180
+ })
181
+ }
182
+
183
+ function hideModal(that) {
184
+ this.$element
185
+ .hide()
186
+ .trigger('hidden')
187
+
188
+ backdrop.call(this)
189
+ }
190
+
191
+ function backdrop(callback) {
192
+ var that = this
193
+ , animate = this.$element.hasClass('fade') ? 'fade' : ''
194
+
195
+ if (this.isShown && this.options.backdrop) {
196
+ var doAnimate = $.support.transition && animate
197
+
198
+ this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
199
+ .appendTo(document.body)
200
+
201
+ if (this.options.backdrop != 'static') {
202
+ this.$backdrop.click($.proxy(this.hide, this))
203
+ }
204
+
205
+ if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
206
+
207
+ this.$backdrop.addClass('in')
208
+
209
+ doAnimate ?
210
+ this.$backdrop.one($.support.transition.end, callback) :
211
+ callback()
212
+
213
+ } else if (!this.isShown && this.$backdrop) {
214
+ this.$backdrop.removeClass('in')
215
+
216
+ $.support.transition && this.$element.hasClass('fade')?
217
+ this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) :
218
+ removeBackdrop.call(this)
219
+
220
+ } else if (callback) {
221
+ callback()
222
+ }
223
+ }
224
+
225
+ function removeBackdrop() {
226
+ this.$backdrop.remove()
227
+ this.$backdrop = null
228
+ }
229
+
230
+ function escape() {
231
+ var that = this
232
+ if (this.isShown && this.options.keyboard) {
233
+ $(document).on('keyup.dismiss.modal', function ( e ) {
234
+ e.which == 27 && that.hide()
235
+ })
236
+ } else if (!this.isShown) {
237
+ $(document).off('keyup.dismiss.modal')
238
+ }
239
+ }
240
+
241
+
242
+ /* MODAL PLUGIN DEFINITION
243
+ * ======================= */
244
+
245
+ $.fn.modal = function (option) {
246
+ return this.each(function () {
247
+ var $this = $(this)
248
+ , data = $this.data('modal')
249
+ , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
250
+ if (!data) $this.data('modal', (data = new Modal(this, options)))
251
+ if (typeof option == 'string') data[option]()
252
+ else if (options.show) data.show()
253
+ })
254
+ }
255
+
256
+ $.fn.modal.defaults = {
257
+ backdrop: true
258
+ , keyboard: true
259
+ , show: true
260
+ }
261
+
262
+ $.fn.modal.Constructor = Modal
263
+
264
+
265
+ /* MODAL DATA-API
266
+ * ============== */
267
+
268
+ $(function () {
269
+ $('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
270
+ var $this = $(this), href
271
+ , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
272
+ , option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data())
273
+
274
+ e.preventDefault()
275
+ $target.modal(option)
276
+ })
277
+ })
278
+
279
+ }(window.jQuery);
280
+ /* ============================================================
281
+ * bootstrap-dropdown.js v2.0.3
282
+ * http://twitter.github.com/bootstrap/javascript.html#dropdowns
283
+ * ============================================================
284
+ * Copyright 2012 Twitter, Inc.
285
+ *
286
+ * Licensed under the Apache License, Version 2.0 (the "License");
287
+ * you may not use this file except in compliance with the License.
288
+ * You may obtain a copy of the License at
289
+ *
290
+ * http://www.apache.org/licenses/LICENSE-2.0
291
+ *
292
+ * Unless required by applicable law or agreed to in writing, software
293
+ * distributed under the License is distributed on an "AS IS" BASIS,
294
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
295
+ * See the License for the specific language governing permissions and
296
+ * limitations under the License.
297
+ * ============================================================ */
298
+
299
+
300
+ !function ($) {
301
+
302
+ "use strict"; // jshint ;_;
303
+
304
+
305
+ /* DROPDOWN CLASS DEFINITION
306
+ * ========================= */
307
+
308
+ var toggle = '[data-toggle="dropdown"]'
309
+ , Dropdown = function (element) {
310
+ var $el = $(element).on('click.dropdown.data-api', this.toggle)
311
+ $('html').on('click.dropdown.data-api', function () {
312
+ $el.parent().removeClass('open')
313
+ })
314
+ }
315
+
316
+ Dropdown.prototype = {
317
+
318
+ constructor: Dropdown
319
+
320
+ , toggle: function (e) {
321
+ var $this = $(this)
322
+ , $parent
323
+ , selector
324
+ , isActive
325
+
326
+ if ($this.is('.disabled, :disabled')) return
327
+
328
+ selector = $this.attr('data-target')
329
+
330
+ if (!selector) {
331
+ selector = $this.attr('href')
332
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
333
+ }
334
+
335
+ $parent = $(selector)
336
+ $parent.length || ($parent = $this.parent())
337
+
338
+ isActive = $parent.hasClass('open')
339
+
340
+ clearMenus()
341
+
342
+ if (!isActive) $parent.toggleClass('open')
343
+
344
+ return false
345
+ }
346
+
347
+ }
348
+
349
+ function clearMenus() {
350
+ $(toggle).parent().removeClass('open')
351
+ }
352
+
353
+
354
+ /* DROPDOWN PLUGIN DEFINITION
355
+ * ========================== */
356
+
357
+ $.fn.dropdown = function (option) {
358
+ return this.each(function () {
359
+ var $this = $(this)
360
+ , data = $this.data('dropdown')
361
+ if (!data) $this.data('dropdown', (data = new Dropdown(this)))
362
+ if (typeof option == 'string') data[option].call($this)
363
+ })
364
+ }
365
+
366
+ $.fn.dropdown.Constructor = Dropdown
367
+
368
+
369
+ /* APPLY TO STANDARD DROPDOWN ELEMENTS
370
+ * =================================== */
371
+
372
+ $(function () {
373
+ $('html').on('click.dropdown.data-api', clearMenus)
374
+ $('body')
375
+ .on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
376
+ .on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
377
+ })
378
+
379
+ }(window.jQuery);
380
+ /* =============================================================
381
+ * bootstrap-scrollspy.js v2.0.3
382
+ * http://twitter.github.com/bootstrap/javascript.html#scrollspy
383
+ * =============================================================
384
+ * Copyright 2012 Twitter, Inc.
385
+ *
386
+ * Licensed under the Apache License, Version 2.0 (the "License");
387
+ * you may not use this file except in compliance with the License.
388
+ * You may obtain a copy of the License at
389
+ *
390
+ * http://www.apache.org/licenses/LICENSE-2.0
391
+ *
392
+ * Unless required by applicable law or agreed to in writing, software
393
+ * distributed under the License is distributed on an "AS IS" BASIS,
394
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
395
+ * See the License for the specific language governing permissions and
396
+ * limitations under the License.
397
+ * ============================================================== */
398
+
399
+
400
+ !function ($) {
401
+
402
+ "use strict"; // jshint ;_;
403
+
404
+
405
+ /* SCROLLSPY CLASS DEFINITION
406
+ * ========================== */
407
+
408
+ function ScrollSpy( element, options) {
409
+ var process = $.proxy(this.process, this)
410
+ , $element = $(element).is('body') ? $(window) : $(element)
411
+ , href
412
+ this.options = $.extend({}, $.fn.scrollspy.defaults, options)
413
+ this.$scrollElement = $element.on('scroll.scroll.data-api', process)
414
+ this.selector = (this.options.target
415
+ || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
416
+ || '') + ' .nav li > a'
417
+ this.$body = $('body')
418
+ this.refresh()
419
+ this.process()
420
+ }
421
+
422
+ ScrollSpy.prototype = {
423
+
424
+ constructor: ScrollSpy
425
+
426
+ , refresh: function () {
427
+ var self = this
428
+ , $targets
429
+
430
+ this.offsets = $([])
431
+ this.targets = $([])
432
+
433
+ $targets = this.$body
434
+ .find(this.selector)
435
+ .map(function () {
436
+ var $el = $(this)
437
+ , href = $el.data('target') || $el.attr('href')
438
+ , $href = /^#\w/.test(href) && $(href)
439
+ return ( $href
440
+ && href.length
441
+ && [[ $href.position().top, href ]] ) || null
442
+ })
443
+ .sort(function (a, b) { return a[0] - b[0] })
444
+ .each(function () {
445
+ self.offsets.push(this[0])
446
+ self.targets.push(this[1])
447
+ })
448
+ }
449
+
450
+ , process: function () {
451
+ var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
452
+ , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
453
+ , maxScroll = scrollHeight - this.$scrollElement.height()
454
+ , offsets = this.offsets
455
+ , targets = this.targets
456
+ , activeTarget = this.activeTarget
457
+ , i
458
+
459
+ if (scrollTop >= maxScroll) {
460
+ return activeTarget != (i = targets.last()[0])
461
+ && this.activate ( i )
462
+ }
463
+
464
+ for (i = offsets.length; i--;) {
465
+ activeTarget != targets[i]
466
+ && scrollTop >= offsets[i]
467
+ && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
468
+ && this.activate( targets[i] )
469
+ }
470
+ }
471
+
472
+ , activate: function (target) {
473
+ var active
474
+ , selector
475
+
476
+ this.activeTarget = target
477
+
478
+ $(this.selector)
479
+ .parent('.active')
480
+ .removeClass('active')
481
+
482
+ selector = this.selector
483
+ + '[data-target="' + target + '"],'
484
+ + this.selector + '[href="' + target + '"]'
485
+
486
+ active = $(selector)
487
+ .parent('li')
488
+ .addClass('active')
489
+
490
+ if (active.parent('.dropdown-menu')) {
491
+ active = active.closest('li.dropdown').addClass('active')
492
+ }
493
+
494
+ active.trigger('activate')
495
+ }
496
+
497
+ }
498
+
499
+
500
+ /* SCROLLSPY PLUGIN DEFINITION
501
+ * =========================== */
502
+
503
+ $.fn.scrollspy = function ( option ) {
504
+ return this.each(function () {
505
+ var $this = $(this)
506
+ , data = $this.data('scrollspy')
507
+ , options = typeof option == 'object' && option
508
+ if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
509
+ if (typeof option == 'string') data[option]()
510
+ })
511
+ }
512
+
513
+ $.fn.scrollspy.Constructor = ScrollSpy
514
+
515
+ $.fn.scrollspy.defaults = {
516
+ offset: 10
517
+ }
518
+
519
+
520
+ /* SCROLLSPY DATA-API
521
+ * ================== */
522
+
523
+ $(function () {
524
+ $('[data-spy="scroll"]').each(function () {
525
+ var $spy = $(this)
526
+ $spy.scrollspy($spy.data())
527
+ })
528
+ })
529
+
530
+ }(window.jQuery);
531
+ /* ========================================================
532
+ * bootstrap-tab.js v2.0.3
533
+ * http://twitter.github.com/bootstrap/javascript.html#tabs
534
+ * ========================================================
535
+ * Copyright 2012 Twitter, Inc.
536
+ *
537
+ * Licensed under the Apache License, Version 2.0 (the "License");
538
+ * you may not use this file except in compliance with the License.
539
+ * You may obtain a copy of the License at
540
+ *
541
+ * http://www.apache.org/licenses/LICENSE-2.0
542
+ *
543
+ * Unless required by applicable law or agreed to in writing, software
544
+ * distributed under the License is distributed on an "AS IS" BASIS,
545
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
546
+ * See the License for the specific language governing permissions and
547
+ * limitations under the License.
548
+ * ======================================================== */
549
+
550
+
551
+ !function ($) {
552
+
553
+ "use strict"; // jshint ;_;
554
+
555
+
556
+ /* TAB CLASS DEFINITION
557
+ * ==================== */
558
+
559
+ var Tab = function ( element ) {
560
+ this.element = $(element)
561
+ }
562
+
563
+ Tab.prototype = {
564
+
565
+ constructor: Tab
566
+
567
+ , show: function () {
568
+ var $this = this.element
569
+ , $ul = $this.closest('ul:not(.dropdown-menu)')
570
+ , selector = $this.attr('data-target')
571
+ , previous
572
+ , $target
573
+ , e
574
+
575
+ if (!selector) {
576
+ selector = $this.attr('href')
577
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
578
+ }
579
+
580
+ if ( $this.parent('li').hasClass('active') ) return
581
+
582
+ previous = $ul.find('.active a').last()[0]
583
+
584
+ e = $.Event('show', {
585
+ relatedTarget: previous
586
+ })
587
+
588
+ $this.trigger(e)
589
+
590
+ if (e.isDefaultPrevented()) return
591
+
592
+ $target = $(selector)
593
+
594
+ this.activate($this.parent('li'), $ul)
595
+ this.activate($target, $target.parent(), function () {
596
+ $this.trigger({
597
+ type: 'shown'
598
+ , relatedTarget: previous
599
+ })
600
+ })
601
+ }
602
+
603
+ , activate: function ( element, container, callback) {
604
+ var $active = container.find('> .active')
605
+ , transition = callback
606
+ && $.support.transition
607
+ && $active.hasClass('fade')
608
+
609
+ function next() {
610
+ $active
611
+ .removeClass('active')
612
+ .find('> .dropdown-menu > .active')
613
+ .removeClass('active')
614
+
615
+ element.addClass('active')
616
+
617
+ if (transition) {
618
+ element[0].offsetWidth // reflow for transition
619
+ element.addClass('in')
620
+ } else {
621
+ element.removeClass('fade')
622
+ }
623
+
624
+ if ( element.parent('.dropdown-menu') ) {
625
+ element.closest('li.dropdown').addClass('active')
626
+ }
627
+
628
+ callback && callback()
629
+ }
630
+
631
+ transition ?
632
+ $active.one($.support.transition.end, next) :
633
+ next()
634
+
635
+ $active.removeClass('in')
636
+ }
637
+ }
638
+
639
+
640
+ /* TAB PLUGIN DEFINITION
641
+ * ===================== */
642
+
643
+ $.fn.tab = function ( option ) {
644
+ return this.each(function () {
645
+ var $this = $(this)
646
+ , data = $this.data('tab')
647
+ if (!data) $this.data('tab', (data = new Tab(this)))
648
+ if (typeof option == 'string') data[option]()
649
+ })
650
+ }
651
+
652
+ $.fn.tab.Constructor = Tab
653
+
654
+
655
+ /* TAB DATA-API
656
+ * ============ */
657
+
658
+ $(function () {
659
+ $('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
660
+ e.preventDefault()
661
+ $(this).tab('show')
662
+ })
663
+ })
664
+
665
+ }(window.jQuery);
666
+ /* ===========================================================
667
+ * bootstrap-tooltip.js v2.0.3
668
+ * http://twitter.github.com/bootstrap/javascript.html#tooltips
669
+ * Inspired by the original jQuery.tipsy by Jason Frame
670
+ * ===========================================================
671
+ * Copyright 2012 Twitter, Inc.
672
+ *
673
+ * Licensed under the Apache License, Version 2.0 (the "License");
674
+ * you may not use this file except in compliance with the License.
675
+ * You may obtain a copy of the License at
676
+ *
677
+ * http://www.apache.org/licenses/LICENSE-2.0
678
+ *
679
+ * Unless required by applicable law or agreed to in writing, software
680
+ * distributed under the License is distributed on an "AS IS" BASIS,
681
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
682
+ * See the License for the specific language governing permissions and
683
+ * limitations under the License.
684
+ * ========================================================== */
685
+
686
+
687
+ !function ($) {
688
+
689
+ "use strict"; // jshint ;_;
690
+
691
+
692
+ /* TOOLTIP PUBLIC CLASS DEFINITION
693
+ * =============================== */
694
+
695
+ var Tooltip = function (element, options) {
696
+ this.init('tooltip', element, options)
697
+ }
698
+
699
+ Tooltip.prototype = {
700
+
701
+ constructor: Tooltip
702
+
703
+ , init: function (type, element, options) {
704
+ var eventIn
705
+ , eventOut
706
+
707
+ this.type = type
708
+ this.$element = $(element)
709
+ this.options = this.getOptions(options)
710
+ this.enabled = true
711
+
712
+ if (this.options.trigger != 'manual') {
713
+ eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
714
+ eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
715
+ this.$element.on(eventIn, this.options.selector, $.proxy(this.enter, this))
716
+ this.$element.on(eventOut, this.options.selector, $.proxy(this.leave, this))
717
+ }
718
+
719
+ this.options.selector ?
720
+ (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
721
+ this.fixTitle()
722
+ }
723
+
724
+ , getOptions: function (options) {
725
+ options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
726
+
727
+ if (options.delay && typeof options.delay == 'number') {
728
+ options.delay = {
729
+ show: options.delay
730
+ , hide: options.delay
731
+ }
732
+ }
733
+
734
+ return options
735
+ }
736
+
737
+ , enter: function (e) {
738
+ var self = $(e.currentTarget)[this.type](this._options).data(this.type)
739
+
740
+ if (!self.options.delay || !self.options.delay.show) return self.show()
741
+
742
+ clearTimeout(this.timeout)
743
+ self.hoverState = 'in'
744
+ this.timeout = setTimeout(function() {
745
+ if (self.hoverState == 'in') self.show()
746
+ }, self.options.delay.show)
747
+ }
748
+
749
+ , leave: function (e) {
750
+ var self = $(e.currentTarget)[this.type](this._options).data(this.type)
751
+
752
+ if (!self.options.delay || !self.options.delay.hide) return self.hide()
753
+
754
+ clearTimeout(this.timeout)
755
+ self.hoverState = 'out'
756
+ this.timeout = setTimeout(function() {
757
+ if (self.hoverState == 'out') self.hide()
758
+ }, self.options.delay.hide)
759
+ }
760
+
761
+ , show: function () {
762
+ var $tip
763
+ , inside
764
+ , pos
765
+ , actualWidth
766
+ , actualHeight
767
+ , placement
768
+ , tp
769
+
770
+ if (this.hasContent() && this.enabled) {
771
+ $tip = this.tip()
772
+ this.setContent()
773
+
774
+ if (this.options.animation) {
775
+ $tip.addClass('fade')
776
+ }
777
+
778
+ placement = typeof this.options.placement == 'function' ?
779
+ this.options.placement.call(this, $tip[0], this.$element[0]) :
780
+ this.options.placement
781
+
782
+ inside = /in/.test(placement)
783
+
784
+ $tip
785
+ .remove()
786
+ .css({ top: 0, left: 0, display: 'block' })
787
+ .appendTo(inside ? this.$element : document.body)
788
+
789
+ pos = this.getPosition(inside)
790
+
791
+ actualWidth = $tip[0].offsetWidth
792
+ actualHeight = $tip[0].offsetHeight
793
+
794
+ switch (inside ? placement.split(' ')[1] : placement) {
795
+ case 'bottom':
796
+ tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
797
+ break
798
+ case 'top':
799
+ tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
800
+ break
801
+ case 'left':
802
+ tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
803
+ break
804
+ case 'right':
805
+ tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
806
+ break
807
+ }
808
+
809
+ $tip
810
+ .css(tp)
811
+ .addClass(placement)
812
+ .addClass('in')
813
+ }
814
+ }
815
+
816
+ , isHTML: function(text) {
817
+ // html string detection logic adapted from jQuery
818
+ return typeof text != 'string'
819
+ || ( text.charAt(0) === "<"
820
+ && text.charAt( text.length - 1 ) === ">"
821
+ && text.length >= 3
822
+ ) || /^(?:[^<]*<[\w\W]+>[^>]*$)/.exec(text)
823
+ }
824
+
825
+ , setContent: function () {
826
+ var $tip = this.tip()
827
+ , title = this.getTitle()
828
+
829
+ $tip.find('.tooltip-inner')[this.isHTML(title) ? 'html' : 'text'](title)
830
+ $tip.removeClass('fade in top bottom left right')
831
+ }
832
+
833
+ , hide: function () {
834
+ var that = this
835
+ , $tip = this.tip()
836
+
837
+ $tip.removeClass('in')
838
+
839
+ function removeWithAnimation() {
840
+ var timeout = setTimeout(function () {
841
+ $tip.off($.support.transition.end).remove()
842
+ }, 500)
843
+
844
+ $tip.one($.support.transition.end, function () {
845
+ clearTimeout(timeout)
846
+ $tip.remove()
847
+ })
848
+ }
849
+
850
+ $.support.transition && this.$tip.hasClass('fade') ?
851
+ removeWithAnimation() :
852
+ $tip.remove()
853
+ }
854
+
855
+ , fixTitle: function () {
856
+ var $e = this.$element
857
+ if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
858
+ $e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
859
+ }
860
+ }
861
+
862
+ , hasContent: function () {
863
+ return this.getTitle()
864
+ }
865
+
866
+ , getPosition: function (inside) {
867
+ return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
868
+ width: this.$element[0].offsetWidth
869
+ , height: this.$element[0].offsetHeight
870
+ })
871
+ }
872
+
873
+ , getTitle: function () {
874
+ var title
875
+ , $e = this.$element
876
+ , o = this.options
877
+
878
+ title = $e.attr('data-original-title')
879
+ || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
880
+
881
+ return title
882
+ }
883
+
884
+ , tip: function () {
885
+ return this.$tip = this.$tip || $(this.options.template)
886
+ }
887
+
888
+ , validate: function () {
889
+ if (!this.$element[0].parentNode) {
890
+ this.hide()
891
+ this.$element = null
892
+ this.options = null
893
+ }
894
+ }
895
+
896
+ , enable: function () {
897
+ this.enabled = true
898
+ }
899
+
900
+ , disable: function () {
901
+ this.enabled = false
902
+ }
903
+
904
+ , toggleEnabled: function () {
905
+ this.enabled = !this.enabled
906
+ }
907
+
908
+ , toggle: function () {
909
+ this[this.tip().hasClass('in') ? 'hide' : 'show']()
910
+ }
911
+
912
+ }
913
+
914
+
915
+ /* TOOLTIP PLUGIN DEFINITION
916
+ * ========================= */
917
+
918
+ $.fn.tooltip = function ( option ) {
919
+ return this.each(function () {
920
+ var $this = $(this)
921
+ , data = $this.data('tooltip')
922
+ , options = typeof option == 'object' && option
923
+ if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
924
+ if (typeof option == 'string') data[option]()
925
+ })
926
+ }
927
+
928
+ $.fn.tooltip.Constructor = Tooltip
929
+
930
+ $.fn.tooltip.defaults = {
931
+ animation: true
932
+ , placement: 'top'
933
+ , selector: false
934
+ , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
935
+ , trigger: 'hover'
936
+ , title: ''
937
+ , delay: 0
938
+ }
939
+
940
+ }(window.jQuery);
941
+ /* ===========================================================
942
+ * bootstrap-popover.js v2.0.3
943
+ * http://twitter.github.com/bootstrap/javascript.html#popovers
944
+ * ===========================================================
945
+ * Copyright 2012 Twitter, Inc.
946
+ *
947
+ * Licensed under the Apache License, Version 2.0 (the "License");
948
+ * you may not use this file except in compliance with the License.
949
+ * You may obtain a copy of the License at
950
+ *
951
+ * http://www.apache.org/licenses/LICENSE-2.0
952
+ *
953
+ * Unless required by applicable law or agreed to in writing, software
954
+ * distributed under the License is distributed on an "AS IS" BASIS,
955
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
956
+ * See the License for the specific language governing permissions and
957
+ * limitations under the License.
958
+ * =========================================================== */
959
+
960
+
961
+ !function ($) {
962
+
963
+ "use strict"; // jshint ;_;
964
+
965
+
966
+ /* POPOVER PUBLIC CLASS DEFINITION
967
+ * =============================== */
968
+
969
+ var Popover = function ( element, options ) {
970
+ this.init('popover', element, options)
971
+ }
972
+
973
+
974
+ /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
975
+ ========================================== */
976
+
977
+ Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
978
+
979
+ constructor: Popover
980
+
981
+ , setContent: function () {
982
+ var $tip = this.tip()
983
+ , title = this.getTitle()
984
+ , content = this.getContent()
985
+
986
+ $tip.find('.popover-title')[this.isHTML(title) ? 'html' : 'text'](title)
987
+ $tip.find('.popover-content > *')[this.isHTML(content) ? 'html' : 'text'](content)
988
+
989
+ $tip.removeClass('fade top bottom left right in')
990
+ }
991
+
992
+ , hasContent: function () {
993
+ return this.getTitle() || this.getContent()
994
+ }
995
+
996
+ , getContent: function () {
997
+ var content
998
+ , $e = this.$element
999
+ , o = this.options
1000
+
1001
+ content = $e.attr('data-content')
1002
+ || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
1003
+
1004
+ return content
1005
+ }
1006
+
1007
+ , tip: function () {
1008
+ if (!this.$tip) {
1009
+ this.$tip = $(this.options.template)
1010
+ }
1011
+ return this.$tip
1012
+ }
1013
+
1014
+ })
1015
+
1016
+
1017
+ /* POPOVER PLUGIN DEFINITION
1018
+ * ======================= */
1019
+
1020
+ $.fn.popover = function (option) {
1021
+ return this.each(function () {
1022
+ var $this = $(this)
1023
+ , data = $this.data('popover')
1024
+ , options = typeof option == 'object' && option
1025
+ if (!data) $this.data('popover', (data = new Popover(this, options)))
1026
+ if (typeof option == 'string') data[option]()
1027
+ })
1028
+ }
1029
+
1030
+ $.fn.popover.Constructor = Popover
1031
+
1032
+ $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
1033
+ placement: 'right'
1034
+ , content: ''
1035
+ , template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'
1036
+ })
1037
+
1038
+ }(window.jQuery);
1039
+ /* ==========================================================
1040
+ * bootstrap-alert.js v2.0.3
1041
+ * http://twitter.github.com/bootstrap/javascript.html#alerts
1042
+ * ==========================================================
1043
+ * Copyright 2012 Twitter, Inc.
1044
+ *
1045
+ * Licensed under the Apache License, Version 2.0 (the "License");
1046
+ * you may not use this file except in compliance with the License.
1047
+ * You may obtain a copy of the License at
1048
+ *
1049
+ * http://www.apache.org/licenses/LICENSE-2.0
1050
+ *
1051
+ * Unless required by applicable law or agreed to in writing, software
1052
+ * distributed under the License is distributed on an "AS IS" BASIS,
1053
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1054
+ * See the License for the specific language governing permissions and
1055
+ * limitations under the License.
1056
+ * ========================================================== */
1057
+
1058
+
1059
+ !function ($) {
1060
+
1061
+ "use strict"; // jshint ;_;
1062
+
1063
+
1064
+ /* ALERT CLASS DEFINITION
1065
+ * ====================== */
1066
+
1067
+ var dismiss = '[data-dismiss="alert"]'
1068
+ , Alert = function (el) {
1069
+ $(el).on('click', dismiss, this.close)
1070
+ }
1071
+
1072
+ Alert.prototype.close = function (e) {
1073
+ var $this = $(this)
1074
+ , selector = $this.attr('data-target')
1075
+ , $parent
1076
+
1077
+ if (!selector) {
1078
+ selector = $this.attr('href')
1079
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
1080
+ }
1081
+
1082
+ $parent = $(selector)
1083
+
1084
+ e && e.preventDefault()
1085
+
1086
+ $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
1087
+
1088
+ $parent.trigger(e = $.Event('close'))
1089
+
1090
+ if (e.isDefaultPrevented()) return
1091
+
1092
+ $parent.removeClass('in')
1093
+
1094
+ function removeElement() {
1095
+ $parent
1096
+ .trigger('closed')
1097
+ .remove()
1098
+ }
1099
+
1100
+ $.support.transition && $parent.hasClass('fade') ?
1101
+ $parent.on($.support.transition.end, removeElement) :
1102
+ removeElement()
1103
+ }
1104
+
1105
+
1106
+ /* ALERT PLUGIN DEFINITION
1107
+ * ======================= */
1108
+
1109
+ $.fn.alert = function (option) {
1110
+ return this.each(function () {
1111
+ var $this = $(this)
1112
+ , data = $this.data('alert')
1113
+ if (!data) $this.data('alert', (data = new Alert(this)))
1114
+ if (typeof option == 'string') data[option].call($this)
1115
+ })
1116
+ }
1117
+
1118
+ $.fn.alert.Constructor = Alert
1119
+
1120
+
1121
+ /* ALERT DATA-API
1122
+ * ============== */
1123
+
1124
+ $(function () {
1125
+ $('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
1126
+ })
1127
+
1128
+ }(window.jQuery);
1129
+ /* ============================================================
1130
+ * bootstrap-button.js v2.0.3
1131
+ * http://twitter.github.com/bootstrap/javascript.html#buttons
1132
+ * ============================================================
1133
+ * Copyright 2012 Twitter, Inc.
1134
+ *
1135
+ * Licensed under the Apache License, Version 2.0 (the "License");
1136
+ * you may not use this file except in compliance with the License.
1137
+ * You may obtain a copy of the License at
1138
+ *
1139
+ * http://www.apache.org/licenses/LICENSE-2.0
1140
+ *
1141
+ * Unless required by applicable law or agreed to in writing, software
1142
+ * distributed under the License is distributed on an "AS IS" BASIS,
1143
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1144
+ * See the License for the specific language governing permissions and
1145
+ * limitations under the License.
1146
+ * ============================================================ */
1147
+
1148
+
1149
+ !function ($) {
1150
+
1151
+ "use strict"; // jshint ;_;
1152
+
1153
+
1154
+ /* BUTTON PUBLIC CLASS DEFINITION
1155
+ * ============================== */
1156
+
1157
+ var Button = function (element, options) {
1158
+ this.$element = $(element)
1159
+ this.options = $.extend({}, $.fn.button.defaults, options)
1160
+ }
1161
+
1162
+ Button.prototype.setState = function (state) {
1163
+ var d = 'disabled'
1164
+ , $el = this.$element
1165
+ , data = $el.data()
1166
+ , val = $el.is('input') ? 'val' : 'html'
1167
+
1168
+ state = state + 'Text'
1169
+ data.resetText || $el.data('resetText', $el[val]())
1170
+
1171
+ $el[val](data[state] || this.options[state])
1172
+
1173
+ // push to event loop to allow forms to submit
1174
+ setTimeout(function () {
1175
+ state == 'loadingText' ?
1176
+ $el.addClass(d).attr(d, d) :
1177
+ $el.removeClass(d).removeAttr(d)
1178
+ }, 0)
1179
+ }
1180
+
1181
+ Button.prototype.toggle = function () {
1182
+ var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
1183
+
1184
+ $parent && $parent
1185
+ .find('.active')
1186
+ .removeClass('active')
1187
+
1188
+ this.$element.toggleClass('active')
1189
+ }
1190
+
1191
+
1192
+ /* BUTTON PLUGIN DEFINITION
1193
+ * ======================== */
1194
+
1195
+ $.fn.button = function (option) {
1196
+ return this.each(function () {
1197
+ var $this = $(this)
1198
+ , data = $this.data('button')
1199
+ , options = typeof option == 'object' && option
1200
+ if (!data) $this.data('button', (data = new Button(this, options)))
1201
+ if (option == 'toggle') data.toggle()
1202
+ else if (option) data.setState(option)
1203
+ })
1204
+ }
1205
+
1206
+ $.fn.button.defaults = {
1207
+ loadingText: 'loading...'
1208
+ }
1209
+
1210
+ $.fn.button.Constructor = Button
1211
+
1212
+
1213
+ /* BUTTON DATA-API
1214
+ * =============== */
1215
+
1216
+ $(function () {
1217
+ $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
1218
+ var $btn = $(e.target)
1219
+ if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
1220
+ $btn.button('toggle')
1221
+ })
1222
+ })
1223
+
1224
+ }(window.jQuery);
1225
+ /* =============================================================
1226
+ * bootstrap-collapse.js v2.0.3
1227
+ * http://twitter.github.com/bootstrap/javascript.html#collapse
1228
+ * =============================================================
1229
+ * Copyright 2012 Twitter, Inc.
1230
+ *
1231
+ * Licensed under the Apache License, Version 2.0 (the "License");
1232
+ * you may not use this file except in compliance with the License.
1233
+ * You may obtain a copy of the License at
1234
+ *
1235
+ * http://www.apache.org/licenses/LICENSE-2.0
1236
+ *
1237
+ * Unless required by applicable law or agreed to in writing, software
1238
+ * distributed under the License is distributed on an "AS IS" BASIS,
1239
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1240
+ * See the License for the specific language governing permissions and
1241
+ * limitations under the License.
1242
+ * ============================================================ */
1243
+
1244
+
1245
+ !function ($) {
1246
+
1247
+ "use strict"; // jshint ;_;
1248
+
1249
+
1250
+ /* COLLAPSE PUBLIC CLASS DEFINITION
1251
+ * ================================ */
1252
+
1253
+ var Collapse = function (element, options) {
1254
+ this.$element = $(element)
1255
+ this.options = $.extend({}, $.fn.collapse.defaults, options)
1256
+
1257
+ if (this.options.parent) {
1258
+ this.$parent = $(this.options.parent)
1259
+ }
1260
+
1261
+ this.options.toggle && this.toggle()
1262
+ }
1263
+
1264
+ Collapse.prototype = {
1265
+
1266
+ constructor: Collapse
1267
+
1268
+ , dimension: function () {
1269
+ var hasWidth = this.$element.hasClass('width')
1270
+ return hasWidth ? 'width' : 'height'
1271
+ }
1272
+
1273
+ , show: function () {
1274
+ var dimension
1275
+ , scroll
1276
+ , actives
1277
+ , hasData
1278
+
1279
+ if (this.transitioning) return
1280
+
1281
+ dimension = this.dimension()
1282
+ scroll = $.camelCase(['scroll', dimension].join('-'))
1283
+ actives = this.$parent && this.$parent.find('> .accordion-group > .in')
1284
+
1285
+ if (actives && actives.length) {
1286
+ hasData = actives.data('collapse')
1287
+ if (hasData && hasData.transitioning) return
1288
+ actives.collapse('hide')
1289
+ hasData || actives.data('collapse', null)
1290
+ }
1291
+
1292
+ this.$element[dimension](0)
1293
+ this.transition('addClass', $.Event('show'), 'shown')
1294
+ this.$element[dimension](this.$element[0][scroll])
1295
+ }
1296
+
1297
+ , hide: function () {
1298
+ var dimension
1299
+ if (this.transitioning) return
1300
+ dimension = this.dimension()
1301
+ this.reset(this.$element[dimension]())
1302
+ this.transition('removeClass', $.Event('hide'), 'hidden')
1303
+ this.$element[dimension](0)
1304
+ }
1305
+
1306
+ , reset: function (size) {
1307
+ var dimension = this.dimension()
1308
+
1309
+ this.$element
1310
+ .removeClass('collapse')
1311
+ [dimension](size || 'auto')
1312
+ [0].offsetWidth
1313
+
1314
+ this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
1315
+
1316
+ return this
1317
+ }
1318
+
1319
+ , transition: function (method, startEvent, completeEvent) {
1320
+ var that = this
1321
+ , complete = function () {
1322
+ if (startEvent.type == 'show') that.reset()
1323
+ that.transitioning = 0
1324
+ that.$element.trigger(completeEvent)
1325
+ }
1326
+
1327
+ this.$element.trigger(startEvent)
1328
+
1329
+ if (startEvent.isDefaultPrevented()) return
1330
+
1331
+ this.transitioning = 1
1332
+
1333
+ this.$element[method]('in')
1334
+
1335
+ $.support.transition && this.$element.hasClass('collapse') ?
1336
+ this.$element.one($.support.transition.end, complete) :
1337
+ complete()
1338
+ }
1339
+
1340
+ , toggle: function () {
1341
+ this[this.$element.hasClass('in') ? 'hide' : 'show']()
1342
+ }
1343
+
1344
+ }
1345
+
1346
+
1347
+ /* COLLAPSIBLE PLUGIN DEFINITION
1348
+ * ============================== */
1349
+
1350
+ $.fn.collapse = function (option) {
1351
+ return this.each(function () {
1352
+ var $this = $(this)
1353
+ , data = $this.data('collapse')
1354
+ , options = typeof option == 'object' && option
1355
+ if (!data) $this.data('collapse', (data = new Collapse(this, options)))
1356
+ if (typeof option == 'string') data[option]()
1357
+ })
1358
+ }
1359
+
1360
+ $.fn.collapse.defaults = {
1361
+ toggle: true
1362
+ }
1363
+
1364
+ $.fn.collapse.Constructor = Collapse
1365
+
1366
+
1367
+ /* COLLAPSIBLE DATA-API
1368
+ * ==================== */
1369
+
1370
+ $(function () {
1371
+ $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) {
1372
+ var $this = $(this), href
1373
+ , target = $this.attr('data-target')
1374
+ || e.preventDefault()
1375
+ || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
1376
+ , option = $(target).data('collapse') ? 'toggle' : $this.data()
1377
+ $(target).collapse(option)
1378
+ })
1379
+ })
1380
+
1381
+ }(window.jQuery);
1382
+ /* ==========================================================
1383
+ * bootstrap-carousel.js v2.0.3
1384
+ * http://twitter.github.com/bootstrap/javascript.html#carousel
1385
+ * ==========================================================
1386
+ * Copyright 2012 Twitter, Inc.
1387
+ *
1388
+ * Licensed under the Apache License, Version 2.0 (the "License");
1389
+ * you may not use this file except in compliance with the License.
1390
+ * You may obtain a copy of the License at
1391
+ *
1392
+ * http://www.apache.org/licenses/LICENSE-2.0
1393
+ *
1394
+ * Unless required by applicable law or agreed to in writing, software
1395
+ * distributed under the License is distributed on an "AS IS" BASIS,
1396
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1397
+ * See the License for the specific language governing permissions and
1398
+ * limitations under the License.
1399
+ * ========================================================== */
1400
+
1401
+
1402
+ !function ($) {
1403
+
1404
+ "use strict"; // jshint ;_;
1405
+
1406
+
1407
+ /* CAROUSEL CLASS DEFINITION
1408
+ * ========================= */
1409
+
1410
+ var Carousel = function (element, options) {
1411
+ this.$element = $(element)
1412
+ this.options = options
1413
+ this.options.slide && this.slide(this.options.slide)
1414
+ this.options.pause == 'hover' && this.$element
1415
+ .on('mouseenter', $.proxy(this.pause, this))
1416
+ .on('mouseleave', $.proxy(this.cycle, this))
1417
+ }
1418
+
1419
+ Carousel.prototype = {
1420
+
1421
+ cycle: function (e) {
1422
+ if (!e) this.paused = false
1423
+ this.options.interval
1424
+ && !this.paused
1425
+ && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
1426
+ return this
1427
+ }
1428
+
1429
+ , to: function (pos) {
1430
+ var $active = this.$element.find('.active')
1431
+ , children = $active.parent().children()
1432
+ , activePos = children.index($active)
1433
+ , that = this
1434
+
1435
+ if (pos > (children.length - 1) || pos < 0) return
1436
+
1437
+ if (this.sliding) {
1438
+ return this.$element.one('slid', function () {
1439
+ that.to(pos)
1440
+ })
1441
+ }
1442
+
1443
+ if (activePos == pos) {
1444
+ return this.pause().cycle()
1445
+ }
1446
+
1447
+ return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
1448
+ }
1449
+
1450
+ , pause: function (e) {
1451
+ if (!e) this.paused = true
1452
+ clearInterval(this.interval)
1453
+ this.interval = null
1454
+ return this
1455
+ }
1456
+
1457
+ , next: function () {
1458
+ if (this.sliding) return
1459
+ return this.slide('next')
1460
+ }
1461
+
1462
+ , prev: function () {
1463
+ if (this.sliding) return
1464
+ return this.slide('prev')
1465
+ }
1466
+
1467
+ , slide: function (type, next) {
1468
+ var $active = this.$element.find('.active')
1469
+ , $next = next || $active[type]()
1470
+ , isCycling = this.interval
1471
+ , direction = type == 'next' ? 'left' : 'right'
1472
+ , fallback = type == 'next' ? 'first' : 'last'
1473
+ , that = this
1474
+ , e = $.Event('slide')
1475
+
1476
+ this.sliding = true
1477
+
1478
+ isCycling && this.pause()
1479
+
1480
+ $next = $next.length ? $next : this.$element.find('.item')[fallback]()
1481
+
1482
+ if ($next.hasClass('active')) return
1483
+
1484
+ if ($.support.transition && this.$element.hasClass('slide')) {
1485
+ this.$element.trigger(e)
1486
+ if (e.isDefaultPrevented()) return
1487
+ $next.addClass(type)
1488
+ $next[0].offsetWidth // force reflow
1489
+ $active.addClass(direction)
1490
+ $next.addClass(direction)
1491
+ this.$element.one($.support.transition.end, function () {
1492
+ $next.removeClass([type, direction].join(' ')).addClass('active')
1493
+ $active.removeClass(['active', direction].join(' '))
1494
+ that.sliding = false
1495
+ setTimeout(function () { that.$element.trigger('slid') }, 0)
1496
+ })
1497
+ } else {
1498
+ this.$element.trigger(e)
1499
+ if (e.isDefaultPrevented()) return
1500
+ $active.removeClass('active')
1501
+ $next.addClass('active')
1502
+ this.sliding = false
1503
+ this.$element.trigger('slid')
1504
+ }
1505
+
1506
+ isCycling && this.cycle()
1507
+
1508
+ return this
1509
+ }
1510
+
1511
+ }
1512
+
1513
+
1514
+ /* CAROUSEL PLUGIN DEFINITION
1515
+ * ========================== */
1516
+
1517
+ $.fn.carousel = function (option) {
1518
+ return this.each(function () {
1519
+ var $this = $(this)
1520
+ , data = $this.data('carousel')
1521
+ , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
1522
+ if (!data) $this.data('carousel', (data = new Carousel(this, options)))
1523
+ if (typeof option == 'number') data.to(option)
1524
+ else if (typeof option == 'string' || (option = options.slide)) data[option]()
1525
+ else if (options.interval) data.cycle()
1526
+ })
1527
+ }
1528
+
1529
+ $.fn.carousel.defaults = {
1530
+ interval: 5000
1531
+ , pause: 'hover'
1532
+ }
1533
+
1534
+ $.fn.carousel.Constructor = Carousel
1535
+
1536
+
1537
+ /* CAROUSEL DATA-API
1538
+ * ================= */
1539
+
1540
+ $(function () {
1541
+ $('body').on('click.carousel.data-api', '[data-slide]', function ( e ) {
1542
+ var $this = $(this), href
1543
+ , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
1544
+ , options = !$target.data('modal') && $.extend({}, $target.data(), $this.data())
1545
+ $target.carousel(options)
1546
+ e.preventDefault()
1547
+ })
1548
+ })
1549
+
1550
+ }(window.jQuery);
1551
+ /* =============================================================
1552
+ * bootstrap-typeahead.js v2.0.3
1553
+ * http://twitter.github.com/bootstrap/javascript.html#typeahead
1554
+ * =============================================================
1555
+ * Copyright 2012 Twitter, Inc.
1556
+ *
1557
+ * Licensed under the Apache License, Version 2.0 (the "License");
1558
+ * you may not use this file except in compliance with the License.
1559
+ * You may obtain a copy of the License at
1560
+ *
1561
+ * http://www.apache.org/licenses/LICENSE-2.0
1562
+ *
1563
+ * Unless required by applicable law or agreed to in writing, software
1564
+ * distributed under the License is distributed on an "AS IS" BASIS,
1565
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1566
+ * See the License for the specific language governing permissions and
1567
+ * limitations under the License.
1568
+ * ============================================================ */
1569
+
1570
+
1571
+ !function($){
1572
+
1573
+ "use strict"; // jshint ;_;
1574
+
1575
+
1576
+ /* TYPEAHEAD PUBLIC CLASS DEFINITION
1577
+ * ================================= */
1578
+
1579
+ var Typeahead = function (element, options) {
1580
+ this.$element = $(element)
1581
+ this.options = $.extend({}, $.fn.typeahead.defaults, options)
1582
+ this.matcher = this.options.matcher || this.matcher
1583
+ this.sorter = this.options.sorter || this.sorter
1584
+ this.highlighter = this.options.highlighter || this.highlighter
1585
+ this.updater = this.options.updater || this.updater
1586
+ this.$menu = $(this.options.menu).appendTo('body')
1587
+ this.source = this.options.source
1588
+ this.shown = false
1589
+ this.listen()
1590
+ }
1591
+
1592
+ Typeahead.prototype = {
1593
+
1594
+ constructor: Typeahead
1595
+
1596
+ , select: function () {
1597
+ var val = this.$menu.find('.active').attr('data-value')
1598
+ this.$element
1599
+ .val(this.updater(val))
1600
+ .change()
1601
+ return this.hide()
1602
+ }
1603
+
1604
+ , updater: function (item) {
1605
+ return item
1606
+ }
1607
+
1608
+ , show: function () {
1609
+ var pos = $.extend({}, this.$element.offset(), {
1610
+ height: this.$element[0].offsetHeight
1611
+ })
1612
+
1613
+ this.$menu.css({
1614
+ top: pos.top + pos.height
1615
+ , left: pos.left
1616
+ })
1617
+
1618
+ this.$menu.show()
1619
+ this.shown = true
1620
+ return this
1621
+ }
1622
+
1623
+ , hide: function () {
1624
+ this.$menu.hide()
1625
+ this.shown = false
1626
+ return this
1627
+ }
1628
+
1629
+ , lookup: function (event) {
1630
+ var that = this
1631
+ , items
1632
+ , q
1633
+
1634
+ this.query = this.$element.val()
1635
+
1636
+ if (!this.query) {
1637
+ return this.shown ? this.hide() : this
1638
+ }
1639
+
1640
+ items = $.grep(this.source, function (item) {
1641
+ return that.matcher(item)
1642
+ })
1643
+
1644
+ items = this.sorter(items)
1645
+
1646
+ if (!items.length) {
1647
+ return this.shown ? this.hide() : this
1648
+ }
1649
+
1650
+ return this.render(items.slice(0, this.options.items)).show()
1651
+ }
1652
+
1653
+ , matcher: function (item) {
1654
+ return ~item.toLowerCase().indexOf(this.query.toLowerCase())
1655
+ }
1656
+
1657
+ , sorter: function (items) {
1658
+ var beginswith = []
1659
+ , caseSensitive = []
1660
+ , caseInsensitive = []
1661
+ , item
1662
+
1663
+ while (item = items.shift()) {
1664
+ if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
1665
+ else if (~item.indexOf(this.query)) caseSensitive.push(item)
1666
+ else caseInsensitive.push(item)
1667
+ }
1668
+
1669
+ return beginswith.concat(caseSensitive, caseInsensitive)
1670
+ }
1671
+
1672
+ , highlighter: function (item) {
1673
+ var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
1674
+ return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
1675
+ return '<strong>' + match + '</strong>'
1676
+ })
1677
+ }
1678
+
1679
+ , render: function (items) {
1680
+ var that = this
1681
+
1682
+ items = $(items).map(function (i, item) {
1683
+ i = $(that.options.item).attr('data-value', item)
1684
+ i.find('a').html(that.highlighter(item))
1685
+ return i[0]
1686
+ })
1687
+
1688
+ items.first().addClass('active')
1689
+ this.$menu.html(items)
1690
+ return this
1691
+ }
1692
+
1693
+ , next: function (event) {
1694
+ var active = this.$menu.find('.active').removeClass('active')
1695
+ , next = active.next()
1696
+
1697
+ if (!next.length) {
1698
+ next = $(this.$menu.find('li')[0])
1699
+ }
1700
+
1701
+ next.addClass('active')
1702
+ }
1703
+
1704
+ , prev: function (event) {
1705
+ var active = this.$menu.find('.active').removeClass('active')
1706
+ , prev = active.prev()
1707
+
1708
+ if (!prev.length) {
1709
+ prev = this.$menu.find('li').last()
1710
+ }
1711
+
1712
+ prev.addClass('active')
1713
+ }
1714
+
1715
+ , listen: function () {
1716
+ this.$element
1717
+ .on('blur', $.proxy(this.blur, this))
1718
+ .on('keypress', $.proxy(this.keypress, this))
1719
+ .on('keyup', $.proxy(this.keyup, this))
1720
+
1721
+ if ($.browser.webkit || $.browser.msie) {
1722
+ this.$element.on('keydown', $.proxy(this.keypress, this))
1723
+ }
1724
+
1725
+ this.$menu
1726
+ .on('click', $.proxy(this.click, this))
1727
+ .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
1728
+ }
1729
+
1730
+ , keyup: function (e) {
1731
+ switch(e.keyCode) {
1732
+ case 40: // down arrow
1733
+ case 38: // up arrow
1734
+ break
1735
+
1736
+ case 9: // tab
1737
+ case 13: // enter
1738
+ if (!this.shown) return
1739
+ this.select()
1740
+ break
1741
+
1742
+ case 27: // escape
1743
+ if (!this.shown) return
1744
+ this.hide()
1745
+ break
1746
+
1747
+ default:
1748
+ this.lookup()
1749
+ }
1750
+
1751
+ e.stopPropagation()
1752
+ e.preventDefault()
1753
+ }
1754
+
1755
+ , keypress: function (e) {
1756
+ if (!this.shown) return
1757
+
1758
+ switch(e.keyCode) {
1759
+ case 9: // tab
1760
+ case 13: // enter
1761
+ case 27: // escape
1762
+ e.preventDefault()
1763
+ break
1764
+
1765
+ case 38: // up arrow
1766
+ if (e.type != 'keydown') break
1767
+ e.preventDefault()
1768
+ this.prev()
1769
+ break
1770
+
1771
+ case 40: // down arrow
1772
+ if (e.type != 'keydown') break
1773
+ e.preventDefault()
1774
+ this.next()
1775
+ break
1776
+ }
1777
+
1778
+ e.stopPropagation()
1779
+ }
1780
+
1781
+ , blur: function (e) {
1782
+ var that = this
1783
+ setTimeout(function () { that.hide() }, 150)
1784
+ }
1785
+
1786
+ , click: function (e) {
1787
+ e.stopPropagation()
1788
+ e.preventDefault()
1789
+ this.select()
1790
+ }
1791
+
1792
+ , mouseenter: function (e) {
1793
+ this.$menu.find('.active').removeClass('active')
1794
+ $(e.currentTarget).addClass('active')
1795
+ }
1796
+
1797
+ }
1798
+
1799
+
1800
+ /* TYPEAHEAD PLUGIN DEFINITION
1801
+ * =========================== */
1802
+
1803
+ $.fn.typeahead = function (option) {
1804
+ return this.each(function () {
1805
+ var $this = $(this)
1806
+ , data = $this.data('typeahead')
1807
+ , options = typeof option == 'object' && option
1808
+ if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
1809
+ if (typeof option == 'string') data[option]()
1810
+ })
1811
+ }
1812
+
1813
+ $.fn.typeahead.defaults = {
1814
+ source: []
1815
+ , items: 8
1816
+ , menu: '<ul class="typeahead dropdown-menu"></ul>'
1817
+ , item: '<li><a href="#"></a></li>'
1818
+ }
1819
+
1820
+ $.fn.typeahead.Constructor = Typeahead
1821
+
1822
+
1823
+ /* TYPEAHEAD DATA-API
1824
+ * ================== */
1825
+
1826
+ $(function () {
1827
+ $('body').on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
1828
+ var $this = $(this)
1829
+ if ($this.data('typeahead')) return
1830
+ e.preventDefault()
1831
+ $this.typeahead($this.data())
1832
+ })
1833
+ })
1834
+
1835
+ }(window.jQuery);