locomotivecms_wagon 1.0.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +15 -0
  2. data/Gemfile +1 -1
  3. data/README.md +1 -1
  4. data/Rakefile +2 -2
  5. data/generators/blank/Gemfile.tt +3 -1
  6. data/generators/blank/config/deploy.yml +4 -1
  7. data/generators/bootstrap/Gemfile.tt +3 -1
  8. data/generators/bootstrap/config/deploy.yml +4 -1
  9. data/generators/cloned/Gemfile.tt +3 -1
  10. data/generators/cloned/config/deploy.yml.tt +5 -1
  11. data/generators/foundation/Gemfile.tt +4 -2
  12. data/generators/foundation/app/views/pages/index.liquid +3 -1
  13. data/generators/foundation/app/views/pages/index.liquid.haml +18 -16
  14. data/generators/foundation/config/deploy.yml +4 -1
  15. data/generators/foundation/public/javascripts/foundation.min.js +32 -14
  16. data/generators/foundation/public/javascripts/foundation/foundation.alerts.js +4 -2
  17. data/generators/foundation/public/javascripts/foundation/foundation.clearing.js +67 -31
  18. data/generators/foundation/public/javascripts/foundation/foundation.cookie.js +1 -1
  19. data/generators/foundation/public/javascripts/foundation/foundation.dropdown.js +73 -25
  20. data/generators/foundation/public/javascripts/foundation/foundation.forms.js +356 -235
  21. data/generators/foundation/public/javascripts/foundation/foundation.interchange.js +271 -0
  22. data/generators/foundation/public/javascripts/foundation/foundation.joyride.js +265 -33
  23. data/generators/foundation/public/javascripts/foundation/foundation.js +130 -55
  24. data/generators/foundation/public/javascripts/foundation/foundation.magellan.js +6 -4
  25. data/generators/foundation/public/javascripts/foundation/foundation.orbit.js +38 -13
  26. data/generators/foundation/public/javascripts/foundation/foundation.placeholder.js +1 -1
  27. data/generators/foundation/public/javascripts/foundation/foundation.reveal.js +74 -14
  28. data/generators/foundation/public/javascripts/foundation/foundation.section.js +210 -66
  29. data/generators/foundation/public/javascripts/foundation/foundation.tooltips.js +25 -12
  30. data/generators/foundation/public/javascripts/foundation/foundation.topbar.js +126 -54
  31. data/generators/foundation/public/javascripts/vendor/custom.modernizr.js +1 -1
  32. data/generators/foundation/public/javascripts/vendor/jquery.js +1 -1
  33. data/generators/foundation/public/javascripts/vendor/zepto.js +1 -1
  34. data/generators/foundation/public/stylesheets/foundation.css +870 -438
  35. data/generators/foundation/public/stylesheets/foundation.min.css +440 -1
  36. data/generators/foundation/public/stylesheets/normalize.css +89 -146
  37. data/generators/page/template.liquid.haml.tt +6 -7
  38. data/generators/page/template.liquid.tt +34 -1
  39. data/lib/locomotive/wagon.rb +15 -1
  40. data/lib/locomotive/wagon/cli.rb +8 -4
  41. data/lib/locomotive/wagon/generators/site/foundation.rb +1 -1
  42. data/lib/locomotive/wagon/liquid.rb +1 -2
  43. data/lib/locomotive/wagon/liquid/drops/content_types.rb +6 -22
  44. data/lib/locomotive/wagon/liquid/drops/page.rb +6 -14
  45. data/lib/locomotive/wagon/liquid/drops/site.rb +4 -1
  46. data/lib/locomotive/wagon/liquid/filters/html.rb +1 -1
  47. data/lib/locomotive/wagon/liquid/filters/translate.rb +10 -6
  48. data/lib/locomotive/wagon/liquid/tags/nav.rb +3 -2
  49. data/lib/locomotive/wagon/misc/dragonfly.rb +1 -1
  50. data/lib/locomotive/wagon/scopeable.rb +28 -0
  51. data/lib/locomotive/wagon/server/page.rb +7 -1
  52. data/lib/locomotive/wagon/version.rb +1 -1
  53. data/locales/de.yml +13 -12
  54. data/locales/en.yml +13 -12
  55. data/locales/es.yml +13 -12
  56. data/locales/et.yml +13 -12
  57. data/locales/fr.yml +14 -12
  58. data/locales/it.yml +13 -12
  59. data/locales/nb.yml +13 -12
  60. data/locales/nl.yml +11 -10
  61. data/locales/pl.yml +13 -12
  62. data/locales/pt-BR.yml +13 -12
  63. data/locales/ru.yml +13 -12
  64. data/locomotivecms_wagon.gemspec +2 -1
  65. data/spec/fixtures/default/app/views/pages/grunge_bands.liquid.haml +8 -0
  66. data/spec/fixtures/default/app/views/pages/index.liquid.haml +3 -0
  67. data/spec/fixtures/default/app/views/pages/music.liquid.haml +1 -1
  68. data/spec/fixtures/default/app/views/pages/songs/template.liquid.haml +4 -0
  69. data/spec/fixtures/default/app/views/pages/tags/nav.liquid.haml +6 -0
  70. data/spec/fixtures/default/app/views/pages/unlisted_pages.liquid.haml +9 -0
  71. data/spec/integration/cassettes/pull.yml +397 -240
  72. data/spec/integration/cassettes/push.yml +468 -438
  73. data/spec/integration/cassettes/staging.yml +846 -0
  74. data/spec/integration/cli_spec.rb +19 -0
  75. data/spec/integration/server/basic_spec.rb +34 -5
  76. data/spec/integration/server/liquid_spec.rb +39 -0
  77. data/spec/integration/sites_spec.rb +28 -4
  78. data/spec/spec_helper.rb +1 -0
  79. data/spec/support/helpers.rb +8 -1
  80. metadata +37 -53
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ZGE3ODI1MmIzNmYzNWE3ZWM0OGYwYzJhMjhlNzc1MDY0ZTM3ODFhZg==
5
+ data.tar.gz: !binary |-
6
+ NTNkNDJhNWViNTcyMTNkMWVhM2MyYzQzYjliZDM2Njg1MmU3NzE4OQ==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ Y2RkODRmMGJlNjQ5MTYwYzU0YTliMDE3MDc1YzRkNjBhOTk3ZTUxYmFjMWVi
10
+ YjVlNmM2M2FmMGU0ODU0YjU4NmQxYTMwOGM3ZmRmYTYxN2I1NmY1MWQ3YTQ0
11
+ NmE3OGQ3MDFkZmRhZThkYzIyNmViMWQyODdjODRiMzRjOWY5NTk=
12
+ data.tar.gz: !binary |-
13
+ Y2JmOGE5OTZlNmUxNmExZjI0Y2QwZmRlODQyMjBlNzA3M2ViOTUzMDU0MDBj
14
+ ZDVhZjZiZmEzZTc4YWNjNWNjOTkyYjE0ZTZhYzg0MzE1NGI4ZDNhYzJjNzk1
15
+ NWFlOGU3MjczNDI0OTNlMDNiY2E0NTVjM2UwZGU4ZjUxNjk1Y2E=
data/Gemfile CHANGED
@@ -4,6 +4,6 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  # Development
7
- # gem 'locomotivecms_mounter', path: '../gems/mounter', require: false
7
+ #gem 'locomotivecms_mounter', path: '../gems/mounter', require: false
8
8
 
9
9
  gem 'rb-fsevent', '~> 0.9.1'
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # LocomotiveCMS::Wagon
2
2
 
3
- Wagon is the officiel site generator for the LocomotiveCMS engine powered by all the efficient and modern HTML development tools (Haml, SASS, Compass, Less).
3
+ Wagon is the official site generator for the LocomotiveCMS engine powered by all the efficient and modern HTML development tools (Haml, SASS, Compass, Less).
4
4
 
5
5
  ## Documentation
6
6
 
data/Rakefile CHANGED
@@ -36,10 +36,10 @@ namespace :development do
36
36
 
37
37
  FileUtils.rm_rf(File.join(File.dirname(__FILE__), 'site'))
38
38
  VCR.use_cassette('pull') do
39
- exit unless Locomotive::Wagon.clone('site', '.', host: 'http://locomotive.engine.dev:3000', email: 'admin@locomotivecms.com', password: 'locomotive')
39
+ exit unless Locomotive::Wagon.clone('site', '.', { host: 'sample.example.com:3000', email: 'admin@locomotivecms.com', password: 'locomotive' })
40
40
  end
41
41
 
42
- Locomotive::Wagon.push('site', {'host' => 'http://locomotive.engine.dev:3000'}, 'email' => 'admin@locomotivecms.com', 'password' => 'locomotive', 'force' => true, 'data' => true)
42
+ Locomotive::Wagon.push('site', {host: 'sample.example.com:3000', email: 'admin@locomotivecms.com', password: 'locomotive'}, force: true, force_translations: true, data: true)
43
43
  end
44
44
  end
45
45
 
@@ -10,8 +10,10 @@ group :development do
10
10
 
11
11
  # Unix
12
12
  gem 'therubyracer', require: 'v8', platforms: :ruby
13
+ gem 'rb-inotify', '~> 0.9', require: RUBY_PLATFORM.include?('linux') && 'rb-inotify'
13
14
 
14
- # TODO: Windows
15
+ # Windows
16
+ gem 'wdm', '>= 0.1.0', require: RUBY_PLATFORM =~ /mswin|mingw/i && 'wdm'
15
17
  end
16
18
 
17
19
  group :misc do
@@ -2,11 +2,14 @@ development:
2
2
  host: dev.example.com
3
3
  email: john@doe.net
4
4
  password: apassword
5
+ # api_key: <your api key here>
5
6
  staging:
6
7
  host: staging.example.com
7
8
  email: john@doe.net
8
9
  password: apassword
10
+ # api_key: <your api key here>
9
11
  production:
10
12
  host: www.example.com
11
13
  email: john@doe.net
12
- password: apassword
14
+ password: apassword
15
+ # api_key: <your api key here>
@@ -10,8 +10,10 @@ group :development do
10
10
 
11
11
  # Unix
12
12
  gem 'therubyracer', require: 'v8', platforms: :ruby
13
+ gem 'rb-inotify', '~> 0.9', require: RUBY_PLATFORM.include?('linux') && 'rb-inotify'
13
14
 
14
- # TODO: Windows
15
+ # Windows
16
+ gem 'wdm', '>= 0.1.0', require: RUBY_PLATFORM =~ /mswin|mingw/i && 'wdm'
15
17
  end
16
18
 
17
19
  group :misc do
@@ -2,11 +2,14 @@ development:
2
2
  host: dev.example.com
3
3
  email: john@doe.net
4
4
  password: apassword
5
+ # api_key: <your api key here>
5
6
  staging:
6
7
  host: staging.example.com
7
8
  email: john@doe.net
8
9
  password: apassword
10
+ # api_key: <your api key here>
9
11
  production:
10
12
  host: www.example.com
11
13
  email: john@doe.net
12
- password: apassword
14
+ password: apassword
15
+ # api_key: <your api key here>
@@ -10,8 +10,10 @@ group :development do
10
10
 
11
11
  # Unix
12
12
  gem 'therubyracer', require: 'v8', platforms: :ruby
13
+ gem 'rb-inotify', '~> 0.9', require: RUBY_PLATFORM.include?('linux') && 'rb-inotify'
13
14
 
14
- # TODO: Windows
15
+ # Windows
16
+ gem 'wdm', '>= 0.1.0', require: RUBY_PLATFORM =~ /mswin|mingw/i && 'wdm'
15
17
  end
16
18
 
17
19
  group :misc do
@@ -1,4 +1,8 @@
1
1
  production:
2
2
  host: <%= config[:host] %>
3
+ <% if config[:email] -%>
3
4
  email: <%= config[:email] %>
4
- password: <%= config[:password] %>
5
+ password: <%= config[:password] %>
6
+ <% elsif config[:api_key] -%>
7
+ api_key: <%= config[:api_key] -%>
8
+ <% end -%>
@@ -6,12 +6,14 @@ gem 'locomotivecms_wagon', '<%= config[:version] -%>'
6
6
 
7
7
  group :development do
8
8
  # Mac OS X
9
- gem 'rb-fsevent', '~> 0.9.1', :require => RUBY_PLATFORM.include?('darwin') && 'rb-fsevent'
9
+ gem 'rb-fsevent', '~> 0.9.1', require: RUBY_PLATFORM.include?('darwin') && 'rb-fsevent'
10
10
 
11
11
  # Unix
12
12
  gem 'therubyracer', require: 'v8', platforms: :ruby
13
+ gem 'rb-inotify', '~> 0.9', require: RUBY_PLATFORM.include?('linux') && 'rb-inotify'
13
14
 
14
- # TODO: Windows
15
+ # Windows
16
+ gem 'wdm', '>= 0.1.0', require: RUBY_PLATFORM =~ /mswin|mingw/i && 'wdm'
15
17
  end
16
18
 
17
19
  group :misc do
@@ -23,7 +23,7 @@ published: true
23
23
  <div class="row">
24
24
  <div class="large-12 columns">
