rDrama/ruqqus/templates/default.html

548 lines
16 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<script>
// Voting
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_toast("/api/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_toast("/api/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()
function vote_comment(comment_id, direction) {
url="/api/vote/comment/"+ comment_id +"/"+direction;
callback=function(){
thing = document.getElementById("comment-"+ comment_id+"-actions");
uparrow1=document.getElementById("comment-"+ comment_id +"-up");
downarrow1=document.getElementById("comment-"+ comment_id +"-down");
scoreup1=document.getElementById("comment-"+ comment_id +"-score-up");
scorenone1=document.getElementById("comment-"+ comment_id +"-score-none");
scoredown1=document.getElementById("comment-"+ comment_id +"-score-down");
if (direction=="1") {
thing.classList.add("upvoted");
thing.classList.remove("downvoted");
uparrow1.onclick=function(){vote_comment(comment_id, 0)};
downarrow1.onclick=function(){vote_comment(comment_id, -1)};
scoreup1.classList.remove("d-none");
scorenone1.classList.add("d-none");
scoredown1.classList.add("d-none");
}
else if (direction=="-1"){
thing.classList.remove("upvoted");
thing.classList.add("downvoted");
uparrow1.onclick=function(){vote_comment(comment_id, 1)};
downarrow1.onclick=function(){vote_comment(comment_id, 0)};
scoreup1.classList.add("d-none");
scorenone1.classList.add("d-none");
scoredown1.classList.remove("d-none");
}
else if (direction=="0"){
thing.classList.remove("upvoted");
thing.classList.remove("downvoted");
uparrow1.onclick=function(){vote_comment(comment_id, 1)};
downarrow1.onclick=function(){vote_comment(comment_id, -1)};
scoreup1.classList.add("d-none");
scorenone1.classList.remove("d-none");
scoredown1.classList.add("d-none");
}
}
post(url, callback, "Unable to vote at this time. Please try again later.");
}
</script>
{% if v %}
<script src="https://js.pusher.com/beams/1.0/push-notifications-cdn.js"></script>
<script>
const beamsClient = new PusherPushNotifications.Client({
instanceId: '02ddcc80-b8db-42be-9022-44c546b4dce6',
});
beamsClient
.start()
.then((beamsClient) => beamsClient.getDeviceId())
.then(() => beamsClient.addDeviceInterest(v.strid))
.then(() => beamsClient.getDeviceInterests())
.catch(console.error);
</script>
{% endif %}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="thumbnail" content="/assets/images/preview.png">
<link rel="icon" type="image/png" href="/assets/images/favicon.png">
{% block title %}
<title>Drama</title>
<meta property="og:type" content="article" />
<meta property="og:title" content="Drama" />
<meta property="og:site_name" content="rdrama.net" />
<meta property="og:image" content="{{'/assets/images/preview.png' | full_link}}" />
<meta property="og:url" content="{{request.path | full_link}}">
<meta property="og:description" name="description" content="Dude bussy lmao">
<meta property="og:author" name="author" content="@ruqqus" />
<meta property="og:site_name" content="rdrama.net" />
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:site" content="@ruqqus">
<meta name="twitter:title" content="Drama" />
<meta name="twitter:creator" content="@ruqqus">
<meta name="twitter:description" content="Dude bussy lmao" />
<meta name="twitter:image" content="/assets/images/preview.png" />
<meta name="twitter:url" content="{{request.path | full_link}}" />
{% endblock %}
<!-- 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">
<!-- iOS webapp -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-touch-fullscreen" content="yes">
<meta name="format-detection" content="telephone=no">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
<link rel="apple-touch-icon" sizes="180x180" href="/assets/images/favicon.png">
<!---<link rel="icon" type="image/png" sizes="32x32" href="/assets/images/favicon.png">
<link rel="icon" type="image/png" sizes="16x16" href="/assets/images/favicon.png">--->
<link rel="manifest" href="/assets/manifest.json">
<link rel="mask-icon" href="/assets/images/favicon.png" color="#FF66AC">
<link rel="shortcut icon" href="/assets/images/favicon.png">
<meta name="apple-mobile-web-app-title" content="Drama">
<meta name="application-name" content="Drama">
<meta name="msapplication-TileColor" content="#FF66AC">
<meta name="msapplication-config" content="/assets/images/browserconfig.xml">
<meta name="theme-color" content="#FF66AC">
<link
rel="apple-touch-startup-image"
sizes="320x480"
href="/assets/images/favicon.png"
/>
<link
rel="apple-touch-startup-image"
sizes="640x960"
href="/assets/images/favicon.png"
/>
<link
rel="apple-touch-icon"
sizes="640x1136"
href="/assets/images/favicon.png"
/>
<link
rel="apple-touch-icon"
sizes="750x1334"
href="/assets/images/favicon.png"
/>
<link
rel="apple-touch-startup-image"
sizes="768x1004"
href="/assets/images/favicon.png"
/>
<link
rel="apple-touch-startup-image"
sizes="768x1024"
href="/assets/images/favicon.png"
/>
<link
rel="apple-touch-startup-image"
sizes="828x1792"
href="/assets/images/favicon.png"
/>
<link
rel="apple-touch-startup-image"
sizes="1024x748"
href="/assets/images/favicon.png"
/>
<link
rel="apple-touch-startup-image"
sizes="1024x768"
href="/assets/images/favicon.png"
/>
<link
rel="apple-touch-startup-image"
sizes="1125x2436"
href="/assets/images/favicon.png"
/>
<link
rel="apple-touch-startup-image"
sizes="1242x2208"
href="/assets/images/favicon.png"
/>
<link
rel="apple-touch-startup-image"
sizes="1242x2688"
href="/assets/images/favicon.png"
/>
<link
rel="apple-touch-startup-image"
sizes="1334x750"
href="/assets/images/favicon.png"
/>
<link
rel="apple-touch-startup-image"
sizes="1536x2008"
href="/assets/images/favicon.png"
/>
<link
rel="apple-touch-startup-image"
sizes="1536x2048"
href="/assets/images/favicon.png"
/>
<link
rel="apple-touch-startup-image"
sizes="1668x2224"
href="/assets/images/favicon.png"
/>
<link
rel="apple-touch-startup-image"
sizes="1792x828"
href="/assets/images/favicon.png"
/>
<link
rel="apple-touch-startup-image"
sizes="2048x1496"
href="/assets/images/favicon.png"
/>
<link
rel="apple-touch-startup-image"
sizes="2048x1536"
href="/assets/images/favicon.png"
/>
<link
rel="apple-touch-startup-image"
sizes="2048x2732"
href="/assets/images/favicon.png"
/>
<link
rel="apple-touch-startup-image"
sizes="2208x1242"
href="/assets/images/favicon.png"
/>
<link
rel="apple-touch-startup-image"
sizes="2224x1668"
href="/assets/images/favicon.png"
/>
<link
rel="apple-touch-startup-image"
sizes="2436x1125"
href="/assets/images/favicon.png"
/>
<link
rel="apple-touch-startup-image"
sizes="2668x1242"
href="/assets/images/favicon.png"
/>
<link
rel="apple-touch-startup-image"
sizes="2737x2048"
href="/assets/images/favicon.png"
/>
<!-- Drama CSS -->
{% block stylesheets %}
{% if v %}
<link rel="stylesheet" href="/assets/style/{{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 %}
{% else %}
<link rel="stylesheet" href="/assets/style/dark_ff66ac.css">
{% endif %}
{% endblock %}
<!-- Font Awesome -->
<link href="/assets/style/fa.css" rel="stylesheet"> <!--load all styles -->
{% block fixedMobileBarJS %}
{% endblock %}
{% if v %}
<script>
function formkey() {
return '{{v.formkey}}';
}
</script>
{% endif %}
</head>
<body id="{% if request.path != '/comments' %}{% block pagetype %}frontpage{% endblock %}{% endif %}" style="overflow-x: hidden;">
<a href="https://secure.actblue.com/donate/ms_blm_homepage_2019"><img src="/assets/images/blm.png" width="100%"></a>
{% include "header.html" %}
<!-- Page Content -->
{% block mobileUserBanner %}
{% endblock %}
{% block mobileBanner %}
{% endblock %}
{% block postNav %}
{% endblock %}
<div class="container">
<div class="row justify-content-around" id="main-content-row">
{% block leftSidebar %}
{% block leftSidebarBlock %}
{% endblock %}
{% endblock %}
<div class="col h-100 {% block customPadding %}{% if not '/message' in request.path %}custom-gutters{% endif %}{% endblock %}" id="main-content-col">
{% block desktopUserBanner %}
{% endblock %}
{% block desktopBanner %}
{% endblock %}
{% block PseudoSubmitForm %}
{% endblock %}
{% block searchText %}
{% endblock %}
{% block content %}
{% endblock %}
{% block pagenav %}
{% endblock %}
</div>
</div>
</div>
{% block mobilenavbar %}
{% include "mobile_navigation_bar.html" %}
{% endblock %}
{% block actionsModal %}
{% endblock %}
{% block reportCommentModal %}
{% endblock %}
{% block guildModal %}
{% endblock %}
{% block GIFtoast %}
{% endblock %}
{% block GIFpicker %}
{% endblock %}
<!-- Clipboard Toast -->
<div class="toast clipboard" id="toast-success" role="alert" aria-live="assertive" aria-atomic="true" data-animation="true" data-autohide="true" data-delay="5000">
<div class="toast-body text-center">
<i class="fas fa-check-circle text-success mr-2"></i>Link copied to clipboard
</div>
</div>
<div class="toast clipboard" id="toast-error" role="alert" aria-live="assertive" aria-atomic="true" data-animation="true" data-autohide="true" data-delay="5000">
<div class="toast-body text-center">
<i class="fas fa-exclamation-circle text-danger mr-2"></i>Unable to copy link
</div>
</div>
<div class="toast" id="toast-post-success" style="position: fixed; bottom: 1.5rem; margin: 0 auto; left: 0; right: 0; width: 275px; z-index: 1000" role="alert" aria-live="assertive" aria-atomic="true" data-animation="true" data-autohide="true" data-delay="5000">
<div class="toast-body bg-success text-center text-white">
<i class="fas fa-comment-alt-smile mr-2"></i><span id="toast-post-success-text"></span>
</div>
</div>
<div class="toast" id="toast-post-error" style="position: fixed; bottom: 1.5rem; margin: 0 auto; left: 0; right: 0; width: 275px; z-index: 1000" role="alert" aria-live="assertive" aria-atomic="true" data-animation="true" data-autohide="true" data-delay="5000">
<div class="toast-body bg-danger text-center text-white">
<i class="fas fa-exclamation-circle mr-2"></i><span id="toast-post-error-text"></span>
</div>
</div>
{% if v %}
{% include "flag_post_modal.html" %}
{% include "flag_comment_modal.html" %}
{% include "gif_modal.html" %}
{% include "delete_comment_modal.html" %}
{% include "delete_post_modal.html" %}
{% endif %}
{% include "expanded_image_modal.html" %}
{% include "bootstrap.html" %}
<script src="/assets/js/all_js.js"></script>
<!-- ClipboardJS -->
<script src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js"></script>
<!-- Instantiate clipboard by passing a string selector -->
<script type="text/javascript">
var clipboard = new ClipboardJS('.copy-link');
clipboard.on('success', function(e) {
jQuery(function($) {
$('#toast-success').toast('show');
})
console.log(e);
});
clipboard.on('error', function(e) {
jQuery(function($) {
$('#toast-error').toast('show');
})
console.log(e);
});
</script>
<!-- Mobile "install the app" tooltip -->
{% if request.path=='/' and g.system and g.timestamp>session.get('tooltip_last_dismissed',0)+60*60*24 and (not g.system.endswith('/chrome') and not g.system.endswith('/other')) and not g.system.endswith('/webview') %}
<div id="mobile-prompt-container" class="fixed-bottom">
<div id="mobile-prompt" href="javascript:void(0)" data-toggle="tooltip" data-container="#mobile-prompt-container" data-placement="top" data-trigger="click" title="Install the Drama webapp by saving this page to your home screen!"></div>
</div>
{% endif %}
</body>
</html>