You are either not logged in or not registered with our community. Click here to register.
 
December 08, 2016, 06:08:20 AM

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

Click here if you are having problems.
Default Wide Screen Beige Lilac Rainbow Black & Blue October Send us your theme!

Hark!  The Herald!
Holiday Issue 2016

Wiki Blogs Dicebot

Author Topic: Greasemonkey Script  (Read 26747 times)

0 Members and 1 Guest are viewing this topic.

Offline SsiethTopic starter

Greasemonkey Script
« on: June 09, 2015, 05:27:11 PM »
Hi there,

I hope this is the write place to post and apologies if it isn't.  I'm one of those fussy people who never has the feature that they want on a site.  Fortunately, for me at least, I'm also a programmer.  So - I have a tendency to write scripts to tack on the features I desire and then, if I can kludge them into a not-too-buggy state, I make them available for anyone else who also desires the same features.

The scripts work using a firefox plugin called Grease Monkey (http://www.greasespot.net/) or a chrome plugin called Tamper Monkey (https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo).

Then you just pop my script in there and it adds in the extra features. 

The script can be found at:  https://openuserjs.org/scripts/Ssieth/Elliquiy_Improver

Feel free to let me know if it's useful, useless, confusing, broken etc :)   If you want other features let me know too :)

So far those features are:

Hide Pictures
This hides avatars and images in posts.  Why?  I wanted the script to be able to hide them at work so I could use Elliquiy without fear of anyone glancing over and getting too interested in what I was doing.

Quick Topics
Bookmarks by another name... this is a drop-down menu that has links to specific topics.  You can set/remove topics with a new button on the topic button bar.

To be honest I created this before I was aware of the bookmarks feature but I like it better as I like my navigation to be all up there in that menu bar.

Snippets
The ability to store frequently used bits of bbcode/text to be pasted into posts/PMs.  I created this to make it easier to post with a standard character header.  The interface is still a bit clunky... to remove a Snippet you have to click "Add Snippet" and then type in the snippet name with no body text.

Offline Blythe

Re: Greasemonkey Script
« Reply #1 on: June 09, 2015, 06:30:18 PM »
Very useful! I like all three features. :-) (I could hug you for the quick-topics alone; I suspect I'll use that all the time!)

I see that snippets can be added into the body of a message--would it be possible to be able to add them to a subject line of a PM or post? I was unable to do that when fiddling about with this. ^^

Offline SsiethTopic starter

Re: Greasemonkey Script
« Reply #2 on: June 09, 2015, 06:32:25 PM »
Very useful! I like all three features. :-) (I could hug you for the quick-topics alone; I suspect I'll use that all the time!)

I see that snippets can be added into the body of a message--would it be possible to be able to add them to a subject line of a PM or post? I was unable to do that when fiddling about with this. ^^

Hmmm... there's nothing that would prevent adding them to the subject line.  It's just working out the UI for how a user selects one or the other.  I'll give it some thought :)

Offline Blythe

Re: Greasemonkey Script
« Reply #3 on: June 09, 2015, 06:34:55 PM »
Thank you very much! Both for looking into the subject line thing and for making the nifty tools in the first place!  :-)

Offline SsiethTopic starter

Re: Greasemonkey Script
« Reply #4 on: June 10, 2015, 03:41:40 PM »
OK - I've moved to version 1.0.0 (you'll probably have to manually install it again as I don't think the host I use supports auto-uptdates).

This version overhauls the snippets behaviour a bit.  Still not simple way to delete them but.... the way that they paste into forms has been changed to follow the focus of your cursor so:

  • You can now paste to either message box or subject (in post or PM) depending on where your cursor was last :)
  • You can now paste anywhere in the message box.  If there's no selected text then the snippet is place where the cursor is.  If there is selected text then it is replaced by the snippet

Hope that helps :)

Offline Denivar

Re: Greasemonkey Script
« Reply #5 on: June 11, 2015, 10:00:07 PM »
This is really cool, love the snippets especially. :)

Offline Blythe

Re: Greasemonkey Script
« Reply #6 on: June 11, 2015, 10:03:49 PM »
The snippets now work in the Subject line, although they seem to auto-add to the "To" line as well in PMs, oddly, whatever the snippet is added to the Subject line. ^^;

