Trying out JSFrame for windows

Winbox has this annoying bug where you can't move the window below the
calculated area of the document, so you can't drag it over blank space.
JSFrame fixes this and does basically what we want as well. This has
been implemented for post replies and I am going to implement it for
reports and ban creation too.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2022-06-25 20:42:10 -07:00
parent 8ab760d456
commit e596d59e82
9 changed files with 181 additions and 2 deletions

8
board/static/board/jsframe.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -16,11 +16,24 @@ function documentClick(e) {
}
function doQuote(e) {
$(window).trigger("quote", [$(e.target).text()]);
/*
return;
let idText = $("#id_text");
// Try to set ID text
if (!idText.length) {
idText = $("iframe").contents().find("#id_text");
}
// If we couldn't find an ID text, open the appropriate window
if (!idText.length) {
window.dispatchEvent(event);
}
// TODO
let caret = idText[0].selectionStart;
let text = idText.val();
let toAdd = ">>" + e.target.innerText + "\n";
idText.val(text.substring(0, caret) + toAdd + text.substring(caret));
*/
}
function closeMenu(e) {
@@ -78,6 +91,7 @@ $(document).on("click", documentClick);
$(document).on("click", ".post_id", doQuote);
$(window).on("load", () => {
window.reportWindow = null;
window.jsFrame = new JSFrame();
});
window.menuItemFactories = [];