|
|
Line 1: |
Line 1: |
| if (mw.config.get('wgUserGroups').includes('sysop')) { | | if (mw.config.get('wgUserGroups').includes('sysop')) { |
|
| |
|
| // Function to create the blocking interface as if it's a "Special Page" | | // Function to change the title and hide the user path |
| function createBlockingInterface() { | | function changeTitleAndHideUserPath() { |
| // Change the document title in the browser tab
| |
| document.title = 'Mass Block Tool - ' + mw.config.get('wgSiteName'); | | document.title = 'Mass Block Tool - ' + mw.config.get('wgSiteName'); |
| | $('#firstHeading').text('Mass Block Tool'); // Changes the main title on the page |
| | $('#contentSub').remove(); // Removes the subtitle which typically includes user path |
| | // Depending on your MediaWiki skin, you might need to change the selectors above |
| | } |
|
| |
|
| // Change the content header to 'Mass Block Tool' and remove the subtitle
| | // Function to create the blocking interface |
| $('#firstHeading').text('Mass Block Tool'); // This changes the main page title
| | function createBlockingInterface() { |
| $('#contentSub, #siteSub').hide(); // This hides the subtitle and the user link | | changeTitleAndHideUserPath(); // Call the function to change title and hide the user path |
| | |
| // The HTML for the blocking interface
| |
| var formHtml = '<div id="massBlockTool" style="margin: 20px;">' +
| |
| '<p>If you abuse this tool, it\'s your fault, not mine.</p>' +
| |
| '<textarea id="usernamesToBlock" placeholder="Usernames to block (one on each line, please):" rows="10" cols="50"></textarea>' +
| |
| '<h3>Common reasons:</h3>' +
| |
| '<select id="blockReasonSelect">' +
| |
| '<option value="vandalism">Vandalism</option>' +
| |
| '<option value="spam">Spam</option>' +
| |
| '<option value="harassment">Harassment</option>' +
| |
| '<option value="other">Other reason</option>' +
| |
| '</select><br>' +
| |
| '<input type="text" id="otherBlockReason" placeholder="Other/additional reason" style="display:none; margin-top: 10px;">' +
| |
| '<h3>Block duration:</h3>' +
| |
| '<select id="blockDuration">' +
| |
| '<option value="indefinite">indefinite</option>' +
| |
| '<option value="3 hours">3 hours</option>' +
| |
| '<option value="12 hours">12 hours</option>' +
| |
| '<option value="24 hours">24 hours</option>' +
| |
| '<option value="3 days">3 days</option>' +
| |
| '<option value="1 week">1 week</option>' +
| |
| '<option value="1 month">1 month</option>' +
| |
| '<option value="3 months">3 months</option>' +
| |
| '<option value="6 months">6 months</option>' +
| |
| '<option value="1 year">1 year</option>' +
| |
| '<option value="other">Other...</option>' +
| |
| '</select><br>' +
| |
| '<input type="text" id="customBlockDuration" placeholder="Custom duration" style="display:none; margin-top: 10px;">' +
| |
| '<h3>Additional options:</h3>' +
| |
| '<input type="checkbox" id="nocreateCheckbox" checked> Prevent account creation<br>' +
| |
| '<input type="checkbox" id="noemailCheckbox" checked> Prevent user from sending email<br>' +
| |
| '<input type="checkbox" id="allowusertalkCheckbox"> Prevent user from editing their talk page<br>' +
| |
| '<button id="executeMassBlock" style="margin-top: 10px;">Block Users</button>' +
| |
| '</div>';
| |
|
| |
|
| // Clear the current content and insert the new form | | // Clear the content area and insert the form |
| var contentText = $('#mw-content-text'); | | var contentText = $('#mw-content-text'); |
| contentText.empty(); | | contentText.empty(); |
| | |
| | var formHtml = '<div id="massBlockTool" style="margin: 20px;">' + |
| | // ... (form HTML as before) |
| contentText.html(formHtml); | | contentText.html(formHtml); |
|
| |
|