r62893 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62892‎ | r62893 | r62894 >
Date:21:07, 23 February 2010
Author:tparscal
Status:ok
Tags:
Comment:
Fixed mistake in r62889 where I compared an array to 0 rather than the length of the array.
Modified paths:
  • /trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins.combined.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -72,7 +72,7 @@
7373 array( 'src' => 'js/plugins/jquery.namespaceSelect.js', 'version' => 1 ),
7474 array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 7 ),
7575 array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 27 ),
76 - array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 146 ),
 76+ array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 147 ),
7777 array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 34 ),
7878 array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 50 ),
7979 array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 18 ),
@@ -82,10 +82,10 @@
8383 array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 3 ),
8484 ),
8585 'combined' => array(
86 - array( 'src' => 'js/plugins.combined.js', 'version' => 278 ),
 86+ array( 'src' => 'js/plugins.combined.js', 'version' => 279 ),
8787 ),
8888 'minified' => array(
89 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 278 ),
 89+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 279 ),
9090 ),
9191 ),
9292 );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js
@@ -425,7 +425,7 @@
426426 // This is just downright strange - but if we do this on nodes with text nodes, it fixes allot of
427427 // space collapsing issues at element boundries
428428 $currentElement.find( '*' ).each( function() {
429 - if ( $(this).children() == 0 && this.childNodes.length > 0 ) {
 429+ if ( $(this).children().length == 0 && this.childNodes.length > 0 ) {
430430 $(this).text( $(this).text() );
431431 }
432432 } );
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -6858,7 +6858,7 @@
68596859 // This is just downright strange - but if we do this on nodes with text nodes, it fixes allot of
68606860 // space collapsing issues at element boundries
68616861 $currentElement.find( '*' ).each( function() {
6862 - if ( $(this).children() == 0 && this.childNodes.length > 0 ) {
 6862+ if ( $(this).children().length == 0 && this.childNodes.length > 0 ) {
68636863 $(this).text( $(this).text() );
68646864 }
68656865 } );
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -458,7 +458,7 @@
459459 return true;},'delayedChange':function(event){event.data.scope='division';var newHTML=context.$content.html();if(context.oldDelayedHTML!=newHTML){context.oldDelayedHTML=newHTML;event.data.scope='realchange';}
460460 context.fn.updateHistory(event.data.scope=='realchange');return true;},'paste':function(event){context.$content.find(':not(.wikiEditor)').addClass('wikiEditor');if($.layout.name!=='webkit'){context.$content.addClass('pasting');}
461461 setTimeout(function(){context.$content.find('link, style, meta').remove();context.$content.find('p:not(.wikiEditor) p:not(.wikiEditor)').each(function(){var outerParent=$(this).parent();outerParent.replaceWith(outerParent.childNodes());});context.$content.find('span.Apple-style-span').each(function(){$(this.childNodes).insertBefore(this);}).remove();var $selection=context.$content.find(':not(.wikiEditor)');while($selection.length&&$selection.length>0){var $currentElement=$selection.eq(0);while(!$currentElement.parent().is('body')&&!$currentElement.parent().is('.wikiEditor')){$currentElement=$currentElement.parent();}
462 -$currentElement.find('*').each(function(){if($(this).children()==0&&this.childNodes.length>0){$(this).text($(this).text());}});var text=$currentElement.text();if($currentElement.is('br')){$currentElement.addClass('wikiEditor');}else if($currentElement.is('span')&&text.length==0){$currentElement.remove();}else if($currentElement.is('p')||$currentElement.is('div')){$newElement=$('<p></p>').addClass('wikiEditor').insertAfter($currentElement);if(text.length){$newElement.text(text);}else{$newElement.append($('<br>').addClass('wikiEditor'));}
 462+$currentElement.find('*').each(function(){if($(this).children().length==0&&this.childNodes.length>0){$(this).text($(this).text());}});var text=$currentElement.text();if($currentElement.is('br')){$currentElement.addClass('wikiEditor');}else if($currentElement.is('span')&&text.length==0){$currentElement.remove();}else if($currentElement.is('p')||$currentElement.is('div')){$newElement=$('<p></p>').addClass('wikiEditor').insertAfter($currentElement);if(text.length){$newElement.text(text);}else{$newElement.append($('<br>').addClass('wikiEditor'));}
463463 $currentElement.remove();}else{$('<span></span>').addClass('wikiEditor').text($currentElement.text()).insertAfter($currentElement);$currentElement.remove();}
464464 $selection=context.$content.find(':not(.wikiEditor)');}
465465 context.$content.find('.wikiEditor').removeClass('wikiEditor');var t=context.fn.traverser(context.$content);while(t){if(t.node.nodeName=='#text'){if(t.node.nodeValue==='\n'){$('<p><br></p>').insertAfter($(t.node));var oldNode=t.node;t=t.next();$(oldNode).remove();continue;}

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r62889Fixes some of the strange newline issues on pasting.tparscal19:59, 23 February 2010

Status & tagging log