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
String.prototype.imgURL = function(size) { | |
// remove any current image size then add the new image size | |
return this | |
.replace(/_(pico|icon|thumb|small|compact|medium|large|grande|original|1024x1024|2048x2048|master)+\./g, '.') | |
.replace(/\.jpg|\.png|\.gif|\.jpeg/g, function(match) { | |
return '_'+size+match; | |
}) | |
; | |
}; |
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
<picture> | |
<source media="(max-width: 480px)" srcset="{{ home_slideshow_large_image | asset_url }} 1x, {{ 'slideshow_1_1024x1024.jpg' | asset_url }} 2x"> | |
<source media="(max-width: 640px)" srcset="{{ home_slideshow_grande_image | asset_url }} 1x, {{ 'slideshow_1_1024x1024.jpg' | asset_url }} 2x"> | |
<source media="(max-width: 1024px)" srcset="{{ home_slideshow_1024_image | asset_url }} 1x, {{ 'slideshow_1.jpg' | asset_url }} 2x"> | |
<img src="{% comment %}ly_asset_replace_for_[ home_slideshow_image | asset_url ]_begin{% endcomment %}{% assign ly_asset = home_slideshow_image %}{% include 'ly-asset' with ly_asset %}{{ ly_translation }}{% comment %}ly_asset_replace_end{% endcomment %}" alt=""> | |
</picture> |
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
// one-liner version | |
// retains latin-1 supplement chars as well as latin extended-a and latin extended-b | |
Shopify.handleize = function (str) { | |
return str.toLowerCase().replace(/[^\w\u00C0-\u024f]+/g, "-").replace(/^-+|-+$/g, ""); | |
}; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<title>Bootstrap Modals only - by shlomo hassid</title> | |
<script type='text/javascript' src='//code.jquery.com/jquery-1.11.0.js'></script> | |
<style type='text/css'> | |
[role="button"] { | |
cursor: pointer; | |
} |