Skip to content
This repository was archived by the owner on Nov 1, 2017. It is now read-only.

Commit a3c4ceb

Browse files
committed
Merge pull request #20 from github/fire-crema-dependency
Remove crema as a dependency, pageUpdate hook
2 parents 88f0135 + ab1ceb2 commit a3c4ceb

File tree

3 files changed

+31
-33
lines changed

3 files changed

+31
-33
lines changed

README.md

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ into your GitHub-flavored-Markdown user content.
99
The Task List feature is actually made of several different components:
1010

1111
* GitHub-flavored-Markdown Filter
12-
* Model: summarizes and updates task list items
13-
* Controller: provides the update interface (optional)
14-
* JavaScript: enables task list behavior, handles AJAX updates, etc
12+
* Model: summarizes task list items
13+
* JavaScript: task list update behavior
1514
* CSS: styles Markdown task list items
1615

1716
## Installation
@@ -24,36 +23,43 @@ And then execute:
2423

2524
$ bundle
2625

27-
### Rails 3+: Rails Engine?
26+
### Rails 3+: Railtie method
2827

29-
TBD
30-
31-
### Rails 2.3: Manual.
28+
``` ruby
29+
# config/application.rb
30+
require 'task_list/railtie'
31+
```
3232

33-
TBD
33+
### Rails 2.3: Manual method
3434

35-
### CoffeeScript Requirements
35+
Wherever you have your Sprockets setup:
3636

37-
The following Bower packages are required:
37+
``` ruby
38+
Sprockets::Environment.new(Rails.root) do |env|
39+
# Load TaskList assets
40+
require 'task_list/railtie'
41+
TaskList.asset_paths.each do |path|
42+
env.append_path path
43+
end
44+
end
45+
```
3846

39-
* jquery
40-
* https://github.com/github/crema -- `$.pageUpdate`
41-
* rails-behavior -- `data-remote`
47+
If you're not using Sprockets, you're on your own but it's pretty straight
48+
forward. `task_list/railtie` defines `TaskList.asset_paths` which you can use
49+
to manage building your asset bundles.
4250

43-
## Usage
51+
### CoffeeScript Requirements
4452

45-
TBD
53+
Aside from requiring CoffeeScript, jQuery is the only other requirement.
4654

4755
## Testing and Development
4856

49-
To run the functional tests in the browser, install the necessary components
50-
with `script/bootstrap`:
57+
JavaScript unit tests can be run with `script/testsuite`.
5158

52-
```
53-
script/bootstrap
54-
```
59+
Ruby unit tests can be run with `rake test`.
5560

56-
Then run the server:
61+
Functional tests are more for manual testing in the browser. To run, install
62+
the necessary components with `script/bootstrap` then run the server:
5763

5864
```
5965
rackup -p 4011

app/assets/javascripts/task_lists.coffee

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#= provides tasklist:change
66
#= provides tasklist:changed
77
#
8-
#= require crema/events/pageupdate
8+
#= require jquery
99
#
1010
# Enables Task List update behavior.
1111
#
@@ -39,7 +39,7 @@
3939
# TaskList updates trigger `tasklist:change` events. If the change is
4040
# successful, `tasklist:changed` is fired. The change can be canceled.
4141
#
42-
# jQuery and crema are required.
42+
# jQuery is required.
4343
#
4444
# ### Methods
4545
#
@@ -92,11 +92,7 @@
9292
# ### NOTE
9393
#
9494
# Task list checkboxes are rendered as disabled by default because rendered
95-
# user content is cached without regard for the viewer. We enable checkboxes
96-
# on `pageUpdate` if the container has a `(textarea).js-task-list-field`.
97-
#
98-
# To automatically enable TaskLists, add the `js-task-list-enable` class to the
99-
# `js-task-list-container`.
95+
# user content is cached without regard for the viewer.
10096

10197
incomplete = "[ ]"
10298
complete = "[x]"
@@ -228,7 +224,3 @@ $.fn.taskList = (method) ->
228224
disable: disableTaskLists
229225

230226
methods[method || 'enable']($container)
231-
232-
# When the page is updated, enable new TaskList containers.
233-
$.pageUpdate ->
234-
$('.js-task-list-container.js-task-list-enable').taskList()

lib/task_list/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
class TaskList
2-
VERSION = [0, 3, 0].join('.')
2+
VERSION = [0, 4, 0].join('.')
33
end

0 commit comments

Comments
 (0)