deckar01-task_list 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/task_list.coffee +19 -4
- data/lib/task_list/version.rb +1 -1
- data/package.json +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3001d6279d0f9902b6c3a716160cc4461ebd0f5d
|
4
|
+
data.tar.gz: a430a31c65d93c60d990a28da605034769c28ed8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a520d9514d2b60e807a3b089934de349a12d163dab3dbb9cdefa869759e7954dfeebdf3f3dcebff7f08ec689e4b7b9ebefde455db8d375bb7849033f4e6bcc74
|
7
|
+
data.tar.gz: 1d6b284440eead3abbfb4d8d8466bcd96e5ad18d0c50794c5a8dfd14326f697561cd25b19fdac6ac44876daf50f421d85ec94b65edb43e5b5751a870588e0d29
|
@@ -149,12 +149,18 @@ class TaskList
|
|
149
149
|
@field.dispatchEvent changeEvent
|
150
150
|
|
151
151
|
unless changeEvent.defaultPrevented
|
152
|
-
|
152
|
+
{ result, lineNumber, lineSource } =
|
153
|
+
TaskList.updateSource(@field.value, index, item.checked)
|
154
|
+
|
155
|
+
@field.value = result
|
153
156
|
changeEvent = createEvent 'change'
|
154
157
|
@field.dispatchEvent changeEvent
|
155
|
-
changedEvent = createEvent 'tasklist:changed',
|
158
|
+
changedEvent = createEvent 'tasklist:changed', {
|
156
159
|
index: index
|
157
160
|
checked: item.checked
|
161
|
+
lineNumber: lineNumber
|
162
|
+
lineSource: lineSource
|
163
|
+
}
|
158
164
|
@field.dispatchEvent changedEvent
|
159
165
|
|
160
166
|
# Static interface
|
@@ -220,7 +226,10 @@ class TaskList
|
|
220
226
|
split("\n")
|
221
227
|
index = 0
|
222
228
|
inCodeBlock = false
|
223
|
-
|
229
|
+
lineNumber
|
230
|
+
lineSource
|
231
|
+
|
232
|
+
result = for line, i in source.split("\n")
|
224
233
|
if inCodeBlock
|
225
234
|
# Lines inside of a code block are ignored.
|
226
235
|
if line.match(@endFencesPattern)
|
@@ -232,13 +241,19 @@ class TaskList
|
|
232
241
|
else if line in clean && line.match(@itemPattern)
|
233
242
|
index += 1
|
234
243
|
if index == itemIndex
|
244
|
+
lineNumber = i + 1
|
245
|
+
lineSource = line
|
235
246
|
line =
|
236
247
|
if checked
|
237
248
|
line.replace(@incompletePattern, @complete)
|
238
249
|
else
|
239
250
|
line.replace(@completePattern, @incomplete)
|
240
251
|
line
|
241
|
-
|
252
|
+
return {
|
253
|
+
result: result.join("\n")
|
254
|
+
lineNumber: lineNumber
|
255
|
+
lineSource: lineSource
|
256
|
+
}
|
242
257
|
|
243
258
|
if typeof jQuery != 'undefined'
|
244
259
|
jQuery.fn.taskList = (method) ->
|
data/lib/task_list/version.rb
CHANGED
data/package.json
CHANGED
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: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jared Deckard
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-01-
|
12
|
+
date: 2019-01-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: html-pipeline
|