sockymcsockerson: (02)Socky the Moogle ([personal profile] sockymcsockerson) wrote in [site community profile] dw_nifty,
@ 2012-06-04 08:38 am UTC
  • Previous Entry
  • Add to Memories
  • Tell someone about this!
  • Next Entry
Entry tags:browser extension, user scripts, user styles
Hello!

I don't know about you, but one of the few changes I actually did like in LJ was the handy 'new' comment things that popped up when you revisted a page. Fortunately, there is a way to implement them in DW and make them work in the same way. The steps I'm going to detail have been tried and tested in both Firefox and Chrome, and should work without much problems.

1. If you're using Firefox, go grab Greasemonkey, and if you're using Chrome, Tapermonkey is the equivalent! It'll make it easier for what we're going to do next.

2. Mosey on over to LJ New Comments on userscripts.org. Don't worry about the name, it works just fine for Dreamwidth too. Click install, and everything should take care of itself. Now, what'll happen if you go to the comments page of a post is that new comments will show up like so:



That's good, but I think we can do a little better. Also, clicking the 'NEW' link to expand comments doesn't really seem to be necessary, since the 'expand' button works fine on Dreamwidth, so we'll look into taking that out as well. It won't affect the functionality of the script, I promise.

3. What you're going to do now is to open the script up. In Tapermonkey this should be fairly straightforward- click on the small icon, go to options, then double click on the 'LJ New Comments' script, which'll bring you straight to the Editor. In Firefox, you'll have to go to Manage User Scripts and edit it from there. (If just selecting 'Edit this User Script' doesn't work, right click on the script itself and select 'Show Containing Folder', then select '60535.user'. It should automatically open up in Notepad.)

4. Now do a case sensitive search for "NEW". That should bring you to a section of the code that looks like this:



See that highlighted bit there? That's what you're going to replace now. What you replace it with depends on whether you want a bright yellow appearance in your new script, or a more normal yellow tone. Take a look at both of those!

5. Replace that highlighted bit in the last point with either:

<b><font color=yellow>*NEW*</font></b> for the bright yellow version

OR

<b><font color=FDD017>*NEW*</font></b> for the normal yellow version, depending on what you prefer.

6. Hit save, and refresh your page! You should be good to go.

If you have any other questions about this, leave a comment and I'll see what I can do. Much thanks to pw201 for making the script in the first place, and to [personal profile] majorshipper for bringing it up. The code I've described should work as it does in the screenshots, but I'm sure you could edit it however you want- if you'd prefer a bright neon pink new, for instance, then just swap out FDD017 to FF69B4 instead, and if you'd rather it say 'HEY, HEY LISTEN', then just put that instead of '*NEW*'.

I hope this works out for you!



P.S.: In case you're wondering why the screenshots I have look a lot more like they were taken on LJ than they were on Dreamwidth (and if you're wondering how to get that look for yourself), I couldn't recommend [personal profile] rainfall's wonderful Tropospherical Blue site style reskin for Dreamwidth enough. Her particular version fixes some of the bugs found in [personal profile] emiri's earlier code, and so far I have it working perfectly well in Google Chrome, widescreen. The only small problem there might be is that the original page colours (i.e. Tropospherical Purple) might display for a brief half-second or two while the page is loading, but I've found that DW pages do load really quickly and apart from that, everything's very good. For more site styles and other things, I also made a comment yesterday with a bit more information regarding all that, as well.

Edit: Just a note, if you're using Chrome, installing the script directly into the browser will probably not work. When I tried this, all the comments kept continuously showing up as new, no matter how many times I refreshed the page. [personal profile] hornpile reported something similar here, and since we're both using Chrome and both had the same issue, that does seem to have been the cause of the problem. On the other hand, script confirmed to work in Chrome on Macs! That's good news, too.

(original comment here / DW post here)


(11 comments) - (Post a new comment)
(Flat) (Top-level comments only)

montuos: boy with lightbulb over head (bright idea)


[personal profile] montuos
2012-06-05 01:14 am UTC (link)
That's nifty! *colors "NEW" red* Thank you!

