Merge branch 'frost' of https://github.com/Aevann1/Drama into frost
This commit is contained in:
commit
123cc81604
12 changed files with 234 additions and 32 deletions
|
@ -4799,6 +4799,9 @@ blockquote p {
|
|||
.text-warning {
|
||||
color: #facc15;
|
||||
}
|
||||
.text-yellow {
|
||||
color: #facc15;
|
||||
}
|
||||
.text-danger {
|
||||
color: #dc2626;
|
||||
}
|
||||
|
@ -4820,3 +4823,25 @@ blockquote p {
|
|||
.text-black-50 {
|
||||
color: #57534e;
|
||||
}
|
||||
|
||||
.text-rainbow:hover {
|
||||
-webkit-animation: zomg 0.5s infinite;
|
||||
animation: zomg 0.5s infinite;
|
||||
}
|
||||
|
||||
@-webkit-keyframes zomg {
|
||||
0%, 100% { color: #7ccdea; }
|
||||
16% { color: #0074d9; }
|
||||
32% { color: #2ecc40; }
|
||||
48% { color: #ffdc00; }
|
||||
64% { color: #b10dc9; }
|
||||
80% { color: #ff4136; }
|
||||
}
|
||||
@keyframes zomg {
|
||||
0%, 100% { color: #7ccdea; }
|
||||
16% { color: #0074d9; }
|
||||
32% { color: #2ecc40; }
|
||||
48% { color: #ffdc00; }
|
||||
64% { color: #b10dc9; }
|
||||
80% { color: #ff4136; }
|
||||
}
|
||||
|
|
|
@ -34,3 +34,27 @@ function bet_vote(cid) {
|
|||
post('/bet/' + cid);
|
||||
document.getElementById("user-coins-amount").innerText = parseInt(document.getElementById("user-coins-amount").innerText) - 200;
|
||||
}
|
||||
|
||||
function checkboxSticky(el, id) {
|
||||
if (el.checked) {
|
||||
postToast(`/sticky/${id}`)
|
||||
} else {
|
||||
postToast(`/unsticky/${id}`)
|
||||
}
|
||||
}
|
||||
|
||||
function checkboxClub(el, id) {
|
||||
if (el.checked) {
|
||||
postToast(`/toggle_club/${id}`)
|
||||
} else {
|
||||
postToast(`/toggle_club/${id}`)
|
||||
}
|
||||
}
|
||||
|
||||
function checkboxNSFW(el, id) {
|
||||
if (el.checked) {
|
||||
postToast(`/toggle_post_nsfw/${id}`)
|
||||
} else {
|
||||
postToast(`/toggle_post_nsfw/${id}`)
|
||||
}
|
||||
}
|
|
@ -76,3 +76,48 @@ document.getElementById('file-upload').addEventListener('change', function(){
|
|||
checkForRequired();
|
||||
}
|
||||
})
|
||||
|
||||
// Set local storage
|
||||
const storage = window.localStorage;
|
||||
|
||||
// Get the input box
|
||||
let bodyInput = document.getElementById('post-text');
|
||||
|
||||
// Init a timeout variable to be used below
|
||||
let timeout = null;
|
||||
|
||||
// Draft helpter text
|
||||
const helper = document.getElementById('draft-text');
|
||||
|
||||
window.onload = function() {
|
||||
// Get the input box
|
||||
const input = document.getElementById('post-text');
|
||||
// If storage contains post draft
|
||||
// set the input to draft and show helper text
|
||||
if (storage.getItem('bodyText') !== null) {
|
||||
input.value = JSON.parse(storage.getItem('bodyText'));
|
||||
helper.innerText = 'Draft loaded from storage';
|
||||
}
|
||||
}
|
||||
|
||||
// Listen for keystroke events
|
||||
bodyInput.addEventListener('keyup', function (e) {
|
||||
// Clear the timeout if it has already been set.
|
||||
// This will prevent the previous task from executing
|
||||
// if it has been less than <MILLISECONDS>
|
||||
clearTimeout(timeout);
|
||||
// Make a new timeout set to go off in 1000ms (1 second)
|
||||
timeout = setTimeout(function () {
|
||||
storage.setItem('bodyText', JSON.stringify(bodyInput.value));
|
||||
helper.innerText = 'Draft saved';
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
// Clear local storage on form submit, use "bind()" method to pass key paramater to specifcy with storage to clear
|
||||
document.getElementById('submitform').addEventListener('submit', emptyStorage.bind(event, 'bodyText'));
|
||||
|
||||
// Clear local storage by key name
|
||||
function emptyStorage(key) {
|
||||
// Specify data and clear it
|
||||
window.localStorage.removeItem(key);
|
||||
}
|
34
files/static/dist/main.css
vendored
34
files/static/dist/main.css
vendored
|
@ -1122,6 +1122,9 @@ video {
|
|||
.h-16 {
|
||||
height: 4rem;
|
||||
}
|
||||
.h-6 {
|
||||
height: 1.5rem;
|
||||
}
|
||||
.h-14 {
|
||||
height: 3.5rem;
|
||||
}
|
||||
|
@ -1131,9 +1134,6 @@ video {
|
|||
.h-10 {
|
||||
height: 2.5rem;
|
||||
}
|
||||
.h-6 {
|
||||
height: 1.5rem;
|
||||
}
|
||||
.h-4 {
|
||||
height: 1rem;
|
||||
}
|
||||
|
@ -1645,6 +1645,10 @@ video {
|
|||
--tw-bg-opacity: 1;
|
||||
background-color: rgba(255, 255, 255, var(--tw-bg-opacity));
|
||||
}
|
||||
.bg-gray-900 {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgba(var(--color-900), var(--tw-bg-opacity));
|
||||
}
|
||||
.bg-gray-200 {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgba(var(--color-200), var(--tw-bg-opacity));
|
||||
|
@ -1668,10 +1672,6 @@ video {
|
|||
--tw-bg-opacity: 1;
|
||||
background-color: rgba(var(--color-800), var(--tw-bg-opacity));
|
||||
}
|
||||
.bg-gray-900 {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgba(var(--color-900), var(--tw-bg-opacity));
|
||||
}
|
||||
.bg-black\/20 {
|
||||
background-color: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
@ -2233,8 +2233,8 @@ video {
|
|||
.pb-2 {
|
||||
padding-bottom: 0.5rem;
|
||||
}
|
||||
.pt-16 {
|
||||
padding-top: 4rem;
|
||||
.pt-20 {
|
||||
padding-top: 5rem;
|
||||
}
|
||||
.pr-7 {
|
||||
padding-right: 1.75rem;
|
||||
|
@ -2357,6 +2357,10 @@ video {
|
|||
--tw-text-opacity: 1;
|
||||
color: rgba(var(--color-700), var(--tw-text-opacity));
|
||||
}
|
||||
.text-gray-200 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgba(var(--color-200), var(--tw-text-opacity));
|
||||
}
|
||||
.text-red-600 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgba(220, 38, 38, var(--tw-text-opacity));
|
||||
|
@ -2365,10 +2369,6 @@ video {
|
|||
--tw-text-opacity: 1;
|
||||
color: rgba(21, 128, 61, var(--tw-text-opacity));
|
||||
}
|
||||
.text-gray-200 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgba(var(--color-200), var(--tw-text-opacity));
|
||||
}
|
||||
.text-gray-100 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgba(var(--color-100), var(--tw-text-opacity));
|
||||
|
@ -2417,6 +2417,10 @@ video {
|
|||
--tw-text-opacity: 1;
|
||||
color: rgba(217, 119, 6, var(--tw-text-opacity));
|
||||
}
|
||||
.text-green-400 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgba(74, 222, 128, var(--tw-text-opacity));
|
||||
}
|
||||
.text-green-500 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgba(34, 197, 94, var(--tw-text-opacity));
|
||||
|
@ -2441,10 +2445,6 @@ video {
|
|||
--tw-text-opacity: 1;
|
||||
color: rgba(254, 202, 202, var(--tw-text-opacity));
|
||||
}
|
||||
.text-green-400 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgba(74, 222, 128, var(--tw-text-opacity));
|
||||
}
|
||||
.text-\[\#dc2626\] {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgba(220, 38, 38, var(--tw-text-opacity));
|
||||
|
|
18
files/templates/CHRISTMAS/banner.html
Normal file
18
files/templates/CHRISTMAS/banner.html
Normal file
|
@ -0,0 +1,18 @@
|
|||
<!-- Banner -->
|
||||
{% if v %}
|
||||
<div class="flex items-center justify-center h-6 bg-gray-900 w-full">
|
||||
<span class="text-rainbow text-xs text-gray-200">
|
||||
💖🌈 rdrama.net stands with the LGBTQ+ community.
|
||||
<span class="font-medium hidden md:inline-block">Help keep our community inclusive and welcoming. </span>
|
||||
<strong><a href="https://secure.transequality.org/site/Donation2?df_id=1480">Learn more!</a></strong>
|
||||
</span>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="flex items-center justify-center h-6 bg-primary w-full">
|
||||
<span class="text-rainbow text-xs text-gray-200">
|
||||
✋😕 You are viewing a cached version of rdrama.net
|
||||
<span class="font-medium hidden md:inline-block">Join the community to see the latest content. </span>
|
||||
<strong><a href="/login">Login!</a></strong>
|
||||
</span>
|
||||
</div>
|
||||
{% endif %}
|
|
@ -192,7 +192,7 @@
|
|||
|
||||
{% block stylesheets %}
|
||||
|
||||
<link rel="stylesheet" href="/assets/CHRISTMAS/css/main.css?a=5">
|
||||
<link rel="stylesheet" href="/assets/CHRISTMAS/css/main.css?a=7">
|
||||
|
||||
<link rel="stylesheet" href="/static/dist/main.css?a=6">
|
||||
|
||||
|
@ -237,7 +237,7 @@
|
|||
{% block postNav %}
|
||||
{% endblock %}
|
||||
|
||||
<div class="flex h-full pt-16 bg-gray-500 dark:bg-gray-700 dark:text-gray-200">
|
||||
<div class="flex h-full pt-20 bg-gray-500 dark:bg-gray-700 dark:text-gray-200">
|
||||
<div class="w-full">
|
||||
|
||||
{% block desktopUserBanner %}
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
<!-- This example requires Tailwind CSS v2.0+ -->
|
||||
<nav class="fixed top-0 w-full bg-gray-700" style="z-index: 1030;">
|
||||
<!-- Banner -->
|
||||
{% include "CHRISTMAS/banner.html" %}
|
||||
<!-- Navigation bar -->
|
||||
<div class="w-full max-w-screen-2xl mx-auto grid grid-cols-12 px-4">
|
||||
<div class="relative col-span-full flex items-center justify-between h-16 px-4">
|
||||
<div class="relative col-span-full flex items-center justify-between h-14 px-4">
|
||||
{% if not error %}
|
||||
<div class="absolute inset-y-0 left-0 flex items-center sm:hidden">
|
||||
<!-- Mobile menu button-->
|
||||
|
@ -126,7 +129,7 @@
|
|||
|
||||
<!-- Mobile menu, show/hide based on menu state. -->
|
||||
<div class="offcanvas offcanvas-start bg-gray-200" tabindex="-1" id="offcanvasNavbar" aria-labelledby="offcanvasNavbarLabel">
|
||||
<div class="relative flex w-full bg-gray-700 h-16 px-4 items-center">
|
||||
<div class="relative flex w-full bg-gray-700 h-20 px-4 items-center">
|
||||
<a class="flex items-center" href="{{ '/' if v else '/logged_out'}}">
|
||||
<img class="block lg:hidden h-6 w-6 object-contain" src="/static/assets/images/Drama/headericon.webp?a=7" alt="logo">
|
||||
<img class="hidden lg:block h-6 w-6 object-contain" src="/static/assets/images/Drama/headericon.webp?a=7" alt="logo">
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
{% block stylesheets %}
|
||||
|
||||
<link rel="stylesheet" href="/assets/CHRISTMAS/css/main.css?a=5">
|
||||
<link rel="stylesheet" href="/assets/CHRISTMAS/css/main.css?a=7">
|
||||
|
||||
<link rel="stylesheet" href="/static/dist/main.css?a=6">
|
||||
|
||||
|
@ -65,7 +65,7 @@
|
|||
|
||||
{% include "CHRISTMAS/header-tw.html" %}
|
||||
|
||||
<div class="flex h-full pt-16 bg-gray-500 dark:bg-gray-700 dark:text-gray-200">
|
||||
<div class="flex h-full pt-20 bg-gray-500 dark:bg-gray-700 dark:text-gray-200">
|
||||
<div class="w-full">
|
||||
|
||||
<div class="md:px-4 bg-gray-700" id="sub-header-row">
|
||||
|
|
|
@ -135,4 +135,91 @@
|
|||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
{% if v and v.admin_level > 1 %}
|
||||
<hr class="mt-6 mb-5 h-0.5 border-b border-gray-300 dark:border-gray-900 shadow-inset-t-white-05"/>
|
||||
<div class="relative my-4 px-4 py-3 rounded-md border border-yellow-400 dark:border-gray-700 bg-yellow-100 dark:bg-gray-700/40">
|
||||
<span class="absolute top-2 right-3 text-base">
|
||||
<i class="fas fa-crown fa-sm text-yellow-400 dark:text-gray-300" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="Visible only to moderators"></i>
|
||||
</span>
|
||||
<h2 class="ml-2 font-bold text-lg font-heading leading-normal mb-2">
|
||||
Manage Post
|
||||
</h2>
|
||||
<ul class="flex flex-col mt-3 mb-0 space-y-6">
|
||||
<li>
|
||||
<div class="label text-black dark:text-gray-200">Attributes</div>
|
||||
<ul class="flex flex-col mb-0 space-y-3">
|
||||
<li class="flex space-x-2">
|
||||
<input type="checkbox" value="verify" class="w-5 h-5" onchange="checkboxSticky(this,'{{p.id}}')" {% if p.stickied %}checked{% endif %}>
|
||||
<div>
|
||||
<label class="label mb-0" for="verify">Pinned</label>
|
||||
<small class="block text-gray-600 dark:text-gray-400">
|
||||
Pin this thread to the top of the frontpage
|
||||
</small>
|
||||
</div>
|
||||
</li>
|
||||
<li class="flex space-x-2">
|
||||
<input type="checkbox" value="club" class="w-5 h-5" onchange="checkboxClub(this,'{{p.id}}')" {% if p.club %}checked{% endif %}>
|
||||
<div>
|
||||
<label class="label mb-0" for="club">Country Club</label>
|
||||
<small class="block text-gray-600 dark:text-gray-400">
|
||||
Require Country Club membership to view this thread
|
||||
</small>
|
||||
</div>
|
||||
</li>
|
||||
<li class="flex space-x-2">
|
||||
<input type="checkbox" value="club" class="w-5 h-5" onchange="checkboxNSFW(this,'{{p.id}}')" {% if p.over_18 %}checked{% endif %}>
|
||||
<div>
|
||||
<label class="label mb-0" for="club">18+</label>
|
||||
<small class="block text-gray-600 dark:text-gray-400">
|
||||
Mark this thread as 18+
|
||||
</small>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{% if v.id != p.author_id %}
|
||||
<div class="relative my-4 px-4 py-3 rounded-md border border-red-300 dark:border-gray-700 bg-red-100 dark:bg-gray-700/40 group">
|
||||
<span class="absolute top-2 right-3 text-base">
|
||||
<i class="fas fa-exclamation-triangle fa-sm text-red-400 dark:text-gray-300 group-hover:animate-pulse" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="Visible only to moderators. Recommend internal mod discussion before making changes here."></i>
|
||||
</span>
|
||||
<h2 class="ml-2 font-bold text-lg font-heading leading-normal mb-2">
|
||||
Danger Zone
|
||||
</h2>
|
||||
<ul class="flex flex-col mt-3 mb-0 space-y-6">
|
||||
<li>
|
||||
<div class="label text-black dark:text-gray-200">Post visibility</div>
|
||||
<div id="sidebar-remove-{{p.id}}" class="{% if p.is_banned %}hidden{% endif %}">
|
||||
<button class="btn btn-red w-full" onclick="post_toast2('/ban_post/{{p.id}}','sidebar-remove-{{p.id}}','sidebar-approve-{{p.id}}')">
|
||||
<i class="fas fa-ban fa-sm fa-fw mr-2"></i>
|
||||
Remove post
|
||||
</button>
|
||||
</div>
|
||||
<div id="sidebar-approve-{{p.id}}" class="{% if not p.is_banned %}hidden{% endif %}">
|
||||
<button class="btn btn-green w-full" onclick="post_toast2('/unban_post/{{p.id}}','sidebar-remove-{{p.id}}','sidebar-approve-{{p.id}}')">
|
||||
<i class="fas fa-check fa-sm fa-fw mr-2"></i>
|
||||
Approve post
|
||||
</button>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="label text-black dark:text-gray-200">Manage author</div>
|
||||
<div id="sidebar-ban-{{p.id}}" class="{% if p.author.is_suspended %}hidden{% endif %} text-red-600">
|
||||
<button class="btn btn-red w-full" data-bs-toggle="modal" data-bs-target="#banModal" onclick="banModal('/post/{{p.id}}', '{{ p.author.id }}', '{{p.author.username}}')">
|
||||
<i class="fas fa-user-slash fa-sm fa-fw mr-2"></i>
|
||||
Ban user
|
||||
</button>
|
||||
</div>
|
||||
<div id="sidebar-unban-{{p.id}}" class="{% if not p.author.is_suspended %}hidden{% endif %}">
|
||||
<button class="btn btn-green w-full" onclick="post_toast2('/unban_user/{{p.author_id}}','sidebar-ban-{{p.id}}','sidebar-unban-{{p.id}}')">
|
||||
<i class="fas fa-user-check fa-sm fa-fw mr-2"></i>
|
||||
Unban user
|
||||
</button>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
|
@ -712,10 +712,7 @@
|
|||
|
||||
{% if v %}
|
||||
<script defer src="/assets/CHRISTMAS/js/vote.js?a=1"></script>
|
||||
{% endif %}
|
||||
|
||||
{% if v and (v.id == p.author_id or v.admin_level > 1 and v.admin_level > 2) %}
|
||||
<script src="/assets/CHRISTMAS/js/submission.js?a=1"></script>
|
||||
<script src="/assets/CHRISTMAS/js/submission.js?a=2"></script>
|
||||
{% endif %}
|
||||
|
||||
{% if not v or v.highlightcomments %}
|
||||
|
|
|
@ -156,12 +156,12 @@
|
|||
<hr class="mt-2 mb-1.5 border-t border-black h-1 shadow-inset-t-white-05"/>
|
||||
</li>
|
||||
<li id="club-{{p.id}}" class="{% if p.club %}hidden{% endif %}">
|
||||
<button class="dropdown-item dropdown-item-primary" onclick="post_toast2('/toggle_club/{{p.id}}','club-{{p.id}}','unclub-{{p.id}}')">
|
||||
<button class="dropdown-item block w-full text-left px-4 py-2 text-sm text-red-600 hover:text-white bg-gradient-to-t hover:from-red-800 hover:to-red-700 hover:shadow-inner focus:shadow-inner focus:bg-gradient-to-t focus:from-red-800 focus:to-red-700" onclick="post_toast2('/toggle_club/{{p.id}}','club-{{p.id}}','unclub-{{p.id}}')">
|
||||
<i class="fas fa-eye-slash fa-sm fa-fw mr-4"></i>Mark club
|
||||
</button>
|
||||
</li>
|
||||
<li id="unclub-{{p.id}}" class="{% if not p.club %}hidden{% endif %}">
|
||||
<button class="dropdown-item dropdown-item-primary" onclick="post_toast2('/toggle_club/{{p.id}}','club-{{p.id}}','unclub-{{p.id}}')"><i class="fas fa-eye fa-sm fa-fw mr-4"></i>Unmark club
|
||||
<button class="dropdown-item block w-full text-left px-4 py-2 text-sm text-red-600 hover:text-white bg-gradient-to-t hover:from-red-800 hover:to-red-700 hover:shadow-inner focus:shadow-inner focus:bg-gradient-to-t focus:from-red-800 focus:to-red-700" onclick="post_toast2('/toggle_club/{{p.id}}','club-{{p.id}}','unclub-{{p.id}}')"><i class="fas fa-eye fa-sm fa-fw mr-4"></i>Unmark club
|
||||
</button>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
|
|
@ -130,7 +130,10 @@
|
|||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
<span class="absolute right-3 bottom-3 z-10 text-xs font-medium text-gray-500" id="character-count-submit-text-form"></span>
|
||||
<span class="absolute right-3 bottom-3 z-10 text-xs font-medium text-gray-400 flex space-x-3">
|
||||
<span id="character-count-submit-text-form"></span>
|
||||
<span id="draft-text" data-bs-toggle="tooltip" data-bs-delay="500" data-bs-placement="top" title="" data-bs-original-title="Draft saved to browser storage" class="text-green-400"></span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="nav-preview" role="tabpanel" aria-labelledby="nav-preview-tab">
|
||||
|
@ -178,5 +181,5 @@
|
|||
|
||||
{% block scripts %}
|
||||
<script defer src="/assets/CHRISTMAS/js/marked.js?a=1"></script>
|
||||
<script defer src="/assets/CHRISTMAS/js/submit.js?a=1"></script>
|
||||
<script defer src="/assets/CHRISTMAS/js/submit.js?a=4"></script>
|
||||
{% endblock %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue