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
e02139a4
Commit
e02139a4
authored
Apr 07, 2015
by
Arthur Verschaeve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chaplin-brunch: remove count from clear completed button
parent
0ef0bd3f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
4 additions
and
22 deletions
+4
-22
examples/chaplin-brunch/app/views/footer-view.coffee
examples/chaplin-brunch/app/views/footer-view.coffee
+0
-1
examples/chaplin-brunch/app/views/templates/footer.hbs
examples/chaplin-brunch/app/views/templates/footer.hbs
+1
-1
examples/chaplin-brunch/node_modules/todomvc-app-css/index.css
...les/chaplin-brunch/node_modules/todomvc-app-css/index.css
+1
-17
examples/chaplin-brunch/public/app.js
examples/chaplin-brunch/public/app.js
+1
-2
examples/chaplin-brunch/public/app.js.map
examples/chaplin-brunch/public/app.js.map
+1
-1
No files found.
examples/chaplin-brunch/app/views/footer-view.coffee
View file @
e02139a4
...
...
@@ -32,7 +32,6 @@ module.exports = class FooterView extends View
countDescription
=
(
if
active
is
1
then
'item'
else
'items'
)
@
find
(
'.todo-count-title'
).
textContent
=
countDescription
@
find
(
'#completed-count'
).
textContent
=
"(
#{
completed
}
)"
utils
.
toggle
@
find
(
'#clear-completed'
),
completed
>
0
utils
.
toggle
@
el
,
total
>
0
...
...
examples/chaplin-brunch/app/views/templates/footer.hbs
View file @
e02139a4
...
...
@@ -14,4 +14,4 @@
<a
href=
"#/completed"
>
Completed
</a>
</li>
</ul>
<button
id=
"clear-completed"
>
Clear completed
<span
id=
"completed-count"
></span>
</button>
<button
id=
"clear-completed"
>
Clear completed
</button>
examples/chaplin-brunch/node_modules/todomvc-app-css/index.css
View file @
e02139a4
...
...
@@ -15,11 +15,9 @@ button {
font-weight
:
inherit
;
color
:
inherit
;
-webkit-appearance
:
none
;
-ms-appearance
:
none
;
appearance
:
none
;
-webkit-font-smoothing
:
antialiased
;
-moz-font-smoothing
:
antialiased
;
-ms-font-smoothing
:
antialiased
;
font-smoothing
:
antialiased
;
}
...
...
@@ -33,7 +31,6 @@ body {
margin
:
0
auto
;
-webkit-font-smoothing
:
antialiased
;
-moz-font-smoothing
:
antialiased
;
-ms-font-smoothing
:
antialiased
;
font-smoothing
:
antialiased
;
font-weight
:
300
;
}
...
...
@@ -83,7 +80,6 @@ input[type="checkbox"] {
color
:
rgba
(
175
,
47
,
47
,
0.15
);
-webkit-text-rendering
:
optimizeLegibility
;
-moz-text-rendering
:
optimizeLegibility
;
-ms-text-rendering
:
optimizeLegibility
;
text-rendering
:
optimizeLegibility
;
}
...
...
@@ -102,11 +98,9 @@ input[type="checkbox"] {
padding
:
6px
;
border
:
1px
solid
#999
;
box-shadow
:
inset
0
-1px
5px
0
rgba
(
0
,
0
,
0
,
0.2
);
-ms-box-sizing
:
border-box
;
box-sizing
:
border-box
;
-webkit-font-smoothing
:
antialiased
;
-moz-font-smoothing
:
antialiased
;
-ms-font-smoothing
:
antialiased
;
font-smoothing
:
antialiased
;
}
...
...
@@ -191,7 +185,6 @@ label[for='toggle-all'] {
margin
:
auto
0
;
border
:
none
;
/* Mobile Safari */
-webkit-appearance
:
none
;
-ms-appearance
:
none
;
appearance
:
none
;
}
...
...
@@ -323,19 +316,10 @@ html #clear-completed:active {
line-height
:
20px
;
text-decoration
:
none
;
cursor
:
pointer
;
visibility
:
hidden
;
position
:
relative
;
}
#clear-completed
::after
{
visibility
:
visible
;
content
:
'Clear completed'
;
position
:
absolute
;
right
:
0
;
white-space
:
nowrap
;
}
#clear-completed
:hover::after
{
#clear-completed
:hover
{
text-decoration
:
underline
;
}
...
...
examples/chaplin-brunch/public/app.js
View file @
e02139a4
...
...
@@ -417,7 +417,6 @@ module.exports = FooterView = (function(_super) {
this
.
find
(
'
#todo-count > strong
'
).
textContent
=
active
;
countDescription
=
(
active
===
1
?
'
item
'
:
'
items
'
);
this
.
find
(
'
.todo-count-title
'
).
textContent
=
countDescription
;
this
.
find
(
'
#completed-count
'
).
textContent
=
"
(
"
+
completed
+
"
)
"
;
utils
.
toggle
(
this
.
find
(
'
#clear-completed
'
),
completed
>
0
);
return
utils
.
toggle
(
this
.
el
,
total
>
0
);
};
...
...
@@ -481,7 +480,7 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
return
"
<span id=
\"
todo-count
\"
>
\n
<strong></strong>
\n
<span class=
\"
todo-count-title
\"
>items</span>
\n
left
\n
</span>
\n
<ul id=
\"
filters
\"
>
\n
<li>
\n
<a href=
\"
#/
\"
>All</a>
\n
</li>
\n
<li>
\n
<a href=
\"
#/active
\"
>Active</a>
\n
</li>
\n
<li>
\n
<a href=
\"
#/completed
\"
>Completed</a>
\n
</li>
\n
</ul>
\n
<button id=
\"
clear-completed
\"
>Clear completed
<span id=
\"
completed-count
\"
></span>
</button>
\n
"
;
return
"
<span id=
\"
todo-count
\"
>
\n
<strong></strong>
\n
<span class=
\"
todo-count-title
\"
>items</span>
\n
left
\n
</span>
\n
<ul id=
\"
filters
\"
>
\n
<li>
\n
<a href=
\"
#/
\"
>All</a>
\n
</li>
\n
<li>
\n
<a href=
\"
#/active
\"
>Active</a>
\n
</li>
\n
<li>
\n
<a href=
\"
#/completed
\"
>Completed</a>
\n
</li>
\n
</ul>
\n
<button id=
\"
clear-completed
\"
>Clear completed</button>
\n
"
;
});
if
(
typeof
define
===
'
function
'
&&
define
.
amd
)
{
define
([],
function
()
{
...
...
examples/chaplin-brunch/public/app.js.map
View file @
e02139a4
{"version":3,"sources":["app/application.coffee","app/controllers/index-controller.coffee","app/initialize.coffee","app/lib/utils.coffee","app/mediator.coffee","app/models/todo.coffee","app/models/todos.coffee","app/routes.coffee","app/views/base/collection-view.coffee","app/views/base/view.coffee","app/views/footer-view.coffee","app/views/header-view.coffee","app/views/templates/footer.hbs","app/views/templates/header.hbs","app/views/templates/todo.hbs","app/views/templates/todos.hbs","app/views/todo-view.coffee","app/views/todos-view.coffee"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;GAAA;kSAAA;;AAAA,GAAW,KAAX,EAAW;;AACX,CADA,EACQ,EAAR,EAAQ;;AAGR,CAJA,EAIuB,GAAjB,CAAN;CAGE;;;;;CAAA;;CAAA,EAAO,EAAP;;CAAA,EAIc,SAAd;CAEE,EAAqB,CAArB,IAAQ;CAFI,QAIZ;CARF,EAIc;;CAJd,EAUO,EAAP,IAAO;CAEL,IAAc,GAAN;CAFH,QAGL;CAbF,EAUO;;CAVP;;CAHyC,MAAO;;;;ACJlD;GAAA;kSAAA;;AAAA,GAAa,OAAb,YAAa;;AACb,CADA,EACa,OAAb,YAAa;;AACb,CAFA,EAEY,MAAZ,YAAY;;AACZ,CAHA,EAGW,KAAX,EAAW;;AAEX,CALA,EAKuB,GAAjB,CAAN;CAGE;;;;;CAAA;;CAAA,EAAc,SAAd;CACG,CAAmB,EAAnB,CAAD,IAAoB,EAApB;CACE;CAAA,EAAS,GAAT;CAAS,CAAY,GAAZ;CAAT;CAAA,EACc,CAAb,EAAD,IAAc;CACb,EAAa,CAAb,EAAD,IAAc,GAAd;CAHF,IAAoB;CADtB,EAAc;;CAAd,EASM,CAAN,EAAM,GAAC;CACL;CAAA,EAAqC,CAArC;CAAA,CAC8B,EAA9B;CACC,EAAW,CAAX,KAAW,EAAZ;CAAsB,CAAY,GAAZ,GAAoB,EAApB;CAAA,CAAsC,IAA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;CACC,CAAE,EAAF,EAAD,GAAa,EAAb;CAvCF,EAiCM;;CAjCN;;CADsC;;;;ACFxC;GAAA;kSAAA;;AAAA,GAAiB,WAAjB,UAAiB;;AACjB,CADA,EACW,KAAX,KAAW;;AACX,CAFA,EAEQ,EAAR,EAAQ;;AAER,CAJA,EAIuB,GAAjB,CAAN;CACE;;;;;CAAA;;CAAA,EAAW,IAAX;;CAAA,EAEE,GADF;CACE,CAAqB,EAArB;CAFF;;CAAA,EAGU,KAAV;;CAHA,EAIc,SAAd;;CAJA,EAME,GADF;CACE,CAAkB,EAAlB;CAAA,CACwB,EAAxB,GADA,eACA;CAPF;;CAAA,EAQU,KAAV,WAAU;;CARV,EAUQ,GAAR,GAAQ;CACN;CACC,UAAD;CAZF,EAUQ;;CAVR,EAcgB,WAAhB;CACE,EAA+B,CAA/B,MAA0C,GAA1C,EAA+B;CACzB,CAAN,EAAc,CAAT,CAAL,IAA6B,CAA7B;CAhBF,EAcgB;;CAdhB,EAkBiB,MAAC,MAAlB;CACE;CAAA,EAAY,CAAZ,CAAiB,EAAjB,OAAgC;CAC/B,EAAmB,CAAnB,GAAD,EAAqB,CAAV,CAAX;CAAmC,GAAD,SAAJ;CAAU,CAAW,MAAX;CAApB,OAAU;CAA9B,IAAoB;CApBtB,EAkBiB;;CAlBjB,EAsBO,EAAP,IAAO;CACJ,EAAkC,CAAlC,CAAkC,EAAnC,EAAoC,CAAzB,CAAX;CACQ,IAAD,EAAL;CADF,IAAmC;CAvBrC,EAsBO;;CAtBP;;CADuC","file":"public/app.js","sourcesContent":["mediator = require 'mediator'\nTodos = require 'models/todos'\n\n# The application object\nmodule.exports = class Application extends Chaplin.Application\n # Set your application name here so the document title is set to\n # “Controller title – Site title” (see Layout#adjustTitle)\n title: 'Chaplin • TodoMVC'\n\n # Create additional mediator properties\n # -------------------------------------\n initMediator: ->\n # Add additional application-specific properties and methods\n mediator.todos = new Todos()\n # Seal the mediator\n super\n\n start: ->\n # If todos are fetched from server, we will need to wait for them.\n mediator.todos.fetch()\n super\n","HeaderView = require '../views/header-view'\nFooterView = require '../views/footer-view'\nTodosView = require '../views/todos-view'\nmediator = require 'mediator'\n\nmodule.exports = class IndexController extends Chaplin.Controller\n # The method is executed before any controller actions.\n # We compose structure in order for it to be rendered only once.\n beforeAction: ->\n @reuse 'structure', ->\n params = collection: mediator.todos\n @header = new HeaderView params\n @footer = new FooterView params\n\n # On each new load, old @view will be disposed and\n # new @view will be created. This is idiomatic Chaplin memory management:\n # one controller per screen.\n list: (params) ->\n filterer = params.filterer?.trim() ? 'all'\n @publishEvent 'todos:filter', filterer\n @view = new TodosView collection: mediator.todos, filterer: (model) ->\n switch filterer\n when 'completed' then model.get('completed')\n when 'active' then not model.get('completed')\n else true\n","Application = require 'application'\nroutes = require 'routes'\n\n# Initialize the application on DOM ready event.\ndocument.addEventListener 'DOMContentLoaded', ->\n new Application\n controllerSuffix: '-controller', pushState: false, routes: routes\n, false\n","# Application-specific utilities\n# ------------------------------\n\n# Delegate to Chaplin’s utils module.\nutils = Chaplin.utils.beget Chaplin.utils\n\nBackbone.utils.extend utils,\n toggle: (elem, visible) ->\n elem.style.display = (if visible then '' else 'none')\n\n# Prevent creating new properties and stuff.\nObject.seal? utils\n\nmodule.exports = utils\n","module.exports = Chaplin.mediator\n","# It is a very good idea to have base Model / Collection\n# e.g. Model = require 'models/base/model'\n# But in this particular app since we only have one\n# model type, we will inherit directly from Chaplin Model.\nmodule.exports = class Todo extends Chaplin.Model\n defaults:\n title: ''\n completed: no\n\n initialize: ->\n super\n @set 'created', Date.now() if @isNew()\n\n toggle: ->\n @set completed: not @get('completed')\n\n isVisible: ->\n isCompleted = @get('completed')\n","Todo = require 'models/todo'\n\nmodule.exports = class Todos extends Chaplin.Collection\n model: Todo\n localStorage: new Store 'todos-chaplin'\n\n allAreCompleted: ->\n @getCompleted().length is @length\n\n getCompleted: ->\n @where completed: yes\n\n getActive: ->\n @where completed: no\n\n comparator: (todo) ->\n todo.get('created')\n","module.exports = (match) ->\n match ':filterer', 'index#list'\n match '', 'index#list'\n","View = require 'views/base/view'\n\nmodule.exports = class CollectionView extends Chaplin.CollectionView\n # This class doesn’t inherit from the application-specific View class,\n # so we need to borrow the method from the View prototype:\n getTemplateFunction: View::getTemplateFunction\n useCssAnimation: true\n","module.exports = class View extends Chaplin.View\n # Precompiled templates function initializer.\n getTemplateFunction: ->\n @template\n","View = require './base/view'\nutils = require 'lib/utils'\n\nmodule.exports = class FooterView extends View\n autoRender: true\n el: '#footer'\n events:\n 'click #clear-completed': 'clearCompleted'\n listen:\n 'todos:filter mediator': 'updateFilterer'\n 'all collection': 'renderCounter'\n template: require './templates/footer'\n\n render: ->\n super\n @renderCounter()\n\n updateFilterer: (filterer) ->\n filterer = '' if filterer is 'all'\n selector = \"[href='#/#{filterer}']\"\n cls = 'selected'\n @findAll('#filters a').forEach (link) =>\n link.classList.remove cls\n link.classList.add cls if Backbone.utils.matchesSelector link, selector\n\n renderCounter: ->\n total = @collection.length\n active = @collection.getActive().length\n completed = @collection.getCompleted().length\n\n @find('#todo-count > strong').textContent = active\n countDescription = (if active is 1 then 'item' else 'items')\n @find('.todo-count-title').textContent = countDescription\n\n @find('#completed-count').textContent = \"(#{completed})\"\n utils.toggle @find('#clear-completed'), completed > 0\n utils.toggle @el, total > 0\n\n clearCompleted: ->\n @publishEvent 'todos:clear'\n","View = require './base/view'\n\nmodule.exports = class HeaderView extends View\n autoRender: true\n el: '#header'\n events:\n 'keypress #new-todo': 'createOnEnter'\n template: require './templates/header'\n\n createOnEnter: (event) ->\n ENTER_KEY = 13\n title = event.delegateTarget.value.trim()\n return if event.keyCode isnt ENTER_KEY or not title\n @collection.create {title}\n @find('#new-todo').value = ''\n","var __templateData = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n \n\n\n return \"<span id=\\\"todo-count\\\">\\n <strong></strong>\\n <span class=\\\"todo-count-title\\\">items</span>\\n left\\n</span>\\n<ul id=\\\"filters\\\">\\n <li>\\n <a href=\\\"#/\\\">All</a>\\n </li>\\n <li>\\n <a href=\\\"#/active\\\">Active</a>\\n </li>\\n <li>\\n <a href=\\\"#/completed\\\">Completed</a>\\n </li>\\n</ul>\\n<button id=\\\"clear-completed\\\">Clear completed <span id=\\\"completed-count\\\"></span></button>\\n\";\n });\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n \n\n\n return \"<h1>todos</h1>\\n<input id=\\\"new-todo\\\" placeholder=\\\"What needs to be done?\\\" autofocus>\\n\";\n });\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n var buffer = \"\", stack1, helper, self=this, functionType=\"function\", escapeExpression=this.escapeExpression;\n\nfunction program1(depth0,data) {\n \n \n return \" checked\";\n }\n\n buffer += \"<div class=\\\"view\\\">\\n <input class=\\\"toggle\\\" type=\\\"checkbox\\\"\";\n stack1 = helpers['if'].call(depth0, (depth0 && depth0.completed), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});\n if(stack1 || stack1 === 0) { buffer += stack1; }\n buffer += \">\\n <label>\";\n if (helper = helpers.title) { stack1 = helper.call(depth0, {hash:{},data:data}); }\n else { helper = (depth0 && depth0.title); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }\n buffer += escapeExpression(stack1)\n + \"</label>\\n <button class=\\\"destroy\\\"></button>\\n</div>\\n<input class=\\\"edit\\\" value=\\\"\";\n if (helper = helpers.title) { stack1 = helper.call(depth0, {hash:{},data:data}); }\n else { helper = (depth0 && depth0.title); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }\n buffer += escapeExpression(stack1)\n + \"\\\">\\n\";\n return buffer;\n });\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n \n\n\n return \"<input id=\\\"toggle-all\\\" type=\\\"checkbox\\\">\\n<label for=\\\"toggle-all\\\">Mark all as complete</label>\\n<ul id=\\\"todo-list\\\"></ul>\\n\";\n });\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","View = require './base/view'\n\nmodule.exports = class TodoView extends View\n events:\n 'click .toggle': 'toggle'\n 'dblclick label': 'edit'\n 'keyup .edit': 'save'\n 'focusout .edit': 'save'\n 'click .destroy': 'clear'\n\n listen:\n 'change model': 'render'\n\n template: require './templates/todo'\n tagName: 'li'\n\n render: ->\n super\n @toggleClass()\n\n toggleClass: ->\n isCompleted = @model.get('completed')\n @el.classList.toggle 'completed', isCompleted\n\n clear: ->\n @model.destroy()\n\n toggle: ->\n @model.toggle().save()\n\n edit: ->\n @el.classList.add 'editing'\n input = @find('.edit')\n input.focus()\n input.value = input.value;\n\n save: (event) ->\n ENTER_KEY = 13\n title = event.delegateTarget.value.trim()\n return @model.destroy() unless title\n return if event.type is 'keyup' and event.keyCode isnt ENTER_KEY\n @model.save {title}\n @el.classList.remove 'editing'\n","CollectionView = require './base/collection-view'\nTodoView = require './todo-view'\nutils = require 'lib/utils'\n\nmodule.exports = class TodosView extends CollectionView\n container: '#main'\n events:\n 'click #toggle-all': 'toggleCompleted'\n itemView: TodoView\n listSelector: '#todo-list'\n listen:\n 'all collection': 'renderCheckbox'\n 'todos:clear mediator': 'clear'\n template: require './templates/todos'\n\n render: ->\n super\n @renderCheckbox()\n\n renderCheckbox: ->\n @find('#toggle-all').checked = @collection.allAreCompleted()\n utils.toggle @el, @collection.length isnt 0\n\n toggleCompleted: (event) ->\n isChecked = event.delegateTarget.checked\n @collection.forEach (todo) -> todo.save completed: isChecked\n\n clear: ->\n @collection.getCompleted().forEach (model) ->\n model.destroy()\n"]}
\ No newline at end of file
{"version":3,"sources":["app/application.coffee","app/controllers/index-controller.coffee","app/initialize.coffee","app/lib/utils.coffee","app/mediator.coffee","app/models/todo.coffee","app/models/todos.coffee","app/routes.coffee","app/views/base/collection-view.coffee","app/views/base/view.coffee","app/views/footer-view.coffee","app/views/header-view.coffee","app/views/templates/footer.hbs","app/views/templates/header.hbs","app/views/templates/todo.hbs","app/views/templates/todos.hbs","app/views/todo-view.coffee","app/views/todos-view.coffee"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;GAAA;kSAAA;;AAAA,GAAW,KAAX,EAAW;;AACX,CADA,EACQ,EAAR,EAAQ;;AAGR,CAJA,EAIuB,GAAjB,CAAN;CAGE;;;;;CAAA;;CAAA,EAAO,EAAP;;CAAA,EAIc,SAAd;CAEE,EAAqB,CAArB,IAAQ;CAFI,QAIZ;CARF,EAIc;;CAJd,EAUO,EAAP,IAAO;CAEL,IAAc,GAAN;CAFH,QAGL;CAbF,EAUO;;CAVP;;CAHyC,MAAO;;;;ACJlD;GAAA;kSAAA;;AAAA,GAAa,OAAb,YAAa;;AACb,CADA,EACa,OAAb,YAAa;;AACb,CAFA,EAEY,MAAZ,YAAY;;AACZ,C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AkC,CAAlC,CAAkC,EAAnC,EAAoC,CAAzB,CAAX;CACQ,IAAD,EAAL;CADF,IAAmC;CAvBrC,EAsBO;;CAtBP;;CADuC","file":"public/app.js","sourcesContent":["mediator = require 'mediator'\nTodos = require 'models/todos'\n\n# The application object\nmodule.exports = class Application extends Chaplin.Application\n # Set your application name here so the document title is set to\n # “Controller title – Site title” (see Layout#adjustTitle)\n title: 'Chaplin • TodoMVC'\n\n # Create additional mediator properties\n # -------------------------------------\n initMediator: ->\n # Add additional application-specific properties and methods\n mediator.todos = new Todos()\n # Seal the mediator\n super\n\n start: ->\n # If todos are fetched from server, we will need to wait for them.\n mediator.todos.fetch()\n super\n","HeaderView = require '../views/header-view'\nFooterView = require '../views/footer-view'\nTodosView = require '../views/todos-view'\nmediator = require 'mediator'\n\nmodule.exports = class IndexController extends Chaplin.Controller\n # The method is executed before any controller actions.\n # We compose structure in order for it to be rendered only once.\n beforeAction: ->\n @reuse 'structure', ->\n params = collection: mediator.todos\n @header = new HeaderView params\n @footer = new FooterView params\n\n # On each new load, old @view will be disposed and\n # new @view will be created. This is idiomatic Chaplin memory management:\n # one controller per screen.\n list: (params) ->\n filterer = params.filterer?.trim() ? 'all'\n @publishEvent 'todos:filter', filterer\n @view = new TodosView collection: mediator.todos, filterer: (model) ->\n switch filterer\n when 'completed' then model.get('completed')\n when 'active' then not model.get('completed')\n else true\n","Application = require 'application'\nroutes = require 'routes'\n\n# Initialize the application on DOM ready event.\ndocument.addEventListener 'DOMContentLoaded', ->\n new Application\n controllerSuffix: '-controller', pushState: false, routes: routes\n, false\n","# Application-specific utilities\n# ------------------------------\n\n# Delegate to Chaplin’s utils module.\nutils = Chaplin.utils.beget Chaplin.utils\n\nBackbone.utils.extend utils,\n toggle: (elem, visible) ->\n elem.style.display = (if visible then '' else 'none')\n\n# Prevent creating new properties and stuff.\nObject.seal? utils\n\nmodule.exports = utils\n","module.exports = Chaplin.mediator\n","# It is a very good idea to have base Model / Collection\n# e.g. Model = require 'models/base/model'\n# But in this particular app since we only have one\n# model type, we will inherit directly from Chaplin Model.\nmodule.exports = class Todo extends Chaplin.Model\n defaults:\n title: ''\n completed: no\n\n initialize: ->\n super\n @set 'created', Date.now() if @isNew()\n\n toggle: ->\n @set completed: not @get('completed')\n\n isVisible: ->\n isCompleted = @get('completed')\n","Todo = require 'models/todo'\n\nmodule.exports = class Todos extends Chaplin.Collection\n model: Todo\n localStorage: new Store 'todos-chaplin'\n\n allAreCompleted: ->\n @getCompleted().length is @length\n\n getCompleted: ->\n @where completed: yes\n\n getActive: ->\n @where completed: no\n\n comparator: (todo) ->\n todo.get('created')\n","module.exports = (match) ->\n match ':filterer', 'index#list'\n match '', 'index#list'\n","View = require 'views/base/view'\n\nmodule.exports = class CollectionView extends Chaplin.CollectionView\n # This class doesn’t inherit from the application-specific View class,\n # so we need to borrow the method from the View prototype:\n getTemplateFunction: View::getTemplateFunction\n useCssAnimation: true\n","module.exports = class View extends Chaplin.View\n # Precompiled templates function initializer.\n getTemplateFunction: ->\n @template\n","View = require './base/view'\nutils = require 'lib/utils'\n\nmodule.exports = class FooterView extends View\n autoRender: true\n el: '#footer'\n events:\n 'click #clear-completed': 'clearCompleted'\n listen:\n 'todos:filter mediator': 'updateFilterer'\n 'all collection': 'renderCounter'\n template: require './templates/footer'\n\n render: ->\n super\n @renderCounter()\n\n updateFilterer: (filterer) ->\n filterer = '' if filterer is 'all'\n selector = \"[href='#/#{filterer}']\"\n cls = 'selected'\n @findAll('#filters a').forEach (link) =>\n link.classList.remove cls\n link.classList.add cls if Backbone.utils.matchesSelector link, selector\n\n renderCounter: ->\n total = @collection.length\n active = @collection.getActive().length\n completed = @collection.getCompleted().length\n\n @find('#todo-count > strong').textContent = active\n countDescription = (if active is 1 then 'item' else 'items')\n @find('.todo-count-title').textContent = countDescription\n\n utils.toggle @find('#clear-completed'), completed > 0\n utils.toggle @el, total > 0\n\n clearCompleted: ->\n @publishEvent 'todos:clear'\n","View = require './base/view'\n\nmodule.exports = class HeaderView extends View\n autoRender: true\n el: '#header'\n events:\n 'keypress #new-todo': 'createOnEnter'\n template: require './templates/header'\n\n createOnEnter: (event) ->\n ENTER_KEY = 13\n title = event.delegateTarget.value.trim()\n return if event.keyCode isnt ENTER_KEY or not title\n @collection.create {title}\n @find('#new-todo').value = ''\n","var __templateData = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n \n\n\n return \"<span id=\\\"todo-count\\\">\\n <strong></strong>\\n <span class=\\\"todo-count-title\\\">items</span>\\n left\\n</span>\\n<ul id=\\\"filters\\\">\\n <li>\\n <a href=\\\"#/\\\">All</a>\\n </li>\\n <li>\\n <a href=\\\"#/active\\\">Active</a>\\n </li>\\n <li>\\n <a href=\\\"#/completed\\\">Completed</a>\\n </li>\\n</ul>\\n<button id=\\\"clear-completed\\\">Clear completed</button>\\n\";\n });\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n \n\n\n return \"<h1>todos</h1>\\n<input id=\\\"new-todo\\\" placeholder=\\\"What needs to be done?\\\" autofocus>\\n\";\n });\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n var buffer = \"\", stack1, helper, self=this, functionType=\"function\", escapeExpression=this.escapeExpression;\n\nfunction program1(depth0,data) {\n \n \n return \" checked\";\n }\n\n buffer += \"<div class=\\\"view\\\">\\n <input class=\\\"toggle\\\" type=\\\"checkbox\\\"\";\n stack1 = helpers['if'].call(depth0, (depth0 && depth0.completed), {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data});\n if(stack1 || stack1 === 0) { buffer += stack1; }\n buffer += \">\\n <label>\";\n if (helper = helpers.title) { stack1 = helper.call(depth0, {hash:{},data:data}); }\n else { helper = (depth0 && depth0.title); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }\n buffer += escapeExpression(stack1)\n + \"</label>\\n <button class=\\\"destroy\\\"></button>\\n</div>\\n<input class=\\\"edit\\\" value=\\\"\";\n if (helper = helpers.title) { stack1 = helper.call(depth0, {hash:{},data:data}); }\n else { helper = (depth0 && depth0.title); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }\n buffer += escapeExpression(stack1)\n + \"\\\">\\n\";\n return buffer;\n });\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","var __templateData = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,'>= 1.0.0'];\nhelpers = this.merge(helpers, Handlebars.helpers); data = data || {};\n \n\n\n return \"<input id=\\\"toggle-all\\\" type=\\\"checkbox\\\">\\n<label for=\\\"toggle-all\\\">Mark all as complete</label>\\n<ul id=\\\"todo-list\\\"></ul>\\n\";\n });\nif (typeof define === 'function' && define.amd) {\n define([], function() {\n return __templateData;\n });\n} else if (typeof module === 'object' && module && module.exports) {\n module.exports = __templateData;\n} else {\n __templateData;\n}","View = require './base/view'\n\nmodule.exports = class TodoView extends View\n events:\n 'click .toggle': 'toggle'\n 'dblclick label': 'edit'\n 'keyup .edit': 'save'\n 'focusout .edit': 'save'\n 'click .destroy': 'clear'\n\n listen:\n 'change model': 'render'\n\n template: require './templates/todo'\n tagName: 'li'\n\n render: ->\n super\n @toggleClass()\n\n toggleClass: ->\n isCompleted = @model.get('completed')\n @el.classList.toggle 'completed', isCompleted\n\n clear: ->\n @model.destroy()\n\n toggle: ->\n @model.toggle().save()\n\n edit: ->\n @el.classList.add 'editing'\n input = @find('.edit')\n input.focus()\n input.value = input.value;\n\n save: (event) ->\n ENTER_KEY = 13\n title = event.delegateTarget.value.trim()\n return @model.destroy() unless title\n return if event.type is 'keyup' and event.keyCode isnt ENTER_KEY\n @model.save {title}\n @el.classList.remove 'editing'\n","CollectionView = require './base/collection-view'\nTodoView = require './todo-view'\nutils = require 'lib/utils'\n\nmodule.exports = class TodosView extends CollectionView\n container: '#main'\n events:\n 'click #toggle-all': 'toggleCompleted'\n itemView: TodoView\n listSelector: '#todo-list'\n listen:\n 'all collection': 'renderCheckbox'\n 'todos:clear mediator': 'clear'\n template: require './templates/todos'\n\n render: ->\n super\n @renderCheckbox()\n\n renderCheckbox: ->\n @find('#toggle-all').checked = @collection.allAreCompleted()\n utils.toggle @el, @collection.length isnt 0\n\n toggleCompleted: (event) ->\n isChecked = event.delegateTarget.checked\n @collection.forEach (todo) -> todo.save completed: isChecked\n\n clear: ->\n @collection.getCompleted().forEach (model) ->\n model.destroy()\n"]}
\ 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