forked from MarseyWorld/MarseyWorld
remove event_darkmode
parent
a5f21ea658
commit
499781329f
|
@ -1,20 +0,0 @@
|
|||
function postToastRoastEventDarkmode(t, url) {
|
||||
const xhr = createXhrWithFormKey(url);
|
||||
xhr[0].onload = function() {
|
||||
postToastLoadEventDarkmode(xhr[0])
|
||||
};
|
||||
xhr[0].send(xhr[1]);
|
||||
}
|
||||
|
||||
function postToastLoadEventDarkmode(xhr) {
|
||||
let data
|
||||
try {
|
||||
data = JSON.parse(xhr.response)
|
||||
}
|
||||
catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
success = xhr.status >= 200 && xhr.status < 300;
|
||||
showToast(success, getMessageFromJsonData(success, data));
|
||||
location.reload();
|
||||
}
|
|
@ -164,7 +164,6 @@ class User(Base):
|
|||
if IS_FISTMAS():
|
||||
#TODO: make event_music a cookie toggle instead
|
||||
event_music = Column(Boolean, default=default_event_music, nullable=False)
|
||||
event_darkmode = Column(Boolean, default=default_darkmode, nullable=False)
|
||||
|
||||
badges = relationship("Badge", order_by="Badge.created_utc", back_populates="user")
|
||||
subscriptions = relationship("Subscription", back_populates="user")
|
||||
|
|
|
@ -450,6 +450,7 @@ CHUD_MSG = """:marseypirate: : Avast, ye scurvy cur! Yer {type} be walkin' the p
|
|||
PIN_AWARD_TEXT = " (pin award)"
|
||||
|
||||
THEMES = ["4chan","classic","classic_dark","coffee","dark","dramblr","light","midnight","tron","win98"]
|
||||
LIGHT_THEMES = ["4chan","classic","coffee","light","win98"]
|
||||
BACKGROUND_CATEGORIES = ["glitter", "anime", "fantasy", "solarpunk", "pixelart"]
|
||||
COMMENT_SORTS = ["hot", "new", "old", "top", "bottom", "controversial", "saves"]
|
||||
SORTS = COMMENT_SORTS + ["bump", "comments", "views", "subscriptions", "saves"]
|
||||
|
|
|
@ -970,15 +970,3 @@ def settings_checkmark_text(v):
|
|||
v.verified = new_name
|
||||
g.db.add(v)
|
||||
return redirect("/settings/personal?msg=Checkmark Text successfully updated!")
|
||||
|
||||
if IS_FISTMAS():
|
||||
@app.post("/events/fistmas2022/darkmode")
|
||||
@limiter.limit('1/second', scope=rpath)
|
||||
@limiter.limit('1/second', scope=rpath, key_func=get_ID)
|
||||
@limiter.limit(DEFAULT_RATELIMIT)
|
||||
@limiter.limit(DEFAULT_RATELIMIT, key_func=get_ID)
|
||||
@auth_required
|
||||
def event_darkmode(v):
|
||||
v.event_darkmode = not v.event_darkmode
|
||||
g.db.add(v)
|
||||
return {"message": "Dark mode toggled successfully!"}
|
||||
|
|
|
@ -106,7 +106,7 @@
|
|||
{% if p.embed %}
|
||||
{% if p.domain == "twitter.com" %}
|
||||
{{p.embed | safe}}
|
||||
{% if v and v.theme.split("_")[0] in ["light", "coffee", "4chan"] %}
|
||||
{% if v and v.theme in LIGHT_THEMES %}
|
||||
<script defer src="{{'js/vendor/twitterlight.js' | asset}}"></script>
|
||||
{% else %}
|
||||
<script defer src="{{'js/vendor/twitter.js' | asset}}"></script>
|
||||
|
|
|
@ -27,9 +27,6 @@
|
|||
<a class="sidebar-link" href="/log" data-bs-toggle="tooltip" data-bs-placement="top" title="Moderation Log"><i class="fas fa-scroll-old"></i></a>
|
||||
<a class="sidebar-link" href="/transfers" data-bs-toggle="tooltip" data-bs-placement="top" title="Transfers"><i class="fas fa-arrow-right-arrow-left"></i></a>
|
||||
<a class="sidebar-link" href="/random_post" data-bs-toggle="tooltip" data-bs-placement="top" title="Random Post"><i class="fas fa-random"></i></a>
|
||||
{% if IS_FISTMAS() %}
|
||||
<span class="sidebar-link" data-nonce="{{g.nonce}}" data-onclick="postToastRoastEventDarkmode(this, '/events/fistmas2022/darkmode')" style="display:inline" data-bs-toggle="tooltip" data-bs-placement="top" title="Toggle Dark Mode"><i class="fas fa-moon-over-sun"></i></span>
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
<div class="sidebar-wpd--flairs sidebar-wpd--flairs--3">
|
||||
|
@ -84,7 +81,3 @@
|
|||
Live commit: <a href="https://fsdfsd.net/rDrama/rDrama/commit/{{git_head()[0]}}">{{git_head()[0]}}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if IS_FISTMAS() %}
|
||||
<script defer src="{{'events/fistmas/js/darkmode.js' | asset}}"></script>
|
||||
{% endif %}
|
||||
|
|
|
@ -34,9 +34,6 @@
|
|||
<a class="sidebar-link" href="/log" data-bs-toggle="tooltip" data-bs-placement="top" title="Moderation Log"><i class="fas fa-scroll-old"></i></a>
|
||||
<a class="sidebar-link" href="/transfers" data-bs-toggle="tooltip" data-bs-placement="top" title="Transfers"><i class="fas fa-arrow-right-arrow-left"></i></a>
|
||||
<a class="sidebar-link" href="/random_post" data-bs-toggle="tooltip" data-bs-placement="top" title="Random Post"><i class="fas fa-random"></i></a>
|
||||
{% if IS_FISTMAS() %}
|
||||
<span class="sidebar-link" data-nonce="{{g.nonce}}" data-onclick="postToastRoastEventDarkmode(this, '/events/fistmas2022/darkmode')" style="display:inline" data-bs-toggle="tooltip" data-bs-placement="top" title="Toggle Dark Mode"><i class="fas fa-moon-over-sun"></i></span>
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
{% if sub and sub.sidebar_html %}
|
||||
|
@ -74,7 +71,3 @@
|
|||
Live commit: <a href="https://fsdfsd.net/rDrama/rDrama/commit/{{git_head()[0]}}">{{git_head()[0]}}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if IS_FISTMAS() %}
|
||||
<script defer src="{{'events/fistmas/js/darkmode.js' | asset}}"></script>
|
||||
{% endif %}
|
||||
|
|
|
@ -130,10 +130,10 @@
|
|||
{% if IS_FISTMAS() %}
|
||||
<link rel="stylesheet" href="{{'events/fistmas/css/fistmas.css' | asset}}">
|
||||
|
||||
{% if v and v.event_darkmode %}
|
||||
<link rel="stylesheet" href="{{'events/fistmas/css/themes/dark.css'| asset}}">
|
||||
{% else %}
|
||||
{% if v and v.theme in LIGHT_THEMES %}
|
||||
<link rel="stylesheet" href="{{'events/fistmas/css/themes/light.css'| asset}}">
|
||||
{% else %}
|
||||
<link rel="stylesheet" href="{{'events/fistmas/css/themes/dark.css'| asset}}">
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
|
|
Loading…
Reference in New Issue