FIMFiction UserScripts 383 members · 0 stories
Comments ( 41 )
  • Viewing 1 - 50 of 41
Selbi
Group Admin

As requested here.

Comment IDs without Auto-Scroll

Adds a button with the ID of a comment next to it, which also doesn't automatically scroll to the reply box when clicked.

Awesome! This is great!

Looks neat. I'll try it when I'm again on my pc.

Selbi
Group Admin

Update: Changed # to >>

Can't believe I forgot that. :ajsleepy:

2406454
This is cool! Thanks! (Also, my first installed userscript! :yay:)

ocalhoun
Group Contributor

2406454
That'll do it!

Thanks! :twilightsheepish:

2406454
Uh, it disappears when I hit refresh.:twilightoops:

Selbi
Group Admin

2411671
That's because Greasemonkey scripts are executed once upon page loading, then never again. There are ways to make FIMFiction's refresh button reload these comment ID buttons as well, but I must admit I don't know how to do that yet.

Sorry, for now all you can do is doing a manual page refresh.

yrfoxtaur
Group Contributor

2408289 2411908
I've made a userstyle which might be useful in conjunction with this script, perhaps even instead of it.

Pin comment form to window

It tries to prevent the autoscrolling, but unfortunately the scrolling code has 300px hardcoded into it, so it still scrolls 300px when you click the "reply to" button. Otherwise it works beautifully...
EDIT: i'm a dummy. It now completely prevents the autoscrolling.

(i wanted to tighten up the comment form a little, so that the text field is just as tall as the emoticons block, but there's something weird going on with the site's CSS that has foiled me so far)
Note: compact mode may not work correctly on firefox

Basically it makes bulk reply comments easy. click the reply link, start typing, scroll down to the next one you want to reply to, repeat.

ssokolow
Group Contributor

2411908

