Index: trunk/extensions/ProofreadPage/proofread.js |
— | — | @@ -843,18 +843,18 @@ |
844 | 844 | }; |
845 | 845 | |
846 | 846 | var $edit = $( '#wpTextbox1' ); |
847 | | - if( typeof $edit.wikiEditor == 'function' ) { |
848 | | - setTimeout(function() { |
849 | | - $edit.wikiEditor( 'addToToolbar', { |
850 | | - 'sections': { |
851 | | - 'proofreadpage-tools': { |
852 | | - 'type': 'toolbar', |
853 | | - 'label': mw.msg( 'proofreadpage-section-tools' ) |
| 847 | + if( mw.user.options.get('usebetatoolbar') ) { |
| 848 | + mw.loader.using('ext.wikiEditor.toolbar', function() { |
| 849 | + $edit.wikiEditor( 'addToToolbar', { |
| 850 | + 'sections': { |
| 851 | + 'proofreadpage-tools': { |
| 852 | + 'type': 'toolbar', |
| 853 | + 'label': mw.msg( 'proofreadpage-section-tools' ) |
| 854 | + } |
854 | 855 | } |
855 | | - } |
856 | | - } ) |
857 | | - .wikiEditor( 'addToToolbar', tools); |
858 | | - }, 500); |
| 856 | + } ) |
| 857 | + .wikiEditor( 'addToToolbar', tools); |
| 858 | + } ); |
859 | 859 | } else { |
860 | 860 | var toolbar = document.getElementById( 'toolbar' ); |
861 | 861 | |
— | — | @@ -896,18 +896,9 @@ |
897 | 897 | return; |
898 | 898 | } |
899 | 899 | |
900 | | - if( document.URL.indexOf( 'action=protect' ) > 0 || document.URL.indexOf( 'action=unprotect' ) > 0 ) { |
| 900 | + if( $.inArray( mw.config.get( 'wgAction' ), ['protect', 'unprotect', 'delete', 'undelete', 'watch', 'unwatch', 'history'] ) !== -1 ) { |
901 | 901 | return; |
902 | 902 | } |
903 | | - if( document.URL.indexOf( 'action=delete' ) > 0 || document.URL.indexOf( 'action=undelete' ) > 0 ) { |
904 | | - return; |
905 | | - } |
906 | | - if( document.URL.indexOf( 'action=watch' ) > 0 || document.URL.indexOf( 'action=unwatch' ) > 0 ) { |
907 | | - return; |
908 | | - } |
909 | | - if( document.URL.indexOf( 'action=history' ) > 0 ) { |
910 | | - return; |
911 | | - } |
912 | 903 | |
913 | 904 | /* check if external URL is provided */ |
914 | 905 | if( !self.proofreadPageThumbURL ) { |