r60958 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60957‎ | r60958 | r60959 >
Date:01:05, 12 January 2010
Author:tparscal
Status:ok
Tags:
Comment:
Removed some debugging code, bumped and built.
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.inherit.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -80,7 +80,7 @@
8181 array( 'src' => 'js/plugins/jquery.collapsibleTabs.js', 'version' => 5 ),
8282 array( 'src' => 'js/plugins/jquery.cookie.js', 'version' => 3 ),
8383 array( 'src' => 'js/plugins/jquery.delayedBind.js', 'version' => 1 ),
84 - array( 'src' => 'js/plugins/jquery.inherit.js', 'version' => 2 ),
 84+ array( 'src' => 'js/plugins/jquery.inherit.js', 'version' => 3 ),
8585 array( 'src' => 'js/plugins/jquery.namespaceSelect.js', 'version' => 1 ),
8686 array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 7 ),
8787 array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 22 ),
@@ -88,16 +88,16 @@
8989 array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 12 ),
9090 array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 40 ),
9191 array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 10 ),
92 - array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 57 ),
 92+ array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 58 ),
9393 array( 'src' => 'js/plugins/jquery.wikiEditor.preview.js', 'version' => 9 ),
9494 array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 14 ),
9595 array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 1 ),
9696 ),
9797 'combined' => array(
98 - array( 'src' => 'js/plugins.combined.js', 'version' => 136 ),
 98+ array( 'src' => 'js/plugins.combined.js', 'version' => 137 ),
9999 ),
100100 'minified' => array(
101 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 136 ),
 101+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 137 ),
