Closed ghost closed 3 years ago
is there a way to implement this without javascript? fchan has been trying to decrease the amount of javascript used, not increase. If not, it's not a big deal since this is optional, but ideally a JS-less implementation would be nice.
in some browsers, you can change the page style, but at least in firefox it doesn't stick. ungoogled chromium (and i'll assume by extension, chromium) i can't find any way to actually change it without an extension or javascript.
another route we could go down that i hate involves doing this server side, so we take in the theme
cookie (and set it via a form or something) and do some stuff in static/main.html
to set the default style.
i don't really like this since it would require another POST route to do nothing but set the theme
cookie, then you'd have a CookieTheme
field in PageData
/AdminPage
/etc structs for templates which will decide which theme will be marked as the default stylesheet. not sure how to go about implementing this and i hate it anyway.
thanks for organizing the styling. as for javascript less, as long as the site is functioning w/o javascript it should be fine. users should expect that javascript will have less features than with. like what was stated, it could be moved server side, but are users that want no javascript also expecting themes? i would think they would want less not more functionality in some regards.
going to test theses changes on fchan and 0xchan, a lot was moved around lets see if it holds.
i've already noticed a few (visual) issues myself i didn't notice when testing locally. another PR very soon... but i guess this is what the development branch is for.
margin-left: 25px;
in .newsbox-news
looks uglystatic/anews.html
, static/news.html
nor the grid in static/index.html
for boardsstatic/css/themes/default.css
appears twice, with both rel="stylesheet"
and rel="alternative stylesheet"
NewsGet: template: main.html:22:12: executing "layout" at <eq (sub $l 1) 0>: error calling eq: incompatible types for comparison
, bug caused by me passing mod
insteadhalf of these are already fixed locally. if there's anything else wrong let me know.
this series of commits adds themes to fchan. it's basic, but it works. i'll improve upon this later, but it works well enough now as far as i know.
tl;dr of changes:
Published
/Updated
fields inObjectBase
have been changed from string to time.Time. this shouldn't cause any issues, i tested federation between 21917eb2ea72fe40d70c2c991e821aace5430c23 and head and seemed to work.style=
. uses cookies.*[]string
added to AdminPage and PageData. this should be pointed to the globalThemes
, which is a list of file names fromstatic/css/themes
populated during startup.log.Printf
to templates. they should log when they fail.