Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -70,7 +70,7 @@ |
71 | 71 | array( 'src' => 'js/plugins/jquery.namespaceSelect.js', 'version' => 1 ), |
72 | 72 | array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 6 ), |
73 | 73 | array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 21 ), |
74 | | - array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 28 ), |
| 74 | + array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 29 ), |
75 | 75 | array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 1 ), |
76 | 76 | array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 35 ), |
77 | 77 | array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 9 ), |
— | — | @@ -79,10 +79,10 @@ |
80 | 80 | array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 0 ), |
81 | 81 | ), |
82 | 82 | 'combined' => array( |
83 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 97 ), |
| 83 | + array( 'src' => 'js/plugins.combined.js', 'version' => 98 ), |
84 | 84 | ), |
85 | 85 | 'minified' => array( |
86 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 97 ), |
| 86 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 98 ), |
87 | 87 | ), |
88 | 88 | ), |
89 | 89 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js |
— | — | @@ -375,7 +375,7 @@ |
376 | 376 | * Gets the currently selected text in the content |
377 | 377 | * DO NOT CALL THESE DIRECTLY, use .textSelection( 'functionname', options ) instead |
378 | 378 | */ |
379 | | - 'textSelection': function() { |
| 379 | + 'getSelection': function() { |
380 | 380 | var retval; |
381 | 381 | if ( context.$iframe[0].contentWindow.getSelection ) { |
382 | 382 | retval = context.$iframe[0].contentWindow.getSelection(); |
— | — | @@ -390,7 +390,7 @@ |
391 | 391 | return retval; |
392 | 392 | }, |
393 | 393 | /** |
394 | | - * Inserts text at the beginning and end of a text selection, optionally inserting text at the caret when |
| 394 | + * Inserts text at the begining and end of a text selection, optionally inserting text at the caret when |
395 | 395 | * selection is empty. |
396 | 396 | * DO NOT CALL THESE DIRECTLY, use .textSelection( 'functionname', options ) instead |
397 | 397 | */ |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -1562,11 +1562,11 @@ |
1563 | 1563 | context.fn = { |
1564 | 1564 | 'trigger': function( name, event ) { |
1565 | 1565 | // Event is an optional argument, but from here on out, at least the type field should be dependable |
1566 | | - if ( event == undefined ) { |
| 1566 | + if ( typeof event == 'undefined' ) { |
1567 | 1567 | event = { 'type': 'custom' }; |
1568 | 1568 | } |
1569 | 1569 | // Ensure there's a place for extra information to live |
1570 | | - if ( event.data == undefined ) { |
| 1570 | + if ( typeof event.data == 'undefined' ) { |
1571 | 1571 | event.data = {}; |
1572 | 1572 | } |
1573 | 1573 | // Allow filtering to occur |
— | — | @@ -1685,7 +1685,7 @@ |
1686 | 1686 | * Gets the currently selected text in the content |
1687 | 1687 | * DO NOT CALL THESE DIRECTLY, use .textSelection( 'functionname', options ) instead |
1688 | 1688 | */ |
1689 | | - 'textSelection': function() { |
| 1689 | + 'getSelection': function() { |
1690 | 1690 | var retval; |
1691 | 1691 | if ( context.$iframe[0].contentWindow.getSelection ) { |
1692 | 1692 | retval = context.$iframe[0].contentWindow.getSelection(); |
— | — | @@ -1700,7 +1700,7 @@ |
1701 | 1701 | return retval; |
1702 | 1702 | }, |
1703 | 1703 | /** |
1704 | | - * Inserts text at the beginning and end of a text selection, optionally inserting text at the caret when |
| 1704 | + * Inserts text at the begining and end of a text selection, optionally inserting text at the caret when |
1705 | 1705 | * selection is empty. |
1706 | 1706 | * DO NOT CALL THESE DIRECTLY, use .textSelection( 'functionname', options ) instead |
1707 | 1707 | */ |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -93,14 +93,14 @@ |
94 | 94 | context.evt={'change':function(event){switch(event.type){case'keypress':if(true){event.data.scope='division';}else{event.data.scope='character';} |
95 | 95 | break;case'mousedown':if(true){event.data.scope='division';}else{return false;} |
96 | 96 | break;default:event.data.scope='division';break;} |
97 | | -return true;}};context.fn={'trigger':function(name,event){if(event==undefined){event={'type':'custom'};} |
98 | | -if(event.data==undefined){event.data={};} |
| 97 | +return true;}};context.fn={'trigger':function(name,event){if(typeof event=='undefined'){event={'type':'custom'};} |
| 98 | +if(typeof event.data=='undefined'){event.data={};} |
99 | 99 | if(name in context.evt){if(!context.evt[name](event)){return false;}} |
100 | 100 | for(module in $.wikiEditor.modules){if('evt'in $.wikiEditor.modules[module]&&name in $.wikiEditor.modules[module].evt){$.wikiEditor.modules[module].evt[name](context,event);}}},'addButton':function(options){context.$controls.show();context.$buttons.show();return $('<button />').text($.wikiEditor.autoMsg(options,'caption')).click(options.action).appendTo(context.$buttons);},'addView':function(options){function addTab(options){context.$controls.show();context.$tabs.show();return $('<div></div>').attr('rel','wikiEditor-ui-view-'+options.name).addClass(context.view==options.name?'current':null).append($('<a></a>').attr('href','#').click(function(event){context.$ui.find('.wikiEditor-ui-view').hide();context.$ui.find('.'+$(this).parent().attr('rel')).show();context.$tabs.find('div').removeClass('current');$(this).parent().addClass('current');$(this).blur();if('init'in options&&typeof options.init=='function'){options.init(context);} |
101 | 101 | event.preventDefault();return false;}).text($.wikiEditor.autoMsg(options,'title'))).appendTo(context.$tabs);} |
102 | 102 | if(!context.$tabs.children().size()){addTab({'name':'wikitext','titleMsg':'wikieditor-wikitext-tab'});} |
103 | 103 | addTab(options);return $('<div></div>').addClass('wikiEditor-ui-view wikiEditor-ui-view-'+options.name).hide().appendTo(context.$ui);},'setup':function(){var contentHTML=$('<div />').text(context.$textarea.val()).html();context.$iframe[0].contentWindow.document.open();context.$iframe[0].contentWindow.document.write('<html><head><title>wikiEditor</title><script>var context = window.parent.jQuery.wikiEditor.instances['+context.instance+'].data( "wikiEditor-context" ); window.parent.jQuery( document ).bind( "keydown keypress keyup mousedown mouseup cut paste", function( event ) { context.fn.trigger( "change", event ) } );</script></head><body style="margin:0;padding:0;width:100%;height:100%;white-space:pre-wrap;font-family:monospace">'+contentHTML+'</body></html>');context.$iframe[0].contentWindow.document.close();context.$iframe[0].contentWindow.document.designMode='on';context.$content=$(context.$iframe[0].contentWindow.document.body);if($('body').is('.rtl')){context.$content.addClass('rtl').attr('dir','rtl');} |
104 | | -context.$textarea.attr('disabled',true);context.$textarea.hide();context.$iframe.show();},'isSetup':function(){return context.$content!=undefined&&context.$content[0].innerHTML!=undefined;},'getContents':function(){return $('<div />').html(context.$content.html().replace(/\<br\>/g,"\n")).text();},'setContents':function(options){context.$content.text(options.contents);return context.$textarea;},'textSelection':function(){var retval;if(context.$iframe[0].contentWindow.getSelection){retval=context.$iframe[0].contentWindow.getSelection();}else if(context.$iframe[0].contentWindow.document.selection){retval=context.$iframe[0].contentWindow.document.selection.createRange();} |
| 104 | +context.$textarea.attr('disabled',true);context.$textarea.hide();context.$iframe.show();},'isSetup':function(){return context.$content!=undefined&&context.$content[0].innerHTML!=undefined;},'getContents':function(){return $('<div />').html(context.$content.html().replace(/\<br\>/g,"\n")).text();},'setContents':function(options){context.$content.text(options.contents);return context.$textarea;},'getSelection':function(){var retval;if(context.$iframe[0].contentWindow.getSelection){retval=context.$iframe[0].contentWindow.getSelection();}else if(context.$iframe[0].contentWindow.document.selection){retval=context.$iframe[0].contentWindow.document.selection.createRange();} |
105 | 105 | if(retval.text){retval=retval.text;}else if(retval.toString){retval=retval.toString();} |
106 | 106 | return retval;},'encapsulateSelection':function(options){var selText=$(this).textSelection('getSelection');var selectAfter=false;var pre=options.pre,post=options.post;if(!selText){selText=options.peri;selectAfter=true;}else if(options.replace){selText=options.peri;}else if(selText.charAt(selText.length-1)==' '){selText=selText.substring(0,selText.length-1);post+=' ';} |
107 | 107 | var range=context.$iframe[0].contentWindow.getSelection().getRangeAt(0);if(options.ownline){if(range.startOffset!=0) |