Index: trunk/phase3/resources/mediawiki.action/mediawiki.action.edit.js |
— | — | @@ -3,7 +3,7 @@ |
4 | 4 | var currentFocused = $( '#wpTextbox1' ); |
5 | 5 | |
6 | 6 | mw.toolbar = { |
7 | | - $toolbar : $( '#toolbar' ), |
| 7 | + $toolbar : [], |
8 | 8 | buttons : [], |
9 | 9 | // If you want to add buttons, use |
10 | 10 | // mw.toolbar.addButton( imageFile, speedTip, tagOpen, tagClose, sampleText, imageId, selectText ); |
— | — | @@ -37,7 +37,12 @@ |
38 | 38 | ); |
39 | 39 | } |
40 | 40 | }, |
41 | | - init : function() { |
| 41 | + |
| 42 | + // For backwards compatibility |
| 43 | + init : function() {}, |
| 44 | + |
| 45 | + onReady : function() { |
| 46 | + mw.toolbar.$toolbar = $( '#toolbar' ); |
42 | 47 | // Legacy |
43 | 48 | // Merge buttons from mwCustomEditButtons |
44 | 49 | var buttons = [].concat( this.buttons, window.mwCustomEditButtons ); |
— | — | @@ -59,10 +64,12 @@ |
60 | 65 | window.addButton = mw.toolbar.addButton; |
61 | 66 | window.insertTags = mw.toolbar.insertTags; |
62 | 67 | |
63 | | - //make sure edit summary does not exceed byte limit |
64 | | - $( '#wpSummary' ).byteLimit( 250 ); |
| 68 | + $( document ).ready( function() { |
| 69 | + mw.toolbar.onReady(); |
65 | 70 | |
66 | | - $( document ).ready( function() { |
| 71 | + // Make sure edit summary does not exceed byte limit |
| 72 | + $( '#wpSummary' ).byteLimit( 250 ); |
| 73 | + |
67 | 74 | /** |
68 | 75 | * Restore the edit box scroll state following a preview operation, |
69 | 76 | * and set up a form submission handler to remember this state |