r61605 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61604‎ | r61605 | r61606 >
Date:20:54, 27 January 2010
Author:catrope
Status:ok
Tags:
Comment:
wmf-deployment: UsabilityInitiative_alpha: Merge to trunk state
Modified paths:
  • /branches/wmf-deployment/extensions/UsabilityInitiative_alpha (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative_alpha/UsabilityInitiative.hooks.php (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative_alpha/WikiEditor/Modules/Toolbar/Toolbar.i18n.php (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative_alpha/js/plugins.combined.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative_alpha/js/plugins.combined.min.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative_alpha/js/plugins/jquery.cookie.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative_alpha/js/plugins/jquery.textSelection.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative_alpha/js/plugins/jquery.wikiEditor.js (modified) (history)

Diff [purge]

Index: branches/wmf-deployment/extensions/UsabilityInitiative_alpha/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' => 76 ),
 76+ array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 77 ),
7777 array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 25 ),
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' => 188 ),
 86+ array( 'src' => 'js/plugins.combined.js', 'version' => 189 ),
8787 ),
8888 'minified' => array(
89 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 188 ),
 89+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 189 ),
9090 ),
9191 ),
9292 );
Index: branches/wmf-deployment/extensions/UsabilityInitiative_alpha/WikiEditor/Modules/Toolbar/Toolbar.i18n.php
@@ -4154,6 +4154,7 @@
41554155
41564156 /** Basque (Euskara)
41574157 * @author An13sa
 4158+ * @author Inorbez
41584159 * @author Kobazulo
41594160 * @author Theklan
41604161 */
@@ -4192,7 +4193,7 @@
41934194 'wikieditor-toolbar-tool-file-example' => 'Adibidea.jpg',
41944195 'wikieditor-toolbar-tool-reference' => 'Erreferentzia',
41954196 'wikieditor-toolbar-tool-reference-example' => 'Txertatu testu oina hemen',
4196 - 'wikieditor-toolbar-tool-signature' => 'SInadura data eta orduarekin',
 4197+ 'wikieditor-toolbar-tool-signature' => 'Sinadura data eta orduarekin',
41974198 'wikieditor-toolbar-section-advanced' => 'Aurreratua',
41984199 'wikieditor-toolbar-tool-heading' => 'Izenburua',
41994200 'wikieditor-toolbar-tool-heading-1' => '1. Maila',
@@ -7993,9 +7994,10 @@
79947995
79957996 /** Cornish (Kernowek)
79967997 * @author Kernoweger
 7998+ * @author Kw-Moon
79977999 */
79988000 $messages['kw'] = array(
7999 - 'wikieditor-toolbar-tool-link-cancel' => 'Hedhy',
 8001+ 'wikieditor-toolbar-tool-link-cancel' => 'Hedhi',
80008002 'wikieditor-toolbar-help-page-discussion' => 'Dadhelva',
80018003 );
80028004
Property changes on: branches/wmf-deployment/extensions/UsabilityInitiative_alpha/js/plugins/jquery.textSelection.js
___________________________________________________________________
Name: svn:mergeinfo
80038005 -
80048006 + /trunk/extensions/UsabilityInitiative/js/plugins/jquery.textSelection.js:61584-61604
Property changes on: branches/wmf-deployment/extensions/UsabilityInitiative_alpha/js/plugins/jquery.cookie.js
___________________________________________________________________
Name: svn:mergeinfo
80058007 -
80068008 + /trunk/extensions/UsabilityInitiative/js/plugins/jquery.cookie.js:61584-61604
Index: branches/wmf-deployment/extensions/UsabilityInitiative_alpha/js/plugins/jquery.wikiEditor.js
@@ -369,6 +369,8 @@
370370 .replace( / /g, " " ) // We inserted these to prevent IE from collapsing spaces
371371 .replace( /\<p[^\>]*\>/gi, "\n" ) // IE uses </p><p> for user-inserted line breaks
372372 .replace( /\<\/p[^\>]*\>/gi, "" )
 373+ .replace( /\<div[^\>]*\>/gi, "\n" ) // Webkit uses </div><div> for user-inserted line breaks
 374+ .replace( /\<\/div[^\>]*\>/gi, "" )
