Merge report_window.js into post.js
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
@@ -7,10 +7,6 @@
|
||||
{% endwith %}
|
||||
{% endblock title %}
|
||||
|
||||
{% block extrajs %}
|
||||
<script src="{% static 'board/report_window.js' %}"></script>
|
||||
{% endblock extrajs %}
|
||||
|
||||
{% block content %}
|
||||
{# board header #}
|
||||
<div class="row">
|
||||
|
||||
@@ -2,10 +2,6 @@
|
||||
{% load i18n static %}
|
||||
{# Title #}
|
||||
{% block title %}{% translate "Report success" %}{% endblock %}
|
||||
{# Extra JS #}
|
||||
{% block extrajs %}
|
||||
<script src="{% static 'board/report_window.js' %}"></script>
|
||||
{% endblock extrajs %}
|
||||
{# Body #}
|
||||
{% block content %}
|
||||
<div class="row" id="message">
|
||||
|
||||
Reference in New Issue
Block a user