tennpipes-init 3.6.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +20 -0
  3. data/README.rdoc +163 -0
  4. data/Rakefile +1 -0
  5. data/bin/tennpipes-init +16 -0
  6. data/lib/tennpipes-init.rb +73 -0
  7. data/lib/tennpipes-init/command.rb +18 -0
  8. data/lib/tennpipes-init/generators/actions.rb +630 -0
  9. data/lib/tennpipes-init/generators/app.rb +75 -0
  10. data/lib/tennpipes-init/generators/app/app.rb.tt +72 -0
  11. data/lib/tennpipes-init/generators/app/app.rb.tt~ +72 -0
  12. data/lib/tennpipes-init/generators/cli.rb +57 -0
  13. data/lib/tennpipes-init/generators/component.rb +73 -0
  14. data/lib/tennpipes-init/generators/components/actions.rb +208 -0
  15. data/lib/tennpipes-init/generators/components/mocks/mocha.rb +10 -0
  16. data/lib/tennpipes-init/generators/components/mocks/rr.rb +13 -0
  17. data/lib/tennpipes-init/generators/components/orms/activerecord.rb +201 -0
  18. data/lib/tennpipes-init/generators/components/orms/couchrest.rb +55 -0
  19. data/lib/tennpipes-init/generators/components/orms/datamapper.rb +140 -0
  20. data/lib/tennpipes-init/generators/components/orms/dynamoid.rb +67 -0
  21. data/lib/tennpipes-init/generators/components/orms/minirecord.rb +165 -0
  22. data/lib/tennpipes-init/generators/components/orms/mongoid.rb +113 -0
  23. data/lib/tennpipes-init/generators/components/orms/mongomapper.rb +43 -0
  24. data/lib/tennpipes-init/generators/components/orms/mongomatic.rb +84 -0
  25. data/lib/tennpipes-init/generators/components/orms/ohm.rb +65 -0
  26. data/lib/tennpipes-init/generators/components/orms/ripple.rb +75 -0
  27. data/lib/tennpipes-init/generators/components/orms/sequel.rb +99 -0
  28. data/lib/tennpipes-init/generators/components/renderers/erb.rb +3 -0
  29. data/lib/tennpipes-init/generators/components/renderers/haml.rb +3 -0
  30. data/lib/tennpipes-init/generators/components/renderers/liquid.rb +4 -0
  31. data/lib/tennpipes-init/generators/components/renderers/slim.rb +3 -0
  32. data/lib/tennpipes-init/generators/components/scripts/dojo.rb +10 -0
  33. data/lib/tennpipes-init/generators/components/scripts/extcore.rb +10 -0
  34. data/lib/tennpipes-init/generators/components/scripts/jquery.rb +10 -0
  35. data/lib/tennpipes-init/generators/components/scripts/mootools.rb +10 -0
  36. data/lib/tennpipes-init/generators/components/scripts/prototype.rb +12 -0
  37. data/lib/tennpipes-init/generators/components/scripts/rightjs.rb +10 -0
  38. data/lib/tennpipes-init/generators/components/stylesheets/compass.rb +39 -0
  39. data/lib/tennpipes-init/generators/components/stylesheets/compass/application.scss +43 -0
  40. data/lib/tennpipes-init/generators/components/stylesheets/compass/partials/_base.scss +12 -0
  41. data/lib/tennpipes-init/generators/components/stylesheets/less.rb +25 -0
  42. data/lib/tennpipes-init/generators/components/stylesheets/sass.rb +15 -0
  43. data/lib/tennpipes-init/generators/components/stylesheets/scss.rb +16 -0
  44. data/lib/tennpipes-init/generators/components/tests/bacon.rb +103 -0
  45. data/lib/tennpipes-init/generators/components/tests/cucumber.rb +86 -0
  46. data/lib/tennpipes-init/generators/components/tests/minitest.rb +110 -0
  47. data/lib/tennpipes-init/generators/components/tests/riot.rb +117 -0
  48. data/lib/tennpipes-init/generators/components/tests/rspec.rb +111 -0
  49. data/lib/tennpipes-init/generators/components/tests/shoulda.rb +114 -0
  50. data/lib/tennpipes-init/generators/components/tests/steak.rb +114 -0
  51. data/lib/tennpipes-init/generators/controller.rb +77 -0
  52. data/lib/tennpipes-init/generators/helper.rb +50 -0
  53. data/lib/tennpipes-init/generators/mailer.rb +52 -0
  54. data/lib/tennpipes-init/generators/migration.rb +43 -0
  55. data/lib/tennpipes-init/generators/model.rb +113 -0
  56. data/lib/tennpipes-init/generators/plugin.rb +67 -0
  57. data/lib/tennpipes-init/generators/project.rb +160 -0
  58. data/lib/tennpipes-init/generators/project/config.ru +9 -0
  59. data/lib/tennpipes-init/generators/project/config/apps.rb.tt +35 -0
  60. data/lib/tennpipes-init/generators/project/config/boot.rb +49 -0
  61. data/lib/tennpipes-init/generators/project/public/favicon.ico +0 -0
  62. data/lib/tennpipes-init/generators/project/public/images/booking.com.png +0 -0
  63. data/lib/tennpipes-init/generators/project/public/images/causes.png +0 -0
  64. data/lib/tennpipes-init/generators/project/public/images/ennkeypee_bg.jpg +0 -0
  65. data/lib/tennpipes-init/generators/project/public/images/ennkeypee_bluelogo.png +0 -0
  66. data/lib/tennpipes-init/generators/project/public/images/ennkeypee_bluelogo.svg +68 -0
  67. data/lib/tennpipes-init/generators/project/public/images/ennkeypee_whitelogo.png +0 -0
  68. data/lib/tennpipes-init/generators/project/public/images/ennkeypee_whitelogo.svg +65 -0
  69. data/lib/tennpipes-init/generators/project/public/images/forever21.png +0 -0
  70. data/lib/tennpipes-init/generators/project/public/images/icons/foundation-icons.eot +0 -0
  71. data/lib/tennpipes-init/generators/project/public/images/icons/foundation-icons.svg +970 -0
  72. data/lib/tennpipes-init/generators/project/public/images/icons/foundation-icons.ttf +0 -0
  73. data/lib/tennpipes-init/generators/project/public/images/icons/foundation-icons.woff +0 -0
  74. data/lib/tennpipes-init/generators/project/public/images/icons/tennpipes-icons.css +598 -0
  75. data/lib/tennpipes-init/generators/project/public/images/image1.jpg +0 -0
  76. data/lib/tennpipes-init/generators/project/public/images/image11.jpg +0 -0
  77. data/lib/tennpipes-init/generators/project/public/images/image2.jpg +0 -0
  78. data/lib/tennpipes-init/generators/project/public/images/image3.jpg +0 -0
  79. data/lib/tennpipes-init/generators/project/public/images/intuit.png +0 -0
  80. data/lib/tennpipes-init/generators/project/public/images/krispykreme.png +0 -0
  81. data/lib/tennpipes-init/generators/project/public/images/placeholders/README.md +302 -0
  82. data/lib/tennpipes-init/generators/project/public/images/placeholders/bower.json +4 -0
  83. data/lib/tennpipes-init/generators/project/public/images/placeholders/composer.json +34 -0
  84. data/lib/tennpipes-init/generators/project/public/images/placeholders/gulpfile.js +92 -0
  85. data/lib/tennpipes-init/generators/project/public/images/placeholders/holder.js +1920 -0
  86. data/lib/tennpipes-init/generators/project/public/images/placeholders/holder.min.js +12 -0
  87. data/lib/tennpipes-init/generators/project/public/images/placeholders/package.json +46 -0
  88. data/lib/tennpipes-init/generators/project/public/images/placeholders/src/holder.js +1411 -0
  89. data/lib/tennpipes-init/generators/project/public/images/placeholders/src/lib/augment.js +27 -0
  90. data/lib/tennpipes-init/generators/project/public/images/placeholders/src/lib/ondomready.js +155 -0
  91. data/lib/tennpipes-init/generators/project/public/images/placeholders/src/lib/polyfills.js +177 -0
  92. data/lib/tennpipes-init/generators/project/public/images/placeholders/src/scenegraph.js +101 -0
  93. data/lib/tennpipes-init/generators/project/public/images/placeholders/src/utils.js +129 -0
  94. data/lib/tennpipes-init/generators/project/public/images/priceline.com.png +0 -0
  95. data/lib/tennpipes-init/generators/project/public/images/stripe.png +0 -0
  96. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes.min.js +6081 -0
  97. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.abide.js +340 -0
  98. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.accordion.js +67 -0
  99. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.alert.js +43 -0
  100. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.clearing.js +556 -0
  101. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.dropdown.js +448 -0
  102. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.equalizer.js +77 -0
  103. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.interchange.js +354 -0
  104. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.joyride.js +932 -0
  105. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.js +703 -0
  106. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.magellan.js +203 -0
  107. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.offcanvas.js +152 -0
  108. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.orbit.js +476 -0
  109. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.reveal.js +471 -0
  110. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.slider.js +263 -0
  111. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.tab.js +237 -0
  112. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.tooltip.js +307 -0
  113. data/lib/tennpipes-init/generators/project/public/javascripts/tennpipes/tennpipes.topbar.js +452 -0
  114. data/lib/tennpipes-init/generators/project/public/javascripts/vendor/fastclick.js +8 -0
  115. data/lib/tennpipes-init/generators/project/public/javascripts/vendor/jquery.cookie.js +8 -0
  116. data/lib/tennpipes-init/generators/project/public/javascripts/vendor/jquery.js +26 -0
  117. data/lib/tennpipes-init/generators/project/public/javascripts/vendor/modernizr.js +8 -0
  118. data/lib/tennpipes-init/generators/project/public/javascripts/vendor/placeholder.js +2 -0
  119. data/lib/tennpipes-init/generators/project/public/stylesheets/app.css~ +178 -0
  120. data/lib/tennpipes-init/generators/project/public/stylesheets/app1.css~ +177 -0
  121. data/lib/tennpipes-init/generators/project/public/stylesheets/ennkeypee.css +214 -0
  122. data/lib/tennpipes-init/generators/project/public/stylesheets/ennkeypee.css~ +214 -0
  123. data/lib/tennpipes-init/generators/project/public/stylesheets/normalize.css +427 -0
  124. data/lib/tennpipes-init/generators/project/public/stylesheets/tennpipes.css +6201 -0
  125. data/lib/tennpipes-init/generators/project/public/stylesheets/tennpipes.css~ +6201 -0
  126. data/lib/tennpipes-init/generators/project/public/stylesheets/tennpipes.min.css +1 -0
  127. data/lib/tennpipes-init/generators/runner.rb +139 -0
  128. data/lib/tennpipes-init/generators/task.rb +45 -0
  129. data/lib/tennpipes-init/generators/templates/Gemfile.tt +32 -0
  130. data/lib/tennpipes-init/generators/templates/Rakefile.tt +8 -0
  131. data/lib/tennpipes-init/generators/templates/controller.rb.tt +22 -0
  132. data/lib/tennpipes-init/generators/templates/gem/README.md.tt +29 -0
  133. data/lib/tennpipes-init/generators/templates/gem/gemspec.tt +19 -0
  134. data/lib/tennpipes-init/generators/templates/gem/lib/libname.tt +6 -0
  135. data/lib/tennpipes-init/generators/templates/gem/lib/libname/version.tt +3 -0
  136. data/lib/tennpipes-init/generators/templates/helper.rb.tt +13 -0
  137. data/lib/tennpipes-init/generators/templates/initializer.rb.tt +5 -0
  138. data/lib/tennpipes-init/generators/templates/mailer.rb.tt +54 -0
  139. data/lib/tennpipes-init/generators/templates/project_bin.tt +14 -0
  140. data/lib/tennpipes-init/generators/templates/task.rb.tt +7 -0
  141. data/lib/tennpipes-init/tennpipes-tasks/activerecord.rb +377 -0
  142. data/lib/tennpipes-init/tennpipes-tasks/database.rb +12 -0
  143. data/lib/tennpipes-init/tennpipes-tasks/datamapper.rb +94 -0
  144. data/lib/tennpipes-init/tennpipes-tasks/minirecord.rb +19 -0
  145. data/lib/tennpipes-init/tennpipes-tasks/mongoid.rb +215 -0
  146. data/lib/tennpipes-init/tennpipes-tasks/mongomapper.rb +55 -0
  147. data/lib/tennpipes-init/tennpipes-tasks/sequel.rb +85 -0
  148. data/lib/tennpipes-init/tennpipes-tasks/sql-helpers.rb +72 -0
  149. data/test/fixtures/admin_template.rb +7 -0
  150. data/test/fixtures/example_template.rb +15 -0
  151. data/test/fixtures/git_template.rb +4 -0
  152. data/test/fixtures/plugin_template.rb +13 -0
  153. data/test/fixtures/rake_template.rb +9 -0
  154. data/test/helper.rb +103 -0
  155. data/test/test_app_generator.rb +142 -0
  156. data/test/test_cli.rb +27 -0
  157. data/test/test_component_generator.rb +98 -0
  158. data/test/test_controller_generator.rb +272 -0
  159. data/test/test_generator.rb +13 -0
  160. data/test/test_helper_generator.rb +133 -0
  161. data/test/test_mailer_generator.rb +69 -0
  162. data/test/test_migration_generator.rb +222 -0
  163. data/test/test_model_generator.rb +553 -0
  164. data/test/test_plugin_generator.rb +152 -0
  165. data/test/test_project_generator.rb +757 -0
  166. data/test/test_task_generator.rb +53 -0
  167. metadata +285 -0
