Index: trunk/extensions/WikiEditor/WikiEditor.php |
— | — | @@ -23,6 +23,8 @@ |
24 | 24 | 'toolbar' => array( 'global' => false, 'user' => true ), |
25 | 25 | // Provides interactive tools |
26 | 26 | 'dialogs' => array( 'global' => false, 'user' => true ), |
| 27 | + // Hide signature button from main namespace |
| 28 | + 'hidesig' => array( 'global' => false, 'user' => false ), |
27 | 29 | |
28 | 30 | /* Textarea / i-frame compatible, but still experimental and unstable (do not deploy!) */ |
29 | 31 | |
— | — | @@ -496,5 +498,11 @@ |
497 | 499 | 'jquery.wikiEditor.toolbar.config', |
498 | 500 | ) |
499 | 501 | ), |
500 | | - |
| 502 | + 'ext.wikiEditor.toolbar.hideSig' => $wikiEditorTpl + array( |
| 503 | + 'scripts' => 'ext.wikiEditor.toolbar.hideSig.js', |
| 504 | + 'dependencies' => array( |
| 505 | + 'ext.wikiEditor', |
| 506 | + 'ext.wikiEditor.toolbar', |
| 507 | + ) |
| 508 | + ), |
501 | 509 | ); |
Index: trunk/extensions/WikiEditor/WikiEditor.hooks.php |
— | — | @@ -47,6 +47,22 @@ |
48 | 48 | 'ext.wikiEditor.dialogs', |
49 | 49 | ), |
50 | 50 | ), |
| 51 | + 'hidesig' => array( |
| 52 | + 'preferences' => array( |
| 53 | + 'wikieditor-toolbar-hidesig' => array( |
| 54 | + 'type' => 'toggle', |
| 55 | + 'label-message' => 'wikieditor-toolbar-hidesig', |
| 56 | + 'section' => 'editing/beta', |
| 57 | + ), |
| 58 | + ), |
| 59 | + 'requirements' => array( |
| 60 | + 'wikieditor-toolbar-hidesig' => true, |
| 61 | + 'usebetatoolbar' => true, |
| 62 | + ), |
| 63 | + 'modules' => array( |
| 64 | + 'ext.wikiEditor.toolbar.hideSig', |
| 65 | + ), |
| 66 | + ), |
51 | 67 | |
52 | 68 | /* Labs Features */ |
53 | 69 | |
Index: trunk/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.hideSig.js |
— | — | @@ -0,0 +1,11 @@ |
| 2 | +/* |
| 3 | + * Remove the signature button if the main namespace is edited. |
| 4 | + */ |
| 5 | +$( document ).ready( function() { |
| 6 | + if ( !$.wikiEditor.isSupported( $.wikiEditor.modules.toolbar ) ) { |
| 7 | + return; |
| 8 | + } |
| 9 | + if ( $( 'body' ).hasClass( 'ns-0' ) ) { |
| 10 | + $( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', { 'section': 'main', 'group': 'insert', 'tool': 'signature' } ); |
| 11 | + } |
| 12 | +}); |
Property changes on: trunk/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.hideSig.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 13 | + native |
Index: trunk/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.config.js |
— | — | @@ -170,7 +170,6 @@ |
171 | 171 | }, |
172 | 172 | 'signature': { |
173 | 173 | 'labelMsg': 'wikieditor-toolbar-tool-signature', |
174 | | - 'filters': [ 'body:not(.ns-0)' ], |
175 | 174 | 'type': 'button', |
176 | 175 | 'offset': [2, -1872], |
177 | 176 | 'icon': 'insert-signature.png', |
Index: trunk/extensions/WikiEditor/WikiEditor.i18n.php |
— | — | @@ -55,6 +55,7 @@ |
56 | 56 | 'wikieditor-toolbar-desc' => 'Edit page toolbar with enhanced usability', |
57 | 57 | 'wikieditor-toolbar-preference' => 'Enable enhanced editing toolbar', |
58 | 58 | 'wikieditor-toolbar-dialogs-preference' => 'Enable dialogs for inserting links, tables and more', |
| 59 | + 'wikieditor-toolbar-hidesig' => 'Hide the signature button from pages in the main namespace', |
59 | 60 | 'wikieditor-toolbar-loading' => 'Loading...', |
60 | 61 | /* Toolbar - Main Section */ |
61 | 62 | 'wikieditor-toolbar-tool-bold' => 'Bold', |