forked from tastejs/todomvc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Add Bower integration. Since Brunch automatically concatenates all Bower stuff, we don’t need bower_components in repository (added to .gitignore, except of todomvc-common). 2. Update Brunch to 1.7. * Added automatic source maps generation, source maps are in repo too. 3. Update Chaplin to 0.10. * Remove `chaplin` module, switch to global variable. * Switch to new declarative events format. * Switch to controller compositions instead of static controllers. * Remove `application` since Chaplin now has this functionality by default.
- Loading branch information
Showing
39 changed files
with
15,693 additions
and
8,813 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
bower_components/ | ||
!bower_components/todomvc-common | ||
|
||
# NPM packages folder. | ||
node_modules/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 10 additions & 1 deletion
11
labs/dependency-examples/chaplin-brunch/app/controllers/base/controller.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
Chaplin = require 'chaplin' | ||
HeaderView = require 'views/header-view' | ||
FooterView = require 'views/footer-view' | ||
TodosView = require 'views/todos-view' | ||
mediator = require 'mediator' | ||
|
||
module.exports = class Controller extends Chaplin.Controller | ||
beforeAction: -> | ||
@compose 'footer', -> | ||
params = collection: mediator.todos | ||
@header = new HeaderView params | ||
@footer = new FooterView params | ||
@todos = new TodosView params |
8 changes: 0 additions & 8 deletions
8
labs/dependency-examples/chaplin-brunch/app/controllers/footer-controller.coffee
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
labs/dependency-examples/chaplin-brunch/app/controllers/header-controller.coffee
This file was deleted.
Oops, something went wrong.
8 changes: 3 additions & 5 deletions
8
labs/dependency-examples/chaplin-brunch/app/controllers/index-controller.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
Controller = require 'controllers/base/controller' | ||
Controller = require './base/controller' | ||
|
||
module.exports = class IndexController extends Controller | ||
title: 'Todo list' | ||
|
||
list: (options) -> | ||
@publishEvent 'todos:filter', options.filterer?.trim() ? 'all' | ||
list: (params) -> | ||
@publishEvent 'todos:filter', params.filterer?.trim() ? 'all' |
8 changes: 0 additions & 8 deletions
8
labs/dependency-examples/chaplin-brunch/app/controllers/todos-controller.coffee
This file was deleted.
Oops, something went wrong.
5 changes: 3 additions & 2 deletions
5
labs/dependency-examples/chaplin-brunch/app/initialize.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
Application = require 'application' | ||
routes = require 'routes' | ||
|
||
# Initialize the application on DOM ready event. | ||
$ -> | ||
app = new Application() | ||
app.initialize() | ||
new Application | ||
controllerSuffix: '-controller', pushState: no, routes: routes |
13 changes: 0 additions & 13 deletions
13
labs/dependency-examples/chaplin-brunch/app/lib/support.coffee
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
Chaplin = require 'chaplin' | ||
|
||
# Application-specific utilities | ||
# ------------------------------ | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
labs/dependency-examples/chaplin-brunch/app/lib/view-helper.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
module.exports = require('chaplin').mediator | ||
module.exports = Chaplin.mediator |
1 change: 0 additions & 1 deletion
1
labs/dependency-examples/chaplin-brunch/app/models/base/collection.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
labs/dependency-examples/chaplin-brunch/app/models/base/model.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
Chaplin = require 'chaplin' | ||
|
||
module.exports = class Model extends Chaplin.Model | ||
# Mixin a synchronization state machine | ||
# _(@prototype).extend Chaplin.SyncMachine |
1 change: 0 additions & 1 deletion
1
labs/dependency-examples/chaplin-brunch/app/views/base/collection-view.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
labs/dependency-examples/chaplin-brunch/app/views/base/view.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 2 additions & 5 deletions
7
labs/dependency-examples/chaplin-brunch/app/views/layout.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
Chaplin = require 'chaplin' | ||
|
||
# Layout is the top-level application ‘view’. | ||
module.exports = class Layout extends Chaplin.Layout | ||
initialize: -> | ||
super | ||
@subscribeEvent 'todos:filter', @changeFilterer | ||
listen: | ||
'todos:filter mediator': 'changeFilterer' | ||
|
||
changeFilterer: (filterer = 'all') -> | ||
$('#todoapp').attr 'class', "filter-#{filterer}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.