25
25
  <h2>Welcome to Foundation</h2>
26
- <p>This is version 4.0.9.</p>
26
+ <p>This is version 4.2.1</p>
27
27
  <hr />
28
28
  </div>
29
29
  </div>
@@ -143,6 +143,8 @@ published: true
143
143
 
144
144
  {{ 'foundation/foundation.topbar.js' | javascript_tag }}
145
145
 
146
+ {{ 'foundation/foundation.interchange.js' | javascript_tag }}
147
+
146
148
  -->
147
149
 
148
150
  <script>
@@ -20,7 +20,7 @@ published: true
20
20
  .row
21
21
  .large-12.columns
22
22
  %h2 Welcome to Foundation
23
- %p This is version 4.0.9.
23
+ %p This is version 4.2.1
24
24
  %hr/
25
25
  {% block 'main' %}
26
26
  .row
@@ -96,34 +96,36 @@ published: true
96
96
 
97
97
  {{ 'foundation.min.js' | javascript_tag }}
98
98
 
99
- /
100
- {{ 'foundation/foundation.js' | javascript_tag }}
99
+
100
+ / {{ 'foundation/foundation.js' | javascript_tag }}
101
101
 
102
- {{ 'foundation/foundation.alerts.js' | javascript_tag }}
102
+ / {{ 'foundation/foundation.alerts.js' | javascript_tag }}
103
103
 
104
- {{ 'foundation/foundation.clearing.js' | javascript_tag }}
104
+ / {{ 'foundation/foundation.clearing.js' | javascript_tag }}
105
105
 
106
- {{ 'foundation/foundation.cookie.js' | javascript_tag }}
106
+ / {{ 'foundation/foundation.cookie.js' | javascript_tag }}
107
107
 
108
- {{ 'foundation/foundation.dropdown.js' | javascript_tag }}
108
+ / {{ 'foundation/foundation.dropdown.js' | javascript_tag }}
109
109
 
110
- {{ 'foundation/foundation.forms.js' | javascript_tag }}
110
+ / {{ 'foundation/foundation.forms.js' | javascript_tag }}
111
111
 
112
- {{ 'foundation/foundation.joyride.js' | javascript_tag }}
112
+ / {{ 'foundation/foundation.joyride.js' | javascript_tag }}
113
113
 
114
- {{ 'foundation/foundation.magellan.js' | javascript_tag }}
114
+ / {{ 'foundation/foundation.magellan.js' | javascript_tag }}
115
115
 
116
- {{ 'foundation/foundation.orbit.js' | javascript_tag }}
116
+ / {{ 'foundation/foundation.orbit.js' | javascript_tag }}
117
117
 
118
- {{ 'foundation/foundation.placeholder.js' | javascript_tag }}
118
+ / {{ 'foundation/foundation.placeholder.js' | javascript_tag }}
119
119
 
120
- {{ 'foundation/foundation.reveal.js' | javascript_tag }}
120
+ / {{ 'foundation/foundation.reveal.js' | javascript_tag }}
121
121
 
122
- {{ 'foundation/foundation.section.js' | javascript_tag }}
122
+ / {{ 'foundation/foundation.section.js' | javascript_tag }}
123
123
 
124
- {{ 'foundation/foundation.tooltips.js' | javascript_tag }}
124
+ / {{ 'foundation/foundation.tooltips.js' | javascript_tag }}
125
125
 
126
- {{ 'foundation/foundation.topbar.js' | javascript_tag }}
126
+ / {{ 'foundation/foundation.topbar.js' | javascript_tag }}
127
+
128
+ / {{ 'foundation/foundation.interchange.js' | javascript_tag }}
127
129
 
128
130
  :javascript
129
131
  $(document).foundation();
@@ -2,11 +2,14 @@ development:
2
2
  host: dev.example.com
3
3
  email: john@doe.net
4
4
  password: apassword
5
+ # api_key: <your api key here>
5
6
  staging:
6
7
  host: staging.example.com
7
8
  email: john@doe.net
8
9
  password: apassword
10
+ # api_key: <your api key here>
9
11
  production:
10
12
  host: www.example.com
11
13
  email: john@doe.net