Offline Black Howling

  • Lady Luna's Werewolf, Blitzy's Otis, Lizzy's Alpha Comfort, Sephy's Cloak, Vampy's Other man, Always Big and Bad
  • Knight
  • Enchanter
  • *
  • Join Date: Nov 2009
  • Location: Roaming through Gnothi's Closet....
  • Gender: Male
  • Even Bad Wolves can be good
  • My Role Play Preferences
  • View My Rolls
  • Referrals: 1
Re: Greasemonkey Script
« Reply #7 on: June 11, 2015, 11:01:15 PM »
I haven't tested all the features, but so far I'm really liking the quick topics. I've got my most viewed group pages listed there, and it really makes switching to them a lot easier.

Offline SsiethTopic starter

Re: Greasemonkey Script
« Reply #8 on: June 12, 2015, 04:09:37 AM »
The snippets now work in the Subject line, although they seem to auto-add to the "To" line as well in PMs, oddly, whatever the snippet is added to the Subject line. ^^;

OK - I've put up v1.0.2 (you need to update it manually by reinstalling I think).  That should correct the issue.

Thanks for reporting the bug... I'd probably have missed it and ended up sending out to someone I didn't intend to knowing my luck ;p

Oh - I've also taken a first stab at trying to allow snippets in the To and BCC fields (hopefully only when you intend to).  They are a bit more complex as script already runs there and you may need to tweak whatever is pasted in to get the site's own script to recognize that they need to be processed.  Please let me know how it goes if you use that feature :)

Offline SsiethTopic starter

Re: Greasemonkey Script
« Reply #9 on: June 12, 2015, 05:22:12 PM »
v1.1.0 is now up for download with a new feature:

Unread Replies Count
New in v1.1.0 - this shows the count of unread replies to your post alongside the link to unread replies in the top right of the screen.  So you don't have to click it to know if you have any :D

Offline SsiethTopic starter

Re: Greasemonkey Script
« Reply #10 on: June 12, 2015, 08:51:36 PM »
And another update.. it's been one of those productive scripting days:

v1.1.3

Unread Replies Menu
A list of unread replies.. in a menu.  See the title was meaningful.
Unread replies counts and menus are also updated periodically (every 3 minutes currently but you can adjust it in the script).  UI settings coming in the next release.

Offline SsiethTopic starter

Re: Greasemonkey Script
« Reply #11 on: June 13, 2015, 03:53:49 PM »
And another update - v1.2.0.

There's now an option in the settings to switch off the replies auto-update or change the timing of it.

The links in the replies menu now go to the last post rather than the first.

Offline SsiethTopic starter

Re: Greasemonkey Script
« Reply #12 on: June 15, 2015, 03:48:08 PM »
New version...

v1.3.0...

There's now a button at the top of each topic that lets you choose to ignore unread replies for that topic.  If you click the button it is immediately replaced by a button that lets you cancel the ignore and also hides the topic from the Relies menu and the count of unread replies.

Offline SsiethTopic starter

Re: Greasemonkey Script
« Reply #13 on: June 18, 2015, 07:53:37 AM »
I meant to post this yesterday and forgot....

New version up (1.4.x) which adds automated updates to the PM count link at the top of the screen.  You can set the interval (in minutes) in the settings.  Setting it to 0 disables the feature.

I know that there's a feature built in that can pop up a message to show you new PMs but I was finding that a bit intrusive if I was in mid-flow with a post so created this as a less intrusive option.

Please be aware that this, and the auto-update for replies both create an extra hit on the site (grabbing only the HTML rather than all the images etc) so please don't go setting the intervals any lower than you need them to be.  No point creating extra load on E's servers.  That just slows everything down for everyone and potentially increases the hosting bills.

Offline Nymphadora

  • Tonks, if she were shy. The knitting Nymph.
  • Dame
  • Enchanter
  • *
  • Join Date: Aug 2013
  • Location: Nestled in New York
  • Gender: Female
  • You can't take the sky from me.
  • My Role Play Preferences
  • View My Rolls
  • Referrals: 0
Re: Greasemonkey Script
« Reply #14 on: June 18, 2015, 08:15:51 AM »
This is awesome! I'm loving the Quick Topics so far and will play with SNippets after work!

Thanks for this!

Offline SsiethTopic starter

Re: Greasemonkey Script
« Reply #15 on: June 18, 2015, 08:27:30 AM »
Thanks for the feedback Nymphadora, it's always great to hear when someone is usefully using your code :)

