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
Sven Franck
todomvc
Commits
569c2b74
Commit
569c2b74
authored
Nov 03, 2013
by
Pascal Hartig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
atmajs: cleanup
- Blur saves instead of discarding changes - Whitespace consistency - Pass JSHint
parent
dd9c2c6b
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
43 additions
and
53 deletions
+43
-53
labs/architecture-examples/atmajs/build.js
labs/architecture-examples/atmajs/build.js
+0
-8
labs/architecture-examples/atmajs/index.html
labs/architecture-examples/atmajs/index.html
+2
-2
labs/architecture-examples/atmajs/js/app.js
labs/architecture-examples/atmajs/js/app.js
+3
-2
labs/architecture-examples/atmajs/js/cntrl/input.js
labs/architecture-examples/atmajs/js/cntrl/input.js
+22
-20
labs/architecture-examples/atmajs/js/compo/filter/filter.js
labs/architecture-examples/atmajs/js/compo/filter/filter.js
+3
-2
labs/architecture-examples/atmajs/js/compo/todoList/todoList.js
...rchitecture-examples/atmajs/js/compo/todoList/todoList.js
+2
-7
labs/architecture-examples/atmajs/js/compo/todoList/todoTask/todoTask.js
...re-examples/atmajs/js/compo/todoList/todoTask/todoTask.js
+8
-10
labs/architecture-examples/atmajs/js/model/Todos.js
labs/architecture-examples/atmajs/js/model/Todos.js
+3
-2
No files found.
labs/architecture-examples/atmajs/build.js
deleted
100644 → 0
View file @
dd9c2c6b
module
.
exports
=
{
action
:
'
build
'
,
file
:
'
index.html
'
,
outputMain
:
'
build/index.html
'
,
outputSources
:
'
build/lib/
'
,
includejsFile
:
'
atma-
'
,
minify
:
true
};
\ No newline at end of file
labs/architecture-examples/atmajs/index.html
View file @
569c2b74
...
...
@@ -2,7 +2,7 @@
<html
lang=
"en"
data-framework=
"atmajs"
>
<head>
<meta
charset=
"utf-8"
>
<title>
Template
• TodoMVC
</title>
<title>
Atma.js
• TodoMVC
</title>
<link
rel=
"stylesheet"
href=
"bower_components/todomvc-common/base.css"
>
</head>
<body>
...
...
@@ -91,4 +91,4 @@
<script
src=
"js/app.js"
></script>
</body>
</html>
\ No newline at end of file
</html>
labs/architecture-examples/atmajs/js/app.js
View file @
569c2b74
/*global include, mask, Compo*/
/*jshint newcap:false */
/*global include, Compo */
'
use strict
'
;
...
...
@@ -58,4 +59,4 @@ include
});
Compo
.
initialize
(
Application
,
todos
,
document
.
body
);
});
\ No newline at end of file
});
labs/architecture-examples/atmajs/js/cntrl/input.js
View file @
569c2b74
/*global include, mask, Compo */
/*jshint newcap:false */
/*global mask, Compo */
/**
* Extend INPUT tag to edit a todo's title
* - format string
* - complete edit on ENTER
* - c
ancel
edit on BLUR
* - c
omplete
edit on BLUR
*
* Used as
* - a main application's input
...
...
@@ -33,35 +34,36 @@
},
events
:
{
'
keydown
'
:
function
(
event
)
{
switch
(
event
.
which
)
{
case
ENTER_KEY
:
var
value
=
this
.
$
.
val
().
trim
();
this
.
$
.
trigger
(
'
enter
'
,
value
);
this
.
afterEdit
();
case
ENTER_KEY
:
this
.
save
();
// prevent IE from button click - `Clear Completed`
event
.
preventDefault
();
break
;
case
ESCAPE_KEY
:
this
.
cancel
();
break
;
// prevent IE from button click - `Clear Completed`
event
.
preventDefault
();
break
;
case
ESCAPE_KEY
:
this
.
cancel
();
break
;
}
},
'
blur
'
:
'
cancel
'
'
blur
'
:
'
save
'
},
focus
:
function
()
{
focus
:
function
focus
()
{
this
.
$
.
focus
();
},
cancel
:
function
()
{
cancel
:
function
cancel
()
{
this
.
$
.
trigger
(
'
cancel
'
);
this
.
afterEdit
();
},
save
:
function
save
()
{
var
value
=
this
.
$
.
val
().
trim
();
this
.
$
.
trigger
(
'
enter
'
,
value
);
this
.
afterEdit
();
},
afterEdit
:
function
()
{
this
.
$
.
val
(
this
.
attr
.
preserve
?
this
.
model
.
title
:
''
);
...
...
@@ -69,4 +71,4 @@
}));
}());
\ No newline at end of file
}());
labs/architecture-examples/atmajs/js/compo/filter/filter.js
View file @
569c2b74
...
...
@@ -10,6 +10,7 @@
include
.
load
(
'
filter.mask::Template
'
)
.
done
(
function
(
resp
)
{
'
use strict
'
;
// `Compo` function creates components constructor,
// but it doesnt have ClassJS features, like inhertince and
...
...
@@ -46,7 +47,7 @@ include
},
Self
:
{
applyFilter
:
function
(
route
){
applyFilter
:
function
(
route
)
{
this
.
action
=
_setSelectedFilter
(
route
.
current
,
this
.
model
);
...
...
@@ -68,4 +69,4 @@ include
return
action
;
}
});
\ No newline at end of file
});
labs/architecture-examples/atmajs/js/compo/todoList/todoList.js
View file @
569c2b74
/*jshint newcap:false */
/*global include, mask, Compo*/
/*
...
...
@@ -16,10 +17,8 @@ include
mask
.
registerHandler
(
'
:todoList
'
,
Compo
({
template
:
response
.
load
.
todoList
,
action
:
''
,
pipes
:
{
// To manage the communication within hierarchical components
...
...
@@ -41,7 +40,6 @@ include
// defined in the template and in a single tasks's template
toggleAll
:
function
(
event
)
{
this
.
model
.
each
(
function
(
task
)
{
...
...
@@ -51,15 +49,12 @@ include
},
taskChanged
:
function
()
{
this
.
model
.
save
();
},
taskRemoved
:
function
(
event
,
task
)
{
this
.
model
.
del
(
task
);
}
}
}));
});
\ No newline at end of file
});
labs/architecture-examples/atmajs/js/compo/todoList/todoTask/todoTask.js
View file @
569c2b74
/*jshint newcap:false */
/*global include, mask, Compo */
/**
...
...
@@ -17,14 +18,14 @@ include
.
done
(
function
(
response
)
{
'
use strict
'
;
var
state
_VIEW
=
''
;
var
state
_EDIT
=
'
editing
'
;
var
STATE
_VIEW
=
''
;
var
STATE
_EDIT
=
'
editing
'
;
mask
.
registerHandler
(
'
:todoTask
'
,
Compo
({
//= Properties
state
:
state
_VIEW
,
state
:
STATE
_VIEW
,
//= Component Definition
...
...
@@ -52,9 +53,9 @@ include
return
[
this
.
model
];
},
edit
:
function
(){
edit
:
function
()
{
this
.
state
=
state
_EDIT
;
this
.
state
=
STATE
_EDIT
;
this
.
compos
.
input
.
focus
();
// stop signal propagation (example purpose)
...
...
@@ -66,11 +67,10 @@ include
input
:
'
compo: todo:input
'
},
//= Private Methods
_editEnd
:
function
()
{
this
.
state
=
state
_VIEW
;
this
.
state
=
STATE
_VIEW
;
},
_isVisible
:
function
(
completed
,
action
)
{
...
...
@@ -85,6 +85,4 @@ include
return
true
;
}
}));
});
\ No newline at end of file
});
labs/architecture-examples/atmajs/js/model/Todos.js
View file @
569c2b74
/*global Class, ruqq */
/*jshint newcap:false */
/*global Class, ruqq, include */
(
function
()
{
'
use strict
'
;
...
...
@@ -59,4 +60,4 @@
}
});
}());
\ No newline at end of file
}());
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