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
f0ba5464
Commit
f0ba5464
authored
Mar 20, 2012
by
Sindre Sorhus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix CRLF problem after the latest pull merge
parent
3a6db4da
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
430 additions
and
430 deletions
+430
-430
architecture-examples/angularjs/css/app.css
architecture-examples/angularjs/css/app.css
+3
-3
architecture-examples/angularjs/css/base.css
architecture-examples/angularjs/css/base.css
+201
-201
architecture-examples/angularjs/index.html
architecture-examples/angularjs/index.html
+50
-50
architecture-examples/angularjs/js/controllers.js
architecture-examples/angularjs/js/controllers.js
+107
-107
architecture-examples/angularjs/js/directive.js
architecture-examples/angularjs/js/directive.js
+34
-34
architecture-examples/angularjs/js/libs/angular/angular-ie-compat.js
...e-examples/angularjs/js/libs/angular/angular-ie-compat.js
+35
-35
No files found.
architecture-examples/angularjs/css/app.css
View file @
f0ba5464
/*this doesn't seem to be used in the jquery example at all. Its getting in the way */
/*this doesn't seem to be used in the jquery example at all. Its getting in the way */
#todo-count
span
{
#todo-count
span
{
font-weight
:
inherit
;
font-weight
:
inherit
;
}
}
\ No newline at end of file
architecture-examples/angularjs/css/base.css
View file @
f0ba5464
html
,
html
,
body
{
body
{
margin
:
0
;
margin
:
0
;
padding
:
0
;
padding
:
0
;
}
}
body
{
body
{
font
:
14px
"Helvetica Neue"
,
Helvetica
,
Arial
,
sans-serif
;
font
:
14px
"Helvetica Neue"
,
Helvetica
,
Arial
,
sans-serif
;
line-height
:
1.4em
;
line-height
:
1.4em
;
background
:
#eeeeee
;
background
:
#eeeeee
;
color
:
#333333
;
color
:
#333333
;
width
:
520px
;
width
:
520px
;
margin
:
0
auto
;
margin
:
0
auto
;
-webkit-font-smoothing
:
antialiased
;
-webkit-font-smoothing
:
antialiased
;
}
}
#todoapp
{
#todoapp
{
background
:
#fff
;
background
:
#fff
;
padding
:
20px
;
padding
:
20px
;
margin-bottom
:
40px
;
margin-bottom
:
40px
;
-webkit-box-shadow
:
rgba
(
0
,
0
,
0
,
0.2
)
0
2px
6px
0
;
-webkit-box-shadow
:
rgba
(
0
,
0
,
0
,
0.2
)
0
2px
6px
0
;
-moz-box-shadow
:
rgba
(
0
,
0
,
0
,
0.2
)
0
2px
6px
0
;
-moz-box-shadow
:
rgba
(
0
,
0
,
0
,
0.2
)
0
2px
6px
0
;
-ms-box-shadow
:
rgba
(
0
,
0
,
0
,
0.2
)
0
2px
6px
0
;
-ms-box-shadow
:
rgba
(
0
,
0
,
0
,
0.2
)
0
2px
6px
0
;
-o-box-shadow
:
rgba
(
0
,
0
,
0
,
0.2
)
0
2px
6px
0
;
-o-box-shadow
:
rgba
(
0
,
0
,
0
,
0.2
)
0
2px
6px
0
;
box-shadow
:
rgba
(
0
,
0
,
0
,
0.2
)
0
2px
6px
0
;
box-shadow
:
rgba
(
0
,
0
,
0
,
0.2
)
0
2px
6px
0
;
-webkit-border-radius
:
0
0
5px
5px
;
-webkit-border-radius
:
0
0
5px
5px
;
-moz-border-radius
:
0
0
5px
5px
;
-moz-border-radius
:
0
0
5px
5px
;
-ms-border-radius
:
0
0
5px
5px
;
-ms-border-radius
:
0
0
5px
5px
;
-o-border-radius
:
0
0
5px
5px
;
-o-border-radius
:
0
0
5px
5px
;
border-radius
:
0
0
5px
5px
;
border-radius
:
0
0
5px
5px
;
}
}
#todoapp
h1
{
#todoapp
h1
{
font-size
:
36px
;
font-size
:
36px
;
font-weight
:
bold
;
font-weight
:
bold
;
text-align
:
center
;
text-align
:
center
;
padding
:
0
0
10px
0
;
padding
:
0
0
10px
0
;
}
}
#todoapp
input
[
type
=
"text"
]
{
#todoapp
input
[
type
=
"text"
]
{
width
:
466px
;
width
:
466px
;
font-size
:
24px
;
font-size
:
24px
;
font-family
:
inherit
;
font-family
:
inherit
;
line-height
:
1.4em
;
line-height
:
1.4em
;
border
:
0
;
border
:
0
;
outline
:
none
;
outline
:
none
;
padding
:
6px
;
padding
:
6px
;
border
:
1px
solid
#999999
;
border
:
1px
solid
#999999
;
-webkit-box-shadow
:
rgba
(
0
,
0
,
0
,
0.2
)
0
1px
2px
0
inset
;
-webkit-box-shadow
:
rgba
(
0
,
0
,
0
,
0.2
)
0
1px
2px
0
inset
;
-moz-box-shadow
:
rgba
(
0
,
0
,
0
,
0.2
)
0
1px
2px
0
inset
;
-moz-box-shadow
:
rgba
(
0
,
0
,
0
,
0.2
)
0
1px
2px
0
inset
;
-ms-box-shadow
:
rgba
(
0
,
0
,
0
,
0.2
)
0
1px
2px
0
inset
;
-ms-box-shadow
:
rgba
(
0
,
0
,
0
,
0.2
)
0
1px
2px
0
inset
;
-o-box-shadow
:
rgba
(
0
,
0
,
0
,
0.2
)
0
1px
2px
0
inset
;
-o-box-shadow
:
rgba
(
0
,
0
,
0
,
0.2
)
0
1px
2px
0
inset
;
box-shadow
:
rgba
(
0
,
0
,
0
,
0.2
)
0
1px
2px
0
inset
;
box-shadow
:
rgba
(
0
,
0
,
0
,
0.2
)
0
1px
2px
0
inset
;
}
}
#todoapp
input
::-webkit-input-placeholder
{
#todoapp
input
::-webkit-input-placeholder
{
font-style
:
italic
;
font-style
:
italic
;
}
}
#todo-list
{
#todo-list
{
margin
:
10px
0
;
margin
:
10px
0
;
padding
:
0
;
padding
:
0
;
list-style
:
none
;
list-style
:
none
;
}
}
#todo-list
li
{
#todo-list
li
{
padding
:
18px
20px
18px
0
;
padding
:
18px
20px
18px
0
;
position
:
relative
;
position
:
relative
;
font-size
:
24px
;
font-size
:
24px
;
border-bottom
:
1px
solid
#cccccc
;
border-bottom
:
1px
solid
#cccccc
;
}
}
#todo-list
li
:last-child
{
#todo-list
li
:last-child
{
border-bottom
:
none
;
border-bottom
:
none
;
}
}
#todo-list
li
.done
label
{
#todo-list
li
.done
label
{
color
:
#777777
;
color
:
#777777
;
text-decoration
:
line-through
;
text-decoration
:
line-through
;
}
}
#todo-list
li
.destroy
{
#todo-list
li
.destroy
{
display
:
none
;
display
:
none
;
position
:
absolute
;
position
:
absolute
;
top
:
20px
;
top
:
20px
;
right
:
10px
;
right
:
10px
;
cursor
:
pointer
;
cursor
:
pointer
;
width
:
20px
;
width
:
20px
;
height
:
20px
;
height
:
20px
;
background
:
url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUBAMAAAB/pwA+AAAABGdBTUEAALGPC/xhBQAAACdQTFRFzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMAAAA////zMzMhnu0WAAAAAt0Uk5T5u3pqtV3jFQEKAC0bVelAAAAfUlEQVQI12NYtWpFsc8R865VqxhWrZpyBgg8QcylZ8AgCsjMgTCPrWJYfgYKqhjWwJgaDDVnzpw+c2bPmTPHGWzOnNm95/TuM2cOM/AARXfvBooeZAAp270bRCIz4QoOIGtDMqwJZoUEQzvCYrhzuhhWtUKYEahOX7UK6iEA3A6NUGwCTZIAAAAASUVORK5CYII=')
no-repeat
center
center
;
background
:
url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUBAMAAAB/pwA+AAAABGdBTUEAALGPC/xhBQAAACdQTFRFzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMAAAA////zMzMhnu0WAAAAAt0Uk5T5u3pqtV3jFQEKAC0bVelAAAAfUlEQVQI12NYtWpFsc8R865VqxhWrZpyBgg8QcylZ8AgCsjMgTCPrWJYfgYKqhjWwJgaDDVnzpw+c2bPmTPHGWzOnNm95/TuM2cOM/AARXfvBooeZAAp270bRCIz4QoOIGtDMqwJZoUEQzvCYrhzuhhWtUKYEahOX7UK6iEA3A6NUGwCTZIAAAAASUVORK5CYII=')
no-repeat
center
center
;
}
}
#todo-list
li
:hover
.destroy
{
#todo-list
li
:hover
.destroy
{
display
:
block
;
display
:
block
;
}
}
#todo-list
li
.editing
{
#todo-list
li
.editing
{
border-bottom
:
none
;
border-bottom
:
none
;
margin-top
:
-1px
;
margin-top
:
-1px
;
padding
:
0
;
padding
:
0
;
}
}
#todo-list
li
.editing
:last-child
{
#todo-list
li
.editing
:last-child
{
margin-bottom
:
-1px
;
margin-bottom
:
-1px
;
}
}
#todo-list
li
.editing
.edit
{
#todo-list
li
.editing
.edit
{
display
:
block
;
display
:
block
;
width
:
444px
;
width
:
444px
;
padding
:
13px
15px
14px
20px
;
padding
:
13px
15px
14px
20px
;
margin
:
0
;
margin
:
0
;
}
}
#todo-list
li
.editing
.view
{
#todo-list
li
.editing
.view
{
display
:
none
;
display
:
none
;
}
}
#todo-list
li
.view
label
{
#todo-list
li
.view
label
{
word-break
:
break-word
;
word-break
:
break-word
;
}
}
#todo-list
li
.edit
{
#todo-list
li
.edit
{
display
:
none
;
display
:
none
;
}
}
#todoapp
footer
{
#todoapp
footer
{
margin
:
0
-20px
-20px
-20px
;
margin
:
0
-20px
-20px
-20px
;
overflow
:
hidden
;
overflow
:
hidden
;
color
:
#555555
;
color
:
#555555
;
background
:
#f4fce8
;
background
:
#f4fce8
;
border-top
:
1px
solid
#ededed
;
border-top
:
1px
solid
#ededed
;
padding
:
0
20px
;
padding
:
0
20px
;
line-height
:
37px
;
line-height
:
37px
;
-webkit-border-radius
:
0
0
5px
5px
;
-webkit-border-radius
:
0
0
5px
5px
;
-moz-border-radius
:
0
0
5px
5px
;
-moz-border-radius
:
0
0
5px
5px
;
-ms-border-radius
:
0
0
5px
5px
;
-ms-border-radius
:
0
0
5px
5px
;
-o-border-radius
:
0
0
5px
5px
;
-o-border-radius
:
0
0
5px
5px
;
border-radius
:
0
0
5px
5px
;
border-radius
:
0
0
5px
5px
;
}
}
#clear-completed
{
#clear-completed
{
float
:
right
;
float
:
right
;
line-height
:
20px
;
line-height
:
20px
;
text-decoration
:
none
;
text-decoration
:
none
;
background
:
rgba
(
0
,
0
,
0
,
0.1
);
background
:
rgba
(
0
,
0
,
0
,
0.1
);
color
:
#555555
;
color
:
#555555
;
font-size
:
11px
;
font-size
:
11px
;
margin-top
:
8px
;
margin-top
:
8px
;
margin-bottom
:
8px
;
margin-bottom
:
8px
;
padding
:
0
10px
1px
;
padding
:
0
10px
1px
;
cursor
:
pointer
;
cursor
:
pointer
;
-webkit-border-radius
:
12px
;
-webkit-border-radius
:
12px
;
-moz-border-radius
:
12px
;
-moz-border-radius
:
12px
;
-ms-border-radius
:
12px
;
-ms-border-radius
:
12px
;
-o-border-radius
:
12px
;
-o-border-radius
:
12px
;
border-radius
:
12px
;
border-radius
:
12px
;
-webkit-box-shadow
:
rgba
(
0
,
0
,
0
,
0.2
)
0
-1px
0
0
;
-webkit-box-shadow
:
rgba
(
0
,
0
,
0
,
0.2
)
0
-1px
0
0
;
-moz-box-shadow
:
rgba
(
0
,
0
,
0
,
0.2
)
0
-1px
0
0
;
-moz-box-shadow
:
rgba
(
0
,
0
,
0
,
0.2
)
0
-1px
0
0
;
-ms-box-shadow
:
rgba
(
0
,
0
,
0
,
0.2
)
0
-1px
0
0
;
-ms-box-shadow
:
rgba
(
0
,
0
,
0
,
0.2
)
0
-1px
0
0
;
-o-box-shadow
:
rgba
(
0
,
0
,
0
,
0.2
)
0
-1px
0
0
;
-o-box-shadow
:
rgba
(
0
,
0
,
0
,
0.2
)
0
-1px
0
0
;
box-shadow
:
rgba
(
0
,
0
,
0
,
0.2
)
0
-1px
0
0
;
box-shadow
:
rgba
(
0
,
0
,
0
,
0.2
)
0
-1px
0
0
;
}
}
#clear-completed
:hover
{
#clear-completed
:hover
{
background
:
rgba
(
0
,
0
,
0
,
0.15
);
background
:
rgba
(
0
,
0
,
0
,
0.15
);
-webkit-box-shadow
:
rgba
(
0
,
0
,
0
,
0.3
)
0
-1px
0
0
;
-webkit-box-shadow
:
rgba
(
0
,
0
,
0
,
0.3
)
0
-1px
0
0
;
-moz-box-shadow
:
rgba
(
0
,
0
,
0
,
0.3
)
0
-1px
0
0
;
-moz-box-shadow
:
rgba
(
0
,
0
,
0
,
0.3
)
0
-1px
0
0
;
-ms-box-shadow
:
rgba
(
0
,
0
,
0
,
0.3
)
0
-1px
0
0
;
-ms-box-shadow
:
rgba
(
0
,
0
,
0
,
0.3
)
0
-1px
0
0
;
-o-box-shadow
:
rgba
(
0
,
0
,
0
,
0.3
)
0
-1px
0
0
;
-o-box-shadow
:
rgba
(
0
,
0
,
0
,
0.3
)
0
-1px
0
0
;
box-shadow
:
rgba
(
0
,
0
,
0
,
0.3
)
0
-1px
0
0
;
box-shadow
:
rgba
(
0
,
0
,
0
,
0.3
)
0
-1px
0
0
;
}
}
#clear-completed
:active
{
#clear-completed
:active
{
position
:
relative
;
position
:
relative
;
top
:
1px
;
top
:
1px
;
}
}
#todo-count
span
{
#todo-count
span
{
font-weight
:
bold
;
font-weight
:
bold
;
}
}
#instructions
{
#instructions
{
margin
:
10px
auto
;
margin
:
10px
auto
;
color
:
#777777
;
color
:
#777777
;
text-shadow
:
rgba
(
255
,
255
,
255
,
0.8
)
0
1px
0
;
text-shadow
:
rgba
(
255
,
255
,
255
,
0.8
)
0
1px
0
;
text-align
:
center
;
text-align
:
center
;
}
}
#instructions
a
{
#instructions
a
{
color
:
#336699
;
color
:
#336699
;
}
}
#credits
{
#credits
{
margin
:
30px
auto
;
margin
:
30px
auto
;
color
:
#999
;
color
:
#999
;
text-shadow
:
rgba
(
255
,
255
,
255
,
0.8
)
0
1px
0
;
text-shadow
:
rgba
(
255
,
255
,
255
,
0.8
)
0
1px
0
;
text-align
:
center
;
text-align
:
center
;
}
}
#credits
a
{
#credits
a
{
color
:
#888
;
color
:
#888
;
}
}
\ No newline at end of file
architecture-examples/angularjs/index.html
View file @
f0ba5464
<!doctype html>
<!doctype html>
<html
xmlns:ng=
"http://angularjs.org/"
xmlns:my=
"http://rx.org"
>
<html
xmlns:ng=
"http://angularjs.org/"
xmlns:my=
"http://rx.org"
>
<head>
<head>
<meta
charset=
"utf-8"
>
<meta
charset=
"utf-8"
>
<title>
AngularJS - TodoMVC
</title>
<title>
AngularJS - TodoMVC
</title>
<link
rel=
"stylesheet"
href=
"css/base.css"
>
<link
rel=
"stylesheet"
href=
"css/base.css"
>
<link
rel=
"stylesheet"
href=
"css/app.css"
>
<link
rel=
"stylesheet"
href=
"css/app.css"
>
</head>
</head>
<body>
<body>
<div
ng:controller=
"App.Controllers.TodoController"
id=
"todoapp"
>
<div
ng:controller=
"App.Controllers.TodoController"
id=
"todoapp"
>
<header>
<header>
<h1>
Todos
</h1>
<h1>
Todos
</h1>
<form
id=
"todo-form"
ng:submit=
"addTodo()"
>
<form
id=
"todo-form"
ng:submit=
"addTodo()"
>
<input
id=
"new-todo"
name=
"newTodo"
type=
"text"
placeholder=
"What needs to be done?"
>
<input
id=
"new-todo"
name=
"newTodo"
type=
"text"
placeholder=
"What needs to be done?"
>
</form>
</form>
</header>
</header>
<section
id=
"main"
ng:show=
"hasTodos()"
>
<section
id=
"main"
ng:show=
"hasTodos()"
>
<input
id=
"toggle-all"
type=
"checkbox"
name=
"allChecked"
ng:click=
"toggleAllStates()"
>
<input
id=
"toggle-all"
type=
"checkbox"
name=
"allChecked"
ng:click=
"toggleAllStates()"
>
<label
for=
"toggle-all"
>
Mark all as complete
</label>
<label
for=
"toggle-all"
>
Mark all as complete
</label>
<ul
id=
"todo-list"
>
<ul
id=
"todo-list"
>
<li
ng:repeat=
"todo in todos"
my:dblclick=
"editTodo(todo)"
ng:class=
"(todo.done && ' done ') + (todo.editing && ' editing ')"
>
<li
ng:repeat=
"todo in todos"
my:dblclick=
"editTodo(todo)"
ng:class=
"(todo.done && ' done ') + (todo.editing && ' editing ')"
>
<div
class=
"view"
>
<div
class=
"view"
>
<input
class=
"toggle"
type=
"checkbox"
name=
"todo.done"
>
<input
class=
"toggle"
type=
"checkbox"
name=
"todo.done"
>
<label>
{{ todo.title }}
</label>
<label>
{{ todo.title }}
</label>
<a
class=
"destroy"
ng:click=
"removeTodo(todo)"
></a>
<a
class=
"destroy"
ng:click=
"removeTodo(todo)"
></a>
</div>
</div>
<form
ng:submit=
"finishEditing(todo)"
>
<form
ng:submit=
"finishEditing(todo)"
>
<input
class=
"edit"
type=
"text"
name=
"todo.title"
my:focus=
"todo.editing"
my:blur=
"finishEditing(todo)"
>
<input
class=
"edit"
type=
"text"
name=
"todo.title"
my:focus=
"todo.editing"
my:blur=
"finishEditing(todo)"
>
</form>
</form>
</li>
</li>
</ul>
</ul>
</section>
</section>
<footer
ng:show=
"hasTodos()"
>
<footer
ng:show=
"hasTodos()"
>
<a
id=
"clear-completed"
ng:click=
"clearCompletedItems()"
ng:show=
"hasFinishedTodos()"
>
{{ clearItemsText() }}
</a>
<a
id=
"clear-completed"
ng:click=
"clearCompletedItems()"
ng:show=
"hasFinishedTodos()"
>
{{ clearItemsText() }}
</a>
<div
id=
"todo-count"
><b>
{{ remainingTodos() }}
</b>
{{ itemsLeftText() }}
</div>
<div
id=
"todo-count"
><b>
{{ remainingTodos() }}
</b>
{{ itemsLeftText() }}
</div>
</footer>
</footer>
</div>
</div>
<div
id=
"instructions"
>
<div
id=
"instructions"
>
Double-click to edit a todo.
Double-click to edit a todo.
</div>
</div>
<div
id=
"credits"
>
<div
id=
"credits"
>
Created by
<a
href=
"http://twitter.com/cburgdorf"
>
Christoph Burgdorf
</a>
.
Created by
<a
href=
"http://twitter.com/cburgdorf"
>
Christoph Burgdorf
</a>
.
</div>
</div>
<script
src=
"js/libs/json2.js"
></script>
<script
src=
"js/libs/json2.js"
></script>
<script
src=
"js/booter.js"
></script>
<script
src=
"js/booter.js"
></script>
<script
src=
"js/libs/angular/angular.min.js"
ng:autobind
></script>
<script
src=
"js/libs/angular/angular.min.js"
ng:autobind
></script>
<script
src=
"js/controllers.js"
></script>
<script
src=
"js/controllers.js"
></script>
<script
src=
"js/directive.js"
></script>
<script
src=
"js/directive.js"
></script>
</body>
</body>
</html>
</html>
architecture-examples/angularjs/js/controllers.js
View file @
f0ba5464
/* App Controllers */
/* App Controllers */
App
.
Controllers
.
TodoController
=
function
()
{
App
.
Controllers
.
TodoController
=
function
()
{
var
self
=
this
;
var
self
=
this
;
self
.
newTodo
=
""
;
self
.
newTodo
=
""
;
var
retrieveStore
=
function
()
{
var
retrieveStore
=
function
()
{
var
store
=
localStorage
.
getItem
(
'
todo-angularjs
'
);
var
store
=
localStorage
.
getItem
(
'
todo-angularjs
'
);
return
(
store
&&
JSON
.
parse
(
store
)
)
||
[];
return
(
store
&&
JSON
.
parse
(
store
)
)
||
[];
};
};
var
updateStore
=
function
()
{
var
updateStore
=
function
()
{
var
isEditing
=
angular
.
Array
.
count
(
self
.
todos
,
function
(
x
)
{
var
isEditing
=
angular
.
Array
.
count
(
self
.
todos
,
function
(
x
)
{
return
x
.
editing
;
return
x
.
editing
;
});
});
if
(
!
isEditing
){
if
(
!
isEditing
){
localStorage
.
setItem
(
'
todo-angularjs
'
,
JSON
.
stringify
(
self
.
todos
));
localStorage
.
setItem
(
'
todo-angularjs
'
,
JSON
.
stringify
(
self
.
todos
));
}
}
};
};
//not sure if its intended to do so. However, we need a hook to update the store
//not sure if its intended to do so. However, we need a hook to update the store
//whenever angular changes any properties
//whenever angular changes any properties
self
.
$watch
(
updateStore
);
self
.
$watch
(
updateStore
);
self
.
todos
=
retrieveStore
();
self
.
todos
=
retrieveStore
();
self
.
addTodo
=
function
()
{
self
.
addTodo
=
function
()
{
if
(
self
.
newTodo
.
trim
().
length
===
0
)
return
;
if
(
self
.
newTodo
.
trim
().
length
===
0
)
return
;
self
.
todos
.
push
({
self
.
todos
.
push
({
title
:
self
.
newTodo
,
title
:
self
.
newTodo
,
done
:
false
,
done
:
false
,
editing
:
false
editing
:
false
});
});
self
.
newTodo
=
""
;
self
.
newTodo
=
""
;
};
};
self
.
editTodo
=
function
(
todo
)
{
self
.
editTodo
=
function
(
todo
)
{
//cancel any active editing operation
//cancel any active editing operation
angular
.
forEach
(
self
.
todos
,
function
(
value
)
{
angular
.
forEach
(
self
.
todos
,
function
(
value
)
{
value
.
editing
=
false
;
value
.
editing
=
false
;
});
});
todo
.
editing
=
true
;
todo
.
editing
=
true
;
};
};
self
.
finishEditing
=
function
(
todo
)
{
self
.
finishEditing
=
function
(
todo
)
{
if
(
todo
.
title
.
trim
().
length
===
0
){
if
(
todo
.
title
.
trim
().
length
===
0
){
self
.
removeTodo
(
todo
);
self
.
removeTodo
(
todo
);
}
}
else
{
else
{
todo
.
editing
=
false
;
todo
.
editing
=
false
;
}
}
};
};
self
.
removeTodo
=
function
(
todo
)
{
self
.
removeTodo
=
function
(
todo
)
{
angular
.
Array
.
remove
(
self
.
todos
,
todo
);
angular
.
Array
.
remove
(
self
.
todos
,
todo
);
};
};
var
countTodos
=
function
(
done
)
{
var
countTodos
=
function
(
done
)
{
return
function
()
{
return
function
()
{
return
angular
.
Array
.
count
(
self
.
todos
,
function
(
x
)
{
return
angular
.
Array
.
count
(
self
.
todos
,
function
(
x
)
{
return
x
.
done
===
(
done
===
"
done
"
);
return
x
.
done
===
(
done
===
"
done
"
);
});
});
}
}
};
};
var
pluralize
=
function
(
count
,
word
)
{
var
pluralize
=
function
(
count
,
word
)
{
return
count
===
1
?
word
:
word
+
'
s
'
;
return
count
===
1
?
word
:
word
+
'
s
'
;
};
};
self
.
remainingTodos
=
countTodos
(
"
undone
"
);
self
.
remainingTodos
=
countTodos
(
"
undone
"
);
self
.
finishedTodos
=
countTodos
(
"
done
"
);
self
.
finishedTodos
=
countTodos
(
"
done
"
);
self
.
itemsLeftText
=
function
(){
self
.
itemsLeftText
=
function
(){
return
pluralize
(
self
.
remainingTodos
(),
'
item
'
)
+
'
left
'
return
pluralize
(
self
.
remainingTodos
(),
'
item
'
)
+
'
left
'
};
};
self
.
clearItemsText
=
function
(){
self
.
clearItemsText
=
function
(){
var
finishedTodos
=
self
.
finishedTodos
();
var
finishedTodos
=
self
.
finishedTodos
();
return
'
Clear
'
+
finishedTodos
+
'
completed
'
+
pluralize
(
finishedTodos
,
'
item
'
);
return
'
Clear
'
+
finishedTodos
+
'
completed
'
+
pluralize
(
finishedTodos
,
'
item
'
);
};
};
self
.
clearCompletedItems
=
function
()
{
self
.
clearCompletedItems
=
function
()
{
var
oldTodos
=
self
.
todos
;
var
oldTodos
=
self
.
todos
;
self
.
todos
=
[];
self
.
todos
=
[];
angular
.
forEach
(
oldTodos
,
function
(
todo
)
{
angular
.
forEach
(
oldTodos
,
function
(
todo
)
{
if
(
!
todo
.
done
)
self
.
todos
.
push
(
todo
);
if
(
!
todo
.
done
)
self
.
todos
.
push
(
todo
);
});
});
self
.
allChecked
=
false
;
self
.
allChecked
=
false
;
};
};
self
.
toggleAllStates
=
function
(){
self
.
toggleAllStates
=
function
(){
angular
.
forEach
(
self
.
todos
,
function
(
todo
){
angular
.
forEach
(
self
.
todos
,
function
(
todo
){
todo
.
done
=
self
.
allChecked
;
todo
.
done
=
self
.
allChecked
;
})
})
};
};
self
.
hasFinishedTodos
=
function
()
{
self
.
hasFinishedTodos
=
function
()
{
return
self
.
finishedTodos
()
>
0
;
return
self
.
finishedTodos
()
>
0
;
};
};
self
.
hasTodos
=
function
()
{
self
.
hasTodos
=
function
()
{
return
self
.
todos
.
length
>
0
;
return
self
.
todos
.
length
>
0
;
};
};
};
};
architecture-examples/angularjs/js/directive.js
View file @
f0ba5464
angular
.
directive
(
'
my:blur
'
,
function
(
expression
,
compiledElement
)
{
angular
.
directive
(
'
my:blur
'
,
function
(
expression
,
compiledElement
)
{
var
compiler
=
this
;
var
compiler
=
this
;
return
function
(
linkElement
)
{
return
function
(
linkElement
)
{
var
scope
=
this
;
var
scope
=
this
;
linkElement
.
bind
(
'
blur
'
,
function
(
event
)
{
linkElement
.
bind
(
'
blur
'
,
function
(
event
)
{
scope
.
$apply
(
expression
,
linkElement
);
scope
.
$apply
(
expression
,
linkElement
);
event
.
stopPropagation
();
event
.
stopPropagation
();
});
});
};
};
});
});
angular
.
directive
(
'
my:dblclick
'
,
function
(
expression
,
compiledElement
)
{
angular
.
directive
(
'
my:dblclick
'
,
function
(
expression
,
compiledElement
)
{
var
compiler
=
this
;
var
compiler
=
this
;
return
function
(
linkElement
)
{
return
function
(
linkElement
)
{
var
scope
=
this
;
var
scope
=
this
;
linkElement
.
bind
(
'
dblclick
'
,
function
(
event
)
{
linkElement
.
bind
(
'
dblclick
'
,
function
(
event
)
{
scope
.
$apply
(
expression
,
linkElement
);
scope
.
$apply
(
expression
,
linkElement
);
event
.
stopPropagation
();
event
.
stopPropagation
();
});
});
};
};
});
});
angular
.
directive
(
"
my:focus
"
,
function
(
expression
,
compiledElement
){
angular
.
directive
(
"
my:focus
"
,
function
(
expression
,
compiledElement
){
return
function
(
element
){
return
function
(
element
){
this
.
$watch
(
expression
,
function
(){
this
.
$watch
(
expression
,
function
(){
if
(
angular
.
formatter
.
boolean
.
parse
(
expression
)){
if
(
angular
.
formatter
.
boolean
.
parse
(
expression
)){
element
[
0
].
focus
();
element
[
0
].
focus
();
element
[
0
].
select
();
element
[
0
].
select
();
}
}
},
element
);
},
element
);
};
};
});
});
architecture-examples/angularjs/js/libs/angular/angular-ie-compat.js
View file @
f0ba5464
/*
/*
Content-Type: multipart/related; boundary="_"
Content-Type: multipart/related; boundary="_"
--_
--_
Content-Location:img0
Content-Location:img0
Content-Transfer-Encoding:base64
Content-Transfer-Encoding:base64
R0lGODlhCwAXAKIAAMzMzO/v7/f39////////wAAAAAAAAAAACH5BAUUAAQALAAAAAALABcAAAMrSLoc/AG8FeUUIN+sGebWAnbKSJodqqlsOxJtqYooU9vvk+vcJIcTkg+QAAA7
R0lGODlhCwAXAKIAAMzMzO/v7/f39////////wAAAAAAAAAAACH5BAUUAAQALAAAAAALABcAAAMrSLoc/AG8FeUUIN+sGebWAnbKSJodqqlsOxJtqYooU9vvk+vcJIcTkg+QAAA7
--_
--_
Content-Location:img1
Content-Location:img1
Content-Transfer-Encoding:base64
Content-Transfer-Encoding:base64
R0lGODlhCwAXAKIAAMzMzO/v7/f39////////wAAAAAAAAAAACH5BAUUAAQALAAAAAALABcAAAMrCLTcoM29yN6k9socs91e5X3EyJloipYrO4ohTMqA0Fn2XVNswJe+H+SXAAA7
R0lGODlhCwAXAKIAAMzMzO/v7/f39////////wAAAAAAAAAAACH5BAUUAAQALAAAAAALABcAAAMrCLTcoM29yN6k9socs91e5X3EyJloipYrO4ohTMqA0Fn2XVNswJe+H+SXAAA7
--_
--_
Content-Location:img2
Content-Location:img2
Content-Transfer-Encoding:base64
Content-Transfer-Encoding:base64
R0lGODlhEAAQAPQAAP///wAAAPDw8IqKiuDg4EZGRnp6egAAAFhYWCQkJKysrL6+vhQUFJycnAQEBDY2NmhoaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAEAAQAAAFdyAgAgIJIeWoAkRCCMdBkKtIHIngyMKsErPBYbADpkSCwhDmQCBethRB6Vj4kFCkQPG4IlWDgrNRIwnO4UKBXDufzQvDMaoSDBgFb886MiQadgNABAokfCwzBA8LCg0Egl8jAggGAA1kBIA1BAYzlyILczULC2UhACH5BAkKAAAALAAAAAAQABAAAAV2ICACAmlAZTmOREEIyUEQjLKKxPHADhEvqxlgcGgkGI1DYSVAIAWMx+lwSKkICJ0QsHi9RgKBwnVTiRQQgwF4I4UFDQQEwi6/3YSGWRRmjhEETAJfIgMFCnAKM0KDV4EEEAQLiF18TAYNXDaSe3x6mjidN1s3IQAh+QQJCgAAACwAAAAAEAAQAAAFeCAgAgLZDGU5jgRECEUiCI+yioSDwDJyLKsXoHFQxBSHAoAAFBhqtMJg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href
.
replace
(
/
\/[^\/]
+
(
#.*
)?
$/
,
'
/
'
)
+
var
jsUri
=
document
.
location
.
href
.
replace
(
/
\/[^\/]
+
(
#.*
)?
$/
,
'
/
'
)
+
document
.
getElementById
(
'
ng-ie-compat
'
).
src
,
document
.
getElementById
(
'
ng-ie-compat
'
).
src
,
css
=
'
#ng-callout .ng-arrow-left{*background-image:url("mhtml:
'
+
jsUri
+
'
!img0")}#ng-callout .ng-arrow-right{*background-image:url("mhtml:
'
+
jsUri
+
'
!img1")}.ng-input-indicator-wait {*background-image:url("mhtml:
'
+
jsUri
+
'
!img2")}
'
,
css
=
'
#ng-callout .ng-arrow-left{*background-image:url("mhtml:
'
+
jsUri
+
'
!img0")}#ng-callout .ng-arrow-right{*background-image:url("mhtml:
'
+
jsUri
+
'
!img1")}.ng-input-indicator-wait {*background-image:url("mhtml:
'
+
jsUri
+
'
!img2")}
'
,
s
=
document
.
createElement
(
'
style
'
);
s
=
document
.
createElement
(
'
style
'
);
s
.
setAttribute
(
'
type
'
,
'
text/css
'
);
s
.
setAttribute
(
'
type
'
,
'
text/css
'
);
if
(
s
.
styleSheet
)
{
if
(
s
.
styleSheet
)
{
s
.
styleSheet
.
cssText
=
css
;
s
.
styleSheet
.
cssText
=
css
;
}
else
{
}
else
{
s
.
appendChild
(
document
.
createTextNode
(
css
));
s
.
appendChild
(
document
.
createTextNode
(
css
));
}
}
document
.
getElementsByTagName
(
'
head
'
)[
0
].
appendChild
(
s
);
document
.
getElementsByTagName
(
'
head
'
)[
0
].
appendChild
(
s
);
})();
})();
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