- 使用Sublime Text + Emmet 自動產生標準index.html
- 套用Bootstrap 到index.html
- 使用 畫圓
- Consider JavaScript Closure
- 練習亂數
- 獨立出JavaScript 程式碼 (main.js)
- Use JavaScript Module Pattern
- 產生 10 個 Balls
- 加入背景圖
- 處理輸入事件 (input event)
- 設計按到球的演算法
- 按到球計算分數
- improve code quality in strict mode(verify by JSLint)
{
"tab_size": 4,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true
}
import urllib.request,os; pf = 'Package Control.sublime-package';ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); open(os.path.join(ipp, pf), 'wb').write(urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ','%20')).read())
Ctrl + Shift + P
type 'Install Package'
type 'Editorconfig'
; top-most EditorConfig file
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
Ctrl + Shift + P
type 'Install Package'
type 'Emmet'
html:5
.class
#id
C:\Users\user\Documents\Github\mokoversity-camp3> npm install -g express
C:\Users\user\Documents\Github\mokoversity-camp3> express
C:\Users\user\Documents\Github\mokoversity-camp3> npm install
C:\Users\user\Documents\Github\mokoversity-camp3> npm install websocket --save
$ node app.js
http://127.0.0.1:3000/index.html
$ npm install -g bower
bower init
bower install bootstrap --save
bower install query --save
bower install jquery-tmpl --save
bower install
Refactor 912492d7adb5c4368c1496af87a632f694f30b62
- Move JavaScript code to main.chat.js
- Using JavaScript closure (module)
- Using yepnope loader
Mapping view and data
- Using key-value pairs (ViewModel): use JSON to present key-value data
- Using Backbone (fully application framework) for applying ViewModel, or
- Simple template library (eg. jquery template)
- UI made easy: use Bootstrap CSS framework
Application
- Use Bootstrap navbars
- Responsive design by Bootstrap
Send data
- Use WebSocket send()
- Connect Open API: AJAX and RESTful
- Not use AJAX method: if so, either jQuery way or Backbone way is good
- Not use RESTful API: refactor URL query string to REST spec
Going mobile
- Use PhoneGap: build.phonegap.com or Eclipse+PhoneGap
- Use viewport
- Use Mixins (LESS) to set media query of 'screen' height
Using PhoneGap APIs
- Camera web app
Enter Nodejs: Developing Web service
- Create a Web server
- Handling URL routing
- Create WebSocket server
- Handling requests
Using package.json
- for releasing software
- Use jQuery AJAX and JSON data instead of query string
- use preventDefault()
- use jQuery UI Touch Punch ('touchmove' event)
- Try Express.js and understanding RESTful