102102 ),
103103 ),
104104 );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.inherit.js
@@ -30,7 +30,6 @@
3131 return this;
3232 };
3333 // Create a namespace for hooking some functionality to the iFrame, like document.ready detection and handling
34 - console.log( 'adding hooks' );
3534 var hooks = child.jQueryInherit.hooks = {
3635 isReady: false,
3736 readyBound: false,
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -7753,7 +7753,7 @@
77547754 html: '\
77557755 <div class="wikiEditor-dialog-copywarn"></div>\
77567756 <div class="wikiEditor-dialog-editoptions">\
7757 - <form>\
 7757+ <form id="wikieditor-' + context.instance + '-publish-dialog-form">\
77587758 <label for="wikiEditor-' + context.instance + '-dialog-summary"\
77597759 rel="wikieditor-publish-dialog-summary"></label>\
77607760 <br />\
@@ -8711,35 +8711,37 @@
87128712 // This is based on Linker::generateTOC(), so it should behave like the
87138713 // TOC on rendered articles does - which is considdered to be correct
87148714 // at this point in time.
8715 - var outline = context.data.outline;
8716 - var lastLevel = 0;
8717 - var nLevel = 0;
8718 - for ( var i = 0; i < outline.length; i++ ) {
8719 - if ( outline[i].level > lastLevel ) {
8720 - nLevel++;
 8715+ if ( context.data.outline ) {
 8716+ var outline = context.data.outline;
 8717+ var lastLevel = 0;
 8718+ var nLevel = 0;
 8719+ for ( var i = 0; i < outline.length; i++ ) {
 8720+ if ( outline[i].level > lastLevel ) {
 8721+ nLevel++;
 8722+ }
 8723+ else if ( outline[i].level < lastLevel ) {
 8724+ nLevel -= Math.max( 1, lastLevel - outline[i].level );
 8725+ }
 8726+ if ( nLevel <= 0 ) {
 8727+ nLevel = 1;
 8728+ }
 8729+ outline[i].nLevel = nLevel;
 8730+ lastLevel = outline[i].level;
87218731 }
8722 - else if ( outline[i].level < lastLevel ) {
8723 - nLevel -= Math.max( 1, lastLevel - outline[i].level );
 8732+ // Recursively build the structure and add special item for
 8733+ // section 0, if needed
 8734+ var structure = buildStructure( outline );
 8735+ if ( $( 'input[name=wpSection]' ).val() == '' ) {
 8736+ structure.unshift( { 'text': wgPageName.replace(/_/g, ' '), 'level': 1, 'index': 0 } );
87248737 }
8725 - if ( nLevel <= 0 ) {
8726 - nLevel = 1;
 8738+ context.modules.toc.$toc.html( buildList( structure ) );
 8739+
 8740+ if ( wgNavigableTOCResizable && !context.$ui.data( 'resizableDone' ) ) {
 8741+ buildResizeControls();
 8742+ buildCollapseControls();
87278743 }
8728 - outline[i].nLevel = nLevel;
8729 - lastLevel = outline[i].level;
 8744+ context.modules.toc.$toc.find( 'div' ).autoEllipsis( { 'position': 'right', 'tooltip': true } );
87308745 }
8731 - // Recursively build the structure and add special item for
8732 - // section 0, if needed
8733 - var structure = buildStructure( outline );
8734 - if ( $( 'input[name=wpSection]' ).val() == '' ) {
8735 - structure.unshift( { 'text': wgPageName.replace(/_/g, ' '), 'level': 1, 'index': 0 } );
8736 - }
8737 - context.modules.toc.$toc.html( buildList( structure ) );
8738 -
8739 - if ( wgNavigableTOCResizable && !context.$ui.data( 'resizableDone' ) ) {
8740 - buildResizeControls();
8741 - buildCollapseControls();
8742 - }
8743 - context.modules.toc.$toc.find( 'div' ).autoEllipsis( { 'position': 'right', 'tooltip': true } );
87448746 }
87458747 }
87468748
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -504,7 +504,7 @@
505505 try{var diff=data.query.pages[data.query.pageids[0]].revisions[0].diff['*'];context.$changesTab.find('table.diff tbody').html(diff);context.$changesTab.find('.wikiEditor-preview-loading').hide();context.modules.preview.changesText=wikitext;}catch(e){}},'json');}catch(e){}},'json');}});var loadingMsg=gM('wikieditor-preview-loading');context.modules.preview.$preview.add(context.$changesTab).append($('<div />').addClass('wikiEditor-preview-loading').append($('<img />').addClass('wikiEditor-preview-spinner').attr({'src':$.wikiEditor.imgPath+'dialogs/loading.gif','valign':'absmiddle','alt':loadingMsg,'title':loadingMsg})).append($('<span></span>').text(loadingMsg))).append($('<div />').addClass('wikiEditor-preview-contents'));context.$changesTab.find('.wikiEditor-preview-contents').html('<table class="diff"><col class="diff-marker" /><col class="diff-content" />'+'<col class="diff-marker" /><col class="diff-content" /><tbody /></table>');}}};})(jQuery);(function($){$.wikiEditor.modules.publish={fn:{create:function(context,config){var dialogID='wikiEditor-'+context.instance+'-dialog';$.wikiEditor.modules.dialogs.fn.create(context,{previewsave:{id:dialogID,titleMsg:'wikieditor-publish-dialog-title',html:'\
506506 <div class="wikiEditor-dialog-copywarn"></div>\
507507 <div class="wikiEditor-dialog-editoptions">\
508 - <form>\
 508+ <form id="wikieditor-'+context.instance+'-publish-dialog-form">\
509509 <label for="wikiEditor-'+context.instance+'-dialog-summary"\
510510 rel="wikieditor-publish-dialog-summary"></label>\
511511 <br />\
@@ -572,13 +572,13 @@
573573 function buildResizeControls(){context.$ui.data('resizableDone',true).find('.wikiEditor-ui-right').data('wikiEditor-ui-left',context.$ui.find('.wikiEditor-ui-left')).resizable({handles:'w,e',preventPositionLeftChange:true,minWidth:50,start:function(e,ui){var $this=$(this);$('<div />').addClass('wikiEditor-ui-resize-mask').css({'position':'absolute','z-index':2,'left':0,'top':0,'bottom':0,'right':0}).appendTo(context.$ui.find('.wikiEditor-ui-left'));$this.resizable('option','maxWidth',$this.parent().width()-450);},resize:function(e,ui){$(this).css({'width':ui.size.width,'top':'auto','height':'auto'}).data('wikiEditor-ui-left').css('marginRight',(-1*ui.size.width)).children().css('marginRight',ui.size.width);context.fn.trigger('resize');},stop:function(e,ui){context.$ui.find('.wikiEditor-ui-resize-mask').remove();context.$content.trigger('mouseup');if(ui.size.width<parseFloat($.wikiEditor.modules.toc.cfg.minimumWidth)){context.modules.toc.$toc.trigger('collapse');}else{context.modules.toc.$toc.data('openWidth',ui.size.width);$.cookie('wikiEditor-'+context.instance+'-toc-width',ui.size.width);}
574574 context.fn.trigger('resize');}});var handle=$.wikiEditor.modules.toc.cfg.rtl?'w':'e';context.$ui.find('.ui-resizable-'+handle).removeClass('ui-resizable-'+handle).addClass('ui-resizable-'+(handle=='w'?'e':'w')).addClass('wikiEditor-ui-toc-resize-grip');context.modules.toc.$toc.bind('collapse.wikiEditor-toc',$.wikiEditor.modules.toc.fn.collapse).bind('expand.wikiEditor-toc',$.wikiEditor.modules.toc.fn.expand);context.modules.toc.$toc.data('openWidth',$.wikiEditor.modules.toc.cfg.defaultWidth);if($.cookie('wikiEditor-'+context.instance+'-toc-width')==0){context.modules.toc.$toc.trigger('collapse.wikiEditor-toc',{data:context});}else if($.cookie('wikiEditor-'+context.instance+'-toc-width')>0){var initialWidth=$.cookie('wikiEditor-'+context.instance+'-toc-width');if(initialWidth<parseFloat($.wikiEditor.modules.toc.cfg.minimumWidth))
575575 initialWidth=parseFloat($.wikiEditor.modules.toc.cfg.minimumWidth)+1;context.modules.toc.$toc.data('openWidth',initialWidth+'px');context.$ui.find('.wikiEditor-ui-right').css('width',initialWidth+'px');context.$ui.find('.wikiEditor-ui-left').css('marginRight',(parseFloat(initialWidth)*-1)+'px').children().css('marginRight',initialWidth+'px');}}
576 -var outline=context.data.outline;var lastLevel=0;var nLevel=0;for(var i=0;i<outline.length;i++){if(outline[i].level>lastLevel){nLevel++;}
 576+if(context.data.outline){var outline=context.data.outline;var lastLevel=0;var nLevel=0;for(var i=0;i<outline.length;i++){if(outline[i].level>lastLevel){nLevel++;}
577577 else if(outline[i].level<lastLevel){nLevel-=Math.max(1,lastLevel-outline[i].level);}
578578 if(nLevel<=0){nLevel=1;}
579579 outline[i].nLevel=nLevel;lastLevel=outline[i].level;}
580580 var structure=buildStructure(outline);if($('input[name=wpSection]').val()==''){structure.unshift({'text':wgPageName.replace(/_/g,' '),'level':1,'index':0});}
581581 context.modules.toc.$toc.html(buildList(structure));if(wgNavigableTOCResizable&&!context.$ui.data('resizableDone')){buildResizeControls();buildCollapseControls();}
582 -context.modules.toc.$toc.find('div').autoEllipsis({'position':'right','tooltip':true});}}};$.ui.plugin.add("resizable","preventPositionLeftChange",{resize:function(event,ui){$(this).data("resizable").position.left=0;}});})(jQuery);(function($){$.wikiEditor.modules.toolbar={api:{addToToolbar:function(context,data){for(type in data){switch(type){case'sections':var $sections=context.modules.toolbar.$toolbar.find('div.sections');var $tabs=context.modules.toolbar.$toolbar.find('div.tabs');for(section in data[type]){if(section=='main'){context.modules.toolbar.$toolbar.prepend($.wikiEditor.modules.toolbar.fn.buildSection(context,section,data[type][section]));continue;}
 582+context.modules.toc.$toc.find('div').autoEllipsis({'position':'right','tooltip':true});}}}};$.ui.plugin.add("resizable","preventPositionLeftChange",{resize:function(event,ui){$(this).data("resizable").position.left=0;}});})(jQuery);(function($){$.wikiEditor.modules.toolbar={api:{addToToolbar:function(context,data){for(type in data){switch(type){case'sections':var $sections=context.modules.toolbar.$toolbar.find('div.sections');var $tabs=context.modules.toolbar.$toolbar.find('div.tabs');for(section in data[type]){if(section=='main'){context.modules.toolbar.$toolbar.prepend($.wikiEditor.modules.toolbar.fn.buildSection(context,section,data[type][section]));continue;}
583583 $sections.append($.wikiEditor.modules.toolbar.fn.buildSection(context,section,data[type][section]));$tabs.append($.wikiEditor.modules.toolbar.fn.buildTab(context,section,data[type][section]));$section=$sections.find('.section:visible');if($section.size()){$sections.animate({'height':$section.outerHeight()},'fast');}}
584584 break;case'groups':if(!('section'in data)){continue;}
585585 var $section=context.modules.toolbar.$toolbar.find('div[rel='+data.section+'].section');for(group in data[type]){$section.append($.wikiEditor.modules.toolbar.fn.buildGroup(context,group,data[type][group]));}

Status & tagging log