באַניצער:שמאלץ/salt.js
אַכטונג: נאכן אויפֿהיטן, ברויכט איר אפשר נאך אַריבערגיין דעם בלעטערערס זאַפאַס צו זען די ענדערונגען.
- פֿייערפוקס/סאפֿארי: האלט אראפ שיפֿט בשעתן דרוקן Reload, אדער דרוקט Ctrl-F5 אדער Ctrl-R (אויף א מאקינטאש ⌘-R)
- גוגל כראם: דרוקט Ctrl-Shift-R (אויף א מאקינטאש ⌘-Shift-R)
- אינטערנעט עקספלארער: האלט אראפ Ctrl בשעתן קליקן Refresh, אדער דרוקט Ctrl-F5
- אפערע: גייט צו מעניו → שטעלונגען ( אפערע → פרעפערנצן אויף א מעק) און דערנאך צו פריוואטקייט & און זיכערהייט → אראפראמען בלעטערן דאטן → בילדער און טעקעס אין זאפאס
/ <pre>
$(saltPageTab);
var saltTarget = "Wikipedia:Protected titles/Twinkle";
function saltPageTab() {
if( wgCurRevisionId != false || wgNamespaceNumber < 0 || ! userIsInGroup( 'sysop' ) ) {
return;
}
mw.util.addPortletLink('p-cactions', "javascript:saltPage()", "salt", "ca-salt", "Salt this page using cascading protection", "");
}
function saltPage() {
Status.init( document.getElementById('bodyContent') );
editXML = sajax_init_object();
editXML.overrideMimeType('text/xml');
var query = {
'title': saltTarget,
'action': 'submit'
}
Status.status( 'Finding page...' );
editXML.open( 'GET' , mw.config.get('wgServer') + mw.config.get('wgScriptPath') + '/index.php?' + QueryString.create( query ) , false);
editXML.send( null );
var doc = editXML.responseXML;
var form = doc.getElementById( 'editform' );
var title = wgPageName.replace( /_/g, ' ' );
var text = form.wpTextbox1.value;
if( text.match( new RegExp( RegExp.escape(title) ) ) ) {
Status.info( 'Already salted.' );
return;
}
text += '*{{:' + title + '}} ([[Special:Undelete/' + title + '|history]]) ~~~~';
var postData = {
'wpSummary': 'Adding [[' + title + ']]',
'wpWatchthis': form.wpWatchthis.checked,
'wpStarttime': form.wpStarttime.value,
'wpEdittime': form.wpEdittime.value,
'wpEditToken': form.wpEditToken.value,
'wpAutoSummary': form.wpAutoSummary.value,
'wpTextbox1': text
}
Status.status( 'Adding ' + title + '...' );
editXML = sajax_init_object();
editXML.overrideMimeType('text/xml');
editXML.open( 'POST' , mw.config.get('wgServer') + mw.config.get('wgScriptPath') + '/index.php?' + QueryString.create( query ) , false);
editXML.setRequestHeader('Content-type','application/x-www-form-urlencoded');
editXML.send( QueryString.create( postData ) );
Status.info( 'Salted.' );
}
// </pre>