Post your greasemonkey scripts - Printable Version
-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: General (/forumdisplay.php?fid=11)
+---- Forum: Forum & Website (/forumdisplay.php?fid=13)
+----- Thread: Post your greasemonkey scripts (/showthread.php?tid=92321)
Post your greasemonkey scripts by matty on 09-22-2009 at 07:40 PM
Just as the thread title says.
This will add Inivisible mode options to the header:
js code: // ==UserScript==
// @name Plus! Forum
// @namespace http://shoutbox.menthix.net/*
// @include http://shoutbox.menthix.net/
// ==/UserScript==
var vsubmit = '3a794272e7ed125a'; // needs to be changed to your validsubmit id from the usercp.php page.
var option_on = 'invisible=yes';
var option_off = 'invisible=no';
var url = 'http://shoutbox.menthix.net/usercp.php';
addInvisibleMode ( );
// Functions
function addInvisibleMode () {
with ( getId ( 'contentheaderright' ) )
{
innerHTML += '<br />Invisible Mode <a href="#" OnClick="javascript:ajax ( \''+url+'\' , \'action=do_options&validsubmit='+vsubmit+'&'+option_off+'\' );">on</a> / <a href="#" OnClick="javascript:ajax ( \''+url+'\' , \'action=do_options&validsubmit='+vsubmit+'&'+option_off+'\' );">off</a></form>';
}
}
function getId ( id ) { return document.getElementById ( id ); }
unsafeWindow.ajax = function ( url , params ) {
var xmlhttp = new XMLHttpRequest();
xmlhttp.open('POST', url, true);
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.onreadystatechange=function() {
if ( xmlhttp.readyState === 4 && xmlhttp.status === 200 ) {
window.location.reload();
}
}
xmlhttp.send( params );
}
First time making a GM script
RE: Post your greasemonkey scripts by WDZ on 09-22-2009 at 08:17 PM
You shouldn't just submit one option and not the rest... any values that aren't specified will be reset to default. :/
RE: Post your greasemonkey scripts by Mnjul on 09-22-2009 at 08:24 PM
quote: Originally posted by WDZ
You shouldn't just submit one option and not the rest... any values that aren't specified will be reset to default. :/
Impose isset() checking on incoming variables then
RE: Post your greasemonkey scripts by matty on 09-22-2009 at 08:28 PM
quote: Originally posted by WDZ
You shouldn't just submit one option and not the rest... any values that aren't specified will be reset to default. :/
I happened to notice this; all options were set to what they are by default... stupid design.
RE: Post your greasemonkey scripts by WDZ on 09-22-2009 at 08:32 PM
quote: Originally posted by Mnjul
Impose isset() checking on incoming variables then
I do, and when a variable isn't set, or it's invalid, it gets set to default.
quote: Originally posted by matty
stupid design
I disagree, as that code was never meant to be used for anything other than handling the form at usercp.php?action=options. I'll see if I can fix it, but it's going to take a major rewrite.
RE: Post your greasemonkey scripts by andrey on 09-22-2009 at 09:07 PM
This script replaces the thread icons (, , , etc.) with the coloured dot icons I posted some time ago. (thread: improved thread icons..)
I think those and the other icons still are somewhere on msghelp.net/files/..
RE: Post your greasemonkey scripts by toddy on 09-22-2009 at 10:49 PM
is it just me that matty's script doesn't work for? and before u ask, yes i changed the submit ID
RE: Post your greasemonkey scripts by WDZ on 09-23-2009 at 12:14 AM
Alright, I rewrote some code in usercp.php so it will only update database fields for which the user specified a value. =p
I also hacked matty's script to fix some bugs, make it compatible with Opera as well as Firefox, and make it dynamically grab the security token, which shouldn't be hard-coded because it's subject to change.
http://shoutbox.menthix.net/files/invisiblemode.user.js
RE: Post your greasemonkey scripts by Chris4 on 09-23-2009 at 01:47 AM
Andrey, can't get your script to work?
Downloaded it, renamed it to file.user.js and installed it, yet doesn't change anything?
RE: Post your greasemonkey scripts by WDZ on 09-23-2009 at 01:54 AM
quote: Originally posted by Chris4
Andrey, can't get your script to work?
Downloaded it, renamed it to file.user.js and installed it, yet doesn't change anything?
Are you using http://www.msghelp.net/? It looks like the script only works without a subdomain.
RE: Post your greasemonkey scripts by Chris4 on 09-23-2009 at 02:08 AM
quote: Originally posted by WDZ
quote: Originally posted by Chris4
Andrey, can't get your script to work?
Downloaded it, renamed it to file.user.js and installed it, yet doesn't change anything?
Are you using http://www.msghelp.net/? It looks like the script only works without a subdomain.
Yeah I modified it to *msghelp.net/* and it's enabled on the page, but doesn't change anything.
RE: Post your greasemonkey scripts by toddy on 09-23-2009 at 02:12 AM
quote: Originally posted by Chris4
quote: Originally posted by WDZ
quote: Originally posted by Chris4
Andrey, can't get your script to work?
Downloaded it, renamed it to file.user.js and installed it, yet doesn't change anything?
Are you using http://www.msghelp.net/? It looks like the script only works without a subdomain.
Yeah I modified it to *msghelp.net/* and it's enabled on the page, but doesn't change anything.
doesn't work here either
RE: Post your greasemonkey scripts by NanaFreak on 09-23-2009 at 02:15 AM
Its not working because of the case statements...
case 'http://shoutbox.menthix.net/images/folder.gif':
it needs to have the www. in there as well...
or you could just make it case 'folder.gif': but thats fairly unsafe
RE: Post your greasemonkey scripts by WDZ on 09-23-2009 at 02:54 AM
Here's a modified version that seems to work fine with or without the www.
* WDZ might leave it enabled for a while to see how he likes it
RE: Post your greasemonkey scripts by matty on 09-23-2009 at 01:14 PM
quote: Originally posted by WDZ
Alright, I rewrote some code in usercp.php so it will only update database fields for which the user specified a value. =p
I also hacked matty's script to fix some bugs, make it compatible with Opera as well as Firefox, and make it dynamically grab the security token, which shouldn't be hard-coded because it's subject to change.
I can't get it to work... weird...
RE: Post your greasemonkey scripts by Nathan on 09-23-2009 at 06:58 PM
WDZ is still the same . But no where near as "lazy". He re-wrote the usercp panel for a script that few people will use?wdz has too much free time /me thinks lol
RE: Post your greasemonkey scripts by -dt- on 09-24-2009 at 05:54 AM
I made quite a few a while ago, some still work...
Shoutbox custom commands
Adds nifty tags and command to annoy people on the shoutbox with
tab completion of names
commands such as
/dt
/moo
/kill <name>
/dns <site>
/objslap <name>
/wave <name>
/total
/rand <name>
/time
/noparse
/exit
/mimic
it also adds quickquote to the shoutbox, ctrl+click a shout to quote
Tags:
(!T) (!D) (!PEOPLE)
Shoutbox ajaxy refreshness
those two i know work
for more scripts that probably have died with age
http://version.thedt.net/scripts/GM/
RE: Post your greasemonkey scripts by MeEtc on 09-24-2009 at 05:49 PM
This is a script for the shoutbox that some random dude made a while ago. I forget who, he was in the spambox for a few weeks then disappeared.
RE: Post your greasemonkey scripts by andrey on 09-30-2009 at 05:55 PM
I made dt's scripts compatible with Opera and fixed some stuff that broke over time. (no idea if the web2messenger stuff still works, didn't test that)
The shoutboxcc script should work with Firefox, although I'm pretty sure I broke the betterrefresh script for Firefox..
The original betterrefresh seems to work fine in Firefox though.
shoutboxcc for Opera/Firefox
betterrefresh for Opera
In order to get shoutboxcc working in Opera, you'll need the Emulate GM functions script.
for /rand to work, get the Cross-domain XMLHttpRequest script. Then you'll need to have the Emulate GM functions script use the new XMLHttpRequest by changing the line "var request = new XMLHttpRequest();" to "var request = new opera.XMLHttpRequest();"
|