12
- password: apassword
14
+ password: apassword
15
+ # api_key: <your api key here>
@@ -1,14 +1,32 @@
1
- /*
2
- * Foundation Responsive Library
3
- * http://foundation.zurb.com
4
- * Copyright 2013, ZURB
5
- * Free to use under the MIT license.
6
- * http://www.opensource.org/licenses/mit-license.php
7
- */
8
- /*jslint unparam: true, browser: true, indent: 2 */
9
- // Accommodate running jQuery or Zepto in noConflict() mode by
10
- // using an anonymous function to redefine the $ shorthand name.
11
- // See http://docs.jquery.com/Using_jQuery_with_Other_Libraries
12
- // and http://zeptojs.com/
13
- var libFuncName=null;if(typeof jQuery=="undefined"&&typeof Zepto=="undefined"&&typeof $=="function")libFuncName=$;else if(typeof jQuery=="function")libFuncName=jQuery;else{if(typeof Zepto!="function")throw new TypeError;libFuncName=Zepto}(function(e){(function(){Array.prototype.filter||(Array.prototype.filter=function(e){"use strict";if(this==null)throw new TypeError;var t=Object(this),n=t.length>>>0;if(typeof e!="function")try{throw new TypeError}catch(r){return}var i=[],s=arguments[1];for(var o=0;o<n;o++)if(o in t){var u=t[o];e&&e.call(s,u,o,t)&&i.push(u)}return i},Function.prototype.bind||(Function.prototype.bind=function(e){if(typeof this!="function")throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var t=Array.prototype.slice.call(arguments,1),n=this,r=function(){},i=function(){return n.apply(this instanceof r&&e?this:e,t.concat(Array.prototype.slice.call(arguments)))};return r.prototype=this.prototype,i.prototype=new r,i})),e.fn.stop=e.fn.stop||function(){return this}})(),function(t,n,r){"use strict";t.Foundation={name:"Foundation",version:"4.0.8",cache:{},init:function(e,t,n,r,i,s){var o,u=[e,n,r,i],a=[],s=s||!1;s&&(this.nc=s),this.scope=e||this.scope;if(t&&typeof t=="string"){if(/off/i.test(t))return this.off();o=t.split(" ");if(o.length>0)for(var f=o.length-1;f>=0;f--)a.push(this.init_lib(o[f],u))}else for(var l in this.libs)a.push(this.init_lib(l,u));return typeof t=="function"&&u.unshift(t),this.response_obj(a,u)},response_obj:function(e,t){for(var n in t)if(typeof t[n]=="function")return t[n]({errors:e.filter(function(e){if(typeof e=="string")return e})});return e},init_lib:function(e,t){return this.trap(function(){if(this.libs.hasOwnProperty(e))return this.patch(this.libs[e]),this.libs[e].init.apply(this.libs[e],t)}.bind(this),e)},trap:function(e,t){if(!this.nc)try{return e()}catch(n){return this.error({name:t,message:"could not be initialized",more:n.name+" "+n.message})}return e()},patch:function(e){this.fix_outer(e)},inherit:function(e,t){var n=t.split(" ");for(var r=n.length-1;r>=0;r--)this.lib_methods.hasOwnProperty(n[r])&&(this.libs[e.name][n[r]]=this.lib_methods[n[r]])},random_str:function(e){var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".split("");e||(e=Math.floor(Math.random()*t.length));var n="";for(var r=0;r<e;r++)n+=t[Math.floor(Math.random()*t.length)];return n},libs:{},lib_methods:{set_data:function(e,t){var n=[this.name,+(new Date),Foundation.random_str(5)].join("-");return Foundation.cache[n]=t,e.attr("data-"+this.name+"-id",n),t},get_data:function(e){return Foundation.cache[e.attr("data-"+this.name+"-id")]},remove_data:function(t){t?(delete Foundation.cache[t.attr("data-"+this.name+"-id")],t.attr("data-"+this.name+"-id","")):e("[data-"+this.name+"-id]").each(function(){delete Foundation.cache[e(this).attr("data-"+this.name+"-id")],e(this).attr("data-"+this.name+"-id","")})},throttle:function(e,t){var n=null;return function(){var r=this,i=arguments;clearTimeout(n),n=setTimeout(function(){e.apply(r,i)},t)}},data_options:function(t){function u(e){return!isNaN(e-0)&&e!==null&&e!==""&&e!==!1&&e!==!0}function a(t){return typeof t=="string"?e.trim(t):t}var n={},r,i,s=(t.attr("data-options")||":").split(";"),o=s.length;for(r=o-1;r>=0;r--)i=s[r].split(":"),/true/i.test(i[1])&&(i[1]=!0),/false/i.test(i[1])&&(i[1]=!1),u(i[1])&&(i[1]=parseInt(i[1],10)),i.length===2&&i[0].length>0&&(n[a(i[0])]=a(i[1]));return n},delay:function(e,t){return setTimeout(e,t)},scrollTo:function(n,r,i){if(i<0)return;var s=r-e(t).scrollTop(),o=s/i*10;this.scrollToTimerCache=setTimeout(function(){isNaN(parseInt(o,10))||(t.scrollTo(0,e(t).scrollTop()+o),this.scrollTo(n,r,i-10))}.bind(this),10)},scrollLeft:function(e){if(!e.length)return;return"scrollLeft"in e[0]?e[0].scrollLeft:e[0].pageXOffset},empty:function(e){if(e.length&&e.length>0)return!1;if(e.length&&e.length===0)return!0;for(var t in e)if(hasOwnProperty.call(e,t))return!1;return!0}},fix_outer:function(e){e.outerHeight=function(e,t){return typeof Zepto=="function"?e.height():typeof t!="undefined"?e.outerHeight(t):e.outerHeight()},e.outerWidth=function(e){return typeof Zepto=="function"?e.width():typeof bool!="undefined"?e.outerWidth(bool):e.outerWidth()}},error:function(e){return e.name+" "+e.message+"; "+e.more},off:function(){return e(this.scope).off(".fndtn"),e(t).off(".fndtn"),!0},zj:function(){try{return Zepto}catch(e){return jQuery}}()},e.fn.foundation=function(){var e=Array.prototype.slice.call(arguments,0);return this.each(function(){return Foundation.init.apply(Foundation,[this].concat(e)),this})}}(this,this.document)})(libFuncName),function(e,t,n,r){"use strict";Foundation.libs.alerts={name:"alerts",version:"4.0.0",settings:{speed:300,callback:function(){}},init:function(t,n,r){return this.scope=t||this.scope,typeof n=="object"&&e.extend(!0,this.settings,n),typeof n!="string"?(this.settings.init||this.events(),this.settings.init):this[n].call(this,r)},events:function(){var t=this;e(this.scope).on("click.fndtn.alerts","[data-alert] a.close",function(n){n.preventDefault(),e(this).closest("[data-alert]").fadeOut(t.speed,function(){e(this).remove(),t.settings.callback()})}),this.settings.init=!0},off:function(){e(this.scope).off(".fndtn.alerts")}}}(Foundation.zj,this,this.document),function(e,t,n,r){"use strict";Foundation.libs.clearing={name:"clearing",version:"4.0.0",settings:{templates:{viewing:'<a href="#" class="clearing-close">&times;</a><div class="visible-img" style="display: none"><img src="//:0"><p class="clearing-caption"></p><a href="#" class="clearing-main-left"><span></span></a><a href="#" class="clearing-main-right"><span></span></a></div>'},close_selectors:".clearing-close",init:!1,locked:!1},init:function(t,n,r){return this.scope=this.scope||t,Foundation.inherit(this,"set_data get_data remove_data throttle"),typeof n=="object"&&(r=e.extend(!0,this.settings,n)),typeof n!="string"?(e(this.scope).find("ul[data-clearing]").each(function(){var t=Foundation.libs.clearing,n=e(this),r=r||{},i=t.get_data(n);i||(r.$parent=n.parent(),t.set_data(n,e.extend(!0,t.settings,r)),t.assemble(n.find("li")),t.settings.init||t.events().swipe_events())}),this.settings.init):this[n].call(this,r)},events:function(){var n=this;return e(this.scope).on("click.fndtn.clearing","ul[data-clearing] li",function(t,r,i){var r=r||e(this),i=i||r,s=n.get_data(r.parent());t.preventDefault(),s||n.init(),n.open(e(t.target),r,i),n.update_paddles(i)}).on("click.fndtn.clearing",".clearing-main-right",function(e){this.nav(e,"next")}.bind(this)).on("click.fndtn.clearing",".clearing-main-left",function(e){this.nav(e,"prev")}.bind(this)).on("click.fndtn.clearing",this.settings.close_selectors,function(e){Foundation.libs.clearing.close(e,this)}).on("keydown.fndtn.clearing",function(e){this.keydown(e)}.bind(this)),e(t).on("resize.fndtn.clearing",function(e){this.resize()}.bind(this)),this.settings.init=!0,this},swipe_events:function(){var t=this;e(this.scope).on("touchstart.fndtn.clearing",".visible-img",function(t){t.touches||(t=t.originalEvent);var n={start_page_x:t.touches[0].pageX,start_page_y:t.touches[0].pageY,start_time:(new Date).getTime(),delta_x:0,is_scrolling:r};e(this).data("swipe-transition",n),t.stopPropagation()}).on("touchmove.fndtn.clearing",".visible-img",function(n){n.touches||(n=n.originalEvent);if(n.touches.length>1||n.scale&&n.scale!==1)return;var r=e(this).data("swipe-transition");typeof r=="undefined"&&(r={}),r.delta_x=n.touches[0].pageX-r.start_page_x,typeof r.is_scrolling=="undefined"&&(r.is_scrolling=!!(r.is_scrolling||Math.abs(r.delta_x)<Math.abs(n.touches[0].pageY-r.start_page_y)));if(!r.is_scrolling&&!r.active){n.preventDefault();var i=r.delta_x<0?"next":"prev";r.active=!0,t.nav(n,i)}}).on("touchend.fndtn.clearing",".visible-img",function(t){e(this).data("swipe-transition",{}),t.stopPropagation()})},assemble:function(e){var t=e.parent(),n=this.get_data(t),r=t.detach(),i={grid:'<div class="carousel">'+this.outerHTML(r[0])+"</div>",viewing:n.templates.viewing},s='<div class="clearing-assembled"><div>'+i.viewing+i.grid+"</div></div>";return n.$parent.append(s)},open:function(e,t,n){var r=n.closest(".clearing-assembled"),i=r.find("div").first(),s=i.find(".visible-img"),o=s.find("img").not(e);this.locked()||(o.attr("src",this.load(e)),this.loaded(o,function(){r.addClass("clearing-blackout"),i.addClass("clearing-container"),s.show(),this.fix_height(n).caption(s.find(".clearing-caption"),e).center(o).shift(t,n,function(){n.siblings().removeClass("visible"),n.addClass("visible")})}.bind(this)))},close:function(t,n){t.preventDefault();var r=function(e){return/blackout/.test(e.selector)?e:e.closest(".clearing-blackout")}(e(n)),i,s;return n===t.target&&r&&(i=r.find("div").first(),s=i.find(".visible-img"),this.settings.prev_index=0,r.find("ul[data-clearing]").attr("style","").closest(".clearing-blackout").removeClass("clearing-blackout"),i.removeClass("clearing-container"),s.hide()),!1},keydown:function(t){var n=e(".clearing-blackout").find("ul[data-clearing]");t.which===39&&this.go(n,"next"),t.which===37&&this.go(n,"prev"),t.which===27&&e("a.clearing-close").trigger("click")},nav:function(t,n){var r=e(".clearing-blackout").find("ul[data-clearing]");t.preventDefault(),this.go(r,n)},resize:function(){var t=e(".clearing-blackout .visible-img").find("img");t.length&&this.center(t)},fix_height:function(t){var n=t.parent().children(),r=this;return n.each(function(){var t=e(this),n=t.find("img");t.height()>r.outerHeight(n)&&t.addClass("fix-height")}).closest("ul").width(n.length*100+"%"),this},update_paddles:function(e){var t=e.closest(".carousel").siblings(".visible-img");e.next().length?t.find(".clearing-main-right").removeClass("disabled"):t.find(".clearing-main-right").addClass("disabled"),e.prev().length?t.find(".clearing-main-left").removeClass("disabled"):t.find(".clearing-main-left").addClass("disabled")},center:function(e){return e.css({marginLeft:-(this.outerWidth(e)/2),marginTop:-(this.outerHeight(e)/2)}),this},load:function(e){var t=e.parent().attr("href");return this.preload(e),t?t:e.attr("src")},preload:function(e){this.img(e.closest("li").next()).img(e.closest("li").prev())},loaded:function(e,t){function n(){t()}function r(){this.one("load",n);if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){var e=this.attr("src"),t=e.match(/\?/)?"&":"?";t+="random="+(new Date).getTime(),this.attr("src",e+t)}}if(!e.attr("src")){n();return}this.complete||this.readyState===4?n():r.call(e)},img:function(e){if(e.length){var t=new Image,n=e.find("a");n.length?t.src=n.attr("href"):t.src=e.find("img").attr("src")}return this},caption:function(e,t){var n=t.data("caption");return n?e.text(n).show():e.text("").hide(),this},go:function(e,t){var n=e.find(".visible"),r=n[t]();r.length&&r.find("img").trigger("click",[n,r])},shift:function(e,t,n){var r=t.parent(),i=this.settings.prev_index||t.index(),s=this.direction(r,e,t),o=parseInt(r.css("left"),10),u=this.outerWidth(t),a;t.index()!==i&&!/skip/.test(s)?/left/.test(s)?(this.lock(),r.animate({left:o+u},300,this.unlock())):/right/.test(s)&&(this.lock(),r.animate({left:o-u},300,this.unlock())):/skip/.test(s)&&(a=t.index()-this.settings.up_count,this.lock(),a>0?r.animate({left:-(a*u)},300,this.unlock()):r.animate({left:0},300,this.unlock())),n()},direction:function(t,n,r){var i=t.find("li"),s=this.outerWidth(i)+this.outerWidth(i)/4,o=Math.floor(this.outerWidth(e(".clearing-container"))/s)-1,u=i.index(r),a;return this.settings.up_count=o,this.adjacent(this.settings.prev_index,u)?u>o&&u>this.settings.prev_index?a="right":u>o-1&&u<=this.settings.prev_index?a="left":a=!1:a="skip",this.settings.prev_index=u,a},adjacent:function(e,t){for(var n=t+1;n>=t-1;n--)if(n===e)return!0;return!1},lock:function(){this.settings.locked=!0},unlock:function(){this.settings.locked=!1},locked:function(){return this.settings.locked},outerHTML:function(e){return e.outerHTML||(new XMLSerializer).serializeToString(e)},off:function(){e(this.scope).off(".fndtn.clearing"),e(t).off(".fndtn.clearing"),this.remove_data(),this.settings.init=!1}}}(Foundation.zj,this,this.document),function(e,t,n){function i(e){return e}function s(e){return decodeURIComponent(e.replace(r," "))}var r=/\+/g,o=e.cookie=function(r,u,a){if(u!==n){a=e.extend({},o.defaults,a),u===null&&(a.expires=-1);if(typeof a.expires=="number"){var f=a.expires,l=a.expires=new Date;l.setDate(l.getDate()+f)}return u=o.json?JSON.stringify(u):String(u),t.cookie=[encodeURIComponent(r),"=",o.raw?u:encodeURIComponent(u),a.expires?"; expires="+a.expires.toUTCString():"",a.path?"; path="+a.path:"",a.domain?"; domain="+a.domain:"",a.secure?"; secure":""].join("")}var c=o.raw?i:s,h=t.cookie.split("; ");for(var p=0,d=h.length;p<d;p++){var v=h[p].split("=");if(c(v.shift())===r){var m=c(v.join("="));return o.json?JSON.parse(m):m}}return null};o.defaults={},e.removeCookie=function(t,n){return e.cookie(t)!==null?(e.cookie(t,null,n),!0):!1}}(Foundation.zj,document),function(e,t,n,r){"use strict";Foundation.libs.dropdown={name:"dropdown",version:"4.0.9",settings:{activeClass:"open"},init:function(t,n,r){return this.scope=t||this.scope,Foundation.inherit(this,"throttle"),typeof n=="object"&&e.extend(!0,this.settings,n),typeof n!="string"?(this.settings.init||this.events(),this.settings.init):this[n].call(this,r)},events:function(){var n=this;e(this.scope).on("click.fndtn.dropdown","[data-dropdown]",function(t){t.preventDefault(),t.stopPropagation(),n.toggle(e(this))}),e("*, html, body").on("click.fndtn.dropdown",function(t){e(t.target).data("dropdown")||e("[data-dropdown-content]").css("left","-99999px").removeClass(n.settings.activeClass)}),e(t).on("resize.fndtn.dropdown",n.throttle(function(){n.resize.call(n)},50)).trigger("resize"),this.settings.init=!0},toggle:function(t,n){var r=e("#"+t.data("dropdown"));e("[data-dropdown-content]").not(r).css("left","-99999px").removeClass(this.settings.activeClass),r.hasClass(this.settings.activeClass)?r.css("left","-99999px").removeClass(this.settings.activeClass):this.css(r.addClass(this.settings.activeClass),t)},resize:function(){var t=e("[data-dropdown-content].open"),n=e("[data-dropdown='"+t.attr("id")+"']");t.length&&n.length&&this.css(t,n)},css:function(n,r){if(n.parent()[0]===e("body")[0])var i=r.offset();else var i=r.position();if(this.small())n.css({position:"absolute",width:"95%",left:"2.5%","max-width":"none",top:i.top+this.outerHeight(r)});else{if(e(t).width()>this.outerWidth(n)+r.offset().left)var s=i.left;else{n.hasClass("right")||n.addClass("right");var s=i.left-(this.outerWidth(n)-this.outerWidth(r))}n.attr("style","").css({position:"absolute",top:i.top+this.outerHeight(r),left:s})}return n},small:function(){return e(t).width()<768||e("html").hasClass("lt-ie9")},off:function(){e(this.scope).off(".fndtn.dropdown"),e("html, body").off(".fndtn.dropdown"),e(t).off(".fndtn.dropdown"),e("[data-dropdown-content]").off(".fndtn.dropdown"),this.settings.init=!1}}}(Foundation.zj,this,this.document),function(e,t,n,r){"use strict";Foundation.libs.forms={name:"forms",version:"4.0.4",settings:{disable_class:"no-custom"},init:function(t,n,r){return this.scope=t||this.scope,typeof n=="object"&&e.extend(!0,this.settings,n),typeof n!="string"?(this.settings.init||this.events(),this.assemble(),this.settings.init):this[n].call(this,r)},assemble:function(){e('form.custom input[type="radio"]',e(this.scope)).not('[data-customforms="disabled"]').each(this.append_custom_markup),e('form.custom input[type="checkbox"]',e(this.scope)).not('[data-customforms="disabled"]').each(this.append_custom_markup),e("form.custom select",e(this.scope)).not('[data-customforms="disabled"]').each(this.append_custom_select)},events:function(){var t=this;e(this.scope).on("change.fndtn.forms",'form.custom select:not([data-customforms="disabled"])',function(n){t.refresh_custom_select(e(this))}).on("click.fndtn.forms","form.custom label",function(n){var r=e("#"+t.escape(e(this).attr("for"))+':not([data-customforms="disabled"])'),i,s;r.length!==0&&(r.attr("type")==="checkbox"?(n.preventDefault(),i=e(this).find("span.custom.checkbox"),i.length==0&&(i=e(this).next("span.custom.checkbox")),i.length==0&&(i=e(this).prev("span.custom.checkbox")),t.toggle_checkbox(i)):r.attr("type")==="radio"&&(n.preventDefault(),s=e(this).find("span.custom.radio"),s.length==0&&(s=e(this).next("span.custom.radio")),s.length==0&&(s=e(this).prev("span.custom.radio")),t.toggle_radio(s)))}).on("click.fndtn.forms","form.custom div.custom.dropdown a.current, form.custom div.custom.dropdown a.selector",function(n){var r=e(this),i=r.closest("div.custom.dropdown"),s=i.prev();i.hasClass("open")||e(t.scope).trigger("click"),n.preventDefault();if(!1===s.is(":disabled"))return i.toggleClass("open"),i.hasClass("open")?e(t.scope).on("click.fndtn.forms.customdropdown",function(){i.removeClass("open"),e(t.scope).off(".fndtn.forms.customdropdown")}):e(t.scope).on(".fndtn.forms.customdropdown"),!1}).on("click.fndtn.forms touchend.fndtn.forms","form.custom div.custom.dropdown li",function(t){var n=e(this),r=n.closest("div.custom.dropdown"),i=r.prev(),s=0;t.preventDefault(),t.stopPropagation();if(!e(this).hasClass("disabled")){e("div.dropdown").not(r).removeClass("open");var o=n.closest("ul").find("li.selected");o.removeClass("selected"),n.addClass("selected"),r.removeClass("open").find("a.current").html(n.html()),n.closest("ul").find("li").each(function(e){n[0]==this&&(s=e)}),i[0].selectedIndex=s,i.data("prevalue",o.html()),i.trigger("change")}}),this.settings.init=!0},append_custom_markup:function(t,n){var r=e(n).hide(),i=r.attr("type"),s=r.next("span.custom."+i);s.length===0&&(s=e('<span class="custom '+i+'"></span>').insertAfter(r)),s.toggleClass("checked",r.is(":checked")),s.toggleClass("disabled",r.is(":disabled"))},append_custom_select:function(t,n){var r=Foundation.libs.forms,i=e(n),s=i.next("div.custom.dropdown"),o=s.find("ul"),u=s.find(".current"),a=s.find(".selector"),f=i.find("option"),l=f.filter(":selected"),c=i.attr("class")?i.attr("class").split(" "):[],h=0,p="",d,v=!1;if(i.hasClass(r.settings.disable_class))return;if(s.length===0){var m=i.hasClass("small")?"small":i.hasClass("medium")?"medium":i.hasClass("large")?"large":i.hasClass("expand")?"expand":"";s=e('<div class="'+["custom","dropdown",m].concat(c).filter(function(e,t,n){return e==""?!1:n.indexOf(e)==t}).join(" ")+'"><a href="#" class="selector"></a><ul /></div>'),a=s.find(".selector"),o=s.find("ul"),p=f.map(function(){return"<li>"+e(this).html()+"</li>"}).get().join(""),o.append(p),v=s.prepend('<a href="#" class="current">'+l.html()+"</a>").find(".current"),i.after(s).hide()}else p=f.map(function(){return"<li>"+e(this).html()+"</li>"}).get().join(""),o.html("").append(p);s.toggleClass("disabled",i.is(":disabled")),d=o.find("li"),f.each(function(t){this.selected&&(d.eq(t).addClass("selected"),v&&v.html(e(this).html())),e(this).is(":disabled")&&d.eq(t).addClass("disabled")});if(!s.is(".small, .medium, .large, .expand")){s.addClass("open");var r=Foundation.libs.forms;r.hidden_fix.adjust(o),h=r.outerWidth(d)>h?r.outerWidth(d):h,Foundation.libs.forms.hidden_fix.reset(),s.removeClass("open")}},refresh_custom_select:function(t){var n=this,r=0,i=t.next(),s=t.find("option");i.find("ul").html(""),s.each(function(){var t=e("<li>"+e(this).html()+"</li>");i.find("ul").append(t)}),s.each(function(t){this.selected&&(i.find("li").eq(t).addClass("selected"),i.find(".current").html(e(this).html())),e(this).is(":disabled")&&i.find("li").eq(t).addClass("disabled")}),i.removeAttr("style").find("ul").removeAttr("style"),i.find("li").each(function(){i.addClass("open"),n.outerWidth(e(this))>r&&(r=n.outerWidth(e(this))),i.removeClass("open")})},toggle_checkbox:function(e){var t=e.prev(),n=t[0];!1===t.is(":disabled")&&(n.checked=n.checked?!1:!0,e.toggleClass("checked"),t.trigger("change"))},toggle_radio:function(e){var t=e.prev(),n=t.closest("form.custom"),r=t[0];!1===t.is(":disabled")&&(n.find('input[type="radio"][name="'+this.escape(t.attr("name"))+'"]').next().not(e).removeClass("checked"),e.hasClass("checked")||e.toggleClass("checked"),r.checked=e.hasClass("checked"),t.trigger("change"))},escape:function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},hidden_fix:{tmp:[],hidden:null,adjust:function(t){var n=this;n.hidden=t.parents().andSelf().filter(":hidden"),n.hidden.each(function(){var t=e(this);n.tmp.push(t.attr("style")),t.css({visibility:"hidden",display:"block"})})},reset:function(){var t=this;t.hidden.each(function(n){var i=e(this),s=t.tmp[n];s===r?i.removeAttr("style"):i.attr("style",s)}),t.tmp=[],t.hidden=null}},off:function(){e(this.scope).off(".fndtn.forms")}}}(Foundation.zj,this,this.document),function(e,t,n,r){"use strict";Foundation.libs.joyride={name:"joyride",version:"4.0.0",defaults:{tipLocation:"bottom",nubPosition:"auto",scrollSpeed:300,timer:0,startTimerOnClick:!0,startOffset:0,nextButton:!0,tipAnimation:"fade",pauseAfter:[],tipAnimationFadeSpeed:300,cookieMonster:!1,cookieName:"joyride",cookieDomain:!1,cookieExpires:365,tipContainer:"body",postRideCallback:function(){},postStepCallback:function(){},template:{link:'<a href="#close" class="joyride-close-tip">&times;</a>',timer:'<div class="joyride-timer-indicator-wrap"><span class="joyride-timer-indicator"></span></div>',tip:'<div class="joyride-tip-guide"><span class="joyride-nub"></span></div>',wrapper:'<div class="joyride-content-wrapper"></div>',button:'<a href="#" class="small button joyride-next-tip"></a>'}},settings:{},init:function(t,n,r){return this.scope=t||this.scope,Foundation.inherit(this,"throttle data_options scrollTo scrollLeft delay"),typeof n=="object"?e.extend(!0,this.settings,this.defaults,n):e.extend(!0,this.settings,this.defaults,r),typeof n!="string"?(this.settings.init||this.events(),this.settings.init):this[n].call(this,r)},events:function(){var n=this;e(this.scope).on("click.joyride",".joyride-next-tip, .joyride-modal-bg",function(e){e.preventDefault(),this.settings.$li.next().length<1?this.end():this.settings.timer>0?(clearTimeout(this.settings.automate),this.hide(),this.show(),this.startTimer()):(this.hide(),this.show())}.bind(this)).on("click.joyride",".joyride-close-tip",function(e){e.preventDefault(),this.end()}.bind(this)),e(t).on("resize.fndtn.joyride",n.throttle(function(){e("[data-joyride]").length>0&&n.settings.$next_tip&&(n.is_phone()?n.pos_phone():n.pos_default())},100)),this.settings.init=!0},start:function(){var t=this,n=e(this.scope).find("[data-joyride]"),r=["timer","scrollSpeed","startOffset","tipAnimationFadeSpeed","cookieExpires"],i=r.length;this.settings.init||this.init(),this.settings.$content_el=n,this.settings.body_offset=e(this.settings.tipContainer).position(),this.settings.$tip_content=this.settings.$content_el.find("> li"),this.settings.paused=!1,this.settings.attempts=0,this.settings.tipLocationPatterns={top:["bottom"],bottom:[],left:["right","top","bottom"],right:["left","top","bottom"]},typeof e.cookie!="function"&&(this.settings.cookieMonster=!1);if(!this.settings.cookieMonster||this.settings.cookieMonster&&e.cookie(this.settings.cookieName)===null)this.settings.$tip_content.each(function(n){var s=e(this);e.extend(!0,t.settings,t.data_options(s));for(var o=i-1;o>=0;o--)t.settings[r[o]]=parseInt(t.settings[r[o]],10);t.create({$li:s,index:n})}),!this.settings.startTimerOnClick&&this.settings.timer>0?(this.show("init"),this.startTimer()):this.show("init")},resume:function(){this.set_li(),this.show()},tip_template:function(t){var n,r;return t.tip_class=t.tip_class||"",n=e(this.settings.template.tip).addClass(t.tip_class),r=e.trim(e(t.li).html())+this.button_text(t.button_text)+this.settings.template.link+this.timer_instance(t.index),n.append(e(this.settings.template.wrapper)),n.first().attr("data-index",t.index),e(".joyride-content-wrapper",n).append(r),n[0]},timer_instance:function(t){var n;return t===0&&this.settings.startTimerOnClick&&this.settings.timer>0||this.settings.timer===0?n="":n=this.outerHTML(e(this.settings.template.timer)[0]),n},button_text:function(t){return this.settings.nextButton?(t=e.trim(t)||"Next",t=this.outerHTML(e(this.settings.template.button).append(t)[0])):t="",t},create:function(t){var n=t.$li.attr("data-button")||t.$li.attr("data-text"),r=t.$li.attr("class"),i=e(this.tip_template({tip_class:r,index:t.index,button_text:n,li:t.$li}));e(this.settings.tipContainer).append(i)},show:function(t){var n=null;this.settings.$li===r||e.inArray(this.settings.$li.index(),this.settings.pauseAfter)===-1?(this.settings.paused?this.settings.paused=!1:this.set_li(t),this.settings.attempts=0,this.settings.$li.length&&this.settings.$target.length>0?(this.settings.tipSettings=e.extend(this.settings,this.data_options(this.settings.$li)),this.settings.timer=parseInt(this.settings.timer,10),this.settings.tipSettings.tipLocationPattern=this.settings.tipLocationPatterns[this.settings.tipSettings.tipLocation],/body/i.test(this.settings.$target.selector)||this.scroll_to(),this.is_phone()?this.pos_phone(!0):this.pos_default(!0),n=this.settings.$next_tip.find(".joyride-timer-indicator"),/pop/i.test(this.settings.tipAnimation)?(n.width(0),thsi.settings.timer>0?(this.settings.$next_tip.show(),this.delay(function(){n.animate({width:n.parent().width()},this.settings.timer,"linear")}.bind(this),this.settings.tipAnimationFadeSpeed)):this.settings.$next_tip.show()):/fade/i.test(this.settings.tipAnimation)&&(n.width(0),this.settings.timer>0?(this.settings.$next_tip.fadeIn(this.settings.tipAnimationFadeSpeed).show(),this.delay(function(){n.animate({width:n.parent().width()},this.settings.timer,"linear")}.bind(this),this.settings.tipAnimationFadeSpeed)):this.settings.$next_tip.fadeIn(this.settings.tipAnimationFadeSpeed)),this.settings.$current_tip=this.settings.$next_tip):this.settings.$li&&this.settings.$target.length<1?this.show():this.end()):this.settings.paused=!0},is_phone:function(){return Modernizr?Modernizr.mq("only screen and (max-width: 767px)")||e(".lt-ie9").length>0:this.settings.$window.width()<767?!0:!1},hide:function(){this.settings.postStepCallback(this.settings.$li.index(),this.settings.$current_tip),e(".joyride-modal-bg").hide(),this.settings.$current_tip.hide()},set_li:function(e){e?(this.settings.$li=this.settings.$tip_content.eq(this.settings.startOffset),this.set_next_tip(),this.settings.$current_tip=this.settings.$next_tip):(this.settings.$li=this.settings.$li.next(),this.set_next_tip()),this.set_target()},set_next_tip:function(){this.settings.$next_tip=e(".joyride-tip-guide[data-index='"+this.settings.$li.index()+"']"),this.settings.$next_tip.data("closed","")},set_target:function(){var t=this.settings.$li.attr("data-class"),r=this.settings.$li.attr("data-id"),i=function(){return r?e(n.getElementById(r)):t?e("."+t).first():e("body")};this.settings.$target=i()},scroll_to:function(){var n,r;n=e(t).height()/2,r=Math.ceil(this.settings.$target.offset().top-n+this.outerHeight(this.settings.$next_tip)),r>0&&this.scrollTo(e("html, body"),r,this.settings.scrollSpeed)},paused:function(){return e.inArray(this.settings.$li.index()+1,this.settings.pauseAfter)===-1?!0:!1},restart:function(){this.hide(),this.settings.$li=r,this.show("init")},pos_default:function(n){var r=Math.ceil(e(t).height()/2),i=this.settings.$next_tip.offset(),s=this.settings.$next_tip.find(".joyride-nub"),o=Math.ceil(this.outerHeight(s)/2),u=n||!1;u&&(this.settings.$next_tip.css("visibility","hidden"),this.settings.$next_tip.show()),/body/i.test(this.settings.$target.selector)?this.settings.$li.length&&this.pos_modal(s):(this.bottom()?(this.settings.$next_tip.css({top:this.settings.$target.offset().top+o+this.outerHeight(this.settings.$target),left:this.settings.$target.offset().left}),this.nub_position(s,this.settings.tipSettings.nubPosition,"top")):this.top()?(this.settings.$next_tip.css({top:this.settings.$target.offset().top-this.outerHeight(this.settings.$next_tip)-o,left:this.settings.$target.offset().left}),this.nub_position(s,this.settings.tipSettings.nubPosition,"bottom")):this.right()?(this.settings.$next_tip.css({top:this.settings.$target.offset().top,left:this.outerWidth(this.settings.$target)+this.settings.$target.offset().left}),this.nub_position(s,this.settings.tipSettings.nubPosition,"left")):this.left()&&(this.settings.$next_tip.css({top:this.settings.$target.offset().top,left:this.settings.$target.offset().left-this.outerWidth(this.settings.$next_tip)-o}),this.nub_position(s,this.settings.tipSettings.nubPosition,"right")),!this.visible(this.corners(this.settings.$next_tip))&&this.settings.attempts<this.settings.tipSettings.tipLocationPattern.length&&(s.removeClass("bottom").removeClass("top").removeClass("right").removeClass("left"),this.settings.tipSettings.tipLocation=this.settings.tipSettings.tipLocationPattern[this.settings.attempts],this.settings.attempts++,this.pos_default(!0))),u&&(this.settings.$next_tip.hide(),this.settings.$next_tip.css("visibility","visible"))},pos_phone:function(t){var n=this.outerHeight(this.settings.$next_tip),r=this.settings.$next_tip.offset(),i=this.outerHeight(this.settings.$target),s=e(".joyride-nub",this.settings.$next_tip),o=Math.ceil(this.outerHeight(s)/2),u=t||!1;s.removeClass("bottom").removeClass("top").removeClass("right").removeClass("left"),u&&(this.settings.$next_tip.css("visibility","hidden"),this.settings.$next_tip.show()),/body/i.test(this.settings.$target.selector)?this.settings.$li.length&&this.pos_modal(s):this.top()?(this.settings.$next_tip.offset({top:this.settings.$target.offset().top-n-o}),s.addClass("bottom")):(this.settings.$next_tip.offset({top:this.settings.$target.offset().top+i+o}),s.addClass("top")),u&&(this.settings.$next_tip.hide(),this.settings.$next_tip.css("visibility","visible"))},pos_modal:function(t){this.center(),t.hide(),this.settings.$next_tip.data("closed")||(e(".joyride-modal-bg").length<1&&e("body").append('<div class="joyride-modal-bg">').show(),/pop/i.test(this.settings.tipAnimation)?e(".joyride-modal-bg").show():e(".joyride-modal-bg").fadeIn(this.settings.tipAnimationFadeSpeed))},center:function(){var n=e(t);return this.settings.$next_tip.css({top:(n.height()-this.outerHeight(this.settings.$next_tip))/2+n.scrollTop(),left:(n.width()-this.outerWidth(this.settings.$next_tip))/2+this.scrollLeft(n)}),!0},bottom:function(){return/bottom/i.test(this.settings.tipSettings.tipLocation)},top:function(){return/top/i.test(this.settings.tipSettings.tipLocation)},right:function(){return/right/i.test(this.settings.tipSettings.tipLocation)},left:function(){return/left/i.test(this.settings.tipSettings.tipLocation)},corners:function(n){var r=e(t),i=r.width()+this.scrollLeft(r),s=r.width()+r.scrollTop();return[n.offset().top<=r.scrollTop(),i<=n.offset().left+this.outerWidth(n),s<=n.offset().top+this.outerHeight(n),this.scrollLeft(r)>=n.offset().left]},visible:function(e){var t=e.length;while(t--)if(e[t])return!1;return!0},nub_position:function(e,t,n){t==="auto"?e.addClass(n):e.addClass(t)},startTimer:function(){this.settings.$li.length?this.settings.automate=setTimeout(function(){this.hide(),this.show(),this.startTimer()}.bind(this),this.settings.timer):clearTimeout(this.settings.automate)},end:function(){this.settings.cookieMonster&&e.cookie(this.settings.cookieName,"ridden",{expires:this.settings.cookieExpires,domain:this.settings.cookieDomain}),this.settings.timer>0&&clearTimeout(this.settings.automate),this.settings.$next_tip.data("closed",!0),e(".joyride-modal-bg").hide(),this.settings.$current_tip.hide(),this.settings.postStepCallback(this.settings.$li.index(),this.settings.$current_tip),this.settings.postRideCallback(this.settings.$li.index(),this.settings.$current_tip)},outerHTML:function(e){return e.outerHTML||(new XMLSerializer).serializeToString(e)},off:function(){e(this.scope).off(".joyride"),e(t).off(".joyride"),e(".joyride-close-tip, .joyride-next-tip, .joyride-modal-bg").off(".joyride"),e(".joyride-tip-guide, .joyride-modal-bg").remove(),clearTimeout(this.settings.automate),this.settings={}}}}(Foundation.zj,this,this.document),function(e,t,n,r){"use strict";Foundation.libs.magellan={name:"magellan",version:"4.0.0",settings:{activeClass:"active"},init:function(t,n,r){return this.scope=t||this.scope,Foundation.inherit(this,"data_options"),typeof n=="object"&&e.extend(!0,this.settings,n),typeof n!="string"?(this.settings.init||(this.fixed_magellan=
14
- e("[data-magellan-expedition]"),this.set_threshold(),this.last_destination=e("[data-magellan-destination]").last(),this.events()),this.settings.init):this[n].call(this,r)},events:function(){var n=this;e(this.scope).on("arrival.fndtn.magellan","[data-magellan-arrival]",function(t){var r=e(this),i=r.closest("[data-magellan-expedition]"),s=i.attr("data-magellan-active-class")||n.settings.activeClass;r.closest("[data-magellan-expedition]").find("[data-magellan-arrival]").not(r).removeClass(s),r.addClass(s)}),this.fixed_magellan.on("update-position.fndtn.magellan",function(){var t=e(this)}).trigger("update-position"),e(t).on("resize.fndtn.magellan",function(){this.fixed_magellan.trigger("update-position")}.bind(this)).on("scroll.fndtn.magellan",function(){var r=e(t).scrollTop();n.fixed_magellan.each(function(){var t=e(this);typeof t.data("magellan-top-offset")=="undefined"&&t.data("magellan-top-offset",t.offset().top),typeof t.data("magellan-fixed-position")=="undefined"&&t.data("magellan-fixed-position",!1);var i=r+n.settings.threshold>t.data("magellan-top-offset"),s=t.attr("data-magellan-top-offset");t.data("magellan-fixed-position")!=i&&(t.data("magellan-fixed-position",i),i?t.css({position:"fixed",top:0}):t.css({position:"",top:""}),i&&typeof s!="undefined"&&s!=0&&t.css({position:"fixed",top:s+"px"}))})}),this.last_destination.length>0&&e(t).on("scroll.fndtn.magellan",function(r){var i=e(t).scrollTop(),s=i+e(t).height(),o=Math.ceil(n.last_destination.offset().top);e("[data-magellan-destination]").each(function(){var t=e(this),r=t.attr("data-magellan-destination"),u=t.offset().top-i;u<=n.settings.threshold&&e("[data-magellan-arrival='"+r+"']").trigger("arrival"),s>=e(n.scope).height()&&o>i&&o<s&&e("[data-magellan-arrival]").last().trigger("arrival")})}),this.settings.init=!0},set_threshold:function(){this.settings.threshold||(this.settings.threshold=this.fixed_magellan.length>0?this.outerHeight(this.fixed_magellan,!0):0)},off:function(){e(this.scope).off(".fndtn.magellan")}}}(Foundation.zj,this,this.document),function(e,t,n,r){"use strict";Foundation.libs=Foundation.libs||{},Foundation.libs.orbit={name:"orbit",version:"4.0.0",settings:{timer_speed:1e4,animation_speed:500,bullets:!0,stack_on_small:!0,container_class:"orbit-container",stack_on_small_class:"orbit-stack-on-small",next_class:"orbit-next",prev_class:"orbit-prev",timer_container_class:"orbit-timer",timer_paused_class:"paused",timer_progress_class:"orbit-progress",slides_container_class:"orbit-slides-container",bullets_container_class:"orbit-bullets",bullets_active_class:"active",slide_number_class:"orbit-slide-number",caption_class:"orbit-caption",active_slide_class:"active",orbit_transition_class:"orbit-transitioning"},init:function(t,n,r){var i=this;Foundation.inherit(i,"data_options"),typeof n=="object"&&e.extend(!0,i.settings,n),e("[data-orbit]",t).each(function(t,n){var r=e.extend(!0,{},i);r._init(t,n)})},_container_html:function(){var e=this;return'<div class="'+e.settings.container_class+'"></div>'},_bullets_container_html:function(t){var n=this,r=e('<ol class="'+n.settings.bullets_container_class+'"></ol>');return t.each(function(t,i){var s=e('<li data-orbit-slide-number="'+(t+1)+'" class=""></li>');t===0&&s.addClass(n.settings.bullets_active_class),r.append(s)}),r},_slide_number_html:function(t,n){var r=this,i=e('<div class="'+r.settings.slide_number_class+'"></div>');return i.append("<span>"+t+"</span> of <span>"+n+"</span>"),i},_timer_html:function(){var e=this;return typeof e.settings.timer_speed=="number"&&e.settings.timer_speed>0?'<div class="'+e.settings.timer_container_class+'"><span></span><div class="'+e.settings.timer_progress_class+'"></div></div>':""},_next_html:function(){var e=this;return'<a href="#" class="'+e.settings.next_class+'">Next <span></span></a>'},_prev_html:function(){var e=this;return'<a href="#" class="'+e.settings.prev_class+'">Prev <span></span></a>'},_init:function(t,n){var r=this,i=e(n),s=i.wrap(r._container_html()).parent(),o=i.children();e.extend(!0,r.settings,r.data_options(i)),s.append(r._prev_html()),s.append(r._next_html()),i.addClass(r.settings.slides_container_class),r.settings.stack_on_small&&s.addClass(r.settings.stack_on_small_class),s.append(r._slide_number_html(1,o.length)),s.append(r._timer_html()),r.settings.bullets&&s.after(r._bullets_container_html(o)),i.append(o.first().clone().attr("data-orbit-slide","")),i.prepend(o.last().clone().attr("data-orbit-slide","")),i.css("marginLeft","-100%"),o.first().addClass(r.settings.active_slide_class),r._init_events(i),r._init_dimensions(i),r._start_timer(i)},_init_events:function(i){var s=this,o=i.parent();e(t).on("load.fndtn.orbit",function(){i.height(""),i.height(i.height(o.height())),i.trigger("orbit:ready")}).on("resize.fndtn.orbit",function(){i.height(""),i.height(i.height(o.height()))}),e(n).on("click.fndtn.orbit","[data-orbit-link]",function(t){t.preventDefault();var n=e(t.currentTarget).attr("data-orbit-link"),r=i.find("[data-orbit-slide="+n+"]").first();r.length===1&&(s._reset_timer(i,!0),s._goto(i,r.index(),function(){}))}),o.siblings("."+s.settings.bullets_container_class).on("click.fndtn.orbit","[data-orbit-slide-number]",function(t){t.preventDefault(),s._reset_timer(i,!0),s._goto(i,e(t.currentTarget).data("orbit-slide-number"),function(){})}),o.on("orbit:after-slide-change.fndtn.orbit",function(e,t){var n=o.find("."+s.settings.slide_number_class);n.length===1&&n.replaceWith(s._slide_number_html(t.slide_number,t.total_slides))}).on("orbit:next-slide.fndtn.orbit click.fndtn.orbit","."+s.settings.next_class,function(e){e.preventDefault(),s._reset_timer(i,!0),s._goto(i,"next",function(){})}).on("orbit:prev-slide.fndtn.orbit click.fndtn.orbit","."+s.settings.prev_class,function(e){e.preventDefault(),s._reset_timer(i,!0),s._goto(i,"prev",function(){})}).on("orbit:toggle-play-pause.fndtn.orbit click.fndtn.orbit touchstart.fndtn.orbit","."+s.settings.timer_container_class,function(t){t.preventDefault();var n=e(t.currentTarget).toggleClass(s.settings.timer_paused_class),r=n.closest("."+s.settings.container_class).find("."+s.settings.slides_container_class);n.hasClass(s.settings.timer_paused_class)?s._stop_timer(r):s._start_timer(r)}).on("touchstart.fndtn.orbit",function(e){e.touches||(e=e.originalEvent);var t={start_page_x:e.touches[0].pageX,start_page_y:e.touches[0].pageY,start_time:(new Date).getTime(),delta_x:0,is_scrolling:r};o.data("swipe-transition",t),e.stopPropagation()}).on("touchmove.fndtn.orbit",function(e){e.touches||(e=e.originalEvent);if(e.touches.length>1||e.scale&&e.scale!==1)return;var t=o.data("swipe-transition");typeof t=="undefined"&&(t={}),t.delta_x=e.touches[0].pageX-t.start_page_x,typeof t.is_scrolling=="undefined"&&(t.is_scrolling=!!(t.is_scrolling||Math.abs(t.delta_x)<Math.abs(e.touches[0].pageY-t.start_page_y)));if(!t.is_scrolling&&!t.active){e.preventDefault(),s._stop_timer(i);var n=t.delta_x<0?"next":"prev";t.active=!0,s._goto(i,n,function(){})}}).on("touchend.fndtn.orbit",function(e){o.data("swipe-transition",{}),e.stopPropagation()})},_init_dimensions:function(e){var t=e.parent(),n=e.children();e.css("width",n.length*100+"%"),n.css("width",100/n.length+"%"),e.height(t.height()),e.css("width",n.length*100+"%")},_start_timer:function(e){var t=this,n=e.parent(),r=function(){t._reset_timer(e,!1),t._goto(e,"next",function(){t._start_timer(e)})},i=n.find("."+t.settings.timer_container_class),s=i.find("."+t.settings.timer_progress_class),o=s.width()/i.width(),u=t.settings.timer_speed-o*t.settings.timer_speed;s.animate({width:"100%"},u,"linear",r),e.trigger("orbit:timer-started")},_stop_timer:function(e){var t=this,n=e.parent(),r=n.find("."+t.settings.timer_container_class),i=r.find("."+t.settings.timer_progress_class),s=i.width()/r.width();t._rebuild_timer(n,s*100+"%"),e.trigger("orbit:timer-stopped"),r=n.find("."+t.settings.timer_container_class),r.addClass(t.settings.timer_paused_class)},_reset_timer:function(e,t){var n=this,r=e.parent();n._rebuild_timer(r,"0%");if(typeof t=="boolean"&&t){var i=r.find("."+n.settings.timer_container_class);i.addClass(n.settings.timer_paused_class)}},_rebuild_timer:function(t,n){var r=this,i=t.find("."+r.settings.timer_container_class),s=e(r._timer_html()),o=s.find("."+r.settings.timer_progress_class);if(typeof Zepto=="function")i.remove(),t.append(s),o.css("width",n);else if(typeof jQuery=="function"){var u=i.find("."+r.settings.timer_progress_class);u.css("width",n),u.stop()}},_goto:function(t,n,r){var i=this,s=t.parent(),o=t.children(),u=t.find("."+i.settings.active_slide_class),a=u.index();if(s.hasClass(i.settings.orbit_transition_class))return!1;n==="prev"?a===0?a=o.length-1:a--:n==="next"?a=(a+1)%o.length:typeof n=="number"&&(a=n%o.length),a===o.length-1&&n==="next"?(t.css("marginLeft","0%"),a=1):a===0&&n==="prev"&&(t.css("marginLeft","-"+(o.length-1)*100+"%"),a=o.length-2),s.addClass(i.settings.orbit_transition_class),u.removeClass(i.settings.active_slide_class),e(o[a]).addClass(i.settings.active_slide_class);var f=s.siblings("."+i.settings.bullets_container_class);f.length===1&&(f.children().removeClass(i.settings.bullets_active_class),e(f.children()[a-1]).addClass(i.settings.bullets_active_class));var l="-"+a*100+"%";t.trigger("orbit:before-slide-change"),t.css("marginLeft")===l?(s.removeClass(i.settings.orbit_transition_class),t.trigger("orbit:after-slide-change",[{slide_number:a,total_slides:t.children().length-2}]),r()):t.animate({marginLeft:l},i.settings.animation_speed,"linear",function(){s.removeClass(i.settings.orbit_transition_class),t.trigger("orbit:after-slide-change",[{slide_number:a,total_slides:t.children().length-2}]),r()})}}}(Foundation.zj,this,this.document),function(e,t,n){function f(e){var t={},r=/^jQuery\d+$/;return n.each(e.attributes,function(e,n){n.specified&&!r.test(n.name)&&(t[n.name]=n.value)}),t}function l(e,r){var i=this,s=n(i);if(i.value==s.attr("placeholder")&&s.hasClass("placeholder"))if(s.data("placeholder-password")){s=s.hide().next().show().attr("id",s.removeAttr("id").data("placeholder-id"));if(e===!0)return s[0].value=r;s.focus()}else i.value="",s.removeClass("placeholder"),i==t.activeElement&&i.select()}function c(){var e,t=this,r=n(t),i=r,s=this.id;if(t.value==""){if(t.type=="password"){if(!r.data("placeholder-textinput")){try{e=r.clone().attr({type:"text"})}catch(o){e=n("<input>").attr(n.extend(f(this),{type:"text"}))}e.removeAttr("name").data({"placeholder-password":!0,"placeholder-id":s}).bind("focus.placeholder",l),r.data({"placeholder-textinput":e,"placeholder-id":s}).before(e)}r=r.removeAttr("id").hide().prev().attr("id",s).show()}r.addClass("placeholder"),r[0].value=r.attr("placeholder")}else r.removeClass("placeholder")}var r="placeholder"in t.createElement("input"),i="placeholder"in t.createElement("textarea"),s=n.fn,o=n.valHooks,u,a;r&&i?(a=s.placeholder=function(){return this},a.input=a.textarea=!0):(a=s.placeholder=function(){var e=this;return e.filter((r?"textarea":":input")+"[placeholder]").not(".placeholder").bind({"focus.placeholder":l,"blur.placeholder":c}).data("placeholder-enabled",!0).trigger("blur.placeholder"),e},a.input=r,a.textarea=i,u={get:function(e){var t=n(e);return t.data("placeholder-enabled")&&t.hasClass("placeholder")?"":e.value},set:function(e,r){var i=n(e);return i.data("placeholder-enabled")?(r==""?(e.value=r,e!=t.activeElement&&c.call(e)):i.hasClass("placeholder")?l.call(e,!0,r)||(e.value=r):e.value=r,i):e.value=r}},r||(o.input=u),i||(o.textarea=u),n(function(){n(t).delegate("form","submit.placeholder",function(){var e=n(".placeholder",this).each(l);setTimeout(function(){e.each(c)},10)})}),n(e).bind("beforeunload.placeholder",function(){n(".placeholder").each(function(){this.value=""})}))}(this,document,Foundation.zj),function(e,t,n,r){"use strict";Foundation.libs.reveal={name:"reveal",version:"4.0.9",locked:!1,settings:{animation:"fadeAndPop",animationSpeed:250,closeOnBackgroundClick:!0,dismissModalClass:"close-reveal-modal",bgClass:"reveal-modal-bg",open:function(){},opened:function(){},close:function(){},closed:function(){},bg:e(".reveal-modal-bg"),css:{open:{opacity:0,visibility:"visible",display:"block"},close:{opacity:1,visibility:"hidden",display:"none"}}},init:function(t,n,r){return this.scope=t||this.scope,Foundation.inherit(this,"data_options delay"),typeof n=="object"&&e.extend(!0,this.settings,n),typeof n!="string"?(this.events(),this.settings.init):this[n].call(this,r)},events:function(){var t=this;return e(this.scope).off(".fndtn.reveal").on("click.fndtn.reveal","[data-reveal-id]",function(n){n.preventDefault(),t.locked||(t.locked=!0,t.open.call(t,e(this)))}).on("click.fndtn.reveal touchend.click.fndtn.reveal",this.close_targets(),function(n){n.preventDefault(),t.locked||(t.locked=!0,t.close.call(t,e(this).closest(".reveal-modal")))}).on("open.fndtn.reveal",".reveal-modal",this.settings.open).on("opened.fndtn.reveal",".reveal-modal",this.settings.opened).on("opened.fndtn.reveal",".reveal-modal",this.open_video).on("close.fndtn.reveal",".reveal-modal",this.settings.close).on("closed.fndtn.reveal",".reveal-modal",this.settings.closed).on("closed.fndtn.reveal",".reveal-modal",this.close_video),!0},open:function(t){if(t)var n=e("#"+t.data("reveal-id"));else var n=e(this.scope);if(!n.hasClass("open")){var r=e(".reveal-modal.open");typeof n.data("css-top")=="undefined"&&n.data("css-top",parseInt(n.css("top"),10)).data("offset",this.cache_offset(n)),n.trigger("open"),r.length<1&&this.toggle_bg(n),this.hide(r,this.settings.css.open),this.show(n,this.settings.css.open)}},close:function(t){var t=t||e(this.scope),n=e(".reveal-modal.open");n.length>0&&(this.locked=!0,t.trigger("close"),this.toggle_bg(t),this.hide(n,this.settings.css.close))},close_targets:function(){var e="."+this.settings.dismissModalClass;return this.settings.closeOnBackgroundClick?e+", ."+this.settings.bgClass:e},toggle_bg:function(t){e(".reveal-modal-bg").length===0&&(this.settings.bg=e("<div />",{"class":this.settings.bgClass}).insertAfter(t)),this.settings.bg.filter(":visible").length>0?this.hide(this.settings.bg):this.show(this.settings.bg)},show:function(n,r){if(r){if(/pop/i.test(this.settings.animation)){r.top=e(t).scrollTop()-n.data("offset")+"px";var i={top:e(t).scrollTop()+n.data("css-top")+"px",opacity:1};return this.delay(function(){return n.css(r).animate(i,this.settings.animationSpeed,"linear",function(){this.locked=!1,n.trigger("opened")}.bind(this)).addClass("open")}.bind(this),this.settings.animationSpeed/2)}if(/fade/i.test(this.settings.animation)){var i={opacity:1};return this.delay(function(){return n.css(r).animate(i,this.settings.animationSpeed,"linear",function(){this.locked=!1,n.trigger("opened")}.bind(this)).addClass("open")}.bind(this),this.settings.animationSpeed/2)}return n.css(r).show().css({opacity:1}).addClass("open").trigger("opened")}return/fade/i.test(this.settings.animation)?n.fadeIn(this.settings.animationSpeed/2):n.show()},hide:function(n,r){if(r){if(/pop/i.test(this.settings.animation)){var i={top:-e(t).scrollTop()-n.data("offset")+"px",opacity:0};return this.delay(function(){return n.animate(i,this.settings.animationSpeed,"linear",function(){this.locked=!1,n.css(r).trigger("closed")}.bind(this)).removeClass("open")}.bind(this),this.settings.animationSpeed/2)}if(/fade/i.test(this.settings.animation)){var i={opacity:0};return this.delay(function(){return n.animate(i,this.settings.animationSpeed,"linear",function(){this.locked=!1,n.css(r).trigger("closed")}.bind(this)).removeClass("open")}.bind(this),this.settings.animationSpeed/2)}return n.hide().css(r).removeClass("open").trigger("closed")}return/fade/i.test(this.settings.animation)?n.fadeOut(this.settings.animationSpeed/2):n.hide()},close_video:function(t){var n=e(this).find(".flex-video"),r=n.find("iframe");r.length>0&&(r.attr("data-src",r[0].src),r.attr("src","about:blank"),n.fadeOut(100).hide())},open_video:function(t){var n=e(this).find(".flex-video"),r=n.find("iframe");if(r.length>0){var i=r.attr("data-src");typeof i=="string"&&(r[0].src=r.attr("data-src")),n.show().fadeIn(100)}},cache_offset:function(e){var t=e.show().height()+parseInt(e.css("top"),10);return e.hide(),t},off:function(){e(this.scope).off(".fndtn.reveal")}}}(Foundation.zj,this,this.document),function(e,t,n,r){"use strict";Foundation.libs.section={name:"section",version:"4.0.9",settings:{deep_linking:!1,one_up:!0,callback:function(){}},init:function(e,t,n){var r=this;return this.scope=e||this.scope,Foundation.inherit(this,"throttle data_options"),typeof t!="string"?(this.set_active_from_hash(),this.events(),!0):this[t].call(this,n)},events:function(){var r=this;e(this.scope).on("click.fndtn.section","[data-section] .title",function(t){var n=e(this),i=n.closest("[data-section]");r.toggle_active.call(this,t,r)}),e(t).on("resize.fndtn.section",r.throttle(function(){r.resize.call(this)},30)).on("hashchange",function(){r.settings.toggled||(r.set_active_from_hash(),e(this).trigger("resize"))}).trigger("resize"),e(n).on("click.fndtn.section",function(t){e(t.target).closest(".title").length<1&&e('[data-section="vertical-nav"], [data-section="horizontal-nav"]').find("section, .section").removeClass("active").attr("style","")})},toggle_active:function(t,n){var r=e(this),i=r.closest("section, .section"),s=i.find(".content"),o=i.closest("[data-section]"),n=Foundation.libs.section,u=e.extend({},n.settings,n.data_options(o));n.settings.toggled=!0,!u.deep_linking&&s.length>0&&t.preventDefault();if(i.hasClass("active"))(n.small(o)||n.is_vertical(o)||n.is_horizontal(o)||n.is_accordion(o))&&i.removeClass("active").attr("style","");else{var a=null,f=n.outerHeight(i.find(".title"));if(n.small(o)||u.one_up)a=r.closest("[data-section]").find("section.active, .section.active"),n.small(o)?a.attr("style",""):a.attr("style","visibility: hidden; padding-top: "+f+"px;");n.small(o)?i.attr("style",""):i.css("padding-top",f),i.addClass("active"),a!==null&&a.removeClass("active").attr("style","")}setTimeout(function(){n.settings.toggled=!1},300),u.callback()},resize:function(){var t=e("[data-section]"),n=Foundation.libs.section;t.each(function(){var t=e(this),r=t.find("section.active, .section.active"),i=e.extend({},n.settings,n.data_options(t));if(r.length>1)r.not(":first").removeClass("active").attr("style","");else if(r.length<1&&!n.is_vertical(t)&&!n.is_horizontal(t)&&!n.is_accordion(t)){var s=t.find("section, .section").first();s.addClass("active"),n.small(t)?s.attr("style",""):s.css("padding-top",n.outerHeight(s.find(".title")))}n.small(t)?r.attr("style",""):r.css("padding-top",n.outerHeight(r.find(".title"))),n.position_titles(t),n.is_horizontal(t)&&!n.small(t)?n.position_content(t):n.position_content(t,!1)})},is_vertical:function(e){return/vertical-nav/i.test(e.data("section"))},is_horizontal:function(e){return/horizontal-nav/i.test(e.data("section"))},is_accordion:function(e){return/accordion/i.test(e.data("section"))},is_tabs:function(e){return/tabs/i.test(e.data("section"))},set_active_from_hash:function(){var n=t.location.hash.substring(1),r=e("[data-section]"),i=this;r.each(function(){var t=e(this),r=e.extend({},i.settings,i.data_options(t));n.length>0&&r.deep_linking&&(t.find("section, .section").attr("style","").removeClass("active"),t.find('.content[data-slug="'+n+'"]').closest("section, .section").addClass("active"))})},position_titles:function(t,n){var r=t.find(".title"),i=0,s=this;typeof n=="boolean"?r.attr("style",""):r.each(function(){e(this).css("left",i),i+=s.outerWidth(e(this))})},position_content:function(t,n){var r=t.find(".title"),i=t.find(".content"),s=this;typeof n=="boolean"?(i.attr("style",""),t.attr("style","")):(t.find("section, .section").each(function(){var t=e(this).find(".title"),n=e(this).find(".content");n.css({left:t.position().left-1,top:s.outerHeight(t)-2})}),typeof Zepto=="function"?t.height(this.outerHeight(r.first())):t.height(this.outerHeight(r.first())-2))},small:function(t){var n=e.extend({},this.settings,this.data_options(t));return this.is_tabs(t)?!1:t&&this.is_accordion(t)?!0:e("html").hasClass("lt-ie9")?!0:e("html").hasClass("ie8compat")?!0:e(this.scope).width()<768},off:function(){e(this.scope).off(".fndtn.section"),e(t).off(".fndtn.section"),e(n).off(".fndtn.section")}}}(Foundation.zj,this,this.document),function(e,t,n,r){"use strict";Foundation.libs.tooltips={name:"tooltips",version:"4.0.2",settings:{selector:".has-tip",additionalInheritableClasses:[],tooltipClass:".tooltip",tipTemplate:function(e,t){return'<span data-selector="'+e+'" class="'+Foundation.libs.tooltips.settings.tooltipClass.substring(1)+'">'+t+'<span class="nub"></span></span>'}},cache:{},init:function(t,n,r){var i=this;this.scope=t||this.scope,typeof n=="object"&&e.extend(!0,this.settings,n);if(typeof n=="string")return this[n].call(this,r);Modernizr.touch?e(this.scope).on("click.fndtn.tooltip touchstart.fndtn.tooltip touchend.fndtn.tooltip","[data-tooltip]",function(t){t.preventDefault(),e(i.settings.tooltipClass).hide(),i.showOrCreateTip(e(this))}).on("click.fndtn.tooltip touchstart.fndtn.tooltip touchend.fndtn.tooltip",this.settings.tooltipClass,function(t){t.preventDefault(),e(this).fadeOut(150)}):e(this.scope).on("mouseenter.fndtn.tooltip mouseleave.fndtn.tooltip","[data-tooltip]",function(t){var n=e(this);t.type==="mouseover"||t.type==="mouseenter"?i.showOrCreateTip(n):(t.type==="mouseout"||t.type==="mouseleave")&&i.hide(n)})},showOrCreateTip:function(e){var t=this.getTip(e);return t&&t.length>0?this.show(e):this.create(e)},getTip:function(t){var n=this.selector(t),r=null;return n&&(r=e("span[data-selector="+n+"]"+this.settings.tooltipClass)),typeof r=="object"?r:!1},selector:function(e){var t=e.attr("id"),n=e.attr("data-tooltip")||e.attr("data-selector");return(t&&t.length<1||!t)&&typeof n!="string"&&(n="tooltip"+Math.random().toString(36).substring(7),e.attr("data-selector",n)),t&&t.length>0?t:n},create:function(t){var n=e(this.settings.tipTemplate(this.selector(t),e("<div>").html(t.attr("title")).html())),r=this.inheritable_classes(t);n.addClass(r).appendTo("body"),Modernizr.touch&&n.append('<span class="tap-to-close">tap to close </span>'),t.removeAttr("title").attr("title",""),this.show(t)},reposition:function(n,r,i){var s,o,u,a,f,l;r.css("visibility","hidden").show(),s=n.data("width"),o=r.children(".nub"),u=this.outerHeight(o),a=this.outerHeight(o),l=function(e,t,n,r,i,s){return e.css({top:t?t:"auto",bottom:r?r:"auto",left:i?i:"auto",right:n?n:"auto",width:s?s:"auto"}).end()},l(r,n.offset().top+this.outerHeight(n)+10,"auto","auto",n.offset().left,s),e(t).width()<767?(l(r,n.offset().top+this.outerHeight(n)+10,"auto","auto",12.5,e(this.scope).width()),r.addClass("tip-override"),l(o,-u,"auto","auto",n.offset().left)):(l(r,n.offset().top+this.outerHeight(n)+10,"auto","auto",n.offset().left,s),r.removeClass("tip-override"),i&&i.indexOf("tip-top")>-1?l(r,n.offset().top-this.outerHeight(r),"auto","auto",n.offset().left,s).removeClass("tip-override"):i&&i.indexOf("tip-left")>-1?l(r,n.offset().top+this.outerHeight(n)/2-u*2.5,"auto","auto",n.offset().left-this.outerWidth(r)-u,s).removeClass("tip-override"):i&&i.indexOf("tip-right")>-1&&l(r,n.offset().top+this.outerHeight(n)/2-u*2.5,"auto","auto",n.offset().left+this.outerWidth(n)+u,s).removeClass("tip-override")),r.css("visibility","visible").hide()},inheritable_classes:function(t){var n=["tip-top","tip-left","tip-bottom","tip-right","noradius"].concat(this.settings.additionalInheritableClasses),r=t.attr("class"),i=r?e.map(r.split(" "),function(t,r){if(e.inArray(t,n)!==-1)return t}).join(" "):"";return e.trim(i)},show:function(e){var t=this.getTip(e);this.reposition(e,t,e.attr("class")),t.fadeIn(150)},hide:function(e){var t=this.getTip(e);t.fadeOut(150)},reload:function(){var t=e(this);return t.data("fndtn-tooltips")?t.foundationTooltips("destroy").foundationTooltips("init"):t.foundationTooltips("init")},off:function(){e(this.scope).off(".fndtn.tooltip"),e(this.settings.tooltipClass).each(function(t){e("[data-tooltip]").get(t).attr("title",e(this).text())}).remove()}}}(Foundation.zj,this,this.document),function(e,t,n,r){"use strict";Foundation.libs.topbar={name:"topbar",version:"4.0.0",settings:{index:0,stickyClass:"sticky",custom_back_text:!0,back_text:"Back",init:!1},init:function(n,r,i){var s=this;return this.scope=n||this.scope,typeof r=="object"&&e.extend(!0,this.settings,r),typeof r!="string"?(e(".top-bar").each(function(){s.settings.$w=e(t),s.settings.$topbar=e(this),s.settings.$section=s.settings.$topbar.find("section"),s.settings.$titlebar=s.settings.$topbar.children("ul").first(),s.settings.$topbar.data("index",0);var n=e("<div class='top-bar-js-breakpoint'/>").insertAfter(s.settings.$topbar);s.settings.breakPoint=n.width(),n.remove(),s.assemble(),s.settings.$topbar.parent().hasClass("fixed")&&e("body").css("padding-top",s.outerHeight(s.settings.$topbar))}),s.settings.init||this.events(),this.settings.init):this[r].call(this,i)},events:function(){var n=this,r=this.outerHeight(e(".top-bar"));e(this.scope).on("click.fndtn.topbar",".top-bar .toggle-topbar",function(i){var s=e(this).closest(".top-bar"),o=s.find("section, .section"),u=s.children("ul").first();s.data("height")||n.largestUL(),i.preventDefault(),n.breakpoint()&&s.toggleClass("expanded").css("min-height",""),s.hasClass("expanded")||(o.css({left:"0%"}),o.find(">.name").css({left:"100%"}),o.find("li.moved").removeClass("moved"),s.data("index",0)),s.parent().hasClass("fixed")?(s.parent().removeClass("fixed"),e("body").css("padding-top","0"),t.scrollTo(0)):s.hasClass("fixed expanded")&&(s.parent().addClass("fixed"),e("body").css("padding-top",r))}).on("click.fndtn.topbar",".top-bar .has-dropdown>a",function(t){var r=e(this).closest(".top-bar"),i=r.find("section, .section"),s=r.children("ul").first();(Modernizr.touch||n.breakpoint())&&t.preventDefault();if(n.breakpoint()){var o=e(this),u=o.closest("li");r.data("index",r.data("index")+1),u.addClass("moved"),i.css({left:-(100*r.data("index"))+"%"}),i.find(">.name").css({left:100*r.data("index")+"%"}),o.siblings("ul").height(r.data("height")+n.outerHeight(s,!0)),r.css("min-height",r.data("height")+n.outerHeight(s,!0)*2)}}),e(t).on("resize.fndtn.topbar",function(){this.breakpoint()||e(".top-bar").css("min-height","")}.bind(this)),e(this.scope).on("click.fndtn",".top-bar .has-dropdown .back",function(t){t.preventDefault();var n=e(this),r=n.closest(".top-bar"),i=r.find("section, .section"),s=n.closest("li.moved"),o=s.parent();r.data("index",r.data("index")-1),i.css({left:-(100*r.data("index"))+"%"}),i.find(">.name").css({left:100*r.data("index")+"%"}),r.data("index")===0&&r.css("min-height",0),setTimeout(function(){s.removeClass("moved")},300)})},breakpoint:function(){return e(t).width()<=this.settings.breakPoint||e("html").hasClass("lt-ie9")},assemble:function(){var t=this;this.settings.$section.detach(),this.settings.$section.find(".has-dropdown>a").each(function(){var n=e(this),r=n.siblings(".dropdown"),i=e('<li class="title back js-generated"><h5><a href="#"></a></h5></li>');t.settings.custom_back_text==1?i.find("h5>a").html("&laquo; "+t.settings.back_text):i.find("h5>a").html("&laquo; "+n.html()),r.prepend(i)}),this.settings.$section.appendTo(this.settings.$topbar),this.sticky()},largestUL:function(){var t=this.settings.$topbar.find("section ul ul"),n=t.first(),r=0,i=this;t.each(function(){e(this).children("li").length>n.children("li").length&&(n=e(this))}),n.children("li").each(function(){r+=i.outerHeight(e(this),!0)}),this.settings.$topbar.data("height",r)},sticky:function(){var n="."+this.settings.stickyClass;if(e(n).length>0){var r=e(n).length?e(n).offset().top:0,i=e(t),s=this.outerHeight(e(".top-bar"));i.scroll(function(){i.scrollTop()>=r?(e(n).addClass("fixed"),e("body").css("padding-top",s)):i.scrollTop()<r&&(e(n).removeClass("fixed"),e("body").css("padding-top","0"))})}},off:function(){e(this.scope).off(".fndtn.topbar"),e(t).off(".fndtn.topbar")}}}(Foundation.zj,this,this.document);
1
+ var libFuncName=null;if(typeof jQuery==="undefined"&&typeof Zepto==="undefined"&&typeof $==="function"){libFuncName=$;}else{if(typeof jQuery==="function"){libFuncName=jQuery;
2
+ }else{if(typeof Zepto==="function"){libFuncName=Zepto;}else{throw new TypeError();}}}(function(c,b,a,d){b.matchMedia=b.matchMedia||(function(i,j){var g,e=i.documentElement,f=e.firstElementChild||e.firstChild,h=i.createElement("body"),k=i.createElement("div");
3
+ k.id="mq-test-1";k.style.cssText="position:absolute;top:-100em";h.style.background="none";h.appendChild(k);return function(l){k.innerHTML='&shy;<style media="'+l+'"> #mq-test-1 { width: 42px; }</style>';
4
+ e.insertBefore(h,f);g=k.offsetWidth===42;e.removeChild(h);return{matches:g,media:l};};}(a));if(!Array.prototype.filter){Array.prototype.filter=function(f){if(this==null){throw new TypeError();
5
+ }var k=Object(this),e=k.length>>>0;if(typeof f!="function"){return;}var j=[],h=arguments[1];for(var g=0;g<e;g++){if(g in k){var l=k[g];if(f&&f.call(h,l,g,k)){j.push(l);
6
+ }}}return j;};}if(!Function.prototype.bind){Function.prototype.bind=function(e){if(typeof this!=="function"){throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
7
+ }var i=Array.prototype.slice.call(arguments,1),h=this,f=function(){},g=function(){return h.apply(this instanceof f&&e?this:e,i.concat(Array.prototype.slice.call(arguments)));
8
+ };f.prototype=this.prototype;g.prototype=new f();return g;};}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(g){if(this==null){throw new TypeError();
9
+ }var h=Object(this);var e=h.length>>>0;if(e===0){return -1;}var i=0;if(arguments.length>1){i=Number(arguments[1]);if(i!=i){i=0;}else{if(i!=0&&i!=Infinity&&i!=-Infinity){i=(i>0||-1)*Math.floor(Math.abs(i));
10
+ }}}if(i>=e){return -1;}var f=i>=0?i:Math.max(e-Math.abs(i),0);for(;f<e;f++){if(f in h&&h[f]===g){return f;}}return -1;};}c.fn.stop=c.fn.stop||function(){return this;
11
+ };b.Foundation={name:"Foundation",version:"4.2.0",cache:{},init:function(o,l,e,p,f,h){var j,m=[o,e,p,f],k=[],h=h||false;if(h){this.nc=h;}this.rtl=/rtl/i.test(c("html").attr("dir"));
12
+ this.scope=o||this.scope;if(l&&typeof l==="string"&&!/reflow/i.test(l)){if(/off/i.test(l)){return this.off();}j=l.split(" ");if(j.length>0){for(var g=j.length-1;
13
+ g>=0;g--){k.push(this.init_lib(j[g],m));}}}else{if(/reflow/i.test(l)){m[1]="reflow";}for(var n in this.libs){k.push(this.init_lib(n,m));}}if(typeof l==="function"){m.unshift(l);
14
+ }return this.response_obj(k,m);},response_obj:function(f,g){for(var h=0,e=g.length;h<e;h++){if(typeof g[h]==="function"){return g[h]({errors:f.filter(function(i){if(typeof i==="string"){return i;
15
+ }})});}}return f;},init_lib:function(f,e){return this.trap(function(){if(this.libs.hasOwnProperty(f)){this.patch(this.libs[f]);return this.libs[f].init.apply(this.libs[f],e);
16
+ }else{return function(){};}}.bind(this),f);},trap:function(f,h){if(!this.nc){try{return f();}catch(g){return this.error({name:h,message:"could not be initialized",more:g.name+" "+g.message});
17
+ }}return f();},patch:function(e){this.fix_outer(e);e.scope=this.scope;e.rtl=this.rtl;},inherit:function(h,f){var e=f.split(" ");for(var g=e.length-1;g>=0;
18
+ g--){if(this.lib_methods.hasOwnProperty(e[g])){this.libs[h.name][e[g]]=this.lib_methods[e[g]];}}},random_str:function(g){var f="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".split("");
19
+ if(!g){g=Math.floor(Math.random()*f.length);}var h="";for(var e=0;e<g;e++){h+=f[Math.floor(Math.random()*f.length)];}return h;},libs:{},lib_methods:{set_data:function(e,f){var g=[this.name,+new Date(),Foundation.random_str(5)].join("-");
20
+ Foundation.cache[g]=f;e.attr("data-"+this.name+"-id",g);return f;},get_data:function(e){return Foundation.cache[e.attr("data-"+this.name+"-id")];},remove_data:function(e){if(e){delete Foundation.cache[e.attr("data-"+this.name+"-id")];
21
+ e.attr("data-"+this.name+"-id","");}else{c("[data-"+this.name+"-id]").each(function(){delete Foundation.cache[c(this).attr("data-"+this.name+"-id")];c(this).attr("data-"+this.name+"-id","");
22
+ });}},throttle:function(e,f){var g=null;return function(){var i=this,h=arguments;clearTimeout(g);g=setTimeout(function(){e.apply(i,h);},f);};},data_options:function(j){var k={},i,l,h=(j.attr("data-options")||":").split(";"),g=h.length;
23
+ function f(m){return !isNaN(m-0)&&m!==null&&m!==""&&m!==false&&m!==true;}function e(m){if(typeof m==="string"){return c.trim(m);}return m;}for(i=g-1;i>=0;
24
+ i--){l=h[i].split(":");if(/true/i.test(l[1])){l[1]=true;}if(/false/i.test(l[1])){l[1]=false;}if(f(l[1])){l[1]=parseInt(l[1],10);}if(l.length===2&&l[0].length>0){k[e(l[0])]=e(l[1]);
25
+ }}return k;},delay:function(e,f){return setTimeout(e,f);},scrollTo:function(f,i,g){if(g<0){return;}var h=i-c(b).scrollTop();var e=h/g*10;this.scrollToTimerCache=setTimeout(function(){if(!isNaN(parseInt(e,10))){b.scrollTo(0,c(b).scrollTop()+e);
26
+ this.scrollTo(f,i,g-10);}}.bind(this),10);},scrollLeft:function(e){if(!e.length){return;}return("scrollLeft" in e[0])?e[0].scrollLeft:e[0].pageXOffset;
27
+ },empty:function(f){if(f.length&&f.length>0){return false;}if(f.length&&f.length===0){return true;}for(var e in f){if(hasOwnProperty.call(f,e)){return false;
28
+ }}return true;}},fix_outer:function(e){e.outerHeight=function(g,f){if(typeof Zepto==="function"){return g.height();}if(typeof f!=="undefined"){return g.outerHeight(f);
29
+ }return g.outerHeight();};e.outerWidth=function(f){if(typeof Zepto==="function"){return f.width();}if(typeof bool!=="undefined"){return f.outerWidth(bool);
30
+ }return f.outerWidth();};},error:function(e){return e.name+" "+e.message+"; "+e.more;},off:function(){c(this.scope).off(".fndtn");c(b).off(".fndtn");return true;
31
+ },zj:function(){if(typeof Zepto!=="undefined"){return Zepto;}else{return jQuery;}}()};c.fn.foundation=function(){var e=Array.prototype.slice.call(arguments,0);
32
+ return this.each(function(){Foundation.init.apply(Foundation,[this].concat(e));return this;});};}(libFuncName,this,this.document));
@@ -45,6 +45,8 @@
45
45
 
