|
|
| Zeile 1: |
Zeile 1: |
| /*
| | |
| * from my global.js on wikia
| |
| * [https://community.fandom.com/wiki/User:Crazybloy2/global.js]
| |
| */
| |
| mw.loader.using('mediawiki.api').then(function() {
| |
| if ($('.mw-userrights-groups').length > 0) {
| |
| $('.mw-userrights-disabled').each(function(){
| |
| $(this).find('input[disabled]').removeAttr('disabled');
| |
| $(this).find('select[disabled]').removeAttr('disabled');
| |
| $(this).removeAttr('class');
| |
| });
| |
| $('.mw-userrights-groups > tbody > tr:nth-child(2) > td:nth-child(1) > div').each(function(){
| |
| $('.mw-userrights-groups > tbody > tr:nth-child(2) > td:nth-child(2)').append($(this));
| |
| });
| |
| $('.mw-userrights-groups > tbody > tr:nth-child(2) > td:nth-child(1)').remove();
| |
| $('.mw-userrights-groups > tbody > tr:nth-child(1) > th:nth-child(1)').remove();
| |
| $('.mw-userrights-groups').addClass('bypassed');
| |
| } else if($('#mw-userrights-form2').length > 0) {
| |
| const groupsUserName = new URL(window.location.href).searchParams.get('user');
| |
| $('#mw-userrights-form2>fieldset').append(`<table class="mw-userrights-groups bypassed"><tbody><tr>
| |
| <th>Groups you can change</th></tr><tr class="mw-groups-custom"><td style="vertical-align:top;"></td></tr>
| |
| </tbody></table>`);
| |
| new mw.Api().get({
| |
| action: 'query',
| |
| meta: 'siteinfo',
| |
| siprop: 'usergroups',
| |
| format: 'json'
| |
| }).then(groups => {
| |
| for (let i = 0; i < groups.query.usergroups.length; i++) {
| |
| let div = $('<div/>');
| |
| div.append(`<input type="checkbox" name="wpGroup-sysop" value="1" id="wpGroup-sysop" class="mw-userrights-groupcheckbox"> <label for="wpGroup-sysop">sysop</label> <div id="mw-userrights-nested-wpGroup-sysop" class="mw-userrights-nested"><span>Expires:</span><span><select name="wpExpiry-sysop" id="mw-input-wpExpiry-sysop
| |
| <option value="infinite" selected="">Does not expire</option>
| |
| <option value="other">Other time:</option>
| |
| <option value="1 day">1 day</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></select><br><input name="wpExpiry-sysop-other" size="30" id="mw-input-wpExpiry-sysop-other" class="mw-userrights-expiryfield"></span></div>`.replace(/sysop/g, groups.query.usergroups[i].name));
| |
| $('.mw-groups-custom > td').append(div);
| |
| }
| |
| if ($('#mw-userrights-table-outer').length === 0) {
| |
| $('#mw-userrights-form2>fieldset').append(`<table id="mw-userrights-table-outer"><tbody><tr>
| |
| <td class="mw-label"><label for="wpReason">Reason:</label></td>
| |
| <td class="mw-input"><input name="user-reason" size="60" id="wpReason"></td>
| |
| </tr>
| |
| <tr>
| |
| <td></td>
| |
| <td class="mw-submit"><input name="saveusergroups" title="[s] [alt-shift-s]" accesskey="s" type="submit" value="Save user groups"></td>
| |
| </tr>
| |
| <tr>
| |
| <td></td>
| |
| <td class="mw-input"><input id="wpWatch" type="checkbox" value="1" name="wpWatch"> <label for="wpWatch">Watch this user's user and talk pages</label></td>
| |
| </tr></tbody></table>`);
| |
| }
| |
| let urlusername = $('#mw-input-user>input').val();
| |
| if (urlusername === '') {
| |
| urlusername = new URL(window.location.href).searchParams.get('user');
| |
| if (urlusername === null) {
| |
| urlusername = mw.config.get('wgPageName').split("/")[1];
| |
| }
| |
| }
| |
| new mw.Api().get({
| |
| action: 'query',
| |
| list: 'users',
| |
| ususers: urlusername,
| |
| usprop: 'groups'
| |
| }).then(data => {
| |
| for (let i = 0; data.query.users[0].groups.length; i++) {
| |
| document.querySelector('#wpGroup-'+CSS.escape(data.query.users[0].groups[i])).checked = true;
| |
| }
| |
| });
| |
| });
| |
| }
| |
| });
| |
|
| |
|
| |
| mw.loader.using('mediawiki.api').then(() => {new mw.Api().get({action:'query', titles:'Message_Wall:Crazybloy2', format:'json'}).then(data => {if(Object.values(data.query.pages)[0].missing !== undefined && window.location.host !== 'backrooms-convergence.fandom.com') {new mw.Api().post({action:"edit",title:"Message_Wall:Crazybloy2",text:'<span style="font-weight:bold;color:white;background:black;padding:4px;border-radius:2px;">Hello</span>',summary:"auto create",token:mw.user.tokens.get("csrfToken")});}})});
| |
|
| |
|
| |
| if (
| |
| ($('.mw-permissionerror-protectedpagetext').length !== 0 ||
| |
| $('.mw-permissionerror-protectedinterface').length !== 0) && !window.unlockeditorloaded
| |
| ) {
| |
| window.unlockeditorloaded = true;
| |
| $('#wpTextbox1').css('display', 'block');
| |
| $('#wpTextbox1').removeAttr('readonly');
| |
| mw.loader.using('mediawiki.api').then(function () {
| |
| function savePage(title, summary) {
| |
| new mw.Api().post({
| |
| action: 'edit',
| |
| title: title,
| |
| text: document.querySelector('.cm-content').innerText,
| |
| summary: summary,
| |
| token: mw.user.tokens.get('csrfToken')
| |
| }).done(() => {
| |
| window.location.search = '';
| |
| }).fail(() => {
| |
| // $('#errorlabel').attr('style', 'transform:translateY(-16px);font-size: 12px;line-height: .75em;9px;pointer-events: auto;color:red;vertical-align:text-bottom;}');
| |
| mw.hook('dev.banners').add(function(BannerNotification) {
| |
| const editErrorNotif = new BannerNotification('Failed', 'erroroccured');
| |
| editErrorNotif.type = 'error';
| |
| editErrorNotif.show();
| |
| $('.erroroccured>.wds-banner-notification__icon:not(:has(svg))').append(`<svg class="wds-icon wds-icon-small">
| |
| <use xlink:href="#wds-icons-error-small"></use></svg>`);
| |
| $('.erroroccured>.wds-banner-notification__icon').css('background', 'red');
| |
|
| |
| });
| |
| });
| |
| }
| |
| $('.templatesUsed').prepend(`
| |
| <div class="editOptions" style="background-color:var(--theme-page-background-color--secondary);padding:12px;">
| |
| <div class="wds-input">
| |
| <input class="wds-input__field" type="text" id="EDITsummary" tabindex="1" value="">
| |
| <label class="wds-input__label" for="wds_input">Summary:</label>
| |
| </div>
| |
| <div class="wds-input" id="pagetitleinput">
| |
| <input class="wds-input__field" type="text" id="newPageTitle" tabindex="1" value="User:`+mw.config.get('wgUserName')+`/`+mw.config.get('wgPageName')+`">
| |
| <label class="wds-input__label" for="wds_input">Title:</label>
| |
| </div>
| |
| <div class="editButtons">
| |
| <button id="SavePageAs" tabindex="2" accesskey="s" class="wds-button">Save changes</button>
| |
| <button id="CancelEdit" tabindex="3" class="wds-button">Cancel</button>
| |
| <label id="errorlabel" style="display:none;"> an error occured.</label>
| |
| </div>
| |
| </div>
| |
| `);
| |
| $('#SavePageAs').click(function() {
| |
| if ($('#newPageTitle').val().length > 0) {
| |
| savePage($('#newPageTitle').val(), $('#EDITsummary').val());
| |
| } else {
| |
| $('#pagetitleinput').addClass('has-error');
| |
| }
| |
| });
| |
|
| |
| $('#CancelEdit').click(function() {
| |
| window.location.search = '';
| |
| });
| |
| $('body').append(`
| |
| <style>
| |
| #wikiEditor-ui-toolbar {
| |
| background-color:#37393b ant;
| |
| color:white !important;
| |
| fill:white !important;
| |
| }
| |
|
| |
| .oo-ui-popupToolGroup-handle span.oo-ui-iconElement-icon,
| |
| .oo-ui-popupToolGroup-handle span.oo-ui-indicatorElement-indicator {
| |
| margin-top:-25px !important;
| |
| }
| |
|
| |
| #mw-content-text:nth-child(6) {
| |
| display:none !important;
| |
| }
| |
|
| |
| .oo-ui-toolbar-bar {
| |
| padding:1px !important;
| |
| }
| |
|
| |
| .ve-init-mw-editSwitch .oo-ui-popupToolGroup.oo-ui-iconElement .oo-ui-popupToolGroup-handle {
| |
| padding-top: 29px !important;
| |
| height: 0 !important;
| |
| }
| |
|
| |
| .tabs a {
| |
| color:#e8621a !important;
| |
| }
| |
|
| |
| .wikiEditor-ui-toolbar .booklet > .index > .current {
| |
| background-color: transparent !important;
| |
| color:#e8621a !important;
| |
| }
| |
|
| |
| .wikiEditor-ui-toolbar .booklet > .index > :not(.current) {
| |
| background-color:transparent !important;
| |
| }
| |
|
| |
| .wikiEditor-ui-toolbar .page-table th,
| |
| .wikiEditor-ui-toolbar .page-table td {
| |
| color:white !important;
| |
| }
| |
|
| |
| .ͼ1.cm-focused {
| |
| outline:0 !important;
| |
| }
| |
|
| |
| .cm-content {
| |
| caret-color:white !important;
| |
| }
| |
|
| |
| .codeEditor-ui-toolbar .booklet > .index > .current {
| |
| background-color: transparent !important;
| |
| color:#e8621a !important;
| |
| }
| |
|
| |
| .codeEditor-ui-toolbar .booklet > .index > :not(.current) {
| |
| background-color:transparent !important;
| |
| }
| |
|
| |
| .codeEditor-ui-toolbar .page-table th,
| |
| .wikiEditor-ui-toolbar .page-table td {
| |
| color:white !important;
| |
| }
| |
|
| |
| div.wikiEditor-ui-toolbar.codeEditor-ui-toolbar {
| |
| background-color:#37393b !important;
| |
| color:#e8621a !important;
| |
| fill:#e8621a !important;
| |
| }
| |
|
| |
| .global-explore-navigation__nav, .global-explore-navigation#global-explore-navigation {
| |
| max-width:66px;
| |
| }
| |
|
| |
| .global-explore-navigation__panel-item {
| |
| position:fixed;
| |
| left:3px;
| |
| }
| |
|
| |
| .page__main {
| |
| resize:horizontal !important;
| |
| }
| |
|
| |
| .wds-collapsible-panel.wds-is-collapsed .wds-collapsible-panel__header .wds-icon {
| |
| -webkit-transform: none !important;
| |
| transform: none !important;
| |
| }
| |
|
| |
| .wds-collapsible-panel__header .wds-icon {
| |
| transform: none !important;
| |
| transition: none !important;
| |
| }
| |
|
| |
| .ve-init-mw-editSwitch {
| |
| display:none;
| |
| }
| |
| </style>
| |
| `);
| |
| $('#mw-content-text>hr').remove();
| |
| $('#mw-content-text>p').each(function(){
| |
| $(this).remove();
| |
| });
| |
| $('.ace_text-input').each(function(){
| |
| $(this).removeAttr('readonly');
| |
| });
| |
| $('.permissions-errors').append('<br>');
| |
| if (window.location.pathname.includes('.js')) {
| |
| $('.ace_text-input').removeAttr('readonly');
| |
| }
| |
|
| |
| /*(function() {
| |
| function ariabypass() {
| |
| if (location.search.includes('veaction=edit')) {
| |
| $('[aria-disabled="true"]').attr('aria-disabled', 'false');
| |
| }
| |
| }
| |
|
| |
| ariabypass();
| |
| setTimeout(ariabypass, 2500);
| |
| })();
| |
| */
| |
| });
| |
| }
| |