373375 + '</pre>' );
374376 // Get rid of the noincludes when getting text
375377 $pre.find( '.wikiEditor-noinclude' ).each( function() { $( this ).remove(); } );
@@ -920,7 +922,8 @@
921923 context.$content = $( context.$iframe[0].contentWindow.document.body );
922924 // If we just do "context.$content.text( context.$textarea.val() )", Internet Explorer will strip out the
923925 // whitespace charcters, specifically "\n" - so we must manually encode the text and append it
924 - var html = context.$textarea.val().replace( /\</g, '&lt;' ).replace( /\>/g, '&gt;' );
 926+ // TODO: Refactor this into a textToHtml() function
 927+ var html = context.$textarea.val();
925928 // We must do some extra processing on IE to avoid dirty diffs, specifically IE will collapse leading spaces
926929 if ( $.browser.msie ) {
927930 // Browser sniffing is not ideal, but executing this code on a non-broken browser doesn't cause harm
@@ -934,7 +937,14 @@
935938 }
936939 html = html.replace( /\t/g, '<span class="wikiEditor-tab"></span>' );
937940 }
938 - context.$content.html( html.replace( /\r?\n/g, '<br />' ) );
 941+ // Use a dummy div to escape all entities
 942+ // This'll also escape <br>, <span> and &nbsp; , so we unescape those after
 943+ html = $( '<div />' ).text( html.replace( /\r?\n/g, '<br>' ) ).html()
 944+ .replace( /&amp;nbsp;/g, '&nbsp;' )
 945+ .replace( /&lt;br&gt;/g, '<br>' )
 946+ .replace( /&lt;span class=&quot;wikiEditor-tab&quot;&gt;&lt;\/span&gt;/g, '<span class="wikiEditor-tab"></span>' );
 947+ context.$content.html( html );
 948+
939949 // Reflect direction of parent frame into child
940950 if ( $( 'body' ).is( '.rtl' ) ) {
941951 context.$content.addClass( 'rtl' ).attr( 'dir', 'rtl' );
Index: branches/wmf-deployment/extensions/UsabilityInitiative_alpha/js/plugins.combined.js
@@ -6793,6 +6793,8 @@
67946794 .replace( /&nbsp;/g, " " ) // We inserted these to prevent IE from collapsing spaces
67956795 .replace( /\<p[^\>]*\>/gi, "\n" ) // IE uses </p><p> for user-inserted line breaks
67966796 .replace( /\<\/p[^\>]*\>/gi, "" )
 6797+ .replace( /\<div[^\>]*\>/gi, "\n" ) // Webkit uses </p><p> for user-inserted line breaks
 6798+ .replace( /\<\/div[^\>]*\>/gi, "" )
67976799 + '</pre>' );
67986800 // Get rid of the noincludes when getting text
67996801 $pre.find( '.wikiEditor-noinclude' ).each( function() { $( this ).remove(); } );
@@ -7344,7 +7346,8 @@
73457347 context.$content = $( context.$iframe[0].contentWindow.document.body );
73467348 // If we just do "context.$content.text( context.$textarea.val() )", Internet Explorer will strip out the
73477349 // whitespace charcters, specifically "\n" - so we must manually encode the text and append it
7348 - var html = context.$textarea.val().replace( /\</g, '&lt;' ).replace( /\>/g, '&gt;' );
 7350+ // TODO: Refactor this into a textToHtml() function
 7351+ var html = context.$textarea.val();
