-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update ancient emberjs version and use ember-cli (#1582)
Update to Ember 2.6
- Loading branch information
Showing
63 changed files
with
1,309 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
todomvc/dist/assets/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0"?> | ||
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd"> | ||
<cross-domain-policy> | ||
<!-- Read this: www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html --> | ||
|
||
<!-- Most restrictive policy: --> | ||
<site-control permitted-cross-domain-policies="none"/> | ||
|
||
<!-- Least restrictive policy: --> | ||
<!-- | ||
<site-control permitted-cross-domain-policies="all"/> | ||
<allow-access-from domain="*" to-ports="*" secure="false"/> | ||
<allow-http-request-headers-from domain="*" headers="*" secure="false"/> | ||
--> | ||
</cross-domain-policy> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
todomvc/dist/index.html |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# http://www.robotstxt.org | ||
User-agent: * | ||
Disallow: |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"directory": "bower_components", | ||
"analytics": false | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
|
||
[*] | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.js] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.hbs] | ||
insert_final_newline = false | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.css] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.html] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.{diff,md}] | ||
trim_trailing_whitespace = false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
/** | ||
Ember CLI sends analytics information by default. The data is completely | ||
anonymous, but there are times when you might want to disable this behavior. | ||
|
||
Setting `disableAnalytics` to true will prevent any data from being sent. | ||
*/ | ||
"disableAnalytics": false | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# See http://help.github.com/ignore-files/ for more about ignoring files. | ||
|
||
# compiled output | ||
# /dist | ||
/tmp | ||
|
||
# dependencies | ||
/node_modules | ||
/bower_components | ||
|
||
# misc | ||
/.sass-cache | ||
/connect.lock | ||
/coverage/* | ||
/libpeerconnection.log | ||
npm-debug.log | ||
testem.log |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"predef": [ | ||
"document", | ||
"window", | ||
"-Promise" | ||
], | ||
"browser": true, | ||
"boss": true, | ||
"curly": true, | ||
"debug": false, | ||
"devel": true, | ||
"eqeqeq": true, | ||
"evil": true, | ||
"forin": false, | ||
"immed": false, | ||
"laxbreak": false, | ||
"newcap": true, | ||
"noarg": true, | ||
"noempty": false, | ||
"nonew": false, | ||
"nomen": false, | ||
"onevar": false, | ||
"plusplus": false, | ||
"regexp": false, | ||
"undef": true, | ||
"sub": true, | ||
"strict": false, | ||
"white": false, | ||
"eqnull": true, | ||
"esnext": true, | ||
"unused": true | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
language: node_js | ||
node_js: | ||
- "4" | ||
|
||
sudo: false | ||
|
||
cache: | ||
directories: | ||
- node_modules | ||
|
||
before_install: | ||
- npm config set spin false | ||
- npm install -g bower | ||
- npm install phantomjs-prebuilt | ||
|
||
install: | ||
- npm install | ||
- bower install | ||
|
||
script: | ||
- npm test |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"ignore_dirs": ["tmp", "dist"] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Ember.js TodoMVC Example using Ember CLI | ||
|
||
> A framework for creating ambitious web applications. | ||
> _[Ember.js - emberjs.com](http://emberjs.com)_ | ||
> _[Ember CLI - ember-cli.com](http://ember-cli.com)_ | ||
## Note for people updating this app. | ||
|
||
The `index.html` and the `assets` folder in the parent folder as simlinks into the items with the | ||
same names inside `dist`. The `dist` folder has to be checked in git and built for production. | ||
|
||
To work on this comment `<base href="/examples/ember-cli/index.html" />` in the `app/index.html` | ||
and uncommented it back before doing the production build. | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import Ember from 'ember'; | ||
import Resolver from './resolver'; | ||
import loadInitializers from 'ember-load-initializers'; | ||
import config from './config/environment'; | ||
|
||
let App; | ||
|
||
Ember.MODEL_FACTORY_INJECTIONS = true; | ||
|
||
App = Ember.Application.extend({ | ||
modulePrefix: config.modulePrefix, | ||
podModulePrefix: config.podModulePrefix, | ||
Resolver | ||
}); | ||
|
||
loadInitializers(App, config.modulePrefix); | ||
|
||
export default App; |
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import Ember from 'ember'; | ||
|
||
export default Ember.Component.extend({ | ||
repo: Ember.inject.service(), | ||
tagName: 'li', | ||
editing: false, | ||
classNameBindings: ['todo.completed', 'editing'], | ||
|
||
actions: { | ||
startEditing() { | ||
this.get('onStartEdit')(); | ||
this.set('editing', true); | ||
Ember.run.scheduleOnce('afterRender', this, 'focusInput'); | ||
}, | ||
|
||
doneEditing(todoTitle) { | ||
if (!this.get('editing')) { return; } | ||
if (Ember.isBlank(todoTitle)) { | ||
this.send('removeTodo'); | ||
} else { | ||
this.set('todo.title', todoTitle.trim()); | ||
this.set('editing', false); | ||
this.get('onEndEdit')(); | ||
} | ||
}, | ||
|
||
handleKeydown(e) { | ||
if (e.keyCode === 13) { | ||
e.target.blur(); | ||
} else if (e.keyCode === 27) { | ||
this.set('editing', false); | ||
} | ||
}, | ||
|
||
toggleCompleted(e) { | ||
let todo = this.get('todo'); | ||
Ember.set(todo, 'completed', e.target.checked); | ||
this.get('repo').persist(); | ||
}, | ||
|
||
removeTodo() { | ||
this.get('repo').delete(this.get('todo')); | ||
} | ||
}, | ||
|
||
focusInput() { | ||
this.element.querySelector('input.edit').focus(); | ||
} | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import Ember from 'ember'; | ||
|
||
export default Ember.Component.extend({ | ||
repo: Ember.inject.service(), | ||
tagName: 'section', | ||
elementId: 'main', | ||
canToggle: true, | ||
allCompleted: Ember.computed('todos.@each.completed', function () { | ||
return this.get('todos').isEvery('completed'); | ||
}), | ||
|
||
actions: { | ||
enableToggle() { | ||
this.set('canToggle', true); | ||
}, | ||
|
||
disableToggle() { | ||
this.set('canToggle', false); | ||
}, | ||
|
||
toggleAll() { | ||
let allCompleted = this.get('allCompleted'); | ||
this.get('todos').forEach(todo => Ember.set(todo, 'completed', !allCompleted)); | ||
this.get('repo').persist(); | ||
} | ||
} | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import Ember from 'ember'; | ||
|
||
export default Ember.Controller.extend({ | ||
todos: Ember.computed.filterBy('model', 'completed', false) | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import Ember from 'ember'; | ||
|
||
export default Ember.Controller.extend({ | ||
repo: Ember.inject.service(), | ||
remaining: Ember.computed.filterBy('model', 'completed', false), | ||
completed: Ember.computed.filterBy('model', 'completed'), | ||
actions: { | ||
createTodo(e) { | ||
if (e.keyCode === 13 && !Ember.isBlank(e.target.value)) { | ||
this.get('repo').add({ title: e.target.value.trim(), completed: false }); | ||
e.target.value = ''; | ||
} | ||
}, | ||
|
||
clearCompleted() { | ||
this.get('model').removeObjects(this.get('completed')); | ||
this.get('repo').persist(); | ||
} | ||
} | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import Ember from 'ember'; | ||
|
||
export default Ember.Controller.extend({ | ||
todos: Ember.computed.filterBy('model', 'completed', true) | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Ember from 'ember'; | ||
|
||
export function gt([n1, n2]/*, hash*/) { | ||
return n1 > n2; | ||
} | ||
|
||
export default Ember.Helper.helper(gt); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import Ember from 'ember'; | ||
import { pluralize } from 'ember-inflector'; | ||
|
||
export function pluralizeHelper([singular, count]/*, hash*/) { | ||
return count === 1 ? singular : pluralize(singular); | ||
} | ||
|
||
export default Ember.Helper.helper(pluralizeHelper); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<title>Todomvc</title> | ||
<meta name="description" content=""> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<base href="/examples/ember-cli/index.html" /> | ||
{{content-for "head"}} | ||
|
||
<link rel="stylesheet" href="assets/vendor.css"> | ||
<link rel="stylesheet" href="assets/todomvc.css"> | ||
|
||
{{content-for "head-footer"}} | ||
</head> | ||
<body> | ||
{{content-for "body"}} | ||
|
||
<script src="assets/vendor.js"></script> | ||
<script src="assets/todomvc.js"></script> | ||
|
||
{{content-for "body-footer"}} | ||
</body> | ||
</html> |
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import Resolver from 'ember-resolver'; | ||
|
||
export default Resolver; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import Ember from 'ember'; | ||
import config from './config/environment'; | ||
|
||
const Router = Ember.Router.extend({ | ||
location: config.locationType | ||
}); | ||
|
||
Router.map(function () { | ||
this.route('active'); | ||
this.route('completed'); | ||
}); | ||
|
||
export default Router; |
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import Ember from 'ember'; | ||
|
||
export default Ember.Route.extend({ | ||
repo: Ember.inject.service(), | ||
model() { | ||
return this.get('repo').findAll(); | ||
} | ||
}); |
Oops, something went wrong.