commit
23b9459fa4
@ -1,3 +1,4 @@
|
||||
- Added dice monitoring on /tg/
|
||||
- Fix impossibility to create new threads when in dead threads.
|
||||
|
||||
### 3.5.7 - *2013-07-13*
|
||||
|
||||
@ -13,6 +13,7 @@ Config =
|
||||
'Index Navigation': [false, 'Add buttons to navigate between threads.']
|
||||
'Reply Navigation': [false, 'Add buttons to navigate to top / bottom of thread.']
|
||||
'Check for Updates': [true, 'Notify when updated versions of <%= meta.name %> are available.']
|
||||
'Show Dice Rolled': [true, 'Show dice that were entered into the email field.']
|
||||
'Filtering':
|
||||
'Anonymize': [false, 'Make everyone Anonymous.']
|
||||
'Filter': [true, 'Self-moderation placebo.']
|
||||
|
||||
@ -114,6 +114,7 @@ Main =
|
||||
initFeature 'Thread Watcher', ThreadWatcher
|
||||
initFeature 'Index Navigation', Nav
|
||||
initFeature 'Keybinds', Keybinds
|
||||
initFeature 'Dice Checker', Dice
|
||||
# c.timeEnd 'All initializations'
|
||||
|
||||
$.on d, 'AddCallback', Main.addCallback
|
||||
|
||||
20
src/Miscellaneous/Dice.coffee
Normal file
20
src/Miscellaneous/Dice.coffee
Normal file
@ -0,0 +1,20 @@
|
||||
Dice =
|
||||
init: ->
|
||||
return if g.VIEW is 'catalog' or !Conf['Show Dice Rolled']
|
||||
# or !Conf['Show dice being rolled']
|
||||
return if g.BOARD.ID isnt 'tg'
|
||||
Post::callbacks.push
|
||||
name: 'Dice roller'
|
||||
cb: @node
|
||||
node: ->
|
||||
return if @isClone
|
||||
email = @info.email
|
||||
dicestats = /dice\W(\d+)d(\d+)/.exec(email)
|
||||
return if not dicestats
|
||||
roll = ($$("b",@nodes.comment).filter (elem)->elem.innerHTML.lastIndexOf("Rolled", 0) == 0)[0]
|
||||
return if not roll
|
||||
rollResults = roll.innerHTML.slice 7
|
||||
dicestr = dicestats[1]+"d"+dicestats[2]
|
||||
roll.innerHTML = "Rolled " + dicestr + " and got " + rollResults
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user