diff --git a/src/General/css/style.css b/src/General/css/style.css index 8ff31cf5f..58f7f5584 100755 --- a/src/General/css/style.css +++ b/src/General/css/style.css @@ -1450,7 +1450,6 @@ input#qr-filename { #qr:not(.has-spoiler) #qr-spoiler-label, #file-n-submit:not(.has-file) #qr-spoiler-label, #file-n-submit:not(.has-file) #qr-edit-button, -body:not(.board_i) #qr-edit-button, .has-file #paste-area, .has-file #url-button, #file-n-submit:not(.custom-cooldown) #custom-cooldown-button { diff --git a/src/Posting/QR.oekaki.coffee b/src/Posting/QR.oekaki.coffee index 6a1e5b9dc..c7a3f7426 100644 --- a/src/Posting/QR.oekaki.coffee +++ b/src/Posting/QR.oekaki.coffee @@ -1,4 +1,20 @@ 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: -> $.global -> {Tegaki} = window @@ -13,7 +29,7 @@ QR.oekaki = height: +document.querySelector('#qr [name=oekaki-height]').value edit: -> - $.global -> + QR.oekaki.load -> $.global -> {Tegaki} = window name = document.getElementById('qr-filename').value.replace(/\.\w+$/, '') + '.png' error = (content) ->