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
4a4c8fb2
Commit
4a4c8fb2
authored
Jan 21, 2016
by
TasteBot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update the build files for gh-pages [ci skip]
parent
c2bebdbc
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
56 additions
and
56 deletions
+56
-56
examples/vanilla-es6/dist/bundle.js
examples/vanilla-es6/dist/bundle.js
+17
-17
examples/vanilla-es6/dist/controller.js
examples/vanilla-es6/dist/controller.js
+3
-3
examples/vanilla-es6/dist/model.js
examples/vanilla-es6/dist/model.js
+5
-5
examples/vanilla-es6/dist/store.js
examples/vanilla-es6/dist/store.js
+3
-3
examples/vanilla-es6/dist/template.js
examples/vanilla-es6/dist/template.js
+3
-3
examples/vanilla-es6/dist/view.js
examples/vanilla-es6/dist/view.js
+3
-3
examples/vanilla-es6/src/controller.js
examples/vanilla-es6/src/controller.js
+1
-1
examples/vanilla-es6/src/helpers.js
examples/vanilla-es6/src/helpers.js
+1
-1
examples/vanilla-es6/src/model.js
examples/vanilla-es6/src/model.js
+2
-2
examples/vanilla-es6/src/store.js
examples/vanilla-es6/src/store.js
+3
-3
examples/vanilla-es6/src/template.js
examples/vanilla-es6/src/template.js
+7
-7
examples/vanilla-es6/src/view.js
examples/vanilla-es6/src/view.js
+8
-8
No files found.
examples/vanilla-es6/dist/bundle.js
View file @
4a4c8fb2
...
...
@@ -60,7 +60,7 @@ $on(window, 'hashchange', setView);
},{
"
./controller
"
:
2
,
"
./helpers
"
:
3
,
"
./model
"
:
4
,
"
./store
"
:
5
,
"
./template
"
:
6
,
"
./view
"
:
7
}],
2
:[
function
(
require
,
module
,
exports
){
'
use strict
'
;
var
_createClass
=
(
function
()
{
function
defineProperties
(
target
,
props
)
{
for
(
var
i
=
0
;
i
<
props
.
length
;
i
++
)
{
var
descriptor
=
props
[
i
];
descriptor
.
enumerable
=
descriptor
.
enumerable
||
false
;
descriptor
.
configurable
=
true
;
if
(
"
value
"
in
descriptor
)
descriptor
.
writable
=
true
;
Object
.
defineProperty
(
target
,
descriptor
.
key
,
descriptor
);
}
}
return
function
(
Constructor
,
protoProps
,
staticProps
)
{
if
(
protoProps
)
defineProperties
(
Constructor
.
prototype
,
protoProps
);
if
(
staticProps
)
defineProperties
(
Constructor
,
staticProps
);
return
Constructor
;
};
})
();
var
_createClass
=
function
()
{
function
defineProperties
(
target
,
props
)
{
for
(
var
i
=
0
;
i
<
props
.
length
;
i
++
)
{
var
descriptor
=
props
[
i
];
descriptor
.
enumerable
=
descriptor
.
enumerable
||
false
;
descriptor
.
configurable
=
true
;
if
(
"
value
"
in
descriptor
)
descriptor
.
writable
=
true
;
Object
.
defineProperty
(
target
,
descriptor
.
key
,
descriptor
);
}
}
return
function
(
Constructor
,
protoProps
,
staticProps
)
{
if
(
protoProps
)
defineProperties
(
Constructor
.
prototype
,
protoProps
);
if
(
staticProps
)
defineProperties
(
Constructor
,
staticProps
);
return
Constructor
;
};
}
();
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
...
...
@@ -68,7 +68,7 @@ Object.defineProperty(exports, "__esModule", {
function
_classCallCheck
(
instance
,
Constructor
)
{
if
(
!
(
instance
instanceof
Constructor
))
{
throw
new
TypeError
(
"
Cannot call a class as a function
"
);
}
}
var
Controller
=
(
function
()
{
var
Controller
=
function
()
{
/**
* Take a model & view, then act as controller between them
* @param {object} model The model instance
...
...
@@ -422,7 +422,7 @@ var Controller = (function () {
}]);
return
Controller
;
}
)
();
}();
exports
.
default
=
Controller
;
},{}],
3
:[
function
(
require
,
module
,
exports
){
...
...
@@ -489,14 +489,14 @@ function $parent(element, tagName) {
},{}],
4
:[
function
(
require
,
module
,
exports
){
'
use strict
'
;
var
_createClass
=
(
function
()
{
function
defineProperties
(
target
,
props
)
{
for
(
var
i
=
0
;
i
<
props
.
length
;
i
++
)
{
var
descriptor
=
props
[
i
];
descriptor
.
enumerable
=
descriptor
.
enumerable
||
false
;
descriptor
.
configurable
=
true
;
if
(
"
value
"
in
descriptor
)
descriptor
.
writable
=
true
;
Object
.
defineProperty
(
target
,
descriptor
.
key
,
descriptor
);
}
}
return
function
(
Constructor
,
protoProps
,
staticProps
)
{
if
(
protoProps
)
defineProperties
(
Constructor
.
prototype
,
protoProps
);
if
(
staticProps
)
defineProperties
(
Constructor
,
staticProps
);
return
Constructor
;
};
})();
var
_typeof
=
typeof
Symbol
===
"
function
"
&&
typeof
Symbol
.
iterator
===
"
symbol
"
?
function
(
obj
)
{
return
typeof
obj
;
}
:
function
(
obj
)
{
return
obj
&&
typeof
Symbol
===
"
function
"
&&
obj
.
constructor
===
Symbol
?
"
symbol
"
:
typeof
obj
;
};
var
_createClass
=
function
()
{
function
defineProperties
(
target
,
props
)
{
for
(
var
i
=
0
;
i
<
props
.
length
;
i
++
)
{
var
descriptor
=
props
[
i
];
descriptor
.
enumerable
=
descriptor
.
enumerable
||
false
;
descriptor
.
configurable
=
true
;
if
(
"
value
"
in
descriptor
)
descriptor
.
writable
=
true
;
Object
.
defineProperty
(
target
,
descriptor
.
key
,
descriptor
);
}
}
return
function
(
Constructor
,
protoProps
,
staticProps
)
{
if
(
protoProps
)
defineProperties
(
Constructor
.
prototype
,
protoProps
);
if
(
staticProps
)
defineProperties
(
Constructor
,
staticProps
);
return
Constructor
;
};
}();
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
function
_typeof
(
obj
)
{
return
obj
&&
typeof
Symbol
!==
"
undefined
"
&&
obj
.
constructor
===
Symbol
?
"
symbol
"
:
typeof
obj
;
}
function
_classCallCheck
(
instance
,
Constructor
)
{
if
(
!
(
instance
instanceof
Constructor
))
{
throw
new
TypeError
(
"
Cannot call a class as a function
"
);
}
}
/**
...
...
@@ -505,7 +505,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
* @param {object} storage A reference to the client side storage class
*/
var
Model
=
(
function
()
{
var
Model
=
function
()
{
function
Model
(
storage
)
{
_classCallCheck
(
this
,
Model
);
...
...
@@ -654,13 +654,13 @@ var Model = (function () {
}]);
return
Model
;
}
)
();
}();
exports
.
default
=
Model
;
},{}],
5
:[
function
(
require
,
module
,
exports
){
"
use strict
"
;
var
_createClass
=
(
function
()
{
function
defineProperties
(
target
,
props
)
{
for
(
var
i
=
0
;
i
<
props
.
length
;
i
++
)
{
var
descriptor
=
props
[
i
];
descriptor
.
enumerable
=
descriptor
.
enumerable
||
false
;
descriptor
.
configurable
=
true
;
if
(
"
value
"
in
descriptor
)
descriptor
.
writable
=
true
;
Object
.
defineProperty
(
target
,
descriptor
.
key
,
descriptor
);
}
}
return
function
(
Constructor
,
protoProps
,
staticProps
)
{
if
(
protoProps
)
defineProperties
(
Constructor
.
prototype
,
protoProps
);
if
(
staticProps
)
defineProperties
(
Constructor
,
staticProps
);
return
Constructor
;
};
})
();
var
_createClass
=
function
()
{
function
defineProperties
(
target
,
props
)
{
for
(
var
i
=
0
;
i
<
props
.
length
;
i
++
)
{
var
descriptor
=
props
[
i
];
descriptor
.
enumerable
=
descriptor
.
enumerable
||
false
;
descriptor
.
configurable
=
true
;
if
(
"
value
"
in
descriptor
)
descriptor
.
writable
=
true
;
Object
.
defineProperty
(
target
,
descriptor
.
key
,
descriptor
);
}
}
return
function
(
Constructor
,
protoProps
,
staticProps
)
{
if
(
protoProps
)
defineProperties
(
Constructor
.
prototype
,
protoProps
);
if
(
staticProps
)
defineProperties
(
Constructor
,
staticProps
);
return
Constructor
;
};
}
();
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
...
...
@@ -679,7 +679,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
* real life you probably would be making AJAX calls
*/
var
Store
=
(
function
()
{
var
Store
=
function
()
{
function
Store
(
name
,
callback
)
{
_classCallCheck
(
this
,
Store
);
...
...
@@ -832,13 +832,13 @@ var Store = (function () {
}]);
return
Store
;
}
)
();
}();
exports
.
default
=
Store
;
},{}],
6
:[
function
(
require
,
module
,
exports
){
'
use strict
'
;
var
_createClass
=
(
function
()
{
function
defineProperties
(
target
,
props
)
{
for
(
var
i
=
0
;
i
<
props
.
length
;
i
++
)
{
var
descriptor
=
props
[
i
];
descriptor
.
enumerable
=
descriptor
.
enumerable
||
false
;
descriptor
.
configurable
=
true
;
if
(
"
value
"
in
descriptor
)
descriptor
.
writable
=
true
;
Object
.
defineProperty
(
target
,
descriptor
.
key
,
descriptor
);
}
}
return
function
(
Constructor
,
protoProps
,
staticProps
)
{
if
(
protoProps
)
defineProperties
(
Constructor
.
prototype
,
protoProps
);
if
(
staticProps
)
defineProperties
(
Constructor
,
staticProps
);
return
Constructor
;
};
})
();
var
_createClass
=
function
()
{
function
defineProperties
(
target
,
props
)
{
for
(
var
i
=
0
;
i
<
props
.
length
;
i
++
)
{
var
descriptor
=
props
[
i
];
descriptor
.
enumerable
=
descriptor
.
enumerable
||
false
;
descriptor
.
configurable
=
true
;
if
(
"
value
"
in
descriptor
)
descriptor
.
writable
=
true
;
Object
.
defineProperty
(
target
,
descriptor
.
key
,
descriptor
);
}
}
return
function
(
Constructor
,
protoProps
,
staticProps
)
{
if
(
protoProps
)
defineProperties
(
Constructor
.
prototype
,
protoProps
);
if
(
staticProps
)
defineProperties
(
Constructor
,
staticProps
);
return
Constructor
;
};
}
();
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
...
...
@@ -865,7 +865,7 @@ var escapeHtmlChar = function escapeHtmlChar(chr) {
return
htmlEscapes
[
chr
];
};
var
Template
=
(
function
()
{
var
Template
=
function
()
{
function
Template
()
{
_classCallCheck
(
this
,
Template
);
...
...
@@ -935,13 +935,13 @@ var Template = (function () {
}]);
return
Template
;
}
)
();
}();
exports
.
default
=
Template
;
},{}],
7
:[
function
(
require
,
module
,
exports
){
'
use strict
'
;
var
_createClass
=
(
function
()
{
function
defineProperties
(
target
,
props
)
{
for
(
var
i
=
0
;
i
<
props
.
length
;
i
++
)
{
var
descriptor
=
props
[
i
];
descriptor
.
enumerable
=
descriptor
.
enumerable
||
false
;
descriptor
.
configurable
=
true
;
if
(
"
value
"
in
descriptor
)
descriptor
.
writable
=
true
;
Object
.
defineProperty
(
target
,
descriptor
.
key
,
descriptor
);
}
}
return
function
(
Constructor
,
protoProps
,
staticProps
)
{
if
(
protoProps
)
defineProperties
(
Constructor
.
prototype
,
protoProps
);
if
(
staticProps
)
defineProperties
(
Constructor
,
staticProps
);
return
Constructor
;
};
})
();
var
_createClass
=
function
()
{
function
defineProperties
(
target
,
props
)
{
for
(
var
i
=
0
;
i
<
props
.
length
;
i
++
)
{
var
descriptor
=
props
[
i
];
descriptor
.
enumerable
=
descriptor
.
enumerable
||
false
;
descriptor
.
configurable
=
true
;
if
(
"
value
"
in
descriptor
)
descriptor
.
writable
=
true
;
Object
.
defineProperty
(
target
,
descriptor
.
key
,
descriptor
);
}
}
return
function
(
Constructor
,
protoProps
,
staticProps
)
{
if
(
protoProps
)
defineProperties
(
Constructor
.
prototype
,
protoProps
);
if
(
staticProps
)
defineProperties
(
Constructor
,
staticProps
);
return
Constructor
;
};
}
();
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
...
...
@@ -1000,7 +1000,7 @@ var _editItem = function _editItem(id, title) {
* Renders the given command with the options
*/
var
View
=
(
function
()
{
var
View
=
function
()
{
function
View
(
template
)
{
var
_this
=
this
;
...
...
@@ -1185,7 +1185,7 @@ var View = (function () {
}]);
return
View
;
}
)
();
}();
exports
.
default
=
View
;
},{
"
./helpers
"
:
3
}]},{},[
1
]);
examples/vanilla-es6/dist/controller.js
View file @
4a4c8fb2
'
use strict
'
;
var
_createClass
=
(
function
()
{
function
defineProperties
(
target
,
props
)
{
for
(
var
i
=
0
;
i
<
props
.
length
;
i
++
)
{
var
descriptor
=
props
[
i
];
descriptor
.
enumerable
=
descriptor
.
enumerable
||
false
;
descriptor
.
configurable
=
true
;
if
(
"
value
"
in
descriptor
)
descriptor
.
writable
=
true
;
Object
.
defineProperty
(
target
,
descriptor
.
key
,
descriptor
);
}
}
return
function
(
Constructor
,
protoProps
,
staticProps
)
{
if
(
protoProps
)
defineProperties
(
Constructor
.
prototype
,
protoProps
);
if
(
staticProps
)
defineProperties
(
Constructor
,
staticProps
);
return
Constructor
;
};
})
();
var
_createClass
=
function
()
{
function
defineProperties
(
target
,
props
)
{
for
(
var
i
=
0
;
i
<
props
.
length
;
i
++
)
{
var
descriptor
=
props
[
i
];
descriptor
.
enumerable
=
descriptor
.
enumerable
||
false
;
descriptor
.
configurable
=
true
;
if
(
"
value
"
in
descriptor
)
descriptor
.
writable
=
true
;
Object
.
defineProperty
(
target
,
descriptor
.
key
,
descriptor
);
}
}
return
function
(
Constructor
,
protoProps
,
staticProps
)
{
if
(
protoProps
)
defineProperties
(
Constructor
.
prototype
,
protoProps
);
if
(
staticProps
)
defineProperties
(
Constructor
,
staticProps
);
return
Constructor
;
};
}
();
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
...
...
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", {
function
_classCallCheck
(
instance
,
Constructor
)
{
if
(
!
(
instance
instanceof
Constructor
))
{
throw
new
TypeError
(
"
Cannot call a class as a function
"
);
}
}
var
Controller
=
(
function
()
{
var
Controller
=
function
()
{
/**
* Take a model & view, then act as controller between them
* @param {object} model The model instance
...
...
@@ -362,6 +362,6 @@ var Controller = (function () {
}]);
return
Controller
;
}
)
();
}();
exports
.
default
=
Controller
;
\ No newline at end of file
examples/vanilla-es6/dist/model.js
View file @
4a4c8fb2
'
use strict
'
;
var
_createClass
=
(
function
()
{
function
defineProperties
(
target
,
props
)
{
for
(
var
i
=
0
;
i
<
props
.
length
;
i
++
)
{
var
descriptor
=
props
[
i
];
descriptor
.
enumerable
=
descriptor
.
enumerable
||
false
;
descriptor
.
configurable
=
true
;
if
(
"
value
"
in
descriptor
)
descriptor
.
writable
=
true
;
Object
.
defineProperty
(
target
,
descriptor
.
key
,
descriptor
);
}
}
return
function
(
Constructor
,
protoProps
,
staticProps
)
{
if
(
protoProps
)
defineProperties
(
Constructor
.
prototype
,
protoProps
);
if
(
staticProps
)
defineProperties
(
Constructor
,
staticProps
);
return
Constructor
;
};
})();
var
_typeof
=
typeof
Symbol
===
"
function
"
&&
typeof
Symbol
.
iterator
===
"
symbol
"
?
function
(
obj
)
{
return
typeof
obj
;
}
:
function
(
obj
)
{
return
obj
&&
typeof
Symbol
===
"
function
"
&&
obj
.
constructor
===
Symbol
?
"
symbol
"
:
typeof
obj
;
};
var
_createClass
=
function
()
{
function
defineProperties
(
target
,
props
)
{
for
(
var
i
=
0
;
i
<
props
.
length
;
i
++
)
{
var
descriptor
=
props
[
i
];
descriptor
.
enumerable
=
descriptor
.
enumerable
||
false
;
descriptor
.
configurable
=
true
;
if
(
"
value
"
in
descriptor
)
descriptor
.
writable
=
true
;
Object
.
defineProperty
(
target
,
descriptor
.
key
,
descriptor
);
}
}
return
function
(
Constructor
,
protoProps
,
staticProps
)
{
if
(
protoProps
)
defineProperties
(
Constructor
.
prototype
,
protoProps
);
if
(
staticProps
)
defineProperties
(
Constructor
,
staticProps
);
return
Constructor
;
};
}();
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
function
_typeof
(
obj
)
{
return
obj
&&
typeof
Symbol
!==
"
undefined
"
&&
obj
.
constructor
===
Symbol
?
"
symbol
"
:
typeof
obj
;
}
function
_classCallCheck
(
instance
,
Constructor
)
{
if
(
!
(
instance
instanceof
Constructor
))
{
throw
new
TypeError
(
"
Cannot call a class as a function
"
);
}
}
/**
...
...
@@ -16,7 +16,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
* @param {object} storage A reference to the client side storage class
*/
var
Model
=
(
function
()
{
var
Model
=
function
()
{
function
Model
(
storage
)
{
_classCallCheck
(
this
,
Model
);
...
...
@@ -165,6 +165,6 @@ var Model = (function () {
}]);
return
Model
;
}
)
();
}();
exports
.
default
=
Model
;
\ No newline at end of file
examples/vanilla-es6/dist/store.js
View file @
4a4c8fb2
"
use strict
"
;
var
_createClass
=
(
function
()
{
function
defineProperties
(
target
,
props
)
{
for
(
var
i
=
0
;
i
<
props
.
length
;
i
++
)
{
var
descriptor
=
props
[
i
];
descriptor
.
enumerable
=
descriptor
.
enumerable
||
false
;
descriptor
.
configurable
=
true
;
if
(
"
value
"
in
descriptor
)
descriptor
.
writable
=
true
;
Object
.
defineProperty
(
target
,
descriptor
.
key
,
descriptor
);
}
}
return
function
(
Constructor
,
protoProps
,
staticProps
)
{
if
(
protoProps
)
defineProperties
(
Constructor
.
prototype
,
protoProps
);
if
(
staticProps
)
defineProperties
(
Constructor
,
staticProps
);
return
Constructor
;
};
})
();
var
_createClass
=
function
()
{
function
defineProperties
(
target
,
props
)
{
for
(
var
i
=
0
;
i
<
props
.
length
;
i
++
)
{
var
descriptor
=
props
[
i
];
descriptor
.
enumerable
=
descriptor
.
enumerable
||
false
;
descriptor
.
configurable
=
true
;
if
(
"
value
"
in
descriptor
)
descriptor
.
writable
=
true
;
Object
.
defineProperty
(
target
,
descriptor
.
key
,
descriptor
);
}
}
return
function
(
Constructor
,
protoProps
,
staticProps
)
{
if
(
protoProps
)
defineProperties
(
Constructor
.
prototype
,
protoProps
);
if
(
staticProps
)
defineProperties
(
Constructor
,
staticProps
);
return
Constructor
;
};
}
();
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
...
...
@@ -19,7 +19,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
* real life you probably would be making AJAX calls
*/
var
Store
=
(
function
()
{
var
Store
=
function
()
{
function
Store
(
name
,
callback
)
{
_classCallCheck
(
this
,
Store
);
...
...
@@ -172,6 +172,6 @@ var Store = (function () {
}]);
return
Store
;
}
)
();
}();
exports
.
default
=
Store
;
\ No newline at end of file
examples/vanilla-es6/dist/template.js
View file @
4a4c8fb2
'
use strict
'
;
var
_createClass
=
(
function
()
{
function
defineProperties
(
target
,
props
)
{
for
(
var
i
=
0
;
i
<
props
.
length
;
i
++
)
{
var
descriptor
=
props
[
i
];
descriptor
.
enumerable
=
descriptor
.
enumerable
||
false
;
descriptor
.
configurable
=
true
;
if
(
"
value
"
in
descriptor
)
descriptor
.
writable
=
true
;
Object
.
defineProperty
(
target
,
descriptor
.
key
,
descriptor
);
}
}
return
function
(
Constructor
,
protoProps
,
staticProps
)
{
if
(
protoProps
)
defineProperties
(
Constructor
.
prototype
,
protoProps
);
if
(
staticProps
)
defineProperties
(
Constructor
,
staticProps
);
return
Constructor
;
};
})
();
var
_createClass
=
function
()
{
function
defineProperties
(
target
,
props
)
{
for
(
var
i
=
0
;
i
<
props
.
length
;
i
++
)
{
var
descriptor
=
props
[
i
];
descriptor
.
enumerable
=
descriptor
.
enumerable
||
false
;
descriptor
.
configurable
=
true
;
if
(
"
value
"
in
descriptor
)
descriptor
.
writable
=
true
;
Object
.
defineProperty
(
target
,
descriptor
.
key
,
descriptor
);
}
}
return
function
(
Constructor
,
protoProps
,
staticProps
)
{
if
(
protoProps
)
defineProperties
(
Constructor
.
prototype
,
protoProps
);
if
(
staticProps
)
defineProperties
(
Constructor
,
staticProps
);
return
Constructor
;
};
}
();
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
...
...
@@ -27,7 +27,7 @@ var escapeHtmlChar = function escapeHtmlChar(chr) {
return
htmlEscapes
[
chr
];
};
var
Template
=
(
function
()
{
var
Template
=
function
()
{
function
Template
()
{
_classCallCheck
(
this
,
Template
);
...
...
@@ -97,6 +97,6 @@ var Template = (function () {
}]);
return
Template
;
}
)
();
}();
exports
.
default
=
Template
;
\ No newline at end of file
examples/vanilla-es6/dist/view.js
View file @
4a4c8fb2
'
use strict
'
;
var
_createClass
=
(
function
()
{
function
defineProperties
(
target
,
props
)
{
for
(
var
i
=
0
;
i
<
props
.
length
;
i
++
)
{
var
descriptor
=
props
[
i
];
descriptor
.
enumerable
=
descriptor
.
enumerable
||
false
;
descriptor
.
configurable
=
true
;
if
(
"
value
"
in
descriptor
)
descriptor
.
writable
=
true
;
Object
.
defineProperty
(
target
,
descriptor
.
key
,
descriptor
);
}
}
return
function
(
Constructor
,
protoProps
,
staticProps
)
{
if
(
protoProps
)
defineProperties
(
Constructor
.
prototype
,
protoProps
);
if
(
staticProps
)
defineProperties
(
Constructor
,
staticProps
);
return
Constructor
;
};
})
();
var
_createClass
=
function
()
{
function
defineProperties
(
target
,
props
)
{
for
(
var
i
=
0
;
i
<
props
.
length
;
i
++
)
{
var
descriptor
=
props
[
i
];
descriptor
.
enumerable
=
descriptor
.
enumerable
||
false
;
descriptor
.
configurable
=
true
;
if
(
"
value
"
in
descriptor
)
descriptor
.
writable
=
true
;
Object
.
defineProperty
(
target
,
descriptor
.
key
,
descriptor
);
}
}
return
function
(
Constructor
,
protoProps
,
staticProps
)
{
if
(
protoProps
)
defineProperties
(
Constructor
.
prototype
,
protoProps
);
if
(
staticProps
)
defineProperties
(
Constructor
,
staticProps
);
return
Constructor
;
};
}
();
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
...
...
@@ -59,7 +59,7 @@ var _editItem = function _editItem(id, title) {
* Renders the given command with the options
*/
var
View
=
(
function
()
{
var
View
=
function
()
{
function
View
(
template
)
{
var
_this
=
this
;
...
...
@@ -244,6 +244,6 @@ var View = (function () {
}]);
return
View
;
}
)
();
}();
exports
.
default
=
View
;
\ No newline at end of file
examples/vanilla-es6/src/controller.js
View file @
4a4c8fb2
...
...
@@ -177,7 +177,7 @@ export default class Controller {
* @param {boolean|undefined} force forces a re-painting of todo items.
*/
_filter
(
force
)
{
le
t
active
=
this
.
_activeRoute
;
cons
t
active
=
this
.
_activeRoute
;
const
activeRoute
=
active
.
charAt
(
0
).
toUpperCase
()
+
active
.
substr
(
1
);
// Update the elements on the page, which change with each completed todo
...
...
examples/vanilla-es6/src/helpers.js
View file @
4a4c8fb2
...
...
@@ -19,7 +19,7 @@ export function $on(target, type, callback, useCapture) {
// Attach a handler to event for all elements that match the selector,
// now or in the future, based on a root element
export
function
$delegate
(
target
,
selector
,
type
,
handler
)
{
le
t
dispatchEvent
=
event
=>
{
cons
t
dispatchEvent
=
event
=>
{
const
targetElement
=
event
.
target
;
const
potentialElements
=
qsa
(
selector
,
target
);
const
hasMatch
=
Array
.
from
(
potentialElements
).
includes
(
targetElement
);
...
...
examples/vanilla-es6/src/model.js
View file @
4a4c8fb2
...
...
@@ -17,7 +17,7 @@ export default class Model {
create
(
title
,
callback
){
title
=
title
||
''
;
le
t
newItem
=
{
cons
t
newItem
=
{
title
:
title
.
trim
(),
completed
:
false
};
...
...
@@ -88,7 +88,7 @@ export default class Model {
* Returns a count of all todos
*/
getCount
(
callback
){
le
t
todos
=
{
cons
t
todos
=
{
active
:
0
,
completed
:
0
,
total
:
0
...
...
examples/vanilla-es6/src/store.js
View file @
4a4c8fb2
...
...
@@ -39,7 +39,7 @@ export default class Store {
* })
*/
find
(
query
,
callback
){
le
t
todos
=
JSON
.
parse
(
localStorage
[
this
.
_dbName
]).
todos
;
cons
t
todos
=
JSON
.
parse
(
localStorage
[
this
.
_dbName
]).
todos
;
callback
.
call
(
this
,
todos
.
filter
(
todo
=>
{
for
(
let
q
in
query
)
{
...
...
@@ -72,7 +72,7 @@ export default class Store {
*/
save
(
updateData
,
callback
,
id
){
const
data
=
JSON
.
parse
(
localStorage
[
this
.
_dbName
]);
le
t
todos
=
data
.
todos
;
cons
t
todos
=
data
.
todos
;
const
len
=
todos
.
length
;
// If an ID was actually given, find the item and update each property
...
...
@@ -112,7 +112,7 @@ export default class Store {
*/
remove
(
id
,
callback
){
const
data
=
JSON
.
parse
(
localStorage
[
this
.
_dbName
]);
le
t
todos
=
data
.
todos
;
cons
t
todos
=
data
.
todos
;
const
len
=
todos
.
length
;
for
(
let
i
=
0
;
i
<
todos
.
length
;
i
++
)
{
...
...
examples/vanilla-es6/src/template.js
View file @
4a4c8fb2
...
...
@@ -10,8 +10,8 @@ const htmlEscapes = {
const
reUnescapedHtml
=
/
[
&<>"'`
]
/g
;
const
reHasUnescapedHtml
=
new
RegExp
(
reUnescapedHtml
.
source
);
le
t
escape
=
str
=>
(
str
&&
reHasUnescapedHtml
.
test
(
str
))
?
str
.
replace
(
reUnescapedHtml
,
escapeHtmlChar
)
:
str
;
le
t
escapeHtmlChar
=
chr
=>
htmlEscapes
[
chr
];
cons
t
escape
=
str
=>
(
str
&&
reHasUnescapedHtml
.
test
(
str
))
?
str
.
replace
(
reUnescapedHtml
,
escapeHtmlChar
)
:
str
;
cons
t
escapeHtmlChar
=
chr
=>
htmlEscapes
[
chr
];
export
default
class
Template
{
constructor
()
{
...
...
@@ -44,10 +44,10 @@ export default class Template {
* })
*/
show
(
data
){
le
t
view
=
data
.
map
(
d
=>
{
le
t
template
=
this
.
defaultTemplate
;
le
t
completed
=
d
.
completed
?
'
completed
'
:
''
;
le
t
checked
=
d
.
completed
?
'
checked
'
:
''
;
cons
t
view
=
data
.
map
(
d
=>
{
cons
t
template
=
this
.
defaultTemplate
;
cons
t
completed
=
d
.
completed
?
'
completed
'
:
''
;
cons
t
checked
=
d
.
completed
?
'
checked
'
:
''
;
return
this
.
defaultTemplate
.
replace
(
'
{{id}}
'
,
d
.
id
)
...
...
@@ -66,7 +66,7 @@ export default class Template {
* @returns {string} String containing the count
*/
itemCounter
(
activeTodos
){
le
t
plural
=
activeTodos
===
1
?
''
:
'
s
'
;
cons
t
plural
=
activeTodos
===
1
?
''
:
'
s
'
;
return
`<strong>
${
activeTodos
}
</strong> item
${
plural
}
left`
;
}
...
...
examples/vanilla-es6/src/view.js
View file @
4a4c8fb2
import
{
qs
,
qsa
,
$on
,
$parent
,
$delegate
}
from
'
./helpers
'
;
le
t
_itemId
=
element
=>
parseInt
(
$parent
(
element
,
'
li
'
).
dataset
.
id
,
10
);
cons
t
_itemId
=
element
=>
parseInt
(
$parent
(
element
,
'
li
'
).
dataset
.
id
,
10
);
le
t
_setFilter
=
currentPage
=>
{
cons
t
_setFilter
=
currentPage
=>
{
qs
(
'
.filters .selected
'
).
className
=
''
;
qs
(
`.filters [href="#/
${
currentPage
}
"]`
).
className
=
'
selected
'
;
};
le
t
_elementComplete
=
(
id
,
completed
)
=>
{
cons
t
_elementComplete
=
(
id
,
completed
)
=>
{
const
listItem
=
qs
(
`[data-id="
${
id
}
"]`
);
if
(
!
listItem
)
{
...
...
@@ -20,7 +20,7 @@ let _elementComplete = (id, completed) => {
qs
(
'
input
'
,
listItem
).
checked
=
completed
;
};
le
t
_editItem
=
(
id
,
title
)
=>
{
cons
t
_editItem
=
(
id
,
title
)
=>
{
const
listItem
=
qs
(
`[data-id="
${
id
}
"]`
);
if
(
!
listItem
)
{
...
...
@@ -29,7 +29,7 @@ let _editItem = (id, title) => {
listItem
.
className
+=
'
editing
'
;
le
t
input
=
document
.
createElement
(
'
input
'
);
cons
t
input
=
document
.
createElement
(
'
input
'
);
input
.
className
=
'
edit
'
;
listItem
.
appendChild
(
input
);
...
...
@@ -109,7 +109,7 @@ export default class View {
}
_bindItemEditDone
(
handler
)
{
le
t
self
=
this
;
cons
t
self
=
this
;
$delegate
(
self
.
$todoList
,
'
li .edit
'
,
'
blur
'
,
function
()
{
if
(
!
this
.
dataset
.
iscanceled
)
{
...
...
@@ -129,11 +129,11 @@ export default class View {
}
_bindItemEditCancel
(
handler
)
{
le
t
self
=
this
;
cons
t
self
=
this
;
$delegate
(
self
.
$todoList
,
'
li .edit
'
,
'
keyup
'
,
function
(
event
)
{
if
(
event
.
keyCode
===
self
.
ESCAPE_KEY
)
{
le
t
id
=
_itemId
(
this
);
cons
t
id
=
_itemId
(
this
);
this
.
dataset
.
iscanceled
=
true
;
this
.
blur
();
...
...
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