Basically, you want to attach a callback to the completion of the AJAX request.
1. Open up Firefox's Javascript debugger in a recent enough version (may require Aurora channel).
2. Click "scripts.js" in the sidebar
3. Click the {} button to un-minify the source so it's readable. (this is what may require Aurora)
4. Type "#ajax" in the search box (The # means "in this file") and discover the GoToCommentPage function.
5. Read it and then discover that you want to call your code right after the SetupCommentQuotes(a) line.
6. Since SetupCommentQuotes is a global function, you can wrap it up like this to call your own code afterwards:

var script = document.createElement('script');
script.type = "text/javascript";
script.innerHTML = "(" + (function() {
var _SetupCommentQuotes = window.SetupCommentQuotes;

window.SetupCommentQuotes = function(a) {
_SetupCommentQuotes(a);
alert("TODO: Replace me with code to be run after every AJAX load of comments");
};
}).toString() + ")()";
document.getElementsByTagName('head')[0].appendChild(script);

(You need all that boilerplate because unsafeWindow is unsafe and not available on Chrome, so the only way to redefine SetupCommentQuotes from a userscript is to inject some Javascript into the page.)

With that, you've got an easy way to extend Knighty's "after loading/reloading a comment page" code and you don't have to write different patches for browser reload and AJAX reload since both approaches will call SetupCommentQuotes.

NOTE: The more robust and correct way would be to use a MutationObserver so it doesn't matter how Knighty implements it (MutationObservers let you say "call this code when that part of the page changes") but I've yet to get familiar with them so all I can do is offer this tutorial and this API reference I googled up.

ocalhoun
Group Contributor

2412611
Ooh, nice.
I like this one, and I'll install it on my desktop...

But it's pretty bad for small screens, since the comment block takes up too much space, leaving only a little sliver of the posted comments visible. What's worse, it prevents scrolling all the way down through the last comment. :applejackunsure:

Still, I'll try it when I get back home and have a bigger screen. It may work beautifully there.

yrfoxtaur
Group Contributor

2413867
oh! that's a good catch. I can fix the box covering the last comment. just as soon as I get back on my desktop...

I'm considering ways to make it more compact, but it'll be tricky to do right.

yrfoxtaur
Group Contributor

2413867
I've updated the style some!

It now autohides the bulkiest part of the form, and works beautifully on the mobile browser on my tablet. It shouldn't overlap the last comment when hidden, not sure if it will when shown. I can't get it to do it at all on my browser, so i'm not sure what tweaking will be necessary.

Oh, and unless you use a transparent one, onscreen keyboards are very much not freindly to this style, when in landscape mode. Portrait mode is pretty OK, though.

Selbi
Group Admin

2420021

and works beautifully on the mobile browser on my tablet

Wait what? Greasemonkey and Stylish exist for mobile browser? Fuck me, I'm so going to do some stuff there!

ocalhoun
Group Contributor

2420207
*shrug*
Maybe he has a windows tablet like me?

yrfoxtaur
Group Contributor

2420207
well...

greasemonkey is not available for mobile yet, but Stylish is, at least for Firefox.

2420346 not so much. Just a little bitty android tablet. Galaxy Tab 2 7.0

ssokolow
Group Contributor

2420354

Actually, there is a TamperMonkey app in beta for Android which is basically a simple custom browser with userscript support.

Also, the old Presto-based (12.x) versions of Opera Mobile can apparently run userscripts on any platform you can get them loaded onto.

I will agree, though, that there isn't yet a solution for userscripts on a proper, modern mobile browser.

2406454
Well, Knighty decided to be stupid and updated more stuff, rendering this script useless at the moment. Could you please fix it so that it will work again?

Selbi
Group Admin

2430866
Not only that, but knighty actually thought he was clever by adding "Hold shift to prevent scrolling to the reply box". What he doesn't know is that holding shift while clicking on something opens it up as a new window.

So yeah, will fix it.

2431011
It doesn't create a new window for me.

But I would still rather have a separate button for this, so thank you for fixing it.

Selbi
Group Admin

2431025
Updated.

2431172
Thanks. I will download the update as soon as I can get on the computer (I'm a bit wary about downloading the Tampermonkey app for the mobile).

Selbi
Group Admin

Updated!

Fully functional again.

It doesn't appear to work. You link seems to go to your Meta Checker.

Selbi
Group Admin

3690556
Wow, how did I not notice that before? :twilightangry2:

Fixed. Thank you.

3690663 The comment without autoscroll script is messing with the feed, making all the entries very wide.

knighty
Site Owner

2431011 I didn't realise opened in new window on Firefox. You really are a nasty piece of work, it's a constant battle fighting the urge to ban your arrogant arse.

Selbi
Group Admin

3690755
I feel like my past is haunting me, even though that was 41 weeks ago.

I'm terribly sorry, knighty. :(

I really didn't know better and I didn't mean to insult you or come across as arrogant. I didn't even know you are aware of this group's existence...

Now I feel really terrible. Seriously, if there's anything to make up for my stupidity please tell me

knighty
Site Owner

3691012 I love user scripts. I feel honoured in a way that people want to spend their own time improving aspects of the site for some people. I take offence to people suggesting that bugs or missing features are because I'm some stupid incompetent idiot, rather than someone who is designing and developing a website with a broad array of features basically on his own from *scratch*. Another reason a lot of these features don't exist is because you get issues where users are overloaded with too many features and the design becomes a confusing muddled mess, so sometimes it's better to restrict what people can do for the sake of ease of use and consistency.

Selbi
Group Admin

3691065
Just to make one thing clear right from the start: At no point am I even considering the thought of you being a stupid incompetent idiot for not having thought of some feature. In fact, scratch the part about the feature, because I think you are a wonderful person and programmer. Heck, the simple fact that you are able to pull off building this website from scratch deserves twice the amount of respect I can physically give. I'm light years away from even reaching your front yard of talent.

When I advertise my pathetic little scripts I usually don't think what I write would have consequences. For once because, as I said, I didn't know you were even aware of this group, but also because I try (and fail badly) to be funny by discrediting the people who put all their heart and blood into this site. Not because I want to actually insult anyone, but really only because I'm believing to be funny.

There's not a single user script I use and actually need. Everything was mostly done out of a "Hey, that would be cool to have" kind of thought. That and me having a general interest in becoming better at what I do (you've probably already made the realization that my coding quality is equal to a paper bag filled with poop).

After having read your Twitter I can only make assumptions of how truly offended you feel. But I've been anticipating this update ever since I first saw the announcement, and when it finally came I was completely blown away of how many awesome new things there were. However, there's the YouTube-effect for every website that gets a major overhaul. Suddenly two minimal changes that the devs didn't even waste a second thought on makes people bring out forks and torches. I never had that intention, but at the same time I was gullible enough to believe everything I do automatically makes it better. A terrible, terrible mistake I've now learned to avoid.

Even though it probably doesn't make the impression that I feel sorry, I can say that I truly do. Getting crushed down from one of the people you respect the most on a certain website—the owner nonetheless—makes me just want to hit myself with a baseball bat on the head over and over again.

ocalhoun
Group Contributor

3691065

so sometimes it's better to restrict hide what people can do for the sake of ease of use

Fixed ^.^
Keep the features, but hide them inside some kind of menu or only make them visible in 'advanced mode' or something.

I hate this trend in coding where features are removed because it's assumed people are too stupid to use them. Sure, that is true in a lot of cases... but the advanced features should be kept around, behind the scenes, for users who are capable of using them.

A good example of where you actually did this very well is in the bbcode. You've got tags like [ right_insert ] and [ spoiler ] that are not cluttering up or confusing the code buttons above the text box, but they are still available and still work for users who know how to do it. By doing so, you kept the interface clean and simple while still making the more advanced features available for those who know how.

ocalhoun
Group Contributor

2406454
I love this script, but now it's causing problems...

(I recently replaced my computer and reloaded all of my browser and extensions... it could be a 'just me' problem. I'm looking into it.)
(But, it could also be because the script is causing some conflicts with recent site changes.)

Issues:
When this script is enabled:
-Comment pages (anywhere on the site) will load forever if refreshed.
-Post identifiers (like 1234567) don't get translated into the username of the poster, though the links still work.
-Clicking on a link directly to a post doesn't work if the post is on page 2 or later of the comment section; the comment section doesn't automatically refresh to that page.
-The join/leave button on groups stops working.
-The emoticon menu on the text editor for all comment pages stops working. (Does absolutely nothing when clicked; the other buttons on it all still work fine.)
-The previews for notifications don't load.

Disabling this one script fixes all of those issues*... which is strange, because a couple of them aren't comment related at all.
Because this script is so incredibly useful to me when I need to reply to a lot of comments, in the meantime, I'll be selectively enabling/disabling it when I need to use it... but obviously, that's not quite optimal.

Is it doing this for anyone else, or is it a local problem for me, conflicting with some other browser extension?
And if it is doing it for everyone, any chance for a bugfix?

*I have other scripts running, and they don't cause this problem, so I know at least it's not greasemonkey itself causing the problem.

Selbi
Group Admin

3770658
I will look into it. Already have a pretty big idea what the issue is. In a nutshell: my past self wasn't that efficient.

ocalhoun
Group Contributor

3771024
Selbi is best coder! ^.^

Selbi
Group Admin

3771046
I figured out that most of the problems simply came from the script embedding jQuery a second time. Turns out FIMFiction has that by default now, though probably runs a different version. Therefore legacy clashing, therefore JavaScript abortion, therefore lots of shit. I bet there were even more problems that involved JS.

The only problem I wasn't able to dynamically fix is having the comment IDs when a page is refreshed. There's probably a way to catch a response from the site whether a comment page has successfully finished reloading, but I have no idea how to do so yet. What I did instead was adding a small button next to the page selector to do it manually.

If I ever find out how to do it automatically, I'll be sure to let you know, but for now I hope this works.

Download

ocalhoun
Group Contributor

3772073
Oh, cool! It should be even better than it was before now!
:rainbowkiss: You're the greatest!

ocalhoun
Group Contributor

3772073
*tests it out*
Yep, works perfectly!

You're the best! ^.^
If there's ever anything I can do to help you out, let me know. :raritywink:

Selbi
Group Admin

3772358
I did mention that here before. If you could (ab)use your super popularity to get us some more people into this group, you would be doing a lot of people a huge favor. :pinkiehappy:

ocalhoun
Group Contributor

3772400
:rainbowderp:
I didn't even notice that.
I think I will! ^.^

Selbi
Group Admin

3772526
Awesome! Thanks a lot, bro!

  • Viewing 1 - 50 of 41