updating packages, some styling, background music play
This commit is contained in:
parent
0e4b684e3a
commit
c62600e8dc
20 changed files with 107 additions and 71 deletions
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
"ignore_dirs": ["tmp"]
|
"ignore_dirs": ["tmp", "dist"]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,14 @@ import Resolver from 'ember/resolver';
|
||||||
import loadInitializers from 'ember/load-initializers';
|
import loadInitializers from 'ember/load-initializers';
|
||||||
import config from './config/environment';
|
import config from './config/environment';
|
||||||
|
|
||||||
var App;
|
let App;
|
||||||
|
|
||||||
Ember.MODEL_FACTORY_INJECTIONS = true;
|
Ember.MODEL_FACTORY_INJECTIONS = true;
|
||||||
|
|
||||||
App = Ember.Application.extend({
|
App = Ember.Application.extend({
|
||||||
modulePrefix: config.modulePrefix,
|
modulePrefix: config.modulePrefix,
|
||||||
podModulePrefix: config.podModulePrefix,
|
podModulePrefix: config.podModulePrefix,
|
||||||
Resolver: Resolver
|
Resolver
|
||||||
});
|
});
|
||||||
|
|
||||||
loadInitializers(App, config.modulePrefix);
|
loadInitializers(App, config.modulePrefix);
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<title>Huegasm</title>
|
<title>Huegasm</title>
|
||||||
<meta name="description" content="Huegasm is a free web application for controlling your Philips Hue lights...oh and it's kind of awesome at syncing music with your lights.">
|
<meta name="description" content="Huegasm is a free web application for controlling your Philips Hue lights...oh and it's pretty awesome at synchronizing your music with your lights.">
|
||||||
<meta name="keywords" content="huegasm,hue,philips hue,music player">
|
<meta name="keywords" content="huegasm,hue,philips hue,music player">
|
||||||
<meta name="author" content="Egor Philippov">
|
<meta name="author" content="Egor Philippov">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
<meta name="msapplication-TileImage" content="/mstile-144x144.png">
|
<meta name="msapplication-TileImage" content="/mstile-144x144.png">
|
||||||
<meta name="theme-color" content="#ffffff">
|
<meta name="theme-color" content="#ffffff">
|
||||||
|
|
||||||
<link rel="stylesheet" integrity="" href="assets/vendor.css">
|
<link rel="stylesheet" href="assets/vendor.css">
|
||||||
<link rel="stylesheet" href="assets/huegasm.css">
|
<link rel="stylesheet" href="assets/huegasm.css">
|
||||||
|
|
||||||
{{content-for 'head-footer'}}
|
{{content-for 'head-footer'}}
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ export default Em.Component.extend({
|
||||||
position: 'left'
|
position: 'left'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
element: '#dimmerWrapper',
|
element: '#dimmer',
|
||||||
intro: 'And that\'s it...Feel free to reach out to me through the link at the bottom of the page.<br>' +
|
intro: 'And that\'s it...Feel free to reach out to me through the link at the bottom of the page.<br>' +
|
||||||
'Hope you enjoy the application. ;)<br><br>' +
|
'Hope you enjoy the application. ;)<br><br>' +
|
||||||
'<i><b>TIP</b>: click on the icon to switch to a darker theme.</i>',
|
'<i><b>TIP</b>: click on the icon to switch to a darker theme.</i>',
|
||||||
|
|
@ -138,7 +138,7 @@ export default Em.Component.extend({
|
||||||
if(beatDetectionAreaArrowIcon.hasClass('keyboard-arrow-down')){
|
if(beatDetectionAreaArrowIcon.hasClass('keyboard-arrow-down')){
|
||||||
beatDetectionAreaArrowIcon.removeClass('keyboard-arrow-down').addClass('keyboard-arrow-up');
|
beatDetectionAreaArrowIcon.removeClass('keyboard-arrow-down').addClass('keyboard-arrow-up');
|
||||||
}
|
}
|
||||||
} else if(element.id === 'dimmerWrapper'){
|
} else if(element.id === 'dimmer'){
|
||||||
Em.$(document).click();
|
Em.$(document).click();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -155,6 +155,19 @@ export default Em.Component.extend({
|
||||||
} else {
|
} else {
|
||||||
playerBottom.hide();
|
playerBottom.hide();
|
||||||
}
|
}
|
||||||
|
}, onExit = ()=>{
|
||||||
|
var dimmer = Em.$('#dimmer');
|
||||||
|
|
||||||
|
onFinish();
|
||||||
|
dimmer.popover({
|
||||||
|
trigger: 'manual',
|
||||||
|
placement: 'top',
|
||||||
|
content: 'Click on this icon to toggle the dark theme.'
|
||||||
|
}).popover('show');
|
||||||
|
|
||||||
|
setTimeout(()=>{
|
||||||
|
dimmer.popover('hide');
|
||||||
|
}, 5000);
|
||||||
};
|
};
|
||||||
|
|
||||||
// skip hidden/missing elements
|
// skip hidden/missing elements
|
||||||
|
|
@ -163,7 +176,7 @@ export default Em.Component.extend({
|
||||||
if(elem.html() === '<!---->'){
|
if(elem.html() === '<!---->'){
|
||||||
Em.$('.introjs-nextbutton').click();
|
Em.$('.introjs-nextbutton').click();
|
||||||
}
|
}
|
||||||
}).onexit(onFinish).oncomplete(onFinish).start();
|
}).onexit(onExit).oncomplete(onFinish).start();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,12 +21,12 @@ export default Em.Component.extend({
|
||||||
|
|
||||||
ready: false,
|
ready: false,
|
||||||
|
|
||||||
dimmerOnClass: function(){
|
dimmerOnClass: function () {
|
||||||
var dimmerOn = this.get('dimmerOn'),
|
var dimmerOn = this.get('dimmerOn'),
|
||||||
storage = this.get('storage'),
|
storage = this.get('storage'),
|
||||||
dimmerOnClass = null;
|
dimmerOnClass = null;
|
||||||
|
|
||||||
if(dimmerOn){
|
if (dimmerOn) {
|
||||||
Em.$('body').addClass('dimmerOn');
|
Em.$('body').addClass('dimmerOn');
|
||||||
Em.$('html').addClass('dimmerOn');
|
Em.$('html').addClass('dimmerOn');
|
||||||
dimmerOnClass = 'active';
|
dimmerOnClass = 'active';
|
||||||
|
|
@ -43,18 +43,22 @@ export default Em.Component.extend({
|
||||||
init(){
|
init(){
|
||||||
this._super();
|
this._super();
|
||||||
|
|
||||||
var storage = new window.Locally.Store({ compress: true });
|
var storage = new window.Locally.Store({compress: true});
|
||||||
this.set('storage', storage);
|
this.set('storage', storage);
|
||||||
|
|
||||||
if(!Em.isNone(storage.get('huegasm.dimmerOn'))) {
|
if (!Em.isNone(storage.get('huegasm.dimmerOn'))) {
|
||||||
this.set('dimmerOn', storage.get('huegasm.dimmerOn'));
|
this.set('dimmerOn', storage.get('huegasm.dimmerOn'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!Em.isEmpty(storage.get('huegasm.bridgeIp')) && !Em.isEmpty(storage.get('huegasm.bridgeUsername'))) {
|
if (!Em.isEmpty(storage.get('huegasm.bridgeIp')) && !Em.isEmpty(storage.get('huegasm.bridgeUsername'))) {
|
||||||
this.setProperties({
|
this.setProperties({
|
||||||
bridgeIp: storage.get('huegasm.bridgeIp'),
|
bridgeIp: storage.get('huegasm.bridgeIp'),
|
||||||
bridgeUsername: storage.get('huegasm.bridgeUsername')
|
bridgeUsername: storage.get('huegasm.bridgeUsername')
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
|
year: function () {
|
||||||
|
return new Date().getFullYear();
|
||||||
|
}.property()
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,7 @@
|
||||||
{{else}}
|
{{else}}
|
||||||
<div class="readyBlock">
|
<div class="readyBlock">
|
||||||
<div class="title"><img src="assets/images/logo.png" alt="Huegasm"></div>
|
<div class="title"><img src="assets/images/logo.png" alt="Huegasm"></div>
|
||||||
<p class="introParagraph">Huegasm is a free web application for controlling your <a href="http://www2.meethue.com/en-ca/">Philips Hue lights</a>...oh and it's kind of awesome at syncing music with your lights.</p>
|
<p class="introParagraph">Huegasm is a free web application for controlling your <a href="http://www2.meethue.com/en-ca/">Philips Hue lights</a>...oh and it's pretty awesome at synchronizing your music with your lights.</p>
|
||||||
|
|
||||||
<a href="#" {{action "isReady"}}>
|
|
||||||
<img src="assets/images/intro.jpg" id="introPic" />
|
|
||||||
</a>
|
|
||||||
|
|
||||||
{{#paper-button raised=true primary=true action="isReady" class="goButton"}}Go!{{/paper-button}}
|
{{#paper-button raised=true primary=true action="isReady" class="goButton"}}Go!{{/paper-button}}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -18,6 +14,6 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<footer id="footer">
|
<footer id="footer">
|
||||||
<p><span class="relative"><span id="dimmerWrapper" {{action "toggleDimmer"}} class={{dimmerOnClass}}>
|
<p><span class="relative"><span id="dimmer" {{action "toggleDimmer"}} class={{dimmerOnClass}}>
|
||||||
</span>Made by <a href="//egorphilippov.me">egorphilippov.me</a> © 2015 Huegasm</span></p>
|
</span>© {{year}} <a href="http://egorphilippov.me" target="_blank">Egor Philippov</a></span></p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
@ -191,7 +191,7 @@ export default Em.Component.extend(helperMixin, visualizerMixin, {
|
||||||
|
|
||||||
if(!Em.isNone(track) && !Em.isNone(track.offset())) {
|
if(!Em.isNone(track) && !Em.isNone(track.offset())) {
|
||||||
playListArea.animate({
|
playListArea.animate({
|
||||||
scrollTop: track.offset().top - playListArea.offset().top + playListArea.scrollTop()
|
scrollTop: track.offset().top - playListArea.offset().top + playListArea.scrollTop() - 30
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
@ -762,6 +762,7 @@ export default Em.Component.extend(helperMixin, visualizerMixin, {
|
||||||
if(this.get('firstVisit')){
|
if(this.get('firstVisit')){
|
||||||
this.send('handleNewSoundCloudURL', 'https://soundcloud.com/mrsuicidesheep/tracks');
|
this.send('handleNewSoundCloudURL', 'https://soundcloud.com/mrsuicidesheep/tracks');
|
||||||
this.get('storage').set('huegasm.firstVisit', false);
|
this.get('storage').set('huegasm.firstVisit', false);
|
||||||
|
|
||||||
this.sendAction();
|
this.sendAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,11 @@
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
import config from './config/environment';
|
import config from './config/environment';
|
||||||
|
|
||||||
var Router = Ember.Router.extend({
|
const Router = Ember.Router.extend({
|
||||||
location: config.locationType
|
location: config.locationType
|
||||||
});
|
});
|
||||||
|
|
||||||
Router.map(function() {
|
Router.map(function() {
|
||||||
this.route('404', {path:'/*path'});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export default Router;
|
export default Router;
|
||||||
|
|
|
||||||
|
|
@ -24,13 +24,6 @@ body {
|
||||||
position: static;
|
position: static;
|
||||||
}
|
}
|
||||||
|
|
||||||
#introPic {
|
|
||||||
display: block;
|
|
||||||
margin: 0 auto;
|
|
||||||
width: 100%;
|
|
||||||
max-width: 600px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.introParagraph {
|
.introParagraph {
|
||||||
margin-bottom: 30px;
|
margin-bottom: 30px;
|
||||||
}
|
}
|
||||||
|
|
@ -289,13 +282,13 @@ md-list-item .md-no-style {
|
||||||
}
|
}
|
||||||
|
|
||||||
.colorpicker {
|
.colorpicker {
|
||||||
padding: 10px;
|
padding: 5px;
|
||||||
background: rgba(0, 0, 0, 0.7);
|
background: rgba(0, 0, 0, 0.7);
|
||||||
box-shadow: 5px 10px 15px 5px rgba(0, 0, 0, 0.3);
|
box-shadow: 5px 10px 15px 5px rgba(0, 0, 0, 0.3);
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 275px;
|
width: 266px;
|
||||||
height: 275px;
|
height: 266px;
|
||||||
right: 6px;
|
right: 6px;
|
||||||
top: -9px;
|
top: -9px;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
|
|
@ -954,6 +947,9 @@ body.dimmerOn {
|
||||||
#extraOptionsMenu:hover {
|
#extraOptionsMenu:hover {
|
||||||
background: rgba(0, 0, 0, 0.9);
|
background: rgba(0, 0, 0, 0.9);
|
||||||
}
|
}
|
||||||
|
.popover-content {
|
||||||
|
color: black !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.power-settings-new.dimmerOn,
|
.power-settings-new.dimmerOn,
|
||||||
|
|
@ -971,7 +967,7 @@ body.dimmerOn {
|
||||||
opacity: 0.9 !important;
|
opacity: 0.9 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#dimmerWrapper {
|
#dimmer {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: -50px;
|
left: -50px;
|
||||||
bottom: -10px;
|
bottom: -10px;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
export default function(){
|
|
||||||
this.transition(
|
|
||||||
this.use('crossFade')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
20
bower.json
20
bower.json
|
|
@ -3,26 +3,26 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bootstrap-sass": "~3.3.5",
|
"bootstrap-sass": "~3.3.5",
|
||||||
"ember": "~2.1.0",
|
"ember": "~2.1.0",
|
||||||
"ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3",
|
"ember-cli-shims": "0.0.6",
|
||||||
"ember-cli-test-loader": "ember-cli-test-loader#0.1.3",
|
"ember-cli-test-loader": "0.2.1",
|
||||||
"ember-data": "~2.1.0",
|
"ember-data": "~2.1.0",
|
||||||
"ember-load-initializers": "ember-cli/ember-load-initializers#0.1.5",
|
"ember-load-initializers": "0.1.7",
|
||||||
"ember-qunit": "0.4.9",
|
"ember-qunit": "0.4.16",
|
||||||
"ember-qunit-notifications": "0.0.7",
|
"ember-qunit-notifications": "0.1.0",
|
||||||
"ember-resolver": "~0.1.18",
|
"ember-resolver": "~0.1.20",
|
||||||
"hammerjs": "~2.0.4",
|
"hammerjs": "~2.0.4",
|
||||||
"intro.js": "~1.1.1",
|
"intro.js": "~1.1.1",
|
||||||
"JavaScript-ID3-Reader": "https://github.com/aadsm/JavaScript-ID3-Reader.git",
|
"JavaScript-ID3-Reader": "https://github.com/aadsm/JavaScript-ID3-Reader.git",
|
||||||
"jquery": "~2.1.4",
|
"jquery": "~2.1.4",
|
||||||
"jquery-mousewheel": "~3.1.13",
|
"jquery-mousewheel": "~3.1.13",
|
||||||
"loader.js": "ember-cli/loader.js#3.2.0",
|
"loader.js": "ember-cli/loader.js#3.2.1",
|
||||||
"locallyjs": "~0.3.2",
|
"locallyjs": "~0.3.2",
|
||||||
"matchMedia": "~0.2.0",
|
"matchMedia": "~0.2.0",
|
||||||
"nouislider": "^8.0.1",
|
"nouislider": "^8.0.1",
|
||||||
"qunit": "~1.18.0"
|
"qunit": "~1.20.0",
|
||||||
|
"HackTimer": "https://github.com/turuslan/HackTimer.git#~1.0.0"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"ember": "~2.1.0",
|
"ember": "~2.1.0"
|
||||||
"jquery": "~2.1.4"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ module.exports = function(environment) {
|
||||||
},
|
},
|
||||||
|
|
||||||
contentSecurityPolicy: {
|
contentSecurityPolicy: {
|
||||||
|
'child-src': "blob:",
|
||||||
'default-src': "'none'",
|
'default-src': "'none'",
|
||||||
'script-src': "'self' 'unsafe-inline' connect.soundcloud.com www.google-analytics.com",
|
'script-src': "'self' 'unsafe-inline' connect.soundcloud.com www.google-analytics.com",
|
||||||
'font-src': "'self' fonts.gstatic.com",
|
'font-src': "'self' fonts.gstatic.com",
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,11 @@ module.exports = function(defaults) {
|
||||||
app.import('vendor/dancer.js');
|
app.import('vendor/dancer.js');
|
||||||
app.import('bower_components/bootstrap-sass/assets/javascripts/bootstrap/tooltip.js');
|
app.import('bower_components/bootstrap-sass/assets/javascripts/bootstrap/tooltip.js');
|
||||||
app.import('bower_components/bootstrap-sass/assets/javascripts/bootstrap/dropdown.js');
|
app.import('bower_components/bootstrap-sass/assets/javascripts/bootstrap/dropdown.js');
|
||||||
|
app.import('bower_components/bootstrap-sass/assets/javascripts/bootstrap/popover.js');
|
||||||
app.import('bower_components/JavaScript-ID3-Reader/dist/id3-minimized.js');
|
app.import('bower_components/JavaScript-ID3-Reader/dist/id3-minimized.js');
|
||||||
app.import('bower_components/jquery-mousewheel/jquery.mousewheel.js');
|
app.import('bower_components/jquery-mousewheel/jquery.mousewheel.js');
|
||||||
app.import('bower_components/locallyjs/dist/locally.min.js');
|
app.import('bower_components/locallyjs/dist/locally.min.js');
|
||||||
|
app.import('bower_components/HackTimer/HackTimer.js');
|
||||||
app.import('bower_components/intro.js/intro.js');
|
app.import('bower_components/intro.js/intro.js');
|
||||||
app.import('bower_components/intro.js/introjs.css');
|
app.import('bower_components/intro.js/introjs.css');
|
||||||
|
|
||||||
|
|
|
||||||
30
package.json
30
package.json
|
|
@ -19,26 +19,26 @@
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"broccoli-asset-rev": "^2.0.2",
|
"broccoli-asset-rev": "^2.2.0",
|
||||||
"ember-cli": "1.13.8",
|
"ember-cli": "^1.13.12",
|
||||||
"ember-cli-app-version": "1.0.0",
|
"ember-cli-app-version": "^1.0.0",
|
||||||
"ember-cli-babel": "^5.0.0",
|
"ember-cli-babel": "^5.1.5",
|
||||||
"ember-cli-content-security-policy": "0.4.0",
|
"ember-cli-content-security-policy": "0.4.0",
|
||||||
"ember-cli-dependency-checker": "^1.0.0",
|
"ember-cli-dependency-checker": "^1.1.0",
|
||||||
"ember-cli-htmlbars": "1.0.1",
|
"ember-cli-htmlbars": "^1.0.1",
|
||||||
"ember-cli-htmlbars-inline-precompile": "^0.3.0",
|
"ember-cli-htmlbars-inline-precompile": "^0.3.1",
|
||||||
"ember-cli-ic-ajax": "0.2.1",
|
"ember-cli-ic-ajax": "0.2.4",
|
||||||
"ember-cli-inject-live-reload": "^1.3.0",
|
"ember-cli-inject-live-reload": "^1.3.1",
|
||||||
"ember-cli-nouislider": "0.7.0",
|
"ember-cli-nouislider": "0.7.0",
|
||||||
"ember-cli-qunit": "1.0.3",
|
"ember-cli-qunit": "^1.0.4",
|
||||||
"ember-cli-release": "0.2.8",
|
"ember-cli-release": "0.2.8",
|
||||||
"ember-cli-sass": "5.0.1",
|
"ember-cli-sass": "5.1.0",
|
||||||
"ember-cli-sri": "^1.0.1",
|
"ember-cli-sri": "^1.1.0",
|
||||||
"ember-cli-uglify": "^1.0.1",
|
"ember-cli-uglify": "^1.2.0",
|
||||||
"ember-cli-windows-addon": "^1.2.2",
|
"ember-cli-windows-addon": "^1.2.2",
|
||||||
"ember-data": "2.1.0",
|
"ember-data": "2.1.0",
|
||||||
"ember-disable-proxy-controllers": "^1.0.0",
|
"ember-disable-proxy-controllers": "^1.0.1",
|
||||||
"ember-export-application-global": "^1.0.3",
|
"ember-export-application-global": "^1.0.4",
|
||||||
"ember-modal-dialog": "0.8.2",
|
"ember-modal-dialog": "0.8.2",
|
||||||
"ember-notify": "^4.0.1",
|
"ember-notify": "^4.0.1",
|
||||||
"ember-paper": "https://github.com/miguelcobain/ember-paper.git",
|
"ember-paper": "https://github.com/miguelcobain/ember-paper.git",
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 66 KiB |
5
tests/helpers/destroy-app.js
Normal file
5
tests/helpers/destroy-app.js
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
import Ember from 'ember';
|
||||||
|
|
||||||
|
export default function destroyApp(application) {
|
||||||
|
Ember.run(application, 'destroy');
|
||||||
|
}
|
||||||
23
tests/helpers/module-for-acceptance.js
Normal file
23
tests/helpers/module-for-acceptance.js
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
import { module } from 'qunit';
|
||||||
|
import startApp from '../helpers/start-app';
|
||||||
|
import destroyApp from '../helpers/destroy-app';
|
||||||
|
|
||||||
|
export default function(name, options = {}) {
|
||||||
|
module(name, {
|
||||||
|
beforeEach() {
|
||||||
|
this.application = startApp();
|
||||||
|
|
||||||
|
if (options.beforeEach) {
|
||||||
|
options.beforeEach.apply(this, arguments);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
afterEach() {
|
||||||
|
destroyApp(this.application);
|
||||||
|
|
||||||
|
if (options.afterEach) {
|
||||||
|
options.afterEach.apply(this, arguments);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import Resolver from 'ember/resolver';
|
import Resolver from 'ember/resolver';
|
||||||
import config from '../../config/environment';
|
import config from '../../config/environment';
|
||||||
|
|
||||||
var resolver = Resolver.create();
|
const resolver = Resolver.create();
|
||||||
|
|
||||||
resolver.namespace = {
|
resolver.namespace = {
|
||||||
modulePrefix: config.modulePrefix,
|
modulePrefix: config.modulePrefix,
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,12 @@ import Application from '../../app';
|
||||||
import config from '../../config/environment';
|
import config from '../../config/environment';
|
||||||
|
|
||||||
export default function startApp(attrs) {
|
export default function startApp(attrs) {
|
||||||
var application;
|
let application;
|
||||||
|
|
||||||
var attributes = Ember.merge({}, config.APP);
|
let attributes = Ember.merge({}, config.APP);
|
||||||
attributes = Ember.merge(attributes, attrs); // use defaults, but you can override;
|
attributes = Ember.merge(attributes, attrs); // use defaults, but you can override;
|
||||||
|
|
||||||
Ember.run(function() {
|
Ember.run(() => {
|
||||||
application = Application.create(attributes);
|
application = Application.create(attributes);
|
||||||
application.setupForTesting();
|
application.setupForTesting();
|
||||||
application.injectTestHelpers();
|
application.injectTestHelpers();
|
||||||
|
|
|
||||||
|
|
@ -18,13 +18,14 @@
|
||||||
{{content-for 'test-head-footer'}}
|
{{content-for 'test-head-footer'}}
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
{{content-for 'body'}}
|
{{content-for 'body'}}
|
||||||
{{content-for 'test-body'}}
|
{{content-for 'test-body'}}
|
||||||
|
|
||||||
<script src="assets/vendor.js"></script>
|
<script src="assets/vendor.js"></script>
|
||||||
<script src="assets/test-support.js"></script>
|
<script src="assets/test-support.js"></script>
|
||||||
<script src="assets/huegasm.js"></script>
|
<script src="assets/huegasm.js"></script>
|
||||||
<script src="testem.js"></script>
|
<script src="testem.js" integrity=""></script>
|
||||||
|
<script src="assets/tests.js"></script>
|
||||||
<script src="assets/test-loader.js"></script>
|
<script src="assets/test-loader.js"></script>
|
||||||
|
|
||||||
{{content-for 'body-footer'}}
|
{{content-for 'body-footer'}}
|
||||||
|
|
|
||||||
Reference in a new issue