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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '058afd74f87d80538ead4fff4993788d7f71b1152112edd07115e0554029050c'
4
- data.tar.gz: 12daa5aca83f2a05ca08f6937b5f7c438ac7a93e6acce53346189fcf25c6814e
3
+ metadata.gz: ad259725c7de35c5b6bb6c88a6f175c3c53becfebebc2681d7fc3f816cd0b498
4
+ data.tar.gz: 59bbc4372a0a24e95123585ad2df1b1b9551f89be82486a72bcac36321522121
5
5
  SHA512:
6
- metadata.gz: 7578ca24199c41c957baab771a76f2f7d605bf9d128ff461fffa618700aca615d29c5128b4ffb2b40b251fc7bbf5ed19ec49dd9b44a87b654dd6a15fc78f433d
7
- data.tar.gz: bc47cc0071775b370fc3a26e232d6121c4aff312579c9879c428437d1af8b46d14dfdb4bd9e22378d9cbcb363bd513e72c21590bb545e0f5c12af588de1131e6
6
+ metadata.gz: 2773a96edaf7569423101c52f7b310265e206b1c2ad71aff139cfa810d1bda9313ed4434b0fdd6b7963e555b7321c0fd8dd06f78af551f297a71404657abd28c
7
+ data.tar.gz: 66ed087ad4add8a9bdc24951ce8c55bbbe4562b936f409c7499133276a7df474a6af100d58865ee2f9f4b16292f6f7ddd15b2048f18666b99202908eaadcab08
data/bower.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deckar01-task_list",
3
- "version": "3.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Markdown TaskList components",
5
5
  "homepage": "https://gitlab.com/deckar01/task_list",
6
6
  "devDependencies": {
@@ -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
- (#{CheckboxPatterns}) # checkbox
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
- #{checkbox_attributes(item)}
67
+ #{'checked="checked"' if item.complete?}
76
68
  disabled="disabled"
77
69
  />)
78
70
  end
@@ -1,3 +1,3 @@
1
1
  class TaskList
2
- VERSION = [3, 0, 'alpha1'].join('.')
2
+ VERSION = [3, 0, 'alpha2'].join('.')
3
3
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deckar01-task_list",
3
- "version": "3.0.0",
3
+ "version": "2.3.3",
4
4
  "description": "Markdown TaskList components",
5
5
  "main": "dist/task_list.js",
6
6
  "directories": {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deckar01-task_list
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.alpha1
4
+ version: 3.0.alpha2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jared Deckard