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
#ember-testing-container { | |
position: absolute; | |
background: white; | |
bottom: 0; | |
right: 0; | |
width: 640px; | |
height: 384px; | |
overflow: auto; | |
z-index: 9999; | |
border: 1px solid #ccc; |
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
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); |
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
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 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 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 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 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 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 , '$&,') |
NewerOlder