(Reply to this)  (Thread


sockymcsockerson: (01)


[personal profile] sockymcsockerson
2012-06-05 06:25 am UTC (link)
Aw, you're welcome! I'm glad I could've helped. The 'new' comment things actually did make large posts on LJ a lot faster to read, and being able to implement them in DW is something that made a lot of difference to me.

(Reply to this)  (Thread from start)  (Parent


alchemise: my hand with sonic screwdriver, text "I love my sonic screwdriver" (DW: sonic)


[personal profile] alchemise
2012-06-05 01:14 am UTC (link)
Thanks for this, your instructions worked perfectly!

(Reply to this)  (Thread


sockymcsockerson: (02)


[personal profile] sockymcsockerson
2012-06-05 06:29 am UTC (link)
Glad to hear that! This was one of the handier scripts I found, so getting it working like so was definitely something I thought of as useful.

(Reply to this)  (Thread from start)  (Parent


sally_maria: (Hornblower - Even Chance)


[personal profile] sally_maria
2012-06-05 03:49 pm UTC (link)
Thank you. :-)

I've been using the New Comments script for years, long before the LJ implementation, but I do like being able to change the colour - red is much easier to see.

(Reply to this


musyc: Silver flute resting diagonally across sheet music (B/W: Flute)


[personal profile] musyc
2012-06-08 04:02 am UTC (link)
Oh, this is fun, and I really like being able to see a flag for new comments on the site-schemed pages. However, it really bothers me to have the "new" indicator on my reading list. I tried poking at the code, but I don't speak javascript. What bit could I take out to get rid of the reading page flag but keep the comment page flag?

(Reply to this)  (Thread


sockymcsockerson: (03)


[personal profile] sockymcsockerson
2012-06-08 05:29 pm UTC (link)
I'm sorry, I tried to poke around but I'm not really sure what the problem you're having is. Could you maybe take a screenshot of your reading list to show me where things are turning up? (Can't promise that I can fix it, but I'd definitely like to try!)

Last edited 2012-06-08 05:30 pm UTC

(Reply to this)  (Thread from start)  (Parent


marahmarie: Sheep go to heaven, goats go to hell (sheep)

Fascinating stuff..


[personal profile] marahmarie
2012-06-18 07:35 am UTC (link)
Does this also work with Blank Canvas Script Handler? Can Chrome normally handle scripts without any installer at all or does it always need something like TM or BCSH to handle them smoothly (I'm trying to figure out why exactly Chrome would fail on this script with direct install, if by that you mean installing without a GM-like installer)? *feels confused*

(Reply to this)  (Thread


sockymcsockerson: (02)

Re: Fascinating stuff..


[personal profile] sockymcsockerson
2012-06-18 07:51 am UTC (link)
I think the blank canvas script handler should be fine! Not entirely sure, though, since I haven't tried it myself.

Chrome normally doesn't have problems handling scripts without installer. I've tried installing other scripts and those work okay. For some reason this one just doesn't work without one.

I have no idea why Chrome fails with this script on direct install, and yeah, I did mean installing without a GM-like installer for that.

Hope that helps?

(Reply to this)  (Thread from start)  (Parent)  (Thread


marahmarie: Sheep go to heaven, goats go to hell (sheep)

Re: Fascinating stuff..


[personal profile] marahmarie
2012-06-19 06:25 am UTC (link)
Chrome normally doesn't have problems handling scripts without installer.

http://stackoverflow.com/questions/5258989/manually-adding-a-userscript-to-google-chrome

I guess, if you say so, (I swear I wouldn't know since I've always used BCSH to run the scripts I author) but according to the thread linked to above, "scripts installed this way have severe limitations". Granted that thread was posted over a year ago, and granted Chrome has probably had 157 updates since then, so maybe GM/JS scripts direct-installed these days works much better right out of the box. Just curious as to what the problem with your script was, but to read the aforementioned thread the problem is not with your script at all, but with Chrome's native handling of all scripts in general (which was honestly more like what I expected to find). Never tried Tapermonkey, will have to give it a shot. Thanks for your post. :)

(Reply to this)  (Thread from start)  (Parent


woggy: (Hi Frog)


[personal profile] woggy
2012-11-03 06:08 am UTC (link)
Works like a charm! Thanks a bunch. :D

(Reply to this



(11 comments) - (Post a new comment)
(Flat) (Top-level comments only)