ASCII-compatible upvotes.
This commit is contained in:
parent
67b134c20f
commit
8f3879c9bd
@ -1,10 +1,11 @@
|
|||||||
Upvotes =
|
Upvotes =
|
||||||
text: '\u305D\u3046\u3060\u306D'
|
|
||||||
count: {}
|
count: {}
|
||||||
|
text: '\u305D\u3046\u3060\u306D'
|
||||||
|
regexp: /(?:^>.*\n)+\s*(?:\u305D\u3046\u3060\u306D|this)/gmi
|
||||||
|
|
||||||
init: ->
|
init: ->
|
||||||
return unless g.VIEW is 'thread' and Conf['Upvotes']
|
return unless g.VIEW is 'thread' and Conf['Upvotes']
|
||||||
@regexp = new RegExp "(?:^>.*\\n)+\\s*#{@text}", 'gm'
|
@textPosted = if g.BOARD.ID is 'r9k' then 'This.' else @text
|
||||||
Post.callbacks.push
|
Post.callbacks.push
|
||||||
name: 'Upvotes'
|
name: 'Upvotes'
|
||||||
cb: @node
|
cb: @node
|
||||||
@ -46,7 +47,7 @@ Upvotes =
|
|||||||
return unless QR.postingIsEnabled
|
return unless QR.postingIsEnabled
|
||||||
QR.quote.call @
|
QR.quote.call @
|
||||||
{com} = QR.nodes
|
{com} = QR.nodes
|
||||||
text = "#{Upvotes.text}\n"
|
text = "#{Upvotes.textPosted}\n"
|
||||||
pos = com.selectionStart
|
pos = com.selectionStart
|
||||||
com.value = com.value[..pos] + text + com.value[pos...]
|
com.value = com.value[..pos] + text + com.value[pos...]
|
||||||
pos += text.length
|
pos += text.length
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user