Add optional bottom QR link

This commit is contained in:
seaweedchan 2014-05-16 01:31:48 -07:00
parent af887010a7
commit a17df81fe9
4 changed files with 27 additions and 0 deletions

1
.gitignore vendored
View File

@ -1,6 +1,7 @@
node_modules/
*~
*.db
*.DS_Store
tmp-crx/
tmp-userscript/
testbuilds/

View File

@ -349,6 +349,10 @@ Config =
false
'Automatically load the captcha when you open a thread, and reload it after you post.'
]
'Bottom QR Link': [
true
'Places a link on the bottom of threads to open the QR.'
]
'Quote Links':
'Quote Backlinks': [

View File

@ -836,6 +836,13 @@ span.hide-announcement {
.qr-link-container {
text-align: center;
}
.qr-link-container-bottom {
width: 200px;
position: absolute;
left: -100px;
margin-left: 50%;
text-align: center;
}
.qr-link {
border-radius: 3px;
padding: 6px 10px 5px;

View File

@ -56,8 +56,23 @@ QR =
if Conf['QR Shortcut']
$.rmClass $('.qr-shortcut'), 'disabled'
if Conf['Bottom QR Link'] and g.VIEW is 'thread'
linkBot = $.el 'div',
innerHTML: "[<a href='javascript:;' class='qr-link-bottom'>Reply to Thread</a>]"
className: "qr-link-container-bottom"
$.on linkBot.firstElementChild, 'click', ->
$.event 'CloseMenu'
QR.open()
QR.nodes.com.focus()
if Conf['QR Shortcut']
$.rmClass $('.qr-shortcut'), 'disabled'
$.prepend $('.navLinksBot'), linkBot
$.before $.id('togglePostFormLink'), link
$.on d, 'QRGetSelectedPost', ({detail: cb}) ->
cb QR.selected
$.on d, 'QRAddPreSubmitHook', ({detail: cb}) ->