Skip to content

Commit 7882a4e

Browse files
committed
update ember-app
1 parent 4a590c3 commit 7882a4e

23 files changed

+86
-131
lines changed

.editorconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ indent_style = space
1818
indent_size = 2
1919

2020
[*.hbs]
21+
insert_final_newline = false
2122
indent_style = space
2223
indent_size = 2
2324

@@ -29,5 +30,5 @@ indent_size = 2
2930
indent_style = space
3031
indent_size = 2
3132

32-
[*.md]
33+
[*.{diff,md}]
3334
trim_trailing_whitespace = false

.jshintrc

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
{
2-
"predef": {
3-
"document": true,
4-
"window": true,
5-
"-Promise": true,
6-
"moment": true,
7-
"google": true
8-
},
9-
"browser" : true,
10-
"boss" : true,
2+
"predef": [
3+
"document",
4+
"window",
5+
"-Promise"
6+
],
7+
"browser": true,
8+
"boss": true,
119
"curly": true,
1210
"debug": false,
1311
"devel": true,

app/controllers/crate/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Ember from 'ember';
22
import DS from 'ember-data';
33
import ajax from 'ic-ajax';
4+
import moment from 'moment';
45

56
var NUM_VERSIONS = 5;
67

@@ -194,17 +195,17 @@ export default Ember.ObjectController.extend({
194195
} else {
195196
Ember.$('.graph').show();
196197
}
197-
var myData = google.visualization.arrayToDataTable(data);
198+
var myData = window.google.visualization.arrayToDataTable(data);
198199

199-
var fmt = new google.visualization.DateFormat({
200+
var fmt = new window.google.visualization.DateFormat({
200201
pattern: 'LLL d, yyyy',
201202
});
202203
fmt.format(myData, 0);
203204
var el = document.getElementById('graph-data');
204205
if (!el) {
205206
return;
206207
}
207-
var chart = new google.visualization.AreaChart(el);
208+
var chart = new window.google.visualization.AreaChart(el);
208209
chart.draw(myData, {
209210
chartArea: {'width': '80%', 'height': '80%'},
210211
hAxis: {

app/helpers/date-long.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Ember from 'ember';
2+
import moment from 'moment';
23

34
function dateLong(value) {
45
return moment(value).format('LL');

app/helpers/date-small.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Ember from 'ember';
2+
import moment from 'moment';
23

34
function dateSmall(value) {
45
return moment(value).format('ll');

app/helpers/from-now.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Ember from 'ember';
2+
import moment from 'moment';
23

34
function fromNow(value) {
45
return moment(value).fromNow();

app/index.html

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<meta name="description" content="">
88
<meta name="viewport" content="width=device-width, initial-scale=1">
99

10-
{{BASE_TAG}}
10+
{{content-for 'head'}}
1111

1212
<script>
1313
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
@@ -21,25 +21,22 @@
2121

2222
<link rel="stylesheet" href="assets/vendor.css">
2323
<link rel="stylesheet" href="assets/cargo.css">
24+
{{content-for 'head-footer'}}
2425
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
2526
<link rel="icon" href="/favicon.ico" type="image/x-icon">
2627
<link rel="search" href="/opensearch.xml" type="application/opensearchdescription+xml" title="Cargo">
2728
</head>
2829
<body>
30+
{{content-for 'body'}}
2931
<noscript>
3032
<div id="main">
3133
<div class='noscript'>
3234
This site requires that JavaScript to be enabled.
3335
</div>
3436
</div>
3537
</noscript>
36-
<script>
37-
window.EmberENV = {{EMBER_ENV}};
38-
</script>
3938
<script src="assets/vendor.js"></script>
4039
<script src="assets/cargo.js"></script>
41-
<script>
42-
window.Cargo = require('cargo/app')['default'].create({{APP_CONFIG}});
43-
</script>
40+
{{content-for 'body-footer'}}
4441
</body>
4542
</html>

app/initializers/google.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Ember from 'ember';
22

33
export var initialize = function() {
44
Ember.$.getScript('https://www.google.com/jsapi', function() {
5-
google.load('visualization', '1.0', {
5+
window.google.load('visualization', '1.0', {
66
'packages': ['corechart'],
77
'callback': function() {
88
window.googleChartsLoaded = true;

app/templates/application.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
<div id="header">
66
{{#link-to "index"}}
77
<img src="/assets/Cargo-Logo-Small.png" id="logo"
8-
height=100 width=100/>
8+
height=100 width=100 />
99
{{/link-to}}
1010
{{#link-to "index"}}
11-
<h1>CARGO</h2>
11+
<h1>CARGO</h1>
1212
{{/link-to}}
1313

1414
<form class='search' action='/search' {{ action "" on="submit" }} >

app/templates/me/index.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<dl>
1313
<dt>Name</dt>
14-
<dd>{{ name }}</dt>
14+
<dd>{{ name }}</dd>
1515
<dt>GitHub Account</dt>
1616
<dd>{{ login }}</dd>
1717
<dt>Email</dt>

bower.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
22
"name": "cargo",
33
"dependencies": {
4-
"handlebars": "~1.3.0",
4+
"ember": "1.11.1",
5+
"ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3",
6+
"ember-cli-test-loader": "ember-cli-test-loader#0.1.3",
7+
"ember-data": "1.0.0-beta.16.1",
8+
"ember-load-initializers": "ember-cli/ember-load-initializers#0.1.4",
9+
"ember-qunit": "0.3.1",
10+
"ember-qunit-notifications": "0.0.7",
11+
"ember-resolver": "~0.1.15",
512
"jquery": "^1.11.1",
6-
"ember": "1.7.0",
7-
"ember-data": "1.0.0-beta.10",
8-
"ember-resolver": "~0.1.7",
9-
"loader": "stefanpenner/loader.js#1.0.1",
10-
"ember-cli-shims": "stefanpenner/ember-cli-shims#0.0.3",
11-
"ember-cli-test-loader": "rwjblue/ember-cli-test-loader#0.0.4",
12-
"ember-load-initializers": "stefanpenner/ember-load-initializers#0.0.2",
13-
"ember-qunit": "0.1.8",
14-
"ember-qunit-notifications": "0.0.4",
15-
"qunit": "~1.15.0",
16-
"moment": "~2.8.3",
17-
"normalize-css": "~3.0.1"
13+
"loader.js": "ember-cli/loader.js#3.2.0",
14+
"qunit": "~1.17.1",
15+
"ember-cli-moment-shim": "~0.1.0",
16+
"moment": "~2.10.2",
17+
"normalize-css": "~3.0.3"
1818
}
1919
}

package.json

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"test": "tests"
88
},
99
"scripts": {
10-
"postinstall": "bower install",
1110
"start": "ember server",
1211
"startui": "ember server --proxy https://staging-crates-io.herokuapp.com",
1312
"build": "ember build",
@@ -20,18 +19,22 @@
2019
"author": "",
2120
"license": "MIT",
2221
"devDependencies": {
23-
"body-parser": "^1.2.0",
24-
"bower": "^1.3.12",
25-
"broccoli-asset-rev": "0.1.1",
26-
"broccoli-ember-hbs-template-compiler": "^1.6.1",
22+
"broccoli-asset-rev": "^2.0.2",
2723
"broccoli-sass": "^0.2.2",
28-
"ember-cli": "0.0.46",
24+
"ember-cli": "^0.2.3",
25+
"ember-cli-app-version": "0.3.3",
26+
"ember-cli-babel": "^5.0.0",
27+
"ember-cli-dependency-checker": "0.0.8",
28+
"ember-cli-htmlbars": "0.7.4",
2929
"ember-cli-ic-ajax": "0.1.1",
3030
"ember-cli-inject-live-reload": "^1.0.2",
31-
"ember-cli-qunit": "0.1.0",
32-
"ember-data": "1.0.0-beta.10",
31+
"ember-cli-qunit": "0.3.10",
32+
"ember-cli-uglify": "1.0.1",
33+
"ember-data": "1.0.0-beta.16.1",
34+
"ember-document-title": "~0.1.2",
35+
"ember-export-application-global": "^1.0.2",
36+
"ember-moment": "1.1.1",
3337
"express": "^4.8.5",
34-
"glob": "^4.0.5",
35-
"ember-document-title": "~0.1.2"
38+
"glob": "^4.0.5"
3639
}
3740
}

public/robots.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
# robotstxt.org/
2-
1+
# http://www.robotstxt.org
32
User-agent: *

testem.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"framework": "qunit",
3-
"test_page": "tests/index.html",
3+
"test_page": "tests/index.html?hidepassed",
44
"launch_in_ci": [
55
"PhantomJS"
66
],

tests/.jshintrc

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,8 @@
66
"setTimeout",
77
"$",
88
"-Promise",
9-
"QUnit",
109
"define",
1110
"console",
12-
"equal",
13-
"notEqual",
14-
"notStrictEqual",
15-
"test",
16-
"asyncTest",
17-
"testBoth",
18-
"testWithDefault",
19-
"raises",
20-
"throws",
21-
"deepEqual",
22-
"start",
23-
"stop",
24-
"ok",
25-
"strictEqual",
26-
"module",
27-
"moduleFor",
28-
"moduleForComponent",
29-
"moduleForModel",
30-
"process",
31-
"expect",
3211
"visit",
3312
"exists",
3413
"fillIn",
@@ -39,9 +18,6 @@
3918
"findWithAssert",
4019
"wait",
4120
"DS",
42-
"keyEvent",
43-
"isolatedContainer",
44-
"startApp",
4521
"andThen",
4622
"currentURL",
4723
"currentPath",

tests/helpers/start-app.js

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
11
import Ember from 'ember';
22
import Application from '../../app';
33
import Router from '../../router';
4-
import config from '../../config/environments/test';
4+
import config from '../../config/environment';
55

66
export default function startApp(attrs) {
7-
var App;
7+
var application;
88

99
var attributes = Ember.merge({}, config.APP);
1010
attributes = Ember.merge(attributes, attrs); // use defaults, but you can override;
1111

12-
Router.reopen({
13-
location: 'none'
14-
});
15-
1612
Ember.run(function() {
17-
App = Application.create(attributes);
18-
App.setupForTesting();
19-
App.injectTestHelpers();
13+
application = Application.create(attributes);
14+
application.setupForTesting();
15+
application.injectTestHelpers();
2016
});
2117

22-
App.reset(); // this shouldn't be needed, i want to be able to "start an app at a specific URL"
23-
24-
return App;
18+
return application;
2519
}

tests/index.html

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,42 +7,27 @@
77
<meta name="description" content="">
88
<meta name="viewport" content="width=device-width, initial-scale=1">
99

10-
{{BASE_TAG}}
10+
{{content-for 'head'}}
11+
{{content-for 'test-head'}}
1112

1213
<link rel="stylesheet" href="assets/vendor.css">
1314
<link rel="stylesheet" href="assets/cargo.css">
1415
<link rel="stylesheet" href="assets/test-support.css">
15-
<style>
16-
#ember-testing-container {
17-
position: absolute;
18-
background: white;
19-
bottom: 0;
20-
right: 0;
21-
width: 640px;
22-
height: 384px;
23-
overflow: auto;
24-
z-index: 9999;
25-
border: 1px solid #ccc;
26-
}
27-
#ember-testing {
28-
zoom: 50%;
29-
}
30-
</style>
16+
17+
{{content-for 'head-footer'}}
18+
{{content-for 'test-head-footer'}}
3119
</head>
3220
<body>
33-
<div id="qunit"></div>
34-
<div id="qunit-fixture"></div>
3521

36-
<script>
37-
window.EmberENV = {{EMBER_ENV}};
38-
</script>
22+
{{content-for 'body'}}
23+
{{content-for 'test-body'}}
3924
<script src="assets/vendor.js"></script>
4025
<script src="assets/test-support.js"></script>
4126
<script src="assets/cargo.js"></script>
4227
<script src="testem.js"></script>
43-
<script>
44-
require('cargo/tests/test-helper');
45-
</script>
4628
<script src="assets/test-loader.js"></script>
29+
30+
{{content-for 'body-footer'}}
31+
{{content-for 'test-body-footer'}}
4732
</body>
4833
</html>

tests/test-helper.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,3 @@ import {
44
} from 'ember-qunit';
55

66
setResolver(resolver);
7-
8-
document.write('<div id="ember-testing-container"><div id="ember-testing"></div></div>');
9-
10-
QUnit.config.urlConfig.push({ id: 'nocontainer', label: 'Hide container'});
11-
if (QUnit.urlParams.nocontainer) {
12-
document.getElementById('ember-testing-container').style.visibility = 'hidden';
13-
} else {
14-
document.getElementById('ember-testing-container').style.visibility = 'visible';
15-
}

tests/unit/helpers/date-long-test.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ import {
22
dateLong
33
} from 'cargo/helpers/date-long';
44

5+
import { module } from 'qunit';
6+
import { test } from 'ember-qunit';
7+
58
module('DateLongHelper');
69

710
// Replace this with your real tests.
8-
test('it works', function() {
9-
var result = dateLong(42);
10-
ok(result);
11+
test('it works', function(assert) {
12+
assert.ok(dateLong(42));
1113
});

0 commit comments

Comments
 (0)