Index: trunk/phase3/skins/common/edit.js |
— | — | @@ -78,7 +78,8 @@ |
79 | 79 | // apply tagOpen/tagClose to selection in textarea, |
80 | 80 | // use sampleText instead of selection if there is none |
81 | 81 | function insertTags( tagOpen, tagClose, sampleText ) { |
82 | | - if ( typeof $j != 'undefined' && typeof $j.fn.textSelection != 'undefined' ) { |
| 82 | + if ( typeof $j != 'undefined' && typeof $j.fn.textSelection != 'undefined' && |
| 83 | + ( currentFocused.nodeName.toLowerCase() == 'iframe' || currentFocused.id == 'wpTextbox1' ) ) { |
83 | 84 | $j( '#wpTextbox1' ).textSelection( |
84 | 85 | 'encapsulateSelection', { 'pre': tagOpen, 'peri': sampleText, 'post': tagClose } |
85 | 86 | ); |
— | — | @@ -190,16 +191,16 @@ |
191 | 192 | return; |
192 | 193 | } |
193 | 194 | function onfocus( e ) { |
194 | | - var elm = e.target; |
| 195 | + var elm = e.target || e.srcElement; |
195 | 196 | if ( !elm ) { |
196 | 197 | return; |
197 | 198 | } |
198 | 199 | var tagName = elm.tagName.toLowerCase(); |
199 | | - var type = elm.type.toLowerCase(); |
| 200 | + var type = elm.type || ''; |
200 | 201 | if ( tagName !== 'textarea' && tagName !== 'input' ) { |
201 | 202 | return; |
202 | 203 | } |
203 | | - if ( tagName === 'input' && type && type !== 'text' ) { |
| 204 | + if ( tagName === 'input' && type.toLowerCase() !== 'text' ) { |
204 | 205 | return; |
205 | 206 | } |
206 | 207 | |
— | — | @@ -213,6 +214,17 @@ |
214 | 215 | // IE needs a specific trick here since it doesn't support the standard |
215 | 216 | editForm.attachEvent( 'onfocusin', function() { onfocus( event ); } ); |
216 | 217 | } |
| 218 | + |
| 219 | + // HACK: make currentFocused work with the usability iframe |
| 220 | + // With proper focus detection support (HTML 5!) this'll be much cleaner |
| 221 | + if ( typeof $j != 'undefined' ) { |
| 222 | + var iframe = $j( '.wikiEditor-ui-text iframe' ); |
| 223 | + if ( iframe.length > 0 ) { |
| 224 | + $j( iframe.get( 0 ).contentWindow.document ) |
| 225 | + .add( iframe.get( 0 ).contentWindow.document.body ) // for IE |
| 226 | + .focus( function() { currentFocused = iframe.get( 0 ); } ); |
| 227 | + } |
| 228 | + } |
217 | 229 | |
218 | 230 | editForm |
219 | 231 | } ); |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -1686,7 +1686,7 @@ |
1687 | 1687 | * to ensure that client-side caches do not keep obsolete copies of global |
1688 | 1688 | * styles. |
1689 | 1689 | */ |
1690 | | -$wgStyleVersion = '266'; |
| 1690 | +$wgStyleVersion = '267'; |
1691 | 1691 | |
1692 | 1692 | |
1693 | 1693 | # Server-side caching: |