Uit Hack42
Ga naar: navigatie, zoeken
(fixes)
(+cats)
 
Regel 51: Regel 51:
 
'javascript:('+QuickBlock+')("infinite","?",1,1,1,0,0)',
 
'javascript:('+QuickBlock+')("infinite","?",1,1,1,0,0)',
 
'?: indef',
 
'?: indef',
'p-block-vandalism');
+
'p-block-unknown');
 
//blockOther,blockReason,createAccount,enableAutoblock,emailBan,watchUser,allowUsertalk
 
//blockOther,blockReason,createAccount,enableAutoblock,emailBan,watchUser,allowUsertalk
 
}
 
}
 
if ( mw.config.get('wgCanonicalSpecialPageName') == 'Block' )$(addblockoptions);
 
if ( mw.config.get('wgCanonicalSpecialPageName') == 'Block' )$(addblockoptions);
 +
 +
 +
function AddCats () {
 +
  $( 'textarea[name="wpTextbox1"]' ).val("Hier stond spam.\n[[Bestand:Cat_poster.jpg|1024px]]\n\nNu niet meer.").change();
 +
  $( 'form[name="editform"]' ).submit();
 +
}
 +
 +
if( !mw.config.get('wgIsArticle')) {
 +
mw.util.addPortletLink('p-cactions',
 +
'javascript:('+AddCats+')()',
 +
'Moar Catz Pleez',
 +
'p-edit-cats');
 +
}
  
 
// </nowiki>
 
// </nowiki>

Huidige versie van 8 sep 2022 om 12:32

// <nowiki>

function QuickBlock (blockOther,blockReason,createAccount,enableAutoblock,emailBan,watchUser,allowUsertalk) {
	blockForm = document.evaluate("//form[contains(@action,'Speciaal:Blokkeren')]", document, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue;

	$( '#mw-input-wpExpiry' ).find( 'select' ).val(blockOther).change();
	$( '#mw-input-wpReason' ).find( 'select' ).val("other").change();
	$( 'input[name="wpReason-other"]' ).val(blockReason);
	$( 'input[name="wpCreateAccount"]' ).prop( "checked", createAccount==1 );
	$( 'input[name="wpDisableEmail"]' ).prop( "checked", emailBan==1 );
	$( 'input[name="wpDisableUTEdit"]' ).prop( "checked", allowUsertalk==1 );
	$( 'input[name="wpAutoBlock"]' ).prop( "checked", enableAutoblock==1 );
	$( 'input[name="wpWatch"]' ).prop( "checked", watchUser==1 );

	blockForm.submit();
}

function userIsInGroup (group) {
//are they in a given local group?
	if (mw.config.get('wgUserGroups')) {
		if (!group || group.length == 0) group = '*';
		if (mw.config.get('wgUserGroups').join (' ').indexOf (group) != -1){
			return true;
		}
		else{
			return false;
		}
	}
	return false;
}
function userIsInGlobalGroup (group) {
//are they in a given global group?
	if (mw.config.get('wgGlobalGroups')) {
		if (!group || group.length == 0) group = '*';
		if (mw.config.get('wgGlobalGroups').join (' ').indexOf (group) != -1){
			return true;
		}
		else{
			return false;
		}
	}
	return false;
}

function addblockoptions() {//blockOther,blockReason,createAccount,enableAutoblock,emailBan,watchUser,allowUsertalk
	mw.util.addPortletLink('p-cactions',
		'javascript:('+QuickBlock+')("infinite","spam",1,1,1,0,1)',
		'spam: indef',
		'p-block-vandalism');
	mw.util.addPortletLink('p-cactions',
		'javascript:('+QuickBlock+')("infinite","?",1,1,1,0,0)',
		'?: indef',
		'p-block-unknown');
	//blockOther,blockReason,createAccount,enableAutoblock,emailBan,watchUser,allowUsertalk
}
if ( mw.config.get('wgCanonicalSpecialPageName') == 'Block' )$(addblockoptions);


function AddCats () {
  $( 'textarea[name="wpTextbox1"]' ).val("Hier stond spam.\n[[Bestand:Cat_poster.jpg|1024px]]\n\nNu niet meer.").change();
  $( 'form[name="editform"]' ).submit();
}

if( !mw.config.get('wgIsArticle')) {
	mw.util.addPortletLink('p-cactions',
		'javascript:('+AddCats+')()',
		'Moar Catz Pleez',
		'p-edit-cats');
}

// </nowiki>