73497352 // We must do some extra processing on IE to avoid dirty diffs, specifically IE will collapse leading spaces
73507353 if ( $.browser.msie ) {
73517354 // Browser sniffing is not ideal, but executing this code on a non-broken browser doesn't cause harm
@@ -7358,7 +7361,14 @@
73597362 }
73607363 html = html.replace( /\t/g, '<span class="wikiEditor-tab"></span>' );
73617364 }
7362 - context.$content.html( html.replace( /\r?\n/g, '<br />' ) );
 7365+ // Use a dummy div to escape all entities
 7366+ // This'll also escape <br>, <span> and &nbsp; , so we unescape those after
 7367+ html = $( '<div />' ).text( html.replace( /\r?\n/g, '<br>' ) ).html()
 7368+ .replace( /&amp;nbsp;/g, '&nbsp;' )
 7369+ .replace( /&lt;br&gt;/g, '<br>' )
 7370+ .replace( /&lt;span class=&quot;wikiEditor-tab&quot;&gt;&lt;\/span&gt;/g, '<span class="wikiEditor-tab"></span>' );
 7371+ context.$content.html( html );
 7372+
73637373 // Reflect direction of parent frame into child
73647374 if ( $( 'body' ).is( '.rtl' ) ) {
73657375 context.$content.addClass( 'rtl' ).attr( 'dir', 'rtl' );
Index: branches/wmf-deployment/extensions/UsabilityInitiative_alpha/js/plugins.combined.min.js
@@ -449,7 +449,7 @@
450450 event.preventDefault();return false;}).text($.wikiEditor.autoMsg(options,'title'))).appendTo(context.$tabs);}
451451 if(!context.$tabs.children().size()){addTab({'name':'wikitext','titleMsg':'wikieditor-wikitext-tab'});}
452452 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(/&nbsp;/g," ").replace(/\<p[^\>]*\>/gi,"\n").replace(/\<\/p[^\>]*\>/gi,"")
 453+html.replace(/\r?\n/g,"").replace(/\<br[^\>]*\>/gi,"\n").replace(/&nbsp;/g," ").replace(/\<p[^\>]*\>/gi,"\n").replace(/\<\/p[^\>]*\>/gi,"").replace(/\<div[^\>]*\>/gi,"\n").replace(/\<\/div[^\>]*\>/gi,"")
