├── AsyncioAgg ├── __init__.py ├── urls.py ├── wsgi.py └── settings.py ├── static ├── media │ └── .gitkeep └── content_submit │ ├── img │ ├── .gitkeep │ └── opensource.png │ ├── robots.txt │ ├── humans.txt │ ├── js │ ├── foundation │ │ ├── foundation.alert.js │ │ ├── foundation.accordion.js │ │ ├── foundation.equalizer.js │ │ ├── foundation.offcanvas.js │ │ ├── foundation.tab.js │ │ ├── foundation.slider.js │ │ ├── foundation.magellan.js │ │ ├── foundation.interchange.js │ │ ├── foundation.tooltip.js │ │ ├── foundation.dropdown.js │ │ ├── foundation.abide.js │ │ ├── foundation.reveal.js │ │ ├── foundation.topbar.js │ │ ├── foundation.clearing.js │ │ ├── foundation.orbit.js │ │ └── foundation.js │ └── vendor │ │ ├── jquery.cookie.js │ │ ├── placeholder.js │ │ ├── fastclick.js │ │ └── modernizr.js │ └── css │ ├── style.css │ └── normalize.css ├── content_submit ├── __init__.py ├── migrations │ ├── __init__.py │ ├── 0002_auto__add_field_resource_publish_date.py │ ├── 0003_auto__add_field_resource_author.py │ ├── 0004_auto__add_field_resource_active.py │ ├── 0005_auto__chg_field_resource_publish_date.py │ ├── 0001_initial.py │ └── 0006_auto__add_submission__chg_field_resource_title__chg_field_resource_lin.py ├── tests.py ├── urls.py ├── templates │ └── content_submit │ │ ├── submission_page.html │ │ ├── _resource.html │ │ ├── home_page.html │ │ └── base.html ├── admin.py ├── models.py └── views.py ├── .gitignore ├── README.md ├── requirements.txt └── manage.py /AsyncioAgg/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/media/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /content_submit/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /content_submit/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/content_submit/img/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /content_submit/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | local_settings.py 2 | *.sqlite3 3 | *.db 4 | staticfiles/ 5 | *.log 6 | *.pot 7 | *.pyc 8 | env 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | asyncio-aggregator 2 | ================== 3 | 4 | Content Aggregation site for python's asyncio 5 | -------------------------------------------------------------------------------- /static/content_submit/img/opensource.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4grim/asyncio-aggregator/HEAD/static/content_submit/img/opensource.png -------------------------------------------------------------------------------- /static/content_submit/robots.txt: -------------------------------------------------------------------------------- 1 | # www.robotstxt.org/ 2 | # www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156449 3 | 4 | User-agent: * 5 | -------------------------------------------------------------------------------- /content_submit/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, url 2 | from content_submit import views 3 | 4 | urlpatterns = patterns('', 5 | url(r'^$', views.home_page, name='home_page'), 6 | ) -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | Django==1.6.2 2 | Pillow==2.3.1 3 | South==0.8.4 4 | boto==2.27.0 5 | django-storages==1.1.8 6 | wsgiref==0.1.2 7 | psycopg2==2.5.2 8 | gunicorn==18.0 9 | django-markdown-deux==1.0.4 -------------------------------------------------------------------------------- /static/content_submit/humans.txt: -------------------------------------------------------------------------------- 1 | /* Foundation was made by ZURB, an interaction design and design strategy firm in Campbell, CA */ 2 | /* zurb.com */ 3 | /* humanstxt.org */ 4 | 5 | /* SITE */ 6 | Standards: HTML5, CSS3 7 | Components: jQuery, Orbit, Reveal 8 | Software: Sublime, Git, Sass 9 | -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "AsyncioAgg.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /content_submit/templates/content_submit/submission_page.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 115 | 116 |

