Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -71,10 +71,10 @@ |
72 | 72 | array( 'src' => 'js/plugins/jquery.cookie.js', 'version' => 4 ), |
73 | 73 | array( 'src' => 'js/plugins/jquery.delayedBind.js', 'version' => 1 ), |
74 | 74 | array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 13 ), |
75 | | - array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 31 ), |
76 | | - array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 186 ), |
| 75 | + array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 32 ), |
| 76 | + array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 187 ), |
77 | 77 | array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 53 ), |
78 | | - array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 60 ), |
| 78 | + array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 61 ), |
79 | 79 | array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 24 ), |
80 | 80 | array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 98 ), |
81 | 81 | array( 'src' => 'js/plugins/jquery.wikiEditor.preview.js', 'version' => 11 ), |
— | — | @@ -83,10 +83,10 @@ |
84 | 84 | array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 5 ), |
85 | 85 | ), |
86 | 86 | 'combined' => array( |
87 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 392 ), |
| 87 | + array( 'src' => 'js/plugins.combined.js', 'version' => 393 ), |
88 | 88 | ), |
89 | 89 | 'minified' => array( |
90 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 392 ), |
| 90 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 393 ), |
91 | 91 | ), |
92 | 92 | ), |
93 | 93 | ); |
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.hooks.php |
— | — | @@ -16,16 +16,16 @@ |
17 | 17 | array( 'src' => 'Modules/Preview/Preview.js', 'version' => 6 ), |
18 | 18 | array( 'src' => 'Modules/Publish/Publish.js', 'version' => 6 ), |
19 | 19 | array( 'src' => 'Modules/Toc/Toc.js', 'version' => 7 ), |
20 | | - array( 'src' => 'Modules/Toolbar/Toolbar.js', 'version' => 84 ), |
| 20 | + array( 'src' => 'Modules/Toolbar/Toolbar.js', 'version' => 85 ), |
21 | 21 | array( 'src' => 'Modules/TemplateEditor/TemplateEditor.js', 'version' => 6 ), |
22 | 22 | array( 'src' => 'Modules/Templates/Templates.js', 'version' => 1 ), |
23 | 23 | array( 'src' => 'Modules/AddMediaWizard/AddMediaWizard.js', 'version' => 6 ), |
24 | 24 | ), |
25 | 25 | 'combined' => array( |
26 | | - array( 'src' => 'WikiEditor.combined.js', 'version' => 89 ), |
| 26 | + array( 'src' => 'WikiEditor.combined.js', 'version' => 90 ), |
27 | 27 | ), |
28 | 28 | 'minified' => array( |
29 | | - array( 'src' => 'WikiEditor.combined.min.js', 'version' => 89 ), |
| 29 | + array( 'src' => 'WikiEditor.combined.min.js', 'version' => 90 ), |
30 | 30 | ), |
31 | 31 | ); |
32 | 32 | static $messages = array( |
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.js |
— | — | @@ -1424,6 +1424,8 @@ |
1425 | 1425 | $j( '#wikieditor-toolbar-link-type-int, #wikieditor-toolbar-link-type-ext' ).attr( 'checked', '' ); |
1426 | 1426 | }, |
1427 | 1427 | 'wikieditor-toolbar-tool-link-cancel': function() { |
| 1428 | + // Clear any saved selection state |
| 1429 | + context.fn.restoreStuffForIE(); |
1428 | 1430 | $j(this).dialog( 'close' ); |
1429 | 1431 | } |
1430 | 1432 | }, |
— | — | @@ -1434,8 +1436,11 @@ |
1435 | 1437 | .replace( /\\\$1/g, '(.*)' ) + '$' |
1436 | 1438 | ) ); |
1437 | 1439 | // Pre-fill the text fields based on the current selection |
1438 | | - var selection = $j(this).data( 'context' ) |
1439 | | - .$textarea.textSelection( 'getSelection' ); |
| 1440 | + var context = $j(this).data( 'context' ); |
| 1441 | + // Restore and immediately save selection state, needed for inserting stuff later |
| 1442 | + context.fn.restoreStuffForIE(); |
| 1443 | + context.fn.saveStuffForIE(); |
| 1444 | + var selection = context.$textarea.textSelection( 'getSelection' ); |
1440 | 1445 | $j( '#wikieditor-toolbar-link-int-target' ).focus(); |
1441 | 1446 | // Trigger the change event, so the link status indicator is up to date |
1442 | 1447 | $j( '#wikieditor-toolbar-link-int-target' ).change(); |
— | — | @@ -1554,13 +1559,18 @@ |
1555 | 1560 | $j( '#wikieditor-toolbar-reference-text' ).val( "" ); |
1556 | 1561 | }, |
1557 | 1562 | 'wikieditor-toolbar-tool-reference-cancel': function() { |
| 1563 | + // Clear any saved selection state |
| 1564 | + context.fn.restoreStuffForIE(); |
1558 | 1565 | $j( this ).dialog( 'close' ); |
1559 | 1566 | } |
1560 | 1567 | }, |
1561 | 1568 | open: function() { |
1562 | 1569 | // Pre-fill the text fields based on the current selection |
1563 | | - var selection = $j(this).data( 'context' ) |
1564 | | - .$textarea.textSelection( 'getSelection' ); |
| 1570 | + var context = $j(this).data( 'context' ); |
| 1571 | + // Restore and immediately save selection state, needed for inserting stuff later |
| 1572 | + context.fn.restoreStuffForIE(); |
| 1573 | + context.fn.saveStuffForIE(); |
| 1574 | + var selection = context.$textarea.textSelection( 'getSelection' ); |
1565 | 1575 | // set focus |
1566 | 1576 | $j( '#wikieditor-toolbar-reference-text' ).focus(); |
1567 | 1577 | $j( '#wikieditor-toolbar-reference-dialog' ) |
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.min.js |
— | — | @@ -68,7 +68,7 @@ |
69 | 69 | insertText=escTarget;else if(text=='') |
70 | 70 | insertText='['+escTarget+']';else |
71 | 71 | insertText='['+escTarget+' '+escText+']';} |
72 | | -if(whitespace)insertText=whitespace[0]+insertText+whitespace[1];$j(this).dialog('close');$j.wikiEditor.modules.toolbar.fn.doAction($j(this).data('context'),{type:'replace',options:{pre:insertText}},$j(this));$j('#wikieditor-toolbar-link-int-target, #wikieditor-toolbar-link-int-text').val('');$j('#wikieditor-toolbar-link-type-int, #wikieditor-toolbar-link-type-ext').attr('checked','');},'wikieditor-toolbar-tool-link-cancel':function(){$j(this).dialog('close');}},open:function(){$j(this).data('articlePathRegex',new RegExp('^'+RegExp.escape(wgServer+wgArticlePath).replace(/\\\$1/g,'(.*)')+'$'));var selection=$j(this).data('context').$textarea.textSelection('getSelection');$j('#wikieditor-toolbar-link-int-target').focus();$j('#wikieditor-toolbar-link-int-target').change();$j('#wikieditor-toolbar-link-dialog').data('whitespace',['','']);if(selection!=''){var target,text,type;var matches;if((matches=selection.match(/^(\s*)\[\[([^\]\|]+)(\|([^\]\|]*))?\]\](\s*)$/))){target=matches[2];text=(matches[4]?matches[4]:matches[2]);type='int';$j('#wikieditor-toolbar-link-dialog').data('whitespace',[matches[1],matches[5]]);}else if((matches=selection.match(/^(\s*)\[([^\] ]+)( ([^\]]+))?\](\s*)$/))){target=matches[2];text=(matches[4]?matches[4]:'');type='ext';$j('#wikieditor-toolbar-link-dialog').data('whitespace',[matches[1],matches[5]]);}else{target=text=selection;} |
| 72 | +if(whitespace)insertText=whitespace[0]+insertText+whitespace[1];$j(this).dialog('close');$j.wikiEditor.modules.toolbar.fn.doAction($j(this).data('context'),{type:'replace',options:{pre:insertText}},$j(this));$j('#wikieditor-toolbar-link-int-target, #wikieditor-toolbar-link-int-text').val('');$j('#wikieditor-toolbar-link-type-int, #wikieditor-toolbar-link-type-ext').attr('checked','');},'wikieditor-toolbar-tool-link-cancel':function(){context.fn.restoreStuffForIE();$j(this).dialog('close');}},open:function(){$j(this).data('articlePathRegex',new RegExp('^'+RegExp.escape(wgServer+wgArticlePath).replace(/\\\$1/g,'(.*)')+'$'));var context=$j(this).data('context');context.fn.restoreStuffForIE();context.fn.saveStuffForIE();var selection=context.$textarea.textSelection('getSelection');$j('#wikieditor-toolbar-link-int-target').focus();$j('#wikieditor-toolbar-link-int-target').change();$j('#wikieditor-toolbar-link-dialog').data('whitespace',['','']);if(selection!=''){var target,text,type;var matches;if((matches=selection.match(/^(\s*)\[\[([^\]\|]+)(\|([^\]\|]*))?\]\](\s*)$/))){target=matches[2];text=(matches[4]?matches[4]:matches[2]);type='int';$j('#wikieditor-toolbar-link-dialog').data('whitespace',[matches[1],matches[5]]);}else if((matches=selection.match(/^(\s*)\[([^\] ]+)( ([^\]]+))?\](\s*)$/))){target=matches[2];text=(matches[4]?matches[4]:'');type='ext';$j('#wikieditor-toolbar-link-dialog').data('whitespace',[matches[1],matches[5]]);}else{target=text=selection;} |
73 | 73 | if(typeof text!='undefined') |
74 | 74 | $j('#wikieditor-toolbar-link-int-text').val(text).change();if(typeof target!='undefined') |
75 | 75 | $j('#wikieditor-toolbar-link-int-target').val(target).change();if(typeof type!='undefined') |
— | — | @@ -84,7 +84,7 @@ |
85 | 85 | <input type="text" id="wikieditor-toolbar-reference-text" />\ |
86 | 86 | </div>\ |
87 | 87 | </div></fieldset>\ |
88 | | - </div>',init:function(){$j(this).find('[rel]').each(function(){$j(this).text(mw.usability.getMsg($j(this).attr('rel')));});},dialog:{dialogClass:'wikiEditor-toolbar-dialog',width:590,buttons:{'wikieditor-toolbar-tool-reference-insert':function(){var insertText=$j('#wikieditor-toolbar-reference-text').val();var whitespace=$j('#wikieditor-toolbar-reference-dialog').data('whitespace');var attributes=$j('#wikieditor-toolbar-reference-dialog').data('attributes');$j(this).dialog('close');$j.wikiEditor.modules.toolbar.fn.doAction($j(this).data('context'),{type:'replace',options:{pre:whitespace[0]+'<ref'+attributes+'>',peri:insertText,post:'</ref>'+whitespace[1]}},$j(this));$j('#wikieditor-toolbar-reference-text').val("");},'wikieditor-toolbar-tool-reference-cancel':function(){$j(this).dialog('close');}},open:function(){var selection=$j(this).data('context').$textarea.textSelection('getSelection');$j('#wikieditor-toolbar-reference-text').focus();$j('#wikieditor-toolbar-reference-dialog').data('whitespace',['','']).data('attributes','');if(selection!=''){var matches,text;if((matches=selection.match(/^(\s*)<ref([^\>]*)>([^\<]*)<\/ref\>(\s*)$/))){text=matches[3];$j('#wikieditor-toolbar-reference-dialog').data('whitespace',[matches[1],matches[4]]);$j('#wikieditor-toolbar-reference-dialog').data('attributes',matches[2]);}else{text=selection;} |
| 88 | + </div>',init:function(){$j(this).find('[rel]').each(function(){$j(this).text(mw.usability.getMsg($j(this).attr('rel')));});},dialog:{dialogClass:'wikiEditor-toolbar-dialog',width:590,buttons:{'wikieditor-toolbar-tool-reference-insert':function(){var insertText=$j('#wikieditor-toolbar-reference-text').val();var whitespace=$j('#wikieditor-toolbar-reference-dialog').data('whitespace');var attributes=$j('#wikieditor-toolbar-reference-dialog').data('attributes');$j(this).dialog('close');$j.wikiEditor.modules.toolbar.fn.doAction($j(this).data('context'),{type:'replace',options:{pre:whitespace[0]+'<ref'+attributes+'>',peri:insertText,post:'</ref>'+whitespace[1]}},$j(this));$j('#wikieditor-toolbar-reference-text').val("");},'wikieditor-toolbar-tool-reference-cancel':function(){context.fn.restoreStuffForIE();$j(this).dialog('close');}},open:function(){var context=$j(this).data('context');context.fn.restoreStuffForIE();context.fn.saveStuffForIE();var selection=context.$textarea.textSelection('getSelection');$j('#wikieditor-toolbar-reference-text').focus();$j('#wikieditor-toolbar-reference-dialog').data('whitespace',['','']).data('attributes','');if(selection!=''){var matches,text;if((matches=selection.match(/^(\s*)<ref([^\>]*)>([^\<]*)<\/ref\>(\s*)$/))){text=matches[3];$j('#wikieditor-toolbar-reference-dialog').data('whitespace',[matches[1],matches[4]]);$j('#wikieditor-toolbar-reference-dialog').data('attributes',matches[2]);}else{text=selection;} |
89 | 89 | $j('#wikieditor-toolbar-reference-text').val(text);} |
90 | 90 | if(!($j(this).data('dialogkeypressset'))){$j(this).data('dialogkeypressset',true);$j(this).closest('.ui-dialog').keypress(function(e){if((e.keyCode||e.which)==13){var button=$j(this).data('dialogaction')||$j(this).find('button:first');button.click();e.preventDefault();}});$j(this).closest('.ui-dialog').find('button').focus(function(){$j(this).closest('.ui-dialog').data('dialogaction',this);});}}}},'insert-table':{filters:['#wpTextbox1.toolbar-dialogs'],titleMsg:'wikieditor-toolbar-tool-table-title',id:'wikieditor-toolbar-table-dialog',html:'\ |
91 | 91 | <div class="wikieditor-toolbar-dialog-wrapper">\ |
Index: trunk/extensions/UsabilityInitiative/WikiEditor/Modules/Toolbar/Toolbar.js |
— | — | @@ -1375,6 +1375,8 @@ |
1376 | 1376 | $j( '#wikieditor-toolbar-link-type-int, #wikieditor-toolbar-link-type-ext' ).attr( 'checked', '' ); |
1377 | 1377 | }, |
1378 | 1378 | 'wikieditor-toolbar-tool-link-cancel': function() { |
| 1379 | + // Clear any saved selection state |
| 1380 | + context.fn.restoreStuffForIE(); |
1379 | 1381 | $j(this).dialog( 'close' ); |
1380 | 1382 | } |
1381 | 1383 | }, |
— | — | @@ -1385,8 +1387,11 @@ |
1386 | 1388 | .replace( /\\\$1/g, '(.*)' ) + '$' |
1387 | 1389 | ) ); |
1388 | 1390 | // Pre-fill the text fields based on the current selection |
1389 | | - var selection = $j(this).data( 'context' ) |
1390 | | - .$textarea.textSelection( 'getSelection' ); |
| 1391 | + var context = $j(this).data( 'context' ); |
| 1392 | + // Restore and immediately save selection state, needed for inserting stuff later |
| 1393 | + context.fn.restoreStuffForIE(); |
| 1394 | + context.fn.saveStuffForIE(); |
| 1395 | + var selection = context.$textarea.textSelection( 'getSelection' ); |
1391 | 1396 | $j( '#wikieditor-toolbar-link-int-target' ).focus(); |
1392 | 1397 | // Trigger the change event, so the link status indicator is up to date |
1393 | 1398 | $j( '#wikieditor-toolbar-link-int-target' ).change(); |
— | — | @@ -1505,13 +1510,18 @@ |
1506 | 1511 | $j( '#wikieditor-toolbar-reference-text' ).val( "" ); |
1507 | 1512 | }, |
1508 | 1513 | 'wikieditor-toolbar-tool-reference-cancel': function() { |
| 1514 | + // Clear any saved selection state |
| 1515 | + context.fn.restoreStuffForIE(); |
1509 | 1516 | $j( this ).dialog( 'close' ); |
1510 | 1517 | } |
1511 | 1518 | }, |
1512 | 1519 | open: function() { |
1513 | 1520 | // Pre-fill the text fields based on the current selection |
1514 | | - var selection = $j(this).data( 'context' ) |
1515 | | - .$textarea.textSelection( 'getSelection' ); |
| 1521 | + var context = $j(this).data( 'context' ); |
| 1522 | + // Restore and immediately save selection state, needed for inserting stuff later |
| 1523 | + context.fn.restoreStuffForIE(); |
| 1524 | + context.fn.saveStuffForIE(); |
| 1525 | + var selection = context.$textarea.textSelection( 'getSelection' ); |
1516 | 1526 | // set focus |
1517 | 1527 | $j( '#wikieditor-toolbar-reference-text' ).focus(); |
1518 | 1528 | $j( '#wikieditor-toolbar-reference-dialog' ) |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.textSelection.js |
— | — | @@ -52,13 +52,13 @@ |
53 | 53 | options.post += ' '; |
54 | 54 | } |
55 | 55 | } |
56 | | - var selText = $(this).textSelection( 'getSelection' ); |
57 | 56 | var isSample = false; |
58 | 57 | if ( this.style.display == 'none' ) { |
59 | 58 | // Do nothing |
60 | 59 | } else if ( this.selectionStart || this.selectionStart == '0' ) { |
61 | 60 | // Mozilla/Opera |
62 | 61 | $(this).focus(); |
| 62 | + var selText = $(this).textSelection( 'getSelection' ); |
63 | 63 | var startPos = this.selectionStart; |
64 | 64 | var endPos = this.selectionEnd; |
65 | 65 | var scrollTop = this.scrollTop; |
— | — | @@ -90,13 +90,10 @@ |
91 | 91 | } |
92 | 92 | } else if ( document.selection && document.selection.createRange ) { |
93 | 93 | // IE |
94 | | - // For some mysterious reason, clicking a toolbar button is enough to make |
95 | | - // the textarea scroll. Check if a toolbar button's mousedown handler saved |
96 | | - // the scroll position and use it if available. |
97 | | - var scrollTop = $(this).data( 'scrollTop' ) || this.scrollTop; |
98 | | - $(this).data( 'scrollTop', null ); |
99 | 94 | $(this).focus(); |
100 | | - this.scrollTop = scrollTop; |
| 95 | + context.fn.restoreStuffForIE(); |
| 96 | + var selText = $(this).textSelection( 'getSelection' ); |
| 97 | + var scrollTop = this.scrollTop; |
101 | 98 | var range = document.selection.createRange(); |
102 | 99 | if ( options.ownline && range.moveStart ) { |
103 | 100 | var range2 = document.selection.createRange(); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js |
— | — | @@ -1724,6 +1724,33 @@ |
1725 | 1725 | body.scrollTop( y ); |
1726 | 1726 | } |
1727 | 1727 | $element.trigger( 'scrollToTop' ); |
| 1728 | + }, |
| 1729 | + /** |
| 1730 | + * Save scrollTop and cursor position for IE. |
| 1731 | + */ |
| 1732 | + 'saveStuffForIE': function() { |
| 1733 | + // Only need this for IE in textarea mode |
| 1734 | + if ( !$.browser.msie || context.$iframe ) |
| 1735 | + return; |
| 1736 | + var IHateIE = { |
| 1737 | + 'scrollTop' : context.$textarea.scrollTop(), |
| 1738 | + 'pos': context.$textarea.textSelection( 'getCaretPosition', { startAndEnd: true } ) |
| 1739 | + }; |
| 1740 | + context.$textarea.data( 'IHateIE', IHateIE ); |
| 1741 | + }, |
| 1742 | + /** |
| 1743 | + * Restore scrollTo and cursor position for IE. |
| 1744 | + */ |
| 1745 | + 'restoreStuffForIE': function() { |
| 1746 | + // Only need this for IE in textarea mode |
| 1747 | + if ( !$.browser.msie || context.$iframe ) |
| 1748 | + return; |
| 1749 | + var IHateIE = context.$textarea.data( 'IHateIE' ); |
| 1750 | + if ( !IHateIE ) |
| 1751 | + return; |
| 1752 | + context.$textarea.scrollTop( IHateIE.scrollTop ); |
| 1753 | + context.$textarea.textSelection( 'setSelection', { start: IHateIE.pos[0], end: IHateIE.pos[1] } ); |
| 1754 | + context.$textarea.data( 'IHateIE', null ); |
1728 | 1755 | } |
1729 | 1756 | }; |
1730 | 1757 | |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js |
— | — | @@ -111,8 +111,7 @@ |
112 | 112 | .append( |
113 | 113 | $( $.wikiEditor.modules.toolbar.fn.buildCharacter( data[type][character], actions ) ) |
114 | 114 | .mousedown( function( e ) { |
115 | | - // Save scroll position for IE |
116 | | - context.$textarea.data( 'scrollTop', context.$textarea.scrollTop() ); |
| 115 | + context.fn.saveStuffForIE(); |
117 | 116 | // No dragging! |
118 | 117 | e.preventDefault(); |
119 | 118 | return false; |
— | — | @@ -344,8 +343,7 @@ |
345 | 344 | .data( 'action', tool.action ) |
346 | 345 | .data( 'context', context ) |
347 | 346 | .mousedown( function( e ) { |
348 | | - // Save scroll position for IE |
349 | | - context.$textarea.data( 'scrollTop', context.$textarea.scrollTop() ); |
| 347 | + context.fn.saveStuffForIE(); |
350 | 348 | // No dragging! |
351 | 349 | e.preventDefault(); |
352 | 350 | return false; |
— | — | @@ -382,8 +380,7 @@ |
383 | 381 | .data( 'action', tool.list[option].action ) |
384 | 382 | .data( 'context', context ) |
385 | 383 | .mousedown( function( e ) { |
386 | | - // Save scroll position for IE |
387 | | - context.$textarea.data( 'scrollTop', context.$textarea.scrollTop() ); |
| 384 | + context.fn.saveStuffForIE(); |
388 | 385 | // No dragging! |
389 | 386 | e.preventDefault(); |
390 | 387 | return false; |
— | — | @@ -499,8 +496,7 @@ |
500 | 497 | .html( html ) |
501 | 498 | .children() |
502 | 499 | .mousedown( function( e ) { |
503 | | - // Save scroll position for IE |
504 | | - context.$textarea.data( 'scrollTop', context.$textarea.scrollTop() ); |
| 500 | + context.fn.saveStuffForIE(); |
505 | 501 | // No dragging! |
506 | 502 | e.preventDefault(); |
507 | 503 | return false; |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -6254,13 +6254,13 @@ |
6255 | 6255 | options.post += ' '; |
6256 | 6256 | } |
6257 | 6257 | } |
6258 | | - var selText = $(this).textSelection( 'getSelection' ); |
6259 | 6258 | var isSample = false; |
6260 | 6259 | if ( this.style.display == 'none' ) { |
6261 | 6260 | // Do nothing |
6262 | 6261 | } else if ( this.selectionStart || this.selectionStart == '0' ) { |
6263 | 6262 | // Mozilla/Opera |
6264 | 6263 | $(this).focus(); |
| 6264 | + var selText = $(this).textSelection( 'getSelection' ); |
6265 | 6265 | var startPos = this.selectionStart; |
6266 | 6266 | var endPos = this.selectionEnd; |
6267 | 6267 | var scrollTop = this.scrollTop; |
— | — | @@ -6292,13 +6292,10 @@ |
6293 | 6293 | } |
6294 | 6294 | } else if ( document.selection && document.selection.createRange ) { |
6295 | 6295 | // IE |
6296 | | - // For some mysterious reason, clicking a toolbar button is enough to make |
6297 | | - // the textarea scroll. Check if a toolbar button's mousedown handler saved |
6298 | | - // the scroll position and use it if available. |
6299 | | - var scrollTop = $(this).data( 'scrollTop' ) || this.scrollTop; |
6300 | | - $(this).data( 'scrollTop', null ); |
6301 | 6296 | $(this).focus(); |
6302 | | - this.scrollTop = scrollTop; |
| 6297 | + context.fn.restoreStuffForIE(); |
| 6298 | + var selText = $(this).textSelection( 'getSelection' ); |
| 6299 | + var scrollTop = this.scrollTop; |
6303 | 6300 | var range = document.selection.createRange(); |
6304 | 6301 | if ( options.ownline && range.moveStart ) { |
6305 | 6302 | var range2 = document.selection.createRange(); |
— | — | @@ -8325,6 +8322,33 @@ |
8326 | 8323 | body.scrollTop( y ); |
8327 | 8324 | } |
8328 | 8325 | $element.trigger( 'scrollToTop' ); |
| 8326 | + }, |
| 8327 | + /** |
| 8328 | + * Save scrollTop and cursor position for IE. |
| 8329 | + */ |
| 8330 | + 'saveStuffForIE': function() { |
| 8331 | + // Only need this for IE in textarea mode |
| 8332 | + if ( !$.browser.msie || context.$iframe ) |
| 8333 | + return; |
| 8334 | + var IHateIE = { |
| 8335 | + 'scrollTop' : context.$textarea.scrollTop(), |
| 8336 | + 'pos': context.$textarea.textSelection( 'getCaretPosition', { startAndEnd: true } ) |
| 8337 | + }; |
| 8338 | + context.$textarea.data( 'IHateIE', IHateIE ); |
| 8339 | + }, |
| 8340 | + /** |
| 8341 | + * Restore scrollTo and cursor position for IE. |
| 8342 | + */ |
| 8343 | + 'restoreStuffForIE': function() { |
| 8344 | + // Only need this for IE in textarea mode |
| 8345 | + if ( !$.browser.msie || context.$iframe ) |
| 8346 | + return; |
| 8347 | + var IHateIE = context.$textarea.data( 'IHateIE' ); |
| 8348 | + if ( !IHateIE ) |
| 8349 | + return; |
| 8350 | + context.$textarea.scrollTop( IHateIE.scrollTop ); |
| 8351 | + context.$textarea.textSelection( 'setSelection', { start: IHateIE.pos[0], end: IHateIE.pos[1] } ); |
| 8352 | + context.$textarea.data( 'IHateIE', null ); |
8329 | 8353 | } |
8330 | 8354 | }; |
8331 | 8355 | |
— | — | @@ -10935,8 +10959,7 @@ |
10936 | 10960 | .append( |
10937 | 10961 | $( $.wikiEditor.modules.toolbar.fn.buildCharacter( data[type][character], actions ) ) |
10938 | 10962 | .mousedown( function( e ) { |
10939 | | - // Save scroll position for IE |
10940 | | - context.$textarea.data( 'scrollTop', context.$textarea.scrollTop() ); |
| 10963 | + context.fn.saveStuffForIE(); |
10941 | 10964 | // No dragging! |
10942 | 10965 | e.preventDefault(); |
10943 | 10966 | return false; |
— | — | @@ -11168,8 +11191,7 @@ |
11169 | 11192 | .data( 'action', tool.action ) |
11170 | 11193 | .data( 'context', context ) |
11171 | 11194 | .mousedown( function( e ) { |
11172 | | - // Save scroll position for IE |
11173 | | - context.$textarea.data( 'scrollTop', context.$textarea.scrollTop() ); |
| 11195 | + context.fn.saveStuffForIE(); |
11174 | 11196 | // No dragging! |
11175 | 11197 | e.preventDefault(); |
11176 | 11198 | return false; |
— | — | @@ -11206,8 +11228,7 @@ |
11207 | 11229 | .data( 'action', tool.list[option].action ) |
11208 | 11230 | .data( 'context', context ) |
11209 | 11231 | .mousedown( function( e ) { |
11210 | | - // Save scroll position for IE |
11211 | | - context.$textarea.data( 'scrollTop', context.$textarea.scrollTop() ); |
| 11232 | + context.fn.saveStuffForIE(); |
11212 | 11233 | // No dragging! |
11213 | 11234 | e.preventDefault(); |
11214 | 11235 | return false; |
— | — | @@ -11323,8 +11344,7 @@ |
11324 | 11345 | .html( html ) |
11325 | 11346 | .children() |
11326 | 11347 | .mousedown( function( e ) { |
11327 | | - // Save scroll position for IE |
11328 | | - context.$textarea.data( 'scrollTop', context.$textarea.scrollTop() ); |
| 11348 | + context.fn.saveStuffForIE(); |
11329 | 11349 | // No dragging! |
11330 | 11350 | e.preventDefault(); |
11331 | 11351 | return false; |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -414,12 +414,12 @@ |
415 | 415 | context.data.$container.hide();$.suggestions.cancel(context);});} |
416 | 416 | $(this).data('suggestions-context',context);});return returnValue!==null?returnValue:$(this);};})(jQuery);(function($){$.fn.textSelection=function(command,options){var fn={getContents:function(){return this.val();},getSelection:function(){var e=this.get(0);var retval='';if($(e).is(':hidden')){}else if(document.selection&&document.selection.createRange){e.focus();var range=document.selection.createRange();retval=range.text;}else if(e.selectionStart||e.selectionStart=='0'){retval=e.value.substring(e.selectionStart,e.selectionEnd);} |
417 | 417 | return retval;},encapsulateSelection:function(options){return this.each(function(){function checkSelectedText(){if(!selText){selText=options.peri;isSample=true;}else if(options.replace){selText=options.peri;}else if(selText.charAt(selText.length-1)==' '){selText=selText.substring(0,selText.length-1);options.post+=' ';}} |
418 | | -var selText=$(this).textSelection('getSelection');var isSample=false;if(this.style.display=='none'){}else if(this.selectionStart||this.selectionStart=='0'){$(this).focus();var startPos=this.selectionStart;var endPos=this.selectionEnd;var scrollTop=this.scrollTop;checkSelectedText();if(options.ownline){if(startPos!=0&&this.value.charAt(startPos-1)!="\n"){options.pre="\n"+options.pre;} |
| 418 | +var isSample=false;if(this.style.display=='none'){}else if(this.selectionStart||this.selectionStart=='0'){$(this).focus();var selText=$(this).textSelection('getSelection');var startPos=this.selectionStart;var endPos=this.selectionEnd;var scrollTop=this.scrollTop;checkSelectedText();if(options.ownline){if(startPos!=0&&this.value.charAt(startPos-1)!="\n"){options.pre="\n"+options.pre;} |
419 | 419 | if(this.value.charAt(endPos)!="\n"){options.post+="\n";}} |
420 | 420 | this.value=this.value.substring(0,startPos)+options.pre+selText+options.post+ |
421 | 421 | this.value.substring(endPos,this.value.length);this.scrollTop=scrollTop;if(window.opera){options.pre=options.pre.replace(/\r?\n/g,"\r\n");selText=selText.replace(/\r?\n/g,"\r\n");options.post=options.post.replace(/\r?\n/g,"\r\n");} |
422 | 422 | if(isSample){this.selectionStart=startPos+options.pre.length;this.selectionEnd=startPos+options.pre.length+selText.length;}else{this.selectionStart=startPos+options.pre.length+selText.length+ |
423 | | -options.post.length;this.selectionEnd=this.selectionStart;}}else if(document.selection&&document.selection.createRange){var scrollTop=$(this).data('scrollTop')||this.scrollTop;$(this).data('scrollTop',null);$(this).focus();this.scrollTop=scrollTop;var range=document.selection.createRange();if(options.ownline&&range.moveStart){var range2=document.selection.createRange();range2.collapse();range2.moveStart('character',-1);if(range2.text!="\r"&&range2.text!="\n"&&range2.text!=""){options.pre="\n"+options.pre;} |
| 423 | +options.post.length;this.selectionEnd=this.selectionStart;}}else if(document.selection&&document.selection.createRange){$(this).focus();context.fn.restoreStuffForIE();var selText=$(this).textSelection('getSelection');var scrollTop=this.scrollTop;var range=document.selection.createRange();if(options.ownline&&range.moveStart){var range2=document.selection.createRange();range2.collapse();range2.moveStart('character',-1);if(range2.text!="\r"&&range2.text!="\n"&&range2.text!=""){options.pre="\n"+options.pre;} |
424 | 424 | var range3=document.selection.createRange();range3.collapse(false);range3.moveEnd('character',1);if(range3.text!="\r"&&range3.text!="\n"&&range3.text!=""){options.post+="\n";}} |
425 | 425 | checkSelectedText();range.text=options.pre+selText+options.post;if(isSample&&range.moveStart){range.moveStart('character',-options.post.length-selText.length);range.moveEnd('character',-options.post.length);} |
426 | 426 | range.select();this.scrollTop=scrollTop;} |
— | — | @@ -576,7 +576,10 @@ |
577 | 577 | range2.setEndPoint('StartToEnd',range);range2.select();} |
578 | 578 | return context.$textarea;},'scrollToCaretPosition':function(options){context.fn.scrollToTop(context.fn.getElementAtCursor(),true);},'scrollToTop':function($element,force){var html=context.$content.closest('html'),body=context.$content.closest('body'),parentHtml=$('html'),parentBody=$('body');var y=$element.offset().top;if(!$.browser.msie&&!$element.is('body')){y=parentHtml.scrollTop()>0?y+html.scrollTop()-parentHtml.scrollTop():y;y=parentBody.scrollTop()>0?y+body.scrollTop()-parentBody.scrollTop():y;} |
579 | 579 | var topBound=html.scrollTop()>body.scrollTop()?html.scrollTop():body.scrollTop(),bottomBound=topBound+context.$iframe.height();if(force||y<topBound||y>bottomBound){html.scrollTop(y);body.scrollTop(y);} |
580 | | -$element.trigger('scrollToTop');}};context.$textarea.wrapAll($('<div></div>').addClass('wikiEditor-ui')).wrapAll($('<div></div>').addClass('wikiEditor-ui-view wikiEditor-ui-view-wikitext')).wrapAll($('<div></div>').addClass('wikiEditor-ui-left')).wrapAll($('<div></div>').addClass('wikiEditor-ui-bottom')).wrapAll($('<div></div>').addClass('wikiEditor-ui-text'));context.$ui=context.$textarea.parent().parent().parent().parent().parent();context.$wikitext=context.$textarea.parent().parent().parent().parent();context.$wikitext.before($('<div></div>').addClass('wikiEditor-ui-controls').append($('<div></div>').addClass('wikiEditor-ui-tabs').hide()).append($('<div></div>').addClass('wikiEditor-ui-buttons'))).before($('<div style="clear:both;"></div>'));context.$controls=context.$ui.find('.wikiEditor-ui-buttons').hide();context.$buttons=context.$ui.find('.wikiEditor-ui-buttons');context.$tabs=context.$ui.find('.wikiEditor-ui-tabs');context.$ui.after($('<div style="clear:both;"></div>'));context.$wikitext.append($('<div></div>').addClass('wikiEditor-ui-right'));context.$wikitext.find('.wikiEditor-ui-left').prepend($('<div></div>').addClass('wikiEditor-ui-top'));context.view='wikitext';$(window).resize(function(event){context.fn.trigger('resize',event);});} |
| 580 | +$element.trigger('scrollToTop');},'saveStuffForIE':function(){if(!$.browser.msie||context.$iframe) |
| 581 | +return;var IHateIE={'scrollTop':context.$textarea.scrollTop(),'pos':context.$textarea.textSelection('getCaretPosition',{startAndEnd:true})};context.$textarea.data('IHateIE',IHateIE);},'restoreStuffForIE':function(){if(!$.browser.msie||context.$iframe) |
| 582 | +return;var IHateIE=context.$textarea.data('IHateIE');if(!IHateIE) |
| 583 | +return;context.$textarea.scrollTop(IHateIE.scrollTop);context.$textarea.textSelection('setSelection',{start:IHateIE.pos[0],end:IHateIE.pos[1]});context.$textarea.data('IHateIE',null);}};context.$textarea.wrapAll($('<div></div>').addClass('wikiEditor-ui')).wrapAll($('<div></div>').addClass('wikiEditor-ui-view wikiEditor-ui-view-wikitext')).wrapAll($('<div></div>').addClass('wikiEditor-ui-left')).wrapAll($('<div></div>').addClass('wikiEditor-ui-bottom')).wrapAll($('<div></div>').addClass('wikiEditor-ui-text'));context.$ui=context.$textarea.parent().parent().parent().parent().parent();context.$wikitext=context.$textarea.parent().parent().parent().parent();context.$wikitext.before($('<div></div>').addClass('wikiEditor-ui-controls').append($('<div></div>').addClass('wikiEditor-ui-tabs').hide()).append($('<div></div>').addClass('wikiEditor-ui-buttons'))).before($('<div style="clear:both;"></div>'));context.$controls=context.$ui.find('.wikiEditor-ui-buttons').hide();context.$buttons=context.$ui.find('.wikiEditor-ui-buttons');context.$tabs=context.$ui.find('.wikiEditor-ui-tabs');context.$ui.after($('<div style="clear:both;"></div>'));context.$wikitext.append($('<div></div>').addClass('wikiEditor-ui-right'));context.$wikitext.find('.wikiEditor-ui-left').prepend($('<div></div>').addClass('wikiEditor-ui-top'));context.view='wikitext';$(window).resize(function(event){context.fn.trigger('resize',event);});} |
581 | 584 | var args=$.makeArray(arguments);if(typeof context.$iframe==='undefined'&&args[0]=='addModule'&&typeof args[1]!='undefined'){var modules=args[1];if(typeof modules!="object"){modules={};modules[args[1]]='';} |
582 | 585 | for(module in modules){if(module in $.wikiEditor.modules&&$.wikiEditor.isSupported($.wikiEditor.modules[module])&&$.wikiEditor.isRequired($.wikiEditor.modules[module],'iframe')){context.fn.setupIframe();break;}}} |
583 | 586 | if(args.length>0){var call=args.shift();if(call in context.api){context.api[call](context,typeof args[0]=='undefined'?{}:args[0]);}} |
— | — | @@ -746,7 +749,7 @@ |
747 | 750 | $.wikiEditor.modules.toolbar.fn.updateBookletSelection(context,page,$pages,$index);break;case'rows':if(!('section'in data&&'page'in data)){continue;} |
748 | 751 | var $table=context.modules.toolbar.$toolbar.find('div[rel='+data.section+'].section '+'div[rel='+data.page+'].page table');for(row in data[type]){$table.append($.wikiEditor.modules.toolbar.fn.buildRow(context,data[type][row]));} |
749 | 752 | break;case'characters':if(!('section'in data&&'page'in data)){continue;} |
750 | | -$characters=context.modules.toolbar.$toolbar.find('div[rel='+data.section+'].section '+'div[rel='+data.page+'].page div');var actions=$characters.data('actions');for(character in data[type]){$characters.append($($.wikiEditor.modules.toolbar.fn.buildCharacter(data[type][character],actions)).mousedown(function(e){context.$textarea.data('scrollTop',context.$textarea.scrollTop());e.preventDefault();return false;}).click(function(e){$.wikiEditor.modules.toolbar.fn.doAction($(this).parent().data('context'),$(this).parent().data('actions')[$(this).attr('rel')]);e.preventDefault();return false;}));} |
| 753 | +$characters=context.modules.toolbar.$toolbar.find('div[rel='+data.section+'].section '+'div[rel='+data.page+'].page div');var actions=$characters.data('actions');for(character in data[type]){$characters.append($($.wikiEditor.modules.toolbar.fn.buildCharacter(data[type][character],actions)).mousedown(function(e){context.fn.saveStuffForIE();e.preventDefault();return false;}).click(function(e){$.wikiEditor.modules.toolbar.fn.doAction($(this).parent().data('context'),$(this).parent().data('actions')[$(this).attr('rel')]);e.preventDefault();return false;}));} |
751 | 754 | break;default:break;}}},removeFromToolbar:function(context,data){if(typeof data.section=='string'){var tab='div.tabs span[rel='+data.section+'].tab';var target='div[rel='+data.section+'].section';var group=null;if(typeof data.group=='string'){target+=' div[rel='+data.group+'].group';if(typeof data.tool=='string'){group=target;target+=' div[rel='+data.tool+'].tool';}}else if(typeof data.page=='string'){var index=target+' div.index div[rel='+data.page+']';target+=' div.pages div[rel='+data.page+'].page';if(typeof data.character=='string'){target+=' a[rel='+data.character+']';}else if(typeof data.row=='number'){target+=' table tr:not(:has(th)):eq('+data.row+')';}else{context.modules.toolbar.$toolbar.find(index).remove();$.wikiEditor.modules.toolbar.fn.updateBookletSelection(context,null,context.modules.toolbar.$toolbar.find(target),context.modules.toolbar.$toolbar.find(index));}}else{context.modules.toolbar.$toolbar.find(tab).remove();} |
752 | 755 | context.modules.toolbar.$toolbar.find(target).remove();if(group){$group=context.modules.toolbar.$toolbar.find(group);if($group.children().length==0){$group.hide();}}}}},evt:{resize:function(context,event){context.$ui.find('.sections').height(context.$ui.find('.sections .section-visible').outerHeight());},tocCollapse:function(context,event){$.wikiEditor.modules.toolbar.evt.resize(context,event);},tocExpand:function(context,event){$.wikiEditor.modules.toolbar.evt.resize(context,event);}},fn:{create:function(context,config){if('$toolbar'in context.modules.toolbar){return;} |
753 | 756 | context.modules.toolbar.$toolbar=$('<div />').addClass('wikiEditor-ui-toolbar').attr('id','wikiEditor-ui-toolbar');$.wikiEditor.modules.toolbar.fn.build(context,config);context.$ui.find('.wikiEditor-ui-top').append(context.modules.toolbar.$toolbar);},doAction:function(context,action,source){if($.trackAction!=undefined&&source.closest('.wikiEditor-ui-toolbar').size()){var rels=[];var step=source;var i=0;while(!step.hasClass('wikiEditor-ui-toolbar')){if(i>25){break;} |
— | — | @@ -761,8 +764,8 @@ |
762 | 765 | if(empty){$group.hide();} |
763 | 766 | return $group;},buildTool:function(context,id,tool){if('filters'in tool){for(filter in tool.filters){if($(tool.filters[filter]).size()==0){return null;}}} |
764 | 767 | var label=$.wikiEditor.autoMsg(tool,'label');switch(tool.type){case'button':var src=$.wikiEditor.autoIcon(tool.icon,$.wikiEditor.imgPath+'toolbar/');var $button;if('offset'in tool){var offset=$.wikiEditor.autoLang(tool.offset);$button=$('<span />').attr({'alt':label,'title':label,'rel':id,'class':'wikiEditor-toolbar-spritedButton'}).text(label).css('backgroundPosition',offset[0]+'px '+offset[1]+'px');}else{$button=$('<img />').attr({'src':src,'width':22,'height':22,'alt':label,'title':label,'rel':id,'class':'tool tool-button'});} |
765 | | -if('action'in tool){$button.data('action',tool.action).data('context',context).mousedown(function(e){context.$textarea.data('scrollTop',context.$textarea.scrollTop());e.preventDefault();return false;}).click(function(e){$.wikiEditor.modules.toolbar.fn.doAction($(this).data('context'),$(this).data('action'),$(this));e.preventDefault();return false;});if(tool.action.type=='dialog'&&!(tool.action.module in $.wikiEditor.modules.dialogs.modules)){$button.hide();context.$textarea.bind('wikiEditor-dialogs-setup-'+tool.action.module,{button:$button},function(event){event.data.button.show().parent().show();});}} |
766 | | -return $button;case'select':var $select=$('<div />').attr({'rel':id,'class':'tool tool-select'});var $options=$('<div />').addClass('options');if('list'in tool){for(option in tool.list){var optionLabel=$.wikiEditor.autoMsg(tool.list[option],'label');$options.append($('<a />').data('action',tool.list[option].action).data('context',context).mousedown(function(e){context.$textarea.data('scrollTop',context.$textarea.scrollTop());e.preventDefault();return false;}).click(function(e){$.wikiEditor.modules.toolbar.fn.doAction($(this).data('context'),$(this).data('action'),$(this));if($(this).parent().is(':visible')){$(this).parent().animate({'opacity':'toggle'},'fast');} |
| 768 | +if('action'in tool){$button.data('action',tool.action).data('context',context).mousedown(function(e){context.fn.saveStuffForIE();e.preventDefault();return false;}).click(function(e){$.wikiEditor.modules.toolbar.fn.doAction($(this).data('context'),$(this).data('action'),$(this));e.preventDefault();return false;});if(tool.action.type=='dialog'&&!(tool.action.module in $.wikiEditor.modules.dialogs.modules)){$button.hide();context.$textarea.bind('wikiEditor-dialogs-setup-'+tool.action.module,{button:$button},function(event){event.data.button.show().parent().show();});}} |
| 769 | +return $button;case'select':var $select=$('<div />').attr({'rel':id,'class':'tool tool-select'});var $options=$('<div />').addClass('options');if('list'in tool){for(option in tool.list){var optionLabel=$.wikiEditor.autoMsg(tool.list[option],'label');$options.append($('<a />').data('action',tool.list[option].action).data('context',context).mousedown(function(e){context.fn.saveStuffForIE();e.preventDefault();return false;}).click(function(e){$.wikiEditor.modules.toolbar.fn.doAction($(this).data('context'),$(this).data('action'),$(this));if($(this).parent().is(':visible')){$(this).parent().animate({'opacity':'toggle'},'fast');} |
767 | 770 | e.preventDefault();return false;}).text(optionLabel).addClass('option').attr({'rel':option,'href':'#'}));}} |
768 | 771 | $select.append($('<div />').addClass('menu').append($options));$select.append($('<a />').addClass('label').text(label).data('options',$options).attr('href','#').mousedown(function(e){e.preventDefault();return false;}).click(function(e){$(this).data('options').animate({'opacity':'toggle'},'fast');e.preventDefault();return false;}));return $select;default:return null;}},buildBookmark:function(context,id,page){var label=$.wikiEditor.autoMsg(page,'label');return $('<div />').text(label).attr('rel',id).data('context',context).mousedown(function(e){e.preventDefault();return false;}).click(function(event){$(this).parent().parent().find('.page').hide();$(this).parent().parent().find('.page-'+$(this).attr('rel')).show();$(this).siblings().removeClass('current');$(this).addClass('current');var section=$(this).parent().parent().attr('rel');$.cookie('wikiEditor-'+$(this).data('context').instance+'-booklet-'+section+'-page',$(this).attr('rel'));if($.trackAction!=undefined){$.trackAction(section+'.'+$(this).attr('rel'));} |
769 | 772 | event.preventDefault();return false;})},buildPage:function(context,id,page){var $page=$('<div />').attr({'class':'page page-'+id,'rel':id});switch(page.layout){case'table':$page.addClass('page-table');var html='<table cellpadding=0 cellspacing=0 '+'border=0 width="100%" class="table table-"'+id+'">';if('headings'in page){html+=$.wikiEditor.modules.toolbar.fn.buildHeading(context,page.headings)} |
— | — | @@ -770,7 +773,7 @@ |
771 | 774 | $page.html(html);break;case'characters':$page.addClass('page-characters');$characters=$('<div />').data('context',context).data('actions',{});var actions=$characters.data('actions');if('language'in page){$characters.attr('lang',page.language);} |
772 | 775 | if('direction'in page){$characters.attr('dir',page.direction);} |
773 | 776 | if('characters'in page){var html='';for(character in page.characters){html+=$.wikiEditor.modules.toolbar.fn.buildCharacter(page.characters[character],actions);} |
774 | | -$characters.html(html).children().mousedown(function(e){context.$textarea.data('scrollTop',context.$textarea.scrollTop());e.preventDefault();return false;}).click(function(e){$.wikiEditor.modules.toolbar.fn.doAction($(this).parent().data('context'),$(this).parent().data('actions')[$(this).attr('rel')],$(this));e.preventDefault();return false;});} |
| 777 | +$characters.html(html).children().mousedown(function(e){context.fn.saveStuffForIE();e.preventDefault();return false;}).click(function(e){$.wikiEditor.modules.toolbar.fn.doAction($(this).parent().data('context'),$(this).parent().data('actions')[$(this).attr('rel')],$(this));e.preventDefault();return false;});} |
775 | 778 | $page.append($characters);break;} |
776 | 779 | return $page;},buildHeading:function(context,headings){var html='<tr>';for(heading in headings){html+='<th>'+$.wikiEditor.autoMsg(headings[heading],['html','text'])+'</th>';} |
777 | 780 | return html;},buildRow:function(context,row){var html='<tr>';for(cell in row){html+='<td class="cell cell-'+cell+'" valign="top"><span>'+ |