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
App.IndexRoute = Ember.Application.extend({ | |
redirect: function(transition) { | |
this.transitionTo('movies'); | |
}.before('model') // execute before model hook | |
}); | |
App.IndexRoute = Ember.Application.extend({ | |
redirect: function(model, transition) { | |
this.transitionTo('movies', model); | |
}.after('model') // execute after model hook |
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
@Poller = | |
delay: (ms, func) -> setTimeout func, ms | |
poll: (url,time)-> | |
poller = schedulePoll(url, time) | |
$.ajax | |
url: url, | |
dataType: 'script' | |
$(document).on 'page:fetch', => | |
clearTimeout(poller) |
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.runLoadHooks = function(name, object) { | |
loaded[name] = object; | |
if (typeof window === 'object' && typeof window.dispatchEvent === 'function' && typeof CustomEvent === "function") { | |
var event = new CustomEvent(name, {detail: object, name: name}); | |
window.dispatchEvent(event); | |
} | |
if (loadHooks[name]) { | |
forEach.call(loadHooks[name], function(callback) { |
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
app.registry.add('css', { | |
toTree: function(tree, inputPath, outputPath, options) { | |
// broccoli-compass doesn't like leading slashes | |
if (inputPath[0] === '/') { inputPath = inputPath.slice(1); } | |
return compileCompass(tree, inputPath + '/app.scss', { | |
outputStyle: 'expanded', | |
require: 'sass-css-importer', // Allows us to import CSS files with @import("CSS:path") | |
sassDir: inputPath, | |
imagesDir: 'images', |
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 randomDeck(player, n) { | |
var store = player.store; | |
var deck = player.get('deck'); | |
var r, promises = []; | |
return store.findAll('card') | |
.then(function(cards){ | |
var lastIndex = cards.get('length') - 1; | |
for(var i = 0; i < n; i++) { | |
r = randomInt(lastIndex); |
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
/* global require, module */ | |
var EmberApp = require('ember-cli/lib/broccoli/ember-app'); | |
var rework = require('broccoli-rework'); | |
var reworkTree = rework('app/styles', { use: function(css) { | |
var calc = require('rework-calc'); | |
var customMedia = require('rework-custom-media'); | |
var inliner = require('rework-npm'); | |
var vars = require('rework-vars'); |
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
test("Tour next, back, and cancel builtInButtons work", function(assert) { | |
assert.expect(6); | |
visit('/').then(function() { | |
assert.equal($('body.shepherd-active').length, 1, "Body gets class of shepherd-active, when shepherd becomes active"); | |
assert.equal($('.shepherd-enabled').length, 2, "attachTo element and tour get shepherd-enabled class"); | |
assert.equal($('#shepherdOverlay').length, 1, "#shepherdOverlay exists"); | |
click('.shepherd-enabled .next-button'); | |
//$("a:contains('Next'):visible")[0].click(); | |
assert.equal($("a:contains('Back'):visible").length, 1, "Ensure that the back button appears"); | |
click('.shepherd-enabled .back-button'); |
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
import Ember from 'ember'; | |
const PositionalParams = {positionalParams: ["thing"]}; | |
export default Ember.Component.extend(PositionalParams, { | |
thing: "meow" | |
}); |
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
import Ember from 'ember'; | |
export default Ember.Helper.helper(function () { | |
return "The title"; | |
}); |
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
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
text: Ember.computed.alias('content.text') | |
}); |