Skip to content

Commit

Permalink
0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
ericwangkai committed Mar 13, 2013
1 parent 2786dac commit 12fe4f3
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 20 deletions.
2 changes: 2 additions & 0 deletions .c9revisions/app.js.c9save
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
{"ts":1362358382329,"silentsave":true,"restoring":false,"patch":[[{"diffs":[[1,"var express = require('express')\n , http = require('http')\n , path = require('path');\n\nvar app = express();\n\napp.configure(function() {\n app.set('port', process.env.PORT || 3000);\n app.set('views', __dirname + '/views');\n app.set('view engine', 'jade');\n app.use(express.favicon());\n app.use(express.logger('dev'));\n app.use(express.bodyParser());\n app.use(express.methodOverride());\n app.use(require('connect-assets')());\n app.use(express.static(path.join(__dirname, 'public')));\n app.use(function(req, res, next) {\n if(req.url.match(/^\\/test\\//) != null) {\n res.sendfile(path.join(__dirname, req.url));\n } else {\n next();\n }\n });\n app.use(app.router);\n app.use(function(req, res, next) {\n throw new Error(req.url + ' not found');\n });\n app.use(function(err, req, res, next) {\n console.log(err);\n res.send(err.message);\n });\n});\n\napp.configure('development', function() {\n app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));\n});\n\napp.configure('production', function() {\n app.use(express.errorHandler());\n});\n\nhttp.createServer(app).listen(app.get('port'), function() {\n console.log(\"Express server listening on port \" + app.get('port'));\n});\n\n\nrequire('./initializers/routes_setup')(app);\n"]],"start1":0,"start2":0,"length1":0,"length2":1262}]],"length":1262}
{"contributors":[],"silentsave":false,"ts":1362395997016,"patch":[[{"diffs":[[0,"t\\//) !="],[1,"="],[0," null) {"]],"start1":557,"start2":557,"length1":16,"length2":17}]],"length":1263,"saved":false}
{"contributors":[],"silentsave":false,"ts":1363146141302,"patch":[[{"diffs":[[0,".listen("],[-1,"app.get('port')"],[1,"3000"],[0,", functi"]],"start1":1104,"start2":1104,"length1":31,"length2":20}]],"length":1252,"saved":false}
{"contributors":[],"silentsave":false,"ts":1363146309934,"patch":[[{"diffs":[[0,".listen("],[-1,"3000"],[1,"app.get('port')"],[0,", functi"]],"start1":1104,"start2":1104,"length1":20,"length2":31}]],"length":1263,"saved":false}
6 changes: 6 additions & 0 deletions .c9revisions/assets/js/app.js.c9save
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{"ts":1363141393521,"silentsave":true,"restoring":false,"patch":[[{"diffs":[[1,"'use strict';\n\n\n// Declare app level module which depends on filters, and services\nangular.module('myApp', ['myApp.filters', 'myApp.services', 'myApp.directives']).\n config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {\n $routeProvider.when('/view1', {templateUrl: 'angular/sample/partial1', controller: MyCtrl1});\n $routeProvider.when('/view2', {templateUrl: 'angular/sample/partial2', controller: MyCtrl2});\n $routeProvider.otherwise({redirectTo: '/view1'});\n $locationProvider.html5Mode(true);\n }]);"]],"start1":0,"start2":0,"length1":0,"length2":555}]],"length":555}
{"contributors":[],"silentsave":false,"ts":1363141448590,"patch":[[{"diffs":[[0,"module('"],[-1,"myApp"],[1,"wishList"],[0,"', ['myA"]],"start1":91,"start2":91,"length1":21,"length2":24}]],"length":558,"saved":false}
{"ts":1363141460303,"patch":[[{"diffs":[[0,"ist', ['"],[-1,"myApp"],[1,"wishList"],[0,".filters"]],"start1":104,"start2":104,"length1":21,"length2":24},{"diffs":[[0,"ters', '"],[-1,"myApp"],[1,"wishList"],[0,".service"]],"start1":124,"start2":124,"length1":21,"length2":24},{"diffs":[[0,"', '"],[-1,"myApp"],[1,"wishList"],[0,".dir"]],"start1":149,"start2":149,"length1":13,"length2":16}]],"length":567,"saved":false}
{"ts":1363141646480,"patch":[[{"diffs":[[0,"ider) {\n"],[1," \n"],[0," $rou"]],"start1":264,"start2":264,"length1":16,"length2":23},{"diffs":[[0,".when('/"],[-1,"view1"],[0,"', {temp"]],"start1":297,"start2":297,"length1":21,"length2":16},{"diffs":[[0,"l: '"],[-1,"angular/sample/partial1', controller: MyCtrl1"],[1,"myHomePage', controller: WishListController"],[0,"});\n"]],"start1":319,"start2":319,"length1":53,"length2":51},{"diffs":[[0,"(true);\n"],[1," \n"],[0," }]);"]],"start1":553,"start2":553,"length1":14,"length2":19}]],"length":572,"saved":false}
{"ts":1363142213624,"patch":[[{"diffs":[[0,"ist."],[-1,"filters', 'wishList.services', 'wishList.directive"],[1,"controller"],[0,"s'])"]],"start1":117,"start2":117,"length1":58,"length2":18}]],"length":532,"saved":false}
{"ts":1363142368755,"patch":[[{"diffs":[[0,"ntroller});\n "],[1,"//"],[0,"$routeProvider.w"]],"start1":318,"start2":318,"length1":32,"length2":34},{"diffs":[[0,"Ctrl2});\n "],[1,"//"],[0," $routeProvi"]],"start1":421,"start2":421,"length1":24,"length2":26},{"diffs":[[0,"});\n "],[1,"//"],[0,"$locatio"]],"start1":482,"start2":482,"length1":16,"length2":18}]],"length":538,"saved":false}
9 changes: 9 additions & 0 deletions .c9revisions/assets/js/controllers.js.c9save
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{"ts":1363140844220,"silentsave":true,"restoring":false,"patch":[[{"diffs":[[1,"'use strict';\n\n/* Controllers */\n\nfunction AppCtrl($scope, $http) {\n $http({method: 'GET', url: '/api/name'}).\n success(function(data, status, headers, config) {\n $scope.name = data.name;\n }).\n error(function(data, status, headers, config) {\n $scope.name = 'Error!'\n });\n}\n\nfunction MyCtrl1() {}\nMyCtrl1.$inject = [];\n\n\nfunction MyCtrl2() {\n}\nMyCtrl2.$inject = [];\n"]],"start1":0,"start2":0,"length1":0,"length2":376}]],"length":376}
{"contributors":[],"silentsave":false,"ts":1363141670227,"patch":[[{"diffs":[[0,"lers */\n"],[1,"/*"],[0,"\nfunctio"]],"start1":25,"start2":25,"length1":16,"length2":18},{"diffs":[[0," });\n}\n"],[1,"*/"],[0,"\nfunctio"]],"start1":278,"start2":278,"length1":16,"length2":18},{"diffs":[[0,"unction "],[-1,"MyCtrl1"],[1,"WishListController"],[0,"() {}\nMy"]],"start1":290,"start2":290,"length1":23,"length2":34},{"diffs":[[0,";\n\n\n"],[-1,"function MyCtrl2() {\n}\nMyCtrl2.$inject = [];"],[0,"\n"]],"start1":342,"start2":342,"length1":49,"length2":5}]],"length":347,"saved":false}
{"ts":1363141783296,"patch":[[{"diffs":[[0,"ler("],[-1,") {}\nMyCtrl1.$inject = [];"],[1,"$scope) {\n $scope.wishList=[\n {\"id\"=1, \"wishDesc\"=\"My First Wish\"},\n {},\n {}\n \n ]; \n}\n"],[0,"\n\n\n\n"]],"start1":313,"start2":313,"length1":34,"length2":135}]],"length":448,"saved":false}
{"ts":1363141817714,"patch":[[{"diffs":[[0," {"],[-1,"},\n {}\n \n "],[1,"\"id\"=2, \"wishDesc\"=\"My second Wish\"},\n {\"id\"=3, \"wishDesc\"=\"My Third Wish\"},\n {\"id\"=4, \"wishDesc\"=\"My Fourth Wish\"}, \n"],[0," "]],"start1":400,"start2":400,"length1":35,"length2":147}]],"length":560,"saved":false}
{"ts":1363141825264,"patch":[[{"diffs":[[0,"sh\"}"],[-1,", "],[0," "]],"start1":529,"start2":529,"length1":13,"length2":8}]],"length":555,"saved":false}
{"ts":1363141861294,"patch":[[{"diffs":[[0," {\"id\""],[-1,"="],[1,":"],[0,"1, \"wish"]],"start1":354,"start2":354,"length1":17,"length2":17},{"diffs":[[0,", \"wishDesc\""],[-1,"="],[1,":"],[0,"\"My First Wi"]],"start1":364,"start2":364,"length1":25,"length2":25},{"diffs":[[0," {\"id\""],[-1,"="],[1,":"],[0,"2, \"wish"]],"start1":400,"start2":400,"length1":17,"length2":17},{"diffs":[[0,", \"wishDesc\""],[-1,"="],[1,":"],[0,"\"My second W"]],"start1":410,"start2":410,"length1":25,"length2":25},{"diffs":[[0," {\"id\""],[-1,"="],[1,":"],[0,"3, \"wish"]],"start1":447,"start2":447,"length1":17,"length2":17},{"diffs":[[0,", \"wishDesc\""],[-1,"="],[1,":"],[0,"\"My Third Wi"]],"start1":457,"start2":457,"length1":25,"length2":25},{"diffs":[[0," {\"id\""],[-1,"="],[1,":"],[0,"4, \"wish"]],"start1":493,"start2":493,"length1":17,"length2":17},{"diffs":[[0,"ishDesc\""],[-1,"="],[1,":"],[0,"\"My Four"]],"start1":507,"start2":507,"length1":17,"length2":17}]],"length":555,"saved":false}
{"ts":1363142178419,"patch":[[{"diffs":[[0," ]; \n"],[1," \n $scope.addWishItem = function();\n \n \n"],[0,"}\n\n\n\n\n"]],"start1":541,"start2":541,"length1":14,"length2":66}]],"length":607,"saved":false}
{"ts":1363142277510,"patch":[[{"diffs":[[0,"nction()"],[1,"{}"],[0,";\n \n "]],"start1":581,"start2":581,"length1":16,"length2":18}]],"length":609,"saved":false}
{"ts":1363142280927,"patch":[[{"diffs":[[0," \n \n"],[1," \n"],[0,"}\n\n\n\n\n"]],"start1":595,"start2":595,"length1":14,"length2":19}]],"length":614,"saved":false}
1 change: 1 addition & 0 deletions .c9revisions/assets/js/directives.js.c9save
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ts":1363141427384,"silentsave":true,"restoring":false,"patch":[[{"diffs":[[1,"'use strict';\n\n/* Directives */\n\n\nangular.module('myApp.directives', []).\n directive('appVersion', ['version', function(version) {\n return function(scope, elm, attrs) {\n elm.text(version);\n };\n }]);\n"]],"start1":0,"start2":0,"length1":0,"length2":212}]],"length":212}
1 change: 1 addition & 0 deletions .c9revisions/views/layout.jade.c9save
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
{"ts":1362396459348,"patch":[[{"diffs":[[0,".min"],[-1,".css"],[0,"')\n "]],"start1":145,"start2":145,"length1":12,"length2":8},{"diffs":[[0,"/angular.min"],[-1,".js"],[0,"')\n !=('l"]],"start1":171,"start2":171,"length1":27,"length2":24},{"diffs":[[0,"trap.min"],[-1,".js"],[0,"')\n !"]],"start1":203,"start2":203,"length1":19,"length2":16},{"diffs":[[0,"uery"],[-1,".js"],[0,"')\n "]],"start1":224,"start2":224,"length1":11,"length2":8}]],"length":252,"saved":false}
{"ts":1362396768233,"patch":[[{"diffs":[[0,"t\n !="],[1,"css"],[0,"('bootst"]],"start1":126,"start2":126,"length1":16,"length2":19},{"diffs":[[0,"min')\n !="],[1,"js"],[0,"('lib/angula"]],"start1":149,"start2":149,"length1":24,"length2":26},{"diffs":[[0,")\n !="],[1,"js"],[0,"('lib/bo"]],"start1":189,"start2":189,"length1":16,"length2":18},{"diffs":[[0,")\n !="],[1,"js"],[0,"('jquery"]],"start1":219,"start2":219,"length1":16,"length2":18}]],"length":261,"saved":false}
{"ts":1362396939308,"patch":[[{"diffs":[[0," !=js('"],[1,"lib/"],[0,"jquery')"]],"start1":223,"start2":223,"length1":16,"length2":20}]],"length":265,"saved":false}
{"contributors":[],"silentsave":false,"ts":1363142267999,"patch":[[{"diffs":[[0,"pp=\""],[-1,"W"],[1,"w"],[0,"ishList"],[-1,"s"],[0,"\")\n "]],"start1":30,"start2":30,"length1":17,"length2":16}]],"length":264,"saved":false}
6 changes: 6 additions & 0 deletions .c9revisions/views/myHomePage.jade.c9save
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{"ts":1362358306103,"silentsave":true,"restoring":false,"patch":[[{"diffs":[[1,"extends layout\nblock body\n div.container-fluid(ng-controller='')\n div.row-fluid\n div.span3\n div.\"well sidebar-nav\"\n ul.\"nav nav-list\"\n li.nav-header\n Side Bar\n li\n a(href=\"#\") My Big Date\n div.span9\n div\n h1 我的心愿单\n form(ng-submit='addWishItem')\n input(placeholder='增加你的心愿吧', ng-model='', autofocus) \n ul\n li(ng-repeat='wish in wilshList')\n form(ng-submit='doneEditing(wishItem)')\n input(ng-model='')"]],"start1":0,"start2":0,"length1":0,"length2":553}]],"length":553}
{"contributors":[],"silentsave":false,"ts":1362358342309,"patch":[[{"diffs":[[0,"Big Date"],[1,"s"],[0,"\n d"]],"start1":252,"start2":252,"length1":16,"length2":17}]],"length":554,"saved":false}
{"contributors":[],"silentsave":false,"ts":1362395194328,"patch":[[{"diffs":[[0,"div."],[-1,"\"well "],[0,"side"]],"start1":108,"start2":108,"length1":14,"length2":8},{"diffs":[[0,"ebar-nav"],[-1,"\""],[0,"\n "]],"start1":115,"start2":115,"length1":17,"length2":16},{"diffs":[[0," ul."],[-1,"\""],[0,"nav nav-"]],"start1":129,"start2":129,"length1":17,"length2":16},{"diffs":[[0,"nav-list"],[-1,"\""],[0,"\n "]],"start1":141,"start2":141,"length1":17,"length2":16}]],"length":545,"saved":false}
{"contributors":[],"silentsave":false,"ts":1363140012957,"patch":[[{"diffs":[[0," li"],[1,".unstyled"],[0,"(ng-repe"]],"start1":421,"start2":421,"length1":16,"length2":25}]],"length":554,"saved":false}
{"ts":1363140034061,"patch":[[{"diffs":[[0,".nav"],[-1," nav-list"],[0,"\n "]],"start1":136,"start2":136,"length1":17,"length2":8}]],"length":545,"saved":false}
{"ts":1363140263978,"patch":[[{"diffs":[[0,"-model='"],[1,"wish.wishDesc"],[0,"')"]],"start1":535,"start2":535,"length1":10,"length2":23}]],"length":558,"saved":false}
{"ts":1363141889599,"patch":[[{"diffs":[[0,"luid"],[-1,"(ng-controller='')"],[0,"\n "]],"start1":43,"start2":43,"length1":26,"length2":8},{"diffs":[[0," ul"],[1,"(ng-controller='WishList')"],[0,"\n "]],"start1":381,"start2":381,"length1":16,"length2":42}]],"length":566,"saved":false}
{"ts":1363142296696,"patch":[[{"diffs":[[0," ul"],[-1,"(ng-controller='WishList')"],[0,"\n "]],"start1":385,"start2":385,"length1":34,"length2":8}]],"length":540,"saved":false}
{"ts":1363142303380,"patch":[[{"diffs":[[0,"ing(wish"],[-1,"Item"],[0,")')\n "]],"start1":479,"start2":479,"length1":20,"length2":16}]],"length":536,"saved":false}
13 changes: 7 additions & 6 deletions assets/js/app.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
'use strict';


