Support editing with oekaki painter on boards other than /i/.
This commit is contained in:
parent
cb453b068d
commit
58a51cdf3b
@ -1450,7 +1450,6 @@ input#qr-filename {
|
|||||||
#qr:not(.has-spoiler) #qr-spoiler-label,
|
#qr:not(.has-spoiler) #qr-spoiler-label,
|
||||||
#file-n-submit:not(.has-file) #qr-spoiler-label,
|
#file-n-submit:not(.has-file) #qr-spoiler-label,
|
||||||
#file-n-submit:not(.has-file) #qr-edit-button,
|
#file-n-submit:not(.has-file) #qr-edit-button,
|
||||||
body:not(.board_i) #qr-edit-button,
|
|
||||||
.has-file #paste-area,
|
.has-file #paste-area,
|
||||||
.has-file #url-button,
|
.has-file #url-button,
|
||||||
#file-n-submit:not(.custom-cooldown) #custom-cooldown-button {
|
#file-n-submit:not(.custom-cooldown) #custom-cooldown-button {
|
||||||
|
|||||||
@ -1,4 +1,20 @@
|
|||||||
QR.oekaki =
|
QR.oekaki =
|
||||||
|
load: (cb) ->
|
||||||
|
if $ 'script[src^="//s.4cdn.org/js/painter"]', d.head
|
||||||
|
cb()
|
||||||
|
else
|
||||||
|
style = $.el 'link',
|
||||||
|
rel: 'stylesheet'
|
||||||
|
href: "//s.4cdn.org/css/painter.#{Date.now()}.css"
|
||||||
|
script = $.el 'script',
|
||||||
|
src: "//s.4cdn.org/js/painter.min.#{Date.now()}.js"
|
||||||
|
n = 0
|
||||||
|
onload = ->
|
||||||
|
cb() if ++n is 2
|
||||||
|
$.on style, 'load', onload
|
||||||
|
$.on script, 'load', onload
|
||||||
|
$.add d.head, [style, script]
|
||||||
|
|
||||||
draw: ->
|
draw: ->
|
||||||
$.global ->
|
$.global ->
|
||||||
{Tegaki} = window
|
{Tegaki} = window
|
||||||
@ -13,7 +29,7 @@ QR.oekaki =
|
|||||||
height: +document.querySelector('#qr [name=oekaki-height]').value
|
height: +document.querySelector('#qr [name=oekaki-height]').value
|
||||||
|
|
||||||
edit: ->
|
edit: ->
|
||||||
$.global ->
|
QR.oekaki.load -> $.global ->
|
||||||
{Tegaki} = window
|
{Tegaki} = window
|
||||||
name = document.getElementById('qr-filename').value.replace(/\.\w+$/, '') + '.png'
|
name = document.getElementById('qr-filename').value.replace(/\.\w+$/, '') + '.png'
|
||||||
error = (content) ->
|
error = (content) ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user