454454 +'</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();}
455455 if(typeof retval.text!='undefined'){retval=context.fn.htmlToText(retval.htmlText);}else if(retval.toString){retval=retval.toString();}
456456 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+=' ';}
@@ -494,9 +494,9 @@
495495 var nextPos=t.node.nodeName=='#text'?pos+t.node.nodeValue.length:pos+1;var nextT=t.next();var leavingP=t.inP&&nextT&&!nextT.inP;context.offsets[pos]={'node':t.node,'offset':0,'length':nextPos-pos+(leavingP?1:0),'depth':t.depth,'lastTextNode':lastTextNode,'lastTextNodeDepth':lastTextNodeDepth};if(leavingP){context.offsets[nextPos]={'node':t.node,'offset':nextPos-pos,'length':nextPos-pos+1,'depth':t.depth,'lastTextNode':lastTextNode,'lastTextNodeDepth':lastTextNodeDepth};}
496496 pos=nextPos+(leavingP?1:0);if(t.node.nodeName=='#text'){lastTextNode=t.node;lastTextNodeDepth=t.depth;}
497497 t=nextT;}}};context.$textarea.wrap($('<div></div>').addClass('wikiEditor-ui')).wrap($('<div></div>').addClass('wikiEditor-ui-view wikiEditor-ui-view-wikitext')).wrap($('<div></div>').addClass('wikiEditor-ui-left')).wrap($('<div></div>').addClass('wikiEditor-ui-bottom')).wrap($('<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)});context.$iframe=$('<iframe></iframe>').attr({'frameBorder':0,'border':0,'src':wgScriptPath+'/extensions/UsabilityInitiative_alpha/js/plugins/jquery.wikiEditor.html?'+'instance='+context.instance+'&ts='+(new Date()).getTime(),'id':'wikiEditor-iframe-'+context.instance}).css({'backgroundColor':'white','width':'100%','height':context.$textarea.height(),'display':'none','overflow-y':'scroll','overflow-x':'hidden'}).insertAfter(context.$textarea).load(function(){if(!this.isSecondRun){context.$iframe[0].contentWindow.document.designMode='on';if($.browser.msie){this.isSecondRun=true;return;}}
498 -context.$content=$(context.$iframe[0].contentWindow.document.body);var html=context.$textarea.val().replace(/\</g,'&lt;').replace(/\>/g,'&gt;');if($.browser.msie){if($.browser.versionNumber<=7){html=html.replace(/ /g,"&nbsp;");}else{html=html.replace(/(^|\n) /g,"$1&nbsp;");}
 498+context.$content=$(context.$iframe[0].contentWindow.document.body);var html=context.$textarea.val();if($.browser.msie){if($.browser.versionNumber<=7){html=html.replace(/ /g,"&nbsp;");}else{html=html.replace(/(^|\n) /g,"$1&nbsp;");}
499499 html=html.replace(/\t/g,'<span class="wikiEditor-tab"></span>');}
500 -context.$content.html(html.replace(/\r?\n/g,'<br />'));if($('body').is('.rtl')){context.$content.addClass('rtl').attr('dir','rtl');}
 500+html=$('<div />').text(html.replace(/\r?\n/g,'<br>')).html().replace(/&amp;nbsp;/g,'&nbsp;').replace(/&lt;br&gt;/g,'<br>').replace(/&lt;span class=&quot;wikiEditor-tab&quot;&gt;&lt;\/span&gt;/g,'<span class="wikiEditor-tab"></span>');context.$content.html(html);if($('body').is('.rtl')){context.$content.addClass('rtl').attr('dir','rtl');}
501501 context.$textarea.attr('disabled',true);context.$textarea.hide();context.$iframe.show();context.fn.trigger('ready');$(context.$iframe[0].contentWindow.document).bind('keyup mouseup paste cut encapsulateSelection',function(event){context.fn.trigger('change',event);}).delayedBind(250,'keyup mouseup paste cut encapsulateSelection',function(event){context.fn.trigger('delayedChange',event);});});context.$textarea.closest('form').submit(function(){context.$textarea.attr('disabled',false);context.$textarea.val(context.$textarea.textSelection('getContents'));});context.fallbackWindowOnBeforeUnload=window.onbeforeunload;window.onbeforeunload=function(){context.$textarea.val(context.$textarea.textSelection('getContents'));return context.fallbackWindowOnBeforeUnload?context.fallbackWindowOnBeforeUnload():null;}}
502502 arguments=$.makeArray(arguments);if(arguments.length>0){var call=arguments.shift();if(call in context.api){context.api[call](context,typeof arguments[0]=='undefined'?{}:arguments[0]);}}
503503 return $(this).data('wikiEditor-context',context);};})(jQuery);RegExp.escape=function(s){return s.replace(/([.*+?^${}()|\/\\[\]])/g,'\\$1');};(function($){$.wikiEditor.modules.dialogs={api:{addDialog:function(context,data){$.wikiEditor.modules.dialogs.fn.create(context,data)},openDialog:function(context,module){if(module in $.wikiEditor.modules.dialogs.modules){$('#'+$.wikiEditor.modules.dialogs.modules[module].id).dialog('open');}},closeDialog:function(context,data){if(module in $.wikiEditor.modules.dialogs.modules){$('#'+$.wikiEditor.modules.dialogs.modules[module].id).dialog('close');}}},fn:{create:function(context,config){for(module in config){$.wikiEditor.modules.dialogs.modules[module]=config[module];}
Property changes on: branches/wmf-deployment/extensions/UsabilityInitiative_alpha
___________________________________________________________________
Name: svn:mergeinfo
504504 + /branches/REL1_15/phase3/extensions/UsabilityInitiative_alpha:51646
/trunk/extensions/UsabilityInitiative:61584-61604
/trunk/extensions/UsabilityInitiative_alpha:56207,56209,56296,56333,56355
/trunk/phase3/extensions/UsabilityInitiative_alpha:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,57154-57447,57541,57916,58151,58219,58633,58816

Status & tagging log