deckar01-task_list 3.0.alpha1 → 3.0.alpha2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bower.json +1 -1
- data/lib/task_list/filter.rb +5 -13
- data/lib/task_list/version.rb +1 -1
- data/package.json +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad259725c7de35c5b6bb6c88a6f175c3c53becfebebc2681d7fc3f816cd0b498
|
4
|
+
data.tar.gz: 59bbc4372a0a24e95123585ad2df1b1b9551f89be82486a72bcac36321522121
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2773a96edaf7569423101c52f7b310265e206b1c2ad71aff139cfa810d1bda9313ed4434b0fdd6b7963e555b7321c0fd8dd06f78af551f297a71404657abd28c
|
7
|
+
data.tar.gz: 66ed087ad4add8a9bdc24951ce8c55bbbe4562b936f409c7499133276a7df474a6af100d58865ee2f9f4b16292f6f7ddd15b2048f18666b99202908eaadcab08
|
data/bower.json
CHANGED
data/lib/task_list/filter.rb
CHANGED
@@ -37,17 +37,16 @@ class TaskList
|
|
37
37
|
IncompletePattern = /\[[[:space:]]\]/.freeze # matches all whitespace
|
38
38
|
CompletePattern = /\[[xX]\]/.freeze # matches any capitalization
|
39
39
|
|
40
|
-
# All valid checkbox patterns.
|
41
|
-
# Useful for overriding ItemPattern wih custom formats.
|
42
|
-
CheckboxPatterns = /#{CompletePattern}|#{IncompletePattern}/
|
43
|
-
|
44
40
|
# Pattern used to identify all task list items.
|
45
41
|
# Useful when you need iterate over all items.
|
46
42
|
ItemPattern = /
|
47
43
|
^
|
48
44
|
(?:\s*[-+*]|(?:\d+\.))? # optional list prefix
|
49
45
|
\s* # optional whitespace prefix
|
50
|
-
(#
|
46
|
+
( # checkbox
|
47
|
+
#{CompletePattern}|
|
48
|
+
#{IncompletePattern}
|
49
|
+
)
|
51
50
|
(?=\s) # followed by whitespace
|
52
51
|
/x
|
53
52
|
|
@@ -59,20 +58,13 @@ class TaskList
|
|
59
58
|
result[:task_list_items] ||= []
|
60
59
|
end
|
61
60
|
|
62
|
-
# Computes attributes for the item input.
|
63
|
-
#
|
64
|
-
# Returns an String of HTML attributes.
|
65
|
-
def checkbox_attributes(item)
|
66
|
-
'checked="checked"' if item.complete?
|
67
|
-
end
|
68
|
-
|
69
61
|
# Renders the item checkbox in a span including the item state.
|
70
62
|
#
|
71
63
|
# Returns an HTML-safe String.
|
72
64
|
def render_item_checkbox(item)
|
73
65
|
%(<input type="checkbox"
|
74
66
|
class="task-list-item-checkbox"
|
75
|
-
#{
|
67
|
+
#{'checked="checked"' if item.complete?}
|
76
68
|
disabled="disabled"
|
77
69
|
/>)
|
78
70
|
end
|
data/lib/task_list/version.rb
CHANGED
data/package.json
CHANGED