├── _themes └── foundation-4 │ ├── js │ ├── foundation-4.js │ ├── foundation │ │ ├── foundation.alerts.js │ │ ├── foundation.cookie.js │ │ ├── foundation.magellan.js │ │ ├── foundation.placeholder.js │ │ ├── foundation.dropdown.js │ │ ├── foundation.tooltips.js │ │ ├── foundation.abide.js │ │ ├── foundation.interchange.js │ │ ├── foundation.reveal.js │ │ ├── foundation.topbar.js │ │ ├── foundation.js │ │ ├── foundation.orbit.js │ │ ├── foundation.section.js │ │ ├── foundation.clearing.js │ │ └── foundation.forms.js │ └── vendor │ │ └── custom.modernizr.js │ ├── layouts │ ├── feed.html │ ├── sitemap.html │ └── default.html │ ├── img │ └── image.png │ ├── templates │ ├── page.html │ ├── 404.html │ ├── post.html │ ├── taxonomies.html │ ├── default.html │ ├── sitemap.html │ └── feed.html │ ├── index.html │ ├── partials │ ├── _header.html │ ├── _footer.html │ ├── _aside.html │ ├── _doc_head.html │ ├── _nav.html │ ├── _analytics.html │ ├── _article.html │ ├── _meta.html │ └── _article_listing.html │ ├── theme.yaml │ ├── sass │ ├── _app.scss │ ├── foundation-4.scss │ └── _normalize.scss │ ├── config.rb │ └── MIT-LICENSE.txt ├── _content ├── 02-blog │ ├── feed.md │ ├── page.md │ ├── fields.yaml │ ├── 2013-01-02-test-content-two.md │ ├── 2013-01-03-test-content-three.md │ ├── 2013-03-03-test-content-three.md │ ├── 2013-03-04-test-content-three.md │ ├── 2013-03-05-test-content-three.md │ ├── 2013-03-06-test-content-three.md │ └── 2013-01-01-test-content-one.md ├── page.md ├── sitemap.md ├── feed.md ├── 404.md └── 01-about │ └── page.md ├── .gitignore ├── _config └── fieldsets │ ├── no_content.yaml │ ├── meta.yaml │ ├── page.yaml │ └── post.yaml ├── LICENCE └── README.md /_themes/foundation-4/js/foundation-4.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_themes/foundation-4/layouts/feed.html: -------------------------------------------------------------------------------- 1 | {{ _xml_header }} 2 | {{ layout_content }} -------------------------------------------------------------------------------- /_content/02-blog/feed.md: -------------------------------------------------------------------------------- 1 | --- 2 | _layout: feed 3 | _template: feed 4 | _type: rss 5 | --- -------------------------------------------------------------------------------- /_content/02-blog/page.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Blog Articles 3 | _fieldset: no_content 4 | --- 5 | -------------------------------------------------------------------------------- /_content/page.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Home 3 | _fieldset: page 4 | _template: default 5 | --- 6 | -------------------------------------------------------------------------------- /_content/sitemap.md: -------------------------------------------------------------------------------- 1 | --- 2 | _layout: sitemap 3 | _template: sitemap 4 | _type: rss 5 | --- -------------------------------------------------------------------------------- /_content/feed.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: RSS Feed 3 | 4 | _type: rss 5 | _template: feed 6 | _layout: feed 7 | --- -------------------------------------------------------------------------------- /_themes/foundation-4/img/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StephenGrider/foundation-4/master/_themes/foundation-4/img/image.png -------------------------------------------------------------------------------- /_themes/foundation-4/templates/page.html: -------------------------------------------------------------------------------- 1 |
2 |

{{ title }}

3 | {{ content }} 4 |
-------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .sass-cache 2 | .DS_Store 3 | _cache/_app/ 4 | *.log 5 | /assets/img/cache/ 6 | 7 | # These are some useful ignores for Statamic theme building. # -------------------------------------------------------------------------------- /_config/fieldsets/no_content.yaml: -------------------------------------------------------------------------------- 1 | hide: yes 2 | include: meta # include the meta fields 3 | 4 | fields: 5 | content: 6 | type: hidden -------------------------------------------------------------------------------- /_content/404.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 404 No Go. How Can I Help? 3 | _template: 404 4 | --- 5 | Perhaps I can offer you a brew? Perhaps try heading [home](/)? 6 | -------------------------------------------------------------------------------- /_themes/foundation-4/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 403 Forbidden 4 | 5 | 6 | 7 |

Directory access is forbidden.

8 | 9 | 10 | -------------------------------------------------------------------------------- /_content/02-blog/fields.yaml: -------------------------------------------------------------------------------- 1 | type: date # see http://statamic.com/docs/control-panel/fieldsets#fieldsets-and-entries 2 | hide: yes # hide page from Add Page list 3 | _fieldset: post # use the post fieldset -------------------------------------------------------------------------------- /_themes/foundation-4/templates/404.html: -------------------------------------------------------------------------------- 1 |
2 |

The Page You Are Looking For Is Missing

