Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -72,7 +72,7 @@ |
73 | 73 | array( 'src' => 'js/plugins/jquery.namespaceSelect.js', 'version' => 1 ), |
74 | 74 | array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 7 ), |
75 | 75 | array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 26 ), |
76 | | - array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 78 ), |
| 76 | + array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 79 ), |
77 | 77 | array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 25 ), |
78 | 78 | array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 45 ), |
79 | 79 | array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 11 ), |
— | — | @@ -82,10 +82,10 @@ |
83 | 83 | array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 2 ), |
84 | 84 | ), |
85 | 85 | 'combined' => array( |
86 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 191 ), |
| 86 | + array( 'src' => 'js/plugins.combined.js', 'version' => 192 ), |
87 | 87 | ), |
88 | 88 | 'minified' => array( |
89 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 191 ), |
| 89 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 192 ), |
90 | 90 | ), |
91 | 91 | ), |
92 | 92 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js |
— | — | @@ -369,8 +369,8 @@ |
370 | 370 | .replace( / /g, " " ) // We inserted these to prevent IE from collapsing spaces |
371 | 371 | .replace( /\<p[^\>]*\>/gi, "\n" ) // IE uses </p><p> for user-inserted line breaks |
372 | 372 | .replace( /\<\/p[^\>]*\>/gi, "" ) |
373 | | - .replace( /\<div[^\>]*\>/gi, "\n" ) // Webkit uses </div><div> for user-inserted line breaks |
374 | | - .replace( /\<\/div[^\>]*\>/gi, "" ) |
| 373 | + //.replace( /\<div[^\>]*\>/gi, "\n" ) // Webkit uses </div><div> for user-inserted line breaks |
| 374 | + //.replace( /\<\/div[^\>]*\>/gi, "" ) |
375 | 375 | + '</pre>' ); |
376 | 376 | // Get rid of the noincludes when getting text |
377 | 377 | $pre.find( '.wikiEditor-noinclude' ).each( function() { $( this ).remove(); } ); |
— | — | @@ -652,7 +652,7 @@ |
653 | 653 | // Start at the selection's start and traverse the DOM backwards |
654 | 654 | // This is done by traversing an element's children first, then the element itself, then its parent |
655 | 655 | e = selection.getRangeAt( 0 ).startContainer; |
656 | | - offset = selection.startOffset; |
| 656 | + offset = selection.getRangeAt( 0 ).startOffset; |
657 | 657 | } else { |
658 | 658 | return $( [] ); |
659 | 659 | } |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -6793,8 +6793,8 @@ |
6794 | 6794 | .replace( / /g, " " ) // We inserted these to prevent IE from collapsing spaces |
6795 | 6795 | .replace( /\<p[^\>]*\>/gi, "\n" ) // IE uses </p><p> for user-inserted line breaks |
6796 | 6796 | .replace( /\<\/p[^\>]*\>/gi, "" ) |
6797 | | - .replace( /\<div[^\>]*\>/gi, "\n" ) // Webkit uses </div><div> for user-inserted line breaks |
6798 | | - .replace( /\<\/div[^\>]*\>/gi, "" ) |
| 6797 | + //.replace( /\<div[^\>]*\>/gi, "\n" ) // Webkit uses </div><div> for user-inserted line breaks |
| 6798 | + //.replace( /\<\/div[^\>]*\>/gi, "" ) |
6799 | 6799 | + '</pre>' ); |
6800 | 6800 | // Get rid of the noincludes when getting text |
6801 | 6801 | $pre.find( '.wikiEditor-noinclude' ).each( function() { $( this ).remove(); } ); |
— | — | @@ -7076,7 +7076,7 @@ |
7077 | 7077 | // Start at the selection's start and traverse the DOM backwards |
7078 | 7078 | // This is done by traversing an element's children first, then the element itself, then its parent |
7079 | 7079 | e = selection.getRangeAt( 0 ).startContainer; |
7080 | | - offset = selection.startOffset; |
| 7080 | + offset = selection.getRangeAt( 0 ).startOffset; |
7081 | 7081 | } else { |
7082 | 7082 | return $( [] ); |
7083 | 7083 | } |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -449,7 +449,7 @@ |
450 | 450 | event.preventDefault();return false;}).text($.wikiEditor.autoMsg(options,'title'))).appendTo(context.$tabs);} |
451 | 451 | if(!context.$tabs.children().size()){addTab({'name':'wikitext','titleMsg':'wikieditor-wikitext-tab'});} |
452 | 452 | addTab(options);return $('<div></div>').addClass('wikiEditor-ui-view wikiEditor-ui-view-'+options.name).hide().appendTo(context.$ui);},'htmlToText':function(html){var $pre=$('<pre>'+ |
453 | | -html.replace(/\r?\n/g,"").replace(/\<br[^\>]*\>/gi,"\n").replace(/ /g," ").replace(/\<p[^\>]*\>/gi,"\n").replace(/\<\/p[^\>]*\>/gi,"").replace(/\<div[^\>]*\>/gi,"\n").replace(/\<\/div[^\>]*\>/gi,"") |
| 453 | +html.replace(/\r?\n/g,"").replace(/\<br[^\>]*\>/gi,"\n").replace(/ /g," ").replace(/\<p[^\>]*\>/gi,"\n").replace(/\<\/p[^\>]*\>/gi,"") |
454 | 454 | +'</pre>');$pre.find('.wikiEditor-noinclude').each(function(){$(this).remove();});$pre.find('.wikiEditor-tab').each(function(){$(this).text("\t")});return $pre.text();},'getContents':function(){return context.fn.htmlToText(context.$content.html());},'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();} |
455 | 455 | if(typeof retval.text!='undefined'){retval=context.fn.htmlToText(retval.htmlText);}else if(retval.toString){retval=retval.toString();} |
456 | 456 | return retval;},'encapsulateSelection':function(options){var selText=$(this).textSelection('getSelection');var selTextArr;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+=' ';} |
— | — | @@ -472,7 +472,7 @@ |
473 | 473 | return context.$textarea;},'scrollToCaretPosition':function(options){},'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;} |
474 | 474 | 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);} |
475 | 475 | $element.trigger('scrollToTop');},'beforeSelection':function(selector,strict){if(typeof selector=='undefined'){selector='*';} |
476 | | -var e,offset;if(context.$iframe[0].contentWindow.getSelection){var selection=context.$iframe[0].contentWindow.getSelection();if(selection.baseNode!==null){e=selection.getRangeAt(0).startContainer;offset=selection.startOffset;}else{return $([]);}}else if(context.$iframe[0].contentWindow.document.selection){var range=context.$iframe[0].contentWindow.document.selection.createRange();var range2=context.$iframe[0].contentWindow.document.body.createTextRange();try{range2.setEndPoint('EndToStart',range);}catch(e){return $([]);} |
| 476 | +var e,offset;if(context.$iframe[0].contentWindow.getSelection){var selection=context.$iframe[0].contentWindow.getSelection();if(selection.baseNode!==null){e=selection.getRangeAt(0).startContainer;offset=selection.getRangeAt(0).startOffset;}else{return $([]);}}else if(context.$iframe[0].contentWindow.document.selection){var range=context.$iframe[0].contentWindow.document.selection.createRange();var range2=context.$iframe[0].contentWindow.document.body.createTextRange();try{range2.setEndPoint('EndToStart',range);}catch(e){return $([]);} |
477 | 477 | var seekPos=context.fn.htmlToText(range2.htmlText).length;var offset=context.fn.getOffset(seekPos);e=offset?offset.node:null;offset=offset?offset.offset:null;if(!e){return $([]);}} |
478 | 478 | if(e.nodeName!='#text'){var newE=e.firstChild;for(var i=0;i<offset-1&&newE;i++){newE=newE.nextSibling;} |
479 | 479 | while(newE&&newE.lastChild){newE=newE.lastChild;} |