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
// jQuery no-double-tap-zoom plugin | |
// Triple-licensed: Public Domain, MIT and WTFPL license - share and enjoy! | |
(function($) { | |
var IS_IOS = /iphone|ipad/i.test(navigator.userAgent); | |
$.fn.nodoubletapzoom = function() { | |
if (IS_IOS) | |
$(this).bind('touchstart', function preventZoom(e) { | |
var now = (new Date().getTime()), |
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
Ember.Handlebars.helper 'currency', (value) -> | |
'$' + parseFloat(value).toFixed(2)#.replace(/\d{1,3}(?=(\d{3})+(?!\d))/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
Ember.Handlebars.helper 'date', (date, format) -> | |
moment(date).format(if typeof format is 'string' then format else 'MMMM D') | |
Ember.Handlebars.helper 'from-now', (date) -> | |
moment(date).fromNow() |
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
Ember.Handlebars.helper 'or', (args...) -> | |
return arg for arg in args when !!arg |
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
Ember.Handlebars.helper 'image', (path, options) -> | |
attrs = for key, value of options.hash when typeof value is 'string' then "#{key}=\"#{value}\"" | |
attrs.unshift 'src="//example.com/assets/' + path + '"' | |
new Handlebars.SafeString '<img ' + (attrs.join ' ') + '>' |
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
// Google Tag Manager | |
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': | |
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], | |
j=d.createElement(s);j.async=true;j.src= | |
'//www.googletagmanager.com/gtm.js?id='+i;f.parentNode.insertBefore(j,f); | |
})(window,document,'script','dataLayer','GTM-ABCDEF'); | |
// End Google Tag Manager | |
App.GtmUtil = { |
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
// | |
// Set XSRF token header for POST, PUT and DELETE requests to relative URLs | |
// | |
$.ajaxSetup({ | |
beforeSend: function (xhr, settings) { | |
if (/^https?:/.test(settings.url)) return; | |
if (!/(POST|PUT|DELETE)/.test(settings.type)) return; | |
xhr.setRequestHeader('X-XSRF-TOKEN', $.cookie('XSRF-TOKEN')); | |
} | |
}); |
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
gulp.task('build-svg-icon-sprite', function () { | |
return gulp.src(conf.get('build:svg-sprite-icons:source')) | |
.pipe(svgo({ | |
full: false, | |
plugins: [ | |
{ cleanupIDs: true }, | |
{ removeUnknownsAndDefaults: false } | |
] | |
})) | |
.pipe(fc2json('svg-icon-sprite.json')) |
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
Ember.Component.reopen({ | |
actions: { | |
bubble: function (action) { | |
console.log('[Component action.bubble]', arguments); | |
var temp = this.get(action); | |
this.set(action, action); | |
this.sendAction(action); | |
this.set(action, temp); |
OlderNewer