@@ -0,0 +1,203 @@
1
+ ;(function ($, window, document, undefined) {
2
+ 'use strict';
3
+
4
+ Tennpipes.libs['magellan-expedition'] = {
5
+ name : 'magellan-expedition',
6
+
7
+ version : '5.5.1',
8
+
9
+ settings : {
10
+ active_class : 'active',
11
+ threshold : 0, // pixels from the top of the expedition for it to become fixes
12
+ destination_threshold : 20, // pixels from the top of destination for it to be considered active
13
+ throttle_delay : 30, // calculation throttling to increase framerate
14
+ fixed_top : 0, // top distance in pixels assigend to the fixed element on scroll
15
+ offset_by_height : true, // whether to offset the destination by the expedition height. Usually you want this to be true, unless your expedition is on the side.
16
+ duration : 700, // animation duration time
17
+ easing : 'swing' // animation easing
18
+ },
19
+
20
+ init : function (scope, method, options) {
21
+ Tennpipes.inherit(this, 'throttle');
22
+ this.bindings(method, options);
23
+ },
24
+
25
+ events : function () {
26
+ var self = this,
27
+ S = self.S,
28
+ settings = self.settings;
29
+
30
+ // initialize expedition offset
31
+ self.set_expedition_position();
32
+
33
+ S(self.scope)
34
+ .off('.magellan')
35
+ .on('click.fndtn.magellan', '[' + self.add_namespace('data-magellan-arrival') + '] a[href^="#"]', function (e) {
36
+ e.preventDefault();
37
+ var expedition = $(this).closest('[' + self.attr_name() + ']'),
38
+ settings = expedition.data('magellan-expedition-init'),
39
+ hash = this.hash.split('#').join(''),
40
+ target = $('a[name="' + hash + '"]');
41
+
42
+ if (target.length === 0) {
43
+ target = $('#' + hash);
44
+
45
+ }
46
+
47
+ // Account for expedition height if fixed position
48
+ var scroll_top = target.offset().top - settings.destination_threshold + 1;
49
+ if (settings.offset_by_height) {
50
+ scroll_top = scroll_top - expedition.outerHeight();
51
+ }
52
+
53
+ $('html, body').stop().animate({
54
+ 'scrollTop' : scroll_top
55
+ }, settings.duration, settings.easing, function () {
56
+ if (history.pushState) {
57
+ history.pushState(null, null, '#' + hash);
58
+ } else {
59
+ location.hash = '#' + hash;
60
+ }
61
+ });
62
+ })
63
+ .on('scroll.fndtn.magellan', self.throttle(this.check_for_arrivals.bind(this), settings.throttle_delay));
64
+
65
+ $(window)
66
+ .on('resize.fndtn.magellan', self.throttle(this.set_expedition_position.bind(this), settings.throttle_delay));
67
+ },
68
+
69
+ check_for_arrivals : function () {
70
+ var self = this;
71
+ self.update_arrivals();
72
+ self.update_expedition_positions();
73
+ },
74
+
75
+ set_expedition_position : function () {
76
+ var self = this;
77
+ $('[' + this.attr_name() + '=fixed]', self.scope).each(function (idx, el) {
78
+ var expedition = $(this),
79
+ settings = expedition.data('magellan-expedition-init'),
80
+ styles = expedition.attr('styles'), // save styles
81
+ top_offset, fixed_top;
82
+
83
+ expedition.attr('style', '');
84
+ top_offset = expedition.offset().top + settings.threshold;
85
+
86
+ //set fixed-top by attribute
87
+ fixed_top = parseInt(expedition.data('magellan-fixed-top'));
88
+ if (!isNaN(fixed_top)) {
89
+ self.settings.fixed_top = fixed_top;
90
+ }
91
+
92
+ expedition.data(self.data_attr('magellan-top-offset'), top_offset);
93
+ expedition.attr('style', styles);
94
+ });
95
+ },
96
+
97
+ update_expedition_positions : function () {
98
+ var self = this,
99
+ window_top_offset = $(window).scrollTop();
100
+
101
+ $('[' + this.attr_name() + '=fixed]', self.scope).each(function () {
102
+ var expedition = $(this),
103
+ settings = expedition.data('magellan-expedition-init'),
104
+ styles = expedition.attr('style'), // save styles
105
+ top_offset = expedition.data('magellan-top-offset');
106
+
107
+ //scroll to the top distance
108
+ if (window_top_offset + self.settings.fixed_top >= top_offset) {
109
+ // Placeholder allows height calculations to be consistent even when
110
+ // appearing to switch between fixed/non-fixed placement
111
+ var placeholder = expedition.prev('[' + self.add_namespace('data-magellan-expedition-clone') + ']');
112
+ if (placeholder.length === 0) {
113
+ placeholder = expedition.clone();
114
+ placeholder.removeAttr(self.attr_name());
115
+ placeholder.attr(self.add_namespace('data-magellan-expedition-clone'), '');
116
+ expedition.before(placeholder);
117
+ }
118
+ expedition.css({position :'fixed', top : settings.fixed_top}).addClass('fixed');
119
+ } else {
120
+ expedition.prev('[' + self.add_namespace('data-magellan-expedition-clone') + ']').remove();
121
+ expedition.attr('style', styles).css('position', '').css('top', '').removeClass('fixed');
122
+ }
123
+ });
124
+ },
125
+
126
+ update_arrivals : function () {
127
+ var self = this,
128
+ window_top_offset = $(window).scrollTop();
129
+
130
+ $('[' + this.attr_name() + ']', self.scope).each(function () {
131
+ var expedition = $(this),
132
+ settings = expedition.data(self.attr_name(true) + '-init'),
133
+ offsets = self.offsets(expedition, window_top_offset),
134
+ arrivals = expedition.find('[' + self.add_namespace('data-magellan-arrival') + ']'),
135
+ active_item = false;
136
+ offsets.each(function (idx, item) {
137
+ if (item.viewport_offset >= item.top_offset) {
138
+ var arrivals = expedition.find('[' + self.add_namespace('data-magellan-arrival') + ']');
139
+ arrivals.not(item.arrival).removeClass(settings.active_class);
140
+ item.arrival.addClass(settings.active_class);
141
+ active_item = true;
142
+ return true;
143
+ }
144
+ });
145
+
146
+ if (!active_item) {
147
+ arrivals.removeClass(settings.active_class);
148
+ }
149
+ });
150
+ },
151
+
152
+ offsets : function (expedition, window_offset) {
153
+ var self = this,
154
+ settings = expedition.data(self.attr_name(true) + '-init'),
155
+ viewport_offset = window_offset;
156
+
157
+ return expedition.find('[' + self.add_namespace('data-magellan-arrival') + ']').map(function (idx, el) {
158
+ var name = $(this).data(self.data_attr('magellan-arrival')),
159
+ dest = $('[' + self.add_namespace('data-magellan-destination') + '=' + name + ']');
160
+ if (dest.length > 0) {
161
+ var top_offset = dest.offset().top - settings.destination_threshold;
162
+ if (settings.offset_by_height) {
163
+ top_offset = top_offset - expedition.outerHeight();
164
+ }
165
+ top_offset = Math.floor(top_offset);
166
+ return {
167
+ destination : dest,
168
+ arrival : $(this),
169
+ top_offset : top_offset,
170
+ viewport_offset : viewport_offset
171
+ }
172
+ }
173
+ }).sort(function (a, b) {
174
+ if (a.top_offset < b.top_offset) {
175
+ return -1;
176
+ }
177
+ if (a.top_offset > b.top_offset) {
178
+ return 1;
179
+ }
180
+ return 0;
181
+ });
182
+ },
183
+
184
+ data_attr : function (str) {
185
+ if (this.namespace.length > 0) {
186
+ return this.namespace + '-' + str;
187
+ }
188
+
189
+ return str;
190
+ },
191
+
192
+ off : function () {
193
+ this.S(this.scope).off('.magellan');
194
+ this.S(window).off('.magellan');
195
+ },
196
+
197
+ reflow : function () {
198
+ var self = this;
199
+ // remove placeholder expeditions used for height calculation purposes
200
+ $('[' + self.add_namespace('data-magellan-expedition-clone') + ']', self.scope).remove();
201
+ }
202
+ };
203
+ }(jQuery, window, window.document));
@@ -0,0 +1,152 @@
1
+ ;(function ($, window, document, undefined) {
2
+ 'use strict';
3
+
4
+ Tennpipes.libs.offcanvas = {
5
+ name : 'offcanvas',
6
+
7
+ version : '5.5.1',
8
+
9
+ settings : {
10
+ open_method : 'move',
11
+ close_on_click : false
12
+ },
13
+
14
+ init : function (scope, method, options) {
15
+ this.bindings(method, options);
16
+ },
17
+
18
+ events : function () {
19
+ var self = this,
20
+ S = self.S,
21
+ move_class = '',
22
+ right_postfix = '',
23
+ left_postfix = '';
24
+
25
+ if (this.settings.open_method === 'move') {
26
+ move_class = 'move-';
27
+ right_postfix = 'right';
28
+ left_postfix = 'left';
29
+ } else if (this.settings.open_method === 'overlap_single') {
30
+ move_class = 'offcanvas-overlap-';
31
+ right_postfix = 'right';
32
+ left_postfix = 'left';
33
+ } else if (this.settings.open_method === 'overlap') {
34
+ move_class = 'offcanvas-overlap';
35
+ }
36
+
37
+ S(this.scope).off('.offcanvas')
38
+ .on('click.fndtn.offcanvas', '.left-off-canvas-toggle', function (e) {
39
+ self.click_toggle_class(e, move_class + right_postfix);
40
+ if (self.settings.open_method !== 'overlap') {
41
+ S('.left-submenu').removeClass(move_class + right_postfix);
42
+ }
43
+ $('.left-off-canvas-toggle').attr('aria-expanded', 'true');
44
+ })
45
+ .on('click.fndtn.offcanvas', '.left-off-canvas-menu a', function (e) {
46
+ var settings = self.get_settings(e);
47
+ var parent = S(this).parent();
48
+
49
+ if (settings.close_on_click && !parent.hasClass('has-submenu') && !parent.hasClass('back')) {
50
+ self.hide.call(self, move_class + right_postfix, self.get_wrapper(e));
51
+ parent.parent().removeClass(move_class + right_postfix);
52
+ } else if (S(this).parent().hasClass('has-submenu')) {
53
+ e.preventDefault();
54
+ S(this).siblings('.left-submenu').toggleClass(move_class + right_postfix);
55
+ } else if (parent.hasClass('back')) {
56
+ e.preventDefault();
57
+ parent.parent().removeClass(move_class + right_postfix);
58
+ }
59
+ $('.left-off-canvas-toggle').attr('aria-expanded', 'true');
60
+ })
61
+ .on('click.fndtn.offcanvas', '.right-off-canvas-toggle', function (e) {
62
+ self.click_toggle_class(e, move_class + left_postfix);
63
+ if (self.settings.open_method !== 'overlap') {
64
+ S('.right-submenu').removeClass(move_class + left_postfix);
65
+ }
66
+ $('.right-off-canvas-toggle').attr('aria-expanded', 'true');
67
+ })
68
+ .on('click.fndtn.offcanvas', '.right-off-canvas-menu a', function (e) {
69
+ var settings = self.get_settings(e);
70
+ var parent = S(this).parent();
71
+
72
+ if (settings.close_on_click && !parent.hasClass('has-submenu') && !parent.hasClass('back')) {
73
+ self.hide.call(self, move_class + left_postfix, self.get_wrapper(e));
74
+ parent.parent().removeClass(move_class + left_postfix);
75
+ } else if (S(this).parent().hasClass('has-submenu')) {
76
+ e.preventDefault();
77
+ S(this).siblings('.right-submenu').toggleClass(move_class + left_postfix);
78
+ } else if (parent.hasClass('back')) {
79
+ e.preventDefault();
80
+ parent.parent().removeClass(move_class + left_postfix);
81
+ }
82
+ $('.right-off-canvas-toggle').attr('aria-expanded', 'true');
83
+ })
84
+ .on('click.fndtn.offcanvas', '.exit-off-canvas', function (e) {
85
+ self.click_remove_class(e, move_class + left_postfix);
86
+ S('.right-submenu').removeClass(move_class + left_postfix);
87
+ if (right_postfix) {
88
+ self.click_remove_class(e, move_class + right_postfix);
89
+ S('.left-submenu').removeClass(move_class + left_postfix);
90
+ }
91
+ $('.right-off-canvas-toggle').attr('aria-expanded', 'true');
92
+ })
93
+ .on('click.fndtn.offcanvas', '.exit-off-canvas', function (e) {
94
+ self.click_remove_class(e, move_class + left_postfix);
95
+ $('.left-off-canvas-toggle').attr('aria-expanded', 'false');
96
+ if (right_postfix) {
97
+ self.click_remove_class(e, move_class + right_postfix);
98
+ $('.right-off-canvas-toggle').attr('aria-expanded', 'false');
99
+ }
100
+ });
101
+ },
102
+
103
+ toggle : function (class_name, $off_canvas) {
104
+ $off_canvas = $off_canvas || this.get_wrapper();
105
+ if ($off_canvas.is('.' + class_name)) {
106
+ this.hide(class_name, $off_canvas);
107
+ } else {
108
+ this.show(class_name, $off_canvas);
109
+ }
110
+ },
111
+
112
+ show : function (class_name, $off_canvas) {
113
+ $off_canvas = $off_canvas || this.get_wrapper();
114
+ $off_canvas.trigger('open').trigger('open.fndtn.offcanvas');
115
+ $off_canvas.addClass(class_name);
116
+ },
117
+
118
+ hide : function (class_name, $off_canvas) {
119
+ $off_canvas = $off_canvas || this.get_wrapper();
120
+ $off_canvas.trigger('close').trigger('close.fndtn.offcanvas');
121
+ $off_canvas.removeClass(class_name);
122
+ },
123
+
124
+ click_toggle_class : function (e, class_name) {
125
+ e.preventDefault();
126
+ var $off_canvas = this.get_wrapper(e);
127
+ this.toggle(class_name, $off_canvas);
128
+ },
129
+
130
+ click_remove_class : function (e, class_name) {
131
+ e.preventDefault();
132
+ var $off_canvas = this.get_wrapper(e);
133
+ this.hide(class_name, $off_canvas);
134
+ },
135
+
136
+ get_settings : function (e) {
137
+ var offcanvas = this.S(e.target).closest('[' + this.attr_name() + ']');
138
+ return offcanvas.data(this.attr_name(true) + '-init') || this.settings;
139
+ },
140
+
141
+ get_wrapper : function (e) {
142
+ var $off_canvas = this.S(e ? e.target : this.scope).closest('.off-canvas-wrap');
143
+
144
+ if ($off_canvas.length === 0) {
145
+ $off_canvas = this.S('.off-canvas-wrap');
146
+ }
147
+ return $off_canvas;
148
+ },
149
+
150
+ reflow : function () {}
151
+ };
152
+ }(jQuery, window, window.document));
@@ -0,0 +1,476 @@
1
+ ;(function ($, window, document, undefined) {
2
+ 'use strict';
3
+
4
+ var noop = function () {};
5
+
6
+ var Orbit = function (el, settings) {
7
+ // Don't reinitialize plugin
8
+ if (el.hasClass(settings.slides_container_class)) {
9
+ return this;
10
+ }
11
+
12
+ var self = this,
13
+ container,
14
+ slides_container = el,
15
+ number_container,
16
+ bullets_container,
17
+ timer_container,
18
+ idx = 0,
19
+ animate,
20
+ timer,
21
+ locked = false,
22
+ adjust_height_after = false;
23
+
24
+ self.slides = function () {
25
+ return slides_container.children(settings.slide_selector);
26
+ };
27
+
28
+ self.slides().first().addClass(settings.active_slide_class);
29
+
30
+ self.update_slide_number = function (index) {
31
+ if (settings.slide_number) {
32
+ number_container.find('span:first').text(parseInt(index) + 1);
33
+ number_container.find('span:last').text(self.slides().length);
34
+ }
35
+ if (settings.bullets) {
36
+ bullets_container.children().removeClass(settings.bullets_active_class);
37
+ $(bullets_container.children().get(index)).addClass(settings.bullets_active_class);
38
+ }
39
+ };
40
+
41
+ self.update_active_link = function (index) {
42
+ var link = $('[data-orbit-link="' + self.slides().eq(index).attr('data-orbit-slide') + '"]');
43
+ link.siblings().removeClass(settings.bullets_active_class);
44
+ link.addClass(settings.bullets_active_class);
45
+ };
46
+
47
+ self.build_markup = function () {
48
+ slides_container.wrap('<div class="' + settings.container_class + '"></div>');
49
+ container = slides_container.parent();
50
+ slides_container.addClass(settings.slides_container_class);
51
+
52
+ if (settings.stack_on_small) {
53
+ container.addClass(settings.stack_on_small_class);
54
+ }
55
+
56
+ if (settings.navigation_arrows) {
57
+ container.append($('<a href="#"><span></span></a>').addClass(settings.prev_class));
58
+ container.append($('<a href="#"><span></span></a>').addClass(settings.next_class));
59
+ }
60
+
61
+ if (settings.timer) {
62
+ timer_container = $('<div>').addClass(settings.timer_container_class);
63
+ timer_container.append('<span>');
64
+ timer_container.append($('<div>').addClass(settings.timer_progress_class));
65
+ timer_container.addClass(settings.timer_paused_class);
66
+ container.append(timer_container);
67
+ }
68
+
69
+ if (settings.slide_number) {
70
+ number_container = $('<div>').addClass(settings.slide_number_class);
71
+ number_container.append('<span></span> ' + settings.slide_number_text + ' <span></span>');
72
+ container.append(number_container);
73
+ }
74
+
75
+ if (settings.bullets) {
76
+ bullets_container = $('<ol>').addClass(settings.bullets_container_class);
77
+ container.append(bullets_container);
78
+ bullets_container.wrap('<div class="orbit-bullets-container"></div>');
79
+ self.slides().each(function (idx, el) {
80
+ var bullet = $('<li>').attr('data-orbit-slide', idx).on('click', self.link_bullet);;
81
+ bullets_container.append(bullet);
82
+ });
83
+ }
84
+
85
+ };
86
+
87
+ self._goto = function (next_idx, start_timer) {
88
+ // if (locked) {return false;}
89
+ if (next_idx === idx) {return false;}
90
+ if (typeof timer === 'object') {timer.restart();}
91
+ var slides = self.slides();
92
+
93
+ var dir = 'next';
94
+ locked = true;
95
+ if (next_idx < idx) {dir = 'prev';}
96
+ if (next_idx >= slides.length) {
97
+ if (!settings.circular) {
98
+ return false;
99
+ }
100
+ next_idx = 0;
101
+ } else if (next_idx < 0) {
102
+ if (!settings.circular) {
103
+ return false;
104
+ }
105
+ next_idx = slides.length - 1;
106
+ }
107
+
108
+ var current = $(slides.get(idx));
109
+ var next = $(slides.get(next_idx));
110
+
111
+ current.css('zIndex', 2);
112
+ current.removeClass(settings.active_slide_class);
113
+ next.css('zIndex', 4).addClass(settings.active_slide_class);
114
+
115
+ slides_container.trigger('before-slide-change.fndtn.orbit');
116
+ settings.before_slide_change();
117
+ self.update_active_link(next_idx);
118
+
119
+ var callback = function () {
120
+ var unlock = function () {
121
+ idx = next_idx;
122
+ locked = false;
123
+ if (start_timer === true) {timer = self.create_timer(); timer.start();}
124
+ self.update_slide_number(idx);
125
+ slides_container.trigger('after-slide-change.fndtn.orbit', [{slide_number : idx, total_slides : slides.length}]);
126
+ settings.after_slide_change(idx, slides.length);
127
+ };
128
+ if (slides_container.outerHeight() != next.outerHeight() && settings.variable_height) {
129
+ slides_container.animate({'height': next.outerHeight()}, 250, 'linear', unlock);
130
+ } else {
131
+ unlock();
132
+ }
133
+ };
134
+
135
+ if (slides.length === 1) {callback(); return false;}
136
+
137
+ var start_animation = function () {
138
+ if (dir === 'next') {animate.next(current, next, callback);}
139
+ if (dir === 'prev') {animate.prev(current, next, callback);}
140
+ };
141
+
142
+ if (next.outerHeight() > slides_container.outerHeight() && settings.variable_height) {
143
+ slides_container.animate({'height': next.outerHeight()}, 250, 'linear', start_animation);
144
+ } else {
145
+ start_animation();
146
+ }
147
+ };
148
+
149
+ self.next = function (e) {
150
+ e.stopImmediatePropagation();
151
+ e.preventDefault();
152
+ self._goto(idx + 1);
153
+ };
154
+
155
+ self.prev = function (e) {
156
+ e.stopImmediatePropagation();
157
+ e.preventDefault();
158
+ self._goto(idx - 1);
159
+ };
160
+
161
+ self.link_custom = function (e) {
162
+ e.preventDefault();
163
+ var link = $(this).attr('data-orbit-link');
164
+ if ((typeof link === 'string') && (link = $.trim(link)) != '') {
165
+ var slide = container.find('[data-orbit-slide=' + link + ']');
166
+ if (slide.index() != -1) {self._goto(slide.index());}
167
+ }
168
+ };
169
+
170
+ self.link_bullet = function (e) {
171
+ var index = $(this).attr('data-orbit-slide');
172
+ if ((typeof index === 'string') && (index = $.trim(index)) != '') {
173
+ if (isNaN(parseInt(index))) {
174
+ var slide = container.find('[data-orbit-slide=' + index + ']');
175
+ if (slide.index() != -1) {self._goto(slide.index() + 1);}
176
+ } else {
177
+ self._goto(parseInt(index));
178
+ }
179
+ }
180
+
181
+ }
182
+
183
+ self.timer_callback = function () {
184
+ self._goto(idx + 1, true);
185
+ }
186
+
187
+ self.compute_dimensions = function () {
188
+ var current = $(self.slides().get(idx));
189
+ var h = current.outerHeight();
190
+ if (!settings.variable_height) {
191
+ self.slides().each(function(){
192
+ if ($(this).outerHeight() > h) { h = $(this).outerHeight(); }
193
+ });
194
+ }
195
+ slides_container.height(h);
196
+ };
197
+
198
+ self.create_timer = function () {
199
+ var t = new Timer(
200
+ container.find('.' + settings.timer_container_class),
201
+ settings,
202
+ self.timer_callback
203
+ );
204
+ return t;
205
+ };
206
+
207
+ self.stop_timer = function () {
208
+ if (typeof timer === 'object') {
209
+ timer.stop();
210
+ }
211
+ };
212
+
213
+ self.toggle_timer = function () {
214
+ var t = container.find('.' + settings.timer_container_class);
215
+ if (t.hasClass(settings.timer_paused_class)) {
216
+ if (typeof timer === 'undefined') {timer = self.create_timer();}
217
+ timer.start();
218
+ } else {
219
+ if (typeof timer === 'object') {timer.stop();}
220
+ }
221
+ };
222
+
223
+ self.init = function () {
224
+ self.build_markup();
225
+ if (settings.timer) {
226
+ timer = self.create_timer();
227
+ Tennpipes.utils.image_loaded(this.slides().children('img'), timer.start);
228
+ }
229
+ animate = new FadeAnimation(settings, slides_container);
230
+ if (settings.animation === 'slide') {
231
+ animate = new SlideAnimation(settings, slides_container);
232
+ }
233
+
234
+ container.on('click', '.' + settings.next_class, self.next);
235
+ container.on('click', '.' + settings.prev_class, self.prev);
236
+
237
+ if (settings.next_on_click) {
238
+ container.on('click', '.' + settings.slides_container_class + ' [data-orbit-slide]', self.link_bullet);
239
+ }
240
+
241
+ container.on('click', self.toggle_timer);
242
+ if (settings.swipe) {
243
+ container.on('touchstart.fndtn.orbit', function (e) {
244
+ if (!e.touches) {e = e.originalEvent;}
245
+ var data = {
246
+ start_page_x : e.touches[0].pageX,
247
+ start_page_y : e.touches[0].pageY,
248
+ start_time : (new Date()).getTime(),
249
+ delta_x : 0,
250
+ is_scrolling : undefined
251
+ };
252
+ container.data('swipe-transition', data);
253
+ e.stopPropagation();
254
+ })
255
+ .on('touchmove.fndtn.orbit', function (e) {
256
+ if (!e.touches) {
257
+ e = e.originalEvent;
258
+ }
259
+ // Ignore pinch/zoom events
260
+ if (e.touches.length > 1 || e.scale && e.scale !== 1) {
261
+ return;
262
+ }
263
+
264
+ var data = container.data('swipe-transition');
265
+ if (typeof data === 'undefined') {data = {};}
266
+
267
+ data.delta_x = e.touches[0].pageX - data.start_page_x;
268
+
269
+ if ( typeof data.is_scrolling === 'undefined') {
270
+ data.is_scrolling = !!( data.is_scrolling || Math.abs(data.delta_x) < Math.abs(e.touches[0].pageY - data.start_page_y) );
271
+ }
272
+
273
+ if (!data.is_scrolling && !data.active) {
274
+ e.preventDefault();
275
+ var direction = (data.delta_x < 0) ? (idx + 1) : (idx - 1);
276
+ data.active = true;
277
+ self._goto(direction);
278
+ }
279
+ })
280
+ .on('touchend.fndtn.orbit', function (e) {
281
+ container.data('swipe-transition', {});
282
+ e.stopPropagation();
283
+ })
284
+ }
285
+ container.on('mouseenter.fndtn.orbit', function (e) {
286
+ if (settings.timer && settings.pause_on_hover) {
287
+ self.stop_timer();
288
+ }
289
+ })
290
+ .on('mouseleave.fndtn.orbit', function (e) {
291
+ if (settings.timer && settings.resume_on_mouseout) {
292
+ timer.start();
293
+ }
294
+ });
295
+
296
+ $(document).on('click', '[data-orbit-link]', self.link_custom);
297
+ $(window).on('load resize', self.compute_dimensions);
298
+ Tennpipes.utils.image_loaded(this.slides().children('img'), self.compute_dimensions);
299
+ Tennpipes.utils.image_loaded(this.slides().children('img'), function () {
300
+ container.prev('.' + settings.preloader_class).css('display', 'none');
301
+ self.update_slide_number(0);
302
+ self.update_active_link(0);
303
+ slides_container.trigger('ready.fndtn.orbit');
304
+ });
305
+ };
306
+
307
+ self.init();
308
+ };
309
+
310
+ var Timer = function (el, settings, callback) {
311
+ var self = this,
312
+ duration = settings.timer_speed,
313
+ progress = el.find('.' + settings.timer_progress_class),
314
+ start,
315
+ timeout,
316
+ left = -1;
317
+
318
+ this.update_progress = function (w) {
319
+ var new_progress = progress.clone();
320
+ new_progress.attr('style', '');
321
+ new_progress.css('width', w + '%');
322
+ progress.replaceWith(new_progress);
323
+ progress = new_progress;
324
+ };
325
+
326
+ this.restart = function () {
327
+ clearTimeout(timeout);
328
+ el.addClass(settings.timer_paused_class);
329
+ left = -1;
330
+ self.update_progress(0);
331
+ };
332
+
333
+ this.start = function () {
334
+ if (!el.hasClass(settings.timer_paused_class)) {return true;}
335
+ left = (left === -1) ? duration : left;
336
+ el.removeClass(settings.timer_paused_class);
337
+ start = new Date().getTime();
338
+ progress.animate({'width' : '100%'}, left, 'linear');
339
+ timeout = setTimeout(function () {
340
+ self.restart();
341
+ callback();
342
+ }, left);
343
+ el.trigger('timer-started.fndtn.orbit')
344
+ };
345
+
346
+ this.stop = function () {
347
+ if (el.hasClass(settings.timer_paused_class)) {return true;}
348
+ clearTimeout(timeout);
349
+ el.addClass(settings.timer_paused_class);
350
+ var end = new Date().getTime();
351
+ left = left - (end - start);
352
+ var w = 100 - ((left / duration) * 100);
353
+ self.update_progress(w);
354
+ el.trigger('timer-stopped.fndtn.orbit');
355
+ };
356
+ };
357
+
358
+ var SlideAnimation = function (settings, container) {
359
+ var duration = settings.animation_speed;
360
+ var is_rtl = ($('html[dir=rtl]').length === 1);
361
+ var margin = is_rtl ? 'marginRight' : 'marginLeft';
362
+ var animMargin = {};
363
+ animMargin[margin] = '0%';
364
+
365
+ this.next = function (current, next, callback) {
366
+ current.animate({marginLeft : '-100%'}, duration);
367
+ next.animate(animMargin, duration, function () {
368
+ current.css(margin, '100%');
369
+ callback();
370
+ });
371
+ };
372
+
373
+ this.prev = function (current, prev, callback) {
374
+ current.animate({marginLeft : '100%'}, duration);
375
+ prev.css(margin, '-100%');
376
+ prev.animate(animMargin, duration, function () {
377
+ current.css(margin, '100%');
378
+ callback();
379
+ });
380
+ };
381
+ };
382
+
383
+ var FadeAnimation = function (settings, container) {
384
+ var duration = settings.animation_speed;
385
+ var is_rtl = ($('html[dir=rtl]').length === 1);
386
+ var margin = is_rtl ? 'marginRight' : 'marginLeft';
387
+
388
+ this.next = function (current, next, callback) {
389
+ next.css({'margin' : '0%', 'opacity' : '0.01'});
390
+ next.animate({'opacity' :'1'}, duration, 'linear', function () {
391
+ current.css('margin', '100%');
392
+ callback();
393
+ });
394
+ };
395
+
396
+ this.prev = function (current, prev, callback) {
397
+ prev.css({'margin' : '0%', 'opacity' : '0.01'});
398
+ prev.animate({'opacity' : '1'}, duration, 'linear', function () {
399
+ current.css('margin', '100%');
400
+ callback();
401
+ });
402
+ };
403
+ };
404
+
405
+ Tennpipes.libs = Tennpipes.libs || {};
406
+
407
+ Tennpipes.libs.orbit = {
408
+ name : 'orbit',
409
+
410
+ version : '5.5.1',
411
+
412
+ settings : {
413
+ animation : 'slide',
414
+ timer_speed : 10000,
415
+ pause_on_hover : true,
416
+ resume_on_mouseout : false,
417
+ next_on_click : true,
418
+ animation_speed : 500,
419
+ stack_on_small : false,
420
+ navigation_arrows : true,
421
+ slide_number : true,
422
+ slide_number_text : 'of',
423
+ container_class : 'orbit-container',
424
+ stack_on_small_class : 'orbit-stack-on-small',
425
+ next_class : 'orbit-next',
426
+ prev_class : 'orbit-prev',
427
+ timer_container_class : 'orbit-timer',
428
+ timer_paused_class : 'paused',
429
+ timer_progress_class : 'orbit-progress',
430
+ slides_container_class : 'orbit-slides-container',
431
+ preloader_class : 'preloader',
432
+ slide_selector : '*',
433
+ bullets_container_class : 'orbit-bullets',
434
+ bullets_active_class : 'active',
435
+ slide_number_class : 'orbit-slide-number',
436
+ caption_class : 'orbit-caption',
437
+ active_slide_class : 'active',
438
+ orbit_transition_class : 'orbit-transitioning',
439
+ bullets : true,
440
+ circular : true,
441
+ timer : true,
442
+ variable_height : false,
443
+ swipe : true,
444
+ before_slide_change : noop,
445
+ after_slide_change : noop
446
+ },
447
+
448
+ init : function (scope, method, options) {
449
+ var self = this;
450
+ this.bindings(method, options);
451
+ },
452
+
453
+ events : function (instance) {
454
+ var orbit_instance = new Orbit(this.S(instance), this.S(instance).data('orbit-init'));
455
+ this.S(instance).data(this.name + '-instance', orbit_instance);
456
+ },
457
+
458
+ reflow : function () {
459
+ var self = this;
460
+
461
+ if (self.S(self.scope).is('[data-orbit]')) {
462
+ var $el = self.S(self.scope);
463
+ var instance = $el.data(self.name + '-instance');
464
+ instance.compute_dimensions();
465
+ } else {
466
+ self.S('[data-orbit]', self.scope).each(function (idx, el) {
467
+ var $el = self.S(el);
468
+ var opts = self.data_options($el);
469
+ var instance = $el.data(self.name + '-instance');
470
+ instance.compute_dimensions();
471
+ });
472
+ }
473
+ }
474
+ };
475
+
476
+ }(jQuery, window, window.document));