This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment %} | |
This include requires you to pass in the an article excerpt | |
which contains a single image. | |
Example: {% include 'excerpt_image' with article.excerpt %} | |
{% endcomment %} | |
{% assign src = excerpt_image | split: 'src="' %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var obj = {}; | |
$('form').find('input, select, textarea').each(function() { | |
obj[this.name] = this.value; | |
}); | |
// Or create an object based on a specific group of form elements | |
var address = {}; | |
$('form').find('[name^="address"]').each(function() { | |
address[this.name.replace('address[','').replace(']','')] = this.value; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var notification = { | |
element: $('#notification'), | |
timeout: null, | |
show: function(type, message) { | |
'use strict'; | |
// reset the current timer | |
clearTimeout(this.timeout); | |
this.element |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// call a callback function every *interval* until *stopTime* or until (bool)true is | |
// returned from the callback function | |
function setIntervalTimeout(callback, interval, stopTime) { | |
var i; | |
i = setInterval(function() { | |
if(callback()) clearInterval(i); | |
}, interval); | |
setTimeout(function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011 | |
* http://benalman.com/ | |
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */ | |
(function($) { | |
var o = $({}); | |
$.subscribe = function() { | |
o.on.apply(o, arguments); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var wait = (function() { | |
var timers = {}; | |
return function(name, time) { | |
// if the current timer has not been set yet or it has previously | |
// been set but finished it's waiting period | |
if(typeof(timers[name])==='undefined' || timers[name]) { | |
timers[name] = false; | |
setTimeout(function() { timers[name] = true; }, time); | |
return true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.custom-select { | |
position: relative; | |
width: 100%; | |
} | |
.custom-select > span { | |
border-radius: 3px; | |
border: 1px solid #d3dbe2; | |
padding: 5px 15px; | |
color: #479ccf; | |
cursor: pointer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% assign some_stock = false %} | |
{% assign out_of_stock = 0 %} | |
{% for variant in product.variants %} | |
{% if variant.available == false %} | |
{% assign out_of_stock = out_of_stock | plus: 1 %} | |
{% endif %} | |
{% endfor %} | |
{% if product.variants.size != out_of_stock and out_of_stock > 0 %} | |
{% assign some_stock = true %} | |
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment %} | |
blog_handles should contain the handles of each blog you want to pull posts from | |
seperated by commas. | |
{% endcomment %} | |
{% assign blog_handles = 'blog-1,blog-2,blog-3,blog-4,blog-5' | split: ',' %} | |
{% comment %}initialise the previous_article_timestamp as the current time{% endcomment %} | |
{% assign previous_article_timestamp = 'now' | date: '%s' %} | |
{% comment %}i represents the number of featured articles that will be shown{% endcomment %} |
OlderNewer