Index: branches/wmf-deployment/skins/common/edit.js |
— | — | @@ -47,11 +47,14 @@ |
48 | 48 | var textbox = document.getElementById('wpTextbox1'); |
49 | 49 | if (!textbox) { return false; } |
50 | 50 | |
51 | | - // Don't generate buttons for browsers which don't fully |
52 | | - // support it. |
53 | | - if (!(document.selection && document.selection.createRange) |
54 | | - && textbox.selectionStart === null) { |
55 | | - return false; |
| 51 | + // Only check for selection capability if the textarea is visible - errors will occur otherwise - just because |
| 52 | + // the textarea is not visible, doesn't mean we shouldn't build out the toolbar though - it might have been replaced |
| 53 | + // with some other kind of control |
| 54 | + if ( textbox.style.display != 'none' ) { |
| 55 | + if ( !( document.selection && document.selection.createRange ) |
| 56 | + && textbox.selectionStart === null ) { |
| 57 | + return false; |
| 58 | + } |
56 | 59 | } |
57 | 60 | |
58 | 61 | for (var i = 0; i < mwEditButtons.length; i++) { |
— | — | @@ -66,6 +69,12 @@ |
67 | 70 | // apply tagOpen/tagClose to selection in textarea, |
68 | 71 | // use sampleText instead of selection if there is none |
69 | 72 | function insertTags(tagOpen, tagClose, sampleText) { |
| 73 | + if ( typeof $j != 'undefined' && typeof $j.fn.textSelection != 'undefined' ) { |
| 74 | + $j( '#wpTextbox1' ).textSelection( |
| 75 | + 'encapsulateSelection', { 'pre': tagOpen, 'peri': sampleText, 'post': tagClose } |
| 76 | + ); |
| 77 | + return; |
| 78 | + } |
70 | 79 | var txtarea; |
71 | 80 | if (document.editform) { |
72 | 81 | txtarea = currentFocused; |
Property changes on: branches/wmf-deployment/skins/common/edit.js |
___________________________________________________________________ |
Name: svn:mergeinfo |
73 | 82 | - /branches/REL1_15/phase3/skins/common/edit.js:51646 |
/trunk/phase3/skins/common/edit.js:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,57154-57447,57541,57916,58151,58219,58633,58816,59604,59939,61557-61558,61700 |
74 | 83 | + /branches/REL1_15/phase3/skins/common/edit.js:51646 |
/trunk/phase3/skins/common/edit.js:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,57154-57447,57541,57916,58151,58219,58633,58816,59604,59939,61557-61558,61700,62154,62186 |