Add options for header and page QR shortcuts. #280
This commit is contained in:
parent
c78443ac00
commit
94124f953b
@ -3,6 +3,8 @@ zixaphir
|
|||||||
- Fix stubs in reply hiding menu not following stubs config
|
- Fix stubs in reply hiding menu not following stubs config
|
||||||
- Fix thread hiding
|
- Fix thread hiding
|
||||||
- Fix Board Subtitle option
|
- Fix Board Subtitle option
|
||||||
|
- Revert to Mayhem-style notifications
|
||||||
|
- Add options for adding QR Shortcuts to the header or page
|
||||||
|
|
||||||
### 2.0.1 - 2013-05-08
|
### 2.0.1 - 2013-05-08
|
||||||
seaweed
|
seaweed
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
BIN
builds/crx.crx
BIN
builds/crx.crx
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -243,9 +243,13 @@ Config =
|
|||||||
]
|
]
|
||||||
|
|
||||||
'Posting':
|
'Posting':
|
||||||
'Quick Reply': [
|
'Header Shortcut': [
|
||||||
true
|
true
|
||||||
'All-in-one form to reply, create threads, automate dumping and more.'
|
'Add a shortcut to the header to toggle the QR.'
|
||||||
|
]
|
||||||
|
'Page Shortcut': [
|
||||||
|
false
|
||||||
|
'Add a shortcut to the top of the page to toggle the QR.'
|
||||||
]
|
]
|
||||||
'Persistent QR': [
|
'Persistent QR': [
|
||||||
true
|
true
|
||||||
|
|||||||
@ -1120,6 +1120,10 @@ input:checked + .rice {
|
|||||||
#selectrice:empty {
|
#selectrice:empty {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
/* Post Form Shortcut */
|
||||||
|
.qr-shortcut.on-page {
|
||||||
|
font-size: 250%;
|
||||||
|
}
|
||||||
/* Post Form */
|
/* Post Form */
|
||||||
#qr {
|
#qr {
|
||||||
z-index: 20;
|
z-index: 20;
|
||||||
@ -1346,16 +1350,6 @@ input:not([type=radio]) {
|
|||||||
opacity: 0;
|
opacity: 0;
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
}
|
}
|
||||||
#showQR {
|
|
||||||
display: #{if _conf["Hide Show Post Form"] then "none" else "block"};
|
|
||||||
z-index: 4;
|
|
||||||
#{Style.sidebarLocation[0]}: 2px;
|
|
||||||
width: #{width}px;
|
|
||||||
background-color: transparent;
|
|
||||||
text-align: center;
|
|
||||||
position: fixed;
|
|
||||||
top: auto;
|
|
||||||
}
|
|
||||||
/* Fake File Input */
|
/* Fake File Input */
|
||||||
#qr-filename,
|
#qr-filename,
|
||||||
.has-file #qr-no-file {
|
.has-file #qr-no-file {
|
||||||
|
|||||||
@ -1,9 +1,16 @@
|
|||||||
QR =
|
QR =
|
||||||
init: ->
|
init: ->
|
||||||
return if !Conf['Quick Reply']
|
|
||||||
|
|
||||||
@db = new DataBoard 'yourPosts'
|
@db = new DataBoard 'yourPosts'
|
||||||
|
|
||||||
|
$.ready @initReady
|
||||||
|
$.on d, '4chanXInitFinished', @persist if Conf['Persistent QR']
|
||||||
|
|
||||||
|
Post::callbacks.push
|
||||||
|
name: 'Quick Reply'
|
||||||
|
cb: @node
|
||||||
|
|
||||||
|
return unless Conf['Header Shortcut'] or Conf['Page Shortcut']
|
||||||
|
|
||||||
sc = $.el 'a',
|
sc = $.el 'a',
|
||||||
className: "qr-shortcut #{unless Conf['Persistent QR'] then 'disabled' else ''}"
|
className: "qr-shortcut #{unless Conf['Persistent QR'] then 'disabled' else ''}"
|
||||||
textContent: 'QR'
|
textContent: 'QR'
|
||||||
@ -19,14 +26,16 @@ QR =
|
|||||||
QR.close()
|
QR.close()
|
||||||
$.toggleClass @, 'disabled'
|
$.toggleClass @, 'disabled'
|
||||||
|
|
||||||
Header.addShortcut sc
|
return Header.addShortcut sc if Conf['Header Shortcut']
|
||||||
|
|
||||||
$.ready @initReady
|
$.addClass sc, 'on-page'
|
||||||
$.on d, '4chanXInitFinished', @persist if Conf['Persistent QR']
|
sc.textContent = if g.VIEW is 'thread' then 'Reply to Thread' else 'Start a Thread'
|
||||||
|
con = $.el 'div',
|
||||||
Post::callbacks.push
|
className: 'center'
|
||||||
name: 'Quick Reply'
|
$.add con, sc
|
||||||
cb: @node
|
$.asap (-> d.body), ->
|
||||||
|
$.asap (-> $.id 'postForm'), ->
|
||||||
|
$.before $.id('postForm'), con
|
||||||
|
|
||||||
initReady: ->
|
initReady: ->
|
||||||
QR.postingIsEnabled = !!$.id 'postForm'
|
QR.postingIsEnabled = !!$.id 'postForm'
|
||||||
@ -117,9 +126,9 @@ QR =
|
|||||||
QR.captcha.nodes.input.focus()
|
QR.captcha.nodes.input.focus()
|
||||||
alert el.textContent if d.hidden
|
alert el.textContent if d.hidden
|
||||||
QR.notifications.push new Notification 'warning', el
|
QR.notifications.push new Notification 'warning', el
|
||||||
|
|
||||||
notifications: []
|
notifications: []
|
||||||
|
|
||||||
cleanNotifications: ->
|
cleanNotifications: ->
|
||||||
for notification in QR.notifications
|
for notification in QR.notifications
|
||||||
notification.close()
|
notification.close()
|
||||||
@ -571,7 +580,7 @@ QR =
|
|||||||
# Load this post's values.
|
# Load this post's values.
|
||||||
for name in ['thread', 'name', 'email', 'sub', 'com']
|
for name in ['thread', 'name', 'email', 'sub', 'com']
|
||||||
QR.nodes[name].value = @[name] or null
|
QR.nodes[name].value = @[name] or null
|
||||||
|
|
||||||
QR.tripcodeHider.call QR.nodes['name']
|
QR.tripcodeHider.call QR.nodes['name']
|
||||||
@showFileData()
|
@showFileData()
|
||||||
QR.characterCount()
|
QR.characterCount()
|
||||||
@ -703,16 +712,16 @@ QR =
|
|||||||
|
|
||||||
dragStart: ->
|
dragStart: ->
|
||||||
$.addClass @, 'drag'
|
$.addClass @, 'drag'
|
||||||
|
|
||||||
dragEnd: ->
|
dragEnd: ->
|
||||||
$.rmClass @, 'drag'
|
$.rmClass @, 'drag'
|
||||||
|
|
||||||
dragEnter: ->
|
dragEnter: ->
|
||||||
$.addClass @, 'over'
|
$.addClass @, 'over'
|
||||||
|
|
||||||
dragLeave: ->
|
dragLeave: ->
|
||||||
$.rmClass @, 'over'
|
$.rmClass @, 'over'
|
||||||
|
|
||||||
dragOver: (e) ->
|
dragOver: (e) ->
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
e.dataTransfer.dropEffect = 'move'
|
e.dataTransfer.dropEffect = 'move'
|
||||||
@ -782,7 +791,7 @@ QR =
|
|||||||
|
|
||||||
$.addClass QR.nodes.el, 'has-captcha'
|
$.addClass QR.nodes.el, 'has-captcha'
|
||||||
$.after QR.nodes.dumpList.parentElement, [imgContainer, input]
|
$.after QR.nodes.dumpList.parentElement, [imgContainer, input]
|
||||||
|
|
||||||
sync: (@captchas) ->
|
sync: (@captchas) ->
|
||||||
QR.captcha.count()
|
QR.captcha.count()
|
||||||
|
|
||||||
@ -944,7 +953,7 @@ QR =
|
|||||||
$.on nodes.dumpButton, 'click', -> nodes.el.classList.toggle 'dump'
|
$.on nodes.dumpButton, 'click', -> nodes.el.classList.toggle 'dump'
|
||||||
$.on nodes.addPost, 'click', -> new QR.post true
|
$.on nodes.addPost, 'click', -> new QR.post true
|
||||||
$.on nodes.form, 'submit', QR.submit
|
$.on nodes.form, 'submit', QR.submit
|
||||||
$.on nodes.fileRM, 'click', (e) ->
|
$.on nodes.fileRM, 'click', (e) ->
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
QR.selected.rmFile()
|
QR.selected.rmFile()
|
||||||
$.on nodes.spoiler, 'change', -> QR.selected.nodes.spoiler.click()
|
$.on nodes.spoiler, 'change', -> QR.selected.nodes.spoiler.click()
|
||||||
@ -969,9 +978,9 @@ QR =
|
|||||||
QR.status()
|
QR.status()
|
||||||
QR.cooldown.init()
|
QR.cooldown.init()
|
||||||
QR.captcha.init()
|
QR.captcha.init()
|
||||||
|
|
||||||
Rice.nodes dialog
|
Rice.nodes dialog
|
||||||
|
|
||||||
$.add d.body, dialog
|
$.add d.body, dialog
|
||||||
|
|
||||||
if Conf['Auto Hide QR']
|
if Conf['Auto Hide QR']
|
||||||
@ -987,7 +996,7 @@ QR =
|
|||||||
else if !check and @.className.match "\\btripped\\b" then $.rmClass @, 'tripped'
|
else if !check and @.className.match "\\btripped\\b" then $.rmClass @, 'tripped'
|
||||||
|
|
||||||
preSubmitHooks: []
|
preSubmitHooks: []
|
||||||
|
|
||||||
submit: (e) ->
|
submit: (e) ->
|
||||||
e?.preventDefault()
|
e?.preventDefault()
|
||||||
|
|
||||||
@ -1155,11 +1164,11 @@ QR =
|
|||||||
QR.status()
|
QR.status()
|
||||||
QR.error err
|
QR.error err
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
QR.cleanNotifications()
|
QR.cleanNotifications()
|
||||||
h1 = $ 'h1', tmpDoc
|
h1 = $ 'h1', tmpDoc
|
||||||
|
|
||||||
if Conf['Posting Success Notifications']
|
if Conf['Posting Success Notifications']
|
||||||
QR.notifications.push new Notification 'success', h1.textContent, 5
|
QR.notifications.push new Notification 'success', h1.textContent, 5
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user