$( function() { var $edit = $( '#wpTextbox1' ); if( typeof $edit.wikiEditor !== 'function' ) { return; } mw.messages.set( { 'proofreadpage-section-tools': 'Proofread tools', 'proofreadpage-group-zoom': 'Zoom', 'proofreadpage-group-other': 'Other', 'proofreadpage-button-toggle-visibility-label': 'Show/hide this page\'s header and footer', 'proofreadpage-button-zoom-out-label': 'Zoom out', 'proofreadpage-button-reset-zoom-label': 'Reset zoom', 'proofreadpage-button-zoom-in-label': 'Zoom in', 'proofreadpage-button-toggle-layout-label': 'Vertical/horizontal layout' }); $edit.wikiEditor( 'addToToolbar', { 'sections': { 'proofreadpage-tools': { 'type': 'toolbar', 'label': mw.msg( 'proofreadpage-section-tools' ) } } } ) .wikiEditor( 'addToToolbar', { 'section': 'proofreadpage-tools', 'groups': { 'zoom': { 'label': mw.msg( 'proofreadpage-group-zoom' ), 'tools': { 'zoom-in': { label: mw.msg( 'proofreadpage-button-zoom-in-label' ), type: 'button', icon: mw.config.get( 'wgScriptPath' ) + '/extensions/ProofreadPage/Button_zoom_in.png', action: { type: 'callback', execute: function() { xx=0; yy=0; pr_zoom(2); } } }, 'zoom-out': { label: mw.msg( 'proofreadpage-button-zoom-out-label' ), type: 'button', icon: mw.config.get( 'wgScriptPath' ) + '/extensions/ProofreadPage/Button_zoom_out.png', action: { type: 'callback', execute: function() { xx=0; yy=0; pr_zoom(-2); } } }, 'reset-zoom': { label: mw.msg( 'proofreadpage-button-reset-zoom-label' ), type: 'button', icon: mw.config.get( 'wgScriptPath' ) + '/extensions/ProofreadPage/Button_examine.png', action: { type: 'callback', execute: function() { pr_zoom(0); } } } } }, 'other': { 'label': mw.msg( 'proofreadpage-group-other' ), 'tools': { 'toggle-visibility': { label: mw.msg( 'proofreadpage-button-toggle-visibility-label' ), type: 'button', icon: mw.config.get( 'wgScriptPath' ) + '/extensions/ProofreadPage/button_category_plus.png', action: { type: 'callback', execute: function() { pr_toggle_visibility(); } } }, 'toggle-layout': { label: mw.msg( 'proofreadpage-button-toggle-layout-label' ), type: 'button', icon: mw.config.get( 'wgScriptPath' ) + '/extensions/ProofreadPage/Button_multicol.png', action: { type: 'callback', execute: function() { pr_toggle_layout(); } } } } } } } ); } );