MediaWiki:MaximizeAce.js

/* MaximizeAce by Sophiedp */ //If editing and codeeditor if (mw.config.get('wgAction') === 'edit' && $('.codeeditor').exists) { //remove the help link $('#HelpLink').remove;

//remove toolbar (can be disabled) if (!window.MizimzeAceHelpLink) { $('body').removeClass('wikia-bar-visible'); $('#WikiaBar').remove; }

//move the editrail over all the way to the right mw.util.addCSS(':root { --rail-right: 0; }'); //if the notifications link doesn't have a notification, hide it   if (!$('.EditPageHeader #NotificationsLink > a > span').text) { $('.EditPageHeader #NotificationsLink').hide; }

//wait for the editor to load setTimeout(function {        //make the editor use the full width        $('#WikiaPage').css({'border':'none !important', 'width':'100%'});

//expand the editor $('.codeeditor .editpage-widemode-trigger').click;

//make the editor resize itself so it doesn't leave a hole where the toolbar was $(window).trigger('resize'); //remove the two extra lines at the end of the page ace.edit('editarea').setValue(ace.edit('editarea').getValue.replace(/\n{2}$/, ''), -1); //fix the "are you sure you want to leave?" message ///cache the new content var value = ace.edit('editarea').getValue; $(window) .unbind('beforeunload') ///remove the old handler .on('beforeunload', function { //create our new handler                ///var is for the publish button, otherwise it asks if we want to leave when we click on publish                if (!disableBeforeUnload && value !== ace.edit('editarea').getValue) { //if the two don't match (page is edited)                    //show the message                    return $.msg('wikia-editor-leaveconfirm-message');                }            }); }, 100);

//import FixAceWidemode importArticle({       type: 'style',        article: 'u:dev:MediaWiki:FixAceWidemode.css'    }); }