117 | 118 |
119 | 120 | × 121 | 122 | 123 | 124 | 125 | 128 | 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /static/content_submit/js/foundation/foundation.tab.js: -------------------------------------------------------------------------------- 1 | /*jslint unparam: true, browser: true, indent: 2 */ 2 | ;(function ($, window, document, undefined) { 3 | 'use strict'; 4 | 5 | Foundation.libs.tab = { 6 | name : 'tab', 7 | 8 | version : '5.2.1', 9 | 10 | settings : { 11 | active_class: 'active', 12 | callback : function () {}, 13 | deep_linking: false, 14 | scroll_to_content: true 15 | }, 16 | 17 | default_tab_hashes: [], 18 | 19 | init : function (scope, method, options) { 20 | var self = this, 21 | S = this.S; 22 | 23 | this.bindings(method, options); 24 | this.handle_location_hash_change(); 25 | 26 | // Store the default active tabs which will be referenced when the 27 | // location hash is absent, as in the case of navigating the tabs and 28 | // returning to the first viewing via the browser Back button. 29 | S('[' + this.attr_name() + '] > dd.active > a', this.scope).each(function () { 30 | self.default_tab_hashes.push(this.hash); 31 | }); 32 | }, 33 | 34 | events : function () { 35 | var self = this, 36 | S = this.S; 37 | 38 | // Click event: tab title 39 | S(this.scope).off('.tab').on('click.fndtn.tab', '[' + this.attr_name() + '] > dd > a', function (e) { 40 | e.preventDefault(); 41 | e.stopPropagation(); 42 | self.toggle_active_tab(S(this).parent()); 43 | }); 44 | 45 | // Location hash change event 46 | S(window).on('hashchange.fndtn.tab', function (e) { 47 | e.preventDefault(); 48 | self.handle_location_hash_change(); 49 | }); 50 | }, 51 | 52 | handle_location_hash_change : function () { 53 | var self = this, 54 | S = this.S; 55 | 56 | S('[' + this.attr_name() + ']', this.scope).each(function () { 57 | var settings = S(this).data(self.attr_name(true) + '-init'); 58 | if (settings.deep_linking) { 59 | // Match the location hash to a label 60 | var hash = self.scope.location.hash; 61 | if (hash != '') { 62 | // Check whether the location hash references a tab content div or 63 | // another element on the page (inside or outside the tab content div) 64 | var hash_element = S(hash); 65 | if (hash_element.hasClass('content') && hash_element.parent().hasClass('tab-content')) { 66 | // Tab content div 67 | self.toggle_active_tab($('[' + self.attr_name() + '] > dd > a[href=' + hash + ']').parent()); 68 | } else { 69 | // Not the tab content div. If inside the tab content, find the 70 | // containing tab and toggle it as active. 71 | var hash_tab_container_id = hash_element.closest('.content').attr('id'); 72 | if (hash_tab_container_id != undefined) { 73 | self.toggle_active_tab($('[' + self.attr_name() + '] > dd > a[href=#' + hash_tab_container_id + ']').parent(), hash); 74 | } 75 | } 76 | } else { 77 | // Reference the default tab hashes which were initialized in the init function 78 | for (var ind in self.default_tab_hashes) { 79 | self.toggle_active_tab($('[' + self.attr_name() + '] > dd > a[href=' + self.default_tab_hashes[ind] + ']').parent()); 80 | } 81 | } 82 | } 83 | }); 84 | }, 85 | 86 | toggle_active_tab: function (tab, location_hash) { 87 | var S = this.S, 88 | tabs = tab.closest('[' + this.attr_name() + ']'), 89 | anchor = tab.children('a').first(), 90 | target_hash = '#' + anchor.attr('href').split('#')[1], 91 | target = S(target_hash), 92 | siblings = tab.siblings(), 93 | settings = tabs.data(this.attr_name(true) + '-init'); 94 | 95 | // allow usage of data-tab-content attribute instead of href 96 | if (S(this).data(this.data_attr('tab-content'))) { 97 | target_hash = '#' + S(this).data(this.data_attr('tab-content')).split('#')[1]; 98 | target = S(target_hash); 99 | } 100 | 101 | if (settings.deep_linking) { 102 | // Get the scroll Y position prior to moving to the hash ID 103 | var cur_ypos = $('body,html').scrollTop(); 104 | 105 | // Update the location hash to preserve browser history 106 | // Note that the hash does not need to correspond to the 107 | // tab content ID anchor; it can be an ID inside or outside of the tab 108 | // content div. 109 | if (location_hash != undefined) { 110 | window.location.hash = location_hash; 111 | } else { 112 | window.location.hash = target_hash; 113 | } 114 | 115 | if (settings.scroll_to_content) { 116 | // If the user is requesting the content of a tab, then scroll to the 117 | // top of the title area; otherwise, scroll to the element within 118 | // the content area as defined by the hash value. 119 | if (location_hash == undefined || location_hash == target_hash) { 120 | tab.parent()[0].scrollIntoView(); 121 | } else { 122 | S(target_hash)[0].scrollIntoView(); 123 | } 124 | } else { 125 | // Adjust the scrollbar to the Y position prior to setting the hash 126 | // Only do this for the tab content anchor, otherwise there will be 127 | // conflicts with in-tab anchor links nested in the tab-content div 128 | if (location_hash == undefined || location_hash == target_hash) { 129 | $('body,html').scrollTop(cur_ypos); 130 | } 131 | } 132 | } 133 | 134 | // WARNING: The activation and deactivation of the tab content must 135 | // occur after the deep linking in order to properly refresh the browser 136 | // window (notably in Chrome). 137 | tab.addClass(settings.active_class).triggerHandler('opened'); 138 | siblings.removeClass(settings.active_class); 139 | target.siblings().removeClass(settings.active_class).end().addClass(settings.active_class); 140 | settings.callback(tab); 141 | target.triggerHandler('toggled', [tab]); 142 | tabs.triggerHandler('toggled', [target]); 143 | }, 144 | 145 | data_attr: function (str) { 146 | if (this.namespace.length > 0) { 147 | return this.namespace + '-' + str; 148 | } 149 | 150 | return str; 151 | }, 152 | 153 | off : function () {}, 154 | 155 | reflow : function () {} 156 | }; 157 | }(jQuery, this, this.document)); 158 | -------------------------------------------------------------------------------- /static/content_submit/js/foundation/foundation.slider.js: -------------------------------------------------------------------------------- 1 | ;(function ($, window, document, undefined) { 2 | 'use strict'; 3 | 4 | Foundation.libs.slider = { 5 | name : 'slider', 6 | 7 | version : '5.2.1', 8 | 9 | settings: { 10 | start: 0, 11 | end: 100, 12 | step: 1, 13 | initial: null, 14 | display_selector: '', 15 | on_change: function(){} 16 | }, 17 | 18 | cache : {}, 19 | 20 | init : function (scope, method, options) { 21 | Foundation.inherit(this,'throttle'); 22 | this.bindings(method, options); 23 | this.reflow(); 24 | }, 25 | 26 | events : function() { 27 | var self = this; 28 | 29 | $(this.scope) 30 | .off('.slider') 31 | .on('mousedown.fndtn.slider touchstart.fndtn.slider pointerdown.fndtn.slider', '[' + self.attr_name() + '] .range-slider-handle', function(e) { 32 | if (!self.cache.active) { 33 | self.set_active_slider($(e.target)); 34 | } 35 | }) 36 | .on('mousemove.fndtn.slider touchmove.fndtn.slider pointermove.fndtn.slider', function(e) { 37 | if (!!self.cache.active) { 38 | e.preventDefault(); 39 | self.calculate_position(self.cache.active, e.pageX || e.originalEvent.touches[0].clientX || e.currentPoint.x); 40 | } 41 | }) 42 | .on('mouseup.fndtn.slider touchend.fndtn.slider pointerup.fndtn.slider', function(e) { 43 | self.remove_active_slider(); 44 | }) 45 | .on('change.fndtn.slider', function(e) { 46 | self.settings.on_change; 47 | }); 48 | 49 | self.S(window) 50 | .on('resize.fndtn.slider', self.throttle(function(e) { 51 | self.reflow(); 52 | }, 300)); 53 | }, 54 | 55 | set_active_slider : function($handle) { 56 | this.cache.active = $handle; 57 | }, 58 | 59 | remove_active_slider : function() { 60 | this.cache.active = null; 61 | }, 62 | 63 | calculate_position : function($handle, cursor_x) { 64 | var self = this, 65 | settings = $.extend({}, self.settings, self.data_options($handle.parent())), 66 | handle_w = $.data($handle[0], 'handle_w'), 67 | handle_o = $.data($handle[0], 'handle_o'), 68 | bar_w = $.data($handle[0], 'bar_w'), 69 | bar_o = $.data($handle[0], 'bar_o'); 70 | 71 | requestAnimationFrame(function(){ 72 | var pct = self.limit_to((((cursor_x)-bar_o)/bar_w),0,1), 73 | norm = self.normalized_value(pct, settings.start, settings.end, settings.step); 74 | 75 | self.set_ui($handle, norm); 76 | }); 77 | }, 78 | 79 | set_ui : function($handle, value) { 80 | var settings = $.extend({}, this.settings, this.data_options($handle.parent())), 81 | handle_w = $.data($handle[0], 'handle_w'), 82 | bar_w = $.data($handle[0], 'bar_w'), 83 | norm_pct = this.normalized_percentage(value, settings.start, settings.end), 84 | handle_offset = norm_pct*(bar_w-handle_w)-1, 85 | progress_bar_width = norm_pct*100; 86 | 87 | this.set_translate($handle, handle_offset); 88 | $handle.siblings('.range-slider-active-segment').css('width', progress_bar_width+'%'); 89 | 90 | $handle.parent().attr(this.attr_name(), value); 91 | $handle.parent().trigger('change'); 92 | 93 | $handle.parent().children('input[type=hidden]').val(value); 94 | 95 | if (settings.input_id != '') { 96 | $(settings.display_selector).each(function(){ 97 | if (this.hasOwnProperty('value')) { 98 | $(this).val(value); 99 | } else { 100 | $(this).text(value); 101 | } 102 | }); 103 | } 104 | 105 | }, 106 | 107 | normalized_percentage : function(val, start, end) { 108 | return val/(end - start); 109 | }, 110 | 111 | normalized_value : function(val, start, end, step) { 112 | var range = end - start, 113 | step = step, 114 | point = val*range, 115 | mod = (point-(point%step)) / step, 116 | rem = point % step, 117 | round = ( rem >= step*0.5 ? step : 0); 118 | return (mod*step + round); 119 | }, 120 | 121 | set_translate : function(ele, offset, vertical) { 122 | if (vertical) { 123 | $(ele) 124 | .css('-webkit-transform', 'translateY('+offset+'px)') 125 | .css('-moz-transform', 'translateY('+offset+'px)') 126 | .css('-ms-transform', 'translateY('+offset+'px)') 127 | .css('-o-transform', 'translateY('+offset+'px)') 128 | .css('transform', 'translateY('+offset+'px)'); 129 | } else { 130 | $(ele) 131 | .css('-webkit-transform', 'translateX('+offset+'px)') 132 | .css('-moz-transform', 'translateX('+offset+'px)') 133 | .css('-ms-transform', 'translateX('+offset+'px)') 134 | .css('-o-transform', 'translateX('+offset+'px)') 135 | .css('transform', 'translateX('+offset+'px)'); 136 | } 137 | }, 138 | 139 | limit_to : function(val, min, max) { 140 | return Math.min(Math.max(val, min), max); 141 | }, 142 | 143 | initialize_settings : function(handle) { 144 | $.data(handle, 'bar', $(handle).parent()); 145 | $.data(handle, 'bar_o', $(handle).parent().offset().left); 146 | $.data(handle, 'bar_w', $(handle).parent().outerWidth()); 147 | $.data(handle, 'handle_o', $(handle).offset().left); 148 | $.data(handle, 'handle_w', $(handle).outerWidth()); 149 | $.data(handle, 'settings', $.extend({}, this.settings, this.data_options($(handle).parent()))); 150 | }, 151 | 152 | set_initial_position : function($ele) { 153 | var settings = $.data($ele.children('.range-slider-handle')[0], 'settings'), 154 | initial = (!!settings.initial ? settings.initial : Math.floor((settings.end-settings.start)*0.5/settings.step)*settings.step), 155 | $handle = $ele.children('.range-slider-handle'); 156 | this.set_ui($handle, initial); 157 | }, 158 | 159 | set_value : function(value) { 160 | var self = this; 161 | $('[' + self.attr_name() + ']', this.scope).each(function(){ 162 | $(this).attr(self.attr_name(), value); 163 | }); 164 | if (!!$(this.scope).attr(self.attr_name())) { 165 | $(this.scope).attr(self.attr_name(), value); 166 | } 167 | self.reflow(); 168 | }, 169 | 170 | reflow : function() { 171 | var self = this; 172 | self.S('[' + this.attr_name() + ']').each(function() { 173 | var handle = $(this).children('.range-slider-handle')[0], 174 | val = $(this).attr(self.attr_name()); 175 | self.initialize_settings(handle); 176 | 177 | if (val) { 178 | self.set_ui($(handle), parseInt(val)); 179 | } else { 180 | self.set_initial_position($(this)); 181 | } 182 | }); 183 | } 184 | 185 | }; 186 | 187 | }(jQuery, this, this.document)); 188 | -------------------------------------------------------------------------------- /static/content_submit/js/foundation/foundation.magellan.js: -------------------------------------------------------------------------------- 1 | ;(function ($, window, document, undefined) { 2 | 'use strict'; 3 | 4 | Foundation.libs['magellan-expedition'] = { 5 | name : 'magellan-expedition', 6 | 7 | version : '5.2.1', 8 | 9 | settings : { 10 | active_class: 'active', 11 | threshold: 0, // pixels from the top of the expedition for it to become fixes 12 | destination_threshold: 20, // pixels from the top of destination for it to be considered active 13 | throttle_delay: 30 // calculation throttling to increase framerate 14 | }, 15 | 16 | init : function (scope, method, options) { 17 | Foundation.inherit(this, 'throttle'); 18 | this.bindings(method, options); 19 | }, 20 | 21 | events : function () { 22 | var self = this, 23 | S = self.S, 24 | settings = self.settings; 25 | 26 | // initialize expedition offset 27 | self.set_expedition_position(); 28 | 29 | S(self.scope) 30 | .off('.magellan') 31 | .on('click.fndtn.magellan', '[' + self.add_namespace('data-magellan-arrival') + '] a[href^="#"]', function (e) { 32 | e.preventDefault(); 33 | var expedition = $(this).closest('[' + self.attr_name() + ']'), 34 | settings = expedition.data('magellan-expedition-init'); 35 | 36 | var hash = this.hash.split('#').join(''), 37 | target = $('a[name='+hash+']'); 38 | if (target.length === 0) target = $('#'+hash); 39 | 40 | // Account for expedition height if fixed position 41 | var scroll_top = target.offset().top; 42 | if (expedition.css('position') === 'fixed') { 43 | scroll_top = scroll_top - expedition.outerHeight(); 44 | } 45 | 46 | $('html, body').stop().animate({ 47 | 'scrollTop': scroll_top 48 | }, 700, 'swing', function () { 49 | window.location.hash = '#'+hash; 50 | }); 51 | }) 52 | .on('scroll.fndtn.magellan', self.throttle(this.check_for_arrivals.bind(this), settings.throttle_delay)) 53 | $(window).on('resize.fndtn.magellan', self.throttle(this.set_expedition_position.bind(this), settings.throttle_delay)); 54 | }, 55 | 56 | check_for_arrivals : function() { 57 | var self = this; 58 | self.update_arrivals(); 59 | self.update_expedition_positions(); 60 | }, 61 | 62 | set_expedition_position : function() { 63 | var self = this; 64 | $('[' + this.attr_name() + '=fixed]', self.scope).each(function(idx, el) { 65 | var expedition = $(this), 66 | styles = expedition.attr('styles'), // save styles 67 | top_offset; 68 | 69 | expedition.attr('style', ''); 70 | top_offset = expedition.offset().top; 71 | 72 | expedition.data(self.data_attr('magellan-top-offset'), top_offset); 73 | expedition.attr('style', styles); 74 | }); 75 | }, 76 | 77 | update_expedition_positions : function() { 78 | var self = this, 79 | window_top_offset = $(window).scrollTop(); 80 | 81 | $('[' + this.attr_name() + '=fixed]', self.scope).each(function() { 82 | var expedition = $(this), 83 | top_offset = expedition.data('magellan-top-offset'); 84 | 85 | if (window_top_offset >= top_offset) { 86 | // Placeholder allows height calculations to be consistent even when 87 | // appearing to switch between fixed/non-fixed placement 88 | var placeholder = expedition.prev('[' + self.add_namespace('data-magellan-expedition-clone') + ']'); 89 | if (placeholder.length === 0) { 90 | placeholder = expedition.clone(); 91 | placeholder.removeAttr(self.attr_name()); 92 | placeholder.attr(self.add_namespace('data-magellan-expedition-clone'),''); 93 | expedition.before(placeholder); 94 | } 95 | expedition.css({position:'fixed', top: 0}); 96 | } else { 97 | expedition.prev('[' + self.add_namespace('data-magellan-expedition-clone') + ']').remove(); 98 | expedition.attr('style',''); 99 | } 100 | }); 101 | }, 102 | 103 | update_arrivals : function() { 104 | var self = this, 105 | window_top_offset = $(window).scrollTop(); 106 | 107 | $('[' + this.attr_name() + ']', self.scope).each(function() { 108 | var expedition = $(this), 109 | settings = settings = expedition.data(self.attr_name(true) + '-init'), 110 | offsets = self.offsets(expedition, window_top_offset), 111 | arrivals = expedition.find('[' + self.add_namespace('data-magellan-arrival') + ']'), 112 | active_item = false; 113 | offsets.each(function(idx, item) { 114 | if (item.viewport_offset >= item.top_offset) { 115 | var arrivals = expedition.find('[' + self.add_namespace('data-magellan-arrival') + ']'); 116 | arrivals.not(item.arrival).removeClass(settings.active_class); 117 | item.arrival.addClass(settings.active_class); 118 | active_item = true; 119 | return true; 120 | } 121 | }); 122 | 123 | if (!active_item) arrivals.removeClass(settings.active_class); 124 | }); 125 | }, 126 | 127 | offsets : function(expedition, window_offset) { 128 | var self = this, 129 | settings = expedition.data(self.attr_name(true) + '-init'), 130 | viewport_offset = (window_offset + settings.destination_threshold); 131 | 132 | return expedition.find('[' + self.add_namespace('data-magellan-arrival') + ']').map(function(idx, el) { 133 | var name = $(this).data(self.data_attr('magellan-arrival')), 134 | dest = $('[' + self.add_namespace('data-magellan-destination') + '=' + name + ']'); 135 | if (dest.length > 0) { 136 | var top_offset = dest.offset().top; 137 | return { 138 | destination : dest, 139 | arrival : $(this), 140 | top_offset : top_offset, 141 | viewport_offset : viewport_offset 142 | } 143 | } 144 | }).sort(function(a, b) { 145 | if (a.top_offset < b.top_offset) return -1; 146 | if (a.top_offset > b.top_offset) return 1; 147 | return 0; 148 | }); 149 | }, 150 | 151 | data_attr: function (str) { 152 | if (this.namespace.length > 0) { 153 | return this.namespace + '-' + str; 154 | } 155 | 156 | return str; 157 | }, 158 | 159 | off : function () { 160 | this.S(this.scope).off('.magellan'); 161 | this.S(window).off('.magellan'); 162 | }, 163 | 164 | reflow : function () { 165 | var self = this; 166 | // remove placeholder expeditions used for height calculation purposes 167 | $('[' + self.add_namespace('data-magellan-expedition-clone') + ']', self.scope).remove(); 168 | } 169 | }; 170 | }(jQuery, this, this.document)); 171 | -------------------------------------------------------------------------------- /static/content_submit/css/style.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | background-color: #f0f4f6; 3 | margin: 0rem; 4 | padding: 0rem; 5 | font-size: 16px; 6 | } 7 | 8 | .main { 9 | background-color: #f0f4f6; 10 | } 11 | /* -----------------------HERO SECTION ---------------------------------- */ 12 | .main-head { 13 | background-color: #2d3438; 14 | height: 300px; 15 | position: relative; 16 | text-align: center; 17 | } 18 | nav { 19 | background-color: #2d3438; 20 | color: #bfd1d9; 21 | font-family: 'Montserrat', sans-serif; 22 | padding-top: 17px; 23 | padding-bottom: 17px; 24 | } 25 | nav a { 26 | color: #bfd1d9; 27 | font-weight: 200; 28 | padding-left: .5rem; 29 | padding-right: .5rem; 30 | font-family: 'Montserrat', sans-serif; 31 | font-size: normal; 32 | } 33 | nav a:hover, nav a:active { 34 | text-decoration: none; 35 | } 36 | .main-head h1 { 37 | color: #a6b7bf; 38 | margin: 0rem; 39 | font-family: 'Montserrat', sans-serif; 40 | vertical-align: center; 41 | padding-top: 3rem; 42 | } 43 | .main-head p.small { 44 | color: #79909a; 45 | margin: 0rem; 46 | padding-top: 20px; 47 | padding-bottom: 20px; 48 | font-family: 'Montserrat', sans-serif; 49 | text-align: center; 50 | } 51 | .main-head p.medium { 52 | color: #79909a; 53 | margin: 0rem; 54 | padding-top: 30px; 55 | padding-bottom: 34px; 56 | font-family: 'Montserrat', sans-serif; 57 | font-size: 18px; 58 | text-align: center; 59 | } 60 | .main-head p.large { 61 | color: #79909a; 62 | margin: 0rem; 63 | padding-top: 30px; 64 | padding-bottom: 36px; 65 | font-family: 'Montserrat', sans-serif; 66 | text-align: center; 67 | } 68 | .main-head a { 69 | color: #bfd1d9; 70 | text-decoration: underline; 71 | font-family: 'Montserrat', sans-serif; 72 | } 73 | 74 | /* ------------------------- CONTENT SECTION --------------------- */ 75 | .main-content { 76 | background-color: #fff; 77 | border-width: 1px; 78 | border-style: solid; 79 | border-right-color: #dfe8ec; 80 | border-left-color: #dfe8ec; 81 | border-bottom-color: #dfe8ec; 82 | border-top: none; 83 | box-shadow: 0px .5px .5px .5px #ccc; 84 | margin-bottom: 3rem; 85 | margin-top: 0rem; 86 | text-align: center; 87 | width: 100%; 88 | max-width: 1000px; 89 | } 90 | 91 | .resource-type-title { 92 | clear: both; 93 | font-family: 'Lato', sans-serif; 94 | text-align: left; 95 | margin-top: 1em; 96 | color: #ACACAC; 97 | margin-left: 100px; 98 | } 99 | 100 | .rsrc-columns { 101 | /* -webkit-column-count: 1; 102 | -webkit-column-gap: 1rem; 103 | -webkit-column-fill: auto; 104 | -moz-column-count: 1; 105 | -moz-column-gap: 1rem; 106 | -moz-column-fill: auto; 107 | column-count: 1; 108 | column-gap: 1rem; 109 | column-fill: auto; 110 | 111 | width: 800px; 112 | margin-left: 100px;*/ 113 | width: 80%; 114 | margin: auto; 115 | } 116 | 117 | @media (min-width: 960px) { 118 | .rsrc-columns { 119 | /*-webkit-column-count: 2; 120 | -moz-column-count: 2; 121 | column-count: 2;*/ 122 | } 123 | } 124 | 125 | /*@media (min-width: 1100px) { 126 | .rsrc-columns { 127 | -webkit-column-count: 5; 128 | -moz-column-count: 5; 129 | column-count: 5; 130 | } 131 | }*/ 132 | 133 | .content-data { 134 | 135 | } 136 | 137 | .box { 138 | display: block; 139 | width: 23rem; 140 | background-color: #f6f6f6; 141 | box-shadow: 0px 2px 2px 0px rgba(50, 50, 50, 0.15); 142 | font-family: 'Lato', sans-serif; 143 | border-style: solid; 144 | border-color: #ccc; 145 | border-width: 1px; 146 | margin-right: 1rem; 147 | margin-top: 0.5rem; 148 | margin-bottom: 1rem; 149 | width: 100%; 150 | clear:both; 151 | overflow: auto; 152 | padding: 1rem; 153 | } 154 | 155 | .box .link { 156 | color: #17abf0; 157 | } 158 | 159 | .box img { 160 | display: block; 161 | width: 25%; 162 | height: auto; 163 | float: left; 164 | margin-right: 1rem; 165 | } 166 | 167 | /*.content-tile { 168 | padding: 1rem; 169 | } 170 | 171 | .content-tile h4 { 172 | color: #717e84; 173 | } 174 | 175 | .content-tile a { 176 | color: #17abf0; 177 | word-wrap: break-word; 178 | } 179 | 180 | .content-tile p { 181 | color: #5a5f61; 182 | } 183 | 184 | .content-tile:active { 185 | background-color: #222729; 186 | } 187 | 188 | .content-tile-image { 189 | padding: 0rem; 190 | } 191 | 192 | .content-tile-image > .image { 193 | padding: 0rem; 194 | 195 | margin: 1rem; 196 | } 197 | 198 | .content-tile-image > .content { 199 | padding: 1rem; 200 | }*/ 201 | 202 | .box h4 { 203 | color: #717e84; 204 | } 205 | 206 | .box a { 207 | color: #17abf0; 208 | word-wrap: break-word; 209 | } 210 | 211 | .box p { 212 | color: #5a5f61; 213 | } 214 | 215 | .content-tile-image:active { 216 | background-color: #222729; 217 | } 218 | 219 | .pub-date { 220 | margin: 0px; 221 | } 222 | 223 | .author { 224 | margin: 0px; 225 | } 226 | 227 | /* ------------------------- CONTENT NAVIGATION ------------------- */ 228 | .resource-nav { 229 | background-color: #f0f4f6; 230 | border-width: 1px; 231 | border-style: solid; 232 | border-top-color: #dfe8ec; 233 | border-right-color: #fff; 234 | border-left-color: #fff; 235 | border-bottom-color: #dfe8ec; 236 | padding: 0rem; 237 | margin-top: 0px; 238 | margin-left: auto; 239 | margin-right: auto; 240 | max-width: 100%; 241 | position: relative; 242 | } 243 | 244 | dl.large { 245 | margin: 0rem; 246 | font-family: 'Lato', sans-serif; 247 | } 248 | 249 | dl.medium { 250 | margin-top: 0rem; 251 | margin-left: 0rem; 252 | margin-right: 0rem; 253 | font-family: 'Lato', sans-serif; 254 | } 255 | 256 | dl.small { 257 | margin: 0rem; 258 | font-family: 'Lato', sans-serif; 259 | } 260 | dl.large > dd.active { 261 | background-color: #fff; 262 | } 263 | 264 | dl.medium > dd.active { 265 | background-color: #fff; 266 | } 267 | dl.small > dd.active { 268 | background-color: #fff; 269 | } 270 | .sub-nav { 271 | padding-top: 0px; 272 | margin-bottom: 0px; 273 | padding-bottom: 0rem; 274 | margin-left: 0px; 275 | margin-right: 0px; 276 | text-align: center; 277 | } 278 | .sub-nav dd:first-child { 279 | border-left: none; 280 | font-family: 'Lato', sans-serif; 281 | } 282 | 283 | .sub-nav dd.active a { 284 | background-color: #fff; 285 | color: #717e84; 286 | border-radius: 0px; 287 | padding-left: 0rem; 288 | margin: 0rem; 289 | font-family: 'Lato', sans-serif; 290 | font-weight: normal; 291 | font-size: 1rem; 292 | } 293 | 294 | dl.large dd { 295 | border-left-style: solid; 296 | border-left-width: 2px; 297 | border-left-color: #fff; 298 | padding-left: 1em; 299 | padding-right: 1em; 300 | margin: 0rem; 301 | background-color: #f0f4f6; 302 | font-size: 1.5rem; 303 | color: #717e84; 304 | text-align: center; 305 | width: 20%; 306 | } 307 | 308 | dl.medium dd { 309 | border-left-style: solid; 310 | border-left-width: 1px; 311 | border-left-color: #fff; 312 | padding-top: .2rem; 313 | padding-bottom: .2rem; 314 | margin: 0rem; 315 | background-color: #f0f4f6; 316 | font-size: 1.25rem; 317 | color: #717e84; 318 | width: 20%; 319 | text-align: center; 320 | } 321 | 322 | dl.small dd { 323 | border-left-style: solid; 324 | border-left-width: 1px; 325 | border-left-color: #fff; 326 | padding: 0rem; 327 | margin: 0rem; 328 | background-color: #f0f4f6; 329 | font-size: .75rem; 330 | color: #717e84; 331 | width: 20%; 332 | text-align: center; 333 | } 334 | 335 | [data-magellan-expedition] { 336 | left: 0; 337 | } 338 | -------------------------------------------------------------------------------- /static/content_submit/js/vendor/fastclick.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve FastClick: polyfill to remove click delays on browsers with touch UIs. 3 | * 4 | * @version 0.6.12 5 | * @codingstandard ftlabs-jsv2 6 | * @copyright The Financial Times Limited [All Rights Reserved] 7 | * @license MIT License (see LICENSE.txt) 8 | */ 9 | function FastClick(a){"use strict";var b,c=this;if(this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=10,this.layer=a,!a||!a.nodeType)throw new TypeError("Layer must be a document node");this.onClick=function(){return FastClick.prototype.onClick.apply(c,arguments)},this.onMouse=function(){return FastClick.prototype.onMouse.apply(c,arguments)},this.onTouchStart=function(){return FastClick.prototype.onTouchStart.apply(c,arguments)},this.onTouchMove=function(){return FastClick.prototype.onTouchMove.apply(c,arguments)},this.onTouchEnd=function(){return FastClick.prototype.onTouchEnd.apply(c,arguments)},this.onTouchCancel=function(){return FastClick.prototype.onTouchCancel.apply(c,arguments)},FastClick.notNeeded(a)||(this.deviceIsAndroid&&(a.addEventListener("mouseover",this.onMouse,!0),a.addEventListener("mousedown",this.onMouse,!0),a.addEventListener("mouseup",this.onMouse,!0)),a.addEventListener("click",this.onClick,!0),a.addEventListener("touchstart",this.onTouchStart,!1),a.addEventListener("touchmove",this.onTouchMove,!1),a.addEventListener("touchend",this.onTouchEnd,!1),a.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(a.removeEventListener=function(b,c,d){var e=Node.prototype.removeEventListener;"click"===b?e.call(a,b,c.hijacked||c,d):e.call(a,b,c,d)},a.addEventListener=function(b,c,d){var e=Node.prototype.addEventListener;"click"===b?e.call(a,b,c.hijacked||(c.hijacked=function(a){a.propagationStopped||c(a)}),d):e.call(a,b,c,d)}),"function"==typeof a.onclick&&(b=a.onclick,a.addEventListener("click",function(a){b(a)},!1),a.onclick=null))}FastClick.prototype.deviceIsAndroid=navigator.userAgent.indexOf("Android")>0,FastClick.prototype.deviceIsIOS=/iP(ad|hone|od)/.test(navigator.userAgent),FastClick.prototype.deviceIsIOS4=FastClick.prototype.deviceIsIOS&&/OS 4_\d(_\d)?/.test(navigator.userAgent),FastClick.prototype.deviceIsIOSWithBadTarget=FastClick.prototype.deviceIsIOS&&/OS ([6-9]|\d{2})_\d/.test(navigator.userAgent),FastClick.prototype.needsClick=function(a){"use strict";switch(a.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(a.disabled)return!0;break;case"input":if(this.deviceIsIOS&&"file"===a.type||a.disabled)return!0;break;case"label":case"video":return!0}return/\bneedsclick\b/.test(a.className)},FastClick.prototype.needsFocus=function(a){"use strict";switch(a.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!this.deviceIsAndroid;case"input":switch(a.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!a.disabled&&!a.readOnly;default:return/\bneedsfocus\b/.test(a.className)}},FastClick.prototype.sendClick=function(a,b){"use strict";var c,d;document.activeElement&&document.activeElement!==a&&document.activeElement.blur(),d=b.changedTouches[0],c=document.createEvent("MouseEvents"),c.initMouseEvent(this.determineEventType(a),!0,!0,window,1,d.screenX,d.screenY,d.clientX,d.clientY,!1,!1,!1,!1,0,null),c.forwardedTouchEvent=!0,a.dispatchEvent(c)},FastClick.prototype.determineEventType=function(a){"use strict";return this.deviceIsAndroid&&"select"===a.tagName.toLowerCase()?"mousedown":"click"},FastClick.prototype.focus=function(a){"use strict";var b;this.deviceIsIOS&&a.setSelectionRange&&0!==a.type.indexOf("date")&&"time"!==a.type?(b=a.value.length,a.setSelectionRange(b,b)):a.focus()},FastClick.prototype.updateScrollParent=function(a){"use strict";var b,c;if(b=a.fastClickScrollParent,!b||!b.contains(a)){c=a;do{if(c.scrollHeight>c.offsetHeight){b=c,a.fastClickScrollParent=c;break}c=c.parentElement}while(c)}b&&(b.fastClickLastScrollTop=b.scrollTop)},FastClick.prototype.getTargetElementFromEventTarget=function(a){"use strict";return a.nodeType===Node.TEXT_NODE?a.parentNode:a},FastClick.prototype.onTouchStart=function(a){"use strict";var b,c,d;if(a.targetTouches.length>1)return!0;if(b=this.getTargetElementFromEventTarget(a.target),c=a.targetTouches[0],this.deviceIsIOS){if(d=window.getSelection(),d.rangeCount&&!d.isCollapsed)return!0;if(!this.deviceIsIOS4){if(c.identifier===this.lastTouchIdentifier)return a.preventDefault(),!1;this.lastTouchIdentifier=c.identifier,this.updateScrollParent(b)}}return this.trackingClick=!0,this.trackingClickStart=a.timeStamp,this.targetElement=b,this.touchStartX=c.pageX,this.touchStartY=c.pageY,a.timeStamp-this.lastClickTime<200&&a.preventDefault(),!0},FastClick.prototype.touchHasMoved=function(a){"use strict";var b=a.changedTouches[0],c=this.touchBoundary;return Math.abs(b.pageX-this.touchStartX)>c||Math.abs(b.pageY-this.touchStartY)>c?!0:!1},FastClick.prototype.onTouchMove=function(a){"use strict";return this.trackingClick?((this.targetElement!==this.getTargetElementFromEventTarget(a.target)||this.touchHasMoved(a))&&(this.trackingClick=!1,this.targetElement=null),!0):!0},FastClick.prototype.findControl=function(a){"use strict";return void 0!==a.control?a.control:a.htmlFor?document.getElementById(a.htmlFor):a.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},FastClick.prototype.onTouchEnd=function(a){"use strict";var b,c,d,e,f,g=this.targetElement;if(!this.trackingClick)return!0;if(a.timeStamp-this.lastClickTime<200)return this.cancelNextClick=!0,!0;if(this.cancelNextClick=!1,this.lastClickTime=a.timeStamp,c=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,this.deviceIsIOSWithBadTarget&&(f=a.changedTouches[0],g=document.elementFromPoint(f.pageX-window.pageXOffset,f.pageY-window.pageYOffset)||g,g.fastClickScrollParent=this.targetElement.fastClickScrollParent),d=g.tagName.toLowerCase(),"label"===d){if(b=this.findControl(g)){if(this.focus(g),this.deviceIsAndroid)return!1;g=b}}else if(this.needsFocus(g))return a.timeStamp-c>100||this.deviceIsIOS&&window.top!==window&&"input"===d?(this.targetElement=null,!1):(this.focus(g),this.sendClick(g,a),this.deviceIsIOS4&&"select"===d||(this.targetElement=null,a.preventDefault()),!1);return this.deviceIsIOS&&!this.deviceIsIOS4&&(e=g.fastClickScrollParent,e&&e.fastClickLastScrollTop!==e.scrollTop)?!0:(this.needsClick(g)||(a.preventDefault(),this.sendClick(g,a)),!1)},FastClick.prototype.onTouchCancel=function(){"use strict";this.trackingClick=!1,this.targetElement=null},FastClick.prototype.onMouse=function(a){"use strict";return this.targetElement?a.forwardedTouchEvent?!0:a.cancelable&&(!this.needsClick(this.targetElement)||this.cancelNextClick)?(a.stopImmediatePropagation?a.stopImmediatePropagation():a.propagationStopped=!0,a.stopPropagation(),a.preventDefault(),!1):!0:!0},FastClick.prototype.onClick=function(a){"use strict";var b;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===a.target.type&&0===a.detail?!0:(b=this.onMouse(a),b||(this.targetElement=null),b)},FastClick.prototype.destroy=function(){"use strict";var a=this.layer;this.deviceIsAndroid&&(a.removeEventListener("mouseover",this.onMouse,!0),a.removeEventListener("mousedown",this.onMouse,!0),a.removeEventListener("mouseup",this.onMouse,!0)),a.removeEventListener("click",this.onClick,!0),a.removeEventListener("touchstart",this.onTouchStart,!1),a.removeEventListener("touchmove",this.onTouchMove,!1),a.removeEventListener("touchend",this.onTouchEnd,!1),a.removeEventListener("touchcancel",this.onTouchCancel,!1)},FastClick.notNeeded=function(a){"use strict";var b,c;if("undefined"==typeof window.ontouchstart)return!0;if(c=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!FastClick.prototype.deviceIsAndroid)return!0;if(b=document.querySelector("meta[name=viewport]")){if(-1!==b.content.indexOf("user-scalable=no"))return!0;if(c>31&&window.innerWidth<=window.screen.width)return!0}}return"none"===a.style.msTouchAction?!0:!1},FastClick.attach=function(a){"use strict";return new FastClick(a)},"undefined"!=typeof define&&define.amd?define(function(){"use strict";return FastClick}):"undefined"!=typeof module&&module.exports?(module.exports=FastClick.attach,module.exports.FastClick=FastClick):window.FastClick=FastClick; 10 | -------------------------------------------------------------------------------- /static/content_submit/css/normalize.css: -------------------------------------------------------------------------------- 1 | /*! normalize.css v3.0.0 | MIT License | git.io/normalize */ 2 | 3 | /** 4 | * 1. Set default font family to sans-serif. 5 | * 2. Prevent iOS text size adjust after orientation change, without disabling 6 | * user zoom. 7 | */ 8 | 9 | html { 10 | font-family: sans-serif; /* 1 */ 11 | -ms-text-size-adjust: 100%; /* 2 */ 12 | -webkit-text-size-adjust: 100%; /* 2 */ 13 | } 14 | 15 | /** 16 | * Remove default margin. 17 | */ 18 | 19 | body { 20 | margin: 0; 21 | } 22 | 23 | /* HTML5 display definitions 24 | ========================================================================== */ 25 | 26 | /** 27 | * Correct `block` display not defined in IE 8/9. 28 | */ 29 | 30 | article, 31 | aside, 32 | details, 33 | figcaption, 34 | figure, 35 | footer, 36 | header, 37 | hgroup, 38 | main, 39 | nav, 40 | section, 41 | summary { 42 | display: block; 43 | } 44 | 45 | /** 46 | * 1. Correct `inline-block` display not defined in IE 8/9. 47 | * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. 48 | */ 49 | 50 | audio, 51 | canvas, 52 | progress, 53 | video { 54 | display: inline-block; /* 1 */ 55 | vertical-align: baseline; /* 2 */ 56 | } 57 | 58 | /** 59 | * Prevent modern browsers from displaying `audio` without controls. 60 | * Remove excess height in iOS 5 devices. 61 | */ 62 | 63 | audio:not([controls]) { 64 | display: none; 65 | height: 0; 66 | } 67 | 68 | /** 69 | * Address `[hidden]` styling not present in IE 8/9. 70 | * Hide the `template` element in IE, Safari, and Firefox < 22. 71 | */ 72 | 73 | [hidden], 74 | template { 75 | display: none; 76 | } 77 | 78 | /* Links 79 | ========================================================================== */ 80 | 81 | /** 82 | * Remove the gray background color from active links in IE 10. 83 | */ 84 | 85 | a { 86 | background: transparent; 87 | } 88 | 89 | /** 90 | * Improve readability when focused and also mouse hovered in all browsers. 91 | */ 92 | 93 | a:active, 94 | a:hover { 95 | outline: 0; 96 | } 97 | 98 | /* Text-level semantics 99 | ========================================================================== */ 100 | 101 | /** 102 | * Address styling not present in IE 8/9, Safari 5, and Chrome. 103 | */ 104 | 105 | abbr[title] { 106 | border-bottom: 1px dotted; 107 | } 108 | 109 | /** 110 | * Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome. 111 | */ 112 | 113 | b, 114 | strong { 115 | font-weight: bold; 116 | } 117 | 118 | /** 119 | * Address styling not present in Safari 5 and Chrome. 120 | */ 121 | 122 | dfn { 123 | font-style: italic; 124 | } 125 | 126 | /** 127 | * Address variable `h1` font-size and margin within `section` and `article` 128 | * contexts in Firefox 4+, Safari 5, and Chrome. 129 | */ 130 | 131 | h1 { 132 | font-size: 2em; 133 | margin: 0.67em 0; 134 | } 135 | 136 | /** 137 | * Address styling not present in IE 8/9. 138 | */ 139 | 140 | mark { 141 | background: #ff0; 142 | color: #000; 143 | } 144 | 145 | /** 146 | * Address inconsistent and variable font size in all browsers. 147 | */ 148 | 149 | small { 150 | font-size: 80%; 151 | } 152 | 153 | /** 154 | * Prevent `sub` and `sup` affecting `line-height` in all browsers. 155 | */ 156 | 157 | sub, 158 | sup { 159 | font-size: 75%; 160 | line-height: 0; 161 | position: relative; 162 | vertical-align: baseline; 163 | } 164 | 165 | sup { 166 | top: -0.5em; 167 | } 168 | 169 | sub { 170 | bottom: -0.25em; 171 | } 172 | 173 | /* Embedded content 174 | ========================================================================== */ 175 | 176 | /** 177 | * Remove border when inside `a` element in IE 8/9. 178 | */ 179 | 180 | img { 181 | border: 0; 182 | } 183 | 184 | /** 185 | * Correct overflow displayed oddly in IE 9. 186 | */ 187 | 188 | svg:not(:root) { 189 | overflow: hidden; 190 | } 191 | 192 | /* Grouping content 193 | ========================================================================== */ 194 | 195 | /** 196 | * Address margin not present in IE 8/9 and Safari 5. 197 | */ 198 | 199 | figure { 200 | margin: 1em 40px; 201 | } 202 | 203 | /** 204 | * Address differences between Firefox and other browsers. 205 | */ 206 | 207 | hr { 208 | -moz-box-sizing: content-box; 209 | box-sizing: content-box; 210 | height: 0; 211 | } 212 | 213 | /** 214 | * Contain overflow in all browsers. 215 | */ 216 | 217 | pre { 218 | overflow: auto; 219 | } 220 | 221 | /** 222 | * Address odd `em`-unit font size rendering in all browsers. 223 | */ 224 | 225 | code, 226 | kbd, 227 | pre, 228 | samp { 229 | font-family: monospace, monospace; 230 | font-size: 1em; 231 | } 232 | 233 | /* Forms 234 | ========================================================================== */ 235 | 236 | /** 237 | * Known limitation: by default, Chrome and Safari on OS X allow very limited 238 | * styling of `select`, unless a `border` property is set. 239 | */ 240 | 241 | /** 242 | * 1. Correct color not being inherited. 243 | * Known issue: affects color of disabled elements. 244 | * 2. Correct font properties not being inherited. 245 | * 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome. 246 | */ 247 | 248 | button, 249 | input, 250 | optgroup, 251 | select, 252 | textarea { 253 | color: inherit; /* 1 */ 254 | font: inherit; /* 2 */ 255 | margin: 0; /* 3 */ 256 | } 257 | 258 | /** 259 | * Address `overflow` set to `hidden` in IE 8/9/10. 260 | */ 261 | 262 | button { 263 | overflow: visible; 264 | } 265 | 266 | /** 267 | * Address inconsistent `text-transform` inheritance for `button` and `select`. 268 | * All other form control elements do not inherit `text-transform` values. 269 | * Correct `button` style inheritance in Firefox, IE 8+, and Opera 270 | * Correct `select` style inheritance in Firefox. 271 | */ 272 | 273 | button, 274 | select { 275 | text-transform: none; 276 | } 277 | 278 | /** 279 | * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` 280 | * and `video` controls. 281 | * 2. Correct inability to style clickable `input` types in iOS. 282 | * 3. Improve usability and consistency of cursor style between image-type 283 | * `input` and others. 284 | */ 285 | 286 | button, 287 | html input[type="button"], /* 1 */ 288 | input[type="reset"], 289 | input[type="submit"] { 290 | -webkit-appearance: button; /* 2 */ 291 | cursor: pointer; /* 3 */ 292 | } 293 | 294 | /** 295 | * Re-set default cursor for disabled elements. 296 | */ 297 | 298 | button[disabled], 299 | html input[disabled] { 300 | cursor: default; 301 | } 302 | 303 | /** 304 | * Remove inner padding and border in Firefox 4+. 305 | */ 306 | 307 | button::-moz-focus-inner, 308 | input::-moz-focus-inner { 309 | border: 0; 310 | padding: 0; 311 | } 312 | 313 | /** 314 | * Address Firefox 4+ setting `line-height` on `input` using `!important` in 315 | * the UA stylesheet. 316 | */ 317 | 318 | input { 319 | line-height: normal; 320 | } 321 | 322 | /** 323 | * It's recommended that you don't attempt to style these elements. 324 | * Firefox's implementation doesn't respect box-sizing, padding, or width. 325 | * 326 | * 1. Address box sizing set to `content-box` in IE 8/9/10. 327 | * 2. Remove excess padding in IE 8/9/10. 328 | */ 329 | 330 | input[type="checkbox"], 331 | input[type="radio"] { 332 | box-sizing: border-box; /* 1 */ 333 | padding: 0; /* 2 */ 334 | } 335 | 336 | /** 337 | * Fix the cursor style for Chrome's increment/decrement buttons. For certain 338 | * `font-size` values of the `input`, it causes the cursor style of the 339 | * decrement button to change from `default` to `text`. 340 | */ 341 | 342 | input[type="number"]::-webkit-inner-spin-button, 343 | input[type="number"]::-webkit-outer-spin-button { 344 | height: auto; 345 | } 346 | 347 | /** 348 | * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome. 349 | * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome 350 | * (include `-moz` to future-proof). 351 | */ 352 | 353 | input[type="search"] { 354 | -webkit-appearance: textfield; /* 1 */ 355 | -moz-box-sizing: content-box; 356 | -webkit-box-sizing: content-box; /* 2 */ 357 | box-sizing: content-box; 358 | } 359 | 360 | /** 361 | * Remove inner padding and search cancel button in Safari and Chrome on OS X. 362 | * Safari (but not Chrome) clips the cancel button when the search input has 363 | * padding (and `textfield` appearance). 364 | */ 365 | 366 | input[type="search"]::-webkit-search-cancel-button, 367 | input[type="search"]::-webkit-search-decoration { 368 | -webkit-appearance: none; 369 | } 370 | 371 | /** 372 | * Define consistent border, margin, and padding. 373 | */ 374 | 375 | fieldset { 376 | border: 1px solid #c0c0c0; 377 | margin: 0 2px; 378 | padding: 0.35em 0.625em 0.75em; 379 | } 380 | 381 | /** 382 | * 1. Correct `color` not being inherited in IE 8/9. 383 | * 2. Remove padding so people aren't caught out if they zero out fieldsets. 384 | */ 385 | 386 | legend { 387 | border: 0; /* 1 */ 388 | padding: 0; /* 2 */ 389 | } 390 | 391 | /** 392 | * Remove default vertical scrollbar in IE 8/9. 393 | */ 394 | 395 | textarea { 396 | overflow: auto; 397 | } 398 | 399 | /** 400 | * Don't inherit the `font-weight` (applied by a rule above). 401 | * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. 402 | */ 403 | 404 | optgroup { 405 | font-weight: bold; 406 | } 407 | 408 | /* Tables 409 | ========================================================================== */ 410 | 411 | /** 412 | * Remove most spacing between table cells. 413 | */ 414 | 415 | table { 416 | border-collapse: collapse; 417 | border-spacing: 0; 418 | } 419 | 420 | td, 421 | th { 422 | padding: 0; 423 | } 424 | -------------------------------------------------------------------------------- /static/content_submit/js/foundation/foundation.interchange.js: -------------------------------------------------------------------------------- 1 | ;(function ($, window, document, undefined) { 2 | 'use strict'; 3 | 4 | Foundation.libs.interchange = { 5 | name : 'interchange', 6 | 7 | version : '5.2.1', 8 | 9 | cache : {}, 10 | 11 | images_loaded : false, 12 | nodes_loaded : false, 13 | 14 | settings : { 15 | load_attr : 'interchange', 16 | 17 | named_queries : { 18 | 'default' : 'only screen', 19 | small : Foundation.media_queries.small, 20 | medium : Foundation.media_queries.medium, 21 | large : Foundation.media_queries.large, 22 | xlarge : Foundation.media_queries.xlarge, 23 | xxlarge: Foundation.media_queries.xxlarge, 24 | landscape : 'only screen and (orientation: landscape)', 25 | portrait : 'only screen and (orientation: portrait)', 26 | retina : 'only screen and (-webkit-min-device-pixel-ratio: 2),' + 27 | 'only screen and (min--moz-device-pixel-ratio: 2),' + 28 | 'only screen and (-o-min-device-pixel-ratio: 2/1),' + 29 | 'only screen and (min-device-pixel-ratio: 2),' + 30 | 'only screen and (min-resolution: 192dpi),' + 31 | 'only screen and (min-resolution: 2dppx)' 32 | }, 33 | 34 | directives : { 35 | replace: function (el, path, trigger) { 36 | // The trigger argument, if called within the directive, fires 37 | // an event named after the directive on the element, passing 38 | // any parameters along to the event that you pass to trigger. 39 | // 40 | // ex. trigger(), trigger([a, b, c]), or trigger(a, b, c) 41 | // 42 | // This allows you to bind a callback like so: 43 | // $('#interchangeContainer').on('replace', function (e, a, b, c) { 44 | // console.log($(this).html(), a, b, c); 45 | // }); 46 | 47 | if (/IMG/.test(el[0].nodeName)) { 48 | var orig_path = el[0].src; 49 | 50 | if (new RegExp(path, 'i').test(orig_path)) return; 51 | 52 | el[0].src = path; 53 | 54 | return trigger(el[0].src); 55 | } 56 | var last_path = el.data(this.data_attr + '-last-path'); 57 | 58 | if (last_path == path) return; 59 | 60 | 61 | var regex = "/^.(\.jpg|\.jpeg|\.png|\.gif|\.tiff|\.bmp)\??|#?./"; 62 | 63 | if (new RegExp(regex,'i').test(path)){ 64 | 65 | $(el).css('background-image', 'url('+path+')'); 66 | el.data('interchange-last-path', path); 67 | return trigger(path); 68 | } 69 | 70 | return $.get(path, function (response) { 71 | el.html(response); 72 | el.data(this.data_attr + '-last-path', path); 73 | trigger(); 74 | }); 75 | 76 | } 77 | } 78 | }, 79 | 80 | init : function (scope, method, options) { 81 | Foundation.inherit(this, 'throttle random_str'); 82 | 83 | this.data_attr = this.set_data_attr(); 84 | $.extend(true, this.settings, method, options); 85 | this.bindings(method, options); 86 | this.load('images'); 87 | this.load('nodes'); 88 | }, 89 | 90 | get_media_hash : function() { 91 | var mediaHash=''; 92 | for (var queryName in this.settings.named_queries ) { 93 | mediaHash += matchMedia(this.settings.named_queries[queryName]).matches.toString(); 94 | } 95 | return mediaHash; 96 | }, 97 | 98 | events : function () { 99 | var self = this, prevMediaHash; 100 | 101 | $(window) 102 | .off('.interchange') 103 | .on('resize.fndtn.interchange', self.throttle(function () { 104 | var currMediaHash = self.get_media_hash(); 105 | if (currMediaHash !== prevMediaHash) { 106 | self.resize(); 107 | } 108 | prevMediaHash = currMediaHash; 109 | }, 50)); 110 | 111 | return this; 112 | }, 113 | 114 | resize : function () { 115 | var cache = this.cache; 116 | 117 | if(!this.images_loaded || !this.nodes_loaded) { 118 | setTimeout($.proxy(this.resize, this), 50); 119 | return; 120 | } 121 | 122 | for (var uuid in cache) { 123 | if (cache.hasOwnProperty(uuid)) { 124 | var passed = this.results(uuid, cache[uuid]); 125 | 126 | if (passed) { 127 | this.settings.directives[passed 128 | .scenario[1]].call(this, passed.el, passed.scenario[0], function () { 129 | if (arguments[0] instanceof Array) { 130 | var args = arguments[0]; 131 | } else { 132 | var args = Array.prototype.slice.call(arguments, 0); 133 | } 134 | 135 | passed.el.trigger(passed.scenario[1], args); 136 | }); 137 | } 138 | } 139 | } 140 | 141 | }, 142 | 143 | results : function (uuid, scenarios) { 144 | var count = scenarios.length; 145 | 146 | if (count > 0) { 147 | var el = this.S('[' + this.add_namespace('data-uuid') + '="' + uuid + '"]'); 148 | 149 | while (count--) { 150 | var mq, rule = scenarios[count][2]; 151 | if (this.settings.named_queries.hasOwnProperty(rule)) { 152 | mq = matchMedia(this.settings.named_queries[rule]); 153 | } else { 154 | mq = matchMedia(rule); 155 | } 156 | if (mq.matches) { 157 | return {el: el, scenario: scenarios[count]}; 158 | } 159 | } 160 | } 161 | 162 | return false; 163 | }, 164 | 165 | load : function (type, force_update) { 166 | if (typeof this['cached_' + type] === 'undefined' || force_update) { 167 | this['update_' + type](); 168 | } 169 | 170 | return this['cached_' + type]; 171 | }, 172 | 173 | update_images : function () { 174 | var images = this.S('img[' + this.data_attr + ']'), 175 | count = images.length, 176 | i = count, 177 | loaded_count = 0, 178 | data_attr = this.data_attr; 179 | 180 | this.cache = {}; 181 | this.cached_images = []; 182 | this.images_loaded = (count === 0); 183 | 184 | while (i--) { 185 | loaded_count++; 186 | if (images[i]) { 187 | var str = images[i].getAttribute(data_attr) || ''; 188 | 189 | if (str.length > 0) { 190 | this.cached_images.push(images[i]); 191 | } 192 | } 193 | 194 | if (loaded_count === count) { 195 | this.images_loaded = true; 196 | this.enhance('images'); 197 | } 198 | } 199 | 200 | return this; 201 | }, 202 | 203 | update_nodes : function () { 204 | var nodes = this.S('[' + this.data_attr + ']').not('img'), 205 | count = nodes.length, 206 | i = count, 207 | loaded_count = 0, 208 | data_attr = this.data_attr; 209 | 210 | this.cached_nodes = []; 211 | this.nodes_loaded = (count === 0); 212 | 213 | 214 | while (i--) { 215 | loaded_count++; 216 | var str = nodes[i].getAttribute(data_attr) || ''; 217 | 218 | if (str.length > 0) { 219 | this.cached_nodes.push(nodes[i]); 220 | } 221 | 222 | if(loaded_count === count) { 223 | this.nodes_loaded = true; 224 | this.enhance('nodes'); 225 | } 226 | } 227 | 228 | return this; 229 | }, 230 | 231 | enhance : function (type) { 232 | var i = this['cached_' + type].length; 233 | 234 | while (i--) { 235 | this.object($(this['cached_' + type][i])); 236 | } 237 | 238 | return $(window).trigger('resize'); 239 | }, 240 | 241 | parse_params : function (path, directive, mq) { 242 | return [this.trim(path), this.convert_directive(directive), this.trim(mq)]; 243 | }, 244 | 245 | convert_directive : function (directive) { 246 | 247 | var trimmed = this.trim(directive); 248 | 249 | if (trimmed.length > 0) { 250 | return trimmed; 251 | } 252 | 253 | return 'replace'; 254 | }, 255 | 256 | object : function(el) { 257 | var raw_arr = this.parse_data_attr(el), 258 | scenarios = [], 259 | i = raw_arr.length; 260 | 261 | if (i > 0) { 262 | while (i--) { 263 | var split = raw_arr[i].split(/\((.*?)(\))$/); 264 | 265 | if (split.length > 1) { 266 | var cached_split = split[0].split(','), 267 | params = this.parse_params(cached_split[0], 268 | cached_split[1], split[1]); 269 | 270 | scenarios.push(params); 271 | } 272 | } 273 | } 274 | 275 | return this.store(el, scenarios); 276 | }, 277 | 278 | store : function (el, scenarios) { 279 | var uuid = this.random_str(), 280 | current_uuid = el.data(this.add_namespace('uuid', true)); 281 | 282 | if (this.cache[current_uuid]) return this.cache[current_uuid]; 283 | 284 | el.attr(this.add_namespace('data-uuid'), uuid); 285 | 286 | return this.cache[uuid] = scenarios; 287 | }, 288 | 289 | trim : function(str) { 290 | 291 | if (typeof str === 'string') { 292 | return $.trim(str); 293 | } 294 | 295 | return str; 296 | }, 297 | 298 | set_data_attr: function (init) { 299 | if (init) { 300 | if (this.namespace.length > 0) { 301 | return this.namespace + '-' + this.settings.load_attr; 302 | } 303 | 304 | return this.settings.load_attr; 305 | } 306 | 307 | if (this.namespace.length > 0) { 308 | return 'data-' + this.namespace + '-' + this.settings.load_attr; 309 | } 310 | 311 | return 'data-' + this.settings.load_attr; 312 | }, 313 | 314 | parse_data_attr : function (el) { 315 | var raw = el.attr(this.attr_name()).split(/\[(.*?)\]/), 316 | i = raw.length, 317 | output = []; 318 | 319 | while (i--) { 320 | if (raw[i].replace(/[\W\d]+/, '').length > 4) { 321 | output.push(raw[i]); 322 | } 323 | } 324 | 325 | return output; 326 | }, 327 | 328 | reflow : function () { 329 | this.load('images', true); 330 | this.load('nodes', true); 331 | } 332 | 333 | }; 334 | 335 | }(jQuery, this, this.document)); 336 | -------------------------------------------------------------------------------- /static/content_submit/js/foundation/foundation.tooltip.js: -------------------------------------------------------------------------------- 1 | ;(function ($, window, document, undefined) { 2 | 'use strict'; 3 | 4 | Foundation.libs.tooltip = { 5 | name : 'tooltip', 6 | 7 | version : '5.2.1', 8 | 9 | settings : { 10 | additional_inheritable_classes : [], 11 | tooltip_class : '.tooltip', 12 | append_to: 'body', 13 | touch_close_text: 'Tap To Close', 14 | disable_for_touch: false, 15 | hover_delay: 200, 16 | tip_template : function (selector, content) { 17 | return '' + content + ''; 20 | } 21 | }, 22 | 23 | cache : {}, 24 | 25 | init : function (scope, method, options) { 26 | Foundation.inherit(this, 'random_str'); 27 | this.bindings(method, options); 28 | }, 29 | 30 | events : function (instance) { 31 | var self = this, 32 | S = self.S; 33 | 34 | self.create(this.S(instance)); 35 | 36 | $(this.scope) 37 | .off('.tooltip') 38 | .on('mouseenter.fndtn.tooltip mouseleave.fndtn.tooltip touchstart.fndtn.tooltip MSPointerDown.fndtn.tooltip', 39 | '[' + this.attr_name() + ']:not(a)', function (e) { 40 | var $this = S(this), 41 | settings = $.extend({}, self.settings, self.data_options($this)), 42 | is_touch = false; 43 | 44 | if (/mouse/i.test(e.type) && self.ie_touch(e)) return false; 45 | 46 | if ($this.hasClass('open')) { 47 | if (Modernizr.touch && /touchstart|MSPointerDown/i.test(e.type)) e.preventDefault(); 48 | self.hide($this); 49 | } else { 50 | if (settings.disable_for_touch && Modernizr.touch && /touchstart|MSPointerDown/i.test(e.type)) { 51 | return; 52 | } else if(!settings.disable_for_touch && Modernizr.touch && /touchstart|MSPointerDown/i.test(e.type)) { 53 | e.preventDefault(); 54 | S(settings.tooltip_class + '.open').hide(); 55 | is_touch = true; 56 | } 57 | 58 | if (/enter|over/i.test(e.type)) { 59 | this.timer = setTimeout(function () { 60 | var tip = self.showTip($this); 61 | }.bind(this), self.settings.hover_delay); 62 | } else if (e.type === 'mouseout' || e.type === 'mouseleave') { 63 | clearTimeout(this.timer); 64 | self.hide($this); 65 | } else { 66 | self.showTip($this); 67 | } 68 | } 69 | }) 70 | .on('mouseleave.fndtn.tooltip touchstart.fndtn.tooltip MSPointerDown.fndtn.tooltip', '[' + this.attr_name() + '].open', function (e) { 71 | if (/mouse/i.test(e.type) && self.ie_touch(e)) return false; 72 | 73 | if($(this).data('tooltip-open-event-type') == 'touch' && e.type == 'mouseleave') { 74 | return; 75 | } 76 | else if($(this).data('tooltip-open-event-type') == 'mouse' && /MSPointerDown|touchstart/i.test(e.type)) { 77 | self.convert_to_touch($(this)); 78 | } else { 79 | self.hide($(this)); 80 | } 81 | }) 82 | .on('DOMNodeRemoved DOMAttrModified', '[' + this.attr_name() + ']:not(a)', function (e) { 83 | self.hide(S(this)); 84 | }); 85 | }, 86 | 87 | ie_touch : function (e) { 88 | // How do I distinguish between IE11 and Windows Phone 8????? 89 | return false; 90 | }, 91 | 92 | showTip : function ($target) { 93 | var $tip = this.getTip($target); 94 | 95 | return this.show($target); 96 | }, 97 | 98 | getTip : function ($target) { 99 | var selector = this.selector($target), 100 | settings = $.extend({}, this.settings, this.data_options($target)), 101 | tip = null; 102 | 103 | if (selector) { 104 | tip = this.S('span[data-selector="' + selector + '"]' + settings.tooltip_class); 105 | } 106 | 107 | return (typeof tip === 'object') ? tip : false; 108 | }, 109 | 110 | selector : function ($target) { 111 | var id = $target.attr('id'), 112 | dataSelector = $target.attr(this.attr_name()) || $target.attr('data-selector'); 113 | 114 | if ((id && id.length < 1 || !id) && typeof dataSelector != 'string') { 115 | dataSelector = this.random_str(6); 116 | $target.attr('data-selector', dataSelector); 117 | } 118 | 119 | return (id && id.length > 0) ? id : dataSelector; 120 | }, 121 | 122 | create : function ($target) { 123 | var self = this, 124 | settings = $.extend({}, this.settings, this.data_options($target)), 125 | tip_template = this.settings.tip_template; 126 | 127 | if (typeof settings.tip_template === 'string' && window.hasOwnProperty(settings.tip_template)) { 128 | tip_template = window[settings.tip_template]; 129 | } 130 | 131 | var $tip = $(tip_template(this.selector($target), $('
').html($target.attr('title')).html())), 132 | classes = this.inheritable_classes($target); 133 | 134 | $tip.addClass(classes).appendTo(settings.append_to); 135 | 136 | if (Modernizr.touch) { 137 | $tip.append(''+settings.touch_close_text+''); 138 | $tip.on('touchstart.fndtn.tooltip MSPointerDown.fndtn.tooltip', function(e) { 139 | self.hide($target); 140 | }); 141 | } 142 | 143 | $target.removeAttr('title').attr('title',''); 144 | }, 145 | 146 | reposition : function (target, tip, classes) { 147 | var width, nub, nubHeight, nubWidth, column, objPos; 148 | 149 | tip.css('visibility', 'hidden').show(); 150 | 151 | width = target.data('width'); 152 | nub = tip.children('.nub'); 153 | nubHeight = nub.outerHeight(); 154 | nubWidth = nub.outerHeight(); 155 | 156 | if (this.small()) { 157 | tip.css({'width' : '100%' }); 158 | } else { 159 | tip.css({'width' : (width) ? width : 'auto'}); 160 | } 161 | 162 | objPos = function (obj, top, right, bottom, left, width) { 163 | return obj.css({ 164 | 'top' : (top) ? top : 'auto', 165 | 'bottom' : (bottom) ? bottom : 'auto', 166 | 'left' : (left) ? left : 'auto', 167 | 'right' : (right) ? right : 'auto', 168 | }).end(); 169 | }; 170 | 171 | objPos(tip, (target.offset().top + target.outerHeight() + 10), 'auto', 'auto', target.offset().left); 172 | 173 | if (this.small()) { 174 | objPos(tip, (target.offset().top + target.outerHeight() + 10), 'auto', 'auto', 12.5, $(this.scope).width()); 175 | tip.addClass('tip-override'); 176 | objPos(nub, -nubHeight, 'auto', 'auto', target.offset().left); 177 | } else { 178 | var left = target.offset().left; 179 | if (Foundation.rtl) { 180 | nub.addClass('rtl'); 181 | left = target.offset().left + target.outerWidth() - tip.outerWidth(); 182 | } 183 | objPos(tip, (target.offset().top + target.outerHeight() + 10), 'auto', 'auto', left); 184 | tip.removeClass('tip-override'); 185 | if (classes && classes.indexOf('tip-top') > -1) { 186 | if (Foundation.rtl) nub.addClass('rtl'); 187 | objPos(tip, (target.offset().top - tip.outerHeight()), 'auto', 'auto', left) 188 | .removeClass('tip-override'); 189 | } else if (classes && classes.indexOf('tip-left') > -1) { 190 | objPos(tip, (target.offset().top + (target.outerHeight() / 2) - (tip.outerHeight() / 2)), 'auto', 'auto', (target.offset().left - tip.outerWidth() - nubHeight)) 191 | .removeClass('tip-override'); 192 | nub.removeClass('rtl'); 193 | } else if (classes && classes.indexOf('tip-right') > -1) { 194 | objPos(tip, (target.offset().top + (target.outerHeight() / 2) - (tip.outerHeight() / 2)), 'auto', 'auto', (target.offset().left + target.outerWidth() + nubHeight)) 195 | .removeClass('tip-override'); 196 | nub.removeClass('rtl'); 197 | } 198 | } 199 | 200 | tip.css('visibility', 'visible').hide(); 201 | }, 202 | 203 | small : function () { 204 | return matchMedia(Foundation.media_queries.small).matches; 205 | }, 206 | 207 | inheritable_classes : function ($target) { 208 | var settings = $.extend({}, this.settings, this.data_options($target)), 209 | inheritables = ['tip-top', 'tip-left', 'tip-bottom', 'tip-right', 'radius', 'round'].concat(settings.additional_inheritable_classes), 210 | classes = $target.attr('class'), 211 | filtered = classes ? $.map(classes.split(' '), function (el, i) { 212 | if ($.inArray(el, inheritables) !== -1) { 213 | return el; 214 | } 215 | }).join(' ') : ''; 216 | 217 | return $.trim(filtered); 218 | }, 219 | 220 | convert_to_touch : function($target) { 221 | var self = this, 222 | $tip = self.getTip($target), 223 | settings = $.extend({}, self.settings, self.data_options($target)); 224 | 225 | if ($tip.find('.tap-to-close').length === 0) { 226 | $tip.append(''+settings.touch_close_text+''); 227 | $tip.on('click.fndtn.tooltip.tapclose touchstart.fndtn.tooltip.tapclose MSPointerDown.fndtn.tooltip.tapclose', function(e) { 228 | self.hide($target); 229 | }); 230 | } 231 | 232 | $target.data('tooltip-open-event-type', 'touch'); 233 | }, 234 | 235 | show : function ($target) { 236 | var $tip = this.getTip($target); 237 | 238 | if ($target.data('tooltip-open-event-type') == 'touch') { 239 | this.convert_to_touch($target); 240 | } 241 | 242 | this.reposition($target, $tip, $target.attr('class')); 243 | $target.addClass('open'); 244 | $tip.fadeIn(150); 245 | }, 246 | 247 | hide : function ($target) { 248 | var $tip = this.getTip($target); 249 | 250 | $tip.fadeOut(150, function() { 251 | $tip.find('.tap-to-close').remove(); 252 | $tip.off('click.fndtn.tooltip.tapclose touchstart.fndtn.tooltip.tapclose MSPointerDown.fndtn.tapclose'); 253 | $target.removeClass('open'); 254 | }); 255 | }, 256 | 257 | off : function () { 258 | var self = this; 259 | this.S(this.scope).off('.fndtn.tooltip'); 260 | this.S(this.settings.tooltip_class).each(function (i) { 261 | $('[' + self.attr_name() + ']').get(i).attr('title', $(this).text()); 262 | }).remove(); 263 | }, 264 | 265 | reflow : function () {} 266 | }; 267 | }(jQuery, this, this.document)); 268 | -------------------------------------------------------------------------------- /static/content_submit/js/vendor/modernizr.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Modernizr v2.7.2 3 | * www.modernizr.com 4 | * 5 | * Copyright (c) Faruk Ates, Paul Irish, Alex Sexton 6 | * Available under the BSD and MIT licenses: www.modernizr.com/license/ 7 | */ 8 | window.Modernizr=function(a,b,c){function d(a){t.cssText=a}function e(a,b){return d(x.join(a+";")+(b||""))}function f(a,b){return typeof a===b}function g(a,b){return!!~(""+a).indexOf(b)}function h(a,b){for(var d in a){var e=a[d];if(!g(e,"-")&&t[e]!==c)return"pfx"==b?e:!0}return!1}function i(a,b,d){for(var e in a){var g=b[a[e]];if(g!==c)return d===!1?a[e]:f(g,"function")?g.bind(d||b):g}return!1}function j(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+z.join(d+" ")+d).split(" ");return f(b,"string")||f(b,"undefined")?h(e,b):(e=(a+" "+A.join(d+" ")+d).split(" "),i(e,b,c))}function k(){o.input=function(c){for(var d=0,e=c.length;e>d;d++)E[c[d]]=!!(c[d]in u);return E.list&&(E.list=!(!b.createElement("datalist")||!a.HTMLDataListElement)),E}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),o.inputtypes=function(a){for(var d,e,f,g=0,h=a.length;h>g;g++)u.setAttribute("type",e=a[g]),d="text"!==u.type,d&&(u.value=v,u.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(e)&&u.style.WebkitAppearance!==c?(q.appendChild(u),f=b.defaultView,d=f.getComputedStyle&&"textfield"!==f.getComputedStyle(u,null).WebkitAppearance&&0!==u.offsetHeight,q.removeChild(u)):/^(search|tel)$/.test(e)||(d=/^(url|email)$/.test(e)?u.checkValidity&&u.checkValidity()===!1:u.value!=v)),D[a[g]]=!!d;return D}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var l,m,n="2.7.2",o={},p=!0,q=b.documentElement,r="modernizr",s=b.createElement(r),t=s.style,u=b.createElement("input"),v=":)",w={}.toString,x=" -webkit- -moz- -o- -ms- ".split(" "),y="Webkit Moz O ms",z=y.split(" "),A=y.toLowerCase().split(" "),B={svg:"http://www.w3.org/2000/svg"},C={},D={},E={},F=[],G=F.slice,H=function(a,c,d,e){var f,g,h,i,j=b.createElement("div"),k=b.body,l=k||b.createElement("body");if(parseInt(d,10))for(;d--;)h=b.createElement("div"),h.id=e?e[d]:r+(d+1),j.appendChild(h);return f=["­",'"].join(""),j.id=r,(k?j:l).innerHTML+=f,l.appendChild(j),k||(l.style.background="",l.style.overflow="hidden",i=q.style.overflow,q.style.overflow="hidden",q.appendChild(l)),g=c(j,a),k?j.parentNode.removeChild(j):(l.parentNode.removeChild(l),q.style.overflow=i),!!g},I=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return H("@media "+b+" { #"+r+" { position: absolute; } }",function(b){d="absolute"==(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle).position}),d},J=function(){function a(a,e){e=e||b.createElement(d[a]||"div"),a="on"+a;var g=a in e;return g||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(a,""),g=f(e[a],"function"),f(e[a],"undefined")||(e[a]=c),e.removeAttribute(a))),e=null,g}var d={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return a}(),K={}.hasOwnProperty;m=f(K,"undefined")||f(K.call,"undefined")?function(a,b){return b in a&&f(a.constructor.prototype[b],"undefined")}:function(a,b){return K.call(a,b)},Function.prototype.bind||(Function.prototype.bind=function(a){var b=this;if("function"!=typeof b)throw new TypeError;var c=G.call(arguments,1),d=function(){if(this instanceof d){var e=function(){};e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(G.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(G.call(arguments)))};return d}),C.flexbox=function(){return j("flexWrap")},C.flexboxlegacy=function(){return j("boxDirection")},C.canvas=function(){var a=b.createElement("canvas");return!(!a.getContext||!a.getContext("2d"))},C.canvastext=function(){return!(!o.canvas||!f(b.createElement("canvas").getContext("2d").fillText,"function"))},C.webgl=function(){return!!a.WebGLRenderingContext},C.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:H(["@media (",x.join("touch-enabled),("),r,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=9===a.offsetTop}),c},C.geolocation=function(){return"geolocation"in navigator},C.postmessage=function(){return!!a.postMessage},C.websqldatabase=function(){return!!a.openDatabase},C.indexedDB=function(){return!!j("indexedDB",a)},C.hashchange=function(){return J("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},C.history=function(){return!(!a.history||!history.pushState)},C.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},C.websockets=function(){return"WebSocket"in a||"MozWebSocket"in a},C.rgba=function(){return d("background-color:rgba(150,255,150,.5)"),g(t.backgroundColor,"rgba")},C.hsla=function(){return d("background-color:hsla(120,40%,100%,.5)"),g(t.backgroundColor,"rgba")||g(t.backgroundColor,"hsla")},C.multiplebgs=function(){return d("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(t.background)},C.backgroundsize=function(){return j("backgroundSize")},C.borderimage=function(){return j("borderImage")},C.borderradius=function(){return j("borderRadius")},C.boxshadow=function(){return j("boxShadow")},C.textshadow=function(){return""===b.createElement("div").style.textShadow},C.opacity=function(){return e("opacity:.55"),/^0.55$/.test(t.opacity)},C.cssanimations=function(){return j("animationName")},C.csscolumns=function(){return j("columnCount")},C.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return d((a+"-webkit- ".split(" ").join(b+a)+x.join(c+a)).slice(0,-a.length)),g(t.backgroundImage,"gradient")},C.cssreflections=function(){return j("boxReflect")},C.csstransforms=function(){return!!j("transform")},C.csstransforms3d=function(){var a=!!j("perspective");return a&&"webkitPerspective"in q.style&&H("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b){a=9===b.offsetLeft&&3===b.offsetHeight}),a},C.csstransitions=function(){return j("transition")},C.fontface=function(){var a;return H('@font-face {font-family:"font";src:url("https://")}',function(c,d){var e=b.getElementById("smodernizr"),f=e.sheet||e.styleSheet,g=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"";a=/src/i.test(g)&&0===g.indexOf(d.split(" ")[0])}),a},C.generatedcontent=function(){var a;return H(["#",r,"{font:0/0 a}#",r,':after{content:"',v,'";visibility:hidden;font:3px/1 a}'].join(""),function(b){a=b.offsetHeight>=3}),a},C.video=function(){var a=b.createElement("video"),c=!1;try{(c=!!a.canPlayType)&&(c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,""))}catch(d){}return c},C.audio=function(){var a=b.createElement("audio"),c=!1;try{(c=!!a.canPlayType)&&(c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,""))}catch(d){}return c},C.localstorage=function(){try{return localStorage.setItem(r,r),localStorage.removeItem(r),!0}catch(a){return!1}},C.sessionstorage=function(){try{return sessionStorage.setItem(r,r),sessionStorage.removeItem(r),!0}catch(a){return!1}},C.webworkers=function(){return!!a.Worker},C.applicationcache=function(){return!!a.applicationCache},C.svg=function(){return!!b.createElementNS&&!!b.createElementNS(B.svg,"svg").createSVGRect},C.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="",(a.firstChild&&a.firstChild.namespaceURI)==B.svg},C.smil=function(){return!!b.createElementNS&&/SVGAnimate/.test(w.call(b.createElementNS(B.svg,"animate")))},C.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(w.call(b.createElementNS(B.svg,"clipPath")))};for(var L in C)m(C,L)&&(l=L.toLowerCase(),o[l]=C[L](),F.push((o[l]?"":"no-")+l));return o.input||k(),o.addTest=function(a,b){if("object"==typeof a)for(var d in a)m(a,d)&&o.addTest(d,a[d]);else{if(a=a.toLowerCase(),o[a]!==c)return o;b="function"==typeof b?b():b,"undefined"!=typeof p&&p&&(q.className+=" "+(b?"":"no-")+a),o[a]=b}return o},d(""),s=u=null,function(a,b){function c(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 d(){var a=s.elements;return"string"==typeof a?a.split(" "):a}function e(a){var b=r[a[p]];return b||(b={},q++,a[p]=q,r[q]=b),b}function f(a,c,d){if(c||(c=b),k)return c.createElement(a);d||(d=e(c));var f;return f=d.cache[a]?d.cache[a].cloneNode():o.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!f.canHaveChildren||n.test(a)||f.tagUrn?f:d.frag.appendChild(f)}function g(a,c){if(a||(a=b),k)return a.createDocumentFragment();c=c||e(a);for(var f=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)f.createElement(h[g]);return f}function h(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return s.shivMethods?f(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(s,b.frag)}function i(a){a||(a=b);var d=e(a);return!s.shivCSS||j||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),k||h(a,d),a}var j,k,l="3.7.0",m=a.html5||{},n=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,o=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,p="_html5shiv",q=0,r={};!function(){try{var a=b.createElement("a");a.innerHTML="",j="hidden"in a,k=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){j=!0,k=!0}}();var s={elements:m.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:l,shivCSS:m.shivCSS!==!1,supportsUnknownElements:k,shivMethods:m.shivMethods!==!1,type:"default",shivDocument:i,createElement:f,createDocumentFragment:g};a.html5=s,i(b)}(this,b),o._version=n,o._prefixes=x,o._domPrefixes=A,o._cssomPrefixes=z,o.mq=I,o.hasEvent=J,o.testProp=function(a){return h([a])},o.testAllProps=j,o.testStyles=H,o.prefixed=function(a,b,c){return b?j(a,b,c):j(a,"pfx")},q.className=q.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(p?" js "+F.join(" "):""),o}(this,this.document); 9 | -------------------------------------------------------------------------------- /static/content_submit/js/foundation/foundation.dropdown.js: -------------------------------------------------------------------------------- 1 | ;(function ($, window, document, undefined) { 2 | 'use strict'; 3 | 4 | Foundation.libs.dropdown = { 5 | name : 'dropdown', 6 | 7 | version : '5.2.1', 8 | 9 | settings : { 10 | active_class: 'open', 11 | align: 'bottom', 12 | is_hover: false, 13 | opened: function(){}, 14 | closed: function(){} 15 | }, 16 | 17 | init : function (scope, method, options) { 18 | Foundation.inherit(this, 'throttle'); 19 | 20 | this.bindings(method, options); 21 | }, 22 | 23 | events : function (scope) { 24 | var self = this, 25 | S = self.S; 26 | 27 | S(this.scope) 28 | .off('.dropdown') 29 | .on('click.fndtn.dropdown', '[' + this.attr_name() + ']', function (e) { 30 | var settings = S(this).data(self.attr_name(true) + '-init') || self.settings; 31 | e.preventDefault(); 32 | if (!settings.is_hover || Modernizr.touch) self.toggle(S(this)); 33 | }) 34 | .on('mouseenter.fndtn.dropdown', '[' + this.attr_name() + '], [' + this.attr_name() + '-content]', function (e) { 35 | var $this = S(this); 36 | clearTimeout(self.timeout); 37 | 38 | if ($this.data(self.data_attr())) { 39 | var dropdown = S('#' + $this.data(self.data_attr())), 40 | target = $this; 41 | } else { 42 | var dropdown = $this; 43 | target = S("[" + self.attr_name() + "='" + dropdown.attr('id') + "']"); 44 | } 45 | 46 | var settings = target.data(self.attr_name(true) + '-init') || self.settings; 47 | 48 | if(S(e.target).data(self.data_attr()) && settings.is_hover) { 49 | self.closeall.call(self); 50 | } 51 | 52 | if (settings.is_hover) self.open.apply(self, [dropdown, target]); 53 | }) 54 | .on('mouseleave.fndtn.dropdown', '[' + this.attr_name() + '], [' + this.attr_name() + '-content]', function (e) { 55 | var $this = S(this); 56 | self.timeout = setTimeout(function () { 57 | if ($this.data(self.data_attr())) { 58 | var settings = $this.data(self.data_attr(true) + '-init') || self.settings; 59 | if (settings.is_hover) self.close.call(self, S('#' + $this.data(self.data_attr()))); 60 | } else { 61 | var target = S('[' + self.attr_name() + '="' + S(this).attr('id') + '"]'), 62 | settings = target.data(self.attr_name(true) + '-init') || self.settings; 63 | if (settings.is_hover) self.close.call(self, $this); 64 | } 65 | }.bind(this), 150); 66 | }) 67 | .on('click.fndtn.dropdown', function (e) { 68 | var parent = S(e.target).closest('[' + self.attr_name() + '-content]'); 69 | 70 | if (S(e.target).data(self.data_attr()) || S(e.target).parent().data(self.data_attr())) { 71 | return; 72 | } 73 | if (!(S(e.target).data('revealId')) && 74 | (parent.length > 0 && (S(e.target).is('[' + self.attr_name() + '-content]') || 75 | $.contains(parent.first()[0], e.target)))) { 76 | e.stopPropagation(); 77 | return; 78 | } 79 | 80 | self.close.call(self, S('[' + self.attr_name() + '-content]')); 81 | }) 82 | .on('opened.fndtn.dropdown', '[' + self.attr_name() + '-content]', function () { 83 | self.settings.opened.call(this); 84 | }) 85 | .on('closed.fndtn.dropdown', '[' + self.attr_name() + '-content]', function () { 86 | self.settings.closed.call(this); 87 | }); 88 | 89 | S(window) 90 | .off('.dropdown') 91 | .on('resize.fndtn.dropdown', self.throttle(function () { 92 | self.resize.call(self); 93 | }, 50)); 94 | 95 | this.resize(); 96 | }, 97 | 98 | close: function (dropdown) { 99 | var self = this; 100 | dropdown.each(function () { 101 | if (self.S(this).hasClass(self.settings.active_class)) { 102 | self.S(this) 103 | .css(Foundation.rtl ? 'right':'left', '-99999px') 104 | .removeClass(self.settings.active_class); 105 | 106 | self.S(this).trigger('closed', [dropdown]); 107 | } 108 | }); 109 | }, 110 | 111 | closeall: function() { 112 | var self = this; 113 | $.each(self.S('[' + this.attr_name() + '-content]'), function() { 114 | self.close.call(self, self.S(this)) 115 | }); 116 | }, 117 | 118 | open: function (dropdown, target) { 119 | this 120 | .css(dropdown 121 | .addClass(this.settings.active_class), target); 122 | dropdown.trigger('opened', [dropdown, target]); 123 | }, 124 | 125 | data_attr: function () { 126 | if (this.namespace.length > 0) { 127 | return this.namespace + '-' + this.name; 128 | } 129 | 130 | return this.name; 131 | }, 132 | 133 | toggle : function (target) { 134 | var dropdown = this.S('#' + target.data(this.data_attr())); 135 | if (dropdown.length === 0) { 136 | // No dropdown found, not continuing 137 | return; 138 | } 139 | 140 | this.close.call(this, this.S('[' + this.attr_name() + '-content]').not(dropdown)); 141 | 142 | if (dropdown.hasClass(this.settings.active_class)) { 143 | this.close.call(this, dropdown); 144 | } else { 145 | this.close.call(this, this.S('[' + this.attr_name() + '-content]')) 146 | this.open.call(this, dropdown, target); 147 | } 148 | }, 149 | 150 | resize : function () { 151 | var dropdown = this.S('[' + this.attr_name() + '-content].open'), 152 | target = this.S("[" + this.attr_name() + "='" + dropdown.attr('id') + "']"); 153 | 154 | if (dropdown.length && target.length) { 155 | this.css(dropdown, target); 156 | } 157 | }, 158 | 159 | css : function (dropdown, target) { 160 | this.clear_idx(); 161 | 162 | if (this.small()) { 163 | var p = this.dirs.bottom.call(dropdown, target); 164 | 165 | dropdown.attr('style', '').removeClass('drop-left drop-right drop-top').css({ 166 | position : 'absolute', 167 | width: '95%', 168 | 'max-width': 'none', 169 | top: p.top 170 | }); 171 | 172 | dropdown.css(Foundation.rtl ? 'right':'left', '2.5%'); 173 | } else { 174 | var settings = target.data(this.attr_name(true) + '-init') || this.settings; 175 | 176 | this.style(dropdown, target, settings); 177 | } 178 | 179 | return dropdown; 180 | }, 181 | 182 | style : function (dropdown, target, settings) { 183 | var css = $.extend({position: 'absolute'}, 184 | this.dirs[settings.align].call(dropdown, target, settings)); 185 | 186 | dropdown.attr('style', '').css(css); 187 | }, 188 | 189 | // return CSS property object 190 | // `this` is the dropdown 191 | dirs : { 192 | // Calculate target offset 193 | _base : function (t) { 194 | var o_p = this.offsetParent(), 195 | o = o_p.offset(), 196 | p = t.offset(); 197 | 198 | p.top -= o.top; 199 | p.left -= o.left; 200 | 201 | return p; 202 | }, 203 | top: function (t, s) { 204 | var self = Foundation.libs.dropdown, 205 | p = self.dirs._base.call(this, t), 206 | pip_offset_base = (t.outerWidth() / 2) - 8; 207 | 208 | this.addClass('drop-top'); 209 | 210 | if (t.outerWidth() < this.outerWidth() || self.small()) { 211 | self.adjust_pip(pip_offset_base, p); 212 | } 213 | 214 | if (Foundation.rtl) { 215 | return {left: p.left - this.outerWidth() + t.outerWidth(), 216 | top: p.top - this.outerHeight()}; 217 | } 218 | 219 | return {left: p.left, top: p.top - this.outerHeight()}; 220 | }, 221 | bottom: function (t, s) { 222 | var self = Foundation.libs.dropdown, 223 | p = self.dirs._base.call(this, t), 224 | pip_offset_base = (t.outerWidth() / 2) - 8; 225 | 226 | if (t.outerWidth() < this.outerWidth() || self.small()) { 227 | self.adjust_pip(pip_offset_base, p); 228 | } 229 | 230 | if (self.rtl) { 231 | return {left: p.left - this.outerWidth() + t.outerWidth(), top: p.top + t.outerHeight()}; 232 | } 233 | 234 | return {left: p.left, top: p.top + t.outerHeight()}; 235 | }, 236 | left: function (t, s) { 237 | var p = Foundation.libs.dropdown.dirs._base.call(this, t); 238 | 239 | this.addClass('drop-left'); 240 | 241 | return {left: p.left - this.outerWidth(), top: p.top}; 242 | }, 243 | right: function (t, s) { 244 | var p = Foundation.libs.dropdown.dirs._base.call(this, t); 245 | 246 | this.addClass('drop-right'); 247 | 248 | return {left: p.left + t.outerWidth(), top: p.top}; 249 | } 250 | }, 251 | 252 | // Insert rule to style psuedo elements 253 | adjust_pip : function (pip_offset_base, p) { 254 | var sheet = Foundation.stylesheet; 255 | 256 | if (this.small()) { 257 | pip_offset_base += p.left - 8; 258 | } 259 | 260 | this.rule_idx = sheet.cssRules.length; 261 | 262 | var sel_before = '.f-dropdown.open:before', 263 | sel_after = '.f-dropdown.open:after', 264 | css_before = 'left: ' + pip_offset_base + 'px;', 265 | css_after = 'left: ' + (pip_offset_base - 1) + 'px;'; 266 | 267 | if (sheet.insertRule) { 268 | sheet.insertRule([sel_before, '{', css_before, '}'].join(' '), this.rule_idx); 269 | sheet.insertRule([sel_after, '{', css_after, '}'].join(' '), this.rule_idx + 1); 270 | } else { 271 | sheet.addRule(sel_before, css_before, this.rule_idx); 272 | sheet.addRule(sel_after, css_after, this.rule_idx + 1); 273 | } 274 | }, 275 | 276 | // Remove old dropdown rule index 277 | clear_idx : function () { 278 | var sheet = Foundation.stylesheet; 279 | 280 | if (this.rule_idx) { 281 | sheet.deleteRule(this.rule_idx); 282 | sheet.deleteRule(this.rule_idx); 283 | delete this.rule_idx; 284 | } 285 | }, 286 | 287 | small : function () { 288 | return matchMedia(Foundation.media_queries.small).matches && 289 | !matchMedia(Foundation.media_queries.medium).matches; 290 | }, 291 | 292 | off: function () { 293 | this.S(this.scope).off('.fndtn.dropdown'); 294 | this.S('html, body').off('.fndtn.dropdown'); 295 | this.S(window).off('.fndtn.dropdown'); 296 | this.S('[data-dropdown-content]').off('.fndtn.dropdown'); 297 | }, 298 | 299 | reflow : function () {} 300 | }; 301 | }(jQuery, this, this.document)); 302 | -------------------------------------------------------------------------------- /static/content_submit/js/foundation/foundation.abide.js: -------------------------------------------------------------------------------- 1 | ;(function ($, window, document, undefined) { 2 | 'use strict'; 3 | 4 | Foundation.libs.abide = { 5 | name : 'abide', 6 | 7 | version : '5.2.1', 8 | 9 | settings : { 10 | live_validate : true, 11 | focus_on_invalid : true, 12 | error_labels: true, // labels with a for="inputId" will recieve an `error` class 13 | timeout : 1000, 14 | patterns : { 15 | alpha: /^[a-zA-Z]+$/, 16 | alpha_numeric : /^[a-zA-Z0-9]+$/, 17 | integer: /^\d+$/, 18 | number: /-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?/, 19 | 20 | // amex, visa, diners 21 | 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})$/, 22 | cvv : /^([0-9]){3,4}$/, 23 | 24 | // http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address 25 | 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])?)*$/, 26 | 27 | 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})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?/, 28 | // abc.de 29 | domain: /^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}$/, 30 | 31 | 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))/, 32 | // YYYY-MM-DD 33 | 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))/, 34 | // HH:MM:SS 35 | time : /(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]){2}/, 36 | dateISO: /\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/, 37 | // MM/DD/YYYY 38 | month_day_year : /(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.](19|20)\d\d/, 39 | 40 | // #FFF or #FFFFFF 41 | color: /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/ 42 | }, 43 | validators : { 44 | equalTo: function(el, required, parent) { 45 | var from = document.getElementById(el.getAttribute(this.add_namespace('data-equalto'))).value, 46 | to = el.value, 47 | valid = (from === to); 48 | 49 | return valid; 50 | } 51 | } 52 | }, 53 | 54 | timer : null, 55 | 56 | init : function (scope, method, options) { 57 | this.bindings(method, options); 58 | }, 59 | 60 | events : function (scope) { 61 | var self = this, 62 | form = self.S(scope).attr('novalidate', 'novalidate'), 63 | settings = form.data(this.attr_name(true) + '-init'); 64 | 65 | this.invalid_attr = this.add_namespace('data-invalid'); 66 | 67 | form 68 | .off('.abide') 69 | .on('submit.fndtn.abide validate.fndtn.abide', function (e) { 70 | var is_ajax = /ajax/i.test(self.S(this).attr(self.attr_name())); 71 | return self.validate(self.S(this).find('input, textarea, select').get(), e, is_ajax); 72 | }) 73 | .on('reset', function() { 74 | return self.reset($(this)); 75 | }) 76 | .find('input, textarea, select') 77 | .off('.abide') 78 | .on('blur.fndtn.abide change.fndtn.abide', function (e) { 79 | self.validate([this], e); 80 | }) 81 | .on('keydown.fndtn.abide', function (e) { 82 | var settings = $(this).closest('form').data(self.attr_name(true) + '-init'); 83 | if (settings.live_validate === true) { 84 | clearTimeout(self.timer); 85 | self.timer = setTimeout(function () { 86 | self.validate([this], e); 87 | }.bind(this), settings.timeout); 88 | } 89 | }); 90 | }, 91 | 92 | reset : function (form) { 93 | form.removeAttr(this.invalid_attr); 94 | $(this.invalid_attr, form).removeAttr(this.invalid_attr); 95 | $('.error', form).not('small').removeClass('error'); 96 | }, 97 | 98 | validate : function (els, e, is_ajax) { 99 | var validations = this.parse_patterns(els), 100 | validation_count = validations.length, 101 | form = this.S(els[0]).closest('form'), 102 | submit_event = /submit/.test(e.type); 103 | 104 | // Has to count up to make sure the focus gets applied to the top error 105 | for (var i=0; i < validation_count; i++) { 106 | if (!validations[i] && (submit_event || is_ajax)) { 107 | if (this.settings.focus_on_invalid) els[i].focus(); 108 | form.trigger('invalid'); 109 | this.S(els[i]).closest('form').attr(this.invalid_attr, ''); 110 | return false; 111 | } 112 | } 113 | 114 | if (submit_event || is_ajax) { 115 | form.trigger('valid'); 116 | } 117 | 118 | form.removeAttr(this.invalid_attr); 119 | 120 | if (is_ajax) return false; 121 | 122 | return true; 123 | }, 124 | 125 | parse_patterns : function (els) { 126 | var i = els.length, 127 | el_patterns = []; 128 | 129 | while (i--) { 130 | el_patterns.push(this.pattern(els[i])); 131 | } 132 | 133 | return this.check_validation_and_apply_styles(el_patterns); 134 | }, 135 | 136 | pattern : function (el) { 137 | var type = el.getAttribute('type'), 138 | required = typeof el.getAttribute('required') === 'string'; 139 | 140 | var pattern = el.getAttribute('pattern') || ''; 141 | 142 | if (this.settings.patterns.hasOwnProperty(pattern) && pattern.length > 0) { 143 | return [el, this.settings.patterns[pattern], required]; 144 | } else if (pattern.length > 0) { 145 | return [el, new RegExp(pattern), required]; 146 | } 147 | 148 | if (this.settings.patterns.hasOwnProperty(type)) { 149 | return [el, this.settings.patterns[type], required]; 150 | } 151 | 152 | pattern = /.*/; 153 | 154 | return [el, pattern, required]; 155 | }, 156 | 157 | check_validation_and_apply_styles : function (el_patterns) { 158 | var i = el_patterns.length, 159 | validations = []; 160 | 161 | while (i--) { 162 | var el = el_patterns[i][0], 163 | required = el_patterns[i][2], 164 | value = el.value, 165 | direct_parent = this.S(el).parent(), 166 | validator = el.getAttribute(this.add_namespace('data-abide-validator')), 167 | is_radio = el.type === "radio", 168 | is_checkbox = el.type === "checkbox", 169 | label = this.S('label[for="' + el.getAttribute('id') + '"]'), 170 | valid_length = (required) ? (el.value.length > 0) : true; 171 | 172 | var parent, valid; 173 | 174 | // support old way to do equalTo validations 175 | if(el.getAttribute(this.add_namespace('data-equalto'))) { validator = "equalTo" } 176 | 177 | if (!direct_parent.is('label')) { 178 | parent = direct_parent; 179 | } else { 180 | parent = direct_parent.parent(); 181 | } 182 | 183 | if (is_radio && required) { 184 | validations.push(this.valid_radio(el, required)); 185 | } else if (is_checkbox && required) { 186 | validations.push(this.valid_checkbox(el, required)); 187 | } else if (validator) { 188 | valid = this.settings.validators[validator].apply(this, [el, required, parent]) 189 | validations.push(valid); 190 | 191 | if (valid) { 192 | this.S(el).removeAttr(this.invalid_attr); 193 | parent.removeClass('error'); 194 | } else { 195 | this.S(el).attr(this.invalid_attr, ''); 196 | parent.addClass('error'); 197 | } 198 | } else { 199 | 200 | if (el_patterns[i][1].test(value) && valid_length || 201 | !required && el.value.length < 1 || $(el).attr('disabled')) { 202 | this.S(el).removeAttr(this.invalid_attr); 203 | parent.removeClass('error'); 204 | if (label.length > 0 && this.settings.error_labels) label.removeClass('error'); 205 | 206 | validations.push(true); 207 | $(el).triggerHandler('valid'); 208 | } else { 209 | this.S(el).attr(this.invalid_attr, ''); 210 | parent.addClass('error'); 211 | if (label.length > 0 && this.settings.error_labels) label.addClass('error'); 212 | 213 | validations.push(false); 214 | $(el).triggerHandler('invalid'); 215 | } 216 | } 217 | } 218 | 219 | return validations; 220 | }, 221 | 222 | valid_checkbox : function(el, required) { 223 | var el = this.S(el), 224 | valid = (el.is(':checked') || !required); 225 | 226 | if (valid) { 227 | el.removeAttr(this.invalid_attr).parent().removeClass('error'); 228 | } else { 229 | el.attr(this.invalid_attr, '').parent().addClass('error'); 230 | } 231 | 232 | return valid; 233 | }, 234 | 235 | valid_radio : function (el, required) { 236 | var name = el.getAttribute('name'), 237 | group = document.getElementsByName(name), 238 | count = group.length, 239 | valid = false; 240 | 241 | // Has to count up to make sure the focus gets applied to the top error 242 | for (var i=0; i < count; i++) { 243 | if (group[i].checked) valid = true; 244 | } 245 | 246 | // Has to count up to make sure the focus gets applied to the top error 247 | for (var i=0; i < count; i++) { 248 | if (valid) { 249 | this.S(group[i]).removeAttr(this.invalid_attr).parent().removeClass('error'); 250 | } else { 251 | this.S(group[i]).attr(this.invalid_attr, '').parent().addClass('error'); 252 | } 253 | } 254 | 255 | return valid; 256 | } 257 | }; 258 | }(jQuery, this, this.document)); 259 | -------------------------------------------------------------------------------- /static/content_submit/js/foundation/foundation.reveal.js: -------------------------------------------------------------------------------- 1 | ;(function ($, window, document, undefined) { 2 | 'use strict'; 3 | 4 | Foundation.libs.reveal = { 5 | name : 'reveal', 6 | 7 | version : '5.2.1', 8 | 9 | locked : false, 10 | 11 | settings : { 12 | animation: 'fadeAndPop', 13 | animation_speed: 250, 14 | close_on_background_click: true, 15 | close_on_esc: true, 16 | dismiss_modal_class: 'close-reveal-modal', 17 | bg_class: 'reveal-modal-bg', 18 | open: function(){}, 19 | opened: function(){}, 20 | close: function(){}, 21 | closed: function(){}, 22 | bg : $('.reveal-modal-bg'), 23 | css : { 24 | open : { 25 | 'opacity': 0, 26 | 'visibility': 'visible', 27 | 'display' : 'block' 28 | }, 29 | close : { 30 | 'opacity': 1, 31 | 'visibility': 'hidden', 32 | 'display': 'none' 33 | } 34 | } 35 | }, 36 | 37 | init : function (scope, method, options) { 38 | $.extend(true, this.settings, method, options); 39 | this.bindings(method, options); 40 | }, 41 | 42 | events : function (scope) { 43 | var self = this, 44 | S = self.S; 45 | 46 | S(this.scope) 47 | .off('.reveal') 48 | .on('click.fndtn.reveal', '[' + this.add_namespace('data-reveal-id') + ']', function (e) { 49 | e.preventDefault(); 50 | 51 | if (!self.locked) { 52 | var element = S(this), 53 | ajax = element.data(self.data_attr('reveal-ajax')); 54 | 55 | self.locked = true; 56 | 57 | if (typeof ajax === 'undefined') { 58 | self.open.call(self, element); 59 | } else { 60 | var url = ajax === true ? element.attr('href') : ajax; 61 | 62 | self.open.call(self, element, {url: url}); 63 | } 64 | } 65 | }); 66 | 67 | S(document) 68 | .on('touchend.fndtn.reveal click.fndtn.reveal', this.close_targets(), function (e) { 69 | 70 | e.preventDefault(); 71 | 72 | if (!self.locked) { 73 | var settings = S('[' + self.attr_name() + '].open').data(self.attr_name(true) + '-init'), 74 | bg_clicked = S(e.target)[0] === S('.' + settings.bg_class)[0]; 75 | 76 | if (bg_clicked) { 77 | if (settings.close_on_background_click) { 78 | e.stopPropagation(); 79 | } else { 80 | return; 81 | } 82 | } 83 | 84 | self.locked = true; 85 | self.close.call(self, bg_clicked ? S('[' + self.attr_name() + '].open') : S(this).closest('[' + self.attr_name() + ']')); 86 | } 87 | }); 88 | 89 | if(S('[' + self.attr_name() + ']', this.scope).length > 0) { 90 | S(this.scope) 91 | // .off('.reveal') 92 | .on('open.fndtn.reveal', this.settings.open) 93 | .on('opened.fndtn.reveal', this.settings.opened) 94 | .on('opened.fndtn.reveal', this.open_video) 95 | .on('close.fndtn.reveal', this.settings.close) 96 | .on('closed.fndtn.reveal', this.settings.closed) 97 | .on('closed.fndtn.reveal', this.close_video); 98 | } else { 99 | S(this.scope) 100 | // .off('.reveal') 101 | .on('open.fndtn.reveal', '[' + self.attr_name() + ']', this.settings.open) 102 | .on('opened.fndtn.reveal', '[' + self.attr_name() + ']', this.settings.opened) 103 | .on('opened.fndtn.reveal', '[' + self.attr_name() + ']', this.open_video) 104 | .on('close.fndtn.reveal', '[' + self.attr_name() + ']', this.settings.close) 105 | .on('closed.fndtn.reveal', '[' + self.attr_name() + ']', this.settings.closed) 106 | .on('closed.fndtn.reveal', '[' + self.attr_name() + ']', this.close_video); 107 | } 108 | 109 | return true; 110 | }, 111 | 112 | // PATCH #3: turning on key up capture only when a reveal window is open 113 | key_up_on : function (scope) { 114 | var self = this; 115 | 116 | // PATCH #1: fixing multiple keyup event trigger from single key press 117 | self.S('body').off('keyup.fndtn.reveal').on('keyup.fndtn.reveal', function ( event ) { 118 | var open_modal = self.S('[' + self.attr_name() + '].open'), 119 | settings = open_modal.data(self.attr_name(true) + '-init'); 120 | // PATCH #2: making sure that the close event can be called only while unlocked, 121 | // so that multiple keyup.fndtn.reveal events don't prevent clean closing of the reveal window. 122 | if ( settings && event.which === 27 && settings.close_on_esc && !self.locked) { // 27 is the keycode for the Escape key 123 | self.close.call(self, open_modal); 124 | } 125 | }); 126 | 127 | return true; 128 | }, 129 | 130 | // PATCH #3: turning on key up capture only when a reveal window is open 131 | key_up_off : function (scope) { 132 | this.S('body').off('keyup.fndtn.reveal'); 133 | return true; 134 | }, 135 | 136 | open : function (target, ajax_settings) { 137 | var self = this; 138 | if (target) { 139 | if (typeof target.selector !== 'undefined') { 140 | var modal = self.S('#' + target.data(self.data_attr('reveal-id'))); 141 | } else { 142 | var modal = self.S(this.scope); 143 | 144 | ajax_settings = target; 145 | } 146 | } else { 147 | var modal = self.S(this.scope); 148 | } 149 | 150 | var settings = modal.data(self.attr_name(true) + '-init'); 151 | 152 | if (!modal.hasClass('open')) { 153 | var open_modal = self.S('[' + self.attr_name() + '].open'); 154 | 155 | if (typeof modal.data('css-top') === 'undefined') { 156 | modal.data('css-top', parseInt(modal.css('top'), 10)) 157 | .data('offset', this.cache_offset(modal)); 158 | } 159 | 160 | this.key_up_on(modal); // PATCH #3: turning on key up capture only when a reveal window is open 161 | modal.trigger('open'); 162 | 163 | if (open_modal.length < 1) { 164 | this.toggle_bg(modal); 165 | } 166 | 167 | if (typeof ajax_settings === 'string') { 168 | ajax_settings = { 169 | url: ajax_settings 170 | }; 171 | } 172 | 173 | if (typeof ajax_settings === 'undefined' || !ajax_settings.url) { 174 | if (open_modal.length > 0) { 175 | this.hide(open_modal, settings.css.close); 176 | } 177 | 178 | this.show(modal, settings.css.open); 179 | } else { 180 | var old_success = typeof ajax_settings.success !== 'undefined' ? ajax_settings.success : null; 181 | 182 | $.extend(ajax_settings, { 183 | success: function (data, textStatus, jqXHR) { 184 | if ( $.isFunction(old_success) ) { 185 | old_success(data, textStatus, jqXHR); 186 | } 187 | 188 | modal.html(data); 189 | self.S(modal).foundation('section', 'reflow'); 190 | 191 | if (open_modal.length > 0) { 192 | self.hide(open_modal, settings.css.close); 193 | } 194 | self.show(modal, settings.css.open); 195 | } 196 | }); 197 | 198 | $.ajax(ajax_settings); 199 | } 200 | } 201 | }, 202 | 203 | close : function (modal) { 204 | var modal = modal && modal.length ? modal : this.S(this.scope), 205 | open_modals = this.S('[' + this.attr_name() + '].open'), 206 | settings = modal.data(this.attr_name(true) + '-init'); 207 | 208 | if (open_modals.length > 0) { 209 | this.locked = true; 210 | this.key_up_off(modal); // PATCH #3: turning on key up capture only when a reveal window is open 211 | modal.trigger('close'); 212 | this.toggle_bg(modal); 213 | this.hide(open_modals, settings.css.close, settings); 214 | } 215 | }, 216 | 217 | close_targets : function () { 218 | var base = '.' + this.settings.dismiss_modal_class; 219 | 220 | if (this.settings.close_on_background_click) { 221 | return base + ', .' + this.settings.bg_class; 222 | } 223 | 224 | return base; 225 | }, 226 | 227 | toggle_bg : function (modal) { 228 | var settings = modal.data(this.attr_name(true)); 229 | 230 | if (this.S('.' + this.settings.bg_class).length === 0) { 231 | this.settings.bg = $('
', {'class': this.settings.bg_class}) 232 | .appendTo('body').hide(); 233 | } 234 | 235 | if (this.settings.bg.filter(':visible').length > 0) { 236 | this.hide(this.settings.bg); 237 | } else { 238 | this.show(this.settings.bg); 239 | } 240 | }, 241 | 242 | show : function (el, css) { 243 | // is modal 244 | if (css) { 245 | var settings = el.data(this.attr_name(true) + '-init'); 246 | if (el.parent('body').length === 0) { 247 | var placeholder = el.wrap('
').parent(), 248 | rootElement = this.settings.rootElement || 'body'; 249 | 250 | el.on('closed.fndtn.reveal.wrapped', function() { 251 | el.detach().appendTo(placeholder); 252 | el.unwrap().unbind('closed.fndtn.reveal.wrapped'); 253 | }); 254 | 255 | el.detach().appendTo(rootElement); 256 | } 257 | 258 | var animData = getAnimationData(settings.animation); 259 | if (!animData.animate) { 260 | this.locked = false; 261 | } 262 | if (animData.pop) { 263 | css.top = $(window).scrollTop() - el.data('offset') + 'px'; 264 | var end_css = { 265 | top: $(window).scrollTop() + el.data('css-top') + 'px', 266 | opacity: 1 267 | }; 268 | 269 | return setTimeout(function () { 270 | return el 271 | .css(css) 272 | .animate(end_css, settings.animation_speed, 'linear', function () { 273 | this.locked = false; 274 | el.trigger('opened'); 275 | }.bind(this)) 276 | .addClass('open'); 277 | }.bind(this), settings.animation_speed / 2); 278 | } 279 | 280 | if (animData.fade) { 281 | css.top = $(window).scrollTop() + el.data('css-top') + 'px'; 282 | var end_css = {opacity: 1}; 283 | 284 | return setTimeout(function () { 285 | return el 286 | .css(css) 287 | .animate(end_css, settings.animation_speed, 'linear', function () { 288 | this.locked = false; 289 | el.trigger('opened'); 290 | }.bind(this)) 291 | .addClass('open'); 292 | }.bind(this), settings.animation_speed / 2); 293 | } 294 | 295 | return el.css(css).show().css({opacity: 1}).addClass('open').trigger('opened'); 296 | } 297 | 298 | var settings = this.settings; 299 | 300 | // should we animate the background? 301 | if (getAnimationData(settings.animation).fade) { 302 | return el.fadeIn(settings.animation_speed / 2); 303 | } 304 | 305 | this.locked = false; 306 | 307 | return el.show(); 308 | }, 309 | 310 | hide : function (el, css) { 311 | // is modal 312 | if (css) { 313 | var settings = el.data(this.attr_name(true) + '-init'); 314 | var animData = getAnimationData(settings.animation); 315 | if (!animData.animate) { 316 | this.locked = false; 317 | } 318 | if (animData.pop) { 319 | var end_css = { 320 | top: - $(window).scrollTop() - el.data('offset') + 'px', 321 | opacity: 0 322 | }; 323 | 324 | return setTimeout(function () { 325 | return el 326 | .animate(end_css, settings.animation_speed, 'linear', function () { 327 | this.locked = false; 328 | el.css(css).trigger('closed'); 329 | }.bind(this)) 330 | .removeClass('open'); 331 | }.bind(this), settings.animation_speed / 2); 332 | } 333 | 334 | if (animData.fade) { 335 | var end_css = {opacity: 0}; 336 | 337 | return setTimeout(function () { 338 | return el 339 | .animate(end_css, settings.animation_speed, 'linear', function () { 340 | this.locked = false; 341 | el.css(css).trigger('closed'); 342 | }.bind(this)) 343 | .removeClass('open'); 344 | }.bind(this), settings.animation_speed / 2); 345 | } 346 | 347 | return el.hide().css(css).removeClass('open').trigger('closed'); 348 | } 349 | 350 | var settings = this.settings; 351 | 352 | // should we animate the background? 353 | if (getAnimationData(settings.animation).fade) { 354 | return el.fadeOut(settings.animation_speed / 2); 355 | } 356 | 357 | return el.hide(); 358 | }, 359 | 360 | close_video : function (e) { 361 | var video = $('.flex-video', e.target), 362 | iframe = $('iframe', video); 363 | 364 | if (iframe.length > 0) { 365 | iframe.attr('data-src', iframe[0].src); 366 | iframe.attr('src', 'about:blank'); 367 | video.hide(); 368 | } 369 | }, 370 | 371 | open_video : function (e) { 372 | var video = $('.flex-video', e.target), 373 | iframe = video.find('iframe'); 374 | 375 | if (iframe.length > 0) { 376 | var data_src = iframe.attr('data-src'); 377 | if (typeof data_src === 'string') { 378 | iframe[0].src = iframe.attr('data-src'); 379 | } else { 380 | var src = iframe[0].src; 381 | iframe[0].src = undefined; 382 | iframe[0].src = src; 383 | } 384 | video.show(); 385 | } 386 | }, 387 | 388 | data_attr: function (str) { 389 | if (this.namespace.length > 0) { 390 | return this.namespace + '-' + str; 391 | } 392 | 393 | return str; 394 | }, 395 | 396 | cache_offset : function (modal) { 397 | var offset = modal.show().height() + parseInt(modal.css('top'), 10); 398 | 399 | modal.hide(); 400 | 401 | return offset; 402 | }, 403 | 404 | off : function () { 405 | $(this.scope).off('.fndtn.reveal'); 406 | }, 407 | 408 | reflow : function () {} 409 | }; 410 | 411 | /* 412 | * getAnimationData('popAndFade') // {animate: true, pop: true, fade: true} 413 | * getAnimationData('fade') // {animate: true, pop: false, fade: true} 414 | * getAnimationData('pop') // {animate: true, pop: true, fade: false} 415 | * getAnimationData('foo') // {animate: false, pop: false, fade: false} 416 | * getAnimationData(null) // {animate: false, pop: false, fade: false} 417 | */ 418 | function getAnimationData(str) { 419 | var fade = /fade/i.test(str); 420 | var pop = /pop/i.test(str); 421 | return { 422 | animate: fade || pop, 423 | pop: pop, 424 | fade: fade 425 | }; 426 | } 427 | }(jQuery, this, this.document)); 428 | -------------------------------------------------------------------------------- /static/content_submit/js/foundation/foundation.topbar.js: -------------------------------------------------------------------------------- 1 | ;(function ($, window, document, undefined) { 2 | 'use strict'; 3 | 4 | Foundation.libs.topbar = { 5 | name : 'topbar', 6 | 7 | version: '5.2.1', 8 | 9 | settings : { 10 | index : 0, 11 | sticky_class : 'sticky', 12 | custom_back_text: true, 13 | back_text: 'Back', 14 | is_hover: true, 15 | mobile_show_parent_link: false, 16 | scrolltop : true, // jump to top when sticky nav menu toggle is clicked 17 | sticky_on : 'all' 18 | }, 19 | 20 | init : function (section, method, options) { 21 | Foundation.inherit(this, 'add_custom_rule register_media throttle'); 22 | var self = this; 23 | 24 | self.register_media('topbar', 'foundation-mq-topbar'); 25 | 26 | this.bindings(method, options); 27 | 28 | self.S('[' + this.attr_name() + ']', this.scope).each(function () { 29 | var topbar = $(this), 30 | settings = topbar.data(self.attr_name(true) + '-init'), 31 | section = self.S('section', this), 32 | titlebar = topbar.children().filter('ul').first(); 33 | topbar.data('index', 0); 34 | var topbarContainer = topbar.parent(); 35 | if(topbarContainer.hasClass('fixed') || self.is_sticky(topbar, topbarContainer, settings) ) { 36 | self.settings.sticky_class = settings.sticky_class; 37 | self.settings.sticky_topbar = topbar; 38 | topbar.data('height', topbarContainer.outerHeight()); 39 | topbar.data('stickyoffset', topbarContainer.offset().top); 40 | } else { 41 | topbar.data('height', topbar.outerHeight()); 42 | } 43 | 44 | if (!settings.assembled) self.assemble(topbar); 45 | 46 | if (settings.is_hover) { 47 | self.S('.has-dropdown', topbar).addClass('not-click'); 48 | } else { 49 | self.S('.has-dropdown', topbar).removeClass('not-click'); 50 | } 51 | 52 | // Pad body when sticky (scrolled) or fixed. 53 | self.add_custom_rule('.f-topbar-fixed { padding-top: ' + topbar.data('height') + 'px }'); 54 | 55 | if (topbarContainer.hasClass('fixed')) { 56 | self.S('body').addClass('f-topbar-fixed'); 57 | } 58 | }); 59 | 60 | }, 61 | 62 | is_sticky: function (topbar, topbarContainer, settings) { 63 | var sticky = topbarContainer.hasClass(settings.sticky_class); 64 | 65 | if (sticky && settings.sticky_on === 'all') { 66 | return true; 67 | } else if (sticky && this.small() && settings.sticky_on === 'small') { 68 | return true; 69 | } else if (sticky && this.medium() && settings.sticky_on === 'medium') { 70 | return true; 71 | } else if (sticky && this.large() && settings.sticky_on === 'large') { 72 | return true; 73 | } 74 | 75 | return false; 76 | }, 77 | 78 | toggle: function (toggleEl) { 79 | var self = this; 80 | 81 | if (toggleEl) { 82 | var topbar = self.S(toggleEl).closest('[' + this.attr_name() + ']'); 83 | } else { 84 | var topbar = self.S('[' + this.attr_name() + ']'); 85 | } 86 | 87 | var settings = topbar.data(this.attr_name(true) + '-init'); 88 | 89 | var section = self.S('section, .section', topbar); 90 | 91 | if (self.breakpoint()) { 92 | if (!self.rtl) { 93 | section.css({left: '0%'}); 94 | $('>.name', section).css({left: '100%'}); 95 | } else { 96 | section.css({right: '0%'}); 97 | $('>.name', section).css({right: '100%'}); 98 | } 99 | 100 | self.S('li.moved', section).removeClass('moved'); 101 | topbar.data('index', 0); 102 | 103 | topbar 104 | .toggleClass('expanded') 105 | .css('height', ''); 106 | } 107 | 108 | if (settings.scrolltop) { 109 | if (!topbar.hasClass('expanded')) { 110 | if (topbar.hasClass('fixed')) { 111 | topbar.parent().addClass('fixed'); 112 | topbar.removeClass('fixed'); 113 | self.S('body').addClass('f-topbar-fixed'); 114 | } 115 | } else if (topbar.parent().hasClass('fixed')) { 116 | if (settings.scrolltop) { 117 | topbar.parent().removeClass('fixed'); 118 | topbar.addClass('fixed'); 119 | self.S('body').removeClass('f-topbar-fixed'); 120 | 121 | window.scrollTo(0,0); 122 | } else { 123 | topbar.parent().removeClass('expanded'); 124 | } 125 | } 126 | } else { 127 | if(self.is_sticky(topbar, topbar.parent(), settings)) { 128 | topbar.parent().addClass('fixed'); 129 | } 130 | 131 | if(topbar.parent().hasClass('fixed')) { 132 | if (!topbar.hasClass('expanded')) { 133 | topbar.removeClass('fixed'); 134 | topbar.parent().removeClass('expanded'); 135 | self.update_sticky_positioning(); 136 | } else { 137 | topbar.addClass('fixed'); 138 | topbar.parent().addClass('expanded'); 139 | self.S('body').addClass('f-topbar-fixed'); 140 | } 141 | } 142 | } 143 | }, 144 | 145 | timer : null, 146 | 147 | events : function (bar) { 148 | var self = this, 149 | S = this.S; 150 | 151 | S(this.scope) 152 | .off('.topbar') 153 | .on('click.fndtn.topbar', '[' + this.attr_name() + '] .toggle-topbar', function (e) { 154 | e.preventDefault(); 155 | self.toggle(this); 156 | }) 157 | .on('click.fndtn.topbar','.top-bar .top-bar-section li a[href^="#"],[' + this.attr_name() + '] .top-bar-section li a[href^="#"]',function (e) { 158 | var li = $(this).closest('li'); 159 | if(self.breakpoint() && !li.hasClass('back') && !li.hasClass('has-dropdown')) 160 | { 161 | self.toggle(); 162 | } 163 | }) 164 | .on('click.fndtn.topbar', '[' + this.attr_name() + '] li.has-dropdown', function (e) { 165 | var li = S(this), 166 | target = S(e.target), 167 | topbar = li.closest('[' + self.attr_name() + ']'), 168 | settings = topbar.data(self.attr_name(true) + '-init'); 169 | 170 | if(target.data('revealId')) { 171 | self.toggle(); 172 | return; 173 | } 174 | 175 | if (self.breakpoint()) return; 176 | if (settings.is_hover && !Modernizr.touch) return; 177 | 178 | e.stopImmediatePropagation(); 179 | 180 | if (li.hasClass('hover')) { 181 | li 182 | .removeClass('hover') 183 | .find('li') 184 | .removeClass('hover'); 185 | 186 | li.parents('li.hover') 187 | .removeClass('hover'); 188 | } else { 189 | li.addClass('hover'); 190 | 191 | if (target[0].nodeName === 'A' && target.parent().hasClass('has-dropdown')) { 192 | e.preventDefault(); 193 | } 194 | } 195 | }) 196 | .on('click.fndtn.topbar', '[' + this.attr_name() + '] .has-dropdown>a', function (e) { 197 | if (self.breakpoint()) { 198 | 199 | e.preventDefault(); 200 | 201 | var $this = S(this), 202 | topbar = $this.closest('[' + self.attr_name() + ']'), 203 | section = topbar.find('section, .section'), 204 | dropdownHeight = $this.next('.dropdown').outerHeight(), 205 | $selectedLi = $this.closest('li'); 206 | 207 | topbar.data('index', topbar.data('index') + 1); 208 | $selectedLi.addClass('moved'); 209 | 210 | if (!self.rtl) { 211 | section.css({left: -(100 * topbar.data('index')) + '%'}); 212 | section.find('>.name').css({left: 100 * topbar.data('index') + '%'}); 213 | } else { 214 | section.css({right: -(100 * topbar.data('index')) + '%'}); 215 | section.find('>.name').css({right: 100 * topbar.data('index') + '%'}); 216 | } 217 | 218 | topbar.css('height', $this.siblings('ul').outerHeight(true) + topbar.data('height')); 219 | } 220 | }); 221 | 222 | S(window).off('.topbar').on('resize.fndtn.topbar', self.throttle(function () { 223 | self.resize.call(self); 224 | }, 50)).trigger('resize'); 225 | 226 | S('body').off('.topbar').on('click.fndtn.topbar touchstart.fndtn.topbar', function (e) { 227 | var parent = S(e.target).closest('li').closest('li.hover'); 228 | 229 | if (parent.length > 0) { 230 | return; 231 | } 232 | 233 | S('[' + self.attr_name() + '] li').removeClass('hover'); 234 | }); 235 | 236 | // Go up a level on Click 237 | S(this.scope).on('click.fndtn.topbar', '[' + this.attr_name() + '] .has-dropdown .back', function (e) { 238 | e.preventDefault(); 239 | 240 | var $this = S(this), 241 | topbar = $this.closest('[' + self.attr_name() + ']'), 242 | section = topbar.find('section, .section'), 243 | settings = topbar.data(self.attr_name(true) + '-init'), 244 | $movedLi = $this.closest('li.moved'), 245 | $previousLevelUl = $movedLi.parent(); 246 | 247 | topbar.data('index', topbar.data('index') - 1); 248 | 249 | if (!self.rtl) { 250 | section.css({left: -(100 * topbar.data('index')) + '%'}); 251 | section.find('>.name').css({left: 100 * topbar.data('index') + '%'}); 252 | } else { 253 | section.css({right: -(100 * topbar.data('index')) + '%'}); 254 | section.find('>.name').css({right: 100 * topbar.data('index') + '%'}); 255 | } 256 | 257 | if (topbar.data('index') === 0) { 258 | topbar.css('height', ''); 259 | } else { 260 | topbar.css('height', $previousLevelUl.outerHeight(true) + topbar.data('height')); 261 | } 262 | 263 | setTimeout(function () { 264 | $movedLi.removeClass('moved'); 265 | }, 300); 266 | }); 267 | }, 268 | 269 | resize : function () { 270 | var self = this; 271 | self.S('[' + this.attr_name() + ']').each(function () { 272 | var topbar = self.S(this), 273 | settings = topbar.data(self.attr_name(true) + '-init'); 274 | 275 | var stickyContainer = topbar.parent('.' + self.settings.sticky_class); 276 | var stickyOffset; 277 | 278 | if (!self.breakpoint()) { 279 | var doToggle = topbar.hasClass('expanded'); 280 | topbar 281 | .css('height', '') 282 | .removeClass('expanded') 283 | .find('li') 284 | .removeClass('hover'); 285 | 286 | if(doToggle) { 287 | self.toggle(topbar); 288 | } 289 | } 290 | 291 | if(self.is_sticky(topbar, stickyContainer, settings)) { 292 | if(stickyContainer.hasClass('fixed')) { 293 | // Remove the fixed to allow for correct calculation of the offset. 294 | stickyContainer.removeClass('fixed'); 295 | 296 | stickyOffset = stickyContainer.offset().top; 297 | if(self.S(document.body).hasClass('f-topbar-fixed')) { 298 | stickyOffset -= topbar.data('height'); 299 | } 300 | 301 | topbar.data('stickyoffset', stickyOffset); 302 | stickyContainer.addClass('fixed'); 303 | } else { 304 | stickyOffset = stickyContainer.offset().top; 305 | topbar.data('stickyoffset', stickyOffset); 306 | } 307 | } 308 | 309 | }); 310 | }, 311 | 312 | breakpoint : function () { 313 | return !matchMedia(Foundation.media_queries['topbar']).matches; 314 | }, 315 | 316 | small : function () { 317 | return matchMedia(Foundation.media_queries['small']).matches; 318 | }, 319 | 320 | medium : function () { 321 | return matchMedia(Foundation.media_queries['medium']).matches; 322 | }, 323 | 324 | large : function () { 325 | return matchMedia(Foundation.media_queries['large']).matches; 326 | }, 327 | 328 | assemble : function (topbar) { 329 | var self = this, 330 | settings = topbar.data(this.attr_name(true) + '-init'), 331 | section = self.S('section', topbar), 332 | titlebar = $(this).children().filter('ul').first(); 333 | 334 | // Pull element out of the DOM for manipulation 335 | section.detach(); 336 | 337 | self.S('.has-dropdown>a', section).each(function () { 338 | var $link = self.S(this), 339 | $dropdown = $link.siblings('.dropdown'), 340 | url = $link.attr('href'); 341 | 342 | if (!$dropdown.find('.title.back').length) { 343 | if (settings.mobile_show_parent_link && url && url.length > 1) { 344 | var $titleLi = $('
  • ' + $link.text() +'
  • '); 345 | } else { 346 | var $titleLi = $('
  • '); 347 | } 348 | 349 | // Copy link to subnav 350 | if (settings.custom_back_text == true) { 351 | $('h5>a', $titleLi).html(settings.back_text); 352 | } else { 353 | $('h5>a', $titleLi).html('« ' + $link.html()); 354 | } 355 | $dropdown.prepend($titleLi); 356 | } 357 | }); 358 | 359 | // Put element back in the DOM 360 | section.appendTo(topbar); 361 | 362 | // check for sticky 363 | this.sticky(); 364 | 365 | this.assembled(topbar); 366 | }, 367 | 368 | assembled : function (topbar) { 369 | topbar.data(this.attr_name(true), $.extend({}, topbar.data(this.attr_name(true)), {assembled: true})); 370 | }, 371 | 372 | height : function (ul) { 373 | var total = 0, 374 | self = this; 375 | 376 | $('> li', ul).each(function () { total += self.S(this).outerHeight(true); }); 377 | 378 | return total; 379 | }, 380 | 381 | sticky : function () { 382 | var $window = this.S(window), 383 | self = this; 384 | 385 | this.S(window).on('scroll', function() { 386 | self.update_sticky_positioning(); 387 | }); 388 | }, 389 | 390 | update_sticky_positioning: function() { 391 | var klass = '.' + this.settings.sticky_class, 392 | $window = this.S(window), 393 | self = this; 394 | 395 | if (self.settings.sticky_topbar && self.is_sticky(this.settings.sticky_topbar,this.settings.sticky_topbar.parent(), this.settings)) { 396 | var distance = this.settings.sticky_topbar.data('stickyoffset'); 397 | if (!self.S(klass).hasClass('expanded')) { 398 | if ($window.scrollTop() > (distance)) { 399 | if (!self.S(klass).hasClass('fixed')) { 400 | self.S(klass).addClass('fixed'); 401 | self.S('body').addClass('f-topbar-fixed'); 402 | } 403 | } else if ($window.scrollTop() <= distance) { 404 | if (self.S(klass).hasClass('fixed')) { 405 | self.S(klass).removeClass('fixed'); 406 | self.S('body').removeClass('f-topbar-fixed'); 407 | } 408 | } 409 | } 410 | } 411 | }, 412 | 413 | off : function () { 414 | this.S(this.scope).off('.fndtn.topbar'); 415 | this.S(window).off('.fndtn.topbar'); 416 | }, 417 | 418 | reflow : function () {} 419 | }; 420 | }(jQuery, this, this.document)); 421 | -------------------------------------------------------------------------------- /static/content_submit/js/foundation/foundation.clearing.js: -------------------------------------------------------------------------------- 1 | ;(function ($, window, document, undefined) { 2 | 'use strict'; 3 | 4 | Foundation.libs.clearing = { 5 | name : 'clearing', 6 | 7 | version: '5.2.1', 8 | 9 | settings : { 10 | templates : { 11 | viewing : '×' + 12 | '' 15 | }, 16 | 17 | // comma delimited list of selectors that, on click, will close clearing, 18 | // add 'div.clearing-blackout, div.visible-img' to close on background click 19 | close_selectors : '.clearing-close', 20 | 21 | touch_label : '← Swipe to Advance →', 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, 'throttle image_loaded'); 31 | 32 | this.bindings(method, options); 33 | 34 | if (self.S(this.scope).is('[' + this.attr_name() + ']')) { 35 | this.assemble(self.S('li', this.scope)); 36 | } else { 37 | self.S('[' + this.attr_name() + ']', this.scope).each(function () { 38 | self.assemble(self.S('li', this)); 39 | }); 40 | } 41 | }, 42 | 43 | events : function (scope) { 44 | var self = this, 45 | S = self.S; 46 | 47 | if ($('.scroll-container').length > 0) { 48 | this.scope = $('.scroll-container'); 49 | } 50 | 51 | S(this.scope) 52 | .off('.clearing') 53 | .on('click.fndtn.clearing', 'ul[' + this.attr_name() + '] li', 54 | function (e, current, target) { 55 | var current = current || S(this), 56 | target = target || current, 57 | next = current.next('li'), 58 | settings = current.closest('[' + self.attr_name() + ']').data(self.attr_name(true) + '-init'), 59 | image = S(e.target); 60 | 61 | e.preventDefault(); 62 | 63 | if (!settings) { 64 | self.init(); 65 | settings = current.closest('[' + self.attr_name() + ']').data(self.attr_name(true) + '-init'); 66 | } 67 | 68 | // if clearing is open and the current image is 69 | // clicked, go to the next image in sequence 70 | if (target.hasClass('visible') && 71 | current[0] === target[0] && 72 | next.length > 0 && self.is_open(current)) { 73 | target = next; 74 | image = S('img', target); 75 | } 76 | 77 | // set current and target to the clicked li if not otherwise defined. 78 | self.open(image, current, target); 79 | self.update_paddles(target); 80 | }) 81 | 82 | .on('click.fndtn.clearing', '.clearing-main-next', 83 | function (e) { self.nav(e, 'next') }) 84 | .on('click.fndtn.clearing', '.clearing-main-prev', 85 | function (e) { self.nav(e, 'prev') }) 86 | .on('click.fndtn.clearing', this.settings.close_selectors, 87 | function (e) { Foundation.libs.clearing.close(e, this) }); 88 | 89 | $(document).on('keydown.fndtn.clearing', 90 | function (e) { self.keydown(e) }); 91 | 92 | S(window).off('.clearing').on('resize.fndtn.clearing', 93 | function () { self.resize() }); 94 | 95 | this.swipe_events(scope); 96 | }, 97 | 98 | swipe_events : function (scope) { 99 | var self = this, 100 | S = self.S; 101 | 102 | S(this.scope) 103 | .on('touchstart.fndtn.clearing', '.visible-img', function(e) { 104 | if (!e.touches) { e = e.originalEvent; } 105 | var data = { 106 | start_page_x: e.touches[0].pageX, 107 | start_page_y: e.touches[0].pageY, 108 | start_time: (new Date()).getTime(), 109 | delta_x: 0, 110 | is_scrolling: undefined 111 | }; 112 | 113 | S(this).data('swipe-transition', data); 114 | e.stopPropagation(); 115 | }) 116 | .on('touchmove.fndtn.clearing', '.visible-img', function(e) { 117 | if (!e.touches) { e = e.originalEvent; } 118 | // Ignore pinch/zoom events 119 | if(e.touches.length > 1 || e.scale && e.scale !== 1) return; 120 | 121 | var data = S(this).data('swipe-transition'); 122 | 123 | if (typeof data === 'undefined') { 124 | data = {}; 125 | } 126 | 127 | data.delta_x = e.touches[0].pageX - data.start_page_x; 128 | 129 | if ( typeof data.is_scrolling === 'undefined') { 130 | data.is_scrolling = !!( data.is_scrolling || Math.abs(data.delta_x) < Math.abs(e.touches[0].pageY - data.start_page_y) ); 131 | } 132 | 133 | if (!data.is_scrolling && !data.active) { 134 | e.preventDefault(); 135 | var direction = (data.delta_x < 0) ? 'next' : 'prev'; 136 | data.active = true; 137 | self.nav(e, direction); 138 | } 139 | }) 140 | .on('touchend.fndtn.clearing', '.visible-img', function(e) { 141 | S(this).data('swipe-transition', {}); 142 | e.stopPropagation(); 143 | }); 144 | }, 145 | 146 | assemble : function ($li) { 147 | var $el = $li.parent(); 148 | 149 | if ($el.parent().hasClass('carousel')) return; 150 | $el.after('
    '); 151 | 152 | var holder = this.S('#foundationClearingHolder'), 153 | settings = $el.data(this.attr_name(true) + '-init'), 154 | grid = $el.detach(), 155 | data = { 156 | grid: '', 157 | viewing: settings.templates.viewing 158 | }, 159 | wrapper = '
    ' + data.viewing + 160 | data.grid + '
    ', 161 | touch_label = this.settings.touch_label; 162 | 163 | if (Modernizr.touch) { 164 | wrapper = $(wrapper).find('.clearing-touch-label').html(touch_label).end(); 165 | } 166 | 167 | holder.after(wrapper).remove(); 168 | }, 169 | 170 | open : function ($image, current, target) { 171 | var self = this, 172 | body = $(document.body), 173 | root = target.closest('.clearing-assembled'), 174 | container = $('div', root).first(), 175 | visible_image = $('.visible-img', container), 176 | image = $('img', visible_image).not($image), 177 | label = $('.clearing-touch-label', '.clearing-blackout'), 178 | error = false; 179 | 180 | image.error(function () { 181 | error = true; 182 | }); 183 | 184 | function startLoad() { 185 | setTimeout(function () { 186 | this.image_loaded(image, function () { 187 | if (image.outerWidth() === 1 && !error) { 188 | startLoad.call(this); 189 | } else { 190 | cb.call(this, image); 191 | } 192 | }.bind(this)); 193 | }.bind(this), 50); 194 | } 195 | 196 | function cb (image) { 197 | var $image = $(image); 198 | image.css('visibility', 'visible'); 199 | // toggle the gallery 200 | body.css('overflow', 'hidden'); 201 | root.addClass('clearing-blackout'); 202 | container.addClass('clearing-container'); 203 | visible_image.show(); 204 | this.fix_height(target) 205 | .caption(self.S('.clearing-caption', visible_image), self.S('img', target)) 206 | .center_and_label(image, label) 207 | .shift(current, target, function () { 208 | target.siblings().removeClass('visible'); 209 | target.addClass('visible'); 210 | }); 211 | } 212 | 213 | if (!this.locked()) { 214 | // set the image to the selected thumbnail 215 | image 216 | .attr('src', this.load($image)) 217 | .css('visibility', 'hidden'); 218 | 219 | startLoad.call(this); 220 | 221 | } 222 | }, 223 | 224 | close : function (e, el) { 225 | e.preventDefault(); 226 | 227 | var root = (function (target) { 228 | if (/blackout/.test(target.selector)) { 229 | return target; 230 | } else { 231 | return target.closest('.clearing-blackout'); 232 | } 233 | }($(el))), 234 | body = $(document.body), container, visible_image; 235 | 236 | if (el === e.target && root) { 237 | body.css('overflow', ''); 238 | container = $('div', root).first(); 239 | visible_image = $('.visible-img', container); 240 | this.settings.prev_index = 0; 241 | $('ul[' + this.attr_name() + ']', root) 242 | .attr('style', '').closest('.clearing-blackout') 243 | .removeClass('clearing-blackout'); 244 | container.removeClass('clearing-container'); 245 | visible_image.hide(); 246 | } 247 | 248 | return false; 249 | }, 250 | 251 | is_open : function (current) { 252 | return current.parent().prop('style').length > 0; 253 | }, 254 | 255 | keydown : function (e) { 256 | var clearing = $('.clearing-blackout ul[' + this.attr_name() + ']'), 257 | NEXT_KEY = this.rtl ? 37 : 39, 258 | PREV_KEY = this.rtl ? 39 : 37, 259 | ESC_KEY = 27; 260 | 261 | if (e.which === NEXT_KEY) this.go(clearing, 'next'); 262 | if (e.which === PREV_KEY) this.go(clearing, 'prev'); 263 | if (e.which === ESC_KEY) this.S('a.clearing-close').trigger('click'); 264 | }, 265 | 266 | nav : function (e, direction) { 267 | var clearing = $('ul[' + this.attr_name() + ']', '.clearing-blackout'); 268 | 269 | e.preventDefault(); 270 | this.go(clearing, direction); 271 | }, 272 | 273 | resize : function () { 274 | var image = $('img', '.clearing-blackout .visible-img'), 275 | label = $('.clearing-touch-label', '.clearing-blackout'); 276 | 277 | if (image.length) { 278 | this.center_and_label(image, label); 279 | } 280 | }, 281 | 282 | // visual adjustments 283 | fix_height : function (target) { 284 | var lis = target.parent().children(), 285 | self = this; 286 | 287 | lis.each(function () { 288 | var li = self.S(this), 289 | image = li.find('img'); 290 | 291 | if (li.height() > image.outerHeight()) { 292 | li.addClass('fix-height'); 293 | } 294 | }) 295 | .closest('ul') 296 | .width(lis.length * 100 + '%'); 297 | 298 | return this; 299 | }, 300 | 301 | update_paddles : function (target) { 302 | var visible_image = target 303 | .closest('.carousel') 304 | .siblings('.visible-img'); 305 | 306 | if (target.next().length > 0) { 307 | this.S('.clearing-main-next', visible_image) 308 | .removeClass('disabled'); 309 | } else { 310 | this.S('.clearing-main-next', visible_image) 311 | .addClass('disabled'); 312 | } 313 | 314 | if (target.prev().length > 0) { 315 | this.S('.clearing-main-prev', visible_image) 316 | .removeClass('disabled'); 317 | } else { 318 | this.S('.clearing-main-prev', visible_image) 319 | .addClass('disabled'); 320 | } 321 | }, 322 | 323 | center_and_label : function (target, label) { 324 | if (!this.rtl) { 325 | target.css({ 326 | marginLeft : -(target.outerWidth() / 2), 327 | marginTop : -(target.outerHeight() / 2) 328 | }); 329 | 330 | if (label.length > 0) { 331 | label.css({ 332 | marginLeft : -(label.outerWidth() / 2), 333 | marginTop : -(target.outerHeight() / 2)-label.outerHeight()-10 334 | }); 335 | } 336 | } else { 337 | target.css({ 338 | marginRight : -(target.outerWidth() / 2), 339 | marginTop : -(target.outerHeight() / 2), 340 | left: 'auto', 341 | right: '50%' 342 | }); 343 | 344 | if (label.length > 0) { 345 | label.css({ 346 | marginRight : -(label.outerWidth() / 2), 347 | marginTop : -(target.outerHeight() / 2)-label.outerHeight()-10, 348 | left: 'auto', 349 | right: '50%' 350 | }); 351 | } 352 | } 353 | return this; 354 | }, 355 | 356 | // image loading and preloading 357 | 358 | load : function ($image) { 359 | if ($image[0].nodeName === "A") { 360 | var href = $image.attr('href'); 361 | } else { 362 | var href = $image.parent().attr('href'); 363 | } 364 | 365 | this.preload($image); 366 | 367 | if (href) return href; 368 | return $image.attr('src'); 369 | }, 370 | 371 | preload : function ($image) { 372 | this 373 | .img($image.closest('li').next()) 374 | .img($image.closest('li').prev()); 375 | }, 376 | 377 | img : function (img) { 378 | if (img.length) { 379 | var new_img = new Image(), 380 | new_a = this.S('a', img); 381 | 382 | if (new_a.length) { 383 | new_img.src = new_a.attr('href'); 384 | } else { 385 | new_img.src = this.S('img', img).attr('src'); 386 | } 387 | } 388 | return this; 389 | }, 390 | 391 | // image caption 392 | 393 | caption : function (container, $image) { 394 | var caption = $image.attr('data-caption'); 395 | 396 | if (caption) { 397 | container 398 | .html(caption) 399 | .show(); 400 | } else { 401 | container 402 | .text('') 403 | .hide(); 404 | } 405 | return this; 406 | }, 407 | 408 | // directional methods 409 | 410 | go : function ($ul, direction) { 411 | var current = this.S('.visible', $ul), 412 | target = current[direction](); 413 | 414 | if (target.length) { 415 | this.S('img', target) 416 | .trigger('click', [current, target]); 417 | } 418 | }, 419 | 420 | shift : function (current, target, callback) { 421 | var clearing = target.parent(), 422 | old_index = this.settings.prev_index || target.index(), 423 | direction = this.direction(clearing, current, target), 424 | dir = this.rtl ? 'right' : 'left', 425 | left = parseInt(clearing.css('left'), 10), 426 | width = target.outerWidth(), 427 | skip_shift; 428 | 429 | var dir_obj = {}; 430 | 431 | // we use jQuery animate instead of CSS transitions because we 432 | // need a callback to unlock the next animation 433 | // needs support for RTL ** 434 | if (target.index() !== old_index && !/skip/.test(direction)){ 435 | if (/left/.test(direction)) { 436 | this.lock(); 437 | dir_obj[dir] = left + width; 438 | clearing.animate(dir_obj, 300, this.unlock()); 439 | } else if (/right/.test(direction)) { 440 | this.lock(); 441 | dir_obj[dir] = left - width; 442 | clearing.animate(dir_obj, 300, this.unlock()); 443 | } 444 | } else if (/skip/.test(direction)) { 445 | // the target image is not adjacent to the current image, so 446 | // do we scroll right or not 447 | skip_shift = target.index() - this.settings.up_count; 448 | this.lock(); 449 | 450 | if (skip_shift > 0) { 451 | dir_obj[dir] = -(skip_shift * width); 452 | clearing.animate(dir_obj, 300, this.unlock()); 453 | } else { 454 | dir_obj[dir] = 0; 455 | clearing.animate(dir_obj, 300, this.unlock()); 456 | } 457 | } 458 | 459 | callback(); 460 | }, 461 | 462 | direction : function ($el, current, target) { 463 | var lis = this.S('li', $el), 464 | li_width = lis.outerWidth() + (lis.outerWidth() / 4), 465 | up_count = Math.floor(this.S('.clearing-container').outerWidth() / li_width) - 1, 466 | target_index = lis.index(target), 467 | response; 468 | 469 | this.settings.up_count = up_count; 470 | 471 | if (this.adjacent(this.settings.prev_index, target_index)) { 472 | if ((target_index > up_count) 473 | && target_index > this.settings.prev_index) { 474 | response = 'right'; 475 | } else if ((target_index > up_count - 1) 476 | && target_index <= this.settings.prev_index) { 477 | response = 'left'; 478 | } else { 479 | response = false; 480 | } 481 | } else { 482 | response = 'skip'; 483 | } 484 | 485 | this.settings.prev_index = target_index; 486 | 487 | return response; 488 | }, 489 | 490 | adjacent : function (current_index, target_index) { 491 | for (var i = target_index + 1; i >= target_index - 1; i--) { 492 | if (i === current_index) return true; 493 | } 494 | return false; 495 | }, 496 | 497 | // lock management 498 | 499 | lock : function () { 500 | this.settings.locked = true; 501 | }, 502 | 503 | unlock : function () { 504 | this.settings.locked = false; 505 | }, 506 | 507 | locked : function () { 508 | return this.settings.locked; 509 | }, 510 | 511 | off : function () { 512 | this.S(this.scope).off('.fndtn.clearing'); 513 | this.S(window).off('.fndtn.clearing'); 514 | }, 515 | 516 | reflow : function () { 517 | this.init(); 518 | } 519 | }; 520 | 521 | }(jQuery, this, this.document)); 522 | -------------------------------------------------------------------------------- /static/content_submit/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 | adjust_height_after = false; 21 | 22 | self.cache = {}; 23 | 24 | self.slides = function() { 25 | return slides_container.children(settings.slide_selector); 26 | }; 27 | 28 | self.slides().first().addClass(settings.active_slide_class); 29 | 30 | self.update_slide_number = function(index) { 31 | if (settings.slide_number) { 32 | number_container.find('span:first').text(parseInt(index)+1); 33 | number_container.find('span:last').text(self.slides().length); 34 | } 35 | if (settings.bullets) { 36 | bullets_container.children().removeClass(settings.bullets_active_class); 37 | $(bullets_container.children().get(index)).addClass(settings.bullets_active_class); 38 | } 39 | }; 40 | 41 | self.update_active_link = function(index) { 42 | var link = $('[data-orbit-link="'+self.slides().eq(index).attr('data-orbit-slide')+'"]'); 43 | link.siblings().removeClass(settings.bullets_active_class); 44 | link.addClass(settings.bullets_active_class); 45 | }; 46 | 47 | self.build_markup = function() { 48 | slides_container.wrap('
    '); 49 | container = slides_container.parent(); 50 | slides_container.addClass(settings.slides_container_class); 51 | 52 | if (settings.navigation_arrows) { 53 | container.append($('').addClass(settings.prev_class)); 54 | container.append($('').addClass(settings.next_class)); 55 | } 56 | 57 | if (settings.timer) { 58 | timer_container = $('
    ').addClass(settings.timer_container_class); 59 | timer_container.append(''); 60 | timer_container.append($('
    ').addClass(settings.timer_progress_class)); 61 | timer_container.addClass(settings.timer_paused_class); 62 | container.append(timer_container); 63 | } 64 | 65 | if (settings.slide_number) { 66 | number_container = $('
    ').addClass(settings.slide_number_class); 67 | number_container.append(' ' + settings.slide_number_text + ' '); 68 | container.append(number_container); 69 | } 70 | 71 | if (settings.bullets) { 72 | bullets_container = $('
      ').addClass(settings.bullets_container_class); 73 | container.append(bullets_container); 74 | bullets_container.wrap('
      '); 75 | self.slides().each(function(idx, el) { 76 | var bullet = $('
    1. ').attr('data-orbit-slide', idx); 77 | bullets_container.append(bullet); 78 | }); 79 | } 80 | 81 | if (settings.stack_on_small) { 82 | container.addClass(settings.stack_on_small_class); 83 | } 84 | }; 85 | 86 | self._prepare_direction = function(next_idx, current_direction) { 87 | var dir = 'next'; 88 | if (next_idx <= idx) { dir = 'prev'; } 89 | 90 | if (settings.animation === 'slide') { 91 | setTimeout(function(){ 92 | slides_container.removeClass("swipe-prev swipe-next"); 93 | if (dir === 'next') {slides_container.addClass("swipe-next");} 94 | else if (dir === 'prev') {slides_container.addClass("swipe-prev");} 95 | },0); 96 | } 97 | 98 | var slides = self.slides(); 99 | if (next_idx >= slides.length) { 100 | if (!settings.circular) return false; 101 | next_idx = 0; 102 | } else if (next_idx < 0) { 103 | if (!settings.circular) return false; 104 | next_idx = slides.length - 1; 105 | } 106 | var current = $(slides.get(idx)) 107 | , next = $(slides.get(next_idx)); 108 | 109 | 110 | return [dir, current, next, next_idx]; 111 | }; 112 | 113 | self._goto = function(next_idx, start_timer) { 114 | if (next_idx === null) {return false;} 115 | if (self.cache.animating) {return false;} 116 | if (next_idx === idx) {return false;} 117 | if (typeof self.cache.timer === 'object') {self.cache.timer.restart();} 118 | 119 | var slides = self.slides(); 120 | self.cache.animating = true; 121 | var res = self._prepare_direction(next_idx) 122 | , dir = res[0] 123 | , current = res[1] 124 | , next = res[2] 125 | , next_idx = res[3]; 126 | 127 | slides_container.trigger('before-slide-change.fndtn.orbit'); 128 | settings.before_slide_change(); 129 | idx = next_idx; 130 | 131 | current.css("transitionDuration", settings.animation_speed+"ms"); 132 | next.css("transitionDuration", settings.animation_speed+"ms"); 133 | 134 | var callback = function() { 135 | var unlock = function() { 136 | if (start_timer === true) {self.cache.timer.restart();} 137 | self.update_slide_number(idx); 138 | next.addClass(settings.active_slide_class); 139 | self.update_active_link(next_idx); 140 | slides_container.trigger('after-slide-change.fndtn.orbit',[{slide_number: idx, total_slides: slides.length}]); 141 | settings.after_slide_change(idx, slides.length); 142 | setTimeout(function(){ 143 | self.cache.animating = false; 144 | }, 100); 145 | 146 | }; 147 | if (slides_container.height() != next.height() && settings.variable_height) { 148 | slides_container.animate({'height': next.height()}, 250, 'linear', unlock); 149 | } else { 150 | unlock(); 151 | } 152 | }; 153 | 154 | if (slides.length === 1) {callback(); return false;} 155 | 156 | var start_animation = function() { 157 | if (dir === 'next') {animate.next(current, next, callback);} 158 | if (dir === 'prev') {animate.prev(current, next, callback);} 159 | }; 160 | 161 | if (next.height() > slides_container.height() && settings.variable_height) { 162 | slides_container.animate({'height': next.height()}, 250, 'linear', start_animation); 163 | } else { 164 | start_animation(); 165 | } 166 | }; 167 | 168 | self.next = function(e) { 169 | e.stopImmediatePropagation(); 170 | e.preventDefault(); 171 | self._prepare_direction(idx + 1); 172 | setTimeout(function(){ 173 | self._goto(idx + 1); 174 | }, 100); 175 | }; 176 | 177 | self.prev = function(e) { 178 | e.stopImmediatePropagation(); 179 | e.preventDefault(); 180 | self._prepare_direction(idx - 1); 181 | setTimeout(function(){ 182 | self._goto(idx - 1) 183 | }, 100); 184 | }; 185 | 186 | self.link_custom = function(e) { 187 | e.preventDefault(); 188 | var link = $(this).attr('data-orbit-link'); 189 | if ((typeof link === 'string') && (link = $.trim(link)) != "") { 190 | var slide = container.find('[data-orbit-slide='+link+']'); 191 | if (slide.index() != -1) { 192 | setTimeout(function(){ 193 | self._goto(slide.index()); 194 | },100); 195 | } 196 | } 197 | }; 198 | 199 | self.link_bullet = function(e) { 200 | var index = $(this).attr('data-orbit-slide'); 201 | if ((typeof index === 'string') && (index = $.trim(index)) != "") { 202 | if(isNaN(parseInt(index))) 203 | { 204 | var slide = container.find('[data-orbit-slide='+index+']'); 205 | if (slide.index() != -1) { 206 | setTimeout(function(){ 207 | self._goto(slide.index() + 1); 208 | },100); 209 | } 210 | } 211 | else 212 | { 213 | setTimeout(function(){ 214 | self._goto(parseInt(index)); 215 | },100); 216 | } 217 | } 218 | 219 | } 220 | 221 | self.timer_callback = function() { 222 | self._goto(idx + 1, true); 223 | } 224 | 225 | self.compute_dimensions = function() { 226 | var current = $(self.slides().get(idx)); 227 | var h = current.height(); 228 | if (!settings.variable_height) { 229 | self.slides().each(function(){ 230 | if ($(this).height() > h) { h = $(this).height(); } 231 | }); 232 | } 233 | slides_container.height(h); 234 | }; 235 | 236 | self.create_timer = function() { 237 | var t = new Timer( 238 | container.find('.'+settings.timer_container_class), 239 | settings, 240 | self.timer_callback 241 | ); 242 | return t; 243 | }; 244 | 245 | self.stop_timer = function() { 246 | if (typeof self.cache.timer === 'object') self.cache.timer.stop(); 247 | }; 248 | 249 | self.toggle_timer = function() { 250 | var t = container.find('.'+settings.timer_container_class); 251 | if (t.hasClass(settings.timer_paused_class)) { 252 | if (typeof self.cache.timer === 'undefined') {self.cache.timer = self.create_timer();} 253 | self.cache.timer.start(); 254 | } 255 | else { 256 | if (typeof self.cache.timer === 'object') {self.cache.timer.stop();} 257 | } 258 | }; 259 | 260 | self.init = function() { 261 | self.build_markup(); 262 | if (settings.timer) { 263 | self.cache.timer = self.create_timer(); 264 | Foundation.utils.image_loaded(this.slides().children('img'), self.cache.timer.start); 265 | } 266 | // animate = new FadeAnimation(settings, slides_container); 267 | // if (settings.animation === 'slide') 268 | // animate = new SlideAnimation(settings, slides_container); 269 | if(settings.animation === 'fade') {slides_container.addClass('fade');} 270 | animate = new CSSAnimation(settings, slides_container); 271 | container.on('click', '.'+settings.next_class, self.next); 272 | container.on('click', '.'+settings.prev_class, self.prev); 273 | 274 | container.on('click', '[data-orbit-slide]', self.link_bullet); 275 | container.on('click', self.toggle_timer); 276 | if (settings.swipe) { 277 | slides_container.on('touchstart.fndtn.orbit',function(e) { 278 | if (self.cache.animating) {return;} 279 | if (!e.touches) {e = e.originalEvent;} 280 | 281 | self.cache.start_page_x = e.touches[0].pageX; 282 | self.cache.start_page_y = e.touches[0].pageY; 283 | self.cache.start_time = (new Date()).getTime(); 284 | self.cache.delta_x = 0; 285 | self.cache.is_scrolling = null; 286 | self.cache.direction = null; 287 | 288 | self.stop_timer(); // does not appear to prevent callback from occurring 289 | }) 290 | .on('touchmove.fndtn.orbit',function(e) { 291 | if (Math.abs(self.cache.delta_x) > 5) { 292 | e.preventDefault(); 293 | e.stopPropagation(); 294 | } 295 | 296 | if (self.cache.animating) {return;} 297 | requestAnimationFrame(function(){ 298 | if (!e.touches) { e = e.originalEvent; } 299 | 300 | // Ignore pinch/zoom events 301 | if(e.touches.length > 1 || e.scale && e.scale !== 1) return; 302 | 303 | self.cache.delta_x = e.touches[0].pageX - self.cache.start_page_x; 304 | 305 | if (self.cache.is_scrolling === null) { 306 | self.cache.is_scrolling = !!( self.cache.is_scrolling || Math.abs(self.cache.delta_x) < Math.abs(e.touches[0].pageY - self.cache.start_page_y) ); 307 | } 308 | 309 | if (self.cache.is_scrolling) { 310 | return; 311 | } 312 | 313 | var direction = (self.cache.delta_x < 0) ? (idx+1) : (idx-1); 314 | if (self.cache.direction !== direction) { 315 | var res = self._prepare_direction(direction); 316 | self.cache.direction = direction; 317 | self.cache.dir = res[0]; 318 | self.cache.current = res[1]; 319 | self.cache.next = res[2]; 320 | } 321 | 322 | if (settings.animation === 'slide') { 323 | var offset, next_offset; 324 | 325 | offset = (self.cache.delta_x / container.width()) * 100; 326 | if (offset >= 0) {next_offset = -(100 - offset);} 327 | else {next_offset = 100 + offset;} 328 | 329 | self.cache.current.css("transform","translate3d("+offset+"%,0,0)"); 330 | self.cache.next.css("transform","translate3d("+next_offset+"%,0,0)"); 331 | } 332 | }); 333 | }) 334 | .on('touchend.fndtn.orbit', function(e) { 335 | if (self.cache.animating) {return;} 336 | e.preventDefault(); 337 | e.stopPropagation(); 338 | setTimeout(function(){ 339 | self._goto(self.cache.direction); 340 | }, 50); 341 | }); 342 | } 343 | container.on('mouseenter.fndtn.orbit', function(e) { 344 | if (settings.timer && settings.pause_on_hover) { 345 | self.stop_timer(); 346 | } 347 | }) 348 | .on('mouseleave.fndtn.orbit', function(e) { 349 | if (settings.timer && settings.resume_on_mouseout) { 350 | self.cache.timer.start(); 351 | } 352 | }); 353 | 354 | $(document).on('click', '[data-orbit-link]', self.link_custom); 355 | $(window).on('resize', self.compute_dimensions); 356 | Foundation.utils.image_loaded(this.slides().children('img'), self.compute_dimensions); 357 | Foundation.utils.image_loaded(this.slides().children('img'), function() { 358 | container.prev('.preloader').css('display', 'none'); 359 | self.update_slide_number(0); 360 | self.update_active_link(0); 361 | slides_container.trigger('ready.fndtn.orbit'); 362 | }); 363 | }; 364 | 365 | self.init(); 366 | }; 367 | 368 | var Timer = function(el, settings, callback) { 369 | var self = this, 370 | duration = settings.timer_speed, 371 | progress = el.find('.'+settings.timer_progress_class), 372 | start, 373 | timeout, 374 | left = -1; 375 | 376 | this.update_progress = function(w) { 377 | var new_progress = progress.clone(); 378 | new_progress.attr('style', ''); 379 | new_progress.css('width', w+'%'); 380 | progress.replaceWith(new_progress); 381 | progress = new_progress; 382 | }; 383 | 384 | this.restart = function() { 385 | clearTimeout(timeout); 386 | el.addClass(settings.timer_paused_class); 387 | left = -1; 388 | self.update_progress(0); 389 | self.start(); 390 | }; 391 | 392 | this.start = function() { 393 | if (!el.hasClass(settings.timer_paused_class)) {return true;} 394 | left = (left === -1) ? duration : left; 395 | el.removeClass(settings.timer_paused_class); 396 | start = new Date().getTime(); 397 | progress.animate({'width': '100%'}, left, 'linear'); 398 | timeout = setTimeout(function() { 399 | self.restart(); 400 | callback(); 401 | }, left); 402 | el.trigger('timer-started.fndtn.orbit') 403 | }; 404 | 405 | this.stop = function() { 406 | if (el.hasClass(settings.timer_paused_class)) {return true;} 407 | clearTimeout(timeout); 408 | el.addClass(settings.timer_paused_class); 409 | var end = new Date().getTime(); 410 | left = left - (end - start); 411 | var w = 100 - ((left / duration) * 100); 412 | self.update_progress(w); 413 | el.trigger('timer-stopped.fndtn.orbit'); 414 | }; 415 | }; 416 | 417 | var CSSAnimation = function(settings, container) { 418 | var animation_end = "webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend"; 419 | 420 | this.next = function(current, next, callback) { 421 | next.on(animation_end, function(e){ 422 | next.unbind(animation_end); 423 | current.removeClass("active animate-out"); 424 | next.removeClass("animate-in"); 425 | callback(); 426 | }); 427 | container.children().css({ 428 | "transform":"", 429 | "transitionDuration":"" 430 | }); 431 | current.addClass("animate-out"); 432 | next.addClass("animate-in"); 433 | }; 434 | 435 | this.prev = function(current, prev, callback) { 436 | prev.on(animation_end, function(e){ 437 | prev.unbind(animation_end); 438 | current.removeClass("active animate-out"); 439 | prev.removeClass("animate-in"); 440 | callback(); 441 | }); 442 | current.css({"transform":"", "transitionDuration":""}).addClass("animate-out"); 443 | prev.css({"transform":"", "transitionDuration":""}).addClass("animate-in"); 444 | }; 445 | }; 446 | 447 | 448 | Foundation.libs = Foundation.libs || {}; 449 | 450 | Foundation.libs.orbit = { 451 | name: 'orbit', 452 | 453 | version: '5.2.1', 454 | 455 | settings: { 456 | animation: 'slide', 457 | timer_speed: 10000, 458 | pause_on_hover: true, 459 | resume_on_mouseout: false, 460 | animation_speed: 500, 461 | stack_on_small: false, 462 | navigation_arrows: true, 463 | slide_number: true, 464 | slide_number_text: 'of', 465 | container_class: 'orbit-container', 466 | stack_on_small_class: 'orbit-stack-on-small', 467 | next_class: 'orbit-next', 468 | prev_class: 'orbit-prev', 469 | timer_container_class: 'orbit-timer', 470 | timer_paused_class: 'paused', 471 | timer_progress_class: 'orbit-progress', 472 | slides_container_class: 'orbit-slides-container', 473 | slide_selector: '*', 474 | bullets_container_class: 'orbit-bullets', 475 | bullets_active_class: 'active', 476 | slide_number_class: 'orbit-slide-number', 477 | caption_class: 'orbit-caption', 478 | active_slide_class: 'active', 479 | orbit_transition_class: 'orbit-transitioning', 480 | bullets: true, 481 | circular: true, 482 | timer: true, 483 | variable_height: false, 484 | swipe: true, 485 | before_slide_change: noop, 486 | after_slide_change: noop 487 | }, 488 | 489 | init : function (scope, method, options) { 490 | var self = this; 491 | this.bindings(method, options); 492 | }, 493 | 494 | events : function (instance) { 495 | var orbit_instance = new Orbit(this.S(instance), this.S(instance).data('orbit-init')); 496 | this.S(instance).data(self.name + '-instance', orbit_instance); 497 | }, 498 | 499 | reflow : function () { 500 | var self = this; 501 | 502 | if (self.S(self.scope).is('[data-orbit]')) { 503 | var $el = self.S(self.scope); 504 | var instance = $el.data(self.name + '-instance'); 505 | instance.compute_dimensions(); 506 | } else { 507 | self.S('[data-orbit]', self.scope).each(function(idx, el) { 508 | var $el = self.S(el); 509 | var opts = self.data_options($el); 510 | var instance = $el.data(self.name + '-instance'); 511 | instance.compute_dimensions(); 512 | }); 513 | } 514 | } 515 | }; 516 | 517 | 518 | }(jQuery, this, this.document)); 519 | -------------------------------------------------------------------------------- /static/content_submit/js/foundation/foundation.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Foundation Responsive Library 3 | * http://foundation.zurb.com 4 | * Copyright 2014, ZURB 5 | * Free to use under the MIT license. 6 | * http://www.opensource.org/licenses/mit-license.php 7 | */ 8 | 9 | (function ($, window, document, undefined) { 10 | 'use strict'; 11 | 12 | var header_helpers = function (class_array) { 13 | var i = class_array.length; 14 | var head = $('head'); 15 | 16 | while (i--) { 17 | if($('head').has('.' + class_array[i]).length === 0) { 18 | $('head').append(''); 19 | } 20 | } 21 | }; 22 | 23 | header_helpers([ 24 | 'foundation-mq-small', 25 | 'foundation-mq-medium', 26 | 'foundation-mq-large', 27 | 'foundation-mq-xlarge', 28 | 'foundation-mq-xxlarge', 29 | 'foundation-data-attribute-namespace']); 30 | 31 | // Enable FastClick if present 32 | 33 | $(function() { 34 | if (typeof FastClick !== 'undefined') { 35 | // Don't attach to body if undefined 36 | if (typeof document.body !== 'undefined') { 37 | FastClick.attach(document.body); 38 | } 39 | } 40 | }); 41 | 42 | // private Fast Selector wrapper, 43 | // returns jQuery object. Only use where 44 | // getElementById is not available. 45 | var S = function (selector, context) { 46 | if (typeof selector === 'string') { 47 | if (context) { 48 | var cont; 49 | if (context.jquery) { 50 | cont = context[0]; 51 | if (!cont) return context; 52 | } else { 53 | cont = context; 54 | } 55 | return $(cont.querySelectorAll(selector)); 56 | } 57 | 58 | return $(document.querySelectorAll(selector)); 59 | } 60 | 61 | return $(selector, context); 62 | }; 63 | 64 | // Namespace functions. 65 | 66 | var attr_name = function (init) { 67 | var arr = []; 68 | if (!init) arr.push('data'); 69 | if (this.namespace.length > 0) arr.push(this.namespace); 70 | arr.push(this.name); 71 | 72 | return arr.join('-'); 73 | }; 74 | 75 | var add_namespace = function (str) { 76 | var parts = str.split('-'), 77 | i = parts.length, 78 | arr = []; 79 | 80 | while (i--) { 81 | if (i !== 0) { 82 | arr.push(parts[i]); 83 | } else { 84 | if (this.namespace.length > 0) { 85 | arr.push(this.namespace, parts[i]); 86 | } else { 87 | arr.push(parts[i]); 88 | } 89 | } 90 | } 91 | 92 | return arr.reverse().join('-'); 93 | }; 94 | 95 | // Event binding and data-options updating. 96 | 97 | var bindings = function (method, options) { 98 | var self = this, 99 | should_bind_events = !S(this).data(this.attr_name(true)); 100 | 101 | if (typeof method === 'string') { 102 | return this[method].call(this, options); 103 | } 104 | 105 | if (S(this.scope).is('[' + this.attr_name() +']')) { 106 | S(this.scope).data(this.attr_name(true) + '-init', $.extend({}, this.settings, (options || method), this.data_options(S(this.scope)))); 107 | 108 | if (should_bind_events) { 109 | this.events(this.scope); 110 | } 111 | 112 | } else { 113 | S('[' + this.attr_name() +']', this.scope).each(function () { 114 | var should_bind_events = !S(this).data(self.attr_name(true) + '-init'); 115 | S(this).data(self.attr_name(true) + '-init', $.extend({}, self.settings, (options || method), self.data_options(S(this)))); 116 | 117 | if (should_bind_events) { 118 | self.events(this); 119 | } 120 | }); 121 | } 122 | }; 123 | 124 | var single_image_loaded = function (image, callback) { 125 | function loaded () { 126 | callback(image[0]); 127 | } 128 | 129 | function bindLoad () { 130 | this.one('load', loaded); 131 | 132 | if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { 133 | var src = this.attr( 'src' ), 134 | param = src.match( /\?/ ) ? '&' : '?'; 135 | 136 | param += 'random=' + (new Date()).getTime(); 137 | this.attr('src', src + param); 138 | } 139 | } 140 | 141 | if (!image.attr('src')) { 142 | loaded(); 143 | return; 144 | } 145 | 146 | if (image[0].complete || image[0].readyState === 4) { 147 | loaded(); 148 | } else { 149 | bindLoad.call(image); 150 | } 151 | }; 152 | 153 | /* 154 | https://github.com/paulirish/matchMedia.js 155 | */ 156 | 157 | window.matchMedia = window.matchMedia || (function( doc, undefined ) { 158 | 159 | "use strict"; 160 | 161 | var bool, 162 | docElem = doc.documentElement, 163 | refNode = docElem.firstElementChild || docElem.firstChild, 164 | // fakeBody required for 165 | fakeBody = doc.createElement( "body" ), 166 | div = doc.createElement( "div" ); 167 | 168 | div.id = "mq-test-1"; 169 | div.style.cssText = "position:absolute;top:-100em"; 170 | fakeBody.style.background = "none"; 171 | fakeBody.appendChild(div); 172 | 173 | return function (q) { 174 | 175 | div.innerHTML = "­"; 176 | 177 | docElem.insertBefore( fakeBody, refNode ); 178 | bool = div.offsetWidth === 42; 179 | docElem.removeChild( fakeBody ); 180 | 181 | return { 182 | matches: bool, 183 | media: q 184 | }; 185 | 186 | }; 187 | 188 | }( document )); 189 | 190 | /* 191 | * jquery.requestAnimationFrame 192 | * https://github.com/gnarf37/jquery-requestAnimationFrame 193 | * Requires jQuery 1.8+ 194 | * 195 | * Copyright (c) 2012 Corey Frang 196 | * Licensed under the MIT license. 197 | */ 198 | 199 | (function($) { 200 | 201 | // requestAnimationFrame polyfill adapted from Erik Möller 202 | // fixes from Paul Irish and Tino Zijdel 203 | // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ 204 | // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating 205 | 206 | var animating, 207 | lastTime = 0, 208 | vendors = ['webkit', 'moz'], 209 | requestAnimationFrame = window.requestAnimationFrame, 210 | cancelAnimationFrame = window.cancelAnimationFrame, 211 | jqueryFxAvailable = 'undefined' !== typeof jQuery.fx; 212 | 213 | for (; lastTime < vendors.length && !requestAnimationFrame; lastTime++) { 214 | requestAnimationFrame = window[ vendors[lastTime] + "RequestAnimationFrame" ]; 215 | cancelAnimationFrame = cancelAnimationFrame || 216 | window[ vendors[lastTime] + "CancelAnimationFrame" ] || 217 | window[ vendors[lastTime] + "CancelRequestAnimationFrame" ]; 218 | } 219 | 220 | function raf() { 221 | if (animating) { 222 | requestAnimationFrame(raf); 223 | 224 | if (jqueryFxAvailable) { 225 | jQuery.fx.tick(); 226 | } 227 | } 228 | } 229 | 230 | if (requestAnimationFrame) { 231 | // use rAF 232 | window.requestAnimationFrame = requestAnimationFrame; 233 | window.cancelAnimationFrame = cancelAnimationFrame; 234 | 235 | if (jqueryFxAvailable) { 236 | jQuery.fx.timer = function (timer) { 237 | if (timer() && jQuery.timers.push(timer) && !animating) { 238 | animating = true; 239 | raf(); 240 | } 241 | }; 242 | 243 | jQuery.fx.stop = function () { 244 | animating = false; 245 | }; 246 | } 247 | } else { 248 | // polyfill 249 | window.requestAnimationFrame = function (callback, element) { 250 | var currTime = new Date().getTime(), 251 | timeToCall = Math.max(0, 16 - (currTime - lastTime)), 252 | id = window.setTimeout(function () { 253 | callback(currTime + timeToCall); 254 | }, timeToCall); 255 | lastTime = currTime + timeToCall; 256 | return id; 257 | }; 258 | 259 | window.cancelAnimationFrame = function (id) { 260 | clearTimeout(id); 261 | }; 262 | 263 | } 264 | 265 | }( jQuery )); 266 | 267 | 268 | function removeQuotes (string) { 269 | if (typeof string === 'string' || string instanceof String) { 270 | string = string.replace(/^['\\/"]+|(;\s?})+|['\\/"]+$/g, ''); 271 | } 272 | 273 | return string; 274 | } 275 | 276 | window.Foundation = { 277 | name : 'Foundation', 278 | 279 | version : '5.2.1', 280 | 281 | media_queries : { 282 | small : S('.foundation-mq-small').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''), 283 | medium : S('.foundation-mq-medium').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''), 284 | large : S('.foundation-mq-large').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''), 285 | xlarge: S('.foundation-mq-xlarge').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''), 286 | xxlarge: S('.foundation-mq-xxlarge').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, '') 287 | }, 288 | 289 | stylesheet : $('').appendTo('head')[0].sheet, 290 | 291 | global: { 292 | namespace: '' 293 | }, 294 | 295 | init : function (scope, libraries, method, options, response) { 296 | var library_arr, 297 | args = [scope, method, options, response], 298 | responses = []; 299 | 300 | // check RTL 301 | this.rtl = /rtl/i.test(S('html').attr('dir')); 302 | 303 | // set foundation global scope 304 | this.scope = scope || this.scope; 305 | 306 | this.set_namespace(); 307 | 308 | if (libraries && typeof libraries === 'string' && !/reflow/i.test(libraries)) { 309 | if (this.libs.hasOwnProperty(libraries)) { 310 | responses.push(this.init_lib(libraries, args)); 311 | } 312 | } else { 313 | for (var lib in this.libs) { 314 | responses.push(this.init_lib(lib, libraries)); 315 | } 316 | } 317 | 318 | return scope; 319 | }, 320 | 321 | init_lib : function (lib, args) { 322 | if (this.libs.hasOwnProperty(lib)) { 323 | this.patch(this.libs[lib]); 324 | 325 | if (args && args.hasOwnProperty(lib)) { 326 | if (typeof this.libs[lib].settings !== 'undefined') { 327 | $.extend(true, this.libs[lib].settings, args[lib]); 328 | } 329 | else if (typeof this.libs[lib].defaults !== 'undefined') { 330 | $.extend(true, this.libs[lib].defaults, args[lib]); 331 | } 332 | return this.libs[lib].init.apply(this.libs[lib], [this.scope, args[lib]]); 333 | } 334 | 335 | args = args instanceof Array ? args : Array(args); // PATCH: added this line 336 | return this.libs[lib].init.apply(this.libs[lib], args); 337 | } 338 | 339 | return function () {}; 340 | }, 341 | 342 | patch : function (lib) { 343 | lib.scope = this.scope; 344 | lib.namespace = this.global.namespace; 345 | lib.rtl = this.rtl; 346 | lib['data_options'] = this.utils.data_options; 347 | lib['attr_name'] = attr_name; 348 | lib['add_namespace'] = add_namespace; 349 | lib['bindings'] = bindings; 350 | lib['S'] = this.utils.S; 351 | }, 352 | 353 | inherit : function (scope, methods) { 354 | var methods_arr = methods.split(' '), 355 | i = methods_arr.length; 356 | 357 | while (i--) { 358 | if (this.utils.hasOwnProperty(methods_arr[i])) { 359 | scope[methods_arr[i]] = this.utils[methods_arr[i]]; 360 | } 361 | } 362 | }, 363 | 364 | set_namespace: function () { 365 | 366 | // Don't bother reading the namespace out of the meta tag 367 | // if the namespace has been set globally in javascript 368 | // 369 | // Example: something like Foundation.global.namespace = 'my-namespace'; 370 | // 371 | // Otherwise, if the namespace hasn't been set globally, 372 | // read it out of the meta tag 373 | // 374 | var namespace = this.global.namespace || $('.foundation-data-attribute-namespace').css('font-family'); 375 | 376 | if (/false/i.test(namespace)) return; 377 | 378 | this.global.namespace = namespace; 379 | }, 380 | 381 | libs : {}, 382 | 383 | // methods that can be inherited in libraries 384 | utils : { 385 | 386 | // Description: 387 | // Fast Selector wrapper returns jQuery object. Only use where getElementById 388 | // is not available. 389 | // 390 | // Arguments: 391 | // Selector (String): CSS selector describing the element(s) to be 392 | // returned as a jQuery object. 393 | // 394 | // Scope (String): CSS selector describing the area to be searched. Default 395 | // is document. 396 | // 397 | // Returns: 398 | // Element (jQuery Object): jQuery object containing elements matching the 399 | // selector within the scope. 400 | S : S, 401 | 402 | // Description: 403 | // Executes a function a max of once every n milliseconds 404 | // 405 | // Arguments: 406 | // Func (Function): Function to be throttled. 407 | // 408 | // Delay (Integer): Function execution threshold in milliseconds. 409 | // 410 | // Returns: 411 | // Lazy_function (Function): Function with throttling applied. 412 | throttle : function (func, delay) { 413 | var timer = null; 414 | 415 | return function () { 416 | var context = this, args = arguments; 417 | 418 | clearTimeout(timer); 419 | timer = setTimeout(function () { 420 | func.apply(context, args); 421 | }, delay); 422 | }; 423 | }, 424 | 425 | // Description: 426 | // Executes a function when it stops being invoked for n seconds 427 | // Modified version of _.debounce() http://underscorejs.org 428 | // 429 | // Arguments: 430 | // Func (Function): Function to be debounced. 431 | // 432 | // Delay (Integer): Function execution threshold in milliseconds. 433 | // 434 | // Immediate (Bool): Whether the function should be called at the beginning 435 | // of the delay instead of the end. Default is false. 436 | // 437 | // Returns: 438 | // Lazy_function (Function): Function with debouncing applied. 439 | debounce : function (func, delay, immediate) { 440 | var timeout, result; 441 | return function () { 442 | var context = this, args = arguments; 443 | var later = function () { 444 | timeout = null; 445 | if (!immediate) result = func.apply(context, args); 446 | }; 447 | var callNow = immediate && !timeout; 448 | clearTimeout(timeout); 449 | timeout = setTimeout(later, delay); 450 | if (callNow) result = func.apply(context, args); 451 | return result; 452 | }; 453 | }, 454 | 455 | // Description: 456 | // Parses data-options attribute 457 | // 458 | // Arguments: 459 | // El (jQuery Object): Element to be parsed. 460 | // 461 | // Returns: 462 | // Options (Javascript Object): Contents of the element's data-options 463 | // attribute. 464 | data_options : function (el) { 465 | var opts = {}, ii, p, opts_arr, 466 | data_options = function (el) { 467 | var namespace = Foundation.global.namespace; 468 | 469 | if (namespace.length > 0) { 470 | return el.data(namespace + '-options'); 471 | } 472 | 473 | return el.data('options'); 474 | }; 475 | 476 | var cached_options = data_options(el); 477 | 478 | if (typeof cached_options === 'object') { 479 | return cached_options; 480 | } 481 | 482 | opts_arr = (cached_options || ':').split(';'), 483 | ii = opts_arr.length; 484 | 485 | function isNumber (o) { 486 | return ! isNaN (o-0) && o !== null && o !== "" && o !== false && o !== true; 487 | } 488 | 489 | function trim (str) { 490 | if (typeof str === 'string') return $.trim(str); 491 | return str; 492 | } 493 | 494 | while (ii--) { 495 | p = opts_arr[ii].split(':'); 496 | 497 | if (/true/i.test(p[1])) p[1] = true; 498 | if (/false/i.test(p[1])) p[1] = false; 499 | if (isNumber(p[1])) { 500 | if (p[1].indexOf('.') === -1) { 501 | p[1] = parseInt(p[1], 10); 502 | } else { 503 | p[1] = parseFloat(p[1], 10); 504 | } 505 | } 506 | 507 | if (p.length === 2 && p[0].length > 0) { 508 | opts[trim(p[0])] = trim(p[1]); 509 | } 510 | } 511 | 512 | return opts; 513 | }, 514 | 515 | // Description: 516 | // Adds JS-recognizable media queries 517 | // 518 | // Arguments: 519 | // Media (String): Key string for the media query to be stored as in 520 | // Foundation.media_queries 521 | // 522 | // Class (String): Class name for the generated tag 523 | register_media : function (media, media_class) { 524 | if(Foundation.media_queries[media] === undefined) { 525 | $('head').append(''); 526 | Foundation.media_queries[media] = removeQuotes($('.' + media_class).css('font-family')); 527 | } 528 | }, 529 | 530 | // Description: 531 | // Add custom CSS within a JS-defined media query 532 | // 533 | // Arguments: 534 | // Rule (String): CSS rule to be appended to the document. 535 | // 536 | // Media (String): Optional media query string for the CSS rule to be 537 | // nested under. 538 | add_custom_rule : function (rule, media) { 539 | if (media === undefined) { 540 | Foundation.stylesheet.insertRule(rule, Foundation.stylesheet.cssRules.length); 541 | } else { 542 | var query = Foundation.media_queries[media]; 543 | 544 | if (query !== undefined) { 545 | Foundation.stylesheet.insertRule('@media ' + 546 | Foundation.media_queries[media] + '{ ' + rule + ' }'); 547 | } 548 | } 549 | }, 550 | 551 | // Description: 552 | // Performs a callback function when an image is fully loaded 553 | // 554 | // Arguments: 555 | // Image (jQuery Object): Image(s) to check if loaded. 556 | // 557 | // Callback (Function): Fundation to execute when image is fully loaded. 558 | image_loaded : function (images, callback) { 559 | var self = this, 560 | unloaded = images.length; 561 | 562 | if (unloaded === 0) { 563 | callback(images); 564 | } 565 | 566 | images.each(function () { 567 | single_image_loaded(self.S(this), function () { 568 | unloaded -= 1; 569 | if (unloaded === 0) { 570 | callback(images); 571 | } 572 | }); 573 | }); 574 | }, 575 | 576 | // Description: 577 | // Returns a random, alphanumeric string 578 | // 579 | // Arguments: 580 | // Length (Integer): Length of string to be generated. Defaults to random 581 | // integer. 582 | // 583 | // Returns: 584 | // Rand (String): Pseudo-random, alphanumeric string. 585 | random_str : function () { 586 | if (!this.fidx) this.fidx = 0; 587 | this.prefix = this.prefix || [(this.name || 'F'), (+new Date).toString(36)].join('-'); 588 | 589 | return this.prefix + (this.fidx++).toString(36); 590 | } 591 | } 592 | }; 593 | 594 | $.fn.foundation = function () { 595 | var args = Array.prototype.slice.call(arguments, 0); 596 | 597 | return this.each(function () { 598 | Foundation.init.apply(Foundation, [this].concat(args)); 599 | return this; 600 | }); 601 | }; 602 | 603 | }(jQuery, this, this.document)); 604 | --------------------------------------------------------------------------------