Skip to content

Instantly share code, notes, and snippets.

@13twelve
13twelve / application.js
Created March 12, 2015 18:44
Keeping track of current media query
charlierose.onReady = function(){
// sort out which media query we're using
charlierose.media_query_in_use = charlierose.Helpers.get_media_query_in_use();
// init behaviors
charlierose.LoadBehavior();
// on resize, check
var resize_timer;
window.on('resize', function(event){
clearTimeout(resize_timer);
resize_timer = setTimeout(function(){
@13twelve
13twelve / lightbox.js
Created March 12, 2015 14:47
CR Lightbox
charlierose.Helpers.lightbox = function() {
if ($("#charlierose_lb").length != 0) {
return false;
}
var lightbox_html = '<div id="mask"></div><div id="lightbox" style="display:none;"><iframe src="{{url}}" sandbox="allow-forms allow-same-origin allow-scripts allow-top-navigation allow-popups"></iframe></div>';
var active_class = "lightbox-active";
var lightbox_active = false;
timezones.locations = [
{ name: "San Francisco", lat: 37.775, long: -122.4183333, timezone: "America/Los_Angeles" },
{ name: "Memphis", lat: 35.6331, long: -88.8208, timezone: "America/Chicago" },
{ name: "New York", lat: 40.7141667, long: -74.0063889, timezone: "America/New_York" },
{ name: "Tucumán", lat: -26.8166667, long: -65.2166667, timezone: "America/Argentina/Tucuman" },
{ name: "London", lat: 51.5, long: -0.116667, timezone: "Europe/London" },
{ name: "Paris", lat: 48.866667, long: 2.333333, timezone: "Europe/Paris" }
];