User:Midas02/Zeusmode/preferences.js

// // // Manage preferences for User:Zanaq/Zeusmode // (c) Zanaq, 2008, released under GPL //

function loadPrefs { content=document.getElementById('bodyContent');

content.innerHTML='';

if ( typeof ( zmUseQuickTemplate ) == "undefined" )     zmUseQuickTemplate=true; if ( typeof ( zmUseLocalTemplates ) == "undefined" )     zmUseLocalTemplates=true; if ( typeof ( zmUseCustomTemplates ) == "undefined" )     zmUseCustomTemplates=false; if ( typeof ( zmCustomTemplateLocation ) == "undefined" )    zmCustomTemplateLocation = 'http://nl.wikipedia.org/wiki/Gebruiker:Zanaq/zeusmodetemplates.js'; if ( typeof ( zmUseRevert ) == "undefined" )   zmUseRevert=true; if ( typeof ( zmUsePlace ) == "undefined" )       zmUsePlace = true; if ( typeof ( zmUseUndo ) == "undefined" )       zmUseUndo = true; if ( typeof ( zmUseRollback ) == "undefined" )        zmUseRollback = (isSysop == true) ? false : true; if ( typeof ( zmUseWatchlist ) == "undefined" )         zmUseWatchlist=true; if ( typeof ( zmUseSinceLinks ) == "undefined" )           zmUseSinceLinks=true; if ( typeof ( zmUseSinceTab ) == "undefined" )           zmUseSinceTab=true; if ( typeof ( zmUseLastTab ) == "undefined" )           zmUseLastTab=true; if ( typeof ( zmUseNewPages ) == "undefined" )         zmUseNewPages=true; if ( typeof ( zmUseMarkPatrolled ) == "undefined" )           zmUseMarkPatrolled=true; if ( typeof ( zmUseWhatLinksHere ) == "undefined" )         zmUseWhatLinksHere=true; if ( typeof ( zmUseMisc ) == "undefined" )         zmUseMisc=true; if ( typeof ( zmUseBlockRequest ) == "undefined" )           zmUseBlockRequest = (isSysop == true) ? false : true; if ( typeof ( zmRecentChangesLink ) == "undefined" )           zmRecentChangesLink=true; if ( typeof ( zmzmRecentChangesDefault ) == "undefined" )           zmRecentChangesDefault='?hidepatrolled=1&hideliu=1&limit=500'; if ( typeof ( zmUseFixDABs ) == "undefined" )     zmUseFixDABs=true; if ( typeof ( zmDABdelay ) == "undefined" )     zmDABdelay=30000;

if (( typeof ( zmver ) == "undefined" ) || (zmver < zmVersion) ) {

zmver='0';

content.innerHTML+=txtNewVersion + ' ';

}

a=' ';

a+=' ';

a+=' '; a+=' ';

a+=' ';

a+=' ';

a+=' ';

a+=' ';

a+=' ' + txtSavePage + '  ' + txtRefresh;

a+=' ';

a+=' ';

content.innerHTML+=a; } if (document.location.href.indexOf('Zeusmode:Preferences') != -1) { zmLoadMonobook loadPrefs; } else if (( typeof ( zmver ) == "undefined" ) || (zmver < zmVersion) ) { versionAlert; }

function zmLoadMonobook { var nodes = $.parseHTML(' '); $('body').append(nodes);

//alert(pageTitle); xmlhttp = HTTPClient; if (!xmlhttp) return;

if (zm_extension == null) { var thetitle="/w/index.php?title="+encodeURIComponent('Special:MyPage/' + skin + '.js'); } else { var thetitle="/w/index.php?title="+encodeURIComponent('Special:MyPage/zeusmodepreferences.js');

}

//alert(thetitle + '&action=edit'); xmlhttp.open("GET", thetitle + '&action=edit', true); xmlhttp.onreadystatechange = loadEditForm2; xmlhttp.send(null); } function loadEditForm2 { if (xmlhttp.readyState != 4) return;

a=xmlhttp.responseText.indexOf('<form id="editform"');

b=xmlhttp.responseText.indexOf(' ',a+1)+7;

document.getElementById('hiddenMonobook').innerHTML = xmlhttp.responseText.substring(a,b);

}

function zmSaveChanges {

//alert(document.getElementById('wpTextbox1').value);

a='\/\/ ZeusMode 2.beta - SETTINGS - \n'; a+=' zmver=' + zmVersion + ';\n'; a+=' isSysop=' + document.getElementById('chkIsSysop').checked + ';\n'; a+=' zmUseQuickTemplate=' + document.getElementById('chkQF').checked + ';\n'; zmUseLocalTemplates a+='     zmUseLocalTemplates=' + document.getElementById('chkLocalTemplatesF').checked + ';\n';

a+='     zmUseCustomTemplates=' + document.getElementById('chkCustomTemplatesF').checked + ';\n'; a+='     zmCustomTemplateLocation="' + document.getElementById('inputCTL').value + '";\n';

a+=' zmUseRevert=' + document.getElementById('chkRF').checked + ';\n'; a+='     zmUsePlace=' + document.getElementById('chkPlaceF').checked + ';\n'; a+='     zmUseUndo=' + document.getElementById('chkUndoF').checked + ';\n'; a+='     zmUseRollback=' + document.getElementById('chkRollbackF').checked + ';\n'; a+='   zmUseWatchlist=' + document.getElementById('chkWF').checked + ';\n'; a+='     zmUseSinceLinks=' + document.getElementById('chkSinceLinksF').checked + ';\n'; a+='     zmUseSinceTab=' + document.getElementById('chkSinceTabF').checked + ';\n'; a+='     zmUseLastTab=' + document.getElementById('chkLastTabF').checked + ';\n'; a+='   zmUseNewPages=' + document.getElementById('chkNF').checked + ';\n'; a+='     zmUseMarkPatrolled=' + document.getElementById('chkMarkPatrolledF').checked + ';\n'; a+='   zmUseWhatLinksHere=' + document.getElementById('chkWLH').checked + ';\n'; a+='   zmUseFixDABs=' + document.getElementById('chkFixDABF').checked + ';\n'; a+='   zmDABdelay=' + document.getElementById('DABdelay').value + ';\n';

a+='   zmUseMisc=' + document.getElementById('chkMF').checked + ';\n'; a+='     zmUseBlockRequest=' + document.getElementById('chkBlockReqF').checked + ';\n'; a+='     zmRecentChangesLink=' + document.getElementById('chkRecentF').checked + ';\n'; a+='     zmRecentChangesDefault="' + document.getElementById('inputRCD').value + '";\n'; a+='     zmUseUserListLinks=' + document.getElementById('chkUserListLinks').checked + ';\n'; a+='\/\/ --- END OF ZEUSMODE SETTINGS\n';

//alert(a);

s=document.getElementById('wpTextbox1').value.indexOf('\/\/ ZeusMode 2.beta - SETTINGS');

if (s==-1) {  document.getElementById('wpTextbox1').value += a; } else { ss=document.getElementById('wpTextbox1').value.indexOf('\/\/ --- END OF ZEUSMODE SETTINGS') +32;

document.getElementById('wpTextbox1').value=document.getElementById('wpTextbox1').value.substring(0,s) + a + document.getElementById('wpTextbox1').value.substring(ss);

} document.getElementById('wpSummary').value=settingsSummary; //alert(document.getElementById('wpTextbox1').value); document.editform.submit;

}

//