e5f52e No.15636
Discussions about user.js
____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
e5f52e No.15649
>>15558
>>15547
>>15385
>>15532
> I have this JS (customized to have no color for my and Q's posts, and no nope buttom; for caps).
https://pastebin.com/Jh4Mqwpj
> It doesn't let me make new threads from the catalog and only the index. Any idea why that'd be?
I suspect that your runq() may be recursive.
have you instrumented any part with console.log()
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
176f4c No.15675
>>15649
I am absolutely code illiterate, KEK.
I just found where it had the hex codes and deleted it for the no colors, and found the nope part and deleted it for the no nope button.
I haven't tried to fix it at all, don't know how to.
But in the index, baking is normal and fine with or without the script.
And in the catalog, with the script, clicking on "Create A Thread" doesn't bring up the dialog box.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
c21f9d No.15695
>>15385 PB
>>14740 PB
Repost from general with addition:
>@Codefag
>Tested the updated user javascript and it looks great.
>Scanned the code and did not see anything troubling.
>(Everyone should study the code for themself; don't rely on me or anyone but yourself.)
* * * * * * *
>When things are moving fast, I have been known to tag NOPE by accident and then want to reverse it.
So far I haven't figured out how to modify the code to enable this.
* * * * * * *
Also, download blacklist gets its data from where?
* * * * * * *
>Appreciate the code! TYVM!
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
176f4c No.15707
>>15675
>>15649
Otherwise it works perfectly, no other problems.
And I have the original, so I can readd the things I took out if I want to.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
e5f52e No.15708
>>15675
heh.
in previous life, wrote linux kernel code, js is pretty much out of the wheelhouse.
but, code is code, once you understand the underlying engine, and the syntax, everything is possible.
I would suggest wrapping the whole thing in the test like I did, the
if (window.location.pathname.search("/catalog") == -1) {
... your code goes here
}
should turn off anything you are doing when on the catalog.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
c21f9d No.15714
>>15695
The NOPE (Blacklist images) I was using before, that includes
(1) blurring out the image using CSS instead of making it completely disappear and
(2) ability to click the blacklisted blurred image and it's removed from the block list & displayed
is this:
/* NOPE */
var imageBlacklist = [] ;
function loadImageBlacklist() { JSON.parse(localStorage.imageBlacklist || "[]").forEach(addToImageBlacklist); }
function saveImageBlacklist() { localStorage.imageBlacklist = JSON.stringify(imageBlacklist); }
function addToImageBlacklist(md5) { if (md5 && -1 === imageBlacklist.indexOf(md5)) imageBlacklist.push(md5); }
function removeImageFromBlacklist(md5) { var index = imageBlacklist.indexOf(md5); if (-1 !== index) imageBlacklist.splice(index, 1); }
function blacklistPostImages(post) { $(post).find('img.post-image').each(function (i, el) { var md5 = el.getAttribute('data-md5'); addToImageBlacklist(md5); $(el).addClass('nope'); }); }
function removeBlacklistedImages() { $('img.post-image').each(function (i, el) { if (-1 !== imageBlacklist.indexOf(el.getAttribute('data-md5'))) { $(el).addClass('nope'); } }); }
function onNopeClicked(event) { event.preventDefault(); event.stopPropagation(); loadImageBlacklist(); var post = $(event.target).closest('.post'); blacklistPostImages(post); removeBlacklistedImages(); saveImageBlacklist(); }
function addNopeButtons() { $('.post').each(function(i, post) { if ($(post).find('.nope').length === 0) { $(post).prepend("<input type='button' class='nope' onClick='onNopeClicked(event)' value='Nope'></input>"); } }) }
setInterval(function () { loadImageBlacklist(); removeBlacklistedImages(); addNopeButtons(); }, 1000);
$('body').on('click', 'img.nope', function (event) { event.preventDefault(); event.stopPropagation(); $(this).removeClass('nope'); removeImageFromBlacklist(this.getAttribute('data-md5')); saveImageBlacklist(); });
/* end NOPE */
and here's the CSS for the above NOPE function, that goes into the THEME section on 8ch options:
img.nope {
filter: grayscale(30%) blur(10px);
overflow: hidden;
max-width: 150px;
max-height: 150px;
}
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
e5f52e No.15723
>>15695
localstorage includes the imageBlacklist, or whatever it's called. so when you download "localstoage" whatever is in there comes along for free.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
c21f9d No.15740
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
176f4c No.15769
>>15708
Gotcha, I've never coded at all, so I'll play around with it later tonight.
If you notice anything that'd be a fix for it, let me know.
I've asked for a while, never really got an answer on why it would be happening.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
e5f52e No.15795
>>15740
just save it. it's .json
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
e5f52e No.15811
>>15795
it's the array of the image id's. technically, it's the id of the thumbnails, but they match the main images, just different path, /file_store/ v. /thumb/ or something.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
732dcf No.15871
>>15811
I just don't understand the JS programming model at all. Opened a file from local storage maintained by my browser, and saved it to local storage maintained by my browser...
I did have to locate the browser's local storage and erase it once, because it got too large from my interactions with 8ch over the 19 months and the browser was thrashing. I probably had more posts than anybody because of meme farming...
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
e5f52e No.15918
>>15871
yeah, saving to your system doesn't actually change anything about it, and at some point, it will get full. current understanding is the limit is 5meg. in my case, whacking porn and cp with the nope button stops me from accidentally downloading those when I download the bread. in my case the list is only a few 100k. each file id is 64 bytes.
I have some code that when saving images looks to see if the image was seen before. if it was, don't download as it's already here.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
c0d519 No.15995
>>15918
I see your logic for a nope button that really whacks the undesirable URLs instead of just blurring them. Agree, that's a better approach for those of us who want to maintain a clean environment.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
6819fb No.16158
OP can this logic be ported to discord bots or RSS feeds to feed Q posts?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
e5f52e No.17013
>>16158
look into the code for qanon.pub, they have done that heavy lifting, it would prob be easier to port.
qrb-bells-whistles is targeted at general viewing of Q boards, with some visual enhancements. my work is top of someone else's work.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
679f1d No.17294
>>16158
shouldn't be any code needed for this, here:
https://zapier.com/apps/discord/integrations/rss
https://qmap.pub/info/rss
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
6819fb No.18364
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
380f30 No.18445
Thanks again codefag! We made a few tweaks to reflect individual needs --
1) Wide right nav area restored to 30 px instead of 10 px
2) PB links color blue. Spouseanon rejected faggoty green, kek.
pbColor: "#0000cc", // previous bread color, dark blue
3) Moved post count to bottom right and larger font
4) Renamed "Spam Free Bread." button to "Spam Fader"
https://pastebin.com/3XS9GtDr
Very happy with this useful tool. Thank you again.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
679f1d No.19277
>>18445
>PB links color blue
recommend using a background color for this instead. I used #ffffbb yellow which looks quite nice.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
61a29a No.19809
>>17294
>>16158
>>17013
https://qanon.news/feed
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
d0f618 No.25032
>>15695
Finally I figured out what this script's DLBL "Download Blacklist" does.
It writes a file called "imageBlacklist.json" to my Downloads directory.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
e5f52e No.25186
>>25032
>>25032
correct. the items in the array are ids of the image id as stored both as the main image, and the thumbnail, although in different paths.
this is useful to see if you have downloaded the image before if you grab the main link, rather than the second one, which is the name of the uploaded file from the anon's system.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
e5f52e No.26281
2019-07-24
Updated user.js qrb-bells-whistles.
Rename the "Spam Free Bread" toggle button in the header "Spam Fader".
Source:
https://pastebin.com/2We1Nc2p
Compressed:
https://pastebin.com/jt1WN9pv
$ sha256sum qrb-bells-whistles.js.txt qrb-bells-whistles-190724-0112Z.min
e1da173ca0c40e6c70662b88f23c1a3bd074faf8d879eff850b1907ac9172424 qrb-bells-whistles.js.txt
c92a0c9c2a12103050a116742da6610397a235f86e27ffc03a5601b00d96988e qrb-bells-whistles-190724-0112Z.min
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
679f1d No.27786
Calling all coderanons:
Get a large external hard drive.
Use it well.
The pot is starting to boil, and historians will want the primary sources later.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
e5f52e No.28768
>>15636
2019-07-26
Updated user.js qrb-bells-whistles.
The ordering and display of the toasts, and the post count have been
moved to align on the right side of the window, with the post count
stuck to the bottom right corner of the window. No image size changes
were made, just where the display is presented.
The net effect is that everything now lines up vertically on the
right edge, versus blocks floating on the upper right at the top.
$ sha256sum qrb-bells-whistles.js.txt qrb-bells-whistles-190726-0900Z.min
f68666c3eaf4f535a77103fdf2c76325b26aae43b81fc293783f6a5d1e784779 qrb-bells-whistles.js.txt
85fe05650d9b25ff9df9a4e08958f64cd3646f3ca245f6b12dc88f4f134a858e qrb-bells-whistles-190726-0900Z.min
Compressed:
https://pastebin.com/KJdiAHhC
Source:
https://pastebin.com/EjGtyX9z
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
fa190b No.28894
How do I make the NOPE button default to "ON"? (First state of toggle button = on)
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
e5f52e No.29073
>>28768
2019-07-26-2
MOAR
qrb-bells-whistles.js: adjust the horizontal position of the toasts
The previous positioning had it slightly overlapping the post.
anon is always confused, are you sposed to measure once, cut twice, or measure twice and cut once?
whatever, have tested on both dissenter (chrome) and firefox, and the toasts no longer overlap.
$ sha256sum qrb-bells-whistles.js.txt qrb-bells-whistles-190726-1817Z.min
a51d95e9d837c6bf804320a2ff52f207d71554542f4463c7e311332f2734cc1b qrb-bells-whistles.js.txt
98a7a4930087c0723181e6182e86bb7a6789a7533c0db338e4a0f0a0e1b57b62 qrb-bells-whistles-190726-1817Z.min
Compressed:
https://pastebin.com/5jXy0VjE
Source:
https://pastebin.com/41SH6xkN
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
e5f52e No.29093
>>28894
yeah, in the user.js, see the nopeSI:0, in the first block,
- change the 0 to 1 without touching either the ':' or the ','.
- save the user.js,
- and you should be in bidness.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
7514d0 No.29211
POTUS talking now says John enjoys wine. Who is the John? I got the impression POTUS was saying ( under his breath) John has a drinking problem or POTUS knows about a problem associated with John's drinking.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
679f1d No.30754
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
e5f52e No.33828
>>15636
2019-07-31
FREASHA TOASTA ONA CONVEYOR, SIGNOR
Was proud of meself for moving the breads all over to the edge of screen, aligned vertically. Looks good methinks. Goes away for a few hours, comes back, and toasts have spilled all over.
Turns out, there was at least one bug in the code that kept up with them, basically, nothing was timing out and leaving the list, the list continued to grow until you refreshed or changed breads.
When a new bread showed up, the toast was appended to the list, at the end, so that made it hard to determine which was the newest, you had to look at the color. I know, not that hard, but when a couple were not adjacent, it was easy to poke the wrong one.
Now, the list is actually timing out, with burnt ones getting tossed. To me though, the big deal is that the new toast is added to the top of the list. This allows you easily judge by the color gradations who is newer, at least I am able to compare visually as they are ordered in descending burntness.
The other bug that I think was present was that a variable was being use that was defined once when the new bread was opened, then a callback was called that used the same name but never initialized it, so *may* have be reusing the global var that was essentially static.
What I had noticed previously was when moving the sprite over the Q posts at the top of the bread, or even the notable was cause the parser to freak, and all the posts would disappear, only to come back with a refresh/reload. Not sure about this one, as it may have been fixed in the browser.
New Tuning Knobs
toastQuantum: 7200, // 2 hours. NB: Date().getTime() is milliseconds
toastThrottle: 3, // allow non qresearch board to run 3x longer before timing out.
When not on /qresearch, bump the toastQuantum to 6 hours to prevent losing older breads. You can change the multiplier in toastThrottle.
maxToasts: 13, // set this to prevent more toast display than screen real estate.
I have a desktop, so just picked 13 as the max to display. If you can adjust ilower if they still spill over. I don't plan on coding up a way to autocalc how much real estate is available.
$ sha256sum qrb-bells-whistles-190731-1433Z.js.txt qrb-bells-whistles-190731-1433Z.min
7b9d9123d65c292539ffa88ba567912963a7e6177ee31d0bebbc2ddec9c1d684 qrb-bells-whistles-190731-1433Z.js.txt
ebc828c7f72f211a630d0b386d7a6fae7f0e100dc98e8aae8076c741092edda6 qrb-bells-whistles-190731-1433Z.min
Compressed:
https://pastebin.com/jYj3kpyb
Source:
https://pastebin.com/zfK7QkGc
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
dc681b No.33842
>>33828
I use the script that combines an older version of Toast (across top) with the "anonsw" side bar, so would appreciate an upgraded Toast version where breads remain across top.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
94e66a No.34906
Twitter made a change to their API on July 25th that prevents very useful 3rd party tools from scraping accounts and turning them into RSS for self-hosted feed readers like RSS Owl to consume.
http://twitrss.me/
"2019-07-25: Twitter have changed their UI. For now, user queries should continue to work, as they'll be directed to the mobile version of Twitter. Search queries not so much.
2018-10-17: Twitter are rate limiting requests from TwitRSS.me, meaning it is effectively broken until I can think of a way round it. You can still run your own instance"
[of the code which is available in github]
It's obvious that Twitter's instrumentation wants to know (via cookies, browser fingerprint, IP address, etc.) WHO is accessing each tweet, whether or not they're using a Twitter app and whether or not they're a logged-in Twitter user.
By using the aggregator site and presenting all the tweets in an RSS feed reader app, people like me were somewhat anonymized and able to consume a lot of twitter without touching twitter's website.
Can't anymore. Had to delete all the feeds from my feed reader that were utilizing twitrss.me to convert from twitter handles to RSS.
Can still consume RSS feeds that are generated by various news websites.
RSS was a great idea. I think websites hate it because it enables people to take their published content and display it (or just headlines & URLs -- how much content appears in an RSS feed varies widely from headlines & URLs to 1 graphic to full articles) in a different format without giving the publisher any "eyeballs".
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
94e66a No.34908
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
94e66a No.35009
>>33828
Looks good! Compared entire file with previously deployed one, added personal tweaks, installed, looks like a winner.
pbColor: "#05C80C", ''//''Muh Mods Make previous bread color dark blue
nopeLabel: "Blacklist", ''//''Muh Mods
Thanks.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
94e66a No.35010
>>35009
Weird how 8ch code tag inserts pair of single quotes around // - ignore what I dint type!
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
94e66a No.35013
>>35009
Wrong color dang it.
Ever edit your JS directly and forget to save the file?
pbColor: "#0000cc", // previous bread color, dark blue
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
679f1d No.35043
>>35010
It's a board filter designed to keep URLs from being turned into links. See: https://8ch.net/settings.php?board=qrb
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
d275b7 No.40421
Can anybody give me the real rundown on Cloudflare?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
6ca8cc No.50566
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.