This file contains hidden or 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
/* | |
* Ensure the http protocol is always used on the myshopify.com domains. | |
* Uses liquid to input the correct URL. | |
*/ | |
if (window.location.href.match(/https:\/\/.*.myshopify.com/) && top === self) { | |
window.location.href = window.location.href.replace(/https:\/\/.*.myshopify.com/, 'http://{{ shop.domain }}'); | |
} |
This file contains hidden or 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
// --------------------------------------------------------- | |
// POST to cart/update.js returns the cart in JSON. | |
// To clear a particular attribute, set its value to an empty string. | |
// Receives attributes as a hash or array. Look at comments below. | |
// --------------------------------------------------------- | |
Shopify.updateCartAttributes = function(attributes, callback) { | |
var data = ''; | |
// If attributes is an array of the form: | |
// [ { key: 'my key', value: 'my value' }, ... ] | |
if (jQuery.isArray(attributes)) { |
This file contains hidden or 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
function getQueryParams(qs) { | |
qs = qs.replace(/\+/g, " "); | |
var params = {}, | |
re = /[?&]?([^=]+)=([^&]*)/g, | |
tokens; | |
while (tokens = re.exec(qs)) { | |
params[decodeURIComponent(tokens[1])] | |
= decodeURIComponent(tokens[2]); | |
} |
This file contains hidden or 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
# COMPASS WATCH | |
desc "Watches and compiles sass to tomcat" | |
task :watch do | |
puts Paint["Watching sass", :cyan] | |
puts "Watching: " + SRC_SCSS | |
puts "Compile to: " + TOMCAT_SKIN + SCSS_CSS | |
puts "output-style: " + SCSS_OUTPUT | |
Dir.chdir(COMPASS) do | |
system "compass watch --sass-dir #{SRC_SCSS} --css-dir #{TOMCAT_SKIN} --output-style #{SCSS_OUTPUT}" | |
end |