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