Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
submit code chapter2...
  • Loading branch information
ubuntuvim committed Sep 22, 2015
1 parent 4bcad22 commit 0b19987
Show file tree
Hide file tree
Showing 98 changed files with 5,214 additions and 598 deletions.
202 changes: 0 additions & 202 deletions chapter1_The_Object_Model/LICENSE

This file was deleted.

2 changes: 0 additions & 2 deletions chapter1_The_Object_Model/README.md

This file was deleted.

18 changes: 0 additions & 18 deletions chapter1_The_Object_Model/template.html

This file was deleted.

4 changes: 4 additions & 0 deletions chapter2_templates/.bowerrc
@@ -0,0 +1,4 @@
{
"directory": "bower_components",
"analytics": false
}
34 changes: 34 additions & 0 deletions chapter2_templates/.editorconfig
@@ -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
9 changes: 9 additions & 0 deletions chapter2_templates/.ember-cli
@@ -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
}
17 changes: 17 additions & 0 deletions chapter2_templates/.gitignore
@@ -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
32 changes: 32 additions & 0 deletions chapter2_templates/.jshintrc
@@ -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
}
23 changes: 23 additions & 0 deletions chapter2_templates/.travis.yml
@@ -0,0 +1,23 @@
---
language: node_js
node_js:
- "0.12"

sudo: false

cache:
directories:
- node_modules

before_install:
- export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH
- "npm config set spin false"
- "npm install -g npm@^2"

install:
- npm install -g bower
- npm install
- bower install

script:
- npm test
3 changes: 3 additions & 0 deletions chapter2_templates/.watchmanconfig
@@ -0,0 +1,3 @@
{
"ignore_dirs": ["tmp"]
}
35 changes: 35 additions & 0 deletions chapter2_templates/app/components/my-action.js
@@ -0,0 +1,35 @@
import Ember from 'ember';

export default Ember.Component.extend({
// 控制页面文章详细内容是否显示
isShowingBody: false,
actions: {
showDetailInfo: function() {
// toggleProperty方法直接把isShowingBody设置为相反值
// toggleProperty方法详情:http://devdocs.io/ember/classes/ember.observable#method_toggleProperty
// this.toggleProperty('isShowingBody');

// 变量作用域问题
var isShowingBody = this.get('isShowingBody');
if (isShowingBody) {
this.set('isShowingBody', false);
} else {
this.set('isShowingBody', true);
}

},

hitMe: function(m) { // 参数的名字可以任意
console.log('The title is ' + m.title);
console.log('The body is ' + m.body);
},

triggerMe: function() {
console.log('触发mouseover事件。。。。');
},

pressALTKeyTiggerMe: function() {
console.log('pressALTKeyTiggerMe event tiggered by press alt...');
}
}
});

0 comments on commit 0b19987

Please sign in to comment.