-
-
Save ianpark/77526668b8aca41c0b7575381737f362 to your computer and use it in GitHub Desktop.
Improve steemit editor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (typeof window.reform_loop == 'undefined') { | |
window.reform_loop = setInterval( | |
function nice_viewer() { | |
var vframe, pbox, fbox, tbox; | |
try { | |
vframe = document.querySelectorAll('.vframe')[0]; | |
pbox = vframe.querySelectorAll('.Preview')[0]; | |
fbox = vframe.querySelectorAll('.ReplyEditor__body')[0]; | |
tbox = fbox.getElementsByTagName('textarea')[0]; | |
try { | |
document.querySelectorAll('.ReplyEditor')[0].className = ""; | |
} catch (err) { | |
} | |
} catch(err) { | |
return; | |
} | |
if (!pbox.style.position) { | |
vframe.style.position = "relative"; | |
tbox.style.height = "500px"; | |
tbox.style.width = "50%"; | |
pbox.style.position = "absolute"; | |
pbox.style.right = "0px"; | |
pbox.style.top = "50px"; | |
pbox.style.overflowY = "scroll"; | |
} | |
var frame_size = fbox.getBoundingClientRect(); | |
var tbox_size = tbox.getBoundingClientRect(); | |
var new_width = frame_size.width - tbox_size.width - 10; | |
var new_height = tbox_size.height - 10; | |
pbox.style.width = new_width + "px"; | |
pbox.style.maxHeight = new_height + "px"; | |
}, | |
500); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment