forked from rDrama/rDrama
sdf
parent
193aec5df6
commit
efc793292a
|
@ -1,7 +1,7 @@
|
||||||
for theme in ['transparent', 'win98', 'midnight', 'dark', 'light', 'coffee', 'tron', '4chan']:
|
for theme in ['transparent', 'win98', 'midnight', 'dark', 'light', 'coffee', 'tron', '4chan']:
|
||||||
with open(f"./files/assets/style/{theme}_ff66ac.css", encoding='utf-8') as t:
|
with open(f"./files/assets/css/{theme}_ff66ac.css", encoding='utf-8') as t:
|
||||||
text = t.read()
|
text = t.read()
|
||||||
for color in ['ff66ac','805ad5','62ca56','38a169','80ffff','2a96f3','62ca56','eb4963','ff0000','f39731','30409f','3e98a7','e4432d','7b9ae4','ec72de','7f8fa6', 'f8db58']:
|
for color in ['ff66ac','805ad5','62ca56','38a169','80ffff','2a96f3','62ca56','eb4963','ff0000','f39731','30409f','3e98a7','e4432d','7b9ae4','ec72de','7f8fa6', 'f8db58']:
|
||||||
newtext = text.replace("ff66ac", color).replace("ff4097", color).replace("ff1a83", color).replace("ff3390", color).replace("rgba(255, 102, 172, 0.25)", color)
|
newtext = text.replace("ff66ac", color).replace("ff4097", color).replace("ff1a83", color).replace("ff3390", color).replace("rgba(255, 102, 172, 0.25)", color)
|
||||||
with open(f"./files/assets/style/{theme}_{color}.css", encoding='utf-8', mode='w') as nt:
|
with open(f"./files/assets/css/{theme}_{color}.css", encoding='utf-8', mode='w') as nt:
|
||||||
nt.write(newtext)
|
nt.write(newtext)
|
|
@ -1,68 +0,0 @@
|
||||||
<!-- 2FA Modal -->
|
|
||||||
|
|
||||||
<div class="modal fade" id="2faModal" tabindex="-1" role="dialog" aria-labelledby="2faModalTitle" aria-hidden="true">
|
|
||||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header">
|
|
||||||
<h5 class="modal-title">{% if mfa_secret %}Setup two-step login{% elif mfa_secret and not v.email %}Email required for two-step login{% else %}Disable two-step login{% endif %}</h5>
|
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
||||||
<span aria-hidden="true"><i class="far fa-times"></i></span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
{% if mfa_secret %}
|
|
||||||
<div>
|
|
||||||
<form action="/settings/security" method="post">
|
|
||||||
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
|
||||||
<input type="hidden" name="2fa_secret" value="{{mfa_secret}}">
|
|
||||||
<div class="modal-body">
|
|
||||||
<p>
|
|
||||||
<span class="font-weight-bold">Step 1:</span> Scan this barcode (or enter the code) using a two-factor authentication app such as Google Authenticator or Authy.
|
|
||||||
</p>
|
|
||||||
<div class="text-center mb-3">
|
|
||||||
<img loading="lazy" class="img-fluid" style="width: 175px;" src="/2faqr/{{mfa_secret}}">
|
|
||||||
<pre></pre>
|
|
||||||
<div class="text-small text-muted">Or enter this code: {{mfa_secret}}</div>
|
|
||||||
</div>
|
|
||||||
<p>
|
|
||||||
<span class="font-weight-bold">Step 2:</span> Enter the six-digit code generated in the authenticator app and your {{'SITE_NAME' | app_config}} account password.
|
|
||||||
</p>
|
|
||||||
<label for="2fa_input">6-digit code</label>
|
|
||||||
<input type="text" class="form-control mb-2" id="2fa_input" name="2fa_token" placeholder="# # # # # #" required>
|
|
||||||
|
|
||||||
<label for="2fa_input_password">Password</label>
|
|
||||||
<input type="password" autocomplete="new-password" class="form-control mb-2" id="2fa_input_password" name="password" oninput="document.getElementById('enable2faButton').disabled=false" autocomplete="off" required>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="button" class="btn btn-link text-muted" data-dismiss="modal">Cancel</button>
|
|
||||||
<input id="enable2faButton" class="btn btn-primary" type="submit" value="Enable 2-step login" disabled>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
{% else %}
|
|
||||||
<div>
|
|
||||||
<form action="/settings/security" method="post">
|
|
||||||
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
|
||||||
<input type="hidden" name="2fa_secret" value="{{mfa_secret}}">
|
|
||||||
<div class="modal-body">
|
|
||||||
|
|
||||||
<div class="alert alert-warning" role="alert">
|
|
||||||
<i class="fas fa-info-circle"></i>
|
|
||||||
To disable two-step login, please enter your {{'SITE_NAME' | app_config}} account password and the 6-digit code generated in your authentication app. If you no longer have your two-step device, <a href="/lost_2fa">click here</a>.
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<label for="2fa_input_password">Password</label>
|
|
||||||
<input type="password" autocomplete="new-password" class="form-control mb-2" id="2fa_input_password" name="password" autocomplete="off" required>
|
|
||||||
|
|
||||||
<label for="2fa_input">6-digit code</label>
|
|
||||||
<input type="text" class="form-control mb-2" id="2fa_input" name="2fa_remove" placeholder="# # # # # #" oninput="document.getElementById('disable2faButton').disabled=false" required>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="button" class="btn btn-link text-muted" data-dismiss="modal">Cancel</button>
|
|
||||||
<input id="disable2faButton" class="btn btn-primary" type="submit" value="Disable 2-step login" disabled>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
|
@ -12,19 +12,16 @@
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600&display=swap" rel="stylesheet">
|
||||||
|
|
||||||
<!-- Bootstrap core CSS -->
|
|
||||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
|
|
||||||
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
|
|
||||||
|
|
||||||
<!-- Font Awesome -->
|
<!-- Font Awesome -->
|
||||||
<link href="/assets/fontawesome/css/all.css" rel="stylesheet"> <!--load all styles -->
|
<link href="/assets/fontawesome/css/all.css" rel="stylesheet"> <!--load all styles -->
|
||||||
|
|
||||||
<!-- {{'SITE_NAME' | app_config}} CSS -->
|
<!-- {{'SITE_NAME' | app_config}} CSS -->
|
||||||
{% if v %}
|
{% if v %}
|
||||||
<link rel="stylesheet" href="/assets/style/{{v.theme}}_{{v.themecolor}}.css">
|
<link rel="stylesheet" href="/assets/css/{{v.theme}}_{{v.themecolor}}.css">
|
||||||
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/style/agendaposter.css">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<link rel="stylesheet" href="/assets/style/{{'DEFAULT_THEME' | app_config}}.css">
|
<link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
|
@ -1,10 +1,181 @@
|
||||||
<script>
|
<script>
|
||||||
function bruh(kind) {
|
// Voting
|
||||||
document.getElementById('giveaward').disabled=false;
|
|
||||||
document.getElementById('kind').value=kind;
|
function post_vote(url, callback) {
|
||||||
try {document.getElementsByClassName('picked')[0].classList.toggle('picked');} catch(e) {}
|
var xhr = new XMLHttpRequest();
|
||||||
document.getElementById(kind).classList.toggle('picked')
|
xhr.open("POST", url, true);
|
||||||
}
|
var form = new FormData()
|
||||||
|
form.append("formkey", formkey());
|
||||||
|
xhr.withCredentials=true;
|
||||||
|
|
||||||
|
xhr.onload = function() {
|
||||||
|
if (xhr.status==204) {}
|
||||||
|
else if (xhr.status >= 200 && xhr.status < 300) {
|
||||||
|
$('#toast-post-success').toast('dispose');
|
||||||
|
$('#toast-post-success').toast('show');
|
||||||
|
document.getElementById('toast-post-success-text').innerText = JSON.parse(xhr.response)["message"];
|
||||||
|
callback(xhr)
|
||||||
|
return true
|
||||||
|
|
||||||
|
} else if (xhr.status >= 300 && xhr.status < 400) {
|
||||||
|
window.location.href = JSON.parse(xhr.response)["redirect"]
|
||||||
|
} else {
|
||||||
|
data=JSON.parse(xhr.response);
|
||||||
|
|
||||||
|
$('#toast-post-error').toast('dispose');
|
||||||
|
$('#toast-post-error').toast('show');
|
||||||
|
document.getElementById('toast-post-error-text').innerText = data["error"];
|
||||||
|
return false
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
xhr.send(form);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var upvote = function(event) {
|
||||||
|
|
||||||
|
var type = event.target.dataset.contentType;
|
||||||
|
var id = event.target.dataset.idUp;
|
||||||
|
|
||||||
|
var downvoteButton = document.getElementsByClassName(type + '-' + id + '-down');
|
||||||
|
var upvoteButton = document.getElementsByClassName(type + '-' + id + '-up');
|
||||||
|
var scoreText = document.getElementsByClassName(type + '-score-' + id);
|
||||||
|
|
||||||
|
for (var j = 0; j < upvoteButton.length && j < downvoteButton.length && j < scoreText.length; j++) {
|
||||||
|
|
||||||
|
var thisUpvoteButton = upvoteButton[j];
|
||||||
|
var thisDownvoteButton = downvoteButton[j];
|
||||||
|
var thisScoreText = scoreText[j];
|
||||||
|
var thisScore = Number(thisScoreText.textContent);
|
||||||
|
|
||||||
|
if (thisUpvoteButton.classList.contains('active')) {
|
||||||
|
thisUpvoteButton.classList.remove('active')
|
||||||
|
thisScoreText.textContent = thisScore - 1
|
||||||
|
voteDirection = "0"
|
||||||
|
} else if (thisDownvoteButton.classList.contains('active')) {
|
||||||
|
thisUpvoteButton.classList.add('active')
|
||||||
|
thisDownvoteButton.classList.remove('active')
|
||||||
|
thisScoreText.textContent = thisScore + 2
|
||||||
|
voteDirection = "1"
|
||||||
|
} else {
|
||||||
|
thisUpvoteButton.classList.add('active')
|
||||||
|
thisScoreText.textContent = thisScore + 1
|
||||||
|
voteDirection = "1"
|
||||||
|
}
|
||||||
|
|
||||||
|
if (thisUpvoteButton.classList.contains('active')) {
|
||||||
|
thisScoreText.classList.add('score-up')
|
||||||
|
thisScoreText.classList.remove('score-down')
|
||||||
|
thisScoreText.classList.remove('score')
|
||||||
|
} else if (thisDownvoteButton.classList.contains('active')) {
|
||||||
|
thisScoreText.classList.add('score-down')
|
||||||
|
thisScoreText.classList.remove('score-up')
|
||||||
|
thisScoreText.classList.remove('score')
|
||||||
|
} else {
|
||||||
|
thisScoreText.classList.add('score')
|
||||||
|
thisScoreText.classList.remove('score-up')
|
||||||
|
thisScoreText.classList.remove('score-down')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
post_vote("/vote/" + type + "/" + id + "/" + voteDirection);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
var downvote = function(event) {
|
||||||
|
|
||||||
|
var type = event.target.dataset.contentType;
|
||||||
|
var id = event.target.dataset.idDown;
|
||||||
|
|
||||||
|
var downvoteButton = document.getElementsByClassName(type + '-' + id + '-down');
|
||||||
|
var upvoteButton = document.getElementsByClassName(type + '-' + id + '-up');
|
||||||
|
var scoreText = document.getElementsByClassName(type + '-score-' + id);
|
||||||
|
|
||||||
|
for (var j = 0; j < upvoteButton.length && j < downvoteButton.length && j < scoreText.length; j++) {
|
||||||
|
|
||||||
|
var thisUpvoteButton = upvoteButton[j];
|
||||||
|
var thisDownvoteButton = downvoteButton[j];
|
||||||
|
var thisScoreText = scoreText[j];
|
||||||
|
var thisScore = Number(thisScoreText.textContent);
|
||||||
|
|
||||||
|
if (thisDownvoteButton.classList.contains('active')) {
|
||||||
|
thisDownvoteButton.classList.remove('active')
|
||||||
|
thisScoreText.textContent = thisScore + 1
|
||||||
|
voteDirection = "0"
|
||||||
|
} else if (thisUpvoteButton.classList.contains('active')) {
|
||||||
|
thisDownvoteButton.classList.add('active')
|
||||||
|
thisUpvoteButton.classList.remove('active')
|
||||||
|
thisScoreText.textContent = thisScore - 2
|
||||||
|
voteDirection = "-1"
|
||||||
|
} else {
|
||||||
|
thisDownvoteButton.classList.add('active')
|
||||||
|
thisScoreText.textContent = thisScore - 1
|
||||||
|
voteDirection = "-1"
|
||||||
|
}
|
||||||
|
|
||||||
|
if (thisUpvoteButton.classList.contains('active')) {
|
||||||
|
thisScoreText.classList.add('score-up')
|
||||||
|
thisScoreText.classList.remove('score-down')
|
||||||
|
thisScoreText.classList.remove('score')
|
||||||
|
} else if (thisDownvoteButton.classList.contains('active')) {
|
||||||
|
thisScoreText.classList.add('score-down')
|
||||||
|
thisScoreText.classList.remove('score-up')
|
||||||
|
thisScoreText.classList.remove('score')
|
||||||
|
} else {
|
||||||
|
thisScoreText.classList.add('score')
|
||||||
|
thisScoreText.classList.remove('score-up')
|
||||||
|
thisScoreText.classList.remove('score-down')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
post_vote("/vote/" + type + "/" + id + "/" + voteDirection);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var register_votes = function() {
|
||||||
|
var upvoteButtons = document.getElementsByClassName('upvote-button')
|
||||||
|
|
||||||
|
var downvoteButtons = document.getElementsByClassName('downvote-button')
|
||||||
|
|
||||||
|
var voteDirection = 0
|
||||||
|
|
||||||
|
for (var i = 0; i < upvoteButtons.length; i++) {
|
||||||
|
upvoteButtons[i].addEventListener('click', upvote, false);
|
||||||
|
upvoteButtons[i].addEventListener('keydown', function(event) {
|
||||||
|
if (event.keyCode === 13) {
|
||||||
|
upvote(event)
|
||||||
|
}
|
||||||
|
}, false)
|
||||||
|
};
|
||||||
|
|
||||||
|
for (var i = 0; i < downvoteButtons.length; i++) {
|
||||||
|
downvoteButtons[i].addEventListener('click', downvote, false);
|
||||||
|
downvoteButtons[i].addEventListener('keydown', function(event) {
|
||||||
|
if (event.keyCode === 13) {
|
||||||
|
downvote(event)
|
||||||
|
}
|
||||||
|
}, false)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
register_votes()
|
||||||
|
|
||||||
|
// award modal
|
||||||
|
|
||||||
|
function awardModal(link) {
|
||||||
|
var target = document.getElementById("awardTarget");
|
||||||
|
target.action = link;
|
||||||
|
}
|
||||||
|
|
||||||
|
function bruh(kind) {
|
||||||
|
document.getElementById('giveaward').disabled=false;
|
||||||
|
document.getElementById('kind').value=kind;
|
||||||
|
try {document.getElementsByClassName('picked')[0].classList.toggle('picked');} catch(e) {}
|
||||||
|
document.getElementById(kind).classList.toggle('picked')
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="modal fade" id="awardModal" tabindex="-1" role="dialog" aria-labelledby="awardModalTitle" aria-hidden="true">
|
<div class="modal fade" id="awardModal" tabindex="-1" role="dialog" aria-labelledby="awardModalTitle" aria-hidden="true">
|
||||||
|
|
|
@ -1,4 +1,29 @@
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const banModal = function(link, id, name) {
|
||||||
|
document.getElementById("banModalTitle").innerHTML = `Ban @${name}`;
|
||||||
|
document.getElementById("ban-modal-link").value = link;
|
||||||
|
document.getElementById("banUserButton").innerHTML = `Ban @${name}`;
|
||||||
|
|
||||||
|
document.getElementById("banUserButton").onclick = function() {
|
||||||
|
let fd = new FormData(document.getElementById("banModalForm"));
|
||||||
|
fd.append("formkey", formkey());
|
||||||
|
|
||||||
|
let xhr = new XMLHttpRequest();
|
||||||
|
xhr.open("POST", `/ban_user/${id}?form`, true);
|
||||||
|
xhr.withCredentials = true;
|
||||||
|
|
||||||
|
xhr.onload = function(){
|
||||||
|
$('#toast-post-success').toast('dispose');
|
||||||
|
$('#toast-post-success').toast('show');
|
||||||
|
document.getElementById('toast-post-success-text').innerHTML = `@${name} banned`;
|
||||||
|
}
|
||||||
|
|
||||||
|
xhr.send(fd);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
<div class="modal fade" id="banModal" tabindex="-1" role="dialog" aria-labelledby="banModalTitle" aria-hidden="true">
|
<div class="modal fade" id="banModal" tabindex="-1" role="dialog" aria-labelledby="banModalTitle" aria-hidden="true">
|
||||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
|
|
|
@ -1,7 +1,469 @@
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js"></script>
|
||||||
|
|
||||||
|
{% if v %}
|
||||||
|
<script>
|
||||||
|
function post_toast3(url, button1, button2) {
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
xhr.open("POST", url, true);
|
||||||
|
var form = new FormData()
|
||||||
|
|
||||||
|
if(typeof data === 'object' && data !== null) {
|
||||||
|
for(let k of Object.keys(data)) {
|
||||||
|
form.append(k, data[k]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
form.append("formkey", formkey());
|
||||||
|
xhr.withCredentials=true;
|
||||||
|
|
||||||
|
xhr.onload = function() {
|
||||||
|
if (xhr.status >= 200 && xhr.status < 300) {
|
||||||
|
$('#toast-post-success').toast('dispose');
|
||||||
|
$('#toast-post-success').toast('show');
|
||||||
|
try {
|
||||||
|
document.getElementById('toast-post-success-text').innerText = JSON.parse(xhr.response)["message"];
|
||||||
|
} catch(e) {
|
||||||
|
document.getElementById('toast-post-success-text').innerText = "Action successful!";
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
|
||||||
|
} else if (xhr.status >= 300 && xhr.status < 400) {
|
||||||
|
window.location.href = JSON.parse(xhr.response)["redirect"]
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
data=JSON.parse(xhr.response);
|
||||||
|
|
||||||
|
$('#toast-post-error').toast('dispose');
|
||||||
|
$('#toast-post-error').toast('show');
|
||||||
|
document.getElementById('toast-post-error-text').innerText = data["error"];
|
||||||
|
return false
|
||||||
|
} catch(e) {
|
||||||
|
$('#toast-post-success').toast('dispose');
|
||||||
|
$('#toast-post-error').toast('dispose');
|
||||||
|
$('#toast-post-error').toast('show');
|
||||||
|
document.getElementById('toast-post-error-text').innerText = "Error. Try again later.";
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
xhr.send(form);
|
||||||
|
|
||||||
|
document.getElementById(button1).classList.toggle("d-md-inline-block");
|
||||||
|
document.getElementById(button2).classList.toggle("d-md-inline-block");
|
||||||
|
}
|
||||||
|
|
||||||
|
//reporting
|
||||||
|
// Report Comment
|
||||||
|
|
||||||
|
report_commentModal = function(id, author) {
|
||||||
|
|
||||||
|
document.getElementById("comment-author").textContent = author;
|
||||||
|
|
||||||
|
//offtopic.disabled=true;
|
||||||
|
|
||||||
|
document.getElementById("reportCommentButton").onclick = function() {
|
||||||
|
|
||||||
|
this.innerHTML='<span class="spinner-border spinner-border-sm mr-2" role="status" aria-hidden="true"></span>Reporting comment';
|
||||||
|
this.disabled = true;
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
xhr.open("POST", '/flag/comment/'+id, true);
|
||||||
|
var form = new FormData()
|
||||||
|
form.append("formkey", formkey());
|
||||||
|
form.append("reason", document.getElementById("reason-comment").value);
|
||||||
|
|
||||||
|
xhr.withCredentials=true;
|
||||||
|
|
||||||
|
xhr.onload=function() {
|
||||||
|
document.getElementById("reportCommentFormBefore").classList.add('d-none');
|
||||||
|
document.getElementById("reportCommentFormAfter").classList.remove('d-none');
|
||||||
|
};
|
||||||
|
|
||||||
|
xhr.onerror=function(){alert(errortext)};
|
||||||
|
xhr.send(form);
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
$('#reportCommentModal').on('hidden.bs.modal', function () {
|
||||||
|
|
||||||
|
var button = document.getElementById("reportCommentButton");
|
||||||
|
|
||||||
|
var beforeModal = document.getElementById("reportCommentFormBefore");
|
||||||
|
var afterModal = document.getElementById("reportCommentFormAfter");
|
||||||
|
|
||||||
|
button.innerHTML='Report comment';
|
||||||
|
button.disabled= false;
|
||||||
|
afterModal.classList.add('d-none');
|
||||||
|
|
||||||
|
if ( beforeModal.classList.contains('d-none') ) {
|
||||||
|
beforeModal.classList.remove('d-none');
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
//Commenting form
|
||||||
|
|
||||||
|
// Expand comment box on focus, hide otherwise
|
||||||
|
|
||||||
|
$('.comment-box').focus(function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
$(this).parent().parent().addClass("collapsed");
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// Open comment reply box
|
||||||
|
|
||||||
|
function openReplyBox(id) {
|
||||||
|
const element = document.getElementById(`reply-to-${id}`);
|
||||||
|
element.classList.remove('d-none')
|
||||||
|
|
||||||
|
element.getElementsByTagName('textarea')[0].focus()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Comment edit form
|
||||||
|
|
||||||
|
toggleEdit=function(id){
|
||||||
|
comment=document.getElementById("comment-text-"+id);
|
||||||
|
form=document.getElementById("comment-edit-"+id);
|
||||||
|
box=document.getElementById('edit-box-comment-'+id);
|
||||||
|
actions = document.getElementById('comment-' + id +'-actions');
|
||||||
|
|
||||||
|
comment.classList.toggle("d-none");
|
||||||
|
form.classList.toggle("d-none");
|
||||||
|
actions.classList.toggle("d-none");
|
||||||
|
autoExpand(box);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Delete Comment
|
||||||
|
|
||||||
|
function delete_commentModal(id,button1,button2) {
|
||||||
|
|
||||||
|
// Passed data for modal
|
||||||
|
|
||||||
|
document.getElementById("deleteCommentButton").onclick = function() {
|
||||||
|
|
||||||
|
this.innerHTML='<span class="spinner-border spinner-border-sm mr-2" role="status" aria-hidden="true"></span>Deleting comment';
|
||||||
|
this.disabled = true;
|
||||||
|
post('/delete/comment/' + id,
|
||||||
|
callback = function() {
|
||||||
|
|
||||||
|
location.reload();
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
document.getElementById(button1).classList.toggle("d-md-inline-block");
|
||||||
|
document.getElementById(button2).classList.toggle("d-md-inline-block");
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
function delete_commentModal2(id,button1,button2) {
|
||||||
|
|
||||||
|
// Passed data for modal
|
||||||
|
|
||||||
|
document.getElementById("deleteCommentButton").onclick = function() {
|
||||||
|
|
||||||
|
this.innerHTML='<span class="spinner-border spinner-border-sm mr-2" role="status" aria-hidden="true"></span>Deleting comment';
|
||||||
|
this.disabled = true;
|
||||||
|
post('/delete/comment/' + id,
|
||||||
|
callback = function() {
|
||||||
|
|
||||||
|
location.reload();
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
document.getElementById(button1).classList.toggle("d-none");
|
||||||
|
document.getElementById(button2).classList.toggle("d-none");
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
post_comment=function(fullname){
|
||||||
|
|
||||||
|
|
||||||
|
var form = new FormData();
|
||||||
|
|
||||||
|
form.append('formkey', formkey());
|
||||||
|
form.append('parent_fullname', fullname);
|
||||||
|
form.append('submission', document.getElementById('reply-form-submission-'+fullname).value);
|
||||||
|
form.append('body', document.getElementById('reply-form-body-'+fullname).value);
|
||||||
|
form.append('file', document.getElementById('file-upload-reply-'+fullname).files[0]);
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
xhr.open("post", "/comment");
|
||||||
|
xhr.withCredentials=true;
|
||||||
|
xhr.onload=function(){
|
||||||
|
if (xhr.status==200) {
|
||||||
|
commentForm=document.getElementById('comment-form-space-'+fullname);
|
||||||
|
commentForm.innerHTML=JSON.parse(xhr.response)["html"];
|
||||||
|
$('#toast-comment-success').toast('dispose');
|
||||||
|
$('#toast-comment-error').toast('dispose');
|
||||||
|
$('#toast-comment-success').toast('show');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var commentError = document.getElementById("comment-error-text");
|
||||||
|
$('#toast-comment-success').toast('dispose');
|
||||||
|
$('#toast-comment-error').toast('dispose');
|
||||||
|
$('#toast-comment-error').toast('show');
|
||||||
|
commentError.textContent = JSON.parse(xhr.response)["error"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xhr.send(form)
|
||||||
|
|
||||||
|
document.getElementById('save-reply-to-'+fullname).classList.add('disabled');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
post_reply=function(id){
|
||||||
|
|
||||||
|
var form = new FormData();
|
||||||
|
|
||||||
|
form.append('formkey', formkey());
|
||||||
|
form.append('parent_id', id);
|
||||||
|
form.append('body', document.getElementById('reply-form-body-'+id).value);
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
xhr.open("post", "/reply");
|
||||||
|
xhr.withCredentials=true;
|
||||||
|
xhr.onload=function(){
|
||||||
|
if (xhr.status==200) {
|
||||||
|
commentForm=document.getElementById('comment-form-space-'+id);
|
||||||
|
commentForm.innerHTML=JSON.parse(xhr.response)["html"];
|
||||||
|
$('#toast-comment-success').toast('dispose');
|
||||||
|
$('#toast-comment-error').toast('dispose');
|
||||||
|
$('#toast-comment-success').toast('show');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var commentError = document.getElementById("comment-error-text");
|
||||||
|
$('#toast-comment-success').toast('dispose');
|
||||||
|
$('#toast-comment-error').toast('dispose');
|
||||||
|
$('#toast-comment-error').toast('show');
|
||||||
|
commentError.textContent = JSON.parse(xhr.response)["error"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xhr.send(form)
|
||||||
|
|
||||||
|
document.getElementById('save-reply-to-'+id).classList.add('disabled');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
comment_edit=function(id){
|
||||||
|
|
||||||
|
var commentError = document.getElementById("comment-error-text");
|
||||||
|
|
||||||
|
var form = new FormData();
|
||||||
|
|
||||||
|
form.append('formkey', formkey());
|
||||||
|
form.append('body', document.getElementById('comment-edit-body-'+id).value);
|
||||||
|
form.append('file', document.getElementById('file-edit-reply-'+id).files[0]);
|
||||||
|
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
xhr.open("post", "/edit_comment/"+id);
|
||||||
|
xhr.withCredentials=true;
|
||||||
|
xhr.onload=function(){
|
||||||
|
if (xhr.status==200) {
|
||||||
|
commentForm=document.getElementById('comment-text-'+id);
|
||||||
|
commentForm.innerHTML=JSON.parse(xhr.response)["html"];
|
||||||
|
document.getElementById('cancel-edit-'+id).click()
|
||||||
|
$('#toast-comment-success').toast('dispose');
|
||||||
|
$('#toast-comment-error').toast('dispose');
|
||||||
|
$('#toast-comment-success').toast('show');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$('#toast-comment-success').toast('dispose');
|
||||||
|
$('#toast-comment-error').toast('dispose');
|
||||||
|
$('#toast-comment-error').toast('show');
|
||||||
|
commentError.textContent = JSON.parse(xhr.response)["error"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xhr.send(form)
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
{% if v and v.admin_level == 6 %}
|
||||||
|
<script>
|
||||||
|
//comment modding
|
||||||
|
function removeComment(post_id,button1,button2) {
|
||||||
|
url="/ban_comment/"+post_id
|
||||||
|
|
||||||
|
callback=function(){
|
||||||
|
document.getElementById("comment-"+post_id+"-only").classList.add("banned");
|
||||||
|
|
||||||
|
button=document.getElementById("moderate-"+post_id);
|
||||||
|
button.onclick=function(){approveComment(post_id)};
|
||||||
|
button.innerHTML='<i class="fas fa-clipboard-check"></i>Approve'
|
||||||
|
}
|
||||||
|
post(url, callback, "Comment has been removed.")
|
||||||
|
|
||||||
|
|
||||||
|
if (typeof button1 !== 'undefined') {
|
||||||
|
document.getElementById(button1).classList.toggle("d-md-inline-block");
|
||||||
|
document.getElementById(button2).classList.toggle("d-md-inline-block");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
function approveComment(post_id,button1,button2) {
|
||||||
|
url="/unban_comment/"+post_id
|
||||||
|
|
||||||
|
callback=function(){
|
||||||
|
document.getElementById("comment-"+post_id+"-only").classList.remove("banned");
|
||||||
|
|
||||||
|
button=document.getElementById("moderate-"+post_id);
|
||||||
|
button.onclick=function(){removeComment(post_id)};
|
||||||
|
button.innerHTML='<i class="fas fa-trash-alt"></i>Remove'
|
||||||
|
}
|
||||||
|
|
||||||
|
post(url, callback, "Comment has been approved.")
|
||||||
|
|
||||||
|
if (typeof button1 !== 'undefined') {
|
||||||
|
document.getElementById(button1).classList.toggle("d-md-inline-block");
|
||||||
|
document.getElementById(button2).classList.toggle("d-md-inline-block");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function removeComment2(post_id,button1,button2) {
|
||||||
|
url="/ban_comment/"+post_id
|
||||||
|
|
||||||
|
callback=function(){
|
||||||
|
document.getElementById("comment-"+post_id+"-only").classList.add("banned");
|
||||||
|
|
||||||
|
button=document.getElementById("moderate-"+post_id);
|
||||||
|
button.onclick=function(){approveComment(post_id)};
|
||||||
|
button.innerHTML='<i class="fas fa-clipboard-check"></i>Approve'
|
||||||
|
}
|
||||||
|
post(url, callback, "Comment has been removed.")
|
||||||
|
|
||||||
|
|
||||||
|
if (typeof button1 !== 'undefined') {
|
||||||
|
document.getElementById(button1).classList.toggle("d-none");
|
||||||
|
document.getElementById(button2).classList.toggle("d-none");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
function approveComment2(post_id,button1,button2) {
|
||||||
|
url="/unban_comment/"+post_id
|
||||||
|
|
||||||
|
callback=function(){
|
||||||
|
document.getElementById("comment-"+post_id+"-only").classList.remove("banned");
|
||||||
|
|
||||||
|
button=document.getElementById("moderate-"+post_id);
|
||||||
|
button.onclick=function(){removeComment(post_id)};
|
||||||
|
button.innerHTML='<i class="fas fa-trash-alt"></i>Remove'
|
||||||
|
}
|
||||||
|
|
||||||
|
post(url, callback, "Comment has been approved.")
|
||||||
|
|
||||||
|
if (typeof button1 !== 'undefined') {
|
||||||
|
document.getElementById(button1).classList.toggle("d-none");
|
||||||
|
document.getElementById(button2).classList.toggle("d-none");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
admin_comment=function(cid,button1,button2,distinguish){
|
||||||
|
|
||||||
|
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
xhr.open("post", "/distinguish_comment/"+cid);
|
||||||
|
|
||||||
|
var form = new FormData();
|
||||||
|
|
||||||
|
form.append('formkey', formkey());
|
||||||
|
|
||||||
|
xhr.withCredentials=true;
|
||||||
|
xhr.onload=function(){
|
||||||
|
if (xhr.status==200) {
|
||||||
|
comment=document.getElementById('comment-'+cid+'-only');
|
||||||
|
comment.innerHTML=JSON.parse(xhr.response)["html"];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var commentError = document.getElementById("comment-error-text");
|
||||||
|
$('#toast-comment-success').toast('dispose');
|
||||||
|
$('#toast-comment-error').toast('dispose');
|
||||||
|
$('#toast-comment-error').toast('show');
|
||||||
|
commentError.textContent = JSON.parse(xhr.response)["error"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xhr.send(form)
|
||||||
|
|
||||||
|
document.getElementById(button1).classList.toggle("d-md-inline-block");
|
||||||
|
document.getElementById(button2).classList.toggle("d-md-inline-block");
|
||||||
|
|
||||||
|
$('#toast-post-success').toast('dispose');
|
||||||
|
$('#toast-post-success').toast('show');
|
||||||
|
if (distinguish=='yes') {
|
||||||
|
document.getElementById('toast-post-success-text').innerText = "Comment distinguished!";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
document.getElementById('toast-post-success-text').innerText = "Comment undistinguished!";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
admin_comment2=function(cid,button1,button2,distinguish){
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
xhr.open("post", "/distinguish_comment/"+cid);
|
||||||
|
|
||||||
|
var form = new FormData();
|
||||||
|
|
||||||
|
form.append('formkey', formkey());
|
||||||
|
|
||||||
|
xhr.withCredentials=true;
|
||||||
|
xhr.onload=function(){
|
||||||
|
if (xhr.status==200) {
|
||||||
|
comment=document.getElementById('comment-'+cid+'-only');
|
||||||
|
comment.innerHTML=JSON.parse(xhr.response)["html"];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var commentError = document.getElementById("comment-error-text");
|
||||||
|
$('#toast-comment-success').toast('dispose');
|
||||||
|
$('#toast-comment-error').toast('dispose');
|
||||||
|
$('#toast-comment-error').toast('show');
|
||||||
|
commentError.textContent = JSON.parse(xhr.response)["error"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xhr.send(form)
|
||||||
|
|
||||||
|
document.getElementById(button1).classList.toggle("d-none");
|
||||||
|
document.getElementById(button2).classList.toggle("d-none");
|
||||||
|
|
||||||
|
$('#toast-post-success').toast('dispose');
|
||||||
|
$('#toast-post-success').toast('show');
|
||||||
|
if (distinguish=='yes') {
|
||||||
|
document.getElementById('toast-post-success-text').innerText = "Comment distinguished!";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
document.getElementById('toast-post-success-text').innerText = "Comment undistinguished!";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
// comment collapse
|
||||||
|
|
||||||
|
// Toggle comment collapse
|
||||||
|
|
||||||
|
function collapse_comment(comment_id) {
|
||||||
|
const comment = "comment-" + comment_id
|
||||||
|
const element = document.getElementById(comment)
|
||||||
|
const closed = element.classList.toggle("collapsed")
|
||||||
|
const top = element.getBoundingClientRect().y
|
||||||
|
|
||||||
|
if (closed && top < 0) {
|
||||||
|
element.scrollIntoView()
|
||||||
|
window.scrollBy(0, - 100)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
var clipboard = new ClipboardJS('.copy-link');
|
var clipboard = new ClipboardJS('.copy-link');
|
||||||
clipboard.on('success', function(e) {
|
clipboard.on('success', function(e) {
|
||||||
|
|
||||||
|
@ -302,8 +764,6 @@
|
||||||
|
|
||||||
{% if v %}
|
{% if v %}
|
||||||
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="javascript:void(0)" data-toggle="modal" data-target="#reportCommentModal" onclick="report_commentModal('{{c.id}}','{{c.author.username}}',)"><i class="fas fa-flag fa-fw"></i>Report</a></li>
|
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="javascript:void(0)" data-toggle="modal" data-target="#reportCommentModal" onclick="report_commentModal('{{c.id}}','{{c.author.username}}',)"><i class="fas fa-flag fa-fw"></i>Report</a></li>
|
||||||
{% else %}
|
|
||||||
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="javascript:void(0)" data-toggle="modal" data-target="#reportCommentModal" onclick=""><i class="fas fa-flag fa-fw"></i>Report</a></li>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
@ -548,11 +1008,76 @@
|
||||||
{% include "gif_modal.html" %}
|
{% include "gif_modal.html" %}
|
||||||
{% include "emoji_modal.html" %}
|
{% include "emoji_modal.html" %}
|
||||||
{% include "award_modal.html" %}
|
{% include "award_modal.html" %}
|
||||||
{% include "delete_comment_modal.html" %}
|
|
||||||
{% if v.admin_level == 6 %}
|
{% if v.admin_level == 6 %}
|
||||||
{% include "ban_modal.html" %}
|
{% include "ban_modal.html" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
<!-- Delete Comment Modal -->
|
||||||
|
<div class="modal fade" id="deleteCommentModal" tabindex="-1" role="dialog" aria-labelledby="deleteCommentModalTitle" aria-hidden="true">
|
||||||
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title">Delete comment?</h5>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
|
<span aria-hidden="true"><i class="far fa-times"></i></span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal-body text-center">
|
||||||
|
|
||||||
|
<div class="py-4">
|
||||||
|
<i class="fad fa-trash-alt text-muted" style="font-size: 3.5rem;"></i>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p>Your comment will be removed everywhere on {{'SITE_NAME' | app_config}}. This action can be undone.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-link text-muted" data-dismiss="modal">Cancel</button>
|
||||||
|
<button id="deleteCommentButton" class="btn btn-danger">Delete comment</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal fade" id="reportCommentModal" tabindex="-1" role="dialog" aria-labelledby="reportCommentModalTitle" aria-hidden="true">
|
||||||
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title">Report <span id="comment-author"></span>'s comment</h5>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
|
<span aria-hidden="true"><i class="far fa-times"></i></span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<!-- Before report is made, show this -->
|
||||||
|
<div class="" id="reportCommentFormBefore">
|
||||||
|
<form id="report-comment-form" method="post">
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="h6">We're sorry something here is wrong.</div>
|
||||||
|
<small class="form-text text-muted">Please enter a reason for reporting below.</small>
|
||||||
|
<pre></pre>
|
||||||
|
<input maxlength="100" id="reason-comment" class="form-control"/>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-link text-muted" data-dismiss="modal">Cancel</button>
|
||||||
|
<button type="button" id="reportCommentButton" class="btn btn-danger">Report comment</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<!-- After report is made, show this -->
|
||||||
|
<div class="d-none" id="reportCommentFormAfter">
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="h6">Thank you for reporting this comment!</div>
|
||||||
|
<small class="form-text text-muted">We'll take it from here.</small>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% include "expanded_image_modal.html" %}
|
{% include "expanded_image_modal.html" %}
|
||||||
{% include "flag_comment_modal.html" %}
|
|
||||||
</body>
|
</body>
|
File diff suppressed because it is too large
Load Diff
|
@ -1,28 +0,0 @@
|
||||||
<!-- Delete Comment Modal -->
|
|
||||||
<div class="modal fade" id="deleteCommentModal" tabindex="-1" role="dialog" aria-labelledby="deleteCommentModalTitle" aria-hidden="true">
|
|
||||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header">
|
|
||||||
<h5 class="modal-title">Delete comment?</h5>
|
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
||||||
<span aria-hidden="true"><i class="far fa-times"></i></span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="modal-body text-center">
|
|
||||||
|
|
||||||
<div class="py-4">
|
|
||||||
<i class="fad fa-trash-alt text-muted" style="font-size: 3.5rem;"></i>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p>Your comment will be removed everywhere on {{'SITE_NAME' | app_config}}. This action can be undone.</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="button" class="btn btn-link text-muted" data-dismiss="modal">Cancel</button>
|
|
||||||
<button id="deleteCommentButton" class="btn btn-danger">Delete comment</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
|
@ -1,3 +1,30 @@
|
||||||
|
<script>
|
||||||
|
function delete_postModal(id,button1,button2) {
|
||||||
|
|
||||||
|
// Passed data for modal
|
||||||
|
|
||||||
|
document.getElementById("deletePostButton-mobile").addEventListener("click", delete_post);
|
||||||
|
|
||||||
|
document.getElementById("deletePostButton").addEventListener("click", delete_post);
|
||||||
|
|
||||||
|
function delete_post(){
|
||||||
|
|
||||||
|
this.innerHTML='<span class="spinner-border spinner-border-sm mr-2" role="status" aria-hidden="true"></span>Deleting post';
|
||||||
|
this.disabled = true;
|
||||||
|
post('/delete_post/' + id,
|
||||||
|
callback = function() {
|
||||||
|
|
||||||
|
location.reload();
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
document.getElementById(button1).classList.toggle("d-none");
|
||||||
|
document.getElementById(button2).classList.toggle("d-none");
|
||||||
|
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
<!-- Delete Post Modal -->
|
<!-- Delete Post Modal -->
|
||||||
<div class="modal fade modal-sm-bottom" id="deletePostModal" tabindex="-1" role="dialog" aria-labelledby="deletePostModalTitle" aria-hidden="true">
|
<div class="modal fade modal-sm-bottom" id="deletePostModal" tabindex="-1" role="dialog" aria-labelledby="deletePostModalTitle" aria-hidden="true">
|
||||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||||
|
|
|
@ -13,6 +13,115 @@
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var commentFormID;
|
||||||
|
function commentForm(form) {
|
||||||
|
commentFormID = form;
|
||||||
|
};
|
||||||
|
|
||||||
|
const TEXTAREA_POS = 'curr-pos'
|
||||||
|
|
||||||
|
// Insert EMOJI markdown into comment box function
|
||||||
|
|
||||||
|
function getEmoji(searchTerm, form) {
|
||||||
|
const commentBox = document.getElementById(form);
|
||||||
|
const old = commentBox.value;
|
||||||
|
const curPos = $(commentBox).data(TEXTAREA_POS);
|
||||||
|
|
||||||
|
const firstHalf = old.slice(0, curPos)
|
||||||
|
const lastHalf = old.slice(curPos)
|
||||||
|
|
||||||
|
let emoji = ':' + searchTerm + ':'
|
||||||
|
const previousChar = firstHalf.slice(-1)
|
||||||
|
if (firstHalf.length > 0 && previousChar !== " " && previousChar !== "\n") {
|
||||||
|
emoji = " " + emoji
|
||||||
|
}
|
||||||
|
if (lastHalf.length > 0 && lastHalf[0] !== " ") {
|
||||||
|
emoji = emoji + " "
|
||||||
|
}
|
||||||
|
|
||||||
|
commentBox.value = firstHalf + emoji + lastHalf;
|
||||||
|
|
||||||
|
const newPos = curPos + emoji.length
|
||||||
|
|
||||||
|
$(commentBox).data(TEXTAREA_POS, newPos)
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadEmojis(form) {
|
||||||
|
|
||||||
|
const emojis = [
|
||||||
|
{
|
||||||
|
type:'marsey',
|
||||||
|
emojis: ['marseywhirlyhat','marsey173','marseycthulhu','marseycuck','marseyemperor','marseyface','marseyjohnson','marseykneel','marseymummy','marseymummy2','marseypanda','marseypumpkin','marseyskeletor','marseystein','marseyvampire','marseyvengeance','marseywitch3','marseylong1','marseylong2','marseylong3','marseypop','marseyqueenlizard','marseyagree','marseybane','marseybog','marseybux','marseycommitted','marseydisagree','marseydizzy','marseyfunko','marseyhealthy','marseykaiser','marseykyle','marseymask','marseymeds','marseykvlt','marseyn8','marseynietzsche','marseyobey','marseypatriot','marseypedo','marseypony','marseypuke','marseyqueen','marseyrage','marseysnek','marseytinfoil','marseywitch2','marseycenter','marseyauthleft','marseyauthright','marseylibleft','marseylibright','marseybinladen','marseycool','marseyjanny2','marseyjones','marseynapoleon','marseysanders','marseyshrug','marseysnoo','marseysoypoint','marseybiting','marseyblush','marseybountyhunter','marseycoonass','marseyfinger','marseyglancing','marseyhappy','marseyhearts','marseyluther','marseypizzashill','marseypokerface','marseypopcorn','marseyrasta','marseysad2','marseysmirk','marseysurprised','marseythomas','marseywitch','marseyyawn','marcusfootball','marje','marmsey','marsey1984','marsey420','marsey4chan','marsey69','marseyakshually','marseyandmarcus','marseyangel','marseyasian','marseybattered','marseybiden','marseybingus','marseyblm','marseyblowkiss','marseybluecheck','marseybong','marseybooba','marseyboomer','marseybrainlet','marseybride','marseyburger','marseybush','marseycamus','marseycanned','marseycarp','marseycatgirl','marseychef','marseychonker','marseychu','marseyclown','marseycomrade','marseyconfused','marseycoomer','marseycop','marseycope','marseycorn','marseycowboy','marseycry','marseycumjar1','marseycumjar2','marseycumjar3','marseycwc','marseydead','marseydepressed','marseydespair','marseydeux','marseydildo','marseydoomer','marseydrunk','marseydynamite','marseyexcited','marseyeyeroll','marseyfacepalm','marseyfamily','marseyfbi','marseyfeet','marseyfeminist','marseyflamethrower','marseyflamewar','marseyfloyd','marseyfug','marseygasp','marseyghost','marseygift','marseygigaretard','marseygigavaxxer','marseyglam','marseyglow','marseygodfather','marseygoodnight','marseygrass','marseygrilling','marseyhacker','marseyhmm','marseyhmmm','marseyilluminati','marseyinabox','marseyira','marseyisis','marseyjam','marseyjamming','marseyjanny','marseyjunkie','marseyking','marseykkk','marseylaugh','marseylawlz','marseylifting','marseylizard','marseylolcow','marseylove','marseymad','marseymanlet','marseymaoist','marseymcarthur','marseymerchant','marseymermaid','marseymommy','marseymouse','marseymyeisha','marseyneckbeard','marseyniqab','marseynpc','marseynun','marseynut','marseyorthodox','marseyowow','marseypainter','marseypanties','marseyparty','marseypat','marseypeacekeeper','marseypharaoh','marseypickle','marseypinochet','marseypipe','marseypirate','marseypoggers','marseypope','marseyproctologist','marseypsycho','marseyqoomer','marseyradioactive','marseyrain','marseyrat','marseyreading','marseyready','marseyrealwork','marseyreich','marseyrentfree','marseyretard','marseyrick','marseyrope','marseyrowling','marseysad','marseysadcat','marseyscarf','marseyschizo','marseyseethe','marseyshisha','marseyshook','marseysick','marseysleep','marseysmug','marseysneed','marseysociety','marseyspider','marseysrdine','marseystroke','marseysus','marseytaliban','marseytank','marseytankushanka','marseytea','marseythonk','marseythumbsup','marseytrain','marseysipping','marseytrans','marseytrans2','marseytroll','marseytrump','marseytwerking','marseyunabomber','marseyuwuw','marseyvan','marseyvaxmaxx','marseywave','marseyworried','marseyxd','marseyyeezus','marseyzoomer','marseyzwei','marsoy','marsoyhype']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type:'platy',
|
||||||
|
emojis: ['platyabused','platyblizzard','platyboxer','platydevil','platyfear','platygirlmagic','platygolong','platyhaes','platyking','platylove','platyneet','platyold','platypatience','platypopcorn','platyrich','platysarcasm','platysilly','platysleeping','platythink','platytired','platytuxedomask','platyblush','platybruh','platycaveman','platycheer','platydown','platyeyes','platyheart','platylol','platymicdrop','platynooo','platysalute','platyseethe','platythumbsup','platywave']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type:'tay',
|
||||||
|
emojis: ['tayaaa','tayadmire','taycat','taycelebrate','taychefkiss','taychristmas','tayclap','taycold','taycrown','tayflex','tayflirt','taygrimacing','tayhappy','tayheart','tayhmm','tayhuh','tayhyperdab','tayjammin','taylaugh','taymindblown','tayno','taynod','taypeace','taypray','tayrun','tayscrunch','tayshake','tayshrug','taysilly','tayslide','taysmart','taystop','taytantrum','taytea','taythink','tayvibin','taywhat','taywine','taywine2','taywink','tayyes']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type:'classic',
|
||||||
|
emojis: ['2thumbsup','aliendj','ambulance','angry','angrywhip','argue','aroused','ashamed','badass','banana','band','banghead','batman','bigeyes','bite','blind','blowkiss','blush','bong','bounce','bow','breakheart','bs','cartwheel','cat','celebrate','chainsaw','cheers','clap','cold','confused','crazyeyes','cry','cthulhu','cute','D','daydream','ddr','deadpool','devilsmile','diddle','die','distress','disturbing','dizzy','domo','doughboy','drink','drool','dudeweedlmao','edward','electro','elephant','embarrassed','emo','emo2','evil','evilclown','evilgrin','facepalm','fap','flamethrower','flipbird','flirt','frown','gasp','glomp','go','gooby','grr','gtfo','guitar','haha','handshake','happydance','headbang','heart','heartbeat','hearts','highfive','hmm','hmph','holdhands','horny','hug','hugging','hugs','hump','humpbed','hysterical','ily','inlove','jason','jawdrop','jedi','jester','kaboom','kick','kiss','kitty','laughchair','lick','link','lol','lolbeat','loving','makeout','medal','megaman','megamanguitar','meow','metime','mooning','mummy','na','nauseous','nervous','ninja','nod','nono','omg','onfire','ooo','orly','p','paddle','panda','pandabutt','paranoid','party','pat','peek','pikachu','pimp','plzdie','poke','popcorn','pout','probe','puke','punch','quote','raccoon','roar','rofl','roflmao','rolleyes','sad','sadeyes','sadhug','samurai','sarcasm','scoot','scream','shmoopy','shrug','skull','slap','slapfight','sleepy','smackfish','smackhead','smh','smile','smoke','sonic','spank','sparta','sperm','spiderman','stab','star','stare','stfu','suicide','surprisehug','suspicious','sweat','swordfight','taco','talk2hand','tantrum','teehee','thinking','threesome','throw','throwaway','tickle','typing','uhuh','vampbat','viking','violin','vulgar','wah','wat','whip','whipping','wink','witch','wizard','woah','worm','woo','work','worship','wow','XD','yay','zzz']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type:'rage',
|
||||||
|
emojis: ['troll','bitchplease','spit','challengeaccepted','contentiouscereal','cryingatcuteness','derp','derpcornsyrup','derpcrying','derpcute','derpdumb','derpeuphoria','derpinahd','derpinapokerface','derpinasnickering','derpprocessing','derprealization','derpsnickering','derptalking','derpthinking','derpthumbsup','derpunimpressed','derpwhy','donotwant','epicfacefeatures','fancywithwine','fffffffuuuuuuuuuuuu','flipthetable','foreveralone','foreveralonehappy','hewillnever','idontknow','interuptedreading','iseewhatyoudidthere','killherkillher','ledesire','leexcited','legenius','lelolidk','lemiddlefinger','lemindblown','leokay','lepanicrunning','lepokerface','lepokerface2','lerageface','leseriousface','likeaboss','lolface','longwhiskers','manymiddlefingers','megusta','motherfucker','motherofgod','mysides','ohgodwhy','pervertedspiderman','picard','ragestrangle','rukiddingme','tfwyougettrolled','trollolol','truestorybro','xallthey','yuno']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type:'wojak',
|
||||||
|
emojis: ['gigachad','gigachad2','chadyes','chadno','abusivewife','ancap','bardfinn','bloomer','boomer','boomermonster','brainletbush','brainletcaved','brainletchair','brainletchest','brainletmaga','brainletpit','chad','chadarab','chadasian','chadblack','chadjesus','chadjew','chadjihadi','chadlatino','chadlibleft','chadnordic','chadsikh','chadusa','coomer','doomer','doomerfront','doomergirl','ethot','fatbrain','fatpriest','femboy','gogetter','grug','monke','nazijak','npc','npcfront','npcmaga','psychojak','ragejak','ragemask','ramonajak','soyjackwow','soyjak','soyjakfront','soyjakhipster','soyjakmaga','soyjakyell','tomboy','zoomer','zoomersoy']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type:'flags',
|
||||||
|
emojis: ['niger', 'lgbt', 'saudi', 'animesexual','blacknation','blm','blueline','dreamgender','fatpride','incelpride','israel','kazakhstan','landlordlove','scalperpride','superstraight','trans','translord','transracial','usa']
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
let search_bar = document.getElementById("emoji_search");
|
||||||
|
let search_container = document.getElementById('emoji-tab-search')
|
||||||
|
|
||||||
|
if(search_bar.value == ""){
|
||||||
|
let container = document.getElementById(`EMOJIS_favorite`)
|
||||||
|
container.innerHTML = container.innerHTML.replace(/@form@/g, form)
|
||||||
|
|
||||||
|
const commentBox = document.getElementById(form);
|
||||||
|
$(commentBox).data(TEXTAREA_POS, commentBox.selectionStart)
|
||||||
|
|
||||||
|
for (i=0; i < emojis.length; i++) {
|
||||||
|
|
||||||
|
let container = document.getElementById(`EMOJIS_${emojis[i].type}`)
|
||||||
|
let str = ''
|
||||||
|
let arr = emojis[i].emojis
|
||||||
|
|
||||||
|
for (j=0; j < arr.length; j++) {
|
||||||
|
if(arr[j].match(search_bar.value)){
|
||||||
|
str += `<button class="btn m-1 px-0" onclick="getEmoji(\'${arr[j]}\', \'${form}\')" style="background: None!important; width:60px; overflow: hidden; border: none;" data-toggle="tooltip" title=":${arr[j]}:" delay:="0"><img loading="lazy" width=50 src="/assets/images/emojis/${arr[j]}.webp" alt="${arr[j]}-emoji"/></button>`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
container.innerHTML = str
|
||||||
|
search_container.innerHTML = ""
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
let str = ''
|
||||||
|
for (i=0; i < emojis.length; i++) {
|
||||||
|
let arr = emojis[i].emojis
|
||||||
|
let container = document.getElementById(`EMOJIS_${emojis[i].type}`)
|
||||||
|
for (j=0; j < arr.length; j++) {
|
||||||
|
if(arr[j].match(search_bar.value.toLowerCase())){
|
||||||
|
str += `<button class="btn m-1 px-0" onclick="getEmoji(\'${arr[j]}\', \'${form}\')" style="background: None!important; width:60px; overflow: hidden; border: none;" data-toggle="tooltip" title=":${arr[j]}:" delay:="0"><img loading="lazy" width=50 src="/assets/images/emojis/${arr[j]}.webp" alt="${arr[j]}-emoji"/></button>`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
container.innerHTML = ""
|
||||||
|
}
|
||||||
|
search_container.innerHTML = str
|
||||||
|
}
|
||||||
|
search_bar.oninput = function(){loadEmojis(form);};
|
||||||
|
}
|
||||||
|
</script>
|
||||||
<!-- Emoji Selection Modal -->
|
<!-- Emoji Selection Modal -->
|
||||||
<div id="form" class="d-none"></div>
|
<div id="form" class="d-none"></div>
|
||||||
<div class="modal fade" id="emojiModal" tabindex="-1" role="dialog" aria-labelledby="emojiModalTitle" aria-hidden="true">
|
<div class="modal fade" id="emojiModal" tabindex="-1" role="dialog" aria-labelledby="emojiModalTitle" aria-hidden="true">
|
||||||
|
|
|
@ -1,3 +1,36 @@
|
||||||
|
<script>
|
||||||
|
$('.expandable-image').click( function(event) {
|
||||||
|
|
||||||
|
if (event.which != 1) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
var url= $(this).data('url');
|
||||||
|
|
||||||
|
expandDesktopImage(url,url);
|
||||||
|
})
|
||||||
|
|
||||||
|
// Expand Images on Desktop
|
||||||
|
|
||||||
|
function expandDesktopImage(image, link) {
|
||||||
|
|
||||||
|
// Link text
|
||||||
|
|
||||||
|
var linkText = document.getElementById("desktop-expanded-image-link");
|
||||||
|
var imgLink = document.getElementById("desktop-expanded-image-wrap-link");
|
||||||
|
|
||||||
|
var inlineImage = document.getElementById("desktop-expanded-image");
|
||||||
|
|
||||||
|
inlineImage.src = image.replace("100w.webp", "giphy.webp");
|
||||||
|
linkText.href = image;
|
||||||
|
imgLink.href=image;
|
||||||
|
|
||||||
|
linkText.textContent = 'View original';
|
||||||
|
};
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
<!-- Expand Desktop Image Modal -->
|
<!-- Expand Desktop Image Modal -->
|
||||||
|
|
||||||
<div class="modal desktop-expanded-image-modal" id="expandImageModal" tabindex="-1" role="dialog" aria-labelledby="expandImageModalTitle" aria-hidden="true">
|
<div class="modal desktop-expanded-image-modal" id="expandImageModal" tabindex="-1" role="dialog" aria-labelledby="expandImageModalTitle" aria-hidden="true">
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
<!-- Report Comment Modal -->
|
|
||||||
<div class="modal fade" id="reportCommentModal" tabindex="-1" role="dialog" aria-labelledby="reportCommentModalTitle" aria-hidden="true">
|
|
||||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header">
|
|
||||||
<h5 class="modal-title">Report <span id="comment-author"></span>'s comment</h5>
|
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
||||||
<span aria-hidden="true"><i class="far fa-times"></i></span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<!-- Before report is made, show this -->
|
|
||||||
<div class="" id="reportCommentFormBefore">
|
|
||||||
<form id="report-comment-form" method="post">
|
|
||||||
<div class="modal-body">
|
|
||||||
<div class="h6">We're sorry something here is wrong.</div>
|
|
||||||
<small class="form-text text-muted">Please enter a reason for reporting below.</small>
|
|
||||||
<pre></pre>
|
|
||||||
<input maxlength="100" id="reason-comment" class="form-control"/>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="button" class="btn btn-link text-muted" data-dismiss="modal">Cancel</button>
|
|
||||||
<button type="button" id="reportCommentButton" class="btn btn-danger">Report comment</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<!-- After report is made, show this -->
|
|
||||||
<div class="d-none" id="reportCommentFormAfter">
|
|
||||||
<div class="modal-body">
|
|
||||||
<div class="h6">Thank you for reporting this comment!</div>
|
|
||||||
<small class="form-text text-muted">We'll take it from here.</small>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
File diff suppressed because one or more lines are too long
|
@ -5,10 +5,10 @@
|
||||||
{% block stylesheets %}
|
{% block stylesheets %}
|
||||||
|
|
||||||
{% if v %}
|
{% if v %}
|
||||||
<link rel="stylesheet" href="/assets/style/{{v.theme}}_{{v.themecolor}}.css">
|
<link rel="stylesheet" href="/assets/css/{{v.theme}}_{{v.themecolor}}.css">
|
||||||
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/style/agendaposter.css">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<link rel="stylesheet" href="/assets/style/{{'DEFAULT_THEME' | app_config}}.css">
|
<link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -15,19 +15,11 @@
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600&display=swap" rel="stylesheet">
|
||||||
|
|
||||||
<!-- Bootstrap core CSS -->
|
|
||||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
|
|
||||||
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
|
|
||||||
|
|
||||||
<!-- Font Awesome -->
|
<!-- Font Awesome -->
|
||||||
<link href="/assets/style/fa.css" rel="stylesheet"> <!--load all styles -->
|
<link href="/assets/css/fa.css" rel="stylesheet"> <!--load all styles -->
|
||||||
|
|
||||||
<script data-search-pseudo-elements defer src="https://use.fontawesome.com/releases/latest/js/javascript.js"
|
|
||||||
integrity="sha384-L469/ELG4Bg9sDQbl0hvjMq8pOcqFgkSpwhwnslzvVVGpDjYJ6wJJyYjvG3u8XW7"
|
|
||||||
crossorigin="anonymous"></script>
|
|
||||||
|
|
||||||
<!-- {{'SITE_NAME' | app_config}} CSS -->
|
<!-- {{'SITE_NAME' | app_config}} CSS -->
|
||||||
<link rel="stylesheet" href="/assets/style/{{'DEFAULT_THEME' | app_config}}.css">
|
<link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css">
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
@ -132,6 +124,7 @@
|
||||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
|
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
|
||||||
<script src="/assets/js/general39.js"></script>
|
<script src="/assets/js/general39.js"></script>
|
||||||
|
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -12,18 +12,12 @@
|
||||||
<title>2-Step Login - {{'SITE_NAME' | app_config}}</title>
|
<title>2-Step Login - {{'SITE_NAME' | app_config}}</title>
|
||||||
|
|
||||||
<!-- Bootstrap core CSS -->
|
<!-- Bootstrap core CSS -->
|
||||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
|
|
||||||
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
|
|
||||||
|
|
||||||
<!-- Font Awesome -->
|
<!-- Font Awesome -->
|
||||||
<link href="/assets/fontawesome/css/all.css" rel="stylesheet"> <!--load all styles -->
|
<link href="/assets/fontawesome/css/all.css" rel="stylesheet"> <!--load all styles -->
|
||||||
|
|
||||||
<script data-search-pseudo-elements defer src="https://use.fontawesome.com/releases/latest/js/javascript.js"
|
|
||||||
integrity="sha384-L469/ELG4Bg9sDQbl0hvjMq8pOcqFgkSpwhwnslzvVVGpDjYJ6wJJyYjvG3u8XW7"
|
|
||||||
crossorigin="anonymous"></script>
|
|
||||||
|
|
||||||
<!-- {{'SITE_NAME' | app_config}} CSS -->
|
<!-- {{'SITE_NAME' | app_config}} CSS -->
|
||||||
<link rel="stylesheet" href="/assets/style/{{'DEFAULT_THEME' | app_config}}.css">
|
<link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css">
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,59 @@
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Mobile bottom navigation bar
|
||||||
|
|
||||||
|
window.onload = function () {
|
||||||
|
var prevScrollpos = window.pageYOffset;
|
||||||
|
window.onscroll = function () {
|
||||||
|
var currentScrollPos = window.pageYOffset;
|
||||||
|
|
||||||
|
var topBar = document.getElementById("fixed-bar-mobile");
|
||||||
|
|
||||||
|
var bottomBar = document.getElementById("mobile-bottom-navigation-bar");
|
||||||
|
|
||||||
|
var dropdown = document.getElementById("mobileSortDropdown");
|
||||||
|
|
||||||
|
var navbar = document.getElementById("navbar");
|
||||||
|
|
||||||
|
if (bottomBar != null) {
|
||||||
|
if (prevScrollpos > currentScrollPos && (window.innerHeight + currentScrollPos) < (document.body.offsetHeight - 65)) {
|
||||||
|
bottomBar.style.bottom = "0px";
|
||||||
|
}
|
||||||
|
else if (currentScrollPos <= 125 && (window.innerHeight + currentScrollPos) < (document.body.offsetHeight - 65)) {
|
||||||
|
bottomBar.style.bottom = "0px";
|
||||||
|
}
|
||||||
|
else if (prevScrollpos > currentScrollPos && (window.innerHeight + currentScrollPos) >= (document.body.offsetHeight - 65)) {
|
||||||
|
bottomBar.style.bottom = "-50px";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
bottomBar.style.bottom = "-50px";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Execute if bottomBar exists
|
||||||
|
|
||||||
|
if (topBar != null && dropdown != null) {
|
||||||
|
if (prevScrollpos > currentScrollPos) {
|
||||||
|
topBar.style.top = "48px";
|
||||||
|
navbar.classList.remove("shadow");
|
||||||
|
}
|
||||||
|
else if (currentScrollPos <= 125) {
|
||||||
|
topBar.style.top = "48px";
|
||||||
|
navbar.classList.remove("shadow");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
topBar.style.top = "-48px";
|
||||||
|
dropdown.classList.remove('show');
|
||||||
|
navbar.classList.add("shadow");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
prevScrollpos = currentScrollPos;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
<div class="container d-inline-flex d-lg-none">
|
<div class="container d-inline-flex d-lg-none">
|
||||||
|
|
||||||
<div class="row fixed-bottom bg-white border-top p-2" id="mobile-bottom-navigation-bar"
|
<div class="row fixed-bottom bg-white border-top p-2" id="mobile-bottom-navigation-bar"
|
||||||
|
|
|
@ -116,7 +116,4 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block GIFpicker %}
|
{% block GIFpicker %}
|
||||||
{% if v %}
|
|
||||||
{% include "gif_modal.html" %}
|
|
||||||
{% endif %}
|
|
||||||
{% endblock %}
|
{% endblock %}
|
|
@ -1,3 +1,55 @@
|
||||||
|
<script>
|
||||||
|
// Report Submission
|
||||||
|
|
||||||
|
report_postModal = function(id, author) {
|
||||||
|
|
||||||
|
document.getElementById("post-author").textContent = author;
|
||||||
|
|
||||||
|
submitbutton=document.getElementById("reportPostButton");
|
||||||
|
|
||||||
|
submitbutton.onclick = function() {
|
||||||
|
|
||||||
|
this.innerHTML='<span class="spinner-border spinner-border-sm mr-2" role="status" aria-hidden="true"></span>Reporting post';
|
||||||
|
this.disabled = true;
|
||||||
|
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
xhr.open("POST", '/flag/post/'+id, true);
|
||||||
|
var form = new FormData()
|
||||||
|
form.append("formkey", formkey());
|
||||||
|
form.append("reason", document.getElementById("reason").value);
|
||||||
|
|
||||||
|
xhr.withCredentials=true;
|
||||||
|
|
||||||
|
xhr.onload=function() {
|
||||||
|
document.getElementById("reportPostFormBefore").classList.add('d-none');
|
||||||
|
document.getElementById("reportPostFormAfter").classList.remove('d-none');
|
||||||
|
};
|
||||||
|
|
||||||
|
xhr.onerror=function(){alert(errortext)};
|
||||||
|
xhr.send(form);
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$('#reportPostModal').on('hidden.bs.modal', function () {
|
||||||
|
|
||||||
|
var button = document.getElementById("reportPostButton");
|
||||||
|
|
||||||
|
var beforeModal = document.getElementById("reportPostFormBefore");
|
||||||
|
var afterModal = document.getElementById("reportPostFormAfter");
|
||||||
|
|
||||||
|
button.innerHTML='Report post';
|
||||||
|
button.disabled= false;
|
||||||
|
|
||||||
|
afterModal.classList.add('d-none');
|
||||||
|
|
||||||
|
if ( beforeModal.classList.contains('d-none') ) {
|
||||||
|
beforeModal.classList.remove('d-none');
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
<!-- Report Post Modal -->
|
<!-- Report Post Modal -->
|
||||||
<div class="modal fade" id="reportPostModal" tabindex="-1" role="dialog" aria-labelledby="reportPostModalTitle" aria-hidden="true">
|
<div class="modal fade" id="reportPostModal" tabindex="-1" role="dialog" aria-labelledby="reportPostModalTitle" aria-hidden="true">
|
||||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
|
@ -140,7 +140,9 @@
|
||||||
|
|
||||||
<div class="posts" id="posts">
|
<div class="posts" id="posts">
|
||||||
|
|
||||||
{% block listing_template %}{% include "submission_listing.html" %}{% endblock %}
|
{% block listing_template %}
|
||||||
|
{% include "submission_listing.html" %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js"></script>
|
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js"></script>
|
||||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
|
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js"></script>
|
||||||
|
<script src="/assets/js/general39.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
@ -95,17 +96,14 @@
|
||||||
<meta name="twitter:url" content="{{request.host}}" />
|
<meta name="twitter:url" content="{{request.host}}" />
|
||||||
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600&display=swap" rel="stylesheet">
|
||||||
|
|
||||||
<!-- Bootstrap core CSS -->
|
|
||||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
|
|
||||||
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
|
|
||||||
|
|
||||||
<!-- {{'SITE_NAME' | app_config}} CSS -->
|
<!-- {{'SITE_NAME' | app_config}} CSS -->
|
||||||
|
|
||||||
<link rel="stylesheet" href="/assets/style/{{v.theme}}_{{v.themecolor}}.css">
|
<link rel="stylesheet" href="/assets/css/{{v.theme}}_{{v.themecolor}}.css">
|
||||||
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/style/agendaposter.css">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
||||||
|
|
||||||
<!-- Font Awesome -->
|
<!-- Font Awesome -->
|
||||||
<link href="/assets/style/fa.css" rel="stylesheet"> <!--load all styles -->
|
<link href="/assets/css/fa.css" rel="stylesheet"> <!--load all styles -->
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function formkey() {
|
function formkey() {
|
||||||
|
@ -232,8 +230,74 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if v %}
|
{% if v %}
|
||||||
{% include "2fa_modal.html" %}
|
<!-- 2FA Modal -->
|
||||||
{% endif %}
|
<div class="modal fade" id="2faModal" tabindex="-1" role="dialog" aria-labelledby="2faModalTitle" aria-hidden="true">
|
||||||
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title">{% if mfa_secret %}Setup two-step login{% elif mfa_secret and not v.email %}Email required for two-step login{% else %}Disable two-step login{% endif %}</h5>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
|
<span aria-hidden="true"><i class="far fa-times"></i></span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
{% if mfa_secret %}
|
||||||
|
<div>
|
||||||
|
<form action="/settings/security" method="post">
|
||||||
|
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
||||||
|
<input type="hidden" name="2fa_secret" value="{{mfa_secret}}">
|
||||||
|
<div class="modal-body">
|
||||||
|
<p>
|
||||||
|
<span class="font-weight-bold">Step 1:</span> Scan this barcode (or enter the code) using a two-factor authentication app such as Google Authenticator or Authy.
|
||||||
|
</p>
|
||||||
|
<div class="text-center mb-3">
|
||||||
|
<img loading="lazy" class="img-fluid" style="width: 175px;" src="/2faqr/{{mfa_secret}}">
|
||||||
|
<pre></pre>
|
||||||
|
<div class="text-small text-muted">Or enter this code: {{mfa_secret}}</div>
|
||||||
|
</div>
|
||||||
|
<p>
|
||||||
|
<span class="font-weight-bold">Step 2:</span> Enter the six-digit code generated in the authenticator app and your {{'SITE_NAME' | app_config}} account password.
|
||||||
|
</p>
|
||||||
|
<label for="2fa_input">6-digit code</label>
|
||||||
|
<input type="text" class="form-control mb-2" id="2fa_input" name="2fa_token" placeholder="# # # # # #" required>
|
||||||
|
|
||||||
|
<label for="2fa_input_password">Password</label>
|
||||||
|
<input type="password" autocomplete="new-password" class="form-control mb-2" id="2fa_input_password" name="password" oninput="document.getElementById('enable2faButton').disabled=false" autocomplete="off" required>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-link text-muted" data-dismiss="modal">Cancel</button>
|
||||||
|
<input id="enable2faButton" class="btn btn-primary" type="submit" value="Enable 2-step login" disabled>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
|
<div>
|
||||||
|
<form action="/settings/security" method="post">
|
||||||
|
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
||||||
|
<input type="hidden" name="2fa_secret" value="{{mfa_secret}}">
|
||||||
|
<div class="modal-body">
|
||||||
|
|
||||||
|
<div class="alert alert-warning" role="alert">
|
||||||
|
<i class="fas fa-info-circle"></i>
|
||||||
|
To disable two-step login, please enter your {{'SITE_NAME' | app_config}} account password and the 6-digit code generated in your authentication app. If you no longer have your two-step device, <a href="/lost_2fa">click here</a>.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<label for="2fa_input_password">Password</label>
|
||||||
|
<input type="password" autocomplete="new-password" class="form-control mb-2" id="2fa_input_password" name="password" autocomplete="off" required>
|
||||||
|
|
||||||
|
<label for="2fa_input">6-digit code</label>
|
||||||
|
<input type="text" class="form-control mb-2" id="2fa_input" name="2fa_remove" placeholder="# # # # # #" oninput="document.getElementById('disable2faButton').disabled=false" required>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-link text-muted" data-dismiss="modal">Cancel</button>
|
||||||
|
<input id="disable2faButton" class="btn btn-primary" type="submit" value="Disable 2-step login" disabled>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<!-- Clipboard Toast -->
|
<!-- Clipboard Toast -->
|
||||||
|
|
||||||
|
@ -264,7 +328,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/assets/js/general39.js"></script>
|
|
||||||
|
|
||||||
{% block onload %}{% endblock %}
|
{% block onload %}{% endblock %}
|
||||||
|
|
||||||
|
|
|
@ -34,20 +34,16 @@
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600&display=swap" rel="stylesheet">
|
||||||
|
|
||||||
<!-- Bootstrap core CSS -->
|
|
||||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
|
|
||||||
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
|
|
||||||
|
|
||||||
<!-- {{'SITE_NAME' | app_config}} CSS -->
|
<!-- {{'SITE_NAME' | app_config}} CSS -->
|
||||||
|
|
||||||
{% if v %}
|
{% if v %}
|
||||||
<link id="css-link" rel="stylesheet" href="/assets/style/{{v.theme}}_{{v.themecolor}}.css">
|
<link id="css-link" rel="stylesheet" href="/assets/css/{{v.theme}}_{{v.themecolor}}.css">
|
||||||
{% else %}
|
{% else %}
|
||||||
<link id="css-link" rel="stylesheet" href="/assets/style/{{'DEFAULT_THEME' | app_config}}.css">
|
<link id="css-link" rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<!-- Font Awesome -->
|
<!-- Font Awesome -->
|
||||||
<link href="/assets/style/fa.css" rel="stylesheet"> <!--load all styles -->
|
<link href="/assets/css/fa.css" rel="stylesheet"> <!--load all styles -->
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function formkey() {
|
function formkey() {
|
||||||
|
@ -186,7 +182,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% block mobilenavbar %}
|
{% block mobilenavbar %}
|
||||||
{% include "mobile_navigation_bar.html" %}
|
{% include "mobile_navigation_bar.html" %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block invitationModal %}
|
{% block invitationModal %}
|
||||||
|
@ -204,11 +200,10 @@
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
|
||||||
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js"></script>
|
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js"></script>
|
||||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
|
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
|
||||||
|
|
||||||
<script src="/assets/js/general39.js"></script>
|
<script src="/assets/js/general39.js"></script>
|
||||||
|
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
|
||||||
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js"></script>
|
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js"></script>
|
||||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
|
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
|
||||||
|
<script src="/assets/js/general39.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
//Signup js
|
//Signup js
|
||||||
|
@ -91,19 +93,11 @@
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600&display=swap" rel="stylesheet">
|
||||||
|
|
||||||
<!-- Bootstrap core CSS -->
|
|
||||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
|
|
||||||
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
|
|
||||||
|
|
||||||
<!-- Font Awesome -->
|
<!-- Font Awesome -->
|
||||||
<link href="/assets/fontawesome/css/all.css" rel="stylesheet"> <!--load all styles -->
|
<link href="/assets/fontawesome/css/all.css" rel="stylesheet"> <!--load all styles -->
|
||||||
|
|
||||||
<script data-search-pseudo-elements defer src="https://use.fontawesome.com/releases/latest/js/javascript.js"
|
|
||||||
integrity="sha384-L469/ELG4Bg9sDQbl0hvjMq8pOcqFgkSpwhwnslzvVVGpDjYJ6wJJyYjvG3u8XW7"
|
|
||||||
crossorigin="anonymous"></script>
|
|
||||||
|
|
||||||
<!-- {{'SITE_NAME' | app_config}} CSS -->
|
<!-- {{'SITE_NAME' | app_config}} CSS -->
|
||||||
<link rel="stylesheet" href="/assets/style/{{'DEFAULT_THEME' | app_config}}.css">
|
<link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css">
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
@ -235,7 +229,7 @@
|
||||||
|
|
||||||
<!-- {{'SITE_NAME' | app_config}} JS -->
|
<!-- {{'SITE_NAME' | app_config}} JS -->
|
||||||
|
|
||||||
<script src="/assets/js/general39.js"></script>
|
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,28 @@
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js"></script>
|
||||||
|
|
||||||
|
{% if v and v.id == p.author_id %}
|
||||||
|
<script>
|
||||||
|
// Post edit form
|
||||||
|
|
||||||
|
togglePostEdit=function(id){
|
||||||
|
|
||||||
|
body=document.getElementById("post-body");
|
||||||
|
title=document.getElementById("post-title");
|
||||||
|
form=document.getElementById("edit-post-body-"+id);
|
||||||
|
box=document.getElementById("post-edit-box-"+id);
|
||||||
|
box2=document.getElementById("post-edit-box2-"+id);
|
||||||
|
|
||||||
|
body.classList.toggle("d-none");
|
||||||
|
title.classList.toggle("d-none");
|
||||||
|
form.classList.toggle("d-none");
|
||||||
|
autoExpand(box);
|
||||||
|
autoExpand(box2);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var clipboard = new ClipboardJS('.copy-link');
|
var clipboard = new ClipboardJS('.copy-link');
|
||||||
clipboard.on('success', function(e) {
|
clipboard.on('success', function(e) {
|
||||||
|
|
|
@ -520,9 +520,9 @@
|
||||||
{% if v %}
|
{% if v %}
|
||||||
{% include "award_modal.html" %}
|
{% include "award_modal.html" %}
|
||||||
{% include "delete_post_modal.html" %}
|
{% include "delete_post_modal.html" %}
|
||||||
|
{% include "report_post_modal.html" %}
|
||||||
{% if v.admin_level == 6 %}
|
{% if v.admin_level == 6 %}
|
||||||
{% include "ban_modal.html" %}
|
{% include "ban_modal.html" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% include "expanded_image_modal.html" %}
|
{% include "expanded_image_modal.html" %}
|
||||||
{% include "flag_post_modal.html" %}
|
|
|
@ -7,6 +7,7 @@
|
||||||
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
||||||
<script src="/assets/js/general39.js"></script>
|
<script src="/assets/js/general39.js"></script>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
@ -269,23 +270,19 @@
|
||||||
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600&display=swap" rel="stylesheet">
|
||||||
|
|
||||||
<!-- Bootstrap core CSS -->
|
|
||||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
|
|
||||||
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
|
|
||||||
|
|
||||||
<!-- {{'SITE_NAME' | app_config}} Board CSS -->
|
<!-- {{'SITE_NAME' | app_config}} Board CSS -->
|
||||||
|
|
||||||
{% block stylesheets %}
|
{% block stylesheets %}
|
||||||
{% if v %}
|
{% if v %}
|
||||||
<link rel="stylesheet" href="/assets/style/{{v.theme}}_{{v.themecolor}}.css">
|
<link rel="stylesheet" href="/assets/css/{{v.theme}}_{{v.themecolor}}.css">
|
||||||
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/style/agendaposter.css">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<link rel="stylesheet" href="/assets/style/{{'DEFAULT_THEME' | app_config}}.css">
|
<link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
<!-- Font Awesome -->
|
<!-- Font Awesome -->
|
||||||
<link href="/assets/style/fa.css" rel="stylesheet"> <!--load all styles -->
|
<link href="/assets/css/fa.css" rel="stylesheet"> <!--load all styles -->
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body id="submit" style="overflow-x: hidden; {% if v and v.background %} background:url(/assets/images/backgrounds/{{v.background}}) no-repeat center center fixed !important; background-size: cover!important; background-color: #000!important;{% endif %}display: block;">
|
<body id="submit" style="overflow-x: hidden; {% if v and v.background %} background:url(/assets/images/backgrounds/{{v.background}}) no-repeat center center fixed !important; background-size: cover!important; background-color: #000!important;{% endif %}display: block;">
|
||||||
|
|
|
@ -3,10 +3,10 @@
|
||||||
{% if u and u.profilecss %}
|
{% if u and u.profilecss %}
|
||||||
{% block stylesheets %}
|
{% block stylesheets %}
|
||||||
{% if v %}
|
{% if v %}
|
||||||
<link rel="stylesheet" href="/assets/style/{{v.theme}}_{{v.themecolor}}.css">
|
<link rel="stylesheet" href="/assets/css/{{v.theme}}_{{v.themecolor}}.css">
|
||||||
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/style/agendaposter.css">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
{% if v.agendaposter %}<link rel="stylesheet" href="/assets/css/agendaposter.css">{% elif v.css %}<link rel="stylesheet" href="/@{{v.username}}/css">{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<link rel="stylesheet" href="/assets/style/{{'DEFAULT_THEME' | app_config}}.css">
|
<link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if u and u.profilecss %}
|
{% if u and u.profilecss %}
|
||||||
<link rel="stylesheet" href="/@{{u.username}}/profilecss">
|
<link rel="stylesheet" href="/@{{u.username}}/profilecss">
|
||||||
|
@ -44,6 +44,63 @@
|
||||||
{% block desktopUserBanner %}
|
{% block desktopUserBanner %}
|
||||||
<!-- Desktop -->
|
<!-- Desktop -->
|
||||||
<script>
|
<script>
|
||||||
|
function post_toast_callback(url, data, callback) {
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
xhr.open("POST", url, true);
|
||||||
|
var form = new FormData()
|
||||||
|
|
||||||
|
if(typeof data === 'object' && data !== null) {
|
||||||
|
for(let k of Object.keys(data)) {
|
||||||
|
form.append(k, data[k]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
form.append("formkey", formkey());
|
||||||
|
xhr.withCredentials=true;
|
||||||
|
|
||||||
|
xhr.onload = function() {
|
||||||
|
let result = callback(xhr);
|
||||||
|
|
||||||
|
if (xhr.status >= 200 && xhr.status < 300) {
|
||||||
|
$('#toast-post-error').toast('dispose');
|
||||||
|
$('#toast-post-success').toast('dispose');
|
||||||
|
$('#toast-post-success').toast('show');
|
||||||
|
|
||||||
|
try {
|
||||||
|
if(typeof result == "string") {
|
||||||
|
document.getElementById('toast-post-success-text').innerText = result;
|
||||||
|
} else {
|
||||||
|
document.getElementById('toast-post-success-text').innerText = JSON.parse(xhr.response)["message"];
|
||||||
|
}
|
||||||
|
} catch(e) {
|
||||||
|
document.getElementById('toast-post-success-text').innerText = "Action successful!";
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
$('#toast-post-success').toast('dispose');
|
||||||
|
$('#toast-post-error').toast('dispose');
|
||||||
|
$('#toast-post-error').toast('show');
|
||||||
|
|
||||||
|
try {
|
||||||
|
if(typeof result == "string") {
|
||||||
|
document.getElementById('toast-post-error-text').innerText = result;
|
||||||
|
} else {
|
||||||
|
document.getElementById('toast-post-error-text').innerText = JSON.parse(xhr.response)["error"];
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
} catch(e) {
|
||||||
|
document.getElementById('toast-post-error-text').innerText = "Error. Try again later.";
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
xhr.send(form);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
const TRANSFER_TAX = 0.01;
|
const TRANSFER_TAX = 0.01;
|
||||||
|
|
||||||
window.addEventListener( 'load', function() {
|
window.addEventListener( 'load', function() {
|
||||||
|
@ -760,8 +817,4 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block GIFpicker %}
|
{% block GIFpicker %}
|
||||||
{% if v %}
|
|
||||||
{% include "emoji_modal.html" %}
|
|
||||||
{% include "gif_modal.html" %}
|
|
||||||
{% endif %}
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
16
push.sh
16
push.sh
|
@ -5,14 +5,14 @@ git push
|
||||||
|
|
||||||
npm install -g sass
|
npm install -g sass
|
||||||
apt install ruby-sass
|
apt install ruby-sass
|
||||||
sass ./files/assets/style/transparent.scss ./files/assets/style/transparent_ff66ac.css
|
sass ./files/assets/css/transparent.scss ./files/assets/css/transparent_ff66ac.css
|
||||||
sass ./files/assets/style/win98.scss ./files/assets/style/win98_ff66ac.css
|
sass ./files/assets/css/win98.scss ./files/assets/css/win98_ff66ac.css
|
||||||
sass ./files/assets/style/midnight.scss ./files/assets/style/midnight_ff66ac.css
|
sass ./files/assets/css/midnight.scss ./files/assets/css/midnight_ff66ac.css
|
||||||
sass ./files/assets/style/dark.scss ./files/assets/style/dark_ff66ac.css
|
sass ./files/assets/css/dark.scss ./files/assets/css/dark_ff66ac.css
|
||||||
sass ./files/assets/style/light.scss ./files/assets/style/light_ff66ac.css
|
sass ./files/assets/css/light.scss ./files/assets/css/light_ff66ac.css
|
||||||
sass ./files/assets/style/coffee.scss ./files/assets/style/coffee_ff66ac.css
|
sass ./files/assets/css/coffee.scss ./files/assets/css/coffee_ff66ac.css
|
||||||
sass ./files/assets/style/tron.scss ./files/assets/style/tron_ff66ac.css
|
sass ./files/assets/css/tron.scss ./files/assets/css/tron_ff66ac.css
|
||||||
sass ./files/assets/style/4chan.scss ./files/assets/style/4chan_ff66ac.css
|
sass ./files/assets/css/4chan.scss ./files/assets/css/4chan_ff66ac.css
|
||||||
python ./compilecss.py
|
python ./compilecss.py
|
||||||
python3 ./compilecss.py
|
python3 ./compilecss.py
|
||||||
git add .
|
git add .
|
||||||
|
|
Loading…
Reference in New Issue