r59238 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59237‎ | r59238 | r59239 >
Date:10:17, 19 November 2009
Author:catrope
Status:deferred
Tags:
Comment:
Fix r59228: somehow it did increment the right style versions and recombine other things, but didn't recombine the plugins files. Also incrementing a style version for r59221
Modified paths:
  • /trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.hooks.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins.combined.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.hooks.php
@@ -15,13 +15,13 @@
1616 array( 'src' => 'Modules/Highlight/Highlight.js', 'version' => 1 ),
1717 array( 'src' => 'Modules/Preview/Preview.js', 'version' => 1 ),
1818 array( 'src' => 'Modules/Toc/Toc.js', 'version' => 1 ),
19 - array( 'src' => 'Modules/Toolbar/Toolbar.js', 'version' => 5 ),
 19+ array( 'src' => 'Modules/Toolbar/Toolbar.js', 'version' => 6 ),
2020 ),
2121 'combined' => array(
22 - array( 'src' => 'WikiEditor.combined.js', 'version' => 3 ),
 22+ array( 'src' => 'WikiEditor.combined.js', 'version' => 4 ),
2323 ),
2424 'minified' => array(
25 - array( 'src' => 'WikiEditor.combined.min.js', 'version' => 3 ),
 25+ array( 'src' => 'WikiEditor.combined.min.js', 'version' => 4 ),
2626 ),
2727 );
2828 static $modules = array(
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -2642,10 +2642,14 @@
26432643 */
26442644 collapse: function( event ) {
26452645 var $this = $( this ), context = $this.data('context');
 2646+ var pT = $this.parent().position().top - 1;
26462647 $this.parent()
2647 - .animate( { 'width' : '1px' }, 'fast', function() {
2648 - $(this).hide();
2649 - context.$ui.find( '.wikiEditor-ui-toc-expandControl' ).show( 'fast' );
 2648+ .css( 'position', 'absolute' )
 2649+ .css( {'left': 'auto', 'right': 0, 'top': pT})
 2650+ .fadeOut( 'fast', function() {
 2651+ $(this).hide()
 2652+ .css( 'width', '1px' );
 2653+ context.$ui.find( '.wikiEditor-ui-toc-expandControl' ).fadeIn( 'fast' );
26502654 } )
26512655 .prev()
26522656 .animate( { 'marginRight': '-1px'}, 'fast', function() { $(this).css( 'marginRight', 0 ); } )
@@ -2665,10 +2669,13 @@
26662670 */
26672671 expand: function( event) {
26682672 var $this = $( this ), context = $this.data('context');
2669 - context.$ui.find( '.wikiEditor-ui-toc-expandControl' ).hide( 'fast' );
 2673+ context.$ui.find( '.wikiEditor-ui-toc-expandControl' ).hide();
26702674 $this.parent()
26712675 .show()
2672 - .animate( { 'width' : '13em' }, 'fast' )
 2676+ .animate( { 'width' : '13em' }, 'fast', function() {
 2677+ $(this)
 2678+ .css( { 'position': 'relative', 'right': 'auto', 'top': 'auto' });
 2679+ } )
26732680 .prev()
26742681 .animate( { 'marginRight': '-13em'}, 'fast' )
26752682 .children()
@@ -2857,13 +2864,16 @@
28582865 if(wgNavigableTOCResizable) {
28592866 context.$ui.find( '.wikiEditor-ui-right' )
28602867 .data( 'wikiEditor-ui-left', context.$ui.find( '.wikiEditor-ui-left' ))
2861 - .resizable( {handles: 'w,e', minWidth: 50,
 2868+ .resizable( {handles: 'w,e', dontScrewWithLeft: true, minWidth: 50,
28622869 start: function( e, ui ) {
 2870+ $this = $( this );
 2871+ // Toss a transparent cover over our iframe
28632872 $( '<div />' ).addClass( 'wikiEditor-ui-resize-mask' )
28642873 .css( 'position', 'absolute' )
28652874 .css( 'z-index', 2 )
28662875 .css( 'left', 0 ).css( 'top', 0 ).css( 'bottom', 0 ).css( 'right', 0 )
28672876 .appendTo(context.$ui.find( '.wikiEditor-ui-left' ));
 2877+ $this.resizable( 'option', 'maxWidth', $this.parent().width() - 450 );
28682878 },
28692879 resize: function( e, ui ) {
28702880 /*
@@ -2873,14 +2883,14 @@
28742884
28752885 // for some odd reason, ui.size.width seems a step ahead of what the *actual* width of
28762886 // the resizable is
2877 - $( this ).css( 'width' , ui.size.width )
 2887+ $( this ).css( { 'width': ui.size.width, 'top': 'auto' } )
28782888 .data( 'wikiEditor-ui-left' ).css( 'marginRight', ( -1 * ui.size.width ) )
28792889 .children( ).css( 'marginRight', ui.size.width );
28802890 },
28812891 stop: function ( e, ui ) {
28822892 context.$ui.find( '.wikiEditor-ui-resize-mask' ).remove();
28832893 if( ui.size.width < 70 ){
2884 - // collapse
 2894+ context.modules.$toc.trigger( 'collapse' );
28852895 }
28862896 }
28872897 });
@@ -2894,7 +2904,18 @@
28952905 }
28962906 }
28972907
2898 -}; } ) ( jQuery );
 2908+};
 2909+
 2910+/*
 2911+ * Extending resizable to allow west resizing without altering the left position attribute
 2912+ */
 2913+$.ui.plugin.add("resizable", "dontScrewWithLeft", {
 2914+ resize: function(event, ui){
 2915+ $(this).data("resizable").position.left=0;
 2916+ }
 2917+});
 2918+
 2919+} ) ( jQuery );
28992920 /* Preview module for wikiEditor */
29002921 ( function( $ ) { $.wikiEditor.modules.preview = {
29012922
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -159,7 +159,7 @@
160160 section=Math.max(0,section);}
161161 var sectionLink=context.modules.$toc.find('div.section-'+section);sectionLink.addClass('current');var relTop=sectionLink.offset().top-context.modules.$toc.offset().top;var scrollTop=context.modules.$toc.scrollTop();var divHeight=context.modules.$toc.height();var sectionHeight=sectionLink.height();if(relTop<0)
162162 context.modules.$toc.scrollTop(scrollTop+relTop);else if(relTop+sectionHeight>divHeight)
163 -context.modules.$toc.scrollTop(scrollTop+relTop+sectionHeight-divHeight);}},collapse:function(event){var $this=$(this),context=$this.data('context');$this.parent().animate({'width':'1px'},'fast',function(){$(this).hide();context.$ui.find('.wikiEditor-ui-toc-expandControl').show('fast');}).prev().animate({'marginRight':'-1px'},'fast',function(){$(this).css('marginRight',0);}).children().animate({'marginRight':'1px'},'fast',function(){$(this).css('marginRight',0);});return false;},expand:function(event){var $this=$(this),context=$this.data('context');context.$ui.find('.wikiEditor-ui-toc-expandControl').hide('fast');$this.parent().show().animate({'width':'13em'},'fast').prev().animate({'marginRight':'-13em'},'fast').children().animate({'marginRight':'13em'},'fast');return false;},build:function(context){function buildStructure(outline,offset,level){if(offset==undefined)offset=0;if(level==undefined)level=1;var sections=[];for(var i=offset;i<outline.length;i++){if(outline[i].nLevel==level){var sub=buildStructure(outline,i+1,level+1);if(sub.length){outline[i].sections=sub;}
 163+context.modules.$toc.scrollTop(scrollTop+relTop+sectionHeight-divHeight);}},collapse:function(event){var $this=$(this),context=$this.data('context');var pT=$this.parent().position().top-1;$this.parent().css('position','absolute').css({'left':'auto','right':0,'top':pT}).fadeOut('fast',function(){$(this).hide().css('width','1px');context.$ui.find('.wikiEditor-ui-toc-expandControl').fadeIn('fast');}).prev().animate({'marginRight':'-1px'},'fast',function(){$(this).css('marginRight',0);}).children().animate({'marginRight':'1px'},'fast',function(){$(this).css('marginRight',0);});return false;},expand:function(event){var $this=$(this),context=$this.data('context');context.$ui.find('.wikiEditor-ui-toc-expandControl').hide();$this.parent().show().animate({'width':'13em'},'fast',function(){$(this).css({'position':'relative','right':'auto','top':'auto'});}).prev().animate({'marginRight':'-13em'},'fast').children().animate({'marginRight':'13em'},'fast');return false;},build:function(context){function buildStructure(outline,offset,level){if(offset==undefined)offset=0;if(level==undefined)level=1;var sections=[];for(var i=offset;i<outline.length;i++){if(outline[i].nLevel==level){var sub=buildStructure(outline,i+1,level+1);if(sub.length){outline[i].sections=sub;}
164164 sections[sections.length]=outline[i];}else if(outline[i].nLevel<level){break;}}
165165 return sections;}
166166 function buildList(structure){var list=$('<ul />');for(i in structure){var div=$('<div />').addClass('section-'+structure[i].index).data('wrapper',structure[i].wrapper).mousedown(function(event){context.fn.scrollToTop($(this).data('wrapper'));if(typeof $.trackAction!='undefined')
@@ -181,8 +181,8 @@
182182 if(nLevel<=0){nLevel=1;}
183183 outline[i].nLevel=nLevel;lastLevel=outline[i].level;}
184184 var structure=buildStructure(outline);if($('input[name=wpSection]').val()==''){var div=$j('<div />').addClass('wikiEditor-toc-start').hide().prependTo(context.$content);structure.unshift({'text':wgPageName.replace(/_/g,' '),'level':1,'index':0,'wrapper':div});}
185 -context.modules.$toc.html(buildList(structure));if(wgNavigableTOCResizable){context.$ui.find('.wikiEditor-ui-right').data('wikiEditor-ui-left',context.$ui.find('.wikiEditor-ui-left')).resizable({handles:'w,e',minWidth:50,start:function(e,ui){$('<div />').addClass('wikiEditor-ui-resize-mask').css('position','absolute').css('z-index',2).css('left',0).css('top',0).css('bottom',0).css('right',0).appendTo(context.$ui.find('.wikiEditor-ui-left'));},resize:function(e,ui){$(this).css('width',ui.size.width).data('wikiEditor-ui-left').css('marginRight',(-1*ui.size.width)).children().css('marginRight',ui.size.width);},stop:function(e,ui){context.$ui.find('.wikiEditor-ui-resize-mask').remove();if(ui.size.width<70){}}});context.modules.$toc.append(buildResizeControls());buildCollapseControls();}
186 -context.modules.$toc.find('div').autoEllipse({'position':'right','tooltip':true});context.data.outline=outline;}}};})(jQuery);(function($){$.wikiEditor.modules.preview={api:{},fn:{create:function(context,config){mvJsLoader.doLoad(['$j.ui','$j.ui.tabs'],function(){if('preview'in context.modules)
 185+context.modules.$toc.html(buildList(structure));if(wgNavigableTOCResizable){context.$ui.find('.wikiEditor-ui-right').data('wikiEditor-ui-left',context.$ui.find('.wikiEditor-ui-left')).resizable({handles:'w,e',dontScrewWithLeft:true,minWidth:50,start:function(e,ui){$this=$(this);$('<div />').addClass('wikiEditor-ui-resize-mask').css('position','absolute').css('z-index',2).css('left',0).css('top',0).css('bottom',0).css('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'}).data('wikiEditor-ui-left').css('marginRight',(-1*ui.size.width)).children().css('marginRight',ui.size.width);},stop:function(e,ui){context.$ui.find('.wikiEditor-ui-resize-mask').remove();if(ui.size.width<70){context.modules.$toc.trigger('collapse');}}});context.modules.$toc.append(buildResizeControls());buildCollapseControls();}
 186+context.modules.$toc.find('div').autoEllipse({'position':'right','tooltip':true});context.data.outline=outline;}}};$.ui.plugin.add("resizable","dontScrewWithLeft",{resize:function(event,ui){$(this).data("resizable").position.left=0;}});})(jQuery);(function($){$.wikiEditor.modules.preview={api:{},fn:{create:function(context,config){mvJsLoader.doLoad(['$j.ui','$j.ui.tabs'],function(){if('preview'in context.modules)
187187 return;var iframeHTML=context.$content.html();context.$ui.wrapInner($('<div />').addClass('wikiEditor-tab-edit').attr('id','wikiEditor-'+context.instance+'-tab-edit')).wrapInner($('<div />').addClass('wikiEditor-tabs'));var tabList=context.$ui.children();var editTab=tabList.children();var loadingMsg=gM('wikieditor-preview-loading');var previewTab=$('<div />').addClass('wikiEditor-tab-preview').attr('id','wikiEditor-'+context.instance+'-tab-preview').append($('<div />').addClass('wikiEditor-preview-spinner').append($('<img />').attr({'src':$.wikiEditor.imgPath+'dialogs/loading.gif','alt':loadingMsg,'title':loadingMsg}))).append($('<div />').addClass('wikiEditor-preview-contents')).insertAfter(editTab);var dialogID='wikiEditor-'+context.instance+'-savedialog';$.wikiEditor.modules.dialogs.fn.create(context,{previewsave:{id:dialogID,titleMsg:'wikieditor-preview-savedialog-title',html:'\
188188 <div class="wikiEditor-savedialog-copywarn"></div>\
189189 <div class="wikiEditor-savedialog-editoptions">\

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r59221Add missing messages for the existing idention icon...raymond21:52, 18 November 2009
r59228improvements to ntoc resizing and collapsingadam23:45, 18 November 2009

Status & tagging log