3 | {{ content }} 4 |
5 | 6 | {{# 7 | ==================================== 8 | NOTES 9 | ==================================== 10 | 11 | This displays the content for the 404 page. 12 | 13 | #}} 14 | 15 | 16 | -------------------------------------------------------------------------------- /_config/fieldsets/meta.yaml: -------------------------------------------------------------------------------- 1 | fields: 2 | meta_title: 3 | display: Page Title 4 | type: text 5 | instructions: Enter the page title to display in Google's search results. 6 | meta_desc: 7 | display: Page Description 8 | type: text 9 | instructions: Enter a short description to display in Google's search results roughly 155 characters. 10 | 11 | hide: true -------------------------------------------------------------------------------- /_config/fieldsets/page.yaml: -------------------------------------------------------------------------------- 1 | title: Standard Page 2 | 3 | include: meta # include the meta fields 4 | 5 | fields: 6 | _template: 7 | display: Template 8 | type:templates 9 | 10 | title: 11 | default: Default Value 12 | instructions: These are instructions. 13 | 14 | content: 15 | display: Page Content 16 | required: false 17 | default: 18 | type: redactor -------------------------------------------------------------------------------- /_themes/foundation-4/layouts/sitemap.html: -------------------------------------------------------------------------------- 1 | {{ noparse }}{{ /noparse }} 2 | 3 | 4 | {{ layout_content }} 5 | 6 | 7 | {{# 8 | ==================================== 9 | NOTES 10 | ==================================== 11 | 12 | This is the sitemap layouts template used to create a google sitemap. 13 | 14 | #}} -------------------------------------------------------------------------------- /_themes/foundation-4/partials/_header.html: -------------------------------------------------------------------------------- 1 |
2 |

{{ _site_name }}

3 | {{ theme:partial src="_nav" }} 4 |
5 | 6 | {{# 7 | ==================================== 8 | NOTES 9 | ==================================== 10 | 11 | This is the main header partial. 12 | 13 | For more information on partials see http://statamic.com/learn/theming/partials. 14 | 15 | #}} 16 | -------------------------------------------------------------------------------- /_themes/foundation-4/templates/post.html: -------------------------------------------------------------------------------- 1 | {{ theme:partial src="_article" }} 2 | 3 | {{# 4 | ==================================== 5 | NOTES 6 | ==================================== 7 | 8 | If you choose to not specify a template in your front matter, Statamic uses the following template hierarchy: 9 | 10 | If present: post.html 11 | Otherwise, if present: default.html 12 | Otherwise: 404.html 13 | 14 | See http://statamic.com/learn/core-concepts/how-pages-are-built for more information. 15 | 16 | #}} -------------------------------------------------------------------------------- /_themes/foundation-4/partials/_footer.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | {{# 6 | ==================================== 7 | NOTES 8 | ==================================== 9 | 10 | This is the main footer partial. 11 | 12 | For more information on partials see http://statamic.com/learn/theming/partials. 13 | 14 | #}} 15 | -------------------------------------------------------------------------------- /_themes/foundation-4/theme.yaml: -------------------------------------------------------------------------------- 1 | ########################################################################################### 2 | # 3 | # THEME VARIABLES 4 | # 5 | ########################################################################################### 6 | 7 | # Theme name 8 | theme_name: Statarkers 9 | 10 | # Comments + Disqus 11 | disqus_account: changeme 12 | show_comments: no 13 | 14 | # Blog 15 | blog_name: blog 16 | 17 | # Global text snippets 18 | no_results_text: "Sorry, no results found." 19 | 20 | # Site Description 21 | site_desc: "Enter a description which will display in your home page meta description and RSS feed." -------------------------------------------------------------------------------- /_themes/foundation-4/sass/_app.scss: -------------------------------------------------------------------------------- 1 | // VARIABLES FOR APP.SCSS 2 | 3 | $white : rgb(255,255,255); 4 | $black : rgb(0,0,0); 5 | $darkgrey : lighten($black, 10%); 6 | $grey : lighten($black, 50%); 7 | $lightgrey : lighten($black, 75%); 8 | $lightergrey : lighten($black, 90%); 9 | 10 | // APP STYLES 11 | 12 | .no-list-style { 13 | list-style: none; 14 | margin-left: 0; 15 | 16 | li { 17 | margin-bottom: 1em; 18 | border-bottom: 1px dashed $lightgrey; 19 | &:last-child { border-bottom: none; } 20 | } 21 | } 22 | footer[role="contentinfo"] { 23 | padding: 1em 0; 24 | border-top: 1px solid $lightgrey; 25 | } 26 | -------------------------------------------------------------------------------- /_themes/foundation-4/partials/_aside.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Categories

4 | 9 |
10 |
11 |

Tags

12 | 17 |
18 |
-------------------------------------------------------------------------------- /_content/01-about/page.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: About Foundation Theme 3 | _template: page 4 | _fieldset: page 5 | --- 6 | The Foundation theme is built using [Foundation 4](http://foundation.zurb.com/) (a CSS and Javascript framework) on top of the [Statarkers](http://statamicthem.es/themes/statarkers-theme) theme for Statamic. Foundation 4 offers an excellent starting point for building responsive websites and the Statarkers theme offers a base set of files for building Statamic themes quickly and efficiently. 7 | 8 | The two work together to help you create a responsive website with a blog in minutes. The theme has been kept as simple as possible so that it can form a base to build off. Feel free to use it in your projects. -------------------------------------------------------------------------------- /_themes/foundation-4/templates/taxonomies.html: -------------------------------------------------------------------------------- 1 |
2 | {{ if segment_2 == "categories" }} 3 |

Article Category: {{ taxonomy_slug|deslugify|title }}

4 | {{ endif }} 5 | {{ if segment_2 == "tags" }} 6 |

Article Tags: {{ taxonomy_slug|deslugify|title }}

7 | {{ endif }} 8 | 9 | {{ theme:partial src="_article_listing" fold="{{ blog_name }}" lim="5" tax="yes" }} 10 |
11 | 12 | {{# 13 | ==================================== 14 | NOTES 15 | ==================================== 16 | 17 | This is the taxonomy listing template, it displays content when a category or tag is clicked. For more information see: http://statamic.com/learn/core-concepts/taxonomies. 18 | 19 | #}} -------------------------------------------------------------------------------- /_themes/foundation-4/templates/default.html: -------------------------------------------------------------------------------- 1 | {{ theme:partial src="_article_listing" fold="{{ blog_name }}" lim="3" tax="no" }} 2 | 3 | {{# 4 | ==================================== 5 | NOTES 6 | ==================================== 7 | 8 | This is the default template (required), if you choose to not specify a template in your front matter, Statamic uses the following template hierarchy: 9 | 10 | If present: post.html 11 | Otherwise, if present: default.html 12 | Otherwise: 404.html 13 | 14 | See http://statamic.com/learn/core-concepts/how-pages-are-built for more information. 15 | 16 | This template is using the articles template partial with a variable which sets 17 | the limit (number of posts to display). Change the lim="5" variable to however many 18 | posts you would like to display. 19 | 20 | #}} 21 | 22 | -------------------------------------------------------------------------------- /_themes/foundation-4/templates/sitemap.html: -------------------------------------------------------------------------------- 1 | {{ entries:listing folder="{blog_name}" limit="1000" }} 2 | 3 | {{ _site_url }}{{ url }} 4 | {{ datestamp format="Y-m-d" }} 5 | monthly 6 | 0.8 7 | 8 | {{ /entries:listing }} 9 | {{ nav from="/" }} 10 | 11 | {{ _site_url }}{{ url }} 12 | {{ last_modified format="Y-m-d" }} 13 | monthly 14 | 0.8 15 | 16 | {{ /nav }} 17 | 18 | {{# 19 | ==================================== 20 | NOTES 21 | ==================================== 22 | 23 | This template generates a site map which includes your main blog articles and any links generated from your navigation. If your content folder is not called blog change the folder parameter to whatever you have named the folder in the theme.yaml file. 24 | 25 | #}} 26 | -------------------------------------------------------------------------------- /_themes/foundation-4/partials/_doc_head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {{ theme:partial src="_meta" }} 8 | 9 | 10 | 11 | {{# Place favicon.ico and apple-touch-icon.png in the root directory. #}} 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | {{ theme:partial src="_analytics" }} 29 | 30 | 31 | -------------------------------------------------------------------------------- /_themes/foundation-4/partials/_nav.html: -------------------------------------------------------------------------------- 1 | 21 | 22 | {{# 23 | ==================================== 24 | NOTES 25 | ==================================== 26 | 27 | This is the main nav partial. 28 | 29 | It uses the nav tag to render a list of navigation items. For more information on the nav tag see http://statamic.com/learn/documentation/tags/nav. 30 | 31 | #}} -------------------------------------------------------------------------------- /_themes/foundation-4/config.rb: -------------------------------------------------------------------------------- 1 | require 'zurb-foundation' 2 | # Require any additional compass plugins here. 3 | 4 | 5 | # Set this to the root of your project when deployed: 6 | http_path = "/_themes/foundation-4/" 7 | css_dir = "css" 8 | sass_dir = "sass" 9 | images_dir = "img" 10 | javascripts_dir = "js" 11 | fonts_dir = "fonts" 12 | 13 | # You can select your preferred output style here (can be overridden via the command line): 14 | # output_style = :expanded or :nested or :compact or :compressed 15 | 16 | # To enable relative paths to assets via compass helper functions. Uncomment: 17 | # relative_assets = true 18 | 19 | # To disable debugging comments that display the original location of your selectors. Uncomment: 20 | # line_comments = false 21 | 22 | 23 | # If you prefer the indented syntax, you might want to regenerate this 24 | # project again passing --syntax sass, or you can uncomment this: 25 | # preferred_syntax = :sass 26 | # and then run: 27 | # sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass 28 | -------------------------------------------------------------------------------- /LICENCE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Statamic Themes 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /_config/fieldsets/post.yaml: -------------------------------------------------------------------------------- 1 | include: meta # include the meta fields 2 | 3 | fields: 4 | status: 5 | display: Status 6 | type: status 7 | 8 | categories: 9 | display: Categories 10 | required: false 11 | type: tags 12 | instructions: Add categories. 13 | 14 | tags: # the template tag name -- in this example, {{ tags }} 15 | display: Tags # the control panel field label (optional) 16 | required: false # required: true/false for validation (optional, false by default) 17 | default: # default value (optional) 18 | type: tags # fieldtype (optional, text by default) 19 | instructions: Add tags. # instructions added above the field 20 | 21 | summary: 22 | display: Summary 23 | required: true 24 | default: 25 | type: textarea 26 | instructions: Add a short summary for the article here. 27 | 28 | content: 29 | display: Article Content 30 | required: false 31 | default: 32 | type: redactor 33 | image_dir: assets/img/blog 34 | instructions: Add the main article content here. -------------------------------------------------------------------------------- /_themes/foundation-4/MIT-LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 ZURB, http://www.zurb.com/ 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /_themes/foundation-4/partials/_analytics.html: -------------------------------------------------------------------------------- 1 | {{ if enable_analytics == "yes" }} 2 | 15 | {{ endif }} 16 | 17 | {{# 18 | ==================================== 19 | NOTES 20 | ==================================== 21 | 22 | Enter your Google analytics code here, you can just enter your account id here UA-XXXXX-X. 23 | The analytics is wrapped in a conditional which will stop google tracker your site when 24 | on a development server. You will need to uncomment the enable_analytics variables in the 25 | dev and live yaml files. Thes are located in the environments folder which is located in the _config folder. 26 | 27 | Once this is in place you can set up your eviroments in the settings yaml file located in the _config folder. 28 | For more information see: http://statamic.com/learn/advanced-features/environments. 29 | 30 | #}} -------------------------------------------------------------------------------- /_themes/foundation-4/js/foundation/foundation.alerts.js: -------------------------------------------------------------------------------- 1 | /*jslint unparam: true, browser: true, indent: 2 */ 2 | 3 | ;(function ($, window, document, undefined) { 4 | 'use strict'; 5 | 6 | Foundation.libs.alerts = { 7 | name : 'alerts', 8 | 9 | version : '4.2.2', 10 | 11 | settings : { 12 | speed: 300, // fade out speed 13 | callback: function (){} 14 | }, 15 | 16 | init : function (scope, method, options) { 17 | this.scope = scope || this.scope; 18 | 19 | if (typeof method === 'object') { 20 | $.extend(true, this.settings, method); 21 | } 22 | 23 | if (typeof method !== 'string') { 24 | if (!this.settings.init) { this.events(); } 25 | 26 | return this.settings.init; 27 | } else { 28 | return this[method].call(this, options); 29 | } 30 | }, 31 | 32 | events : function () { 33 | var self = this; 34 | 35 | $(this.scope).on('click.fndtn.alerts', '[data-alert] a.close', function (e) { 36 | e.preventDefault(); 37 | $(this).closest("[data-alert]").fadeOut(self.speed, function () { 38 | $(this).remove(); 39 | self.settings.callback(); 40 | }); 41 | }); 42 | 43 | this.settings.init = true; 44 | }, 45 | 46 | off : function () { 47 | $(this.scope).off('.fndtn.alerts'); 48 | }, 49 | 50 | reflow : function () {} 51 | }; 52 | }(Foundation.zj, this, this.document)); -------------------------------------------------------------------------------- /_themes/foundation-4/partials/_article.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

{{ title }}

4 | 5 | 6 | {{ if categories_list && tags_list }} 7 |

Filed under: {{ categories_url_list }} and tagged with: {{ tags_url_list }}

8 | {{ endif }} 9 | 10 | {{ if categories_list && !tags_list }} 11 |

Filed under: {{ categories_url_list }}

12 | {{ endif }} 13 | 14 | {{ if !categories_list && tags_list }} 15 |

Tagged with: {{ tags_url_list }}

16 | {{ endif }} 17 |
18 | 19 | {{ content }} 20 | 21 | 24 |
25 | 26 | {{ if show_comments }} 27 |
28 |

Leave Your Comments

29 | {{ disqus:comments account="{ disqus_account }" }} 30 |
31 | {{ endif }} 32 | 33 | {{# 34 | ==================================== 35 | NOTES 36 | ==================================== 37 | 38 | This partial displays a single article if you require a listing use the _article_listings partial. The partials are designed so that you can use them modularly in your templates. 39 | 40 | For more information on partials see http://statamic.com/learn/theming/partials. 41 | 42 | There is a comments section which uses Disqus, to make this work you will need to set comments to yes in the theme.yaml file and add your Disqus short name in the same file. For more information on using Disqus comments see this post: http://garethredfern.com/article/using-disqus-with-statamic. 43 | 44 | #}} -------------------------------------------------------------------------------- /_content/02-blog/2013-01-02-test-content-two.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Cupcake Content 3 | categories: 4 | - Random 5 | tags: 6 | - Cakes 7 | featured: no 8 | author: Gareth 9 | status: live 10 | summary: Tootsie roll brownie donut marzipan cheesecake jelly beans halvah. Jelly beans ice cream icing biscuit. Halvah fruitcake chocolate fruitcake chocolate cake muffin soufflé. 11 | --- 12 | Cupcake icing toffee cookie lemon drops. Muffin danish candy ice cream bear claw caramels. Halvah dragée croissant liquorice. Jujubes powder sweet brownie jelly-o caramels pie chocolate bar. Icing jujubes bonbon. Brownie halvah dragée fruitcake chocolate bar. Pie liquorice cake lemon drops cotton candy powder. Sweet roll bonbon brownie. Jelly-o fruitcake marshmallow carrot cake lemon drops chupa chups oat cake tiramisu biscuit. Halvah toffee wypas croissant chupa chups jujubes chocolate. Marzipan wafer wafer tiramisu sugar plum icing. Donut tart dragée cheesecake oat cake. 13 | 14 | ![placeholder](http://placehold.it/700x400&text=Placeholder+Image) 15 | 16 | Tootsie roll brownie donut marzipan cheesecake jelly beans halvah. Jelly beans ice cream icing biscuit. Halvah fruitcake chocolate fruitcake chocolate cake muffin soufflé. Sweet roll carrot cake chocolate bar jelly-o oat cake. Ice cream pastry cookie caramels sugar plum. Oat cake sesame snaps candy soufflé ice cream tiramisu chocolate cake pastry oat cake. Bonbon candy canes bonbon wypas sweet topping halvah jujubes. Sugar plum faworki candy canes tiramisu chupa chups cupcake ice cream jelly beans oat cake. Cotton candy brownie pudding cupcake faworki. Sesame snaps dessert pastry chocolate sweet topping bear claw. Apple pie chupa chups chocolate cupcake wypas. Lollipop jelly beans sesame snaps pastry. Candy pudding sweet chupa chups chocolate cake icing. 17 | 18 | [check out some helpful content for styling](/blog/test-content-one) 19 | 20 | -------------------------------------------------------------------------------- /_content/02-blog/2013-01-03-test-content-three.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Building With Statamic Is A Piece Of Cake 3 | categories: 4 | - Random 5 | tags: 6 | - Cakes 7 | featured: no 8 | author: Gareth 9 | status: live 10 | summary: Cupcake icing toffee cookie lemon drops. Muffin danish candy ice cream bear claw caramels. Halvah dragée croissant liquorice. Jujubes powder sweet brownie jelly-o caramels pie chocolate bar. 11 | --- 12 | ![placeholder](http://placehold.it/700x400&text=Placeholder+Image) 13 | 14 | Cupcake icing toffee cookie lemon drops. Muffin danish candy ice cream bear claw caramels. Halvah dragée croissant liquorice. Jujubes powder sweet brownie jelly-o caramels pie chocolate bar. Icing jujubes bonbon. Brownie halvah dragée fruitcake chocolate bar. Pie liquorice cake lemon drops cotton candy powder. Sweet roll bonbon brownie. Jelly-o fruitcake marshmallow carrot cake lemon drops chupa chups oat cake tiramisu biscuit. Halvah toffee wypas croissant chupa chups jujubes chocolate. Marzipan wafer wafer tiramisu sugar plum icing. Donut tart dragée cheesecake oat cake. 15 | 16 | Tootsie roll brownie donut marzipan cheesecake jelly beans halvah. Jelly beans ice cream icing biscuit. Halvah fruitcake chocolate fruitcake chocolate cake muffin soufflé. Sweet roll carrot cake chocolate bar jelly-o oat cake. Ice cream pastry cookie caramels sugar plum. Oat cake sesame snaps candy soufflé ice cream tiramisu chocolate cake pastry oat cake. Bonbon candy canes bonbon wypas sweet topping halvah jujubes. Sugar plum faworki candy canes tiramisu chupa chups cupcake ice cream jelly beans oat cake. Cotton candy brownie pudding cupcake faworki. Sesame snaps dessert pastry chocolate sweet topping bear claw. Apple pie chupa chups chocolate cupcake wypas. Lollipop jelly beans sesame snaps pastry. Candy pudding sweet chupa chups chocolate cake icing. 17 | 18 | [check out some helpful content for styling](/blog/test-content-one) 19 | -------------------------------------------------------------------------------- /_content/02-blog/2013-03-03-test-content-three.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Building With Statamic Is A Piece Of Cake 3 | categories: 4 | - Random 5 | tags: 6 | - Cakes 7 | featured: no 8 | author: Gareth 9 | status: live 10 | summary: Cupcake icing toffee cookie lemon drops. Muffin danish candy ice cream bear claw caramels. Halvah dragée croissant liquorice. Jujubes powder sweet brownie jelly-o caramels pie chocolate bar. 11 | --- 12 | ![placeholder](http://placehold.it/700x400&text=Placeholder+Image) 13 | 14 | Cupcake icing toffee cookie lemon drops. Muffin danish candy ice cream bear claw caramels. Halvah dragée croissant liquorice. Jujubes powder sweet brownie jelly-o caramels pie chocolate bar. Icing jujubes bonbon. Brownie halvah dragée fruitcake chocolate bar. Pie liquorice cake lemon drops cotton candy powder. Sweet roll bonbon brownie. Jelly-o fruitcake marshmallow carrot cake lemon drops chupa chups oat cake tiramisu biscuit. Halvah toffee wypas croissant chupa chups jujubes chocolate. Marzipan wafer wafer tiramisu sugar plum icing. Donut tart dragée cheesecake oat cake. 15 | 16 | Tootsie roll brownie donut marzipan cheesecake jelly beans halvah. Jelly beans ice cream icing biscuit. Halvah fruitcake chocolate fruitcake chocolate cake muffin soufflé. Sweet roll carrot cake chocolate bar jelly-o oat cake. Ice cream pastry cookie caramels sugar plum. Oat cake sesame snaps candy soufflé ice cream tiramisu chocolate cake pastry oat cake. Bonbon candy canes bonbon wypas sweet topping halvah jujubes. Sugar plum faworki candy canes tiramisu chupa chups cupcake ice cream jelly beans oat cake. Cotton candy brownie pudding cupcake faworki. Sesame snaps dessert pastry chocolate sweet topping bear claw. Apple pie chupa chups chocolate cupcake wypas. Lollipop jelly beans sesame snaps pastry. Candy pudding sweet chupa chups chocolate cake icing. 17 | 18 | [check out some helpful content for styling](/blog/test-content-one) 19 | -------------------------------------------------------------------------------- /_content/02-blog/2013-03-04-test-content-three.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Building With Statamic Is A Piece Of Cake 3 | categories: 4 | - Random 5 | tags: 6 | - Cakes 7 | featured: no 8 | author: Gareth 9 | status: live 10 | summary: Cupcake icing toffee cookie lemon drops. Muffin danish candy ice cream bear claw caramels. Halvah dragée croissant liquorice. Jujubes powder sweet brownie jelly-o caramels pie chocolate bar. 11 | --- 12 | ![placeholder](http://placehold.it/700x400&text=Placeholder+Image) 13 | 14 | Cupcake icing toffee cookie lemon drops. Muffin danish candy ice cream bear claw caramels. Halvah dragée croissant liquorice. Jujubes powder sweet brownie jelly-o caramels pie chocolate bar. Icing jujubes bonbon. Brownie halvah dragée fruitcake chocolate bar. Pie liquorice cake lemon drops cotton candy powder. Sweet roll bonbon brownie. Jelly-o fruitcake marshmallow carrot cake lemon drops chupa chups oat cake tiramisu biscuit. Halvah toffee wypas croissant chupa chups jujubes chocolate. Marzipan wafer wafer tiramisu sugar plum icing. Donut tart dragée cheesecake oat cake. 15 | 16 | Tootsie roll brownie donut marzipan cheesecake jelly beans halvah. Jelly beans ice cream icing biscuit. Halvah fruitcake chocolate fruitcake chocolate cake muffin soufflé. Sweet roll carrot cake chocolate bar jelly-o oat cake. Ice cream pastry cookie caramels sugar plum. Oat cake sesame snaps candy soufflé ice cream tiramisu chocolate cake pastry oat cake. Bonbon candy canes bonbon wypas sweet topping halvah jujubes. Sugar plum faworki candy canes tiramisu chupa chups cupcake ice cream jelly beans oat cake. Cotton candy brownie pudding cupcake faworki. Sesame snaps dessert pastry chocolate sweet topping bear claw. Apple pie chupa chups chocolate cupcake wypas. Lollipop jelly beans sesame snaps pastry. Candy pudding sweet chupa chups chocolate cake icing. 17 | 18 | [check out some helpful content for styling](/blog/test-content-one) 19 | -------------------------------------------------------------------------------- /_content/02-blog/2013-03-05-test-content-three.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Building With Statamic Is A Piece Of Cake 3 | categories: 4 | - Random 5 | tags: 6 | - Cakes 7 | featured: no 8 | author: Gareth 9 | status: live 10 | summary: Cupcake icing toffee cookie lemon drops. Muffin danish candy ice cream bear claw caramels. Halvah dragée croissant liquorice. Jujubes powder sweet brownie jelly-o caramels pie chocolate bar. 11 | --- 12 | ![placeholder](http://placehold.it/700x400&text=Placeholder+Image) 13 | 14 | Cupcake icing toffee cookie lemon drops. Muffin danish candy ice cream bear claw caramels. Halvah dragée croissant liquorice. Jujubes powder sweet brownie jelly-o caramels pie chocolate bar. Icing jujubes bonbon. Brownie halvah dragée fruitcake chocolate bar. Pie liquorice cake lemon drops cotton candy powder. Sweet roll bonbon brownie. Jelly-o fruitcake marshmallow carrot cake lemon drops chupa chups oat cake tiramisu biscuit. Halvah toffee wypas croissant chupa chups jujubes chocolate. Marzipan wafer wafer tiramisu sugar plum icing. Donut tart dragée cheesecake oat cake. 15 | 16 | Tootsie roll brownie donut marzipan cheesecake jelly beans halvah. Jelly beans ice cream icing biscuit. Halvah fruitcake chocolate fruitcake chocolate cake muffin soufflé. Sweet roll carrot cake chocolate bar jelly-o oat cake. Ice cream pastry cookie caramels sugar plum. Oat cake sesame snaps candy soufflé ice cream tiramisu chocolate cake pastry oat cake. Bonbon candy canes bonbon wypas sweet topping halvah jujubes. Sugar plum faworki candy canes tiramisu chupa chups cupcake ice cream jelly beans oat cake. Cotton candy brownie pudding cupcake faworki. Sesame snaps dessert pastry chocolate sweet topping bear claw. Apple pie chupa chups chocolate cupcake wypas. Lollipop jelly beans sesame snaps pastry. Candy pudding sweet chupa chups chocolate cake icing. 17 | 18 | [check out some helpful content for styling](/blog/test-content-one) 19 | -------------------------------------------------------------------------------- /_content/02-blog/2013-03-06-test-content-three.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Building With Statamic Is A Piece Of Cake 3 | categories: 4 | - Random 5 | tags: 6 | - Cakes 7 | featured: no 8 | author: Gareth 9 | status: live 10 | summary: Cupcake icing toffee cookie lemon drops. Muffin danish candy ice cream bear claw caramels. Halvah dragée croissant liquorice. Jujubes powder sweet brownie jelly-o caramels pie chocolate bar. 11 | --- 12 | ![placeholder](http://placehold.it/700x400&text=Placeholder+Image) 13 | 14 | Cupcake icing toffee cookie lemon drops. Muffin danish candy ice cream bear claw caramels. Halvah dragée croissant liquorice. Jujubes powder sweet brownie jelly-o caramels pie chocolate bar. Icing jujubes bonbon. Brownie halvah dragée fruitcake chocolate bar. Pie liquorice cake lemon drops cotton candy powder. Sweet roll bonbon brownie. Jelly-o fruitcake marshmallow carrot cake lemon drops chupa chups oat cake tiramisu biscuit. Halvah toffee wypas croissant chupa chups jujubes chocolate. Marzipan wafer wafer tiramisu sugar plum icing. Donut tart dragée cheesecake oat cake. 15 | 16 | Tootsie roll brownie donut marzipan cheesecake jelly beans halvah. Jelly beans ice cream icing biscuit. Halvah fruitcake chocolate fruitcake chocolate cake muffin soufflé. Sweet roll carrot cake chocolate bar jelly-o oat cake. Ice cream pastry cookie caramels sugar plum. Oat cake sesame snaps candy soufflé ice cream tiramisu chocolate cake pastry oat cake. Bonbon candy canes bonbon wypas sweet topping halvah jujubes. Sugar plum faworki candy canes tiramisu chupa chups cupcake ice cream jelly beans oat cake. Cotton candy brownie pudding cupcake faworki. Sesame snaps dessert pastry chocolate sweet topping bear claw. Apple pie chupa chups chocolate cupcake wypas. Lollipop jelly beans sesame snaps pastry. Candy pudding sweet chupa chups chocolate cake icing. 17 | 18 | [check out some helpful content for styling](/blog/test-content-one) 19 | -------------------------------------------------------------------------------- /_themes/foundation-4/partials/_meta.html: -------------------------------------------------------------------------------- 1 | {{# TOP LEVEL PAGES === #}} 2 | 3 | {{ if segment_1 != "404" && segment_1 != "blog" }} 4 | {{ if meta_title }}{{ meta_title }}{{ else }}{{ title }}{{ endif }} | {{ _site_name }} 5 | {{ if meta_desc }} 6 | 7 | {{ endif }} 8 | {{ endif }} 9 | 10 | {{# BLOG =============== #}} 11 | 12 | {{ if segment_1 == "blog" && segment_2 == "" }} 13 | {{ if meta_title }}{{ meta_title }}{{ else }}{{ title }}{{ endif }} | {{ _site_name }} 14 | {{ if meta_desc }} 15 | 16 | {{ endif }} 17 | {{ endif }} 18 | 19 | {{ if segment_1 == "blog" && segment_2 == "categories" }} 20 | Articles With The Category {{ taxonomy_slug|deslugify|title }} | {{ _site_name }} 21 | 22 | {{ endif }} 23 | 24 | {{ if segment_1 == "blog" && segment_2 == "tags" }} 25 | Articles Tagged {{ taxonomy_slug|deslugify|title }} | {{ _site_name }} 26 | 27 | {{ endif }} 28 | 29 | {{# 404 =============== #}} 30 | 31 | {{ if segment_1 == "404" }} 32 | Page Missing | {{ _site_name }} 33 | 34 | {{ endif }} 35 | 36 | {{# 37 | ==================================== 38 | NOTES 39 | ==================================== 40 | 41 | This is the meta template for your site, it is used to dynamically generate each page title and description. You will only need to add to this if additional pages that use taxonomy are used e.g. you add additional areas that use categories or tags. 42 | 43 | If you do add additional taxonomy pages use the blog meta as an example. 44 | 45 | #}} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # The Foundation Theme 2 | 3 | The Foundation theme is built using [Foundation 4](http://foundation.zurb.com/) (a CSS and Javascript framework) and on top of the [Statarkers](https://github.com/statamicthemes/statarkers-theme) theme for Statamic. Foundation 4 offers an excellent starting point for building responsive websites and the Statarkers theme offers a base set of files for building Statamic themes quickly and efficiently. 4 | 5 | The two work together to help you create a responsive website with a blog in minutes. The theme has been kept as simple as possible so that it can form a base to build off. Feel free to use it in your projects. 6 | 7 | ##Installing 8 | 9 | To install the theme follow the instructions below. 10 | 11 | 1. [Install Statamic:](http://statamic.com/learn/digging-in/installing) **Don't forget to set up your .htaccess file**. 12 | 2. Copy the foundation-4 theme folder to your _themes folder. Please note if you have downloaded the foundation-4-master folder **the foundation-4 theme is located inside the _themes folder**. 13 | 3. Delete the contents of your Statamic install fieldsets folder then copy the new fieldsets from the foundation-4-master folder (located in _config/fieldsets). 14 | 4. If you would like to use the dummy content provided with the foundation-4 theme (recommended) then delete the contents of your existing _content folder and copy the files and folders from the foundation-4-master _content folder. 15 | 5. In your Statamic install go to _config settings YAML file and change the _theme name from denali to foundation-4. If this is a clean install you should also change the site name and url to whatever you are using. We suggest also changing the _taxonomy_slugify to true as this gives you cleaner url's. 16 | 6. If you are going to add any additional styles make sure that you have the zurb-foundation gem installed and start watching the foundation-4 theme directory using the compass watch command. The [Foundation 4 Documents](http://foundation.zurb.com/docs/sass.html) explain how to set this up if you are unsure. 17 | 7. All user styles should be added to the _app.scss file (located in the sass folder). 18 | 8. Any user JavaScripts should be added to the foundation-4.js file located in the js folder. 19 | -------------------------------------------------------------------------------- /_themes/foundation-4/templates/feed.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | <![CDATA[{{ _site_name }}]]> 4 | {{ _site_url }} 5 | {{ site_desc|striptags }} 6 | {{ entries:listing folder="{blog_name}" limit="1" }}{{ datestamp format="r" }}{{ /entries:listing }} 7 | en-gb 8 | gareth@garethredfern.com (Gareth Redfern) 9 | Copyright {{ current_date format='Y' }} 10 | 3600 11 | 12 | 13 | {{ entries:listing folder="{blog_name}" limit="20" }} 14 | 15 | <![CDATA[{{ title }}]]> 16 | gareth@garethredfern.com ({{ author }}) 17 | {{ permalink }} 18 | {{ permalink }} 19 | article 20 | {{ datestamp format="r" }} 21 | 22 | 23 | {{ /entries:listing }} 24 | 25 | 26 | 27 | {{# 28 | ==================================== 29 | NOTES 30 | ==================================== 31 | 32 | This is the RSS feed template, if you would like to have an RSS feed please change the following: 33 | 34 | The title: uses the {{ _site_name }} variable to output your website name. 35 | The description: This template uses a theme variable (see theme.yaml file) to output the description. 36 | The folder: here we have set it to {blog_name} which is a global theme variable (see theme.yaml file) but if you choose a different name for your content folder then make sure it is set to the correct name. 37 | The Webmaster: Change the webMaster details to your own. 38 | Entries listing tag: make sure this is set to read the correct folder, here we have set it to the {{ blog_name }} template variable (see theme.yaml file). 39 | The category: change the category if required (currently set to article). 40 | 41 | For more information see: http://statamicist.com/tips/creating-an-rss-feed 42 | 43 | #}} 44 | -------------------------------------------------------------------------------- /_themes/foundation-4/js/foundation/foundation.cookie.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery Cookie Plugin v1.3 3 | * https://github.com/carhartl/jquery-cookie 4 | * 5 | * Copyright 2011, Klaus Hartl 6 | * Dual licensed under the MIT or GPL Version 2 licenses. 7 | * http://www.opensource.org/licenses/mit-license.php 8 | * http://www.opensource.org/licenses/GPL-2.0 9 | * 10 | * Modified to work with Zepto.js by ZURB 11 | */ 12 | (function ($, document, undefined) { 13 | 14 | var pluses = /\+/g; 15 | 16 | function raw(s) { 17 | return s; 18 | } 19 | 20 | function decoded(s) { 21 | return decodeURIComponent(s.replace(pluses, ' ')); 22 | } 23 | 24 | var config = $.cookie = function (key, value, options) { 25 | 26 | // write 27 | if (value !== undefined) { 28 | options = $.extend({}, config.defaults, options); 29 | 30 | if (value === null) { 31 | options.expires = -1; 32 | } 33 | 34 | if (typeof options.expires === 'number') { 35 | var days = options.expires, t = options.expires = new Date(); 36 | t.setDate(t.getDate() + days); 37 | } 38 | 39 | value = config.json ? JSON.stringify(value) : String(value); 40 | 41 | return (document.cookie = [ 42 | encodeURIComponent(key), '=', config.raw ? value : encodeURIComponent(value), 43 | options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE 44 | options.path ? '; path=' + options.path : '', 45 | options.domain ? '; domain=' + options.domain : '', 46 | options.secure ? '; secure' : '' 47 | ].join('')); 48 | } 49 | 50 | // read 51 | var decode = config.raw ? raw : decoded; 52 | var cookies = document.cookie.split('; '); 53 | for (var i = 0, l = cookies.length; i < l; i++) { 54 | var parts = cookies[i].split('='); 55 | if (decode(parts.shift()) === key) { 56 | var cookie = decode(parts.join('=')); 57 | return config.json ? JSON.parse(cookie) : cookie; 58 | } 59 | } 60 | 61 | return null; 62 | }; 63 | 64 | config.defaults = {}; 65 | 66 | $.removeCookie = function (key, options) { 67 | if ($.cookie(key) !== null) { 68 | $.cookie(key, null, options); 69 | return true; 70 | } 71 | return false; 72 | }; 73 | 74 | })(Foundation.zj, document); -------------------------------------------------------------------------------- /_themes/foundation-4/sass/foundation-4.scss: -------------------------------------------------------------------------------- 1 | // Global Foundation Settings 2 | @import "settings"; 3 | 4 | // Comment out this import if you don't want to use normalize 5 | @import "normalize"; 6 | 7 | // Comment out this import if you are customizing you imports below 8 | @import "foundation"; 9 | 10 | // Add additional theme styles 11 | @import "app"; 12 | 13 | // Import specific parts of Foundation by commenting the import "foundation" 14 | // and uncommenting what you want below. You must uncomment the following if customizing 15 | 16 | // @import "foundation/components/global"; // *always required 17 | // @import "foundation/components/grid"; 18 | 19 | // 20 | // Use this grid if you want to start using the new Foundation 5 grid early. 21 | // It will change breakpoints to min-width: 640px and 1024px. 22 | // 23 | // @import "foundation/components/grid-5"; 24 | // 25 | 26 | // @import "foundation/components/visibility"; 27 | // @import "foundation/components/block-grid"; 28 | // @import "foundation/components/type"; 29 | // @import "foundation/components/buttons"; 30 | // @import "foundation/components/forms"; // *requires components/buttons 31 | // @import "foundation/components/custom-forms"; // *requires components/buttons, components/forms 32 | // @import "foundation/components/button-groups"; // *requires components/buttons 33 | // @import "foundation/components/dropdown-buttons"; // *requires components/buttons 34 | // @import "foundation/components/split-buttons"; // *requires components/buttons 35 | // @import "foundation/components/flex-video"; 36 | // @import "foundation/components/section"; 37 | // @import "foundation/components/top-bar"; // *requires components/grid 38 | // @import "foundation/components/orbit"; 39 | // @import "foundation/components/reveal"; 40 | // @import "foundation/components/joyride"; 41 | // @import "foundation/components/clearing"; 42 | // @import "foundation/components/alert-boxes"; 43 | // @import "foundation/components/breadcrumbs"; 44 | // @import "foundation/components/keystrokes"; 45 | // @import "foundation/components/labels"; 46 | // @import "foundation/components/inline-lists"; 47 | // @import "foundation/components/pagination"; 48 | // @import "foundation/components/panels"; 49 | // @import "foundation/components/pricing-tables"; 50 | // @import "foundation/components/progress-bars"; 51 | // @import "foundation/components/side-nav"; 52 | // @import "foundation/components/sub-nav"; 53 | // @import "foundation/components/switch"; 54 | // @import "foundation/components/magellan"; 55 | // @import "foundation/components/tables"; 56 | // @import "foundation/components/thumbs"; 57 | // @import "foundation/components/tooltips"; 58 | // @import "foundation/components/dropdown"; -------------------------------------------------------------------------------- /_themes/foundation-4/layouts/default.html: -------------------------------------------------------------------------------- 1 | {{ theme:partial src="_doc_head" }} 2 | 3 | 4 |
5 |
6 | {{ theme:partial src="_header" }} 7 |
8 |
9 | 10 |
11 |
12 | {{ layout_content }} 13 |
14 |
15 | {{ theme:partial src="_aside" }} 16 |
17 |
18 | 19 |
20 |
21 | {{ theme:partial src="_footer" }} 22 |
23 |
24 | 25 | 26 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | {{# 59 | ==================================== 60 | NOTES 61 | ==================================== 62 | 63 | This is the default layouts template used by all pages. If no other layout file is called then Statamic will use this file. 64 | 65 | For more information on how Statamic works and the three distinct pieces: content file, template and layout see http://statamic.com/learn/core-concepts/how-pages-are-built. 66 | 67 | The RSS link is used in the header. If you are creating an RSS feed make sure to change the title attribute. If you are not creating an RSS feed then you can delete this. For more information on the RSS Feed set up see the feed.html template. 68 | 69 | #}} -------------------------------------------------------------------------------- /_content/02-blog/2013-01-01-test-content-one.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Base Elements For Styling 3 | categories: 4 | - Base 5 | tags: 6 | - HTML Content 7 | featured: no 8 | author: Gareth 9 | status: live 10 | summary: This is the kitchen sink, all the common html elements laid out for you to add styling, really helpful to make sure you don't miss any styles. 11 | --- 12 | 13 | # Heading Level 1 14 | ## Heading Level 2 15 | ### Heading Level 3 16 | #### Heading Level 4 17 | ##### Heading Level 5 18 | ###### Heading Level 6 19 | 20 | ### A Paragraph 21 | 22 | This is a paragraph of text which has all the most common html elements in it such as the **strong element** which is used to give text strong importance. You could of course use the b element which represents a span of text stylistically different from normal text, without conveying any special importance or relevance. The mark element which represents highlighted text, i.e., a run of text marked for reference purposes. *The HTML em element marks text that has stress emphasis.* You could of course use the i element which represents a range of text that is set off from the normal text for some reason, for example, technical terms, foreign language phrases, or fictional character thoughts. It is typically displayed in italic type. The next piece of text is marked up using the code element `function()` and finally links will be styled [like this](https://developer.mozilla.org/en-US/docs/HTML/Element/a). 23 | 24 | ### An Ordered list 25 | 26 | 1. List item one 27 | 2. List item two 28 | 3. List item three 29 | 30 | ### A Definition List 31 | 32 |
33 |
Firefox
34 |
A free, open source, cross-platform, graphical web browser 35 | developed by the Mozilla Corporation and hundreds of volunteer 36 |
37 |
38 | 39 | ### A Blockquote 40 | 41 | > Design is the fundamental soul of a human-made creation that ends 42 | > up expressing itself in successive outer layers of the product or 43 | > service. 44 | 45 | ### An Unordered list 46 | 47 | * List item one 48 | * List item two 49 | * List item three 50 | 51 | ### A Code Block 52 | 53 | header h1 a { 54 | display: block; 55 | width: 300px; 56 | height: 80px; 57 | } 58 | 59 | This wraps your code in a `pre` tags and `code` tags. 60 | 61 | ### A Table 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 |
Heading (th)Heading (th)Heading (th)Heading (th)
datadatadatadata
datadatadatadata
datadatadatadata
-------------------------------------------------------------------------------- /_themes/foundation-4/partials/_article_listing.html: -------------------------------------------------------------------------------- 1 | {{ entries:listing 2 | folder="{fold}" 3 | limit="{lim}" 4 | taxonomy="{tax}" 5 | }} 6 | {{ if no_results }} 7 |

Sorry there are no entries to display at this time.

8 | {{ else }} 9 | 10 | {{ if count == "1" }} 11 |
    12 | {{ endif }} 13 |
  1. 14 |
    15 |

    {{ title }}

    16 | 17 | 18 | {{ if categories_list && tags_list }} 19 |

    Filed under: {{ categories_url_list }} and tagged with: {{ tags_url_list }}

    20 | {{ endif }} 21 | 22 | {{ if categories_list && !tags_list }} 23 |

    Filed under: {{ categories_url_list }}

    24 | {{ endif }} 25 | 26 | {{ if !categories_list && tags_list }} 27 |

    Tagged with: {{ tags_url_list }}

    28 | {{ endif }} 29 | 30 | {{ summary|markdown }} 31 | 32 |
    33 |
  2. 34 | {{ if count == total_results }} 35 |
36 | {{ endif }} 37 | 38 | {{ endif }} 39 | {{ /entries:listing }} 40 | 41 | {{# Add simple pagination: limit must equal entries limit #}} 42 | 43 | {{ entries:pagination 44 | folder="{fold}" 45 | limit="{lim}" 46 | taxonomy="{tax}" 47 | }} 48 | {{# THIS SHOULD USE LIM VARIABLE BUT DOESN'T WORK - FIX COMING 1.5 #}} 49 | {{ if total_items > "3" }} 50 |
51 | {{ if previous_page }} 52 |
53 | ← Previous 54 |
55 | {{ endif }} 56 | {{ if previous_page && next_page }} 57 |
58 | Next → 59 |
60 | {{ endif }} 61 | {{ if !previous_page && next_page }} 62 |
63 | Next → 64 |
65 | {{ endif }} 66 |
67 | {{ endif }} 68 | {{ /entries:pagination }} 69 | 70 | {{# 71 | ==================================== 72 | NOTES 73 | ==================================== 74 | 75 | This partial displays an article listing. The partials are designed so that you can use them modularly in your templates. The variables which are used in the entries listing tag are set in the template which calls the partial e.g. look in the default template you will see three variables: fold, lim, and tax. It is here where you set those values to whichever folder name the articles are reading from e.g. blog, the number of articles to display (lim) and whether you are displaying taxonomies or not. 76 | 77 | For more information on partials see http://statamic.com/learn/theming/partials. 78 | 79 | #}} 80 | -------------------------------------------------------------------------------- /_themes/foundation-4/js/foundation/foundation.magellan.js: -------------------------------------------------------------------------------- 1 | /*jslint unparam: true, browser: true, indent: 2 */ 2 | 3 | ;(function ($, window, document, undefined) { 4 | 'use strict'; 5 | 6 | Foundation.libs.magellan = { 7 | name : 'magellan', 8 | 9 | version : '4.2.2', 10 | 11 | settings : { 12 | activeClass: 'active', 13 | threshold: 0 14 | }, 15 | 16 | init : function (scope, method, options) { 17 | this.scope = scope || this.scope; 18 | Foundation.inherit(this, 'data_options'); 19 | 20 | if (typeof method === 'object') { 21 | $.extend(true, this.settings, method); 22 | } 23 | 24 | if (typeof method !== 'string') { 25 | if (!this.settings.init) { 26 | this.fixed_magellan = $("[data-magellan-expedition]"); 27 | this.set_threshold(); 28 | this.last_destination = $('[data-magellan-destination]').last(); 29 | this.events(); 30 | } 31 | 32 | return this.settings.init; 33 | } else { 34 | return this[method].call(this, options); 35 | } 36 | }, 37 | 38 | events : function () { 39 | var self = this; 40 | $(this.scope).on('arrival.fndtn.magellan', '[data-magellan-arrival]', function (e) { 41 | var $destination = $(this), 42 | $expedition = $destination.closest('[data-magellan-expedition]'), 43 | activeClass = $expedition.attr('data-magellan-active-class') 44 | || self.settings.activeClass; 45 | 46 | $destination 47 | .closest('[data-magellan-expedition]') 48 | .find('[data-magellan-arrival]') 49 | .not($destination) 50 | .removeClass(activeClass); 51 | $destination.addClass(activeClass); 52 | }); 53 | 54 | this.fixed_magellan 55 | .on('update-position.fndtn.magellan', function(){ 56 | var $el = $(this); 57 | // $el.data("magellan-fixed-position",""); 58 | // $el.data("magellan-top-offset", ""); 59 | }) 60 | .trigger('update-position'); 61 | 62 | $(window) 63 | .on('resize.fndtn.magellan', function() { 64 | this.fixed_magellan.trigger('update-position'); 65 | }.bind(this)) 66 | 67 | .on('scroll.fndtn.magellan', function() { 68 | var windowScrollTop = $(window).scrollTop(); 69 | self.fixed_magellan.each(function() { 70 | var $expedition = $(this); 71 | if (typeof $expedition.data('magellan-top-offset') === 'undefined') { 72 | $expedition.data('magellan-top-offset', $expedition.offset().top); 73 | } 74 | if (typeof $expedition.data('magellan-fixed-position') === 'undefined') { 75 | $expedition.data('magellan-fixed-position', false) 76 | } 77 | var fixed_position = (windowScrollTop + self.settings.threshold) > $expedition.data("magellan-top-offset"); 78 | var attr = $expedition.attr('data-magellan-top-offset'); 79 | 80 | if ($expedition.data("magellan-fixed-position") != fixed_position) { 81 | $expedition.data("magellan-fixed-position", fixed_position); 82 | if (fixed_position) { 83 | $expedition.addClass('fixed'); 84 | $expedition.css({position:"fixed", top:0}); 85 | } else { 86 | $expedition.removeClass('fixed'); 87 | $expedition.css({position:"", top:""}); 88 | } 89 | if (fixed_position && typeof attr != 'undefined' && attr != false) { 90 | $expedition.css({position:"fixed", top:attr + "px"}); 91 | } 92 | } 93 | }); 94 | }); 95 | 96 | 97 | if (this.last_destination.length > 0) { 98 | $(window).on('scroll.fndtn.magellan', function (e) { 99 | var windowScrollTop = $(window).scrollTop(), 100 | scrolltopPlusHeight = windowScrollTop + $(window).height(), 101 | lastDestinationTop = Math.ceil(self.last_destination.offset().top); 102 | 103 | $('[data-magellan-destination]').each(function () { 104 | var $destination = $(this), 105 | destination_name = $destination.attr('data-magellan-destination'), 106 | topOffset = $destination.offset().top - windowScrollTop; 107 | 108 | if (topOffset <= self.settings.threshold) { 109 | $("[data-magellan-arrival='" + destination_name + "']").trigger('arrival'); 110 | } 111 | // In large screens we may hit the bottom of the page and dont reach the top of the last magellan-destination, so lets force it 112 | if (scrolltopPlusHeight >= $(self.scope).height() && lastDestinationTop > windowScrollTop && lastDestinationTop < scrolltopPlusHeight) { 113 | $('[data-magellan-arrival]').last().trigger('arrival'); 114 | } 115 | }); 116 | }); 117 | } 118 | 119 | this.settings.init = true; 120 | }, 121 | 122 | set_threshold : function () { 123 | if (!this.settings.threshold) { 124 | this.settings.threshold = (this.fixed_magellan.length > 0) ? 125 | this.outerHeight(this.fixed_magellan, true) : 0; 126 | } 127 | }, 128 | 129 | off : function () { 130 | $(this.scope).off('.fndtn.magellan'); 131 | }, 132 | 133 | reflow : function () {} 134 | }; 135 | }(Foundation.zj, this, this.document)); 136 | -------------------------------------------------------------------------------- /_themes/foundation-4/js/foundation/foundation.placeholder.js: -------------------------------------------------------------------------------- 1 | /*! http://mths.be/placeholder v2.0.7 by @mathias 2 | Modified to work with Zepto.js by ZURB 3 | */ 4 | ;(function(window, document, $) { 5 | 6 | var isInputSupported = 'placeholder' in document.createElement('input'), 7 | isTextareaSupported = 'placeholder' in document.createElement('textarea'), 8 | prototype = $.fn, 9 | valHooks = $.valHooks, 10 | hooks, 11 | placeholder; 12 | 13 | if (isInputSupported && isTextareaSupported) { 14 | 15 | placeholder = prototype.placeholder = function() { 16 | return this; 17 | }; 18 | 19 | placeholder.input = placeholder.textarea = true; 20 | 21 | } else { 22 | 23 | placeholder = prototype.placeholder = function() { 24 | var $this = this; 25 | $this 26 | .filter((isInputSupported ? 'textarea' : ':input') + '[placeholder]') 27 | .not('.placeholder') 28 | .bind({ 29 | 'focus.placeholder': clearPlaceholder, 30 | 'blur.placeholder': setPlaceholder 31 | }) 32 | .data('placeholder-enabled', true) 33 | .trigger('blur.placeholder'); 34 | return $this; 35 | }; 36 | 37 | placeholder.input = isInputSupported; 38 | placeholder.textarea = isTextareaSupported; 39 | 40 | hooks = { 41 | 'get': function(element) { 42 | var $element = $(element); 43 | return $element.data('placeholder-enabled') && $element.hasClass('placeholder') ? '' : element.value; 44 | }, 45 | 'set': function(element, value) { 46 | var $element = $(element); 47 | if (!$element.data('placeholder-enabled')) { 48 | return element.value = value; 49 | } 50 | if (value == '') { 51 | element.value = value; 52 | // Issue #56: Setting the placeholder causes problems if the element continues to have focus. 53 | if (element != document.activeElement) { 54 | // We can't use `triggerHandler` here because of dummy text/password inputs :( 55 | setPlaceholder.call(element); 56 | } 57 | } else if ($element.hasClass('placeholder')) { 58 | clearPlaceholder.call(element, true, value) || (element.value = value); 59 | } else { 60 | element.value = value; 61 | } 62 | // `set` can not return `undefined`; see http://jsapi.info/jquery/1.7.1/val#L2363 63 | return $element; 64 | } 65 | }; 66 | 67 | isInputSupported || (valHooks.input = hooks); 68 | isTextareaSupported || (valHooks.textarea = hooks); 69 | 70 | $(function() { 71 | // Look for forms 72 | $(document).delegate('form', 'submit.placeholder', function() { 73 | // Clear the placeholder values so they don't get submitted 74 | var $inputs = $('.placeholder', this).each(clearPlaceholder); 75 | setTimeout(function() { 76 | $inputs.each(setPlaceholder); 77 | }, 10); 78 | }); 79 | }); 80 | 81 | // Clear placeholder values upon page reload 82 | $(window).bind('beforeunload.placeholder', function() { 83 | $('.placeholder').each(function() { 84 | this.value = ''; 85 | }); 86 | }); 87 | 88 | } 89 | 90 | function args(elem) { 91 | // Return an object of element attributes 92 | var newAttrs = {}, 93 | rinlinejQuery = /^jQuery\d+$/; 94 | $.each(elem.attributes, function(i, attr) { 95 | if (attr.specified && !rinlinejQuery.test(attr.name)) { 96 | newAttrs[attr.name] = attr.value; 97 | } 98 | }); 99 | return newAttrs; 100 | } 101 | 102 | function clearPlaceholder(event, value) { 103 | var input = this, 104 | $input = $(input); 105 | if (input.value == $input.attr('placeholder') && $input.hasClass('placeholder')) { 106 | if ($input.data('placeholder-password')) { 107 | $input = $input.hide().next().show().attr('id', $input.removeAttr('id').data('placeholder-id')); 108 | // If `clearPlaceholder` was called from `$.valHooks.input.set` 109 | if (event === true) { 110 | return $input[0].value = value; 111 | } 112 | $input.focus(); 113 | } else { 114 | input.value = ''; 115 | $input.removeClass('placeholder'); 116 | input == document.activeElement && input.select(); 117 | } 118 | } 119 | } 120 | 121 | function setPlaceholder() { 122 | var $replacement, 123 | input = this, 124 | $input = $(input), 125 | $origInput = $input, 126 | id = this.id; 127 | if (input.value == '') { 128 | if (input.type == 'password') { 129 | if (!$input.data('placeholder-textinput')) { 130 | try { 131 | $replacement = $input.clone().attr({ 'type': 'text' }); 132 | } catch(e) { 133 | $replacement = $('').attr($.extend(args(this), { 'type': 'text' })); 134 | } 135 | $replacement 136 | .removeAttr('name') 137 | .data({ 138 | 'placeholder-password': true, 139 | 'placeholder-id': id 140 | }) 141 | .bind('focus.placeholder', clearPlaceholder); 142 | $input 143 | .data({ 144 | 'placeholder-textinput': $replacement, 145 | 'placeholder-id': id 146 | }) 147 | .before($replacement); 148 | } 149 | $input = $input.removeAttr('id').hide().prev().attr('id', id).show(); 150 | // Note: `$input[0] != input` now! 151 | } 152 | $input.addClass('placeholder'); 153 | $input[0].value = $input.attr('placeholder'); 154 | } else { 155 | $input.removeClass('placeholder'); 156 | } 157 | } 158 | 159 | }(this, document, Foundation.zj)); 160 | 161 | ;(function ($, window, document, undefined) { 162 | 'use strict'; 163 | 164 | Foundation.libs.placeholder = { 165 | name : 'placeholder', 166 | 167 | version : '4.2.2', 168 | 169 | init : function (scope, method, options) { 170 | this.scope = scope || this.scope; 171 | 172 | if (typeof method !== 'string') { 173 | window.onload = function () { 174 | $('input, textarea').placeholder(); 175 | } 176 | } 177 | } 178 | }; 179 | }(Foundation.zj, this, this.document)); -------------------------------------------------------------------------------- /_themes/foundation-4/js/foundation/foundation.dropdown.js: -------------------------------------------------------------------------------- 1 | /*jslint unparam: true, browser: true, indent: 2 */ 2 | 3 | ;(function ($, window, document, undefined) { 4 | 'use strict'; 5 | 6 | Foundation.libs.dropdown = { 7 | name : 'dropdown', 8 | 9 | version : '4.3.0', 10 | 11 | settings : { 12 | activeClass: 'open', 13 | is_hover: false, 14 | opened: function(){}, 15 | closed: function(){} 16 | }, 17 | 18 | init : function (scope, method, options) { 19 | this.scope = scope || this.scope; 20 | Foundation.inherit(this, 'throttle scrollLeft data_options'); 21 | 22 | if (typeof method === 'object') { 23 | $.extend(true, this.settings, method); 24 | } 25 | 26 | if (typeof method !== 'string') { 27 | 28 | if (!this.settings.init) { 29 | this.events(); 30 | } 31 | 32 | return this.settings.init; 33 | } else { 34 | return this[method].call(this, options); 35 | } 36 | }, 37 | 38 | events : function () { 39 | var self = this; 40 | 41 | $(this.scope) 42 | .on('click.fndtn.dropdown', '[data-dropdown]', function (e) { 43 | var settings = $.extend({}, self.settings, self.data_options($(this))); 44 | e.preventDefault(); 45 | 46 | if (!settings.is_hover) self.toggle($(this)); 47 | }) 48 | .on('mouseenter', '[data-dropdown]', function (e) { 49 | var settings = $.extend({}, self.settings, self.data_options($(this))); 50 | if (settings.is_hover) self.toggle($(this)); 51 | }) 52 | .on('mouseleave', '[data-dropdown-content]', function (e) { 53 | var target = $('[data-dropdown="' + $(this).attr('id') + '"]'), 54 | settings = $.extend({}, self.settings, self.data_options(target)); 55 | if (settings.is_hover) self.close.call(self, $(this)); 56 | }) 57 | .on('opened.fndtn.dropdown', '[data-dropdown-content]', this.settings.opened) 58 | .on('closed.fndtn.dropdown', '[data-dropdown-content]', this.settings.closed); 59 | 60 | $(document).on('click.fndtn.dropdown', function (e) { 61 | var parent = $(e.target).closest('[data-dropdown-content]'); 62 | 63 | if ($(e.target).data('dropdown')) { 64 | return; 65 | } 66 | if (parent.length > 0 && ($(e.target).is('[data-dropdown-content]') || $.contains(parent.first()[0], e.target))) { 67 | e.stopPropagation(); 68 | return; 69 | } 70 | 71 | self.close.call(self, $('[data-dropdown-content]')); 72 | }); 73 | 74 | $(window).on('resize.fndtn.dropdown', self.throttle(function () { 75 | self.resize.call(self); 76 | }, 50)).trigger('resize'); 77 | 78 | this.settings.init = true; 79 | }, 80 | 81 | close: function (dropdown) { 82 | var self = this; 83 | dropdown.each(function () { 84 | if ($(this).hasClass(self.settings.activeClass)) { 85 | $(this) 86 | .css(Foundation.rtl ? 'right':'left', '-99999px') 87 | .removeClass(self.settings.activeClass); 88 | $(this).trigger('closed'); 89 | } 90 | }); 91 | }, 92 | 93 | open: function (dropdown, target) { 94 | this 95 | .css(dropdown 96 | .addClass(this.settings.activeClass), target); 97 | dropdown.trigger('opened'); 98 | }, 99 | 100 | toggle : function (target) { 101 | var dropdown = $('#' + target.data('dropdown')); 102 | 103 | this.close.call(this, $('[data-dropdown-content]').not(dropdown)); 104 | 105 | if (dropdown.hasClass(this.settings.activeClass)) { 106 | this.close.call(this, dropdown); 107 | } else { 108 | this.close.call(this, $('[data-dropdown-content]')) 109 | this.open.call(this, dropdown, target); 110 | } 111 | }, 112 | 113 | resize : function () { 114 | var dropdown = $('[data-dropdown-content].open'), 115 | target = $("[data-dropdown='" + dropdown.attr('id') + "']"); 116 | 117 | if (dropdown.length && target.length) { 118 | this.css(dropdown, target); 119 | } 120 | }, 121 | 122 | css : function (dropdown, target) { 123 | var offset_parent = dropdown.offsetParent(); 124 | // if (offset_parent.length > 0 && /body/i.test(dropdown.offsetParent()[0].nodeName)) { 125 | var position = target.offset(); 126 | position.top -= offset_parent.offset().top; 127 | position.left -= offset_parent.offset().left; 128 | // } else { 129 | // var position = target.position(); 130 | // } 131 | 132 | if (this.small()) { 133 | dropdown.css({ 134 | position : 'absolute', 135 | width: '95%', 136 | left: '2.5%', 137 | 'max-width': 'none', 138 | top: position.top + this.outerHeight(target) 139 | }); 140 | } else { 141 | if (!Foundation.rtl && $(window).width() > this.outerWidth(dropdown) + target.offset().left) { 142 | var left = position.left; 143 | if (dropdown.hasClass('right')) { 144 | dropdown.removeClass('right'); 145 | } 146 | } else { 147 | if (!dropdown.hasClass('right')) { 148 | dropdown.addClass('right'); 149 | } 150 | var left = position.left - (this.outerWidth(dropdown) - this.outerWidth(target)); 151 | } 152 | 153 | dropdown.attr('style', '').css({ 154 | position : 'absolute', 155 | top: position.top + this.outerHeight(target), 156 | left: left 157 | }); 158 | } 159 | 160 | return dropdown; 161 | }, 162 | 163 | small : function () { 164 | return $(window).width() < 768 || $('html').hasClass('lt-ie9'); 165 | }, 166 | 167 | off: function () { 168 | $(this.scope).off('.fndtn.dropdown'); 169 | $('html, body').off('.fndtn.dropdown'); 170 | $(window).off('.fndtn.dropdown'); 171 | $('[data-dropdown-content]').off('.fndtn.dropdown'); 172 | this.settings.init = false; 173 | }, 174 | 175 | reflow : function () {} 176 | }; 177 | }(Foundation.zj, this, this.document)); 178 | -------------------------------------------------------------------------------- /_themes/foundation-4/js/foundation/foundation.tooltips.js: -------------------------------------------------------------------------------- 1 | /*jslint unparam: true, browser: true, indent: 2 */ 2 | 3 | ;(function ($, window, document, undefined) { 4 | 'use strict'; 5 | 6 | Foundation.libs.tooltips = { 7 | name : 'tooltips', 8 | 9 | version : '4.2.2', 10 | 11 | settings : { 12 | selector : '.has-tip', 13 | additionalInheritableClasses : [], 14 | tooltipClass : '.tooltip', 15 | appendTo: 'body', 16 | 'disable-for-touch': false, 17 | tipTemplate : function (selector, content) { 18 | return '' + content + ''; 21 | } 22 | }, 23 | 24 | cache : {}, 25 | 26 | init : function (scope, method, options) { 27 | Foundation.inherit(this, 'data_options'); 28 | var self = this; 29 | 30 | if (typeof method === 'object') { 31 | $.extend(true, this.settings, method); 32 | } else if (typeof options !== 'undefined') { 33 | $.extend(true, this.settings, options); 34 | } 35 | 36 | if (typeof method !== 'string') { 37 | if (Modernizr.touch) { 38 | $(this.scope) 39 | .on('click.fndtn.tooltip touchstart.fndtn.tooltip touchend.fndtn.tooltip', 40 | '[data-tooltip]', function (e) { 41 | var settings = $.extend({}, self.settings, self.data_options($(this))); 42 | if (!settings['disable-for-touch']) { 43 | e.preventDefault(); 44 | $(settings.tooltipClass).hide(); 45 | self.showOrCreateTip($(this)); 46 | } 47 | }) 48 | .on('click.fndtn.tooltip touchstart.fndtn.tooltip touchend.fndtn.tooltip', 49 | this.settings.tooltipClass, function (e) { 50 | e.preventDefault(); 51 | $(this).fadeOut(150); 52 | }); 53 | } else { 54 | $(this.scope) 55 | .on('mouseenter.fndtn.tooltip mouseleave.fndtn.tooltip', 56 | '[data-tooltip]', function (e) { 57 | var $this = $(this); 58 | 59 | if (/enter|over/i.test(e.type)) { 60 | self.showOrCreateTip($this); 61 | } else if (e.type === 'mouseout' || e.type === 'mouseleave') { 62 | self.hide($this); 63 | } 64 | }); 65 | } 66 | 67 | // $(this.scope).data('fndtn-tooltips', true); 68 | } else { 69 | return this[method].call(this, options); 70 | } 71 | 72 | }, 73 | 74 | showOrCreateTip : function ($target) { 75 | var $tip = this.getTip($target); 76 | 77 | if ($tip && $tip.length > 0) { 78 | return this.show($target); 79 | } 80 | 81 | return this.create($target); 82 | }, 83 | 84 | getTip : function ($target) { 85 | var selector = this.selector($target), 86 | tip = null; 87 | 88 | if (selector) { 89 | tip = $('span[data-selector="' + selector + '"]' + this.settings.tooltipClass); 90 | } 91 | 92 | return (typeof tip === 'object') ? tip : false; 93 | }, 94 | 95 | selector : function ($target) { 96 | var id = $target.attr('id'), 97 | dataSelector = $target.attr('data-tooltip') || $target.attr('data-selector'); 98 | 99 | if ((id && id.length < 1 || !id) && typeof dataSelector != 'string') { 100 | dataSelector = 'tooltip' + Math.random().toString(36).substring(7); 101 | $target.attr('data-selector', dataSelector); 102 | } 103 | 104 | return (id && id.length > 0) ? id : dataSelector; 105 | }, 106 | 107 | create : function ($target) { 108 | var $tip = $(this.settings.tipTemplate(this.selector($target), $('
').html($target.attr('title')).html())), 109 | classes = this.inheritable_classes($target); 110 | 111 | $tip.addClass(classes).appendTo(this.settings.appendTo); 112 | if (Modernizr.touch) { 113 | $tip.append('tap to close '); 114 | } 115 | $target.removeAttr('title').attr('title',''); 116 | this.show($target); 117 | }, 118 | 119 | reposition : function (target, tip, classes) { 120 | var width, nub, nubHeight, nubWidth, column, objPos; 121 | 122 | tip.css('visibility', 'hidden').show(); 123 | 124 | width = target.data('width'); 125 | nub = tip.children('.nub'); 126 | nubHeight = this.outerHeight(nub); 127 | nubWidth = this.outerHeight(nub); 128 | 129 | objPos = function (obj, top, right, bottom, left, width) { 130 | return obj.css({ 131 | 'top' : (top) ? top : 'auto', 132 | 'bottom' : (bottom) ? bottom : 'auto', 133 | 'left' : (left) ? left : 'auto', 134 | 'right' : (right) ? right : 'auto', 135 | 'width' : (width) ? width : 'auto' 136 | }).end(); 137 | }; 138 | 139 | objPos(tip, (target.offset().top + this.outerHeight(target) + 10), 'auto', 'auto', target.offset().left, width); 140 | 141 | if ($(window).width() < 767) { 142 | objPos(tip, (target.offset().top + this.outerHeight(target) + 10), 'auto', 'auto', 12.5, $(this.scope).width()); 143 | tip.addClass('tip-override'); 144 | objPos(nub, -nubHeight, 'auto', 'auto', target.offset().left); 145 | } else { 146 | var left = target.offset().left; 147 | if (Foundation.rtl) { 148 | left = target.offset().left + target.offset().width - this.outerWidth(tip); 149 | } 150 | objPos(tip, (target.offset().top + this.outerHeight(target) + 10), 'auto', 'auto', left, width); 151 | tip.removeClass('tip-override'); 152 | if (classes && classes.indexOf('tip-top') > -1) { 153 | objPos(tip, (target.offset().top - this.outerHeight(tip)), 'auto', 'auto', left, width) 154 | .removeClass('tip-override'); 155 | } else if (classes && classes.indexOf('tip-left') > -1) { 156 | objPos(tip, (target.offset().top + (this.outerHeight(target) / 2) - nubHeight*2.5), 'auto', 'auto', (target.offset().left - this.outerWidth(tip) - nubHeight), width) 157 | .removeClass('tip-override'); 158 | } else if (classes && classes.indexOf('tip-right') > -1) { 159 | objPos(tip, (target.offset().top + (this.outerHeight(target) / 2) - nubHeight*2.5), 'auto', 'auto', (target.offset().left + this.outerWidth(target) + nubHeight), width) 160 | .removeClass('tip-override'); 161 | } 162 | } 163 | 164 | tip.css('visibility', 'visible').hide(); 165 | }, 166 | 167 | inheritable_classes : function (target) { 168 | var inheritables = ['tip-top', 'tip-left', 'tip-bottom', 'tip-right', 'noradius'].concat(this.settings.additionalInheritableClasses), 169 | classes = target.attr('class'), 170 | filtered = classes ? $.map(classes.split(' '), function (el, i) { 171 | if ($.inArray(el, inheritables) !== -1) { 172 | return el; 173 | } 174 | }).join(' ') : ''; 175 | 176 | return $.trim(filtered); 177 | }, 178 | 179 | show : function ($target) { 180 | var $tip = this.getTip($target); 181 | 182 | this.reposition($target, $tip, $target.attr('class')); 183 | $tip.fadeIn(150); 184 | }, 185 | 186 | hide : function ($target) { 187 | var $tip = this.getTip($target); 188 | 189 | $tip.fadeOut(150); 190 | }, 191 | 192 | // deprecate reload 193 | reload : function () { 194 | var $self = $(this); 195 | 196 | return ($self.data('fndtn-tooltips')) ? $self.foundationTooltips('destroy').foundationTooltips('init') : $self.foundationTooltips('init'); 197 | }, 198 | 199 | off : function () { 200 | $(this.scope).off('.fndtn.tooltip'); 201 | $(this.settings.tooltipClass).each(function (i) { 202 | $('[data-tooltip]').get(i).attr('title', $(this).text()); 203 | }).remove(); 204 | }, 205 | 206 | reflow : function () {} 207 | }; 208 | }(Foundation.zj, this, this.document)); -------------------------------------------------------------------------------- /_themes/foundation-4/js/foundation/foundation.abide.js: -------------------------------------------------------------------------------- 1 | /*jslint unparam: true, browser: true, indent: 2 */ 2 | 3 | ;(function ($, window, document, undefined) { 4 | 'use strict'; 5 | 6 | Foundation.libs.abide = { 7 | name : 'abide', 8 | 9 | version : '4.3.0', 10 | 11 | settings : { 12 | live_validate : true, 13 | focus_on_invalid : true, 14 | timeout : 1000, 15 | patterns : { 16 | alpha: /[a-zA-Z]+/, 17 | alpha_numeric : /[a-zA-Z0-9]+/, 18 | integer: /-?\d+/, 19 | number: /-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?/, 20 | 21 | // generic password: upper-case, lower-case, number/special character, and min 8 characters 22 | password : /(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/, 23 | 24 | // amex, visa, diners 25 | card : /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/, 26 | cvv : /^([0-9]){3,4}$/, 27 | 28 | // http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address 29 | email : /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, 30 | 31 | url: /(https?|ftp|file|ssh):\/\/(((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?/, 32 | // abc.de 33 | domain: /^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}$/, 34 | 35 | datetime: /([0-2][0-9]{3})\-([0-1][0-9])\-([0-3][0-9])T([0-5][0-9])\:([0-5][0-9])\:([0-5][0-9])(Z|([\-\+]([0-1][0-9])\:00))/, 36 | // YYYY-MM-DD 37 | date: /(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))/, 38 | // HH:MM:SS 39 | time : /(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]){2}/, 40 | dateISO: /\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/, 41 | // MM/DD/YYYY 42 | month_day_year : /(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.](19|20)\d\d/, 43 | 44 | // #FFF or #FFFFFF 45 | color: /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/ 46 | } 47 | }, 48 | 49 | timer : null, 50 | 51 | init : function (scope, method, options) { 52 | if (typeof method === 'object') { 53 | $.extend(true, this.settings, method); 54 | } 55 | 56 | if (typeof method !== 'string') { 57 | if (!this.settings.init) { this.events(); } 58 | 59 | } else { 60 | return this[method].call(this, options); 61 | } 62 | }, 63 | 64 | events : function () { 65 | var self = this, 66 | forms = $('form[data-abide]', this.scope).attr('novalidate', 'novalidate'); 67 | 68 | forms 69 | .on('submit validate', function (e) { 70 | return self.validate($(this).find('input, textarea, select').get(), e); 71 | }); 72 | 73 | this.settings.init = true; 74 | 75 | if (!this.settings.live_validate) return; 76 | 77 | forms 78 | .find('input, textarea, select') 79 | .on('blur change', function (e) { 80 | self.validate([this], e); 81 | }) 82 | .on('keydown', function (e) { 83 | clearTimeout(self.timer); 84 | self.timer = setTimeout(function () { 85 | self.validate([this], e); 86 | }.bind(this), self.settings.timeout); 87 | }); 88 | }, 89 | 90 | validate : function (els, e) { 91 | var validations = this.parse_patterns(els), 92 | validation_count = validations.length, 93 | form = $(els[0]).closest('form'); 94 | 95 | while (validation_count--) { 96 | if (!validations[validation_count] && /submit/.test(e.type)) { 97 | if (this.settings.focus_on_invalid) els[validation_count].focus(); 98 | form.trigger('invalid'); 99 | $(els[validation_count]).closest('form').attr('data-invalid', ''); 100 | return false; 101 | } 102 | } 103 | 104 | if (/submit/.test(e.type)) { 105 | form.trigger('valid'); 106 | } 107 | 108 | form.removeAttr('data-invalid'); 109 | 110 | return true; 111 | }, 112 | 113 | parse_patterns : function (els) { 114 | var count = els.length, 115 | el_patterns = []; 116 | 117 | for (var i = count - 1; i >= 0; i--) { 118 | el_patterns.push(this.pattern(els[i])); 119 | } 120 | 121 | return this.check_validation_and_apply_styles(el_patterns); 122 | }, 123 | 124 | pattern : function (el) { 125 | var type = el.getAttribute('type'), 126 | required = typeof el.getAttribute('required') === 'string'; 127 | 128 | if (this.settings.patterns.hasOwnProperty(type)) { 129 | return [el, this.settings.patterns[type], required]; 130 | } 131 | 132 | var pattern = el.getAttribute('pattern') || ''; 133 | 134 | if (this.settings.patterns.hasOwnProperty(pattern) && pattern.length > 0) { 135 | return [el, this.settings.patterns[pattern], required]; 136 | } else if (pattern.length > 0) { 137 | return [el, new RegExp(pattern), required]; 138 | } 139 | 140 | pattern = /.*/; 141 | 142 | return [el, pattern, required]; 143 | }, 144 | 145 | check_validation_and_apply_styles : function (el_patterns) { 146 | var count = el_patterns.length, 147 | validations = []; 148 | 149 | for (var i = count - 1; i >= 0; i--) { 150 | var el = el_patterns[i][0], 151 | required = el_patterns[i][2], 152 | value = el.value, 153 | is_radio = el.type === "radio", 154 | valid_length = (required) ? (el.value.length > 0) : true; 155 | 156 | if (is_radio && required) { 157 | validations.push(this.valid_radio(el, required)); 158 | } else { 159 | if (el_patterns[i][1].test(value) && valid_length || 160 | !required && el.value.length < 1) { 161 | $(el).removeAttr('data-invalid').parent().removeClass('error'); 162 | validations.push(true); 163 | } else { 164 | $(el).attr('data-invalid', '').parent().addClass('error'); 165 | validations.push(false); 166 | } 167 | } 168 | } 169 | 170 | return validations; 171 | }, 172 | 173 | valid_radio : function (el, required) { 174 | var name = el.getAttribute('name'), 175 | group = document.getElementsByName(name), 176 | count = group.length, 177 | valid = false; 178 | 179 | for (var i=0; i < count; i++) { 180 | if (group[i].checked) valid = true; 181 | } 182 | 183 | for (var i=0; i < count; i++) { 184 | if (valid) { 185 | $(group[i]).removeAttr('data-invalid').parent().removeClass('error'); 186 | } else { 187 | $(group[i]).attr('data-invalid', '').parent().addClass('error'); 188 | } 189 | } 190 | 191 | return valid; 192 | } 193 | }; 194 | }(Foundation.zj, this, this.document)); -------------------------------------------------------------------------------- /_themes/foundation-4/js/foundation/foundation.interchange.js: -------------------------------------------------------------------------------- 1 | /*jslint unparam: true, browser: true, indent: 2 */ 2 | 3 | ;(function ($, window, document, undefined) { 4 | 'use strict'; 5 | 6 | Foundation.libs.interchange = { 7 | name : 'interchange', 8 | 9 | version : '4.2.4', 10 | 11 | cache : {}, 12 | 13 | images_loaded : false, 14 | 15 | settings : { 16 | load_attr : 'interchange', 17 | 18 | named_queries : { 19 | 'default' : 'only screen and (min-width: 1px)', 20 | small : 'only screen and (min-width: 768px)', 21 | medium : 'only screen and (min-width: 1280px)', 22 | large : 'only screen and (min-width: 1440px)', 23 | landscape : 'only screen and (orientation: landscape)', 24 | portrait : 'only screen and (orientation: portrait)', 25 | retina : 'only screen and (-webkit-min-device-pixel-ratio: 2),' + 26 | 'only screen and (min--moz-device-pixel-ratio: 2),' + 27 | 'only screen and (-o-min-device-pixel-ratio: 2/1),' + 28 | 'only screen and (min-device-pixel-ratio: 2),' + 29 | 'only screen and (min-resolution: 192dpi),' + 30 | 'only screen and (min-resolution: 2dppx)' 31 | }, 32 | 33 | directives : { 34 | replace: function (el, path) { 35 | if (/IMG/.test(el[0].nodeName)) { 36 | var orig_path = el[0].src; 37 | 38 | if (new RegExp(path, 'i').test(orig_path)) return; 39 | 40 | el[0].src = path; 41 | 42 | return el.trigger('replace', [el[0].src, orig_path]); 43 | } 44 | } 45 | } 46 | }, 47 | 48 | init : function (scope, method, options) { 49 | Foundation.inherit(this, 'throttle'); 50 | 51 | if (typeof method === 'object') { 52 | $.extend(true, this.settings, method); 53 | } 54 | 55 | this.events(); 56 | this.images(); 57 | 58 | if (typeof method !== 'string') { 59 | return this.settings.init; 60 | } else { 61 | return this[method].call(this, options); 62 | } 63 | }, 64 | 65 | events : function () { 66 | var self = this; 67 | 68 | $(window).on('resize.fndtn.interchange', self.throttle(function () { 69 | self.resize.call(self); 70 | }, 50)); 71 | }, 72 | 73 | resize : function () { 74 | var cache = this.cache; 75 | 76 | if(!this.images_loaded) { 77 | setTimeout($.proxy(this.resize, this), 50); 78 | return; 79 | } 80 | 81 | for (var uuid in cache) { 82 | if (cache.hasOwnProperty(uuid)) { 83 | var passed = this.results(uuid, cache[uuid]); 84 | 85 | if (passed) { 86 | this.settings.directives[passed 87 | .scenario[1]](passed.el, passed.scenario[0]); 88 | } 89 | } 90 | } 91 | 92 | }, 93 | 94 | results : function (uuid, scenarios) { 95 | var count = scenarios.length; 96 | 97 | if (count > 0) { 98 | var el = $('[data-uuid="' + uuid + '"]'); 99 | 100 | for (var i = count - 1; i >= 0; i--) { 101 | var mq, rule = scenarios[i][2]; 102 | if (this.settings.named_queries.hasOwnProperty(rule)) { 103 | mq = matchMedia(this.settings.named_queries[rule]); 104 | } else { 105 | mq = matchMedia(rule); 106 | } 107 | if (mq.matches) { 108 | return {el: el, scenario: scenarios[i]}; 109 | } 110 | } 111 | } 112 | 113 | return false; 114 | }, 115 | 116 | images : function (force_update) { 117 | if (typeof this.cached_images === 'undefined' || force_update) { 118 | return this.update_images(); 119 | } 120 | 121 | return this.cached_images; 122 | }, 123 | 124 | update_images : function () { 125 | var images = document.getElementsByTagName('img'), 126 | count = images.length, 127 | loaded_count = 0, 128 | data_attr = 'data-' + this.settings.load_attr; 129 | 130 | this.cached_images = []; 131 | this.images_loaded = false; 132 | 133 | for (var i = count - 1; i >= 0; i--) { 134 | this.loaded($(images[i]), function (image) { 135 | loaded_count++; 136 | if (image) { 137 | var str = image.getAttribute(data_attr) || ''; 138 | 139 | if (str.length > 0) { 140 | this.cached_images.push(image); 141 | } 142 | } 143 | 144 | if(loaded_count === count) { 145 | this.images_loaded = true; 146 | this.enhance(); 147 | } 148 | }.bind(this)); 149 | } 150 | 151 | return 'deferred'; 152 | }, 153 | 154 | // based on jquery.imageready.js 155 | // @weblinc, @jsantell, (c) 2012 156 | 157 | loaded : function (image, callback) { 158 | function loaded () { 159 | callback(image[0]); 160 | } 161 | 162 | function bindLoad () { 163 | this.one('load', loaded); 164 | 165 | if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { 166 | var src = this.attr( 'src' ), 167 | param = src.match( /\?/ ) ? '&' : '?'; 168 | 169 | param += 'random=' + (new Date()).getTime(); 170 | this.attr('src', src + param); 171 | } 172 | } 173 | 174 | if (!image.attr('src')) { 175 | loaded(); 176 | return; 177 | } 178 | 179 | if (image[0].complete || image[0].readyState === 4) { 180 | loaded(); 181 | } else { 182 | bindLoad.call(image); 183 | } 184 | }, 185 | 186 | enhance : function () { 187 | var count = this.images().length; 188 | 189 | for (var i = count - 1; i >= 0; i--) { 190 | this._object($(this.images()[i])); 191 | } 192 | 193 | return $(window).trigger('resize'); 194 | }, 195 | 196 | parse_params : function (path, directive, mq) { 197 | return [this.trim(path), this.convert_directive(directive), this.trim(mq)]; 198 | }, 199 | 200 | convert_directive : function (directive) { 201 | var trimmed = this.trim(directive); 202 | 203 | if (trimmed.length > 0) { 204 | return trimmed; 205 | } 206 | 207 | return 'replace'; 208 | }, 209 | 210 | _object : function(el) { 211 | var raw_arr = this.parse_data_attr(el), 212 | scenarios = [], count = raw_arr.length; 213 | 214 | if (count > 0) { 215 | for (var i = count - 1; i >= 0; i--) { 216 | var split = raw_arr[i].split(/\((.*?)(\))$/); 217 | 218 | if (split.length > 1) { 219 | var cached_split = split[0].split(','), 220 | params = this.parse_params(cached_split[0], 221 | cached_split[1], split[1]); 222 | 223 | scenarios.push(params); 224 | } 225 | } 226 | } 227 | 228 | return this.store(el, scenarios); 229 | }, 230 | 231 | uuid : function (separator) { 232 | var delim = separator || "-"; 233 | 234 | function S4() { 235 | return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); 236 | } 237 | 238 | return (S4() + S4() + delim + S4() + delim + S4() 239 | + delim + S4() + delim + S4() + S4() + S4()); 240 | }, 241 | 242 | store : function (el, scenarios) { 243 | var uuid = this.uuid(), 244 | current_uuid = el.data('uuid'); 245 | 246 | if (current_uuid) return this.cache[current_uuid]; 247 | 248 | el.attr('data-uuid', uuid); 249 | 250 | return this.cache[uuid] = scenarios; 251 | }, 252 | 253 | trim : function(str) { 254 | if (typeof str === 'string') { 255 | return $.trim(str); 256 | } 257 | 258 | return str; 259 | }, 260 | 261 | parse_data_attr : function (el) { 262 | var raw = el.data(this.settings.load_attr).split(/\[(.*?)\]/), 263 | count = raw.length, output = []; 264 | 265 | for (var i = count - 1; i >= 0; i--) { 266 | if (raw[i].replace(/[\W\d]+/, '').length > 4) { 267 | output.push(raw[i]); 268 | } 269 | } 270 | 271 | return output; 272 | }, 273 | 274 | reflow : function () { 275 | this.images(true); 276 | } 277 | 278 | }; 279 | 280 | }(Foundation.zj, this, this.document)); -------------------------------------------------------------------------------- /_themes/foundation-4/js/vendor/custom.modernizr.js: -------------------------------------------------------------------------------- 1 | /* Modernizr 2.6.2 (Custom Build) | MIT & BSD 2 | * Build: http://modernizr.com/download/#-inlinesvg-svg-svgclippaths-touch-shiv-mq-cssclasses-teststyles-prefixes-ie8compat-load 3 | */ 4 | ;window.Modernizr=function(a,b,c){function y(a){j.cssText=a}function z(a,b){return y(m.join(a+";")+(b||""))}function A(a,b){return typeof a===b}function B(a,b){return!!~(""+a).indexOf(b)}function C(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:A(f,"function")?f.bind(d||b):f}return!1}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n={svg:"http://www.w3.org/2000/svg"},o={},p={},q={},r=[],s=r.slice,t,u=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["­",'"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},v=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return u("@media "+b+" { #"+h+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},w={}.hasOwnProperty,x;!A(w,"undefined")&&!A(w.call,"undefined")?x=function(a,b){return w.call(a,b)}:x=function(a,b){return b in a&&A(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=s.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(s.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(s.call(arguments)))};return e}),o.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:u(["@media (",m.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},o.svg=function(){return!!b.createElementNS&&!!b.createElementNS(n.svg,"svg").createSVGRect},o.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="",(a.firstChild&&a.firstChild.namespaceURI)==n.svg},o.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(l.call(b.createElementNS(n.svg,"clipPath")))};for(var D in o)x(o,D)&&(t=D.toLowerCase(),e[t]=o[D](),r.push((e[t]?"":"no-")+t));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)x(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},y(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._prefixes=m,e.mq=v,e.testStyles=u,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+r.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f 0) { 169 | this.locked = true; 170 | modal.trigger('close'); 171 | this.toggle_bg(modal); 172 | this.hide(open_modals, this.settings.css.close); 173 | } 174 | }, 175 | 176 | close_targets : function () { 177 | var base = '.' + this.settings.dismissModalClass; 178 | 179 | if (this.settings.closeOnBackgroundClick) { 180 | return base + ', .' + this.settings.bgClass; 181 | } 182 | 183 | return base; 184 | }, 185 | 186 | toggle_bg : function (modal) { 187 | if ($('.reveal-modal-bg').length === 0) { 188 | this.settings.bg = $('
', {'class': this.settings.bgClass}) 189 | .appendTo('body'); 190 | } 191 | 192 | if (this.settings.bg.filter(':visible').length > 0) { 193 | this.hide(this.settings.bg); 194 | } else { 195 | this.show(this.settings.bg); 196 | } 197 | }, 198 | 199 | show : function (el, css) { 200 | // is modal 201 | if (css) { 202 | if (/pop/i.test(this.settings.animation)) { 203 | css.top = $(window).scrollTop() - el.data('offset') + 'px'; 204 | var end_css = { 205 | top: $(window).scrollTop() + el.data('css-top') + 'px', 206 | opacity: 1 207 | }; 208 | 209 | return this.delay(function () { 210 | return el 211 | .css(css) 212 | .animate(end_css, this.settings.animationSpeed, 'linear', function () { 213 | this.locked = false; 214 | el.trigger('opened'); 215 | }.bind(this)) 216 | .addClass('open'); 217 | }.bind(this), this.settings.animationSpeed / 2); 218 | } 219 | 220 | if (/fade/i.test(this.settings.animation)) { 221 | var end_css = {opacity: 1}; 222 | 223 | return this.delay(function () { 224 | return el 225 | .css(css) 226 | .animate(end_css, this.settings.animationSpeed, 'linear', function () { 227 | this.locked = false; 228 | el.trigger('opened'); 229 | }.bind(this)) 230 | .addClass('open'); 231 | }.bind(this), this.settings.animationSpeed / 2); 232 | } 233 | 234 | return el.css(css).show().css({opacity: 1}).addClass('open').trigger('opened'); 235 | } 236 | 237 | // should we animate the background? 238 | if (/fade/i.test(this.settings.animation)) { 239 | return el.fadeIn(this.settings.animationSpeed / 2); 240 | } 241 | 242 | return el.show(); 243 | }, 244 | 245 | hide : function (el, css) { 246 | // is modal 247 | if (css) { 248 | if (/pop/i.test(this.settings.animation)) { 249 | var end_css = { 250 | top: - $(window).scrollTop() - el.data('offset') + 'px', 251 | opacity: 0 252 | }; 253 | 254 | return this.delay(function () { 255 | return el 256 | .animate(end_css, this.settings.animationSpeed, 'linear', function () { 257 | this.locked = false; 258 | el.css(css).trigger('closed'); 259 | }.bind(this)) 260 | .removeClass('open'); 261 | }.bind(this), this.settings.animationSpeed / 2); 262 | } 263 | 264 | if (/fade/i.test(this.settings.animation)) { 265 | var end_css = {opacity: 0}; 266 | 267 | return this.delay(function () { 268 | return el 269 | .animate(end_css, this.settings.animationSpeed, 'linear', function () { 270 | this.locked = false; 271 | el.css(css).trigger('closed'); 272 | }.bind(this)) 273 | .removeClass('open'); 274 | }.bind(this), this.settings.animationSpeed / 2); 275 | } 276 | 277 | return el.hide().css(css).removeClass('open').trigger('closed'); 278 | } 279 | 280 | // should we animate the background? 281 | if (/fade/i.test(this.settings.animation)) { 282 | return el.fadeOut(this.settings.animationSpeed / 2); 283 | } 284 | 285 | return el.hide(); 286 | }, 287 | 288 | close_video : function (e) { 289 | var video = $(this).find('.flex-video'), 290 | iframe = video.find('iframe'); 291 | 292 | if (iframe.length > 0) { 293 | iframe.attr('data-src', iframe[0].src); 294 | iframe.attr('src', 'about:blank'); 295 | video.hide(); 296 | } 297 | }, 298 | 299 | open_video : function (e) { 300 | var video = $(this).find('.flex-video'), 301 | iframe = video.find('iframe'); 302 | 303 | if (iframe.length > 0) { 304 | var data_src = iframe.attr('data-src'); 305 | if (typeof data_src === 'string') { 306 | iframe[0].src = iframe.attr('data-src'); 307 | } else { 308 | var src = iframe[0].src; 309 | iframe[0].src = undefined; 310 | iframe[0].src = src; 311 | } 312 | video.show(); 313 | } 314 | }, 315 | 316 | cache_offset : function (modal) { 317 | var offset = modal.show().height() + parseInt(modal.css('top'), 10); 318 | 319 | modal.hide(); 320 | 321 | return offset; 322 | }, 323 | 324 | off : function () { 325 | $(this.scope).off('.fndtn.reveal'); 326 | }, 327 | 328 | reflow : function () {} 329 | }; 330 | }(Foundation.zj, this, this.document)); -------------------------------------------------------------------------------- /_themes/foundation-4/js/foundation/foundation.topbar.js: -------------------------------------------------------------------------------- 1 | /*jslint unparam: true, browser: true, indent: 2 */ 2 | 3 | ;(function ($, window, document, undefined) { 4 | 'use strict'; 5 | 6 | Foundation.libs.topbar = { 7 | name : 'topbar', 8 | 9 | version: '4.3.1', 10 | 11 | settings : { 12 | index : 0, 13 | stickyClass : 'sticky', 14 | custom_back_text: true, 15 | back_text: 'Back', 16 | is_hover: true, 17 | mobile_show_parent_link: true, 18 | scrolltop : true, // jump to top when sticky nav menu toggle is clicked 19 | init : false 20 | }, 21 | 22 | init : function (section, method, options) { 23 | Foundation.inherit(this, 'data_options'); 24 | var self = this; 25 | 26 | if (typeof method === 'object') { 27 | $.extend(true, this.settings, method); 28 | } else if (typeof options !== 'undefined') { 29 | $.extend(true, this.settings, options); 30 | } 31 | 32 | if (typeof method !== 'string') { 33 | 34 | $('.top-bar, [data-topbar]').each(function () { 35 | $.extend(true, self.settings, self.data_options($(this))); 36 | self.settings.$w = $(window); 37 | self.settings.$topbar = $(this); 38 | self.settings.$section = self.settings.$topbar.find('section'); 39 | self.settings.$titlebar = self.settings.$topbar.children('ul').first(); 40 | self.settings.$topbar.data('index', 0); 41 | 42 | var breakpoint = $("
").insertAfter(self.settings.$topbar); 43 | self.settings.breakPoint = breakpoint.width(); 44 | breakpoint.remove(); 45 | 46 | self.assemble(); 47 | 48 | if (self.settings.is_hover) { 49 | self.settings.$topbar.find('.has-dropdown').addClass('not-click'); 50 | } 51 | 52 | if (self.settings.$topbar.parent().hasClass('fixed')) { 53 | $('body').css('padding-top', self.outerHeight(self.settings.$topbar)); 54 | } 55 | }); 56 | 57 | if (!self.settings.init) { 58 | this.events(); 59 | } 60 | 61 | return this.settings.init; 62 | } else { 63 | // fire method 64 | return this[method].call(this, options); 65 | } 66 | }, 67 | 68 | timer : null, 69 | 70 | events : function () { 71 | var self = this; 72 | var offst = this.outerHeight($('.top-bar, [data-topbar]')); 73 | $(this.scope) 74 | .off('.fndtn.topbar') 75 | .on('click.fndtn.topbar', '.top-bar .toggle-topbar, [data-topbar] .toggle-topbar', function (e) { 76 | var topbar = $(this).closest('.top-bar, [data-topbar]'), 77 | section = topbar.find('section, .section'), 78 | titlebar = topbar.children('ul').first(); 79 | 80 | e.preventDefault(); 81 | 82 | if (self.breakpoint()) { 83 | if (!self.rtl) { 84 | section.css({left: '0%'}); 85 | section.find('>.name').css({left: '100%'}); 86 | } else { 87 | section.css({right: '0%'}); 88 | section.find('>.name').css({right: '100%'}); 89 | } 90 | 91 | section.find('li.moved').removeClass('moved'); 92 | topbar.data('index', 0); 93 | 94 | topbar 95 | .toggleClass('expanded') 96 | .css('height', ''); 97 | } 98 | 99 | if (!topbar.hasClass('expanded')) { 100 | if (topbar.hasClass('fixed')) { 101 | topbar.parent().addClass('fixed'); 102 | topbar.removeClass('fixed'); 103 | $('body').css('padding-top',offst); 104 | } 105 | } else if (topbar.parent().hasClass('fixed')) { 106 | topbar.parent().removeClass('fixed'); 107 | topbar.addClass('fixed'); 108 | $('body').css('padding-top','0'); 109 | 110 | if (self.settings.scrolltop) { 111 | window.scrollTo(0,0); 112 | } 113 | } 114 | }) 115 | 116 | .on('click.fndtn.topbar', '.top-bar li.has-dropdown', function (e) { 117 | if (self.breakpoint()) return; 118 | 119 | var li = $(this), 120 | target = $(e.target), 121 | topbar = li.closest('[data-topbar], .top-bar'), 122 | is_hover = topbar.data('topbar'); 123 | 124 | if (self.settings.is_hover && !Modernizr.touch) return; 125 | 126 | e.stopImmediatePropagation(); 127 | 128 | if (target[0].nodeName === 'A' && target.parent().hasClass('has-dropdown')) { 129 | e.preventDefault(); 130 | } 131 | 132 | if (li.hasClass('hover')) { 133 | li 134 | .removeClass('hover') 135 | .find('li') 136 | .removeClass('hover'); 137 | } else { 138 | li.addClass('hover'); 139 | } 140 | }) 141 | 142 | .on('click.fndtn.topbar', '.top-bar .has-dropdown>a, [data-topbar] .has-dropdown>a', function (e) { 143 | if (self.breakpoint()) { 144 | e.preventDefault(); 145 | 146 | var $this = $(this), 147 | topbar = $this.closest('.top-bar, [data-topbar]'), 148 | section = topbar.find('section, .section'), 149 | titlebar = topbar.children('ul').first(), 150 | dropdownHeight = $this.next('.dropdown').outerHeight(), 151 | $selectedLi = $this.closest('li'); 152 | 153 | topbar.data('index', topbar.data('index') + 1); 154 | $selectedLi.addClass('moved'); 155 | 156 | if (!self.rtl) { 157 | section.css({left: -(100 * topbar.data('index')) + '%'}); 158 | section.find('>.name').css({left: 100 * topbar.data('index') + '%'}); 159 | } else { 160 | section.css({right: -(100 * topbar.data('index')) + '%'}); 161 | section.find('>.name').css({right: 100 * topbar.data('index') + '%'}); 162 | } 163 | 164 | topbar.css('height', self.outerHeight($this.siblings('ul'), true) + self.height(titlebar)); 165 | } 166 | }); 167 | 168 | $(window).on('resize.fndtn.topbar', function () { 169 | if (!self.breakpoint()) { 170 | $('.top-bar, [data-topbar]') 171 | .css('height', '') 172 | .removeClass('expanded') 173 | .find('li') 174 | .removeClass('hover'); 175 | } 176 | }.bind(this)); 177 | 178 | $('body').on('click.fndtn.topbar', function (e) { 179 | var parent = $(e.target).closest('[data-topbar], .top-bar'); 180 | 181 | if (parent.length > 0) { 182 | return; 183 | } 184 | 185 | $('.top-bar li, [data-topbar] li').removeClass('hover'); 186 | }); 187 | 188 | // Go up a level on Click 189 | $(this.scope).on('click.fndtn', '.top-bar .has-dropdown .back, [data-topbar] .has-dropdown .back', function (e) { 190 | e.preventDefault(); 191 | 192 | var $this = $(this), 193 | topbar = $this.closest('.top-bar, [data-topbar]'), 194 | titlebar = topbar.children('ul').first(), 195 | section = topbar.find('section, .section'), 196 | $movedLi = $this.closest('li.moved'), 197 | $previousLevelUl = $movedLi.parent(); 198 | 199 | topbar.data('index', topbar.data('index') - 1); 200 | 201 | if (!self.rtl) { 202 | section.css({left: -(100 * topbar.data('index')) + '%'}); 203 | section.find('>.name').css({left: 100 * topbar.data('index') + '%'}); 204 | } else { 205 | section.css({right: -(100 * topbar.data('index')) + '%'}); 206 | section.find('>.name').css({right: 100 * topbar.data('index') + '%'}); 207 | } 208 | 209 | if (topbar.data('index') === 0) { 210 | topbar.css('height', ''); 211 | } else { 212 | topbar.css('height', self.outerHeight($previousLevelUl, true) + self.height(titlebar)); 213 | } 214 | 215 | setTimeout(function () { 216 | $movedLi.removeClass('moved'); 217 | }, 300); 218 | }); 219 | }, 220 | 221 | breakpoint : function () { 222 | return $(document).width() <= this.settings.breakPoint || $('html').hasClass('lt-ie9'); 223 | }, 224 | 225 | assemble : function () { 226 | var self = this; 227 | // Pull element out of the DOM for manipulation 228 | this.settings.$section.detach(); 229 | 230 | this.settings.$section.find('.has-dropdown>a').each(function () { 231 | var $link = $(this), 232 | $dropdown = $link.siblings('.dropdown'), 233 | url = $link.attr('href'); 234 | 235 | if (self.settings.mobile_show_parent_link && url && url.length > 1) { 236 | var $titleLi = $('
  • ' + $link.text() +'
  • '); 237 | } else { 238 | var $titleLi = $('
  • '); 239 | } 240 | 241 | // Copy link to subnav 242 | if (self.settings.custom_back_text == true) { 243 | $titleLi.find('h5>a').html('« ' + self.settings.back_text); 244 | } else { 245 | $titleLi.find('h5>a').html('« ' + $link.html()); 246 | } 247 | $dropdown.prepend($titleLi); 248 | }); 249 | 250 | // Put element back in the DOM 251 | this.settings.$section.appendTo(this.settings.$topbar); 252 | 253 | // check for sticky 254 | this.sticky(); 255 | }, 256 | 257 | height : function (ul) { 258 | var total = 0, 259 | self = this; 260 | 261 | ul.find('> li').each(function () { total += self.outerHeight($(this), true); }); 262 | 263 | return total; 264 | }, 265 | 266 | sticky : function () { 267 | var klass = '.' + this.settings.stickyClass; 268 | if ($(klass).length > 0) { 269 | var distance = $(klass).length ? $(klass).offset().top: 0, 270 | $window = $(window), 271 | offst = this.outerHeight($('.top-bar')), 272 | t_top; 273 | 274 | //Whe resize elements of the page on windows resize. Must recalculate distance 275 | $(window).resize(function() { 276 | clearTimeout(t_top); 277 | t_top = setTimeout (function() { 278 | distance = $(klass).offset().top; 279 | },105); 280 | }); 281 | $window.scroll(function() { 282 | if ($window.scrollTop() > (distance)) { 283 | $(klass).addClass("fixed"); 284 | $('body').css('padding-top',offst); 285 | } else if ($window.scrollTop() <= distance) { 286 | $(klass).removeClass("fixed"); 287 | $('body').css('padding-top','0'); 288 | } 289 | }); 290 | } 291 | }, 292 | 293 | off : function () { 294 | $(this.scope).off('.fndtn.topbar'); 295 | $(window).off('.fndtn.topbar'); 296 | }, 297 | 298 | reflow : function () {} 299 | }; 300 | }(Foundation.zj, this, this.document)); 301 | -------------------------------------------------------------------------------- /_themes/foundation-4/js/foundation/foundation.js: -------------------------------------------------------------------------------- 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 | 9 | /*jslint unparam: true, browser: true, indent: 2 */ 10 | 11 | // Accommodate running jQuery or Zepto in noConflict() mode by 12 | // using an anonymous function to redefine the $ shorthand name. 13 | // See http://docs.jquery.com/Using_jQuery_with_Other_Libraries 14 | // and http://zeptojs.com/ 15 | var libFuncName = null; 16 | 17 | if (typeof jQuery === "undefined" && 18 | typeof Zepto === "undefined" && 19 | typeof $ === "function") { 20 | libFuncName = $; 21 | } else if (typeof jQuery === "function") { 22 | libFuncName = jQuery; 23 | } else if (typeof Zepto === "function") { 24 | libFuncName = Zepto; 25 | } else { 26 | throw new TypeError(); 27 | } 28 | 29 | (function ($, window, document, undefined) { 30 | 'use strict'; 31 | 32 | /* 33 | matchMedia() polyfill - Test a CSS media 34 | type/query in JS. Authors & copyright (c) 2012: 35 | Scott Jehl, Paul Irish, Nicholas Zakas. 36 | Dual MIT/BSD license 37 | 38 | https://github.com/paulirish/matchMedia.js 39 | */ 40 | 41 | window.matchMedia = window.matchMedia || (function( doc, undefined ) { 42 | 43 | "use strict"; 44 | 45 | var bool, 46 | docElem = doc.documentElement, 47 | refNode = docElem.firstElementChild || docElem.firstChild, 48 | // fakeBody required for 49 | fakeBody = doc.createElement( "body" ), 50 | div = doc.createElement( "div" ); 51 | 52 | div.id = "mq-test-1"; 53 | div.style.cssText = "position:absolute;top:-100em"; 54 | fakeBody.style.background = "none"; 55 | fakeBody.appendChild(div); 56 | 57 | return function(q){ 58 | 59 | div.innerHTML = "­"; 60 | 61 | docElem.insertBefore( fakeBody, refNode ); 62 | bool = div.offsetWidth === 42; 63 | docElem.removeChild( fakeBody ); 64 | 65 | return { 66 | matches: bool, 67 | media: q 68 | }; 69 | 70 | }; 71 | 72 | }( document )); 73 | 74 | // add dusty browser stuff 75 | if (!Array.prototype.filter) { 76 | Array.prototype.filter = function(fun /*, thisp */) { 77 | "use strict"; 78 | 79 | if (this == null) { 80 | throw new TypeError(); 81 | } 82 | 83 | var t = Object(this), 84 | len = t.length >>> 0; 85 | if (typeof fun !== "function") { 86 | return; 87 | } 88 | 89 | var res = [], 90 | thisp = arguments[1]; 91 | for (var i = 0; i < len; i++) { 92 | if (i in t) { 93 | var val = t[i]; // in case fun mutates this 94 | if (fun && fun.call(thisp, val, i, t)) { 95 | res.push(val); 96 | } 97 | } 98 | } 99 | 100 | return res; 101 | } 102 | } 103 | 104 | if (!Function.prototype.bind) { 105 | Function.prototype.bind = function (oThis) { 106 | if (typeof this !== "function") { 107 | // closest thing possible to the ECMAScript 5 internal IsCallable function 108 | throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable"); 109 | } 110 | 111 | var aArgs = Array.prototype.slice.call(arguments, 1), 112 | fToBind = this, 113 | fNOP = function () {}, 114 | fBound = function () { 115 | return fToBind.apply(this instanceof fNOP && oThis 116 | ? this 117 | : oThis, 118 | aArgs.concat(Array.prototype.slice.call(arguments))); 119 | }; 120 | 121 | fNOP.prototype = this.prototype; 122 | fBound.prototype = new fNOP(); 123 | 124 | return fBound; 125 | }; 126 | } 127 | 128 | if (!Array.prototype.indexOf) { 129 | Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) { 130 | "use strict"; 131 | if (this == null) { 132 | throw new TypeError(); 133 | } 134 | var t = Object(this); 135 | var len = t.length >>> 0; 136 | if (len === 0) { 137 | return -1; 138 | } 139 | var n = 0; 140 | if (arguments.length > 1) { 141 | n = Number(arguments[1]); 142 | if (n != n) { // shortcut for verifying if it's NaN 143 | n = 0; 144 | } else if (n != 0 && n != Infinity && n != -Infinity) { 145 | n = (n > 0 || -1) * Math.floor(Math.abs(n)); 146 | } 147 | } 148 | if (n >= len) { 149 | return -1; 150 | } 151 | var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0); 152 | for (; k < len; k++) { 153 | if (k in t && t[k] === searchElement) { 154 | return k; 155 | } 156 | } 157 | return -1; 158 | } 159 | } 160 | 161 | // fake stop() for zepto. 162 | $.fn.stop = $.fn.stop || function() { 163 | return this; 164 | }; 165 | 166 | window.Foundation = { 167 | name : 'Foundation', 168 | 169 | version : '4.3.1', 170 | 171 | cache : {}, 172 | 173 | init : function (scope, libraries, method, options, response, /* internal */ nc) { 174 | var library_arr, 175 | args = [scope, method, options, response], 176 | responses = [], 177 | nc = nc || false; 178 | 179 | // disable library error catching, 180 | // used for development only 181 | if (nc) this.nc = nc; 182 | 183 | // check RTL 184 | this.rtl = /rtl/i.test($('html').attr('dir')); 185 | 186 | // set foundation global scope 187 | this.scope = scope || this.scope; 188 | 189 | if (libraries && typeof libraries === 'string' && !/reflow/i.test(libraries)) { 190 | if (/off/i.test(libraries)) return this.off(); 191 | 192 | library_arr = libraries.split(' '); 193 | 194 | if (library_arr.length > 0) { 195 | for (var i = library_arr.length - 1; i >= 0; i--) { 196 | responses.push(this.init_lib(library_arr[i], args)); 197 | } 198 | } 199 | } else { 200 | if (/reflow/i.test(libraries)) args[1] = 'reflow'; 201 | 202 | for (var lib in this.libs) { 203 | responses.push(this.init_lib(lib, args)); 204 | } 205 | } 206 | 207 | // if first argument is callback, add to args 208 | if (typeof libraries === 'function') { 209 | args.unshift(libraries); 210 | } 211 | 212 | return this.response_obj(responses, args); 213 | }, 214 | 215 | response_obj : function (response_arr, args) { 216 | for (var i = 0, len = args.length; i < len; i++) { 217 | if (typeof args[i] === 'function') { 218 | return args[i]({ 219 | errors: response_arr.filter(function (s) { 220 | if (typeof s === 'string') return s; 221 | }) 222 | }); 223 | } 224 | } 225 | 226 | return response_arr; 227 | }, 228 | 229 | init_lib : function (lib, args) { 230 | return this.trap(function () { 231 | if (this.libs.hasOwnProperty(lib)) { 232 | this.patch(this.libs[lib]); 233 | return this.libs[lib].init.apply(this.libs[lib], args); 234 | } else { 235 | return function () {}; 236 | } 237 | }.bind(this), lib); 238 | }, 239 | 240 | trap : function (fun, lib) { 241 | if (!this.nc) { 242 | try { 243 | return fun(); 244 | } catch (e) { 245 | return this.error({name: lib, message: 'could not be initialized', more: e.name + ' ' + e.message}); 246 | } 247 | } 248 | 249 | return fun(); 250 | }, 251 | 252 | patch : function (lib) { 253 | this.fix_outer(lib); 254 | lib.scope = this.scope; 255 | lib.rtl = this.rtl; 256 | }, 257 | 258 | inherit : function (scope, methods) { 259 | var methods_arr = methods.split(' '); 260 | 261 | for (var i = methods_arr.length - 1; i >= 0; i--) { 262 | if (this.lib_methods.hasOwnProperty(methods_arr[i])) { 263 | this.libs[scope.name][methods_arr[i]] = this.lib_methods[methods_arr[i]]; 264 | } 265 | } 266 | }, 267 | 268 | random_str : function (length) { 269 | var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(''); 270 | 271 | if (!length) { 272 | length = Math.floor(Math.random() * chars.length); 273 | } 274 | 275 | var str = ''; 276 | for (var i = 0; i < length; i++) { 277 | str += chars[Math.floor(Math.random() * chars.length)]; 278 | } 279 | return str; 280 | }, 281 | 282 | libs : {}, 283 | 284 | // methods that can be inherited in libraries 285 | lib_methods : { 286 | set_data : function (node, data) { 287 | // this.name references the name of the library calling this method 288 | var id = [this.name,+new Date(),Foundation.random_str(5)].join('-'); 289 | 290 | Foundation.cache[id] = data; 291 | node.attr('data-' + this.name + '-id', id); 292 | return data; 293 | }, 294 | 295 | get_data : function (node) { 296 | return Foundation.cache[node.attr('data-' + this.name + '-id')]; 297 | }, 298 | 299 | remove_data : function (node) { 300 | if (node) { 301 | delete Foundation.cache[node.attr('data-' + this.name + '-id')]; 302 | node.attr('data-' + this.name + '-id', ''); 303 | } else { 304 | $('[data-' + this.name + '-id]').each(function () { 305 | delete Foundation.cache[$(this).attr('data-' + this.name + '-id')]; 306 | $(this).attr('data-' + this.name + '-id', ''); 307 | }); 308 | } 309 | }, 310 | 311 | throttle : function(fun, delay) { 312 | var timer = null; 313 | return function () { 314 | var context = this, args = arguments; 315 | clearTimeout(timer); 316 | timer = setTimeout(function () { 317 | fun.apply(context, args); 318 | }, delay); 319 | }; 320 | }, 321 | 322 | // parses data-options attribute on nodes and turns 323 | // them into an object 324 | data_options : function (el) { 325 | var opts = {}, ii, p, 326 | opts_arr = (el.attr('data-options') || ':').split(';'), 327 | opts_len = opts_arr.length; 328 | 329 | function isNumber (o) { 330 | return ! isNaN (o-0) && o !== null && o !== "" && o !== false && o !== true; 331 | } 332 | 333 | function trim(str) { 334 | if (typeof str === 'string') return $.trim(str); 335 | return str; 336 | } 337 | 338 | // parse options 339 | for (ii = opts_len - 1; ii >= 0; ii--) { 340 | p = opts_arr[ii].split(':'); 341 | 342 | if (/true/i.test(p[1])) p[1] = true; 343 | if (/false/i.test(p[1])) p[1] = false; 344 | if (isNumber(p[1])) p[1] = parseInt(p[1], 10); 345 | 346 | if (p.length === 2 && p[0].length > 0) { 347 | opts[trim(p[0])] = trim(p[1]); 348 | } 349 | } 350 | 351 | return opts; 352 | }, 353 | 354 | delay : function (fun, delay) { 355 | return setTimeout(fun, delay); 356 | }, 357 | 358 | // animated scrolling 359 | scrollTo : function (el, to, duration) { 360 | if (duration < 0) return; 361 | var difference = to - $(window).scrollTop(); 362 | var perTick = difference / duration * 10; 363 | 364 | this.scrollToTimerCache = setTimeout(function() { 365 | if (!isNaN(parseInt(perTick, 10))) { 366 | window.scrollTo(0, $(window).scrollTop() + perTick); 367 | this.scrollTo(el, to, duration - 10); 368 | } 369 | }.bind(this), 10); 370 | }, 371 | 372 | // not supported in core Zepto 373 | scrollLeft : function (el) { 374 | if (!el.length) return; 375 | return ('scrollLeft' in el[0]) ? el[0].scrollLeft : el[0].pageXOffset; 376 | }, 377 | 378 | // test for empty object or array 379 | empty : function (obj) { 380 | if (obj.length && obj.length > 0) return false; 381 | if (obj.length && obj.length === 0) return true; 382 | 383 | for (var key in obj) { 384 | if (hasOwnProperty.call(obj, key)) return false; 385 | } 386 | 387 | return true; 388 | } 389 | }, 390 | 391 | fix_outer : function (lib) { 392 | lib.outerHeight = function (el, bool) { 393 | if (typeof Zepto === 'function') { 394 | return el.height(); 395 | } 396 | 397 | if (typeof bool !== 'undefined') { 398 | return el.outerHeight(bool); 399 | } 400 | 401 | return el.outerHeight(); 402 | }; 403 | 404 | lib.outerWidth = function (el, bool) { 405 | if (typeof Zepto === 'function') { 406 | return el.width(); 407 | } 408 | 409 | if (typeof bool !== 'undefined') { 410 | return el.outerWidth(bool); 411 | } 412 | 413 | return el.outerWidth(); 414 | }; 415 | }, 416 | 417 | error : function (error) { 418 | return error.name + ' ' + error.message + '; ' + error.more; 419 | }, 420 | 421 | // remove all foundation events. 422 | off: function () { 423 | $(this.scope).off('.fndtn'); 424 | $(window).off('.fndtn'); 425 | return true; 426 | }, 427 | 428 | zj : $ 429 | }; 430 | 431 | $.fn.foundation = function () { 432 | var args = Array.prototype.slice.call(arguments, 0); 433 | 434 | return this.each(function () { 435 | Foundation.init.apply(Foundation, [this].concat(args)); 436 | return this; 437 | }); 438 | }; 439 | 440 | }(libFuncName, this, this.document)); 441 | -------------------------------------------------------------------------------- /_themes/foundation-4/js/foundation/foundation.orbit.js: -------------------------------------------------------------------------------- 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 | slides_container.children().first().addClass(settings.active_slide_class); 25 | 26 | self.update_slide_number = function(index) { 27 | if (settings.slide_number) { 28 | number_container.find('span:first').text(parseInt(index)+1); 29 | number_container.find('span:last').text(slides_container.children().length); 30 | } 31 | if (settings.bullets) { 32 | bullets_container.children().removeClass(settings.bullets_active_class); 33 | $(bullets_container.children().get(index)).addClass(settings.bullets_active_class); 34 | } 35 | }; 36 | 37 | self.build_markup = function() { 38 | slides_container.wrap('
    '); 39 | container = slides_container.parent(); 40 | slides_container.addClass(settings.slides_container_class); 41 | 42 | if (settings.navigation_arrows) { 43 | container.append($('').addClass(settings.prev_class).append('')); 44 | container.append($('').addClass(settings.next_class).append('')); 45 | } 46 | 47 | if (settings.timer) { 48 | timer_container = $('
    ').addClass(settings.timer_container_class); 49 | timer_container.append(''); 50 | timer_container.append($('
    ').addClass(settings.timer_progress_class)); 51 | timer_container.addClass(settings.timer_paused_class); 52 | container.append(timer_container); 53 | } 54 | 55 | if (settings.slide_number) { 56 | number_container = $('
    ').addClass(settings.slide_number_class); 57 | number_container.append(' of '); 58 | container.append(number_container); 59 | } 60 | 61 | if (settings.bullets) { 62 | bullets_container = $('
      ').addClass(settings.bullets_container_class); 63 | container.append(bullets_container); 64 | slides_container.children().each(function(idx, el) { 65 | var bullet = $('
    1. ').attr('data-orbit-slide', idx); 66 | bullets_container.append(bullet); 67 | }); 68 | } 69 | 70 | if (settings.stack_on_small) { 71 | container.addClass(settings.stack_on_small_class); 72 | } 73 | 74 | self.update_slide_number(0); 75 | }; 76 | 77 | self._goto = function(next_idx, start_timer) { 78 | // if (locked) {return false;} 79 | if (next_idx === idx) {return false;} 80 | if (typeof timer === 'object') {timer.restart();} 81 | var slides = slides_container.children(); 82 | 83 | var dir = 'next'; 84 | locked = true; 85 | if (next_idx < idx) {dir = 'prev';} 86 | if (next_idx >= slides.length) {next_idx = 0;} 87 | else if (next_idx < 0) {next_idx = slides.length - 1;} 88 | 89 | var current = $(slides.get(idx)); 90 | var next = $(slides.get(next_idx)); 91 | 92 | current.css('zIndex', 2); 93 | next.css('zIndex', 4).addClass('active'); 94 | 95 | slides_container.trigger('orbit:before-slide-change'); 96 | settings.before_slide_change(); 97 | 98 | var callback = function() { 99 | var unlock = function() { 100 | idx = next_idx; 101 | locked = false; 102 | if (start_timer === true) {timer = self.create_timer(); timer.start();} 103 | self.update_slide_number(idx); 104 | slides_container.trigger('orbit:after-slide-change',[{slide_number: idx, total_slides: slides.length}]); 105 | settings.after_slide_change(idx, slides.length); 106 | }; 107 | if (slides_container.height() != next.height()) { 108 | slides_container.animate({'height': next.height()}, 250, 'linear', unlock); 109 | } else { 110 | unlock(); 111 | } 112 | }; 113 | 114 | if (slides.length === 1) {callback(); return false;} 115 | 116 | var start_animation = function() { 117 | if (dir === 'next') {animate.next(current, next, callback);} 118 | if (dir === 'prev') {animate.prev(current, next, callback);} 119 | }; 120 | 121 | if (next.height() > slides_container.height()) { 122 | slides_container.animate({'height': next.height()}, 250, 'linear', start_animation); 123 | } else { 124 | start_animation(); 125 | } 126 | }; 127 | 128 | self.next = function(e) { 129 | e.stopImmediatePropagation(); 130 | e.preventDefault(); 131 | self._goto(idx + 1); 132 | }; 133 | 134 | self.prev = function(e) { 135 | e.stopImmediatePropagation(); 136 | e.preventDefault(); 137 | self._goto(idx - 1); 138 | }; 139 | 140 | self.link_custom = function(e) { 141 | e.preventDefault(); 142 | var link = $(this).attr('data-orbit-link'); 143 | if ((typeof link === 'string') && (link = $.trim(link)) != "") { 144 | var slide = container.find('[data-orbit-slide='+link+']'); 145 | if (slide.index() != -1) {self._goto(slide.index());} 146 | } 147 | }; 148 | 149 | self.link_bullet = function(e) { 150 | var index = $(this).attr('data-orbit-slide'); 151 | if ((typeof index === 'string') && (index = $.trim(index)) != "") { 152 | self._goto(index); 153 | } 154 | } 155 | 156 | self.timer_callback = function() { 157 | self._goto(idx + 1, true); 158 | } 159 | 160 | self.compute_dimensions = function() { 161 | var current = $(slides_container.children().get(idx)); 162 | var h = current.height(); 163 | if (!settings.variable_height) { 164 | slides_container.children().each(function(){ 165 | if ($(this).height() > h) { h = $(this).height(); } 166 | }); 167 | } 168 | slides_container.height(h); 169 | }; 170 | 171 | self.create_timer = function() { 172 | var t = new Timer( 173 | container.find('.'+settings.timer_container_class), 174 | settings, 175 | self.timer_callback 176 | ); 177 | return t; 178 | }; 179 | 180 | self.stop_timer = function() { 181 | if (typeof timer === 'object') timer.stop(); 182 | }; 183 | 184 | self.toggle_timer = function() { 185 | var t = container.find('.'+settings.timer_container_class); 186 | if (t.hasClass(settings.timer_paused_class)) { 187 | if (typeof timer === 'undefined') {timer = self.create_timer();} 188 | timer.start(); 189 | } 190 | else { 191 | if (typeof timer === 'object') {timer.stop();} 192 | } 193 | }; 194 | 195 | self.init = function() { 196 | self.build_markup(); 197 | if (settings.timer) {timer = self.create_timer(); timer.start();} 198 | animate = new FadeAnimation(slides_container); 199 | if (settings.animation === 'slide') 200 | animate = new SlideAnimation(slides_container); 201 | container.on('click', '.'+settings.next_class, self.next); 202 | container.on('click', '.'+settings.prev_class, self.prev); 203 | container.on('click', '[data-orbit-slide]', self.link_bullet); 204 | container.on('click', self.toggle_timer); 205 | container.on('touchstart.fndtn.orbit', function(e) { 206 | if (!e.touches) {e = e.originalEvent;} 207 | var data = { 208 | start_page_x: e.touches[0].pageX, 209 | start_page_y: e.touches[0].pageY, 210 | start_time: (new Date()).getTime(), 211 | delta_x: 0, 212 | is_scrolling: undefined 213 | }; 214 | container.data('swipe-transition', data); 215 | e.stopPropagation(); 216 | }) 217 | .on('touchmove.fndtn.orbit', function(e) { 218 | if (!e.touches) { e = e.originalEvent; } 219 | // Ignore pinch/zoom events 220 | if(e.touches.length > 1 || e.scale && e.scale !== 1) return; 221 | 222 | var data = container.data('swipe-transition'); 223 | if (typeof data === 'undefined') {data = {};} 224 | 225 | data.delta_x = e.touches[0].pageX - data.start_page_x; 226 | 227 | if ( typeof data.is_scrolling === 'undefined') { 228 | data.is_scrolling = !!( data.is_scrolling || Math.abs(data.delta_x) < Math.abs(e.touches[0].pageY - data.start_page_y) ); 229 | } 230 | 231 | if (!data.is_scrolling && !data.active) { 232 | e.preventDefault(); 233 | var direction = (data.delta_x < 0) ? (idx+1) : (idx-1); 234 | data.active = true; 235 | self._goto(direction); 236 | } 237 | }) 238 | .on('touchend.fndtn.orbit', function(e) { 239 | container.data('swipe-transition', {}); 240 | e.stopPropagation(); 241 | }) 242 | .on('mouseenter.fndtn.orbit', function(e) { 243 | if (settings.timer && settings.pause_on_hover) { 244 | self.stop_timer(); 245 | } 246 | }) 247 | .on('mouseleave.fndtn.orbit', function(e) { 248 | if (settings.timer && settings.resume_on_mouseout) { 249 | timer.start(); 250 | } 251 | }); 252 | 253 | $(document).on('click', '[data-orbit-link]', self.link_custom); 254 | $(window).on('resize', self.compute_dimensions); 255 | $(window).on('load', self.compute_dimensions); 256 | slides_container.trigger('orbit:ready'); 257 | }; 258 | 259 | self.init(); 260 | }; 261 | 262 | var Timer = function(el, settings, callback) { 263 | var self = this, 264 | duration = settings.timer_speed, 265 | progress = el.find('.'+settings.timer_progress_class), 266 | start, 267 | timeout, 268 | left = -1; 269 | 270 | this.update_progress = function(w) { 271 | var new_progress = progress.clone(); 272 | new_progress.attr('style', ''); 273 | new_progress.css('width', w+'%'); 274 | progress.replaceWith(new_progress); 275 | progress = new_progress; 276 | }; 277 | 278 | this.restart = function() { 279 | clearTimeout(timeout); 280 | el.addClass(settings.timer_paused_class); 281 | left = -1; 282 | self.update_progress(0); 283 | }; 284 | 285 | this.start = function() { 286 | if (!el.hasClass(settings.timer_paused_class)) {return true;} 287 | left = (left === -1) ? duration : left; 288 | el.removeClass(settings.timer_paused_class); 289 | start = new Date().getTime(); 290 | progress.animate({'width': '100%'}, left, 'linear'); 291 | timeout = setTimeout(function() { 292 | self.restart(); 293 | callback(); 294 | }, left); 295 | el.trigger('orbit:timer-started') 296 | }; 297 | 298 | this.stop = function() { 299 | if (el.hasClass(settings.timer_paused_class)) {return true;} 300 | clearTimeout(timeout); 301 | el.addClass(settings.timer_paused_class); 302 | var end = new Date().getTime(); 303 | left = left - (end - start); 304 | var w = 100 - ((left / duration) * 100); 305 | self.update_progress(w); 306 | el.trigger('orbit:timer-stopped'); 307 | }; 308 | }; 309 | 310 | var SlideAnimation = function(container) { 311 | var duration = 400; 312 | var is_rtl = ($('html[dir=rtl]').length === 1); 313 | var margin = is_rtl ? 'marginRight' : 'marginLeft'; 314 | 315 | this.next = function(current, next, callback) { 316 | next.animate({margin: '0%'}, duration, 'linear', function() { 317 | current.css(margin, '100%'); 318 | callback(); 319 | }); 320 | }; 321 | 322 | this.prev = function(current, prev, callback) { 323 | prev.css(margin, '-100%'); 324 | prev.animate({margin:'0%'}, duration, 'linear', function() { 325 | current.css(margin, '100%'); 326 | callback(); 327 | }); 328 | }; 329 | }; 330 | 331 | var FadeAnimation = function(container) { 332 | var duration = 250; 333 | 334 | this.next = function(current, next, callback) { 335 | next.css({'marginLeft':'0%', 'opacity':'0.01'}); 336 | next.animate({'opacity':'1'}, duration, 'linear', function() { 337 | current.css('marginLeft', '100%'); 338 | callback(); 339 | }); 340 | }; 341 | 342 | this.prev = function(current, prev, callback) { 343 | prev.css({'marginLeft':'0%', 'opacity':'0.01'}); 344 | prev.animate({'opacity':'1'}, duration, 'linear', function() { 345 | current.css('marginLeft', '100%'); 346 | callback(); 347 | }); 348 | }; 349 | }; 350 | 351 | 352 | Foundation.libs = Foundation.libs || {}; 353 | 354 | Foundation.libs.orbit = { 355 | name: 'orbit', 356 | 357 | version: '4.3.1', 358 | 359 | settings: { 360 | animation: 'slide', 361 | timer_speed: 10000, 362 | pause_on_hover: true, 363 | resume_on_mouseout: false, 364 | animation_speed: 500, 365 | stack_on_small: false, 366 | navigation_arrows: true, 367 | slide_number: true, 368 | container_class: 'orbit-container', 369 | stack_on_small_class: 'orbit-stack-on-small', 370 | next_class: 'orbit-next', 371 | prev_class: 'orbit-prev', 372 | timer_container_class: 'orbit-timer', 373 | timer_paused_class: 'paused', 374 | timer_progress_class: 'orbit-progress', 375 | slides_container_class: 'orbit-slides-container', 376 | bullets_container_class: 'orbit-bullets', 377 | bullets_active_class: 'active', 378 | slide_number_class: 'orbit-slide-number', 379 | caption_class: 'orbit-caption', 380 | active_slide_class: 'active', 381 | orbit_transition_class: 'orbit-transitioning', 382 | bullets: true, 383 | timer: true, 384 | variable_height: false, 385 | before_slide_change: noop, 386 | after_slide_change: noop 387 | }, 388 | 389 | init: function (scope, method, options) { 390 | var self = this; 391 | Foundation.inherit(self, 'data_options'); 392 | 393 | if (typeof method === 'object') { 394 | $.extend(true, self.settings, method); 395 | } 396 | 397 | if ($(scope).is('[data-orbit]')) { 398 | var $el = $(scope); 399 | var opts = self.data_options($el); 400 | new Orbit($el, $.extend({},self.settings, opts)); 401 | } 402 | 403 | $('[data-orbit]', scope).each(function(idx, el) { 404 | var $el = $(el); 405 | var opts = self.data_options($el); 406 | new Orbit($el, $.extend({},self.settings, opts)); 407 | }); 408 | } 409 | }; 410 | 411 | 412 | }(Foundation.zj, this, this.document)); 413 | -------------------------------------------------------------------------------- /_themes/foundation-4/js/foundation/foundation.section.js: -------------------------------------------------------------------------------- 1 | /*jslint unparam: true, browser: true, indent: 2 */ 2 | 3 | ; 4 | (function($, window, document) { 5 | 'use strict'; 6 | 7 | Foundation.libs.section = { 8 | name : 'section', 9 | 10 | version : '4.3.1', 11 | 12 | settings: { 13 | deep_linking: false, 14 | small_breakpoint: 768, 15 | one_up: true, 16 | section_selector: '[data-section]', 17 | region_selector: 'section, .section, [data-section-region]', 18 | title_selector: '.title, [data-section-title]', 19 | //marker: container is resized 20 | resized_data_attr: 'data-section-resized', 21 | //marker: container should apply accordion style 22 | small_style_data_attr: 'data-section-small-style', 23 | content_selector: '.content, [data-section-content]', 24 | nav_selector: '[data-section="vertical-nav"], [data-section="horizontal-nav"]', 25 | active_class: 'active', 26 | callback: function() {} 27 | }, 28 | 29 | init: function(scope, method, options) { 30 | var self = this; 31 | Foundation.inherit(this, 'throttle data_options position_right offset_right'); 32 | 33 | if (typeof method === 'object') { 34 | $.extend(true, self.settings, method); 35 | } 36 | 37 | if (typeof method !== 'string') { 38 | this.events(); 39 | return true; 40 | } else { 41 | return this[method].call(this, options); 42 | } 43 | }, 44 | 45 | events: function() { 46 | var self = this; 47 | 48 | //combine titles selector from settings for click event binding 49 | var click_title_selectors = [], 50 | section_selector = self.settings.section_selector, 51 | region_selectors = self.settings.region_selector.split(","), 52 | title_selectors = self.settings.title_selector.split(","); 53 | 54 | for (var i = 0, len = region_selectors.length; i < len; i++) { 55 | var region_selector = region_selectors[i]; 56 | 57 | for (var j = 0, len1 = title_selectors.length; j < len1; j++) { 58 | var title_selector = section_selector + ">" + region_selector + ">" + title_selectors[j]; 59 | 60 | click_title_selectors.push(title_selector + " a"); //or we can not do preventDefault for click event of 61 | click_title_selectors.push(title_selector); 62 | } 63 | } 64 | 65 | $(self.scope) 66 | .on('click.fndtn.section', click_title_selectors.join(","), function(e) { 67 | var title = $(this).closest(self.settings.title_selector); 68 | 69 | self.close_navs(title); 70 | if (title.siblings(self.settings.content_selector).length > 0) { 71 | self.toggle_active.call(title[0], e); 72 | } 73 | }); 74 | 75 | $(window) 76 | .on('resize.fndtn.section', self.throttle(function() { self.resize(); }, 30)) 77 | .on('hashchange.fndtn.section', self.set_active_from_hash); 78 | 79 | $(document).on('click.fndtn.section', function (e) { 80 | if (e.isPropagationStopped && e.isPropagationStopped()) return; 81 | if (e.target === document) return; 82 | self.close_navs($(e.target).closest(self.settings.title_selector)); 83 | }); 84 | 85 | $(window).triggerHandler('resize.fndtn.section'); 86 | $(window).triggerHandler('hashchange.fndtn.section'); 87 | }, 88 | 89 | //close nav !one_up on click elsewhere 90 | close_navs: function(except_nav_with_title) { 91 | var self = Foundation.libs.section, 92 | navsToClose = $(self.settings.nav_selector) 93 | .filter(function() { return !$.extend({}, 94 | self.settings, self.data_options($(this))).one_up; }); 95 | 96 | if (except_nav_with_title.length > 0) { 97 | var section = except_nav_with_title.parent().parent(); 98 | 99 | if (self.is_horizontal_nav(section) || self.is_vertical_nav(section)) { 100 | //exclude current nav from list 101 | navsToClose = navsToClose.filter(function() { return this !== section[0]; }); 102 | } 103 | } 104 | //close navs on click on title 105 | navsToClose.children(self.settings.region_selector).removeClass(self.settings.active_class); 106 | }, 107 | 108 | toggle_active: function(e) { 109 | var $this = $(this), 110 | self = Foundation.libs.section, 111 | region = $this.parent(), 112 | content = $this.siblings(self.settings.content_selector), 113 | section = region.parent(), 114 | settings = $.extend({}, self.settings, self.data_options(section)), 115 | prev_active_region = section.children(self.settings.region_selector).filter("." + self.settings.active_class); 116 | 117 | //for anchors inside [data-section-title] 118 | if (!settings.deep_linking && content.length > 0) { 119 | e.preventDefault(); 120 | } 121 | 122 | e.stopPropagation(); //do not catch same click again on parent 123 | 124 | if (!region.hasClass(self.settings.active_class)) { 125 | prev_active_region.removeClass(self.settings.active_class); 126 | region.addClass(self.settings.active_class); 127 | //force resize for better performance (do not wait timer) 128 | self.resize(region.find(self.settings.section_selector).not("[" + self.settings.resized_data_attr + "]"), true); 129 | } else if (!settings.one_up && (self.small(section) || self.is_vertical_nav(section) || self.is_horizontal_nav(section) || self.is_accordion(section))) { 130 | region.removeClass(self.settings.active_class); 131 | } 132 | settings.callback(section); 133 | }, 134 | 135 | check_resize_timer: null, 136 | 137 | //main function that sets title and content positions; runs for :not(.resized) and :visible once when window width is medium up 138 | //sections: 139 | // selected sections to resize, are defined on resize forced by visibility changes 140 | //ensure_has_active_region: 141 | // is true when we force resize for no resized sections that were hidden and became visible, 142 | // these sections can have no selected region, because all regions were hidden along with section on executing set_active_from_hash 143 | resize: function(sections, ensure_has_active_region) { 144 | 145 | var self = Foundation.libs.section, 146 | is_small_window = self.small($(document)), 147 | //filter for section resize 148 | should_be_resized = function (section, now_is_hidden) { 149 | return !self.is_accordion(section) && 150 | !section.is("[" + self.settings.resized_data_attr + "]") && 151 | (!is_small_window || self.is_horizontal_tabs(section)) && 152 | now_is_hidden === (section.css('display') === 'none' || 153 | !section.parent().is(':visible')); 154 | }; 155 | 156 | sections = sections || $(self.settings.section_selector); 157 | 158 | clearTimeout(self.check_resize_timer); 159 | 160 | if (!is_small_window) { 161 | sections.removeAttr(self.settings.small_style_data_attr); 162 | } 163 | 164 | //resize 165 | sections.filter(function() { return should_be_resized($(this), false); }) 166 | .each(function() { 167 | var section = $(this), 168 | regions = section.children(self.settings.region_selector), 169 | titles = regions.children(self.settings.title_selector), 170 | content = regions.children(self.settings.content_selector), 171 | titles_max_height = 0; 172 | 173 | if (ensure_has_active_region && 174 | section.children(self.settings.region_selector).filter("." + self.settings.active_class).length == 0) { 175 | var settings = $.extend({}, self.settings, self.data_options(section)); 176 | 177 | if (!settings.deep_linking && (settings.one_up || !self.is_horizontal_nav(section) && 178 | !self.is_vertical_nav(section) && !self.is_accordion(section))) { 179 | regions.filter(":visible").first().addClass(self.settings.active_class); 180 | } 181 | } 182 | 183 | if (self.is_horizontal_tabs(section) || self.is_auto(section)) { 184 | // region: position relative 185 | // title: position absolute 186 | // content: position static 187 | var titles_sum_width = 0; 188 | 189 | titles.each(function() { 190 | var title = $(this); 191 | 192 | if (title.is(":visible")) { 193 | title.css(!self.rtl ? 'left' : 'right', titles_sum_width); 194 | var title_h_border_width = parseInt(title.css("border-" + (self.rtl ? 'left' : 'right') + "-width"), 10); 195 | 196 | if (title_h_border_width.toString() === 'Nan') { 197 | title_h_border_width = 0; 198 | } 199 | 200 | titles_sum_width += self.outerWidth(title) - title_h_border_width; 201 | titles_max_height = Math.max(titles_max_height, self.outerHeight(title)); 202 | } 203 | }); 204 | titles.css('height', titles_max_height); 205 | regions.each(function() { 206 | var region = $(this), 207 | region_content = region.children(self.settings.content_selector), 208 | content_top_border_width = parseInt(region_content.css("border-top-width"), 10); 209 | 210 | if (content_top_border_width.toString() === 'Nan') { 211 | content_top_border_width = 0; 212 | } 213 | 214 | region.css('padding-top', titles_max_height - content_top_border_width); 215 | }); 216 | 217 | section.css("min-height", titles_max_height); 218 | } else if (self.is_horizontal_nav(section)) { 219 | var first = true; 220 | // region: positon relative, float left 221 | // title: position static 222 | // content: position absolute 223 | titles.each(function() { 224 | titles_max_height = Math.max(titles_max_height, self.outerHeight($(this))); 225 | }); 226 | 227 | regions.each(function() { 228 | var region = $(this); 229 | 230 | region.css("margin-left", "-" + (first ? section : region.children(self.settings.title_selector)).css("border-left-width")); 231 | first = false; 232 | }); 233 | 234 | regions.css("margin-top", "-" + section.css("border-top-width")); 235 | titles.css('height', titles_max_height); 236 | content.css('top', titles_max_height); 237 | section.css("min-height", titles_max_height); 238 | } else if (self.is_vertical_tabs(section)) { 239 | var titles_sum_height = 0; 240 | // region: position relative, for .active: fixed padding==title.width 241 | // title: fixed width, position absolute 242 | // content: position static 243 | titles.each(function() { 244 | var title = $(this); 245 | 246 | if (title.is(":visible")) { 247 | title.css('top', titles_sum_height); 248 | var title_top_border_width = parseInt(title.css("border-top-width"), 10); 249 | 250 | if (title_top_border_width.toString() === 'Nan') { 251 | title_top_border_width = 0; 252 | } 253 | 254 | titles_sum_height += self.outerHeight(title) - title_top_border_width; 255 | } 256 | }); 257 | 258 | content.css('min-height', titles_sum_height + 1); 259 | } else if (self.is_vertical_nav(section)) { 260 | var titles_max_width = 0, 261 | first1 = true; 262 | // region: positon relative 263 | // title: position static 264 | // content: position absolute 265 | titles.each(function() { 266 | titles_max_width = Math.max(titles_max_width, self.outerWidth($(this))); 267 | }); 268 | 269 | regions.each(function () { 270 | var region = $(this); 271 | 272 | region.css("margin-top", "-" + (first1 ? section : region.children(self.settings.title_selector)).css("border-top-width")); 273 | first1 = false; 274 | }); 275 | 276 | titles.css('width', titles_max_width); 277 | content.css(!self.rtl ? 'left' : 'right', titles_max_width); 278 | section.css('width', titles_max_width); 279 | } 280 | 281 | section.attr(self.settings.resized_data_attr, true); 282 | }); 283 | 284 | //wait elements to become visible then resize 285 | if ($(self.settings.section_selector).filter(function() { return should_be_resized($(this), true); }).length > 0) 286 | self.check_resize_timer = setTimeout(function() { 287 | self.resize(sections.filter(function() { return should_be_resized($(this), false); }), true); 288 | }, 700); 289 | 290 | if (is_small_window) { 291 | sections.attr(self.settings.small_style_data_attr, true); 292 | } 293 | }, 294 | 295 | is_vertical_nav: function(el) { 296 | return /vertical-nav/i.test(el.data('section')); 297 | }, 298 | 299 | is_horizontal_nav: function(el) { 300 | return /horizontal-nav/i.test(el.data('section')); 301 | }, 302 | 303 | is_accordion: function(el) { 304 | return /accordion/i.test(el.data('section')); 305 | }, 306 | 307 | is_horizontal_tabs: function(el) { 308 | return /^tabs$/i.test(el.data('section')); 309 | }, 310 | 311 | is_vertical_tabs: function(el) { 312 | return /vertical-tabs/i.test(el.data('section')); 313 | }, 314 | 315 | is_auto: function (el) { 316 | var data_section = el.data('section'); 317 | return data_section === '' || /auto/i.test(data_section); 318 | }, 319 | 320 | set_active_from_hash: function() { 321 | var self = Foundation.libs.section, 322 | hash = window.location.hash.substring(1), 323 | sections = $(self.settings.section_selector); 324 | 325 | sections.each(function() { 326 | var section = $(this), 327 | settings = $.extend({}, self.settings, self.data_options(section)), 328 | regions = section.children(self.settings.region_selector), 329 | set_active_from_hash = settings.deep_linking && hash.length > 0, 330 | selected = false; 331 | 332 | regions.each(function() { 333 | var region = $(this); 334 | 335 | if (selected) { 336 | region.removeClass(self.settings.active_class); 337 | } else if (set_active_from_hash) { 338 | var data_slug = region.children(self.settings.content_selector).data('slug'); 339 | 340 | if (data_slug && new RegExp(data_slug, 'i').test(hash)) { 341 | if (!region.hasClass(self.settings.active_class)) 342 | region.addClass(self.settings.active_class); 343 | selected = true; 344 | } else { 345 | region.removeClass(self.settings.active_class); 346 | } 347 | } else if (region.hasClass(self.settings.active_class)) { 348 | selected = true; 349 | } 350 | }); 351 | 352 | if (!selected && !settings.deep_linking && (settings.one_up || !self.is_horizontal_nav(section) && 353 | !self.is_vertical_nav(section) && !self.is_accordion(section))) 354 | regions.filter(":visible").first().addClass(self.settings.active_class); 355 | }); 356 | }, 357 | 358 | reflow: function() { 359 | var self = Foundation.libs.section; 360 | 361 | $(self.settings.section_selector).removeAttr(self.settings.resized_data_attr); 362 | self.throttle(function() { self.resize(); }, 30)(); 363 | }, 364 | 365 | small: function(el) { 366 | var settings = $.extend({}, this.settings, this.data_options(el)); 367 | 368 | if (this.is_horizontal_tabs(el)) { 369 | return false; 370 | } 371 | if (el && this.is_accordion(el)) { 372 | return true; 373 | } 374 | if ($('html').hasClass('lt-ie9')) { 375 | return true; 376 | } 377 | if ($('html').hasClass('ie8compat')) { 378 | return true; 379 | } 380 | return $(this.scope).width() < settings.small_breakpoint; 381 | }, 382 | 383 | off: function() { 384 | $(this.scope).off('.fndtn.section'); 385 | $(window).off('.fndtn.section'); 386 | $(document).off('.fndtn.section'); 387 | } 388 | }; 389 | 390 | //resize selected sections 391 | $.fn.reflow_section = function(ensure_has_active_region) { 392 | var section = this, 393 | self = Foundation.libs.section; 394 | 395 | section.removeAttr(self.settings.resized_data_attr); 396 | self.throttle(function() { self.resize(section, ensure_has_active_region); }, 30)(); 397 | return this; 398 | }; 399 | 400 | }(Foundation.zj, window, document)); 401 | -------------------------------------------------------------------------------- /_themes/foundation-4/js/foundation/foundation.clearing.js: -------------------------------------------------------------------------------- 1 | /*jslint unparam: true, browser: true, indent: 2 */ 2 | 3 | ;(function ($, window, document, undefined) { 4 | 'use strict'; 5 | 6 | Foundation.libs.clearing = { 7 | name : 'clearing', 8 | 9 | version: '4.3.1', 10 | 11 | settings : { 12 | templates : { 13 | viewing : '×' + 14 | '' 17 | }, 18 | 19 | // comma delimited list of selectors that, on click, will close clearing, 20 | // add 'div.clearing-blackout, div.visible-img' to close on background click 21 | close_selectors : '.clearing-close', 22 | 23 | // event initializers and locks 24 | init : false, 25 | locked : false 26 | }, 27 | 28 | init : function (scope, method, options) { 29 | var self = this; 30 | Foundation.inherit(this, 'set_data get_data remove_data throttle data_options'); 31 | 32 | if (typeof method === 'object') { 33 | options = $.extend(true, this.settings, method); 34 | } 35 | 36 | if (typeof method !== 'string') { 37 | $(this.scope).find('ul[data-clearing]').each(function () { 38 | var $el = $(this), 39 | options = options || {}, 40 | lis = $el.find('li'), 41 | settings = self.get_data($el); 42 | 43 | if (!settings && lis.length > 0) { 44 | options.$parent = $el.parent(); 45 | 46 | self.set_data($el, $.extend({}, self.settings, options, self.data_options($el))); 47 | 48 | self.assemble($el.find('li')); 49 | 50 | if (!self.settings.init) { 51 | self.events().swipe_events(); 52 | } 53 | } 54 | }); 55 | 56 | return this.settings.init; 57 | } else { 58 | // fire method 59 | return this[method].call(this, options); 60 | } 61 | }, 62 | 63 | // event binding and initial setup 64 | 65 | events : function () { 66 | var self = this; 67 | 68 | $(this.scope) 69 | .on('click.fndtn.clearing', 'ul[data-clearing] li', 70 | function (e, current, target) { 71 | var current = current || $(this), 72 | target = target || current, 73 | next = current.next('li'), 74 | settings = self.get_data(current.parent()), 75 | image = $(e.target); 76 | 77 | e.preventDefault(); 78 | if (!settings) self.init(); 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 | 89 | // set current and target to the clicked li if not otherwise defined. 90 | self.open(image, current, target); 91 | self.update_paddles(target); 92 | }) 93 | 94 | .on('click.fndtn.clearing', '.clearing-main-next', 95 | function (e) { this.nav(e, 'next') }.bind(this)) 96 | .on('click.fndtn.clearing', '.clearing-main-prev', 97 | function (e) { this.nav(e, 'prev') }.bind(this)) 98 | .on('click.fndtn.clearing', this.settings.close_selectors, 99 | function (e) { Foundation.libs.clearing.close(e, this) }) 100 | .on('keydown.fndtn.clearing', 101 | function (e) { this.keydown(e) }.bind(this)); 102 | 103 | $(window).on('resize.fndtn.clearing', 104 | function () { this.resize() }.bind(this)); 105 | 106 | this.settings.init = true; 107 | return this; 108 | }, 109 | 110 | swipe_events : function () { 111 | var self = this; 112 | 113 | $(this.scope) 114 | .on('touchstart.fndtn.clearing', '.visible-img', function(e) { 115 | if (!e.touches) { e = e.originalEvent; } 116 | var data = { 117 | start_page_x: e.touches[0].pageX, 118 | start_page_y: e.touches[0].pageY, 119 | start_time: (new Date()).getTime(), 120 | delta_x: 0, 121 | is_scrolling: undefined 122 | }; 123 | 124 | $(this).data('swipe-transition', data); 125 | e.stopPropagation(); 126 | }) 127 | .on('touchmove.fndtn.clearing', '.visible-img', function(e) { 128 | if (!e.touches) { e = e.originalEvent; } 129 | // Ignore pinch/zoom events 130 | if(e.touches.length > 1 || e.scale && e.scale !== 1) return; 131 | 132 | var data = $(this).data('swipe-transition'); 133 | 134 | if (typeof data === 'undefined') { 135 | data = {}; 136 | } 137 | 138 | data.delta_x = e.touches[0].pageX - data.start_page_x; 139 | 140 | if ( typeof data.is_scrolling === 'undefined') { 141 | data.is_scrolling = !!( data.is_scrolling || Math.abs(data.delta_x) < Math.abs(e.touches[0].pageY - data.start_page_y) ); 142 | } 143 | 144 | if (!data.is_scrolling && !data.active) { 145 | e.preventDefault(); 146 | var direction = (data.delta_x < 0) ? 'next' : 'prev'; 147 | data.active = true; 148 | self.nav(e, direction); 149 | } 150 | }) 151 | .on('touchend.fndtn.clearing', '.visible-img', function(e) { 152 | $(this).data('swipe-transition', {}); 153 | e.stopPropagation(); 154 | }); 155 | }, 156 | 157 | assemble : function ($li) { 158 | var $el = $li.parent(); 159 | $el.after('
      '); 160 | 161 | var holder = $('#foundationClearingHolder'), 162 | settings = this.get_data($el), 163 | grid = $el.detach(), 164 | data = { 165 | grid: '', 166 | viewing: settings.templates.viewing 167 | }, 168 | wrapper = '
      ' + data.viewing + 169 | data.grid + '
      '; 170 | 171 | return holder.after(wrapper).remove(); 172 | }, 173 | 174 | // event callbacks 175 | 176 | open : function ($image, current, target) { 177 | var root = target.closest('.clearing-assembled'), 178 | container = root.find('div').first(), 179 | visible_image = container.find('.visible-img'), 180 | image = visible_image.find('img').not($image); 181 | 182 | if (!this.locked()) { 183 | // set the image to the selected thumbnail 184 | image 185 | .attr('src', this.load($image)) 186 | .css('visibility', 'hidden'); 187 | 188 | this.loaded(image, function () { 189 | image.css('visibility', 'visible'); 190 | // toggle the gallery 191 | root.addClass('clearing-blackout'); 192 | container.addClass('clearing-container'); 193 | visible_image.show(); 194 | this.fix_height(target) 195 | .caption(visible_image.find('.clearing-caption'), $image) 196 | .center(image) 197 | .shift(current, target, function () { 198 | target.siblings().removeClass('visible'); 199 | target.addClass('visible'); 200 | }); 201 | }.bind(this)); 202 | } 203 | }, 204 | 205 | close : function (e, el) { 206 | e.preventDefault(); 207 | 208 | var root = (function (target) { 209 | if (/blackout/.test(target.selector)) { 210 | return target; 211 | } else { 212 | return target.closest('.clearing-blackout'); 213 | } 214 | }($(el))), container, visible_image; 215 | 216 | if (el === e.target && root) { 217 | container = root.find('div').first(); 218 | visible_image = container.find('.visible-img'); 219 | this.settings.prev_index = 0; 220 | root.find('ul[data-clearing]') 221 | .attr('style', '').closest('.clearing-blackout') 222 | .removeClass('clearing-blackout'); 223 | container.removeClass('clearing-container'); 224 | visible_image.hide(); 225 | } 226 | 227 | return false; 228 | }, 229 | 230 | is_open : function (current) { 231 | return current.parent().attr('style').length > 0; 232 | }, 233 | 234 | keydown : function (e) { 235 | var clearing = $('.clearing-blackout').find('ul[data-clearing]'); 236 | 237 | if (e.which === 39) this.go(clearing, 'next'); 238 | if (e.which === 37) this.go(clearing, 'prev'); 239 | if (e.which === 27) $('a.clearing-close').trigger('click'); 240 | }, 241 | 242 | nav : function (e, direction) { 243 | var clearing = $('.clearing-blackout').find('ul[data-clearing]'); 244 | 245 | e.preventDefault(); 246 | this.go(clearing, direction); 247 | }, 248 | 249 | resize : function () { 250 | var image = $('.clearing-blackout .visible-img').find('img'); 251 | 252 | if (image.length) { 253 | this.center(image); 254 | } 255 | }, 256 | 257 | // visual adjustments 258 | fix_height : function (target) { 259 | var lis = target.parent().children(), 260 | self = this; 261 | 262 | lis.each(function () { 263 | var li = $(this), 264 | image = li.find('img'); 265 | 266 | if (li.height() > self.outerHeight(image)) { 267 | li.addClass('fix-height'); 268 | } 269 | }) 270 | .closest('ul') 271 | .width(lis.length * 100 + '%'); 272 | 273 | return this; 274 | }, 275 | 276 | update_paddles : function (target) { 277 | var visible_image = target 278 | .closest('.carousel') 279 | .siblings('.visible-img'); 280 | 281 | if (target.next().length > 0) { 282 | visible_image 283 | .find('.clearing-main-next') 284 | .removeClass('disabled'); 285 | } else { 286 | visible_image 287 | .find('.clearing-main-next') 288 | .addClass('disabled'); 289 | } 290 | 291 | if (target.prev().length > 0) { 292 | visible_image 293 | .find('.clearing-main-prev') 294 | .removeClass('disabled'); 295 | } else { 296 | visible_image 297 | .find('.clearing-main-prev') 298 | .addClass('disabled'); 299 | } 300 | }, 301 | 302 | center : function (target) { 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 | } 314 | return this; 315 | }, 316 | 317 | // image loading and preloading 318 | 319 | load : function ($image) { 320 | if ($image[0].nodeName === "A") { 321 | var href = $image.attr('href'); 322 | } else { 323 | var href = $image.parent().attr('href'); 324 | } 325 | 326 | this.preload($image); 327 | 328 | if (href) return href; 329 | return $image.attr('src'); 330 | }, 331 | 332 | preload : function ($image) { 333 | this 334 | .img($image.closest('li').next()) 335 | .img($image.closest('li').prev()); 336 | }, 337 | 338 | loaded : function (image, callback) { 339 | // based on jquery.imageready.js 340 | // @weblinc, @jsantell, (c) 2012 341 | 342 | function loaded () { 343 | callback(); 344 | } 345 | 346 | function bindLoad () { 347 | this.one('load', loaded); 348 | 349 | if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { 350 | var src = this.attr( 'src' ), 351 | param = src.match( /\?/ ) ? '&' : '?'; 352 | 353 | param += 'random=' + (new Date()).getTime(); 354 | this.attr('src', src + param); 355 | } 356 | } 357 | 358 | if (!image.attr('src')) { 359 | loaded(); 360 | return; 361 | } 362 | 363 | if (image[0].complete || image[0].readyState === 4) { 364 | loaded(); 365 | } else { 366 | bindLoad.call(image); 367 | } 368 | }, 369 | 370 | img : function (img) { 371 | if (img.length) { 372 | var new_img = new Image(), 373 | new_a = img.find('a'); 374 | 375 | if (new_a.length) { 376 | new_img.src = new_a.attr('href'); 377 | } else { 378 | new_img.src = img.find('img').attr('src'); 379 | } 380 | } 381 | return this; 382 | }, 383 | 384 | // image caption 385 | 386 | caption : function (container, $image) { 387 | var caption = $image.data('caption'); 388 | 389 | if (caption) { 390 | container 391 | .html(caption) 392 | .show(); 393 | } else { 394 | container 395 | .text('') 396 | .hide(); 397 | } 398 | return this; 399 | }, 400 | 401 | // directional methods 402 | 403 | go : function ($ul, direction) { 404 | var current = $ul.find('.visible'), 405 | target = current[direction](); 406 | 407 | if (target.length) { 408 | target 409 | .find('img') 410 | .trigger('click', [current, target]); 411 | } 412 | }, 413 | 414 | shift : function (current, target, callback) { 415 | var clearing = target.parent(), 416 | old_index = this.settings.prev_index || target.index(), 417 | direction = this.direction(clearing, current, target), 418 | left = parseInt(clearing.css('left'), 10), 419 | width = this.outerWidth(target), 420 | skip_shift; 421 | 422 | // we use jQuery animate instead of CSS transitions because we 423 | // need a callback to unlock the next animation 424 | if (target.index() !== old_index && !/skip/.test(direction)){ 425 | if (/left/.test(direction)) { 426 | this.lock(); 427 | clearing.animate({left : left + width}, 300, this.unlock()); 428 | } else if (/right/.test(direction)) { 429 | this.lock(); 430 | clearing.animate({left : left - width}, 300, this.unlock()); 431 | } 432 | } else if (/skip/.test(direction)) { 433 | // the target image is not adjacent to the current image, so 434 | // do we scroll right or not 435 | skip_shift = target.index() - this.settings.up_count; 436 | this.lock(); 437 | 438 | if (skip_shift > 0) { 439 | clearing.animate({left : -(skip_shift * width)}, 300, this.unlock()); 440 | } else { 441 | clearing.animate({left : 0}, 300, this.unlock()); 442 | } 443 | } 444 | 445 | callback(); 446 | }, 447 | 448 | direction : function ($el, current, target) { 449 | var lis = $el.find('li'), 450 | li_width = this.outerWidth(lis) + (this.outerWidth(lis) / 4), 451 | up_count = Math.floor(this.outerWidth($('.clearing-container')) / li_width) - 1, 452 | target_index = lis.index(target), 453 | response; 454 | 455 | this.settings.up_count = up_count; 456 | 457 | if (this.adjacent(this.settings.prev_index, target_index)) { 458 | if ((target_index > up_count) 459 | && target_index > this.settings.prev_index) { 460 | response = 'right'; 461 | } else if ((target_index > up_count - 1) 462 | && target_index <= this.settings.prev_index) { 463 | response = 'left'; 464 | } else { 465 | response = false; 466 | } 467 | } else { 468 | response = 'skip'; 469 | } 470 | 471 | this.settings.prev_index = target_index; 472 | 473 | return response; 474 | }, 475 | 476 | adjacent : function (current_index, target_index) { 477 | for (var i = target_index + 1; i >= target_index - 1; i--) { 478 | if (i === current_index) return true; 479 | } 480 | return false; 481 | }, 482 | 483 | // lock management 484 | 485 | lock : function () { 486 | this.settings.locked = true; 487 | }, 488 | 489 | unlock : function () { 490 | this.settings.locked = false; 491 | }, 492 | 493 | locked : function () { 494 | return this.settings.locked; 495 | }, 496 | 497 | // plugin management/browser quirks 498 | 499 | outerHTML : function (el) { 500 | // support FireFox < 11 501 | return el.outerHTML || new XMLSerializer().serializeToString(el); 502 | }, 503 | 504 | off : function () { 505 | $(this.scope).off('.fndtn.clearing'); 506 | $(window).off('.fndtn.clearing'); 507 | this.remove_data(); // empty settings cache 508 | this.settings.init = false; 509 | }, 510 | 511 | reflow : function () { 512 | this.init(); 513 | } 514 | }; 515 | 516 | }(Foundation.zj, this, this.document)); 517 | -------------------------------------------------------------------------------- /_themes/foundation-4/js/foundation/foundation.forms.js: -------------------------------------------------------------------------------- 1 | (function ($, window, document, undefined) { 2 | 'use strict'; 3 | 4 | Foundation.libs.forms = { 5 | name : 'forms', 6 | 7 | version: '4.3.1', 8 | 9 | cache: {}, 10 | 11 | settings: { 12 | disable_class: 'no-custom', 13 | last_combo : null 14 | }, 15 | 16 | init: function (scope, method, options) { 17 | 18 | if (typeof method === 'object') { 19 | $.extend(true, this.settings, method); 20 | } 21 | 22 | if (typeof method !== 'string') { 23 | if (!this.settings.init) { 24 | this.events(); 25 | } 26 | 27 | this.assemble(); 28 | 29 | return this.settings.init; 30 | } else { 31 | return this[method].call(this, options); 32 | } 33 | }, 34 | 35 | assemble: function () { 36 | $('form.custom input[type="radio"]', $(this.scope)) 37 | .not('[data-customforms="disabled"]') 38 | .not('.' + this.settings.disable_class) 39 | .each(this.append_custom_markup); 40 | $('form.custom input[type="checkbox"]', $(this.scope)) 41 | .not('[data-customforms="disabled"]') 42 | .not('.' + this.settings.disable_class) 43 | .each(this.append_custom_markup); 44 | $('form.custom select', $(this.scope)) 45 | .not('[data-customforms="disabled"]') 46 | .not('.' + this.settings.disable_class) 47 | .not('[multiple=multiple]') 48 | .each(this.append_custom_select); 49 | }, 50 | 51 | events: function () { 52 | var self = this; 53 | 54 | $(this.scope) 55 | .on('click.fndtn.forms', 'form.custom span.custom.checkbox', function (e) { 56 | e.preventDefault(); 57 | e.stopPropagation(); 58 | self.toggle_checkbox($(this)); 59 | }) 60 | .on('click.fndtn.forms', 'form.custom span.custom.radio', function (e) { 61 | e.preventDefault(); 62 | e.stopPropagation(); 63 | self.toggle_radio($(this)); 64 | }) 65 | .on('change.fndtn.forms', 'form.custom select', function (e, force_refresh) { 66 | if ($(this).is('[data-customforms="disabled"]')) return; 67 | self.refresh_custom_select($(this), force_refresh); 68 | }) 69 | .on('click.fndtn.forms', 'form.custom label', function (e) { 70 | if ($(e.target).is('label')) { 71 | var $associatedElement = $('#' + self.escape($(this).attr('for'))).not('[data-customforms="disabled"]'), 72 | $customCheckbox, 73 | $customRadio; 74 | 75 | if ($associatedElement.length !== 0) { 76 | if ($associatedElement.attr('type') === 'checkbox') { 77 | e.preventDefault(); 78 | $customCheckbox = $(this).find('span.custom.checkbox'); 79 | //the checkbox might be outside after the label or inside of another element 80 | if ($customCheckbox.length === 0) { 81 | $customCheckbox = $associatedElement.add(this).siblings('span.custom.checkbox').first(); 82 | } 83 | self.toggle_checkbox($customCheckbox); 84 | } else if ($associatedElement.attr('type') === 'radio') { 85 | e.preventDefault(); 86 | $customRadio = $(this).find('span.custom.radio'); 87 | //the radio might be outside after the label or inside of another element 88 | if ($customRadio.length === 0) { 89 | $customRadio = $associatedElement.add(this).siblings('span.custom.radio').first(); 90 | } 91 | self.toggle_radio($customRadio); 92 | } 93 | } 94 | } 95 | }) 96 | .on('mousedown.fndtn.forms', 'form.custom div.custom.dropdown', function () { 97 | return false; 98 | }) 99 | .on('click.fndtn.forms', 'form.custom div.custom.dropdown a.current, form.custom div.custom.dropdown a.selector', function (e) { 100 | var $this = $(this), 101 | $dropdown = $this.closest('div.custom.dropdown'), 102 | $select = getFirstPrevSibling($dropdown, 'select'); 103 | 104 | // make sure other dropdowns close 105 | if (!$dropdown.hasClass('open')) $(self.scope).trigger('click'); 106 | 107 | e.preventDefault(); 108 | if (false === $select.is(':disabled')) { 109 | $dropdown.toggleClass('open'); 110 | 111 | if ($dropdown.hasClass('open')) { 112 | $(self.scope).on('click.fndtn.forms.customdropdown', function () { 113 | $dropdown.removeClass('open'); 114 | $(self.scope).off('.fndtn.forms.customdropdown'); 115 | }); 116 | } else { 117 | $(self.scope).on('.fndtn.forms.customdropdown'); 118 | } 119 | return false; 120 | } 121 | }) 122 | .on('click.fndtn.forms touchend.fndtn.forms', 'form.custom div.custom.dropdown li', function (e) { 123 | var $this = $(this), 124 | $customDropdown = $this.closest('div.custom.dropdown'), 125 | $select = getFirstPrevSibling($customDropdown, 'select'), 126 | selectedIndex = 0; 127 | 128 | e.preventDefault(); 129 | e.stopPropagation(); 130 | 131 | if (!$(this).hasClass('disabled')) { 132 | $('div.dropdown').not($customDropdown).removeClass('open'); 133 | 134 | var $oldThis = $this.closest('ul') 135 | .find('li.selected'); 136 | $oldThis.removeClass('selected'); 137 | 138 | $this.addClass('selected'); 139 | 140 | $customDropdown.removeClass('open') 141 | .find('a.current') 142 | .text($this.text()); 143 | 144 | $this.closest('ul').find('li').each(function (index) { 145 | if ($this[0] === this) { 146 | selectedIndex = index; 147 | } 148 | }); 149 | $select[0].selectedIndex = selectedIndex; 150 | 151 | //store the old value in data 152 | $select.data('prevalue', $oldThis.html()); 153 | 154 | // Kick off full DOM change event 155 | if (typeof (document.createEvent) != 'undefined') { 156 | var event = document.createEvent('HTMLEvents'); 157 | event.initEvent('change', true, true); 158 | $select[0].dispatchEvent(event); 159 | } else { 160 | $select[0].fireEvent('onchange'); // for IE 161 | } 162 | } 163 | }); 164 | 165 | $(window).on('keydown', function (e) { 166 | var focus = document.activeElement, 167 | self = Foundation.libs.forms, 168 | dropdown = $('.custom.dropdown.open'); 169 | 170 | if (dropdown.length > 0) { 171 | e.preventDefault(); 172 | 173 | if (e.which === 13) { 174 | dropdown.find('li.selected').trigger('click'); 175 | } 176 | 177 | if (e.which === 27) { 178 | dropdown.removeClass('open'); 179 | } 180 | 181 | if (e.which >= 65 && e.which <= 90) { 182 | var next = self.go_to(dropdown, e.which), 183 | current = dropdown.find('li.selected'); 184 | 185 | if (next) { 186 | current.removeClass('selected'); 187 | self.scrollTo(next.addClass('selected'), 300); 188 | } 189 | } 190 | 191 | if (e.which === 38) { 192 | var current = dropdown.find('li.selected'), 193 | prev = current.prev(':not(.disabled)'); 194 | 195 | if (prev.length > 0) { 196 | prev.parent()[0].scrollTop = prev.parent().scrollTop() - self.outerHeight(prev); 197 | current.removeClass('selected'); 198 | prev.addClass('selected'); 199 | } 200 | } else if (e.which === 40) { 201 | var current = dropdown.find('li.selected'), 202 | next = current.next(':not(.disabled)'); 203 | 204 | if (next.length > 0) { 205 | next.parent()[0].scrollTop = next.parent().scrollTop() + self.outerHeight(next); 206 | current.removeClass('selected'); 207 | next.addClass('selected'); 208 | } 209 | } 210 | } 211 | }); 212 | 213 | this.settings.init = true; 214 | }, 215 | 216 | go_to: function (dropdown, character) { 217 | var lis = dropdown.find('li'), 218 | count = lis.length; 219 | 220 | if (count > 0) { 221 | for (var i = 0; i < count; i++) { 222 | var first_letter = lis.eq(i).text().charAt(0).toLowerCase(); 223 | if (first_letter === String.fromCharCode(character).toLowerCase()) return lis.eq(i); 224 | } 225 | } 226 | }, 227 | 228 | scrollTo: function (el, duration) { 229 | if (duration < 0) return; 230 | var parent = el.parent(); 231 | var li_height = this.outerHeight(el); 232 | var difference = (li_height * (el.index())) - parent.scrollTop(); 233 | var perTick = difference / duration * 10; 234 | 235 | this.scrollToTimerCache = setTimeout(function () { 236 | if (!isNaN(parseInt(perTick, 10))) { 237 | parent[0].scrollTop = parent.scrollTop() + perTick; 238 | this.scrollTo(el, duration - 10); 239 | } 240 | }.bind(this), 10); 241 | }, 242 | 243 | append_custom_markup: function (idx, sel) { 244 | var $this = $(sel), 245 | type = $this.attr('type'), 246 | $span = $this.next('span.custom.' + type); 247 | 248 | if (!$this.parent().hasClass('switch')) { 249 | $this.addClass('hidden-field'); 250 | } 251 | 252 | if ($span.length === 0) { 253 | $span = $('').insertAfter($this); 254 | } 255 | 256 | $span.toggleClass('checked', $this.is(':checked')); 257 | $span.toggleClass('disabled', $this.is(':disabled')); 258 | }, 259 | 260 | append_custom_select: function (idx, sel) { 261 | var self = Foundation.libs.forms, 262 | $this = $(sel), 263 | $customSelect = $this.next('div.custom.dropdown'), 264 | $customList = $customSelect.find('ul'), 265 | $selectCurrent = $customSelect.find(".current"), 266 | $selector = $customSelect.find(".selector"), 267 | $options = $this.find('option'), 268 | $selectedOption = $options.filter(':selected'), 269 | copyClasses = $this.attr('class') ? $this.attr('class').split(' ') : [], 270 | maxWidth = 0, 271 | liHtml = '', 272 | $listItems, 273 | $currentSelect = false; 274 | 275 | if ($customSelect.length === 0) { 276 | var customSelectSize = $this.hasClass('small') ? 'small' : $this.hasClass('medium') ? 'medium' : $this.hasClass('large') ? 'large' : $this.hasClass('expand') ? 'expand' : ''; 277 | 278 | $customSelect = $('
        '); 282 | 283 | $selector = $customSelect.find(".selector"); 284 | $customList = $customSelect.find("ul"); 285 | 286 | liHtml = $options.map(function () { 287 | var copyClasses = $(this).attr('class') ? $(this).attr('class') : ''; 288 | return "
      • " + $(this).html() + "
      • "; 289 | }).get().join(''); 290 | 291 | $customList.append(liHtml); 292 | 293 | $currentSelect = $customSelect 294 | .prepend('' + $selectedOption.html() + '') 295 | .find(".current"); 296 | 297 | $this.after($customSelect) 298 | .addClass('hidden-field'); 299 | } else { 300 | liHtml = $options.map(function () { 301 | return "
      • " + $(this).html() + "
      • "; 302 | }) 303 | .get().join(''); 304 | 305 | $customList.html('') 306 | .append(liHtml); 307 | 308 | } // endif $customSelect.length === 0 309 | 310 | self.assign_id($this, $customSelect); 311 | $customSelect.toggleClass('disabled', $this.is(':disabled')); 312 | $listItems = $customList.find('li'); 313 | 314 | // cache list length 315 | self.cache[$customSelect.data('id')] = $listItems.length; 316 | 317 | $options.each(function (index) { 318 | if (this.selected) { 319 | $listItems.eq(index).addClass('selected'); 320 | 321 | if ($currentSelect) { 322 | $currentSelect.html($(this).html()); 323 | } 324 | } 325 | if ($(this).is(':disabled')) { 326 | $listItems.eq(index).addClass('disabled'); 327 | } 328 | }); 329 | 330 | // 331 | // If we're not specifying a predetermined form size. 332 | // 333 | if (!$customSelect.is('.small, .medium, .large, .expand')) { 334 | 335 | // ------------------------------------------------------------------------------------ 336 | // This is a work-around for when elements are contained within hidden parents. 337 | // For example, when custom-form elements are inside of a hidden reveal modal. 338 | // 339 | // We need to display the current custom list element as well as hidden parent elements 340 | // in order to properly calculate the list item element's width property. 341 | // ------------------------------------------------------------------------------------- 342 | 343 | $customSelect.addClass('open'); 344 | // 345 | // Quickly, display all parent elements. 346 | // This should help us calcualate the width of the list item's within the drop down. 347 | // 348 | var self = Foundation.libs.forms; 349 | self.hidden_fix.adjust($customList); 350 | 351 | maxWidth = (self.outerWidth($listItems) > maxWidth) ? self.outerWidth($listItems) : maxWidth; 352 | 353 | Foundation.libs.forms.hidden_fix.reset(); 354 | 355 | $customSelect.removeClass('open'); 356 | 357 | } // endif 358 | 359 | }, 360 | 361 | assign_id: function ($select, $customSelect) { 362 | var id = [+new Date(), Foundation.random_str(5)].join('-'); 363 | $select.attr('data-id', id); 364 | $customSelect.attr('data-id', id); 365 | }, 366 | 367 | refresh_custom_select: function ($select, force_refresh) { 368 | var self = this; 369 | var maxWidth = 0, 370 | $customSelect = $select.next(), 371 | $options = $select.find('option'), 372 | $listItems = $customSelect.find('li'); 373 | 374 | if ($listItems.length !== this.cache[$customSelect.data('id')] || force_refresh) { 375 | $customSelect.find('ul').html(''); 376 | 377 | $options.each(function () { 378 | var $li = $('
      • ' + $(this).html() + '
      • '); 379 | $customSelect.find('ul').append($li); 380 | }); 381 | 382 | // re-populate 383 | $options.each(function (index) { 384 | if (this.selected) { 385 | $customSelect.find('li').eq(index).addClass('selected'); 386 | $customSelect.find('.current').html($(this).html()); 387 | } 388 | if ($(this).is(':disabled')) { 389 | $customSelect.find('li').eq(index).addClass('disabled'); 390 | } 391 | }); 392 | 393 | // fix width 394 | $customSelect.removeAttr('style') 395 | .find('ul').removeAttr('style'); 396 | $customSelect.find('li').each(function () { 397 | $customSelect.addClass('open'); 398 | if (self.outerWidth($(this)) > maxWidth) { 399 | maxWidth = self.outerWidth($(this)); 400 | } 401 | $customSelect.removeClass('open'); 402 | }); 403 | 404 | $listItems = $customSelect.find('li'); 405 | // cache list length 406 | this.cache[$customSelect.data('id')] = $listItems.length; 407 | } 408 | }, 409 | 410 | toggle_checkbox: function ($element) { 411 | var $input = $element.prev(), 412 | input = $input[0]; 413 | 414 | if (false === $input.is(':disabled')) { 415 | input.checked = ((input.checked) ? false : true); 416 | $element.toggleClass('checked'); 417 | 418 | $input.trigger('change'); 419 | } 420 | }, 421 | 422 | toggle_radio: function ($element) { 423 | var $input = $element.prev(), 424 | $form = $input.closest('form.custom'), 425 | input = $input[0]; 426 | 427 | if (false === $input.is(':disabled')) { 428 | $form.find('input[type="radio"][name="' + this.escape($input.attr('name')) + '"]') 429 | .next().not($element).removeClass('checked'); 430 | 431 | if (!$element.hasClass('checked')) { 432 | $element.toggleClass('checked'); 433 | } 434 | 435 | input.checked = $element.hasClass('checked'); 436 | 437 | $input.trigger('change'); 438 | } 439 | }, 440 | 441 | escape: function (text) { 442 | if (!text) return ''; 443 | return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); 444 | }, 445 | 446 | hidden_fix: { 447 | /** 448 | * Sets all hidden parent elements and self to visibile. 449 | * 450 | * @method adjust 451 | * @param {jQuery Object} $child 452 | */ 453 | 454 | // We'll use this to temporarily store style properties. 455 | tmp: [], 456 | 457 | // We'll use this to set hidden parent elements. 458 | hidden: null, 459 | 460 | adjust: function ($child) { 461 | // Internal reference. 462 | var _self = this; 463 | 464 | // Set all hidden parent elements, including this element. 465 | _self.hidden = $child.parents(); 466 | _self.hidden = _self.hidden.add($child).filter(":hidden"); 467 | 468 | // Loop through all hidden elements. 469 | _self.hidden.each(function () { 470 | 471 | // Cache the element. 472 | var $elem = $(this); 473 | 474 | // Store the style attribute. 475 | // Undefined if element doesn't have a style attribute. 476 | _self.tmp.push($elem.attr('style')); 477 | 478 | // Set the element's display property to block, 479 | // but ensure it's visibility is hidden. 480 | $elem.css({ 481 | 'visibility': 'hidden', 482 | 'display': 'block' 483 | }); 484 | }); 485 | 486 | }, // end adjust 487 | 488 | /** 489 | * Resets the elements previous state. 490 | * 491 | * @method reset 492 | */ 493 | reset: function () { 494 | // Internal reference. 495 | var _self = this; 496 | // Loop through our hidden element collection. 497 | _self.hidden.each(function (i) { 498 | // Cache this element. 499 | var $elem = $(this), 500 | _tmp = _self.tmp[i]; // Get the stored 'style' value for this element. 501 | 502 | // If the stored value is undefined. 503 | if (_tmp === undefined) 504 | // Remove the style attribute. 505 | $elem.removeAttr('style'); 506 | else 507 | // Otherwise, reset the element style attribute. 508 | $elem.attr('style', _tmp); 509 | }); 510 | // Reset the tmp array. 511 | _self.tmp = []; 512 | // Reset the hidden elements variable. 513 | _self.hidden = null; 514 | 515 | } // end reset 516 | }, 517 | 518 | off: function () { 519 | $(this.scope).off('.fndtn.forms'); 520 | }, 521 | 522 | reflow : function () {} 523 | }; 524 | 525 | var getFirstPrevSibling = function($el, selector) { 526 | var $el = $el.prev(); 527 | while ($el.length) { 528 | if ($el.is(selector)) return $el; 529 | $el = $el.prev(); 530 | } 531 | return $(); 532 | }; 533 | }(Foundation.zj, this, this.document)); --------------------------------------------------------------------------------