I'm also working on some features to selectively hide/show bits of the header and footer for those of us on much shorter screens (my laptop is dreadful in this respect).  I need to work out what combinations of elements work and test it to make sure that I don't allow errors to creep in by hiding sections that other bits depend on.  I also want to make sure it's not possible to hide the donations bit unless you're already a dame/knight or admin type personage.

More to come on that soon.  If I can work out how to readily detect status and make it possible for folks who've already contributed to hide the donation bit then I'll check with the admins, first, before allowing that.  I don't want to annoy anyone with the script :)
« Last Edit: June 18, 2015, 08:29:00 AM by Ssieth »

Offline SsiethTopic starter

Re: Greasemonkey Script
« Reply #16 on: June 18, 2015, 02:50:49 PM »
OK - I managed to fix the issues I had with the header/footer customization.  I also managed to find a way to salve my conscience regarding removing some of the items.  In particular:

You can remove loads of bits and bobs but... the news box and the donate section can only be removed by folks who've donated (Dames, Knights etc) and admins (Gods, Goddesses etc).  Even if you can and do remove the donate block, doing so will add a donate menu to the main menu which has links in there to patreon, the paypal page etc :)

So - v1.5.0 is up there.

Oh - I've also added sections to the settings :)

Offline Blythe

Re: Greasemonkey Script
« Reply #17 on: June 18, 2015, 09:13:33 PM »
Absolutely loving the extra functionality, Ssieth.  And it's very awesome you've taken the time out to do all this! <3

(Snippets are still appearing in the "To" line in PMs when I want to use a snippet in a PM Subject line, alas! ;_; )


Offline Nymphadora

  • Tonks, if she were shy. The knitting Nymph.
  • Dame
  • Enchanter
  • *
  • Join Date: Aug 2013
  • Location: Nestled in New York
  • Gender: Female
  • You can't take the sky from me.
  • My Role Play Preferences
  • View My Rolls
  • Referrals: 0
Re: Greasemonkey Script
« Reply #18 on: June 18, 2015, 09:58:38 PM »
I have just noticed, since I was busy most of the day till now, that when I click one of my Quick Topics, it goes to the first post in the thread and displays all in the thread. Easy enough to click Go Up but still not ideal.

It is awesome having just all of my Group RP threads in one place :D

I found the way to change that at line 380 (or 381) I took out 'all' and changed 'last' to 'first' 

For me this is the preference as it then displays the newest post and the newest page. Others, yourself included, may prefer the other way.

Mostly, I'm just amazed I could figure it out on my own! ;)

Offline SsiethTopic starter

Re: Greasemonkey Script
« Reply #19 on: June 19, 2015, 04:31:57 AM »
Many thanks, guys for helping me locate the bugs :)  I'm really enjoying getting my teeth into a GM script project again and, compared to some other sites I've written scripts for, Elliquiy is nice and easy to work with :)

There's a new version out (v1.6.0) that address some bugs you've found and adds some new features:

Absolutely loving the extra functionality, Ssieth.  And it's very awesome you've taken the time out to do all this! <3

(Snippets are still appearing in the "To" line in PMs when I want to use a snippet in a PM Subject line, alas! ;_; )

Er.. yeah.. my bad for messing up my version control and reverting a couple of functions back to what they were a few versions back... should now be fixed :)

I have just noticed, since I was busy most of the day till now, that when I click one of my Quick Topics, it goes to the first post in the thread and displays all in the thread. Easy enough to click Go Up but still not ideal.

It is awesome having just all of my Group RP threads in one place :D

I found the way to change that at line 380 (or 381) I took out 'all' and changed 'last' to 'first' 

For me this is the preference as it then displays the newest post and the newest page. Others, yourself included, may prefer the other way.

Mostly, I'm just amazed I could figure it out on my own! ;)

Ah - this was as a result of the option you've got ticked in your profile to view most recent post first (I didn't even know it existed until I went hunting).  I've now put an option in the UI that allows you to choose which behaviour you want:

  General Features/Quick topics goes to last post?

If it's checked (and it is by default) then the quick topics work as they did before, heading to the post at the bottom of the list of all posts.  If it's not checked then it just loads the first page of topics and sits on the top one.  For what you want, Nymphadora  (and I want now I've found that profile setting and checked it) - you want it unchecked.

New Features
Not much this time... I've added the version number for the script and a link to the current version of the script under the Script Settings menu.  I've also made a lot of movement of code inside the script to group things in more sensible blocks.  That should make my life a bit easier now the script is getting bigger :)

