Post your greasemonkey scripts |
Author: |
Message: |
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
O.P. Post your greasemonkey scripts
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
Attachment: contentheaderright.png (5.13 KB)
This file has been downloaded 525 time(s).
This post was edited on 09-22-2009 at 07:44 PM by matty.
|
|
09-22-2009 07:40 PM |
|
|
WDZ
Former Admin
Posts: 7106 Reputation: 107
– / /
Joined: Mar 2002
|
RE: Post your greasemonkey scripts
You shouldn't just submit one option and not the rest... any values that aren't specified will be reset to default. :/
|
|
09-22-2009 08:17 PM |
|
|
Mnjul
forum super mod
plz wub me
Posts: 5396 Reputation: 58
– / /
Joined: Nov 2002
Status: Away
|
RE: Post your greasemonkey scripts
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
|
|
09-22-2009 08:24 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
O.P. RE: Post your greasemonkey scripts
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.
|
|
09-22-2009 08:28 PM |
|
|
WDZ
Former Admin
Posts: 7106 Reputation: 107
– / /
Joined: Mar 2002
|
RE: Post your greasemonkey scripts
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.
This post was edited on 09-22-2009 at 08:38 PM by WDZ.
|
|
09-22-2009 08:32 PM |
|
|
andrey
elite shoutboxer
Posts: 795 Reputation: 48
– / /
Joined: Aug 2004
|
RE: Post your greasemonkey scripts
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/..
Attachment: msghelp-colour-thread-icons.js.txt (10.6 KB)
This file has been downloaded 230 time(s).
|
|
09-22-2009 09:07 PM |
|
|
toddy
Veteran Member
kcus uoy
Posts: 2573 Reputation: 49
– / /
Joined: Jun 2004
|
RE: Post your greasemonkey scripts
is it just me that matty's script doesn't work for? and before u ask, yes i changed the submit ID
|
|
09-22-2009 10:49 PM |
|
|
WDZ
Former Admin
Posts: 7106 Reputation: 107
– / /
Joined: Mar 2002
|
RE: Post your greasemonkey scripts
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
This post was edited on 09-30-2009 at 12:18 AM by WDZ.
|
|
09-23-2009 12:14 AM |
|
|
Chris4
Elite Member
Posts: 4461 Reputation: 84
33 / /
Joined: Dec 2004
|
RE: Post your greasemonkey scripts
Andrey, can't get your script to work?
Downloaded it, renamed it to file.user.js and installed it, yet doesn't change anything?
|
|
09-23-2009 01:47 AM |
|
|
WDZ
Former Admin
Posts: 7106 Reputation: 107
– / /
Joined: Mar 2002
|
RE: Post your greasemonkey scripts
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.
|
|
09-23-2009 01:54 AM |
|
|
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|