Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
todomvc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eugene Shen
todomvc
Commits
c6efeda0
Commit
c6efeda0
authored
Feb 29, 2012
by
Christoph Burgdorf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanups
parent
6a8987ed
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
35 additions
and
164 deletions
+35
-164
architecture-examples/angularjs/index.html
architecture-examples/angularjs/index.html
+35
-60
architecture-examples/angularjs/index_new.html
architecture-examples/angularjs/index_new.html
+0
-54
architecture-examples/angularjs/js/lib/angular/angular-ie-compat.js
...re-examples/angularjs/js/lib/angular/angular-ie-compat.js
+0
-0
architecture-examples/angularjs/js/lib/angular/angular.js
architecture-examples/angularjs/js/lib/angular/angular.js
+0
-0
architecture-examples/angularjs/js/lib/angular/angular.min.js
...itecture-examples/angularjs/js/lib/angular/angular.min.js
+0
-0
architecture-examples/angularjs/js/lib/angular/version.txt
architecture-examples/angularjs/js/lib/angular/version.txt
+0
-0
architecture-examples/angularjs/lib/rx/rx.angular.js
architecture-examples/angularjs/lib/rx/rx.angular.js
+0
-44
architecture-examples/angularjs/lib/rx/rx.js
architecture-examples/angularjs/lib/rx/rx.js
+0
-6
No files found.
architecture-examples/angularjs/index.html
View file @
c6efeda0
<!doctype html>
<html
xmlns:ng=
"http://angularjs.org/"
xmlns:my=
"http://rx.org"
>
<!doctype html>
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
>
<title>
AngularJS Todo App
</title>
<link
rel=
"stylesheet"
href=
"css/app.css"
/>
<title>
AngularJS - TodoMVC
</title>
<link
rel=
"stylesheet"
href=
"css/app.css"
>
<link
rel=
"stylesheet"
href=
"css/overwrite.css"
>
</head>
<body>
<div
ng:controller=
"App.Controllers.TodoController"
id=
"todoapp"
>
<div
class=
"title"
>
<h1>
Todos
</h1>
</div>
<div
class=
"content"
>
<div
id=
"todo-form"
>
</div>
<header>
<h1>
Todos
</h1>
<form
id=
"todo-form"
ng:submit=
"addTodo()"
>
<input
id=
"new-todo"
name=
"newTodo"
my:blur=
"addTodo()"
placeholder=
"What needs to be done?"
type=
"text"
>
<span
class=
"ui-tooltip-top"
ng:show=
"showHitEnterHint"
>
Press Enter to save this task
</span>
<input
id=
"new-todo"
name=
"newTodo"
type=
"text"
placeholder=
"What needs to be done?"
>
</form>
<div
id=
"todos"
>
</header>
<!-- TODO: figure out if its spec compliant to remove the #main id if its getting into the way?-->
<section
id=
"main"
ng:show=
"hasTodos()"
>
<input
id=
"toggle-all"
type=
"checkbox"
name=
"allChecked"
ng:click=
"toggleAllStates()"
>
<label
for=
"toggle-all"
>
Mark all as complete
</label>
<ul
id=
"todo-list"
>
<li
class=
"todo"
ng:class=
"'editing-' + todo.editing + ' done-' + todo.done"
ng:repeat=
"todo in todos
"
>
<div
class=
"
display
"
>
<input
class=
"check"
type=
"checkbox"
name=
"todo.done"
/
>
<div
ng:click=
"editTodo(todo)"
class=
"todo-content"
>
{{ todo.content }}
</div
>
<span
class=
"todo-destroy"
ng:click=
"removeTodo(todo)"
></span
>
<li
ng:repeat=
"todo in todos"
my:dblclick=
"editTodo(todo)"
ng:class=
"(todo.done && ' done ') + (todo.editing && ' editing ')
"
>
<div
class=
"
view
"
>
<input
class=
"toggle"
type=
"checkbox"
name=
"todo.done"
>
<label>
{{ todo.content }}
</label
>
<a
class=
"destroy"
ng:click=
"removeTodo(todo)"
></a
>
</div>
<div
class=
"edit"
>
<form
ng:submit=
"finishEditing(todo)"
>
<input
class=
"
todo-input"
my:focus=
"todo.editing"
my:blur=
"finishEditing(todo)"
name=
"todo.content"
type=
"text
"
>
<input
class=
"
edit"
type=
"text"
name=
"todo.content"
my:focus=
"todo.editing"
my:blur=
"finishEditing(todo)
"
>
</form>
</div>
</li>
</ul>
</section>
<footer
ng:show=
"hasTodos()"
>
<a
id=
"clear-completed"
ng:click=
"clearCompletedItems()"
ng:show=
"hasFinishedTodos()"
>
{{ clearItemsText() }}
</a>
<div
id=
"todo-count"
><b>
{{ remainingTodos() }}
</b>
{{ itemsLeftText() }}
</div>
</footer>
</div>
<div
id=
"todo-stats"
>
<span
class=
"todo-count"
ng:show=
"hasTodos()"
>
<ng:pluralize
count=
"remainingTodos()"
when=
"{'0' : 'No items left.', '1': '1 item left.', 'other' : '{} items left.' }"
>
</ng:pluralize>
</span>
<span
class=
"todo-clear"
ng:show=
"hasFinishedTodos()"
>
<a
ng:click=
"clearCompletedItems()"
>
Clear
<ng:pluralize
count=
"finishedTodos()"
when=
"{'1': '1 completed item', 'other' : '{} completed items' }"
>
</ng:pluralize>
</a>
</span>
<div
id=
"instructions"
>
Double-click to edit a todo.
</div>
</div>
</div>
<ul
id=
"instructions"
>
<li>
Click to edit a todo.
</li>
</ul>
<div
id=
"credits"
>
<p>
Originally Created by
<br>
<a
href=
"http://jgn.me/"
>
Jérôme Gravel-Niquet
</a>
</p>
<p>
Rewritten to use
<a
href=
"http://angularjs.org"
>
AngularJS
</a>
by
<br>
<a
href=
"http://cburgdorf.wordpress.com/"
>
Christoph Burgdorf
</a>
<br>
Cleanup, edits:
<a
href=
"http://www.linkedin.com/pub/dan-doyon/2/1b0/a83"
>
Dan Doyon
</a>
</p>
Created by
<a
href=
"http://twitter.com/cburgdorf"
>
Christoph Burgdorf
</a>
.
</div>
<script
src=
"js/booter.js"
></script>
<script
src=
"lib/angular/angular.min.js"
ng:autobind
></script>
<script
src=
"lib/rx/rx.js"
></script>
<script
src=
"lib/rx/rx.angular.js"
></script>
<script
src=
"js/lib/angular/angular.min.js"
ng:autobind
></script>
<script
src=
"js/controllers.js"
></script>
<script
src=
"js/directive.js"
></script>
</body>
...
...
architecture-examples/angularjs/index_new.html
deleted
100644 → 0
View file @
6a8987ed
<!doctype html>
<html
xmlns:ng=
"http://angularjs.org/"
xmlns:my=
"http://rx.org"
>
<!doctype html>
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
>
<title>
AngularJS - TodoMVC
</title>
<link
rel=
"stylesheet"
href=
"css/app.css"
>
<link
rel=
"stylesheet"
href=
"css/overwrite.css"
>
</head>
<body>
<div
ng:controller=
"App.Controllers.TodoController"
id=
"todoapp"
>
<header>
<h1>
Todos
</h1>
<form
id=
"todo-form"
ng:submit=
"addTodo()"
>
<input
id=
"new-todo"
name=
"newTodo"
type=
"text"
placeholder=
"What needs to be done?"
>
</form>
</header>
<!-- TODO: figure out if its spec compliant to remove the #main id if its getting into the way?-->
<section
id=
"main"
ng:show=
"hasTodos()"
>
<input
id=
"toggle-all"
type=
"checkbox"
name=
"allChecked"
ng:click=
"toggleAllStates()"
>
<label
for=
"toggle-all"
>
Mark all as complete
</label>
<ul
id=
"todo-list"
>
<li
ng:repeat=
"todo in todos"
my:dblclick=
"editTodo(todo)"
ng:class=
"(todo.done && ' done ') + (todo.editing && ' editing ')"
>
<div
class=
"view"
>
<input
class=
"toggle"
type=
"checkbox"
name=
"todo.done"
>
<label>
{{ todo.content }}
</label>
<a
class=
"destroy"
ng:click=
"removeTodo(todo)"
></a>
</div>
<form
ng:submit=
"finishEditing(todo)"
>
<input
class=
"edit"
type=
"text"
name=
"todo.content"
my:focus=
"todo.editing"
my:blur=
"finishEditing(todo)"
>
</form>
</li>
</ul>
</section>
<footer
ng:show=
"hasTodos()"
>
<a
id=
"clear-completed"
ng:click=
"clearCompletedItems()"
ng:show=
"hasFinishedTodos()"
>
{{ clearItemsText() }}
</a>
<div
id=
"todo-count"
><b>
{{ remainingTodos() }}
</b>
{{ itemsLeftText() }}
</div>
</footer>
</div>
<div
id=
"instructions"
>
Double-click to edit a todo.
</div>
<div
id=
"credits"
>
Created by
<a
href=
"http://twitter.com/cburgdorf"
>
Christoph Burgdorf
</a>
.
</div>
<script
src=
"js/booter.js"
></script>
<script
src=
"lib/angular/angular.min.js"
ng:autobind
></script>
<script
src=
"lib/rx/rx.js"
></script>
<script
src=
"lib/rx/rx.angular.js"
></script>
<script
src=
"js/controllers.js"
></script>
<script
src=
"js/directive.js"
></script>
</body>
</html>
architecture-examples/angularjs/lib/angular/angular-ie-compat.js
→
architecture-examples/angularjs/
js/
lib/angular/angular-ie-compat.js
View file @
c6efeda0
File moved
architecture-examples/angularjs/lib/angular/angular.js
→
architecture-examples/angularjs/
js/
lib/angular/angular.js
View file @
c6efeda0
File moved
architecture-examples/angularjs/lib/angular/angular.min.js
→
architecture-examples/angularjs/
js/
lib/angular/angular.min.js
View file @
c6efeda0
File moved
architecture-examples/angularjs/lib/angular/version.txt
→
architecture-examples/angularjs/
js/
lib/angular/version.txt
View file @
c6efeda0
File moved
architecture-examples/angularjs/lib/rx/rx.angular.js
deleted
100644 → 0
View file @
6a8987ed
(
function
()
{
var
global
=
this
,
root
=
(
typeof
ProvideCustomRxRootObject
==
"
undefined
"
)
?
global
.
Rx
:
ProvideCustomRxRootObject
();
var
observable
=
root
.
Observable
;
var
observableCreate
=
observable
.
Create
;
observable
.
FromAngularScope
=
function
(
angularScope
,
propertyName
)
{
return
observableCreate
(
function
(
observer
)
{
var
unwatch
=
angularScope
.
$watch
(
function
(){
return
angularScope
[
propertyName
];
},
function
(){
observer
.
OnNext
(
angularScope
[
propertyName
]);
});
return
function
()
{
unwatch
();
};
})
.
Skip
(
1
);
//In AngularJS 0.10.x There is no way to avoid initial evaluation. So we take care about it!
};
observable
.
prototype
.
ToOutputProperty
=
function
(
scope
,
propertyName
)
{
var
disposable
=
this
.
Subscribe
(
function
(
data
)
{
scope
[
propertyName
]
=
data
;
scope
.
$apply
();
});
scope
.
$on
(
'
$destroy
'
,
function
(
event
){
//we need to asure that we only dispose the observable when it's our scope that
//was destroyed.
//TODO: Figure out if thats enough to asure the above (e.g what happens when
//a child scope will be destroyed but ours won't be affected. Or the other way around,
//if a higher scope will be destroyed (and therefore ours as well) does it mean that $destroy()
//will be also called on our scope or will our scope get destroyed without actually
//calling $destroy() on it?
if
(
event
.
targetScope
===
scope
){
disposable
.
Dispose
();
}
});
};
})();
\ No newline at end of file
architecture-examples/angularjs/lib/rx/rx.js
deleted
100644 → 0
View file @
6a8987ed
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment