mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/WikiEditor
synced 2024-12-02 20:06:49 +00:00
411be83bc3
* Toolbar button to toggle a two-pane layout on and off. * Resizable bar for the width of the two panes. * Resizable bar for the edit box height, even when realtime preview is off. * Only enabled when $wgWikiEditorRealtimePreview = true. * Fires JS hooks when enabled, resized, and disabled. Bug: T293347 Change-Id: Id09d44519249c0b7f5c33d48d524b7c92a5a9106
17 lines
438 B
JavaScript
17 lines
438 B
JavaScript
mw.hook( 'wikiEditor.toolbarReady' ).add( function ( $textarea ) {
|
|
var RealtimePreview = require( './RealtimePreview.js' );
|
|
var realtimePreview = new RealtimePreview();
|
|
$textarea.wikiEditor( 'addToToolbar', {
|
|
section: 'secondary',
|
|
group: 'default',
|
|
tools: {
|
|
realtimepreview: {
|
|
type: 'element',
|
|
element: function ( context ) {
|
|
return realtimePreview.getToolbarButton( context ).$element;
|
|
}
|
|
}
|
|
}
|
|
} );
|
|
} );
|