More meaningful, better consistency with some QR names.
This commit is contained in:
parent
751fef81dd
commit
3902a40348
100
4chan_x.user.js
100
4chan_x.user.js
File diff suppressed because one or more lines are too long
@ -30,7 +30,7 @@
|
|||||||
background-color: #D6DAF0;
|
background-color: #D6DAF0;
|
||||||
border-color: #B7C5D9;
|
border-color: #B7C5D9;
|
||||||
}
|
}
|
||||||
:root.burichan .qrpreview {
|
:root.burichan .qr-preview {
|
||||||
background-color: rgba(0, 0, 0, .15);
|
background-color: rgba(0, 0, 0, .15);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@
|
|||||||
background-color: #F0E0D6;
|
background-color: #F0E0D6;
|
||||||
border-color: #D9BFB7;
|
border-color: #D9BFB7;
|
||||||
}
|
}
|
||||||
:root.futaba .qrpreview {
|
:root.futaba .qr-preview {
|
||||||
background-color: rgba(0, 0, 0, .15);
|
background-color: rgba(0, 0, 0, .15);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@
|
|||||||
background-color: #DDD;
|
background-color: #DDD;
|
||||||
border-color: #CCC;
|
border-color: #CCC;
|
||||||
}
|
}
|
||||||
:root.photon .qrpreview {
|
:root.photon .qr-preview {
|
||||||
background-color: rgba(0, 0, 0, .15);
|
background-color: rgba(0, 0, 0, .15);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -547,7 +547,7 @@ a[href="javascript:;"] {
|
|||||||
#dump-list::-webkit-scrollbar-thumb {
|
#dump-list::-webkit-scrollbar-thumb {
|
||||||
border: 1px solid;
|
border: 1px solid;
|
||||||
}
|
}
|
||||||
.qrpreview {
|
.qr-preview {
|
||||||
background-position: 50% 20%;
|
background-position: 50% 20%;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
border: 1px solid #808080;
|
border: 1px solid #808080;
|
||||||
@ -569,14 +569,14 @@ a[href="javascript:;"] {
|
|||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
white-space: pre;
|
white-space: pre;
|
||||||
}
|
}
|
||||||
.qrpreview:hover, .qrpreview:focus {
|
.qr-preview:hover, .qr-preview:focus {
|
||||||
opacity: .9;
|
opacity: .9;
|
||||||
color: #FFF !important;
|
color: #FFF !important;
|
||||||
}
|
}
|
||||||
.qrpreview#selected {
|
.qr-preview#selected {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
.qrpreview::before {
|
.qr-preview::before {
|
||||||
counter-increment: qrpreviews;
|
counter-increment: qrpreviews;
|
||||||
content: counter(qrpreviews);
|
content: counter(qrpreviews);
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
@ -584,11 +584,11 @@ a[href="javascript:;"] {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
top: 3px; right: 3px;
|
top: 3px; right: 3px;
|
||||||
}
|
}
|
||||||
.qrpreview.drag {
|
.qr-preview.drag {
|
||||||
border-color: red;
|
border-color: red;
|
||||||
border-style: dashed;
|
border-style: dashed;
|
||||||
}
|
}
|
||||||
.qrpreview.over {
|
.qr-preview.over {
|
||||||
border-color: #FFF;
|
border-color: #FFF;
|
||||||
border-style: dashed;
|
border-style: dashed;
|
||||||
}
|
}
|
||||||
@ -600,17 +600,17 @@ a[href="javascript:;"] {
|
|||||||
.remove:hover::after {
|
.remove:hover::after {
|
||||||
content: ' Remove';
|
content: ' Remove';
|
||||||
}
|
}
|
||||||
.qrpreview > label {
|
.qr-preview > label {
|
||||||
background: rgba(0, 0, 0, .5);
|
background: rgba(0, 0, 0, .5);
|
||||||
right: 0; bottom: 0; left: 0;
|
right: 0; bottom: 0; left: 0;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.qrpreview > label > input {
|
.qr-preview > label > input {
|
||||||
margin: 1px 0;
|
margin: 1px 0;
|
||||||
vertical-align: bottom;
|
vertical-align: bottom;
|
||||||
}
|
}
|
||||||
#addReply {
|
#add-post {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font-size: 30px;
|
font-size: 30px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
|
|||||||
@ -36,7 +36,7 @@
|
|||||||
:root.tomorrow #qr option {
|
:root.tomorrow #qr option {
|
||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
:root.tomorrow .qrpreview {
|
:root.tomorrow .qr-preview {
|
||||||
background-color: rgba(255, 255, 255, .15);
|
background-color: rgba(255, 255, 255, .15);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@
|
|||||||
background-color: #D6DAF0;
|
background-color: #D6DAF0;
|
||||||
border-color: #B7C5D9;
|
border-color: #B7C5D9;
|
||||||
}
|
}
|
||||||
:root.yotsuba-b .qrpreview {
|
:root.yotsuba-b .qr-preview {
|
||||||
background-color: rgba(0, 0, 0, .15);
|
background-color: rgba(0, 0, 0, .15);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@
|
|||||||
background-color: #F0E0D6;
|
background-color: #F0E0D6;
|
||||||
border-color: #D9BFB7;
|
border-color: #D9BFB7;
|
||||||
}
|
}
|
||||||
:root.yotsuba .qrpreview {
|
:root.yotsuba .qr-preview {
|
||||||
background-color: rgba(0, 0, 0, .15);
|
background-color: rgba(0, 0, 0, .15);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
108
src/qr.coffee
108
src/qr.coffee
@ -69,8 +69,8 @@ QR =
|
|||||||
QR.cleanNotifications()
|
QR.cleanNotifications()
|
||||||
d.activeElement.blur()
|
d.activeElement.blur()
|
||||||
$.rmClass QR.nodes.el, 'dump'
|
$.rmClass QR.nodes.el, 'dump'
|
||||||
for i in QR.replies
|
for i in QR.posts
|
||||||
QR.replies[0].rm()
|
QR.posts[0].rm()
|
||||||
QR.cooldown.auto = false
|
QR.cooldown.auto = false
|
||||||
QR.status()
|
QR.status()
|
||||||
if !Conf['Remember Spoiler'] and QR.nodes.spoiler.checked
|
if !Conf['Remember Spoiler'] and QR.nodes.spoiler.checked
|
||||||
@ -165,7 +165,7 @@ QR =
|
|||||||
else
|
else
|
||||||
isSage = /sage/i.test data.post.email
|
isSage = /sage/i.test data.post.email
|
||||||
hasFile = !!data.post.file
|
hasFile = !!data.post.file
|
||||||
isReply = data.isReply
|
{isReply} = data
|
||||||
type = unless isReply
|
type = unless isReply
|
||||||
'thread'
|
'thread'
|
||||||
else if isSage
|
else if isSage
|
||||||
@ -200,7 +200,7 @@ QR =
|
|||||||
else
|
else
|
||||||
QR.nodes.thread.value isnt 'new'
|
QR.nodes.thread.value isnt 'new'
|
||||||
if isReply
|
if isReply
|
||||||
post = QR.replies[0]
|
post = QR.posts[0]
|
||||||
isSage = /sage/i.test post.email
|
isSage = /sage/i.test post.email
|
||||||
hasFile = !!post.file
|
hasFile = !!post.file
|
||||||
now = Date.now()
|
now = Date.now()
|
||||||
@ -308,7 +308,7 @@ QR =
|
|||||||
return unless length
|
return unless length
|
||||||
max = QR.nodes.fileInput.max
|
max = QR.nodes.fileInput.max
|
||||||
QR.cleanNotifications()
|
QR.cleanNotifications()
|
||||||
# Set or change current reply's file.
|
# Set or change current post's file.
|
||||||
if length is 1
|
if length is 1
|
||||||
file = files[0]
|
file = files[0]
|
||||||
if file.size > max
|
if file.size > max
|
||||||
@ -318,17 +318,17 @@ QR =
|
|||||||
else
|
else
|
||||||
QR.selected.setFile file
|
QR.selected.setFile file
|
||||||
return
|
return
|
||||||
# Create new replies with these files.
|
# Create new posts with these files.
|
||||||
for file in files
|
for file in files
|
||||||
if file.size > max
|
if file.size > max
|
||||||
QR.error "#{file.name}: File too large (file: #{$.bytesToString file.size}, max: #{$.bytesToString max})."
|
QR.error "#{file.name}: File too large (file: #{$.bytesToString file.size}, max: #{$.bytesToString max})."
|
||||||
else unless file.type in QR.mimeTypes
|
else unless file.type in QR.mimeTypes
|
||||||
QR.error "#{file.name}: Unsupported file type."
|
QR.error "#{file.name}: Unsupported file type."
|
||||||
else unless QR.replies[QR.replies.length - 1].file
|
else unless QR.posts[QR.posts.length - 1].file
|
||||||
# set last reply's file
|
# set last post's file
|
||||||
QR.replies[QR.replies.length - 1].setFile file
|
QR.posts[QR.posts.length - 1].setFile file
|
||||||
else
|
else
|
||||||
new QR.reply().setFile file
|
new QR.post().setFile file
|
||||||
$.addClass QR.nodes.el, 'dump'
|
$.addClass QR.nodes.el, 'dump'
|
||||||
resetThreadSelector: ->
|
resetThreadSelector: ->
|
||||||
if g.BOARD.ID is 'f'
|
if g.BOARD.ID is 'f'
|
||||||
@ -339,11 +339,11 @@ QR =
|
|||||||
else
|
else
|
||||||
QR.nodes.thread.value = 'new'
|
QR.nodes.thread.value = 'new'
|
||||||
|
|
||||||
replies: []
|
posts: []
|
||||||
reply: class
|
post: class
|
||||||
constructor: ->
|
constructor: ->
|
||||||
# set values, or null, to avoid 'undefined' values in inputs
|
# set values, or null, to avoid 'undefined' values in inputs
|
||||||
prev = QR.replies[QR.replies.length - 1]
|
prev = QR.posts[QR.posts.length - 1]
|
||||||
persona = $.get 'QR.persona', {}
|
persona = $.get 'QR.persona', {}
|
||||||
@name = if prev then prev.name else persona.name or null
|
@name = if prev then prev.name else persona.name or null
|
||||||
@email = if prev and !/^sage$/.test prev.email then prev.email else persona.email or null
|
@email = if prev and !/^sage$/.test prev.email then prev.email else persona.email or null
|
||||||
@ -352,7 +352,7 @@ QR =
|
|||||||
@com = null
|
@com = null
|
||||||
|
|
||||||
el = $.el 'a',
|
el = $.el 'a',
|
||||||
className: 'qrpreview'
|
className: 'qr-preview'
|
||||||
draggable: true
|
draggable: true
|
||||||
href: 'javascript:;'
|
href: 'javascript:;'
|
||||||
innerHTML: '<a class=remove>×</a><label hidden><input type=checkbox> Spoiler</label><span></span>'
|
innerHTML: '<a class=remove>×</a><label hidden><input type=checkbox> Spoiler</label><span></span>'
|
||||||
@ -377,7 +377,7 @@ QR =
|
|||||||
for event in ['dragStart', 'dragEnter', 'dragLeave', 'dragOver', 'dragEnd', 'drop']
|
for event in ['dragStart', 'dragEnter', 'dragLeave', 'dragOver', 'dragEnd', 'drop']
|
||||||
$.on el, event.toLowerCase(), @[event]
|
$.on el, event.toLowerCase(), @[event]
|
||||||
|
|
||||||
QR.replies.push @
|
QR.posts.push @
|
||||||
setFile: (@file) ->
|
setFile: (@file) ->
|
||||||
@filename = "#{file.name} (#{$.bytesToString file.size})"
|
@filename = "#{file.name} (#{$.bytesToString file.size})"
|
||||||
@nodes.el.title = @filename
|
@nodes.el.title = @filename
|
||||||
@ -462,11 +462,11 @@ QR =
|
|||||||
QR.selected.forceSave()
|
QR.selected.forceSave()
|
||||||
QR.selected = @
|
QR.selected = @
|
||||||
@nodes.el.id = 'selected'
|
@nodes.el.id = 'selected'
|
||||||
# Scroll the list to center the focused reply.
|
# Scroll the list to center the focused post.
|
||||||
rectEl = @nodes.el.getBoundingClientRect()
|
rectEl = @nodes.el.getBoundingClientRect()
|
||||||
rectList = @nodes.el.parentNode.getBoundingClientRect()
|
rectList = @nodes.el.parentNode.getBoundingClientRect()
|
||||||
@nodes.el.parentNode.scrollLeft += rectEl.left + rectEl.width/2 - rectList.left - rectList.width/2
|
@nodes.el.parentNode.scrollLeft += rectEl.left + rectEl.width/2 - rectList.left - rectList.width/2
|
||||||
# Load this reply's values.
|
# Load this post's values.
|
||||||
for name in ['name', 'email', 'sub', 'com']
|
for name in ['name', 'email', 'sub', 'com']
|
||||||
QR.nodes[name].value = @[name]
|
QR.nodes[name].value = @[name]
|
||||||
@showFileData()
|
@showFileData()
|
||||||
@ -477,9 +477,9 @@ QR =
|
|||||||
return if input.nodeName isnt 'TEXTAREA'
|
return if input.nodeName isnt 'TEXTAREA'
|
||||||
@nodes.span.textContent = value
|
@nodes.span.textContent = value
|
||||||
QR.characterCount()
|
QR.characterCount()
|
||||||
# Disable auto-posting if you're typing in the first reply
|
# Disable auto-posting if you're typing in the first post
|
||||||
# during the last 5 seconds of the cooldown.
|
# during the last 5 seconds of the cooldown.
|
||||||
if QR.cooldown.auto and @ is QR.replies[0] and 0 < QR.cooldown.seconds <= 5
|
if QR.cooldown.auto and @ is QR.posts[0] and 0 < QR.cooldown.seconds <= 5
|
||||||
QR.cooldown.auto = false
|
QR.cooldown.auto = false
|
||||||
forceSave: ->
|
forceSave: ->
|
||||||
# Do this in case people use extensions
|
# Do this in case people use extensions
|
||||||
@ -506,16 +506,16 @@ QR =
|
|||||||
$.rmClass el, 'drag' # Opera doesn't fire dragEnd if we drop it on something else
|
$.rmClass el, 'drag' # Opera doesn't fire dragEnd if we drop it on something else
|
||||||
$.rmClass @, 'over'
|
$.rmClass @, 'over'
|
||||||
(if oldIndex < newIndex then $.after else $.before) @, el
|
(if oldIndex < newIndex then $.after else $.before) @, el
|
||||||
reply = QR.replies.splice(oldIndex, 1)[0]
|
post = QR.posts.splice(oldIndex, 1)[0]
|
||||||
QR.replies.splice newIndex, 0, reply
|
QR.posts.splice newIndex, 0, post
|
||||||
rm: ->
|
rm: ->
|
||||||
$.rm @nodes.el
|
$.rm @nodes.el
|
||||||
index = QR.replies.indexOf @
|
index = QR.posts.indexOf @
|
||||||
if QR.replies.length is 1
|
if QR.posts.length is 1
|
||||||
new QR.reply().select()
|
new QR.post().select()
|
||||||
else if @ is QR.selected
|
else if @ is QR.selected
|
||||||
(QR.replies[index-1] or QR.replies[index+1]).select()
|
(QR.posts[index-1] or QR.posts[index+1]).select()
|
||||||
QR.replies.splice index, 1
|
QR.posts.splice index, 1
|
||||||
return unless window.URL
|
return unless window.URL
|
||||||
URL.revokeObjectURL @url
|
URL.revokeObjectURL @url
|
||||||
|
|
||||||
@ -636,7 +636,7 @@ QR =
|
|||||||
</div>
|
</div>
|
||||||
<div id=dump-list-container>
|
<div id=dump-list-container>
|
||||||
<div id=dump-list></div>
|
<div id=dump-list></div>
|
||||||
<a id=addReply href=javascript:; title="Add a reply">+</a>
|
<a id=add-post href=javascript:; title="Add a post">+</a>
|
||||||
</div>
|
</div>
|
||||||
<div class=textarea>
|
<div class=textarea>
|
||||||
<textarea data-name=com title=Comment placeholder=Comment class=field></textarea>
|
<textarea data-name=com title=Comment placeholder=Comment class=field></textarea>
|
||||||
@ -668,7 +668,7 @@ QR =
|
|||||||
sub: $ '[data-name=sub]', dialog
|
sub: $ '[data-name=sub]', dialog
|
||||||
com: $ '[data-name=com]', dialog
|
com: $ '[data-name=com]', dialog
|
||||||
dumpList: $ '#dump-list', dialog
|
dumpList: $ '#dump-list', dialog
|
||||||
addReply: $ '#addReply', dialog
|
addPost: $ '#add-post', dialog
|
||||||
charCount: $ '#char-count', dialog
|
charCount: $ '#char-count', dialog
|
||||||
fileSubmit: $ '#file-n-submit', dialog
|
fileSubmit: $ '#file-n-submit', dialog
|
||||||
fileButton: $ '#qr-file-button', dialog
|
fileButton: $ '#qr-file-button', dialog
|
||||||
@ -715,15 +715,15 @@ QR =
|
|||||||
$.on nodes.autohide, 'change', QR.toggleHide
|
$.on nodes.autohide, 'change', QR.toggleHide
|
||||||
$.on nodes.close, 'click', QR.close
|
$.on nodes.close, 'click', QR.close
|
||||||
$.on nodes.dumpButton, 'click', -> nodes.el.classList.toggle 'dump'
|
$.on nodes.dumpButton, 'click', -> nodes.el.classList.toggle 'dump'
|
||||||
$.on nodes.addReply, 'click', -> new QR.reply().select()
|
$.on nodes.addPost, 'click', -> new QR.post().select()
|
||||||
$.on nodes.form, 'submit', QR.submit
|
$.on nodes.form, 'submit', QR.submit
|
||||||
$.on nodes.fileButton, 'click', -> QR.nodes.fileInput.click()
|
$.on nodes.fileButton, 'click', -> QR.nodes.fileInput.click()
|
||||||
$.on nodes.fileRM, 'click', -> QR.selected.rmFile()
|
$.on nodes.fileRM, 'click', -> QR.selected.rmFile()
|
||||||
$.on nodes.spoiler, 'change', -> QR.selected.nodes.spoiler.click()
|
$.on nodes.spoiler, 'change', -> QR.selected.nodes.spoiler.click()
|
||||||
$.on nodes.fileInput, 'change', QR.fileInput
|
$.on nodes.fileInput, 'change', QR.fileInput
|
||||||
|
|
||||||
new QR.reply().select()
|
new QR.post().select()
|
||||||
# save selected reply's data
|
# save selected post's data
|
||||||
for name in ['name', 'email', 'sub', 'com']
|
for name in ['name', 'email', 'sub', 'com']
|
||||||
$.on nodes[name], 'input', -> QR.selected.save @
|
$.on nodes[name], 'input', -> QR.selected.save @
|
||||||
|
|
||||||
@ -748,8 +748,8 @@ QR =
|
|||||||
QR.status()
|
QR.status()
|
||||||
return
|
return
|
||||||
|
|
||||||
reply = QR.replies[0]
|
post = QR.posts[0]
|
||||||
reply.forceSave() if reply is QR.selected
|
post.forceSave() if post is QR.selected
|
||||||
if g.BOARD.ID is 'f'
|
if g.BOARD.ID is 'f'
|
||||||
if g.VIEW is 'index'
|
if g.VIEW is 'index'
|
||||||
filetag = QR.nodes.flashTag.value
|
filetag = QR.nodes.flashTag.value
|
||||||
@ -762,15 +762,15 @@ QR =
|
|||||||
# prevent errors
|
# prevent errors
|
||||||
if threadID is 'new'
|
if threadID is 'new'
|
||||||
threadID = null
|
threadID = null
|
||||||
if g.BOARD.ID in ['vg', 'q'] and !reply.sub
|
if g.BOARD.ID in ['vg', 'q'] and !post.sub
|
||||||
err = 'New threads require a subject.'
|
err = 'New threads require a subject.'
|
||||||
else unless reply.file or textOnly = !!$ 'input[name=textonly]', $.id 'postForm'
|
else unless post.file or textOnly = !!$ 'input[name=textonly]', $.id 'postForm'
|
||||||
err = 'No file selected.'
|
err = 'No file selected.'
|
||||||
else if g.BOARD.ID is 'f' and filetag is '9999'
|
else if g.BOARD.ID is 'f' and filetag is '9999'
|
||||||
err = 'Invalid tag specified.'
|
err = 'Invalid tag specified.'
|
||||||
else if g.BOARD.threads[threadID].isSticky
|
else if g.BOARD.threads[threadID].isSticky
|
||||||
err = 'You can\'t reply to this thread anymore.'
|
err = 'You can\'t reply to this thread anymore.'
|
||||||
else unless reply.com or reply.file
|
else unless post.com or post.file
|
||||||
err = 'No file selected.'
|
err = 'No file selected.'
|
||||||
|
|
||||||
if QR.captcha.isEnabled and !err
|
if QR.captcha.isEnabled and !err
|
||||||
@ -786,22 +786,22 @@ QR =
|
|||||||
QR.cleanNotifications()
|
QR.cleanNotifications()
|
||||||
|
|
||||||
# Enable auto-posting if we have stuff to post, disable it otherwise.
|
# Enable auto-posting if we have stuff to post, disable it otherwise.
|
||||||
QR.cooldown.auto = QR.replies.length > 1
|
QR.cooldown.auto = QR.posts.length > 1
|
||||||
if Conf['Auto Hide QR'] and not QR.cooldown.auto
|
if Conf['Auto Hide QR'] and !QR.cooldown.auto
|
||||||
QR.hide()
|
QR.hide()
|
||||||
if not QR.cooldown.auto and $.x 'ancestor::div[@id="qr"]', d.activeElement
|
if !QR.cooldown.auto and $.x 'ancestor::div[@id="qr"]', d.activeElement
|
||||||
# Unfocus the focused element if it is one within the QR and we're not auto-posting.
|
# Unfocus the focused element if it is one within the QR and we're not auto-posting.
|
||||||
d.activeElement.blur()
|
d.activeElement.blur()
|
||||||
|
|
||||||
post =
|
postData =
|
||||||
resto: threadID
|
resto: threadID
|
||||||
name: reply.name
|
name: post.name
|
||||||
email: reply.email
|
email: post.email
|
||||||
sub: reply.sub
|
sub: post.sub
|
||||||
com: reply.com
|
com: post.com
|
||||||
upfile: reply.file
|
upfile: post.file
|
||||||
filetag: filetag
|
filetag: filetag
|
||||||
spoiler: reply.spoiler
|
spoiler: post.spoiler
|
||||||
textonly: textOnly
|
textonly: textOnly
|
||||||
mode: 'regist'
|
mode: 'regist'
|
||||||
pwd: if m = d.cookie.match(/4chan_pass=([^;]+)/) then decodeURIComponent m[1] else $.id('postPassword').value
|
pwd: if m = d.cookie.match(/4chan_pass=([^;]+)/) then decodeURIComponent m[1] else $.id('postPassword').value
|
||||||
@ -821,7 +821,7 @@ QR =
|
|||||||
target: '_blank',
|
target: '_blank',
|
||||||
textContent: 'Network error.'
|
textContent: 'Network error.'
|
||||||
opts =
|
opts =
|
||||||
form: $.formData post
|
form: $.formData postData
|
||||||
upCallbacks:
|
upCallbacks:
|
||||||
onload: ->
|
onload: ->
|
||||||
# Upload done, waiting for server response.
|
# Upload done, waiting for server response.
|
||||||
@ -889,13 +889,13 @@ QR =
|
|||||||
QR.cleanNotifications()
|
QR.cleanNotifications()
|
||||||
QR.notifications.push new Notification 'success', h1.textContent, 5
|
QR.notifications.push new Notification 'success', h1.textContent, 5
|
||||||
|
|
||||||
reply = QR.replies[0]
|
post = QR.posts[0]
|
||||||
|
|
||||||
persona = $.get 'QR.persona', {}
|
persona = $.get 'QR.persona', {}
|
||||||
persona =
|
persona =
|
||||||
name: reply.name
|
name: post.name
|
||||||
email: if /^sage$/.test reply.email then persona.email else reply.email
|
email: if /^sage$/.test post.email then persona.email else post.email
|
||||||
sub: if Conf['Remember Subject'] then reply.sub else null
|
sub: if Conf['Remember Subject'] then post.sub else null
|
||||||
$.set 'QR.persona', persona
|
$.set 'QR.persona', persona
|
||||||
|
|
||||||
[_, threadID, postID] = h1.nextSibling.textContent.match /thread:(\d+),no:(\d+)/
|
[_, threadID, postID] = h1.nextSibling.textContent.match /thread:(\d+),no:(\d+)/
|
||||||
@ -914,11 +914,11 @@ QR =
|
|||||||
|
|
||||||
QR.cooldown.set
|
QR.cooldown.set
|
||||||
start: req.uploadEndTime
|
start: req.uploadEndTime
|
||||||
post: reply
|
post: post
|
||||||
isReply: !!threadID
|
isReply: !!threadID
|
||||||
|
|
||||||
# Enable auto-posting if we have stuff to post, disable it otherwise.
|
# Enable auto-posting if we have stuff to post, disable it otherwise.
|
||||||
QR.cooldown.auto = QR.replies.length > 1
|
QR.cooldown.auto = QR.posts.length > 1
|
||||||
|
|
||||||
if threadID is postID # new thread
|
if threadID is postID # new thread
|
||||||
$.open "//boards.4chan.org/#{g.BOARD}/res/#{threadID}"
|
$.open "//boards.4chan.org/#{g.BOARD}/res/#{threadID}"
|
||||||
@ -926,7 +926,7 @@ QR =
|
|||||||
$.open "//boards.4chan.org/#{g.BOARD}/res/#{threadID}#p#{postID}"
|
$.open "//boards.4chan.org/#{g.BOARD}/res/#{threadID}#p#{postID}"
|
||||||
|
|
||||||
if Conf['Persistent QR'] or QR.cooldown.auto
|
if Conf['Persistent QR'] or QR.cooldown.auto
|
||||||
reply.rm()
|
post.rm()
|
||||||
else
|
else
|
||||||
QR.close()
|
QR.close()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user