46
46
  off : function () {
47
47
  $(this.scope).off('.fndtn.alerts');
48
- }
48
+ },
49
+
50
+ reflow : function () {}
49
51
  };
50
- }(Foundation.zj, this, this.document));
52
+ }(Foundation.zj, this, this.document));
@@ -6,14 +6,14 @@
6
6
  Foundation.libs.clearing = {
7
7
  name : 'clearing',
8
8
 
9
- version : '4.0.0',
9
+ version : '4.1.3',
10
10
 
11
11
  settings : {
12
12
  templates : {
13
13
  viewing : '<a href="#" class="clearing-close">&times;</a>' +
14
14
  '<div class="visible-img" style="display: none"><img src="//:0">' +
15
- '<p class="clearing-caption"></p><a href="#" class="clearing-main-left"><span></span></a>' +
16
- '<a href="#" class="clearing-main-right"><span></span></a></div>'
15
+ '<p class="clearing-caption"></p><a href="#" class="clearing-main-prev"><span></span></a>' +
16
+ '<a href="#" class="clearing-main-next"><span></span></a></div>'
17
17
  },
18
18
 
19
19
  // comma delimited list of selectors that, on click, will close clearing,
@@ -26,8 +26,8 @@
26
26
  },
27
27
 
28
28
  init : function (scope, method, options) {
29
- this.scope = this.scope || scope;
30
- Foundation.inherit(this, 'set_data get_data remove_data throttle');
29
+ var self = this;
30
+ Foundation.inherit(this, 'set_data get_data remove_data throttle data_options');
31
31
 
32
32
  if (typeof method === 'object') {
33
33
  options = $.extend(true, this.settings, method);
@@ -35,15 +35,15 @@
35
35
 
36
36
  if (typeof method != 'string') {
37
37
  $(this.scope).find('ul[data-clearing]').each(function () {
38
- var self = Foundation.libs.clearing,
39
- $el = $(this),
38
+ var $el = $(this),
40
39
  options = options || {},
40
+ lis = $el.find('li'),
41
41
  settings = self.get_data($el);
42
42
 
43
- if (!settings) {
43
+ if (!settings && lis.length > 0) {
44
44
  options.$parent = $el.parent();
45
45
 
46
- self.set_data($el, $.extend(true, self.settings, options));
46
+ self.set_data($el, $.extend({}, self.settings, options, self.data_options($el)));
47
47
 
48
48
  self.assemble($el.find('li'));
49
49
 
@@ -70,19 +70,30 @@
70
70
  function (e, current, target) {
71
71
  var current = current || $(this),
72
72
  target = target || current,
73
- settings = self.get_data(current.parent());
73
+ next = current.next('li'),
74
+ settings = self.get_data(current.parent()),
75
+ image = $(e.target);
74
76
 
75
77
  e.preventDefault();
76
78
  if (!settings) self.init();
77
79
 
80
+ // if clearing is open and the current image is
81
+ // clicked, go to the next image in sequence
82
+ if (target.hasClass('visible')
83
+ && current[0] === target[0]
84
+ && next.length > 0 && self.is_open(current)) {
85
+ target = next;
86
+ image = target.find('img');
87
+ }
88
+
78
89
  // set current and target to the clicked li if not otherwise defined.
79
- self.open($(e.target), current, target);
90
+ self.open(image, current, target);
80
91
  self.update_paddles(target);
81
92
  })
82
93
 
83
- .on('click.fndtn.clearing', '.clearing-main-right',
94
+ .on('click.fndtn.clearing', '.clearing-main-next',
84
95
  function (e) { this.nav(e, 'next') }.bind(this))
85
- .on('click.fndtn.clearing', '.clearing-main-left',
96
+ .on('click.fndtn.clearing', '.clearing-main-prev',
86
97
  function (e) { this.nav(e, 'prev') }.bind(this))
87
98
  .on('click.fndtn.clearing', this.settings.close_selectors,
88
99
  function (e) { Foundation.libs.clearing.close(e, this) })
@@ -90,7 +101,7 @@
90
101
  function (e) { this.keydown(e) }.bind(this));
91
102
 
92
103
  $(window).on('resize.fndtn.clearing',
93
- function (e) { this.resize() }.bind(this));
104
+ function () { this.resize() }.bind(this));
94
105
 
95
106
  this.settings.init = true;
96
107
  return this;
@@ -144,7 +155,10 @@
144
155
  },
145
156
 
146
157
  assemble : function ($li) {
147
- var $el = $li.parent(),
158
+ var $el = $li.parent();
159
+ $el.after('<div id="foundationClearingHolder"></div>');
160
+
161
+ var holder = $('#foundationClearingHolder'),
148
162
  settings = this.get_data($el),
149
163
  grid = $el.detach(),
150
164
  data = {
@@ -154,7 +168,7 @@
154
168
  wrapper = '<div class="clearing-assembled"><div>' + data.viewing +
155
169
  data.grid + '</div></div>';
156
170
 
157
- return settings.$parent.append(wrapper);
171
+ return holder.after(wrapper).remove();
158
172
  },
159
173
 
160
174
  // event callbacks
@@ -167,9 +181,12 @@
167
181
 
168
182
  if (!this.locked()) {
169
183
  // set the image to the selected thumbnail
170
- image.attr('src', this.load($image));
184
+ image
185
+ .attr('src', this.load($image))
186
+ .css('visibility', 'hidden');
171
187
 
172
188
  this.loaded(image, function () {
189
+ image.css('visibility', 'visible');
173
190
  // toggle the gallery
174
191
  root.addClass('clearing-blackout');
175
192
  container.addClass('clearing-container');
@@ -197,7 +214,7 @@
197
214
  }($(el))), container, visible_image;
198
215
 
199
216
  if (el === e.target && root) {
200
- container = root.find('div').first(),
217
+ container = root.find('div').first();
201
218
  visible_image = container.find('.visible-img');
202
219
  this.settings.prev_index = 0;
203
220
  root.find('ul[data-clearing]')
@@ -210,6 +227,10 @@
210
227
  return false;
211
228
  },
212
229
 
230
+ is_open : function (current) {
231
+ return current.parent().attr('style').length > 0;
232
+ },
233
+
213
234
  keydown : function (e) {
214
235
  var clearing = $('.clearing-blackout').find('ul[data-clearing]');
215
236
 
@@ -257,39 +278,50 @@
257
278
  .closest('.carousel')
258
279
  .siblings('.visible-img');
259
280
 
260
- if (target.next().length) {
281
+ if (target.next().length > 0) {
261
282
  visible_image
262
- .find('.clearing-main-right')
283
+ .find('.clearing-main-next')
263
284
  .removeClass('disabled');
264
285
  } else {
265
286
  visible_image
266
- .find('.clearing-main-right')
287
+ .find('.clearing-main-next')
267
288
  .addClass('disabled');
268
289
  }
269
290
 
270
- if (target.prev().length) {
291
+ if (target.prev().length > 0) {
271
292
  visible_image
272
- .find('.clearing-main-left')
293
+ .find('.clearing-main-prev')
273
294
  .removeClass('disabled');
274
295
  } else {
275
296
  visible_image
276
- .find('.clearing-main-left')
297
+ .find('.clearing-main-prev')
277
298
  .addClass('disabled');
278
299
  }
279
300
  },
280
301
 
281
302
  center : function (target) {
282
- target.css({
283
- marginLeft : -(this.outerWidth(target) / 2),
284
- marginTop : -(this.outerHeight(target) / 2)
285
- });
303
+ if (!this.rtl) {
304
+ target.css({
305
+ marginLeft : -(this.outerWidth(target) / 2),
306
+ marginTop : -(this.outerHeight(target) / 2)
307
+ });
308
+ } else {
309
+ target.css({
310
+ marginRight : -(this.outerWidth(target) / 2),
311
+ marginTop : -(this.outerHeight(target) / 2)
312
+ });
313
+ }
286
314
  return this;
287
315
  },
288
316
 
289
317
  // image loading and preloading
290
318
 
291
319
  load : function ($image) {
292
- var href = $image.parent().attr('href');
320
+ if ($image[0].nodeName === "A") {
321
+ var href = $image.attr('href');
322
+ } else {
323
+ var href = $image.parent().attr('href');
324
+ }
293
325
 
294
326
  this.preload($image);
295
327
 
@@ -328,7 +360,7 @@
328
360
  return;
329
361
  }
330
362
 
331
- if (this.complete || this.readyState === 4) {
363
+ if (image[0].complete || image[0].readyState === 4) {
332
364
  loaded();
333
365
  } else {
334
366
  bindLoad.call(image);
@@ -356,7 +388,7 @@
356
388
 
357
389
  if (caption) {
358
390
  container
359
- .text(caption)
391
+ .html(caption)
360
392
  .show();
361
393
  } else {
362
394
  container
@@ -474,6 +506,10 @@
474
506
  $(window).off('.fndtn.clearing');
475
507
  this.remove_data(); // empty settings cache
476
508
  this.settings.init = false;
509
+ },
510
+
511
+ reflow : function () {
512
+ this.init();
477
513
  }
478
514
  };
479
515