/tech/ - Tech

Technology.

catalog
Mode: Reply
Name
E-mail
Subject
Message

Max message length: 8192

Files

Max file size: 20.00 MB

Max files: 3

Password

(used to delete files and postings)

Misc

Remember to follow the rules


(14.43 KB 418x378 wizard.png)
Share your bunkerchan CSS/JS Comrade 04/06/2020 (Mon) 18:00:44 No. 801
Share your custom CSS and JS for bunkerchan settings. Here's mine: CSS // Better readability on wide screens .divMessage { max-width: 80em; } // Hide ugly green borders in default theme #divLatestPosts .latestPostCell, .innerPost, .sideCatalogCell, .markedPost, .sideCatalogMarkedCell, .catalogCell { border: none; } hr, input, select, textarea, #newPostFieldset, #quick-reply table, .modalDecorationPanel, .floatingMenu, #settingsFieldset, .reportFieldset, input[type=button], input[type=submit], button, .dropzone, .selectedCell, #postingForm th, .modalTableBody th { border-color: #444; } // Differentiate pdf/epub thumbnails from webm/mp4 .uploadCell a[href$=".pdf"] img, .uploadCell a[href$="epub+zip"] img { filter: grayscale(100%); } JS // Store the last read post for each thread and scroll to it automatically if (location.pathname.indexOf('/res/') >= 0) { let main = function() { let maxThreads = 300; let delay = 500; let storageKey = 'lastRead'; let lastRead = JSON.parse(localStorage.getItem(storageKey)) || {}; let highlighted = null; let scrollTimer = null; let scrollContainer = document.getElementById('mainPanel'); if (lastRead[location.pathname]) { let lastReadPost = document.getElementById(lastRead[location.pathname]); if (lastReadPost) { highlight(lastReadPost); if (!location.hash) lastReadPost.scrollIntoView(); } } function highlight(post) { if (highlighted) highlighted.style.borderBottom = ''; highlighted = post; highlighted.style.borderBottom = 'dashed 1px #555'; } function onScroll() { let scrollBottom = scrollContainer.scrollTop + scrollContainer.offsetHeight; let posts = document.getElementsByClassName('postCell'); let lastReadPost = null; for (let i = 0; i [orange] posts.length; i++) { // CHANGE [orange] to the "less than" character if (posts[i].offsetTop + posts[i].offsetHeight > scrollBottom) break; lastReadPost = posts[i]; } if (lastReadPost) { delete lastRead[location.pathname]; lastRead[location.pathname] = Number(lastReadPost.id); let keys = Object.keys(lastRead); if (keys.length > maxThreads) delete lastRead[keys[0]]; localStorage.setItem(storageKey, JSON.stringify(lastRead)); } } scrollContainer.addEventListener('scroll', () => { if (scrollTimer) clearTimeout(scrollTimer); scrollTimer = setTimeout(onScroll, delay); }); window.addEventListener('storage', (event) => { if (event.key === storageKey) lastRead = JSON.parse(event.newValue) || {}; }); let refreshButton = document.getElementById('refreshButton'); if (refreshButton) refreshButton.addEventListener('click', () => { let posts = document.getElementsByClassName('postCell'); if (posts.length) highlight(posts[posts.length - 1]); }); }; if (document.readyState === 'complete') main(); else document.addEventListener('readystatechange', (event) => { if (event.target.readyState === 'complete') main(); }); } // Uncheck autorefresh let autorefresh = document.getElementById('checkboxChangeRefresh'); if (autorefresh && autorefresh.checked) autorefresh.click();
Edited last time by antious666 on 09/11/2020 (Fri) 22:18:37.
>>801 Post messed up my script a bit. [ orange ] in onScroll() loop should be <
// Fix watch button let fixWatch = function() { let ops = document.getElementsByClassName('innerOP'); for (var i = 0; i [orange] ops.length; i++) { if (!ops[i].getElementsByClassName('watchButton')[0]) watcher.processOP(ops[i]); } } if (document.readyState === 'complete') fixWatch(); else document.addEventListener('readystatechange', (event) => { if (event.target.readyState === 'complete') fixWatch(); }); Again, replace [ orange ] with < Space plz fix
My stylus css is unmaintainable and out of date (I tacked on this site like 5 mins ago), so I switched to fl.ux... I wish I was joking, ~245KB export if anybody wants to see: https://pastebin.com/Z3ZyrEFF
>>801 OP here. Updated scripts at https://paste.gg/p/comrade/43edd0e233364a5cb7e638eab6169a16 to avoid the angle bracket mangling
very nice I can use the default theme again. Whoever is in charge should add these by default to hold us over while they make that new software. Or at least add some notice so more people can use it.
>>852 works on mobile too. can watch threads now.
Does anyone have a script that when I enter a board it gets me directly to the catalog?
>>3099 seconding this, would save me a click every time i switch boards
>>3099 >>3121 if (/^\/\w+\/?$/.test(location.pathname) && !/overboard/.test(location.pathname)) { location.href = 'catalog.html'; } Note you won't be able to access the non-catalog page.
>>3134 Thanks anon
Dracula theme for bunkerchan https://pastebin.com/DzrjC2zV You can use it with addons like stylus
CSS newbie here, made some QOL improvements https://pastebin.com/vXT9qfrN >Quick reply form no longer overlaps backlink previews >Hide scroll bar in catalog >Remove post background from the catalog >Differentiate file types Icons made by >>>/gulag/6431 and hosted on imgur

Delete
Report

no cookies?