Offline Nymphadora

  • Tonks, if she were shy. The knitting Nymph.
  • Dame
  • Enchanter
  • *
  • Join Date: Aug 2013
  • Location: Nestled in New York
  • Gender: Female
  • You can't take the sky from me.
  • My Role Play Preferences
  • View My Rolls
  • Referrals: 0
Re: Greasemonkey Script
« Reply #20 on: June 19, 2015, 12:04:25 PM »
Many thanks, guys for helping me locate the bugs :)  I'm really enjoying getting my teeth into a GM script project again and, compared to some other sites I've written scripts for, Elliquiy is nice and easy to work with :)

There's a new version out (v1.6.0) that address some bugs you've found and adds some new features:

Er.. yeah.. my bad for messing up my version control and reverting a couple of functions back to what they were a few versions back... should now be fixed :)

Ah - this was as a result of the option you've got ticked in your profile to view most recent post first (I didn't even know it existed until I went hunting).  I've now put an option in the UI that allows you to choose which behaviour you want:

  General Features/Quick topics goes to last post?

If it's checked (and it is by default) then the quick topics work as they did before, heading to the post at the bottom of the list of all posts.  If it's not checked then it just loads the first page of topics and sits on the top one.  For what you want, Nymphadora  (and I want now I've found that profile setting and checked it) - you want it unchecked.

New Features
Not much this time... I've added the version number for the script and a link to the current version of the script under the Script Settings menu.  I've also made a lot of movement of code inside the script to group things in more sensible blocks.  That should make my life a bit easier now the script is getting bigger :)

Love the update! This is totally awesome!

Offline SsiethTopic starter

Re: Greasemonkey Script
« Reply #21 on: June 19, 2015, 01:58:50 PM »
Love the update! This is totally awesome!

*tips hat*

Glad to be of service :)

I'm not sure what's up next for the script unless more bugs are found. If anyone has anything in mind that they would like to see then please do let me know :)

Offline Nymphadora

  • Tonks, if she were shy. The knitting Nymph.
  • Dame
  • Enchanter
  • *
  • Join Date: Aug 2013
  • Location: Nestled in New York
  • Gender: Female
  • You can't take the sky from me.
  • My Role Play Preferences
  • View My Rolls
  • Referrals: 0
Re: Greasemonkey Script
« Reply #22 on: June 22, 2015, 11:38:48 AM »
*tips hat*

Glad to be of service :)

I'm not sure what's up next for the script unless more bugs are found. If anyone has anything in mind that they would like to see then please do let me know :)


Is it possible to have unread numbers in the Quick Topics?
That would be cool. No biggie if not.

Offline SsiethTopic starter

Re: Greasemonkey Script
« Reply #23 on: June 22, 2015, 11:43:26 AM »

Is it possible to have unread numbers in the Quick Topics?
That would be cool. No biggie if not.

That's a good question and the answer is a yes but/no but sort of thing.  It would be possible but it would put a fair amount of strain on the site (which I would rather avoid) as it would required loading each topic page and having the code examine it for new posts.

If the actual count of new items was not so important but rather you were happy with just a "there is new replies here" type indicator (maybe in the form of an asterix or similar?) then it would be a much less load-intensive operation as it could use the same data that's used for the replies count/menu which is gleaned from a single page.

Would that be of use?

Offline Nymphadora

  • Tonks, if she were shy. The knitting Nymph.
  • Dame
  • Enchanter
  • *
  • Join Date: Aug 2013
  • Location: Nestled in New York
  • Gender: Female
  • You can't take the sky from me.
  • My Role Play Preferences
  • View My Rolls
  • Referrals: 0
Re: Greasemonkey Script
« Reply #24 on: June 22, 2015, 11:46:11 AM »
That's a good question and the answer is a yes but/no but sort of thing.  It would be possible but it would put a fair amount of strain on the site (which I would rather avoid) as it would required loading each topic page and having the code examine it for new posts.

If the actual count of new items was not so important but rather you were happy with just a "there is new replies here" type indicator (maybe in the form of an asterix or similar?) then it would be a much less load-intensive operation as it could use the same data that's used for the replies count/menu which is gleaned from a single page.

Would that be of use?

I definitely wouldn't want to put extra strain on the site for sure! Yes, just having some kind of indicator would be awesome! Again, no biggie if not.

Thanks so much!