r61674 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61673‎ | r61674 | r61675 >
Date:19:05, 29 January 2010
Author:catrope
Status:deferred
Tags:
Comment:
UsabilityInitiative: Add a .prev() function to context.fn.traverser , need this for <p> handling in IE
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' => 26 ),
76 - array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 84 ),
 76+ array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 85 ),
7777 array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 26 ),
7878 array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 45 ),
7979 array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 11 ),
@@ -82,10 +82,10 @@
8383 array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 2 ),
8484 ),
8585 'combined' => array(
86 - array( 'src' => 'js/plugins.combined.js', 'version' => 197 ),
 86+ array( 'src' => 'js/plugins.combined.js', 'version' => 198 ),
8787 ),
8888 'minified' => array(
89 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 197 ),
 89+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 198 ),
9090 ),
9191 ),
9292 );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js
@@ -795,6 +795,42 @@
796796 } while ( p && p.firstChild );
797797 return p ? new context.fn.rawTraverser( p, nextDepth, nextInP ) : null;
798798 };
 799+ this.prev = function() {
 800+ var p = this.node;
 801+ var prevDepth = this.depth;
 802+ var prevInP = this.inP;
 803+ while ( p && !p.previousSibling ) {
 804+ p = p.parentNode;
 805+ prevDepth--;
 806+ if ( prevDepth == 0 ) {
 807+ // We're back at the start node
 808+ p = null;
 809+ }
 810+ if ( p && p.nodeName == "P" ) {
 811+ prevInP = null;
 812+ }
 813+ }
 814+ p = p ? p.previousSibling : null;
 815+ if ( p && p.nodeName == "P" ) {
 816+ prevInP = p;
 817+ }
 818+ do {
 819+ // Filter nodes with the wikiEditor-noinclude class
 820+ // Don't use $( p ).hasClass( 'wikiEditor-noinclude' ) because
 821+ // $() is slow in a tight loop
 822+ while ( p && ( ' ' + p.className + ' ' ).indexOf( ' wikiEditor-noinclude ' ) != -1 ) {
 823+ p = p.previousSibling;
 824+ }
 825+ if ( p && p.lastChild ) {
 826+ p = p.lastChild;
 827+ prevDepth++;
 828+ if ( p.nodeName == "P" ) {
 829+ prevInP = p;
 830+ }
 831+ }
 832+ } while ( p && p.lastChild );
 833+ return p ? new context.fn.rawTraverser( p, prevDepth, prevInP ) : null;
 834+ };
799835 },
800836 /**
801837 * Get an object used to traverse the leaf nodes in the iframe DOM. This traversal skips leaf nodes
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -7219,6 +7219,42 @@
72207220 } while ( p && p.firstChild );
72217221 return p ? new context.fn.rawTraverser( p, nextDepth, nextInP ) : null;
72227222 };
 7223+ this.prev = function() {
 7224+ var p = this.node;
 7225+ var prevDepth = this.depth;
 7226+ var prevInP = this.inP;
 7227+ while ( p && !p.previousSibling ) {
 7228+ p = p.parentNode;
 7229+ prevDepth--;
 7230+ if ( prevDepth == 0 ) {
 7231+ // We're back at the start node
 7232+ p = null;
 7233+ }
 7234+ if ( p && p.nodeName == "P" ) {
 7235+ prevInP = null;
 7236+ }
 7237+ }
 7238+ p = p ? p.previousSibling : null;
 7239+ if ( p && p.nodeName == "P" ) {
 7240+ prevInP = p;
 7241+ }
 7242+ do {
 7243+ // Filter nodes with the wikiEditor-noinclude class
 7244+ // Don't use $( p ).hasClass( 'wikiEditor-noinclude' ) because
 7245+ // $() is slow in a tight loop
 7246+ while ( p && ( ' ' + p.className + ' ' ).indexOf( ' wikiEditor-noinclude ' ) != -1 ) {
 7247+ p = p.previousSibling;
 7248+ }
 7249+ if ( p && p.lastChild ) {
 7250+ p = p.lastChild;
 7251+ prevDepth++;
 7252+ if ( p.nodeName == "P" ) {
 7253+ prevInP = p;
 7254+ }
 7255+ }
 7256+ } while ( p && p.lastChild );
 7257+ return p ? new context.fn.rawTraverser( p, prevDepth, prevInP ) : null;
 7258+ };
72237259 },
72247260 /**
72257261 * Get an object used to traverse the leaf nodes in the iframe DOM. This traversal skips leaf nodes
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -490,7 +490,11 @@
491491 if(p&&p.nodeName=="P"){nextInP=null;}}
492492 p=p?p.nextSibling:null;if(p&&p.nodeName=="P"){nextInP=p;}
493493 do{while(p&&(' '+p.className+' ').indexOf(' wikiEditor-noinclude ')!=-1){p=p.nextSibling;}
494 -if(p&&p.firstChild){p=p.firstChild;nextDepth++;if(p.nodeName=="P"){nextInP=p;}}}while(p&&p.firstChild);return p?new context.fn.rawTraverser(p,nextDepth,nextInP):null;};},'traverser':function(start){var node=start.jquery?start.get(0):start;var depth=0;var inP=node.nodeName=="P"?node:null;do{while(node&&(' '+node.className+' ').indexOf(' wikiEditor-noinclude ')!=-1){node=node.nextSibling;}
 494+if(p&&p.firstChild){p=p.firstChild;nextDepth++;if(p.nodeName=="P"){nextInP=p;}}}while(p&&p.firstChild);return p?new context.fn.rawTraverser(p,nextDepth,nextInP):null;};this.prev=function(){var p=this.node;var prevDepth=this.depth;var prevInP=this.inP;while(p&&!p.previousSibling){p=p.parentNode;prevDepth--;if(prevDepth==0){p=null;}
 495+if(p&&p.nodeName=="P"){prevInP=null;}}
 496+p=p?p.previousSibling:null;if(p&&p.nodeName=="P"){prevInP=p;}
 497+do{while(p&&(' '+p.className+' ').indexOf(' wikiEditor-noinclude ')!=-1){p=p.previousSibling;}
 498+if(p&&p.lastChild){p=p.lastChild;prevDepth++;if(p.nodeName=="P"){prevInP=p;}}}while(p&&p.lastChild);return p?new context.fn.rawTraverser(p,prevDepth,prevInP):null;};},'traverser':function(start){var node=start.jquery?start.get(0):start;var depth=0;var inP=node.nodeName=="P"?node:null;do{while(node&&(' '+node.className+' ').indexOf(' wikiEditor-noinclude ')!=-1){node=node.nextSibling;}
495499 if(node&&node.firstChild){node=node.firstChild;depth++;if(node.nodeName=="P"){inP=node;}}}while(node&&node.firstChild);return new context.fn.rawTraverser(node,depth,inP);},'getOffset':function(offset){if(!context.offsets){context.fn.refreshOffsets();}
496500 if(offset in context.offsets){return context.offsets[offset];}
497501 var lowerBound=-1;for(var o in context.offsets){if(o>offset){break;}

Status & tagging log