Merge report_window.js into post.js

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2022-06-30 18:44:58 -07:00
parent 638d8cd349
commit 61b9e2a277
4 changed files with 24 additions and 28 deletions

View File

@@ -2,6 +2,7 @@ const OPEN = "open";
const CLOSED = "closed";
const replyWindowName = "reply-window";
const postWindowName = "post-window";
const reportWindowName = "report-window"
function documentClick(e) {
let sender = e.target;
@@ -124,6 +125,29 @@ function getPostWindow() {
return window.top.jsFrame.getWindowByName(postWindowName);
}
////////////////////////////////////////////////////////////////////////////////
// Report window
////////////////////////////////////////////////////////////////////////////////
function getReportWindow() {
return window.top.jsFrame.getWindowByName(reportWindowName);
}
function openReportWindow(reportUrl) {
// If there's already a report window open, close it and open this one.
if (window.top.jsFrame.containsWindowName(reportWindowName)) {
getReportWindow().closeFrame();
}
let reportWindow = window.top.jsFrame.create({
url: reportUrl,
name: reportWindowName,
modal: true,
width: 360,
height: 95,
});
reportWindow.show();
}
////////////////////////////////////////////////////////////////////////////////
// Events
////////////////////////////////////////////////////////////////////////////////

View File

@@ -1,20 +0,0 @@
const reportWindowName = "report-window"
function getReportWindow() {
return window.top.jsFrame.getWindowByName(reportWindowName);
}
function openReportWindow(reportUrl) {
// If there's already a report window open, close it and open this one.
if (window.top.jsFrame.containsWindowName(reportWindowName)) {
getReportWindow().closeFrame();
}
let reportWindow = window.top.jsFrame.create({
url: reportUrl,
name: reportWindowName,
modal: true,
width: 360,
height: 95,
});
reportWindow.show();
}