MediaWiki:Gadget-oldeditor.js: Difference between revisions
Content deleted Content added
Attribution: https://en.wikipedia.org/w/index.php?title=User:Matma_Rex/VE_killer.js&action=history |
clean up: No need for ['backet'] access, not done anywhere else either |
||
(6 intermediate revisions by 5 users not shown) | |||
Line 1:
// This script fully hides the VisualEditor tool, leaving
// It does not entirely undo the changes, but does restore old look and user-facing behavior.
Line 9:
/*global $, mw */
$(document).ready(function (){
var state = mw.loader.getState('ext.visualEditor.viewPageTarget.init');
if (
mw.loader.using('ext.visualEditor.viewPageTarget.init', function () {
//
var caEdit = $('#ca-
.
$('#ca-edit').remove();
$('#ca-editsource').attr('id', 'ca-edit');
//
$('.mw-editsection-link-secondary')
.text( $('.mw-editsection-link-primary').eq(0).text() )
.off('focus blur');
$('.mw-editsection-divider, .mw-editsection-link-primary').remove();
$('.mw-editsection-bracket:not(:first-of-type):not(:last-of-type)').remove();
$('.mw-editsection-bracket, .mw-editsection-link-secondary').css('visibility', '');
$('h1, h2, h3, h4, h5, h6').off('mouseenter mouseleave');
}
});
}
});
mw.loader.using('mediawiki.api', function () {
var api = new mw.Api();
api.get({ action: 'tokens', type: 'options' }).done(function (json) {
api.post({
action: 'options',
change: 'gadget-oldeditor|visualeditor-betatempdisable=1',
token: json.tokens.optionstoken
});
});
});
|