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
909f686c
Commit
909f686c
authored
Mar 01, 2012
by
Christoph Burgdorf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed dependency on jquery by using the node method select() instead of the jquery one
parent
5ec4ec5e
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
84 additions
and
89 deletions
+84
-89
architecture-examples/angularjs/index.html
architecture-examples/angularjs/index.html
+50
-51
architecture-examples/angularjs/js/directive.js
architecture-examples/angularjs/js/directive.js
+34
-34
architecture-examples/angularjs/js/libs/jquery-1.7.1.min.js
architecture-examples/angularjs/js/libs/jquery-1.7.1.min.js
+0
-4
No files found.
architecture-examples/angularjs/index.html
View file @
909f686c
<!doctype html>
<html
xmlns:ng=
"http://angularjs.org/"
xmlns:my=
"http://rx.org"
>
<head>
<meta
charset=
"utf-8"
>
<title>
AngularJS - TodoMVC
</title>
<link
rel=
"stylesheet"
href=
"css/base.css"
>
<link
rel=
"stylesheet"
href=
"css/app.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.title }}
</label>
<a
class=
"destroy"
ng:click=
"removeTodo(todo)"
></a>
</div>
<form
ng:submit=
"finishEditing(todo)"
>
<input
class=
"edit"
type=
"text"
name=
"todo.title"
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=
"js/libs/angular/angular.min.js"
ng:autobind
></script>
<script
src=
"js/libs/jquery-1.7.1.min.js"
></script>
<script
src=
"js/controllers.js"
></script>
<script
src=
"js/directive.js"
></script>
</body>
</html>
<!doctype html>
<html
xmlns:ng=
"http://angularjs.org/"
xmlns:my=
"http://rx.org"
>
<head>
<meta
charset=
"utf-8"
>
<title>
AngularJS - TodoMVC
</title>
<link
rel=
"stylesheet"
href=
"css/base.css"
>
<link
rel=
"stylesheet"
href=
"css/app.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.title }}
</label>
<a
class=
"destroy"
ng:click=
"removeTodo(todo)"
></a>
</div>
<form
ng:submit=
"finishEditing(todo)"
>
<input
class=
"edit"
type=
"text"
name=
"todo.title"
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=
"js/libs/angular/angular.min.js"
ng:autobind
></script>
<script
src=
"js/controllers.js"
></script>
<script
src=
"js/directive.js"
></script>
</body>
</html>
architecture-examples/angularjs/js/directive.js
View file @
909f686c
angular
.
directive
(
'
my:blur
'
,
function
(
expression
,
compiledElement
)
{
var
compiler
=
this
;
return
function
(
linkElement
)
{
var
scope
=
this
;
linkElement
.
bind
(
'
blur
'
,
function
(
event
)
{
scope
.
$apply
(
expression
,
linkElement
);
event
.
stopPropagation
();
});
};
});
angular
.
directive
(
'
my:dblclick
'
,
function
(
expression
,
compiledElement
)
{
var
compiler
=
this
;
return
function
(
linkElement
)
{
var
scope
=
this
;
linkElement
.
bind
(
'
dblclick
'
,
function
(
event
)
{
scope
.
$apply
(
expression
,
linkElement
);
event
.
stopPropagation
();
});
};
});
angular
.
directive
(
"
my:focus
"
,
function
(
expression
,
compiledElement
){
return
function
(
element
){
this
.
$watch
(
expression
,
function
(){
if
(
angular
.
formatter
.
boolean
.
parse
(
expression
)){
element
[
0
].
focus
();
$
(
element
[
0
]).
select
();
}
},
element
);
};
});
angular
.
directive
(
'
my:blur
'
,
function
(
expression
,
compiledElement
)
{
var
compiler
=
this
;
return
function
(
linkElement
)
{
var
scope
=
this
;
linkElement
.
bind
(
'
blur
'
,
function
(
event
)
{
scope
.
$apply
(
expression
,
linkElement
);
event
.
stopPropagation
();
});
};
});
angular
.
directive
(
'
my:dblclick
'
,
function
(
expression
,
compiledElement
)
{
var
compiler
=
this
;
return
function
(
linkElement
)
{
var
scope
=
this
;
linkElement
.
bind
(
'
dblclick
'
,
function
(
event
)
{
scope
.
$apply
(
expression
,
linkElement
);
event
.
stopPropagation
();
});
};
});
angular
.
directive
(
"
my:focus
"
,
function
(
expression
,
compiledElement
){
return
function
(
element
){
this
.
$watch
(
expression
,
function
(){
if
(
angular
.
formatter
.
boolean
.
parse
(
expression
)){
element
[
0
].
focus
();
element
[
0
].
select
();
}
},
element
);
};
});
architecture-examples/angularjs/js/libs/jquery-1.7.1.min.js
deleted
100644 → 0
View file @
5ec4ec5e
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