// Declare app level module which depends on filters, and services
angular.module('myApp', ['myApp.filters', 'myApp.services', 'myApp.directives']).
angular.module('wishList').
config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
$routeProvider.when('/view1', {templateUrl: 'angular/sample/partial1', controller: MyCtrl1});
$routeProvider.when('/view2', {templateUrl: 'angular/sample/partial2', controller: MyCtrl2});
$routeProvider.otherwise({redirectTo: '/view1'});
$locationProvider.html5Mode(true);
alert("My App");
$routeProvider.when('/', {templateUrl: 'myHomePage', controller: WishListController});
//$routeProvider.when('/view2', {templateUrl: 'angular/sample/partial2', controller: MyCtrl2});
// $routeProvider.otherwise({redirectTo: '/view1'});
//$locationProvider.html5Mode(true);

}]);
24 changes: 18 additions & 6 deletions assets/js/controllers.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

/* Controllers */

/*
function AppCtrl($scope, $http) {
$http({method: 'GET', url: '/api/name'}).
success(function(data, status, headers, config) {
Expand All @@ -11,11 +11,23 @@ function AppCtrl($scope, $http) {
$scope.name = 'Error!'
});
}
*/
function WishListController($scope) {
alert("Hello");
$scope.wishList=[
{"id":1, "wishDesc":"My First Wish"},
{"id":2, "wishDesc":"My second Wish"},
{"id":3, "wishDesc":"My Third Wish"},
{"id":4, "wishDesc":"My Fourth Wish"}
];

$scope.addWishItem = function(){};




}


