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 CLOSED = "closed";
const replyWindowName = "reply-window"; const replyWindowName = "reply-window";
const postWindowName = "post-window"; const postWindowName = "post-window";
const reportWindowName = "report-window"
function documentClick(e) { function documentClick(e) {
let sender = e.target; let sender = e.target;
@@ -124,6 +125,29 @@ function getPostWindow() {
return window.top.jsFrame.getWindowByName(postWindowName); 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 // 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();
}

View File

@@ -7,10 +7,6 @@
{% endwith %} {% endwith %}
{% endblock title %} {% endblock title %}
{% block extrajs %}
<script src="{% static 'board/report_window.js' %}"></script>
{% endblock extrajs %}
{% block content %} {% block content %}
{# board header #} {# board header #}
<div class="row"> <div class="row">

View File

@@ -2,10 +2,6 @@
{% load i18n static %} {% load i18n static %}
{# Title #} {# Title #}
{% block title %}{% translate "Report success" %}{% endblock %} {% block title %}{% translate "Report success" %}{% endblock %}
{# Extra JS #}
{% block extrajs %}
<script src="{% static 'board/report_window.js' %}"></script>
{% endblock extrajs %}
{# Body #} {# Body #}
{% block content %} {% block content %}
<div class="row" id="message"> <div class="row" id="message">