diff --git a/chat/src/App.tsx b/chat/src/App.tsx index 513304e29..96e9c2844 100644 --- a/chat/src/App.tsx +++ b/chat/src/App.tsx @@ -1,3 +1,5 @@ +(window as any).global = window; + import cx from "classnames"; import throttle from "lodash.throttle"; import React, { useCallback, useEffect, useRef, useState } from "react"; diff --git a/files/assets/css/30409f.css b/files/assets/css/30409f.css new file mode 100644 index 000000000..7d49cd7f7 --- /dev/null +++ b/files/assets/css/30409f.css @@ -0,0 +1,3 @@ +p a { + color: #2a96f3; +} diff --git a/files/assets/css/agendaposter.css b/files/assets/css/agendaposter.css new file mode 100644 index 000000000..9ffee1cef --- /dev/null +++ b/files/assets/css/agendaposter.css @@ -0,0 +1,3 @@ +html { + cursor:url('/i/dildo.webp?v=2000'), auto; +} diff --git a/files/assets/css/awards.css b/files/assets/css/awards.css index 8a31512c4..ea84e6e06 100644 --- a/files/assets/css/awards.css +++ b/files/assets/css/awards.css @@ -157,3 +157,25 @@ 51% {transform: translateX(100vw) rotate(180deg); top: 0; bottom: unset;} 100% {transform: translateX(-15vw) rotate(180deg); top: 0; bottom: unset;} } + +@keyframes tilt { + 0% {transform: rotate(0deg);} + 25% {transform: rotate({{p.award_count("tilt", v)}}deg);} + 75% {transform: rotate(-{{p.award_count("tilt", v)}}deg);} + 100% {transform: rotate(0deg);} +} +@media (max-width: 720px) { + @keyframes tilt { + 0% {transform: rotate(0deg);} + 25% {transform: rotate({{p.award_count("tilt", v)/4}}deg);} + 75% {transform: rotate(-{{p.award_count("tilt", v)/4}}deg);} + 100% {transform: rotate(0deg);} + } +} +.tilt { + animation-name: tilt; + animation-duration: 60s !important; + animation-iteration-count: infinite !important; + animation-direction: alternate !important; + animation-timing-function: linear !important; +} diff --git a/files/assets/css/casino/blackjack_screen.css b/files/assets/css/casino/blackjack_screen.css new file mode 100644 index 000000000..3c125278e --- /dev/null +++ b/files/assets/css/casino/blackjack_screen.css @@ -0,0 +1,56 @@ +.blackjack-cardset { + position: relative; + display: flex; + align-items: center; + margin-bottom: 1rem; + max-width: 470px; + overflow: auto; + box-shadow: 1px 1px 5px 1px rgba(60, 60, 60, 0.81) inset; + -webkit-box-shadow: 1px 1px 5px 1px rgba(60, 60, 60, 0.81) inset; + -moz-box-shadow: 1px 1px 5px 1px rgba(60, 60, 60, 0.81) inset; +} + +.blackjack-cardset__PLAYING { + background-image: radial-gradient(circle farthest-corner at 10% 20%, rgba(14, 174, 87, 1) 0%, rgba(12, 116, 117, 1) 90%); +} + +.blackjack-cardset__LOST { + background-image: linear-gradient(109.6deg, rgba(14, 11, 56, 1) 11.2%, rgba(239, 37, 37, 1) 91.1%); +} + +.blackjack-cardset__PUSHED { + background-image: linear-gradient(110.3deg, rgba(73, 93, 109, 1) 4.3%, rgba(49, 55, 82, 1) 96.7%); +} + +.blackjack-cardset__WON { + background-image: radial-gradient( circle farthest-corner at -0.6% 44.4%, rgba(142,252,152,1) 0%, rgba(107,214,250,1) 90% ); +} + +.blackjack-cardset__BLACKJACK { + background-image: linear-gradient(64.3deg, rgba(254, 122, 152, 0.81) 17.7%, rgba(255, 206, 134, 1) 64.7%, rgba(172, 253, 163, 0.64) 112.1%); +} + +.blackjack-cardset .playing-card { + margin-right: -3rem; + min-width: 100px; +} + +.blackjack-cardset-value { + z-index: 3; + top: 0; + right: 0; + text-transform: uppercase; + letter-spacing: 2px; + text-align: right; + position: absolute; + background-color: rgba(70, 70, 70, 0.6); + padding: 0.5rem; + color: #DDD; +} + +.twentyone-btn { + margin-right: 1rem; + margin-bottom: 1rem; + text-transform: uppercase; + letter-spacing: 2px; +} diff --git a/files/assets/css/casino/game_screen.css b/files/assets/css/casino/game_screen.css new file mode 100644 index 000000000..b802d1f80 --- /dev/null +++ b/files/assets/css/casino/game_screen.css @@ -0,0 +1,23 @@ +.game_screen-title { + display: flex; + align-items: center; + justify-content: center; + text-transform: uppercase; + opacity: 0.6; +} + +.game_screen-title hr { + flex: 1; + margin-left: 0.5rem; +} + +#casinoGameResult { + visibility: hidden; + margin-top: 1rem; +} + +#casinoGameFeedList { + max-height: 110px; + overflow: auto; + list-style-type: none; +} diff --git a/files/assets/css/casino/roulette_screen.css b/files/assets/css/casino/roulette_screen.css new file mode 100644 index 000000000..ad5a9797d --- /dev/null +++ b/files/assets/css/casino/roulette_screen.css @@ -0,0 +1,96 @@ +.roulette-table-number { + flex: 1; + height: 60px; + border: 1px solid white; + background: green; + display: flex; + align-items: center; + justify-content: center; + color: white; + font-weight: bolder; +} + +.roulette-table-number__black { + background: black; +} + +.roulette-table-number__red { + background: red; +} + +.roulette-table-number__green { + background: green; +} + +.roulette-table-row { + display: flex; + align-items: center; + justify-content: flex-start; +} + +.roulette-table-column { + flex: 1; + height: 60px; + border: 1px solid white; + background: green; + display: flex; + align-items: center; + justify-content: center; + color: white; + font-weight: bolder; + writing-mode: vertical-rl; + text-orientation: sideways; +} + +.roulette-table-line, +.roulette-table-1to1 { + border: 1px solid white; + background: green; + display: flex; + align-items: center; + justify-content: center; + color: white; + font-weight: bolder; +} + +.roulette-table-line { + flex: 4; +} + +.roulette-table-1to1 { + flex: 2; +} + +.roulette-poker-chip { + display: flex; + align-items: center; + justify-content: center; + width: 50px; + height: 50px; +} + +.roulette-bet-summary--heading { + display: flex; + align-items: center; +} + +.roulette-bet-summary--heading p { + margin: 0; + margin-left: 1rem; + font-weight: bolder; +} + +.roulette-bet-summary--list { + list-style-type: none; +} + +.roulette-poker-chip img:last-child { + position: absolute; + border-radius: 50%; +} + +.roulette-total-bets { + text-transform: uppercase; + letter-spacing: 2px; + text-align: right; +} diff --git a/files/assets/css/casino/slots_screen.css b/files/assets/css/casino/slots_screen.css new file mode 100644 index 000000000..9b24dfe3a --- /dev/null +++ b/files/assets/css/casino/slots_screen.css @@ -0,0 +1,22 @@ +.slots_reels { + display: flex; + align-items: center; + justify-content: center; +} + +.slots_reel { + display: flex; + align-items: center; + justify-content: center; + width: 100px; + height: 100px; + border: 2px solid black; + background-color: var(--gray); + border: 1px solid var(--black); + border-radius: 8px; + font-size: 64px; +} + +.slots_reel:nth-child(2) { + margin: 0 1rem; +} diff --git a/files/assets/css/err.css b/files/assets/css/err.css new file mode 100644 index 000000000..9d3503b9d --- /dev/null +++ b/files/assets/css/err.css @@ -0,0 +1,6 @@ +body {padding-top: 54px !important} +@media (max-width: 767.98px) { + body { + padding-top: 44px !important + } +} diff --git a/files/assets/css/main.css b/files/assets/css/main.css index 521acfa1c..f8c85418e 100644 --- a/files/assets/css/main.css +++ b/files/assets/css/main.css @@ -6458,3 +6458,145 @@ div.markdown { *::-webkit-scrollbar { display: none; } + +.shop-tabs { + padding-top: 50px; +} + +@media (max-width: 768px) { + #hats-banner { + width: 80%; + } + .shop-tabs { + padding-top: 30px; + } +} + +.shop-tab { + display: inline-flex; + max-width: 46.6%; + letter-spacing: 3px; + border-radius: 0; +} + +.shop-tab.active { + background-color: var(--primary) !important; + pointer-events: none !important; + cursor: default !important; +} + +body {padding-top: 83px !important} +@media (max-width: 767.98px) { + body { + padding-top: 63px !important + } +} + +.comment { + margin-top: 0.3rem; +} + +body > .container { + padding-left: 20px !important; + padding-right: 20px !important; +} + +@media (max-width: 767.98px) { + table { + display: inline-block; + overflow: auto; + } +} + +.shop-tabs { + padding-top: 50px; +} + +@media (max-width: 768px) { + #shop-banner { + width: 80%; + } + .shop-tabs { + padding-top: 30px; + } +} + +.shop-tab { + display: inline-flex; + max-width: 46.6%; + letter-spacing: 3px; + border-radius: 0; +} + +.shop-tab.active { + background-color: var(--primary) !important; + pointer-events: none !important; + cursor: default !important; +} + +.star1 circle {r: 0.5;} +.star2 circle {r: 0.75;} +.star3 circle {r: 1.0;} +.star4 circle {r: 1.2;} +.star5 circle {r: 1.5;} + +.emoji2 { + /*background: None!important;*/ + width:60px; + height: 85px; + overflow: hidden; + border: none +} +.emoji2 > img { + -o-object-fit: contain; + object-fit: contain; +} + +.bg-image { + padding: 0.25rem; + width: 15rem; + height: 10rem; + object-fit: cover; +} +.bg-button { + margin: 0.25rem; + padding: 0; +} + +.dismiss-beg { + color: #919191; + float: left; + font-size: 14px; + padding: 0.25rem 0.7rem 2rem 0.7rem; +} + +#mobile-prompt + .bs-tooltip-bottom { + transform: None !important; + inset: 0px 0px auto auto !important; +} + +.mod-rdrama:before { + content: '((('; +} +.mod-rdrama:after { + content: ')))'; +} + +#emojiTabs {height: 80%;} +@media (max-width: 650px) { + #emojiTabs {height: 100%;} + #emojiModalInternalDivIDK {margin-top: 0 !important; margin-bottom: 0 !important; padding-top: 3rem !important; padding-bottom: 0 !important;} + + #emoji-modal-tabs-container { + overflow-x: auto; + } + + #emoji-modal-tabs { + white-space: nowrap; + flex-wrap: nowrap; + } + + #emoji-modal-tabs li { + display: inline-block; + } +} diff --git a/files/assets/css/poor.css b/files/assets/css/poor.css new file mode 100644 index 000000000..a6512e088 --- /dev/null +++ b/files/assets/css/poor.css @@ -0,0 +1,3 @@ +* :not(img[src="/i/hand.webp"] + img, img.golden, img[g], img[glow], .live-circle) { + animation: unset !important; +} diff --git a/files/assets/css/smolfp.css b/files/assets/css/smolfp.css new file mode 100644 index 000000000..41365d4e5 --- /dev/null +++ b/files/assets/css/smolfp.css @@ -0,0 +1,7 @@ +@media (max-width: 427px) { + .smol-fp { + font-size: 2.7vw; + padding-left: 2.5vw; + padding-right: 2.1vw; + } +} diff --git a/files/assets/event/css/candycane.css b/files/assets/event/css/candycane.css new file mode 100644 index 000000000..0907c4a4a --- /dev/null +++ b/files/assets/event/css/candycane.css @@ -0,0 +1,22 @@ +#post-title, #post-content p { + --color2: #cc4145; + --color1: rgb(12, 128, 101); + font-family: "Open Sans", sans-serif; + background: repeating-linear-gradient( + 45deg, var(--color2), var(--color2) 10px, + var(--color1) 11px, var(--color1) 30px + ); + background-clip: text; + color: transparent; + -webkit-background-clip: text; + animation: 45s linear 0s infinite candycorn-move; +} + +#post-title a { + color: transparent !important; +} + +@keyframes candycorn-move { + from {background-position: 0px;} + to {background-position: 1000px;} +} diff --git a/files/assets/event/css/fireplace.css b/files/assets/event/css/fireplace.css new file mode 100644 index 000000000..5678b7e2c --- /dev/null +++ b/files/assets/event/css/fireplace.css @@ -0,0 +1,8 @@ +#banner-skybox { + fill: url(#skybox-gradient-night) +} + +#banner-window-1, #banner-window-2 { + filter: drop-shadow(0 0 50px orange); + fill: palegoldenrod; +} diff --git a/files/assets/event/css/frostbite.css b/files/assets/event/css/frostbite.css new file mode 100644 index 000000000..bd6e4ebca --- /dev/null +++ b/files/assets/event/css/frostbite.css @@ -0,0 +1,13 @@ +:root { + --opacity-frost: 0.25; + } + .frost { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + box-shadow: 0 0 200px 10px rgba(255, 255, 255, var(--opacity-frost)) inset; + pointer-events: none; + z-index: 1050; + } diff --git a/files/assets/event/css/lights.css b/files/assets/event/css/lights.css new file mode 100644 index 000000000..a2da98aca --- /dev/null +++ b/files/assets/event/css/lights.css @@ -0,0 +1,12 @@ +#post-root::before { + content: ""; + position: absolute; + top: 0; + left: 0; + height: 57px; + width: 100%; + background: url('/assets/event/images/lights.webp?v=1'); + animation: lights 1s infinite steps(2); + pointer-events: none; + z-index: 1; +} diff --git a/files/assets/event/css/snowed-in.css b/files/assets/event/css/snowed-in.css new file mode 100644 index 000000000..69d60d8b0 --- /dev/null +++ b/files/assets/event/css/snowed-in.css @@ -0,0 +1,16 @@ +#canvas-snowed-in-overlay { + position: fixed; + top: 0; + left: 0; + z-index: 9998; + opacity: 1; + pointer-events: none; +} +#canvas-snowed-in-lines { + position: fixed; + top: 0; + left: 0; + z-index: 9999; + opacity: 0.0; + pointer-events: none; +} diff --git a/files/assets/event/js/frostbite.js b/files/assets/event/js/frostbite.js new file mode 100644 index 000000000..31292bb34 --- /dev/null +++ b/files/assets/event/js/frostbite.js @@ -0,0 +1,4 @@ +const root = document.querySelector(':root'); +const count = 5; +const opacity = count * 0.1; +root.style.setProperty('--opacity-frost', opacity); diff --git a/files/assets/event/js/music.js b/files/assets/event/js/music.js new file mode 100644 index 000000000..4e660778f --- /dev/null +++ b/files/assets/event/js/music.js @@ -0,0 +1,8 @@ +const audio = new Audio("{{song}}"); +audio.loop=true; + +audio.play(); +window.addEventListener('click', () => { + if (audio.paused) audio.play(); +}, {once : true}); +prepare_to_pause(audio) diff --git a/files/assets/event/js/snow.js b/files/assets/event/js/snow.js index cfcf4b940..c77d08218 100644 --- a/files/assets/event/js/snow.js +++ b/files/assets/event/js/snow.js @@ -702,3 +702,5 @@ function snow(flakesMax) { return this; } + +snow(80) diff --git a/files/assets/js/admin/alts.js b/files/assets/js/admin/alts.js new file mode 100644 index 000000000..e188327fd --- /dev/null +++ b/files/assets/js/admin/alts.js @@ -0,0 +1,34 @@ +function submitAddAlt(element) { + if (!element || !element.form) return; + const isLinking = element.id == 'add-alt-form-link'; + const otherElement = isLinking ? document.getElementById('add-alt-form-delink') : document.getElementById('add-alt-form-link'); + if (!otherElement) return; + element.disabled = true; + otherElement.disabled = true; + element.classList.add('disabled'); + otherElement.classList.add('disabled'); + const form = new FormData(); + if (!isLinking) form.append('deleted', 'true'); + form.append('other_username', document.getElementById('link-input-other').value); + const xhr = createXhrWithFormKey('/@{{u.username}}/alts/', 'POST', form); + xhr[0].onload = function() { + let data; + try { + data = JSON.parse(xhr[0].response); + } + catch(e) { + console.log(e); + } + if (xhr[0].status >= 200 && xhr[0].status < 300) { + showToast(true, getMessageFromJsonData(true, data)); + window.location.reload(); + } else { + showToast(false, getMessageFromJsonData(false, data)); + element.disabled = false; + otherElement.disabled = false; + element.classList.remove('disabled'); + otherElement.classList.remove('disabled'); + } + } + xhr[0].send(xhr[1]); +} diff --git a/files/assets/js/admin/update_assets.js b/files/assets/js/admin/update_assets.js new file mode 100644 index 000000000..a75c08e8e --- /dev/null +++ b/files/assets/js/admin/update_assets.js @@ -0,0 +1,40 @@ +const IMAGE_FORMATS = document.getElementById('IMAGE_FORMATS') + +document.onpaste = function(event) { + files = structuredClone(event.clipboardData.files); + + filename = files[0] + + if (filename) + { + filename = filename.name.toLowerCase() + f=document.getElementById('file-upload'); + f.files = files; + document.getElementById('filename-show').textContent = filename; + if (IMAGE_FORMATS.some(s => filename.endsWith(s))) + { + const fileReader = new FileReader(); + fileReader.readAsDataURL(f.files[0]); + fileReader.addEventListener("load", function () { + document.getElementById('image-preview').setAttribute('src', this.result); + document.getElementById('image-preview').classList.remove('d-none'); + }); + } + } +} + +document.getElementById('file-upload').addEventListener('change', function(){ + f=document.getElementById('file-upload'); + document.getElementById('filename-show').textContent = document.getElementById('file-upload').files[0].name.substr(0, 20); + filename = f.files[0].name.toLowerCase() + if (IMAGE_FORMATS.some(s => filename.endsWith(s))) + { + const fileReader = new FileReader(); + fileReader.readAsDataURL(f.files[0]); + fileReader.addEventListener("load", function () { + document.getElementById('image-preview').setAttribute('src', this.result); + document.getElementById('image-preview').classList.remove('d-none'); + }); + document.getElementById('submit-asset').disabled = false; + } +}) diff --git a/files/assets/js/banned_domains.js b/files/assets/js/banned_domains.js new file mode 100644 index 000000000..19257897e --- /dev/null +++ b/files/assets/js/banned_domains.js @@ -0,0 +1,4 @@ +function unbanDomain(t, domain) { + postToastSwitch(t,'/admin/unban_domain/' + domain); + t.parentElement.parentElement.remove(); +} diff --git a/files/assets/js/blackjack_screen.js b/files/assets/js/casino/blackjack_screen.js similarity index 96% rename from files/assets/js/blackjack_screen.js rename to files/assets/js/casino/blackjack_screen.js index 5040d7fd4..e4c453811 100644 --- a/files/assets/js/blackjack_screen.js +++ b/files/assets/js/casino/blackjack_screen.js @@ -214,11 +214,4 @@ function initializeBlackjack() { } } -if ( - document.readyState === "complete" || - (document.readyState !== "loading" && !document.documentElement.doScroll) -) { - initializeBlackjack(); -} else { - document.addEventListener("load", initializeBlackjack); -} +initializeBlackjack(); diff --git a/files/assets/js/game_screen.js b/files/assets/js/casino/game_screen.js similarity index 96% rename from files/assets/js/game_screen.js rename to files/assets/js/casino/game_screen.js index 72d762842..ce5c63949 100644 --- a/files/assets/js/game_screen.js +++ b/files/assets/js/casino/game_screen.js @@ -5,15 +5,6 @@ * - Leaderboard */ -if ( - document.readyState === "complete" || - (document.readyState !== "loading" && !document.documentElement.doScroll) -) { - initializeGame(); -} else { - document.addEventListener("load", initializeGame); -} - function initializeGame() { updateFeed(); updateLeaderboard(); @@ -199,3 +190,5 @@ function drawFromDeck() { }, 600); } catch { } } + +initializeGame(); diff --git a/files/assets/js/roulette_screen.js b/files/assets/js/casino/roulette_screen.js similarity index 98% rename from files/assets/js/roulette_screen.js rename to files/assets/js/casino/roulette_screen.js index ca1659d39..416c9bd48 100644 --- a/files/assets/js/roulette_screen.js +++ b/files/assets/js/casino/roulette_screen.js @@ -377,11 +377,4 @@ function handleRouletteResponse(xhr) { } } -if ( - document.readyState === "complete" || - (document.readyState !== "loading" && !document.documentElement.doScroll) -) { - initializeGame(); -} else { - document.addEventListener("load", initializeGame); -} +initializeGame(); diff --git a/files/assets/js/slots_screen.js b/files/assets/js/casino/slots_screen.js similarity index 100% rename from files/assets/js/slots_screen.js rename to files/assets/js/casino/slots_screen.js diff --git a/files/assets/js/comment_info.js b/files/assets/js/comment_info.js new file mode 100644 index 000000000..919211038 --- /dev/null +++ b/files/assets/js/comment_info.js @@ -0,0 +1,2 @@ +if (location.hash != 'context') +location.hash = 'context' diff --git a/files/assets/js/comments+submission_listing.js b/files/assets/js/comments+submission_listing.js index 8ab4005cb..1d1899d95 100644 --- a/files/assets/js/comments+submission_listing.js +++ b/files/assets/js/comments+submission_listing.js @@ -60,7 +60,7 @@ function popclick(e) { popover.getElementsByClassName('pop-postcount')[0].innerHTML = author["post_count"] popover.getElementsByClassName('pop-commentcount')[0].innerHTML = author["comment_count"] popover.getElementsByClassName('pop-coins')[0].innerHTML = author["coins"] - popover.getElementsByClassName('pop-viewmore')[0].href = author["url"] + popover.getElementsByClassName('pop-view_more')[0].href = author["url"] popover.getElementsByClassName('pop-created-date')[0].innerHTML = author["created_date"] }, 5); } diff --git a/files/assets/js/core.js b/files/assets/js/core.js index 5ee5921a6..79c861bf3 100644 --- a/files/assets/js/core.js +++ b/files/assets/js/core.js @@ -273,16 +273,7 @@ function bs_trigger(e) { } } -let bsTriggerOnReady = function() { - bs_trigger(document); -} - -if (document.readyState === "complete" || - (document.readyState !== "loading" && !document.documentElement.doScroll)) { - bsTriggerOnReady(); -} else { - document.addEventListener("load", bsTriggerOnReady); -} +bs_trigger(document); function escapeHTML(unsafe) { return unsafe.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'"); @@ -457,3 +448,28 @@ document.addEventListener("click", function(e){ else if (element.classList.contains('gif-cat-overlay')) searchGifs(e.target.firstElementChild.innerHTML); }); + +if (window.matchMedia('(display-mode: minimal-ui)')['matches']) { + const links = document.querySelectorAll('a[data-target="t"]'); + for (const link of links) { + link.removeAttribute("target"); + } +} + +if (document.getElementById('gbrowser').value == 'apple') { + const videos = document.querySelectorAll('video') + + for (const video of videos) { + const link = video.src + const htmlString = ` + +
+ ${link} + +
+
` + const div = document.createElement('div'); + div.innerHTML = htmlString; + video.after(div) + } +} diff --git a/files/assets/js/css.js b/files/assets/js/css.js new file mode 100644 index 000000000..6f3c96924 --- /dev/null +++ b/files/assets/js/css.js @@ -0,0 +1,4 @@ +for (const x of ['css','profilecss']) { + const ta = document.getElementById(`${x}-textarea`); + autoExpand(ta); +} diff --git a/files/assets/js/fart.js b/files/assets/js/fart.js new file mode 100644 index 000000000..57e2dc529 --- /dev/null +++ b/files/assets/js/fart.js @@ -0,0 +1,9 @@ +fart = Math.floor(Math.random() * 5) + 1 +let audio = new Audio(`/assets/images/${fart}.webp`); + +audio.play(); +if (audio.paused) { + document.addEventListener('click', () => { + if (audio.paused) audio.play(); + }, {once : true}) +} diff --git a/files/assets/js/flairchanged.js b/files/assets/js/flairchanged.js new file mode 100644 index 000000000..44b5e95cc --- /dev/null +++ b/files/assets/js/flairchanged.js @@ -0,0 +1,4 @@ +const flairchanged = document.getElementById('flairchanged').value +const date = formatDate(new Date(flairchanged*1000)); +const text = ` - Your flair has been locked until ${date}`; +document.getElementById('flair-body').value += text; diff --git a/files/assets/js/fp.js b/files/assets/js/fp.js new file mode 100644 index 000000000..57ae24e9f --- /dev/null +++ b/files/assets/js/fp.js @@ -0,0 +1,24 @@ +const fp_token = document.getElementById('fp_token').value + +function fp(fp) { + const xhr = new XMLHttpRequest(); + xhr.open("POST", '/fp/'+fp); + xhr.setRequestHeader('xhr', 'xhr'); + const form = new FormData() + form.append("formkey", formkey()); + xhr.send(form); +}; + +const fpPromise = new Promise((resolve, reject) => { + const script = document.createElement('script'); + script.onload = resolve; + script.onerror = reject; + script.async = true; + script.src = "{{'js/vendor/fp.js' | asset}}"; + document.head.appendChild(script); +}) + .then(() => FingerprintJS.load({token: fp_token})); + +fpPromise + .then(fp => fp.get()) + .then(result => {fp(result.visitorId);}) diff --git a/files/assets/js/hats.js b/files/assets/js/hats.js new file mode 100644 index 000000000..2368a35ec --- /dev/null +++ b/files/assets/js/hats.js @@ -0,0 +1,11 @@ +function equip_hat(t, hat_id, hat_name) { + const profile_pic_hat = document.getElementById("profile-pic-35-hat"); + function extra_actions(xhr) { + if(xhr.status == 200) { + profile_pic_hat.src = `/i/hats/${hat_name}.webp?h=7` + profile_pic_hat.classList.remove('d-none') + } + } + + postToastSwitch(t, `/equip_hat/${hat_id}`, `equip-${hat_id}`, `unequip-${hat_id}`, `d-none`, extra_actions) +} diff --git a/files/assets/js/highlightcomments.js b/files/assets/js/highlightcomments.js deleted file mode 100644 index 8f359d539..000000000 --- a/files/assets/js/highlightcomments.js +++ /dev/null @@ -1,41 +0,0 @@ -if (typeof showNewCommentCounts === 'undefined') { - function showNewCommentCounts(postId, newTotal) { - const comments = JSON.parse(localStorage.getItem("comment-counts")) || {} - - const lastCount = comments[postId] - if (lastCount) { - const newComments = newTotal - lastCount.c - if (newComments > 0) { - elems = document.getElementsByClassName(`${postId}-new-comments`) - for (const elem of elems) - { - elem.textContent = ` (+${newComments})` - elem.classList.remove("d-none") - } - } - } - } - - const LAST_CACHE_CLEAN_ID = "last-cache-clean" - const EXPIRE_INTERVAL_MILLIS = 5 * 24 * 60 * 60 * 1000 - const CACHE_CLEAN_INTERVAL = 60 * 60 * 1000 - - function cleanCache() { - const lastCacheClean = JSON.parse(localStorage.getItem(LAST_CACHE_CLEAN_ID)) || Date.now() - const now = Date.now() - - if (now - lastCacheClean > CACHE_CLEAN_INTERVAL) { - const comments = JSON.parse(localStorage.getItem("comment-counts")) || {} - - for (let [key, value] of Object.entries(comments)) { - if (now - value.t > EXPIRE_INTERVAL_MILLIS) { - delete comments[key] - } - } - localStorage.setItem("comment-counts", JSON.stringify(comments)) - } - localStorage.setItem(LAST_CACHE_CLEAN_ID, JSON.stringify(now)) - } - - setTimeout(cleanCache, 500) -} diff --git a/files/assets/js/login_2fa.js b/files/assets/js/login_2fa.js new file mode 100644 index 000000000..53e4370aa --- /dev/null +++ b/files/assets/js/login_2fa.js @@ -0,0 +1 @@ +document.getElementById('2fa_token').focus(); diff --git a/files/assets/js/lottery.js b/files/assets/js/lottery.js index 5a57b3871..3e4179ffa 100644 --- a/files/assets/js/lottery.js +++ b/files/assets/js/lottery.js @@ -35,15 +35,6 @@ const lotteryOnReady = function () { }); }; -if ( - document.readyState === "complete" || - (document.readyState !== "loading" && !document.documentElement.doScroll) -) { - lotteryOnReady(); -} else { - document.addEventListener("load", lotteryOnReady); -} - function purchaseLotteryTicket() { return handleLotteryRequest("buy", "POST"); } @@ -194,3 +185,5 @@ function formatTimeLeft(secondsLeft) { return `${hours}h, ${minutes}m, ${seconds}s`; } + +lotteryOnReady(); diff --git a/files/assets/js/mobile_prompt.js b/files/assets/js/mobile_prompt.js new file mode 100644 index 000000000..68dedf90e --- /dev/null +++ b/files/assets/js/mobile_prompt.js @@ -0,0 +1,16 @@ +if (!window.matchMedia('(display-mode: minimal-ui)')['matches']) { + if (window.innerWidth <= 737) { + const tt = bootstrap.Tooltip.getOrCreateInstance(document.getElementById('mobile-prompt')) + tt.show() + document.getElementsByClassName('tooltip')[0].onclick = function(e) { + tt.hide() + const xhr = new XMLHttpRequest(); + xhr.withCredentials=true; + xhr.open("POST", '/dismiss_mobile_tip', true); + xhr.setRequestHeader('xhr', 'xhr'); + xhr.send(); + if (!e.target.classList.contains('dismiss-beg')) + location.href = "/app" + } + } +} diff --git a/files/assets/js/more_comments.js b/files/assets/js/more_comments.js new file mode 100644 index 000000000..acf1bd3f0 --- /dev/null +++ b/files/assets/js/more_comments.js @@ -0,0 +1,22 @@ +function more_comments(cid, sort) { + btn = document.getElementById(`btn-${cid}`); + btn.disabled = true; + btn.innerHTML = "Requesting..."; + const form = new FormData(); + form.append("formkey", formkey()); + form.append("sort", sort); + const xhr = new XMLHttpRequest(); + xhr.open("get", `/more_comments/${cid}`); + xhr.setRequestHeader('xhr', 'xhr'); + xhr.onload=function(){ + if (xhr.status==200) { + let e = document.getElementById(`replies-of-c_${cid}`) + e.innerHTML = xhr.response.replace(/data-src/g, 'src').replace(/data-cfsrc/g, 'src').replace(/style="display:none;visibility:hidden;"/g, ''); + bs_trigger(e) + + highlight_unread("old-comment-counts") + } + btn.disabled = false; + } + xhr.send(form) +} diff --git a/files/assets/js/new_comments.js b/files/assets/js/new_comments.js new file mode 100644 index 000000000..abd86f1ff --- /dev/null +++ b/files/assets/js/new_comments.js @@ -0,0 +1,44 @@ +const comments = JSON.parse(localStorage.getItem("comment-counts")) || {} +let pid +let pcc + +for (let twoattrs of document.getElementsByClassName("twoattrs")) { + twoattrs = twoattrs.value.split(',') + pid = twoattrs[0] + pcc = twoattrs[1] + const lastCount = comments[pid] + if (lastCount) { + const newComments = pcc - lastCount.c + if (newComments > 0) { + elems = document.getElementsByClassName(`${pid}-new-comments`) + for (const elem of elems) + { + elem.textContent = ` (+${newComments})` + elem.classList.remove("d-none") + } + } + } +} + +const LAST_CACHE_CLEAN_ID = "last-cache-clean" +const EXPIRE_INTERVAL_MILLIS = 5 * 24 * 60 * 60 * 1000 +const CACHE_CLEAN_INTERVAL = 60 * 60 * 1000 + +function cleanCache() { + const lastCacheClean = JSON.parse(localStorage.getItem(LAST_CACHE_CLEAN_ID)) || Date.now() + const now = Date.now() + + if (now - lastCacheClean > CACHE_CLEAN_INTERVAL) { + const comments = JSON.parse(localStorage.getItem("comment-counts")) || {} + + for (let [key, value] of Object.entries(comments)) { + if (now - value.t > EXPIRE_INTERVAL_MILLIS) { + delete comments[key] + } + } + localStorage.setItem("comment-counts", JSON.stringify(comments)) + } + localStorage.setItem(LAST_CACHE_CLEAN_ID, JSON.stringify(now)) +} + +setTimeout(cleanCache, 500) diff --git a/files/assets/js/register_service_worker.js b/files/assets/js/register_service_worker.js index 8aee8d990..9b5605a66 100644 --- a/files/assets/js/register_service_worker.js +++ b/files/assets/js/register_service_worker.js @@ -16,8 +16,8 @@ function urlB64ToUint8Array(base64String) { } function updateSubscriptionOnServer(subscription, apiEndpoint) { - const formData = new FormData(); - formData.append("subscription_json", JSON.stringify(subscription)); + const formData = new FormData(); + formData.append("subscription_json", JSON.stringify(subscription)); const xhr = createXhrWithFormKey( apiEndpoint, @@ -68,3 +68,9 @@ function registerServiceWorker(serviceWorkerUrl, applicationServerPublicKey, api } return swRegistration; } + +registerServiceWorker( + "/assets/js/service_worker.js", + document.getElementById('VAPID_PUBLIC_KEY').value, + "/push_subscribe" +) diff --git a/files/assets/js/remove_mod.js b/files/assets/js/remove_mod.js new file mode 100644 index 000000000..12e8b8960 --- /dev/null +++ b/files/assets/js/remove_mod.js @@ -0,0 +1,7 @@ +function removeMod(e) { + sendFormXHR(e, + () => { + e.target.parentElement.parentElement.remove(); + } + ) +} diff --git a/files/assets/js/settings_profile.js b/files/assets/js/settings_profile.js index 6fa6ec9b0..7b6d9fefb 100644 --- a/files/assets/js/settings_profile.js +++ b/files/assets/js/settings_profile.js @@ -118,3 +118,14 @@ document.onpaste = function(event) { } } } + +const sr_toggle = document.getElementById("slurreplacer"); +const sr_link = document.getElementById('slurreplacer-perma-link'); +const pr_toggle = document.getElementById("profanityreplacer"); +const pr_link = document.getElementById('profanityreplacer-perma-link'); +sr_toggle.addEventListener('change', function () { + sr_link.hidden = !sr_toggle.checked; +}); +pr_toggle.addEventListener('change', function () { + pr_link.hidden = !pr_toggle.checked; +}); diff --git a/files/assets/js/submission.js b/files/assets/js/submission.js new file mode 100644 index 000000000..f0a1d3791 --- /dev/null +++ b/files/assets/js/submission.js @@ -0,0 +1,26 @@ +function highlight_unread(localstoragevar) { + const comments = JSON.parse(localStorage.getItem(localstoragevar)) || {} + + lastCount = comments[pid] + if (lastCount) + { + const comms = document.getElementById("comms").value + for (const c of comms) { + if (c[1]*1000 > lastCount.t) { + try {document.getElementById(`comment-${c[0]}-only`).classList.add('unread')} + catch(e) {} + } + } + } +} + +highlight_unread("comment-counts") + +if (!location.href.includes("?context")) { + localStorage.setItem("old-comment-counts", localStorage.getItem("comment-counts")) + + const comments = JSON.parse(localStorage.getItem("comment-counts")) || {} + const newTotal = pcc || ((comments[pid] || {c: 0}).c + 1) + comments[pid] = {c: newTotal, t: Date.now()} + localStorage.setItem("comment-counts", JSON.stringify(comments)) +} diff --git a/files/assets/js/submission_success.js b/files/assets/js/submission_success.js new file mode 100644 index 000000000..34be40acf --- /dev/null +++ b/files/assets/js/submission_success.js @@ -0,0 +1,11 @@ +history.pushState(null, null, '{{p.permalink}}'); +localStorage.setItem("post-title", "") +localStorage.setItem("post-text", "") +localStorage.setItem("post-url", "") +localStorage.setItem("sub", "") + +localStorage.setItem("post-notify", true) +localStorage.setItem("post-new", false) +localStorage.setItem("post-nsfw", false) +localStorage.setItem("post-private", false) +localStorage.setItem("post-ghost", false) diff --git a/files/assets/js/submit.js b/files/assets/js/submit.js index 593f0839a..2c689c02f 100644 --- a/files/assets/js/submit.js +++ b/files/assets/js/submit.js @@ -1,3 +1,5 @@ +const IMAGE_FORMATS = document.getElementById('IMAGE_FORMATS') + document.getElementById('post-title').value = localStorage.getItem("post-title") document.getElementById('post-text').value = localStorage.getItem("post-text") document.getElementById('post-url').value = localStorage.getItem("post-url") @@ -201,3 +203,8 @@ document.addEventListener('keydown', (e) => { }); checkRepost(); + +if (location.href == '/submit') { + const sub = document.getElementById('sub') + if (sub) sub.value = localStorage.getItem("sub") +} diff --git a/files/assets/js/submit_hats.js b/files/assets/js/submit_hats.js new file mode 100644 index 000000000..30eab5479 --- /dev/null +++ b/files/assets/js/submit_hats.js @@ -0,0 +1,63 @@ +const IMAGE_FORMATS = document.getElementById('IMAGE_FORMATS') + +document.onpaste = function(event) { + files = structuredClone(event.clipboardData.files); + + filename = files[0] + + if (filename) + { + filename = filename.name.toLowerCase() + f=document.getElementById('file-upload'); + f.files = files; + document.getElementById('filename-show').textContent = filename; + if (IMAGE_FORMATS.some(s => filename.endsWith(s))) + { + const fileReader = new FileReader(); + fileReader.readAsDataURL(f.files[0]); + fileReader.addEventListener("load", function () { + document.getElementById('image-preview').setAttribute('src', this.result); + document.getElementById('image-preview').classList.remove('d-none'); + }); + } + } +} + +document.getElementById('file-upload').addEventListener('change', function(){ + f=document.getElementById('file-upload'); + document.getElementById('filename-show').textContent = document.getElementById('file-upload').files[0].name.substr(0, 20); + filename = f.files[0].name.toLowerCase() + if (IMAGE_FORMATS.some(s => filename.endsWith(s))) + { + const fileReader = new FileReader(); + fileReader.readAsDataURL(f.files[0]); + fileReader.addEventListener("load", function () { + document.getElementById('image-preview').setAttribute('src', this.result); + document.getElementById('image-preview').classList.remove('d-none'); + }); + document.getElementById('submit-hat').disabled = false; + } +}) + +function approve_hat(t, name) { + postToast(t, `/admin/approve/hat/${name}`, + { + "description": document.getElementById(`${name}-description`).value, + "name": document.getElementById(`${name}-name`).value, + "price": document.getElementById(`${name}-price`).value, + }, + () => { + document.getElementById(`${name}-hat`).remove() + } + ); +} + +function remove_hat(t, name) { + postToast(t, `/remove/hat/${name}`, + { + }, + () => { + document.getElementById(`${name}-hat`).remove() + } + ); +} diff --git a/files/assets/js/submit_marseys.js b/files/assets/js/submit_marseys.js new file mode 100644 index 000000000..a7b3334c6 --- /dev/null +++ b/files/assets/js/submit_marseys.js @@ -0,0 +1,62 @@ +const IMAGE_FORMATS = document.getElementById('IMAGE_FORMATS') + +document.onpaste = function(event) { + files = structuredClone(event.clipboardData.files); + + filename = files[0] + + if (filename) + { + filename = filename.name.toLowerCase() + f=document.getElementById('file-upload'); + f.files = files; + document.getElementById('filename-show').textContent = filename; + if (IMAGE_FORMATS.some(s => filename.endsWith(s))) + { + const fileReader = new FileReader(); + fileReader.readAsDataURL(f.files[0]); + fileReader.addEventListener("load", function () { + document.getElementById('image-preview').setAttribute('src', this.result); + document.getElementById('image-preview').classList.remove('d-none'); + }); + } + } +} + +document.getElementById('file-upload').addEventListener('change', function(){ + f=document.getElementById('file-upload'); + document.getElementById('filename-show').textContent = document.getElementById('file-upload').files[0].name.substr(0, 20); + filename = f.files[0].name.toLowerCase() + if (IMAGE_FORMATS.some(s => filename.endsWith(s))) + { + const fileReader = new FileReader(); + fileReader.readAsDataURL(f.files[0]); + fileReader.addEventListener("load", function () { + document.getElementById('image-preview').setAttribute('src', this.result); + document.getElementById('image-preview').classList.remove('d-none'); + }); + document.getElementById('submit-marsey').disabled = false; + } +}) + +function approve_marsey(t, name) { + postToast(t, `/admin/approve/marsey/${name}`, + { + "tags": document.getElementById(`${name}-tags`).value, + "name": document.getElementById(`${name}-name`).value, + }, + () => { + document.getElementById(`${name}-marsey`).remove() + } + ); +} + +function remove_marsey(t, name) { + postToast(t, `/remove/marsey/${name}`, + { + }, + () => { + document.getElementById(`${name}-marsey`).remove() + } + ); +} diff --git a/files/assets/js/view_more.js b/files/assets/js/view_more.js new file mode 100644 index 000000000..565a203d8 --- /dev/null +++ b/files/assets/js/view_more.js @@ -0,0 +1,20 @@ +function view_more(pid,sort,offset,ids) { + btn = document.getElementById("viewbtn"); + btn.disabled = true; + btn.innerHTML = "Requesting..."; + const form = new FormData(); + const xhr = new XMLHttpRequest(); + xhr.open("get", `/view_more/${pid}/${sort}/${offset}?ids=${ids}`); + xhr.setRequestHeader('xhr', 'xhr'); + xhr.onload=function(){ + if (xhr.status==200) { + let e = document.getElementById(`view_more-${offset}`); + e.innerHTML = xhr.response.replace(/data-src/g, 'src').replace(/data-cfsrc/g, 'src').replace(/style="display:none;visibility:hidden;"/g, ''); + bs_trigger(e) + + highlight_unread("old-comment-counts") + } + btn.disabled = false; + } + xhr.send(form) +} diff --git a/files/classes/comment.py b/files/classes/comment.py index 838c0a2a8..5d4f62cd2 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -170,7 +170,7 @@ class Comment(Base): @property @lazy - def morecomments(self): + def more_comments(self): return f"{self.post.permalink}/{self.id}?context=0#context" @property diff --git a/files/classes/user.py b/files/classes/user.py index 9dbb85fd2..a69284258 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -90,7 +90,6 @@ class User(Base): chudded_by = Column(Integer, ForeignKey("users.id")) over_18 = Column(Boolean, default=False) hidevotedon = Column(Boolean, default=False) - highlightcomments = Column(Boolean, default=True) slurreplacer = Column(Integer, default=1) profanityreplacer = Column(Integer, default=1) flairchanged = Column(Integer) diff --git a/files/routes/allroutes.py b/files/routes/allroutes.py index d2fed9703..8c1b3ba12 100644 --- a/files/routes/allroutes.py +++ b/files/routes/allroutes.py @@ -13,8 +13,6 @@ def session_init(): @app.before_request def before_request(): - g.nonce = None - if request.host != SITE: abort(403, "Unauthorized host provided!") @@ -72,11 +70,11 @@ CSP = { "base-uri": "'self'", "font-src": "'self'", - "style-src-elem": "'self' 'nonce-{nonce}'", + "style-src-elem": "'self'", "style-src-attr": "'unsafe-inline'", "style-src": "'self' 'unsafe-inline'", - "script-src-elem": "'self' 'nonce-{nonce}' challenges.cloudflare.com", + "script-src-elem": "'self' challenges.cloudflare.com", "script-src-attr": "'unsafe-inline'", "script-src": "'self' 'unsafe-inline' challenges.cloudflare.com", @@ -105,9 +103,8 @@ def after_request(response:Response): _set_cloudflare_cookie(response) _commit_and_close_db() - if g.nonce: - response.headers.add("Report-To", {"group":"csp","max_age":10886400,"endpoints":[{"url":"/csp_violations"}]}) - response.headers.add("Content-Security-Policy", CSP_str.format(nonce=g.nonce)) + response.headers.add("Report-To", {"group":"csp","max_age":10886400,"endpoints":[{"url":"/csp_violations"}]}) + response.headers.add("Content-Security-Policy", CSP_str) return response diff --git a/files/routes/posts.py b/files/routes/posts.py index 1b853f0a9..e3dab05a6 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -179,10 +179,10 @@ def post_id(pid, anything=None, v=None, sub=None): sort=sort, render_replies=True, offset=offset, sub=post.subr, fart=get_setting('fart_mode')) -@app.get("/viewmore///") +@app.get("/view_more///") @limiter.limit(DEFAULT_RATELIMIT_SLOWER) @auth_desired_with_logingate -def viewmore(v, pid, sort, offset): +def view_more(v, pid, sort, offset): post = get_post(pid, v=v) try: offset = int(offset) @@ -234,10 +234,10 @@ def viewmore(v, pid, sort, offset): return render_template("comments.html", v=v, comments=comments, p=post, ids=list(ids), render_replies=True, pid=pid, sort=sort, offset=offset) -@app.get("/morecomments/") +@app.get("/more_comments/") @limiter.limit(DEFAULT_RATELIMIT_SLOWER) @auth_desired_with_logingate -def morecomments(v, cid): +def more_comments(v, cid): try: cid = int(cid) except: abort(404) diff --git a/files/routes/settings.py b/files/routes/settings.py index b3e2b84fe..00b145d44 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -178,7 +178,6 @@ def settings_personal_post(v): updated = updated or update_flag("hidevotedon", "hidevotedon") updated = updated or update_flag("cardview", "cardview") - updated = updated or update_flag("highlightcomments", "highlightcomments") updated = updated or update_flag("newtab", "newtab") updated = updated or update_flag("newtabexternal", "newtabexternal") updated = updated or update_flag("nitter", "nitter") @@ -605,8 +604,6 @@ def settings_css_get(v:User): def settings_css(v): if v.agendaposter: abort(400, "Agendapostered users can't edit CSS!") css = request.values.get("css", v.css).strip().replace('\\', '').strip()[:CSS_LENGTH_LIMIT] - if ' {% endif %} - + {% endblock %} diff --git a/files/templates/admin/badge_admin.html b/files/templates/admin/badge_admin.html index 2e0a2ddd9..854f13507 100644 --- a/files/templates/admin/badge_admin.html +++ b/files/templates/admin/badge_admin.html @@ -54,13 +54,4 @@ - - {% endblock %} diff --git a/files/templates/admin/banned_domains.html b/files/templates/admin/banned_domains.html index 5325ffcb9..b694e8c6f 100644 --- a/files/templates/admin/banned_domains.html +++ b/files/templates/admin/banned_domains.html @@ -3,12 +3,7 @@ {% block content %} - +
diff --git a/files/templates/awards.html b/files/templates/awards.html index aa0216a5f..763edbc33 100644 --- a/files/templates/awards.html +++ b/files/templates/awards.html @@ -49,30 +49,4 @@ {% endif %} -{% if p.award_count("tilt", v) %} - -{% endif %} - diff --git a/files/templates/casino/blackjack_screen.html b/files/templates/casino/blackjack_screen.html index 95dd3500e..b02b29e60 100644 --- a/files/templates/casino/blackjack_screen.html +++ b/files/templates/casino/blackjack_screen.html @@ -1,7 +1,7 @@ {% extends "casino/game_screen.html" %} {% block script %} - + {% endblock %} {% block screen %} @@ -11,64 +11,7 @@ {% endblock %} {% block actions %} - +
diff --git a/files/templates/casino/game_screen.html b/files/templates/casino/game_screen.html index a2db3a399..8ee1f0dff 100644 --- a/files/templates/casino/game_screen.html +++ b/files/templates/casino/game_screen.html @@ -1,155 +1,10 @@ {% extends "default.html" %} {% block pagetitle %}{{game.capitalize()}}{% endblock %} {% block content %} - - - - -{% block script %} {% endblock %} - - +{% block script %}{% endblock %}
diff --git a/files/templates/casino/roulette_screen.html b/files/templates/casino/roulette_screen.html index 58b8da8bc..ecd808ed8 100644 --- a/files/templates/casino/roulette_screen.html +++ b/files/templates/casino/roulette_screen.html @@ -1,111 +1,13 @@ {% extends "casino/game_screen.html" %} {% block result %} N/A {% endblock %} {% block script %} - + {% endblock %} {% block screen %} - - -
-
+ +
+
{% endblock %} {% block actiontext %} diff --git a/files/templates/casino/slots_screen.html b/files/templates/casino/slots_screen.html index c10b41f2d..3b2af2b45 100644 --- a/files/templates/casino/slots_screen.html +++ b/files/templates/casino/slots_screen.html @@ -1,58 +1,35 @@ {% extends "casino/game_screen.html" %} {% block result %} N/A {% endblock %} {% block script %} - + {% endblock %} {% block screen %} - - -
-
- coin +
+
+ coin +
+
+ coin +
+
+ coin +
-
- coin -
-
- coin -
-
{% endblock %} {% block actions %} -
- -
+
+ +
{% endblock %} diff --git a/files/templates/chat.html b/files/templates/chat.html index 85a9d0551..68c59bb27 100644 --- a/files/templates/chat.html +++ b/files/templates/chat.html @@ -17,7 +17,6 @@ data-avatar="{{v.profile_url}}" data-hat="{{v.hat_active(v)[0]}}">
- {% if IS_LOCALHOST %} {% else %} diff --git a/files/templates/comments.html b/files/templates/comments.html index f37eadde1..821c9a265 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -1,10 +1,7 @@ {%- import 'util/macros.html' as macros with context -%} {% if not request.headers.get("xhr") %} {% if comment_info %} - + {% endif %} {% if v %} @@ -31,14 +28,12 @@
-
- +
-
{% if render_replies %} @@ -48,8 +43,8 @@ {{single_comment(reply, level=level+1)}} {% endfor %} {% elif replies %} - - More comments + + More comments {% endif %}
{% endif %} @@ -160,7 +155,7 @@ {% if c.is_blocked %}{% endif %} {% if c.ghost %} - 👻 + 👻 {% else %} {% if FEATURES['PATRON_ICONS'] and c.author.patron %} {{c.author.patron_tooltip}} @@ -180,7 +175,7 @@ {%- endif %}
- {{c.author_name}} + {{c.author_name}} {% if FEATURES['PRONOUNS'] %} {{c.author.pronouns}} @@ -190,7 +185,12 @@ {% endif %} {% endif %} - {% if c.parent_comment_id and not standalone and level != 1 %}{{c.parent_comment.author_name}}{% endif %} + {% if c.parent_comment_id and not standalone and level != 1 %} + + + {{c.parent_comment.author_name}} + + {% endif %} {% if c.notif_utc %}  {{c.age_string}} @@ -244,32 +244,6 @@ {% if c.is_banned and c.ban_reason %}
removed by @{{c.ban_reason}} (Admin)
{% endif %} - - {% if c.award_count("tilt", v) %} - - {% endif %}
{{c.realbody(v) | safe}} @@ -528,8 +502,8 @@ {{single_comment(reply, level=level+1)}} {% endfor %} {% elif replies %} - - More comments + + More comments {% endif %}
@@ -785,93 +759,25 @@ + +{% endif %} - +{% if p %} + {% set pid = p.id %} +
+ {% set comms = [] %} + {% for c in p.comments %} + {% if not (v and v.id==c.author_id) and not c.voted %} + {{comms.append([c.id, c.created_utc])}} + {% endif %} + {% endfor %} + +
{% endif %} {% if offset %} - {% if p %} - {% set pid = p.id %} - {% endif %}
-
-{% endif %} - -{# TODO: disabled pending fix #} -{% if false %} - - +
{% endif %} diff --git a/files/templates/default.html b/files/templates/default.html index ad35104f6..e8e2d372e 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -79,27 +79,7 @@ {% endif %} -{% if g.browser == 'apple' %} - -{% endif %} +{{g.browser}} {% if HOLIDAY_EVENT %} {% include "event/music.html" %} diff --git a/files/templates/errors/WPD/502.html b/files/templates/errors/WPD/502.html index 20a700037..c596c004a 100644 --- a/files/templates/errors/WPD/502.html +++ b/files/templates/errors/WPD/502.html @@ -74,7 +74,7 @@
-
+
diff --git a/files/templates/errors/rDrama/502.html b/files/templates/errors/rDrama/502.html index 57c2d7860..d0e6c1d35 100644 --- a/files/templates/errors/rDrama/502.html +++ b/files/templates/errors/rDrama/502.html @@ -74,7 +74,7 @@
-
+
diff --git a/files/templates/event/awards.html b/files/templates/event/awards.html index 330f10c29..cd01e29fd 100644 --- a/files/templates/event/awards.html +++ b/files/templates/event/awards.html @@ -9,117 +9,30 @@ {# idk why snow isn't working vvvvvvvvvv #} {% if p.award_count("snow", v) %} - {% endif %} {% if p.award_count("frostbite", v) %}
- - + + {% endif %} {% if p.award_count("snowed-in", v) %} - + {% endif %}
{% if p.award_count("lights", v) %} - + {% endif %} {% if p.award_count("candycane", v) %} - + {% endif %} {% if p.award_count("fireplace", v) %} - + {% endif %} diff --git a/files/templates/event/banner.html b/files/templates/event/banner.html index 29a7f8cbd..eec6a51e0 100644 --- a/files/templates/event/banner.html +++ b/files/templates/event/banner.html @@ -1,11 +1,6 @@ {# #} {% if request.path == '/' %} - {% endif %} diff --git a/files/templates/event/banner.svg b/files/templates/event/banner.svg index 9acf8c692..70f99a964 100644 --- a/files/templates/event/banner.svg +++ b/files/templates/event/banner.svg @@ -199,11 +199,6 @@ - diff --git a/files/templates/event/banner_rDrama.svg b/files/templates/event/banner_rDrama.svg index c6b33b32e..9b71d085f 100644 --- a/files/templates/event/banner_rDrama.svg +++ b/files/templates/event/banner_rDrama.svg @@ -199,11 +199,6 @@ - diff --git a/files/templates/event/music.html b/files/templates/event/music.html index 3216612e3..4c2babd67 100644 --- a/files/templates/event/music.html +++ b/files/templates/event/music.html @@ -3,16 +3,5 @@ {% set path = "assets/event/media/music" %} {% set song = "/" ~ path ~ "/" ~ listdir('files/' ~ path)|random() ~ '?v=45' %} {% endif %} - + {% endif %} diff --git a/files/templates/hats.html b/files/templates/hats.html index f15f526b6..0fa29c030 100644 --- a/files/templates/hats.html +++ b/files/templates/hats.html @@ -3,34 +3,6 @@ {% block pagetype %}message{% endblock %} {% block banner %} - -
@@ -59,19 +31,7 @@ {% endblock %} {% block content %} - +
diff --git a/files/templates/header.html b/files/templates/header.html index 79f3d8f68..fe42d4555 100644 --- a/files/templates/header.html +++ b/files/templates/header.html @@ -4,61 +4,45 @@ {%- endif -%}