function MyCtrl1() {}
MyCtrl1.$inject = [];


function MyCtrl2() {
}
MyCtrl2.$inject = [];
7 changes: 5 additions & 2 deletions views/layout.jade
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
doctype 5
html(lang='en', ng-app="WishLists")
html(lang='en', ng-app='wishList')
head
meta(charset='utf8')
base(href='/')
title Welcome To Wish List
!=css('bootstrap.min')
!=js('lib/angular/angular.min')
!=js('lib/bootstrap.min')
!=js('lib/jquery')
!=js('lib/bootstrap.min')
!=js('app')
!=js('controllers')

body
block body
11 changes: 5 additions & 6 deletions views/myHomePage.jade
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
extends layout
block body
div.container-fluid(ng-controller='')
div.container-fluid
div.row-fluid
div.span3
div.sidebar-nav
ul.nav nav-list
ul.nav
li.nav-header
Side Bar
li
Expand All @@ -13,8 +13,7 @@ block body
div
h1 我的心愿单
form(ng-submit='addWishItem')
input(placeholder='增加你的心愿吧', ng-model='', autofocus)
input(placeholder='增加你的心愿吧', ng-model='wish.wishDesc', autofocus)
ul
li(ng-repeat='wish in wilshList')
form(ng-submit='doneEditing(wishItem)')
input(ng-model='')
li(ng-repeat='wish in wishList')
{{wish.wishDesc}}

0 comments on commit 12fe4f3

Please sign in to comment.