r60042 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60041‎ | r60042 | r60043 >
Date:20:04, 14 December 2009
Author:tparscal
Status:ok
Tags:
Comment:
Combined, minified and version bumped for r60041.
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)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -73,7 +73,7 @@
7474 array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 21 ),
7575 array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 34 ),
7676 array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 1 ),
77 - array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 38 ),
 77+ array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 39 ),
7878 array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 9 ),
7979 array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 50 ),
8080 array( 'src' => 'js/plugins/jquery.wikiEditor.preview.js', 'version' => 7 ),
@@ -81,10 +81,10 @@
8282 array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 0 ),
8383 ),
8484 'combined' => array(
85 - array( 'src' => 'js/plugins.combined.js', 'version' => 107 ),
 85+ array( 'src' => 'js/plugins.combined.js', 'version' => 108 ),
8686 ),
8787 'minified' => array(
88 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 107 ),
 88+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 108 ),
8989 ),
9090 ),
9191 );
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -3811,23 +3811,19 @@
38123812 if ( show ) {
38133813 $section.fadeIn( 'fast' );
38143814 dH = $section.outerHeight() - dH;
3815 - if ( 'toc' in context.modules ) {
3816 - context.modules.toc.$toc.animate({'height': "+="+dH}, $section.outerHeight() * 2);
3817 - }
3818 - $sections.animate( { 'height': $section.outerHeight() }, $section.outerHeight() * 2, function() {
3819 - $(this).css('overflow', 'visible').css('height', 'auto');
3820 - context.fn.trigger( 'resize' );
3821 - } );
 3815+ $sections
 3816+ .animate( { 'height': $section.outerHeight() }, $section.outerHeight() * 2, function() {
 3817+ $(this).css( 'overflow', 'visible' ).css( 'height', 'auto' );
 3818+ context.fn.trigger( 'resize' );
 3819+ } );
38223820 $(this).addClass( 'current' );
38233821 } else {
3824 - $sections.css('height', $section.outerHeight() )
3825 - .animate( { 'height': 0 }, $section.outerHeight() * 2, function() {
3826 - $(this).css('overflow', 'visible');
 3822+ $sections
 3823+ .css( 'height', $section.outerHeight() )
 3824+ .animate( { 'height': 'hide' }, $section.outerHeight() * 2, function() {
 3825+ $(this).css( 'overflow', 'visible' );
38273826 context.fn.trigger( 'resize' );
38283827 } );
3829 - if ( 'toc' in context.modules ) {
3830 - context.modules.toc.$toc.animate({'height': "-="+$section.outerHeight()}, $section.outerHeight() * 2);
3831 - }
38323828 }
38333829 // Click tracking
38343830 if($.trackAction != undefined){
@@ -3928,12 +3924,7 @@
39293925 var $section = s.$sections.find( '.section:visible' );
39303926 if ( $section.size() ) {
39313927 $sections.animate( { 'height': $section.outerHeight() }, $section.outerHeight() * 2, function( ) {
3932 - if ( 'toc' in context.modules ) {
3933 - context.modules.toc.$toc.height(
3934 - context.$ui.find( '.wikiEditor-ui-left' )
3935 - .outerHeight() - context.$ui.find( '.tab-toc' ).outerHeight()
3936 - )
3937 - }
 3928+ context.fn.trigger( 'resize' );
39383929 } );
39393930 }
39403931 }
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -258,8 +258,7 @@
259259 return html;},buildRow:function(context,row){var html='<tr>';for(cell in row){html+='<td class="cell cell-'+cell+'" valign="top"><span>'+
260260 $.wikiEditor.autoMsg(row[cell],['html','text'])+'</span></td>';}
261261 html+='</tr>';return html;},buildCharacter:function(character,actions){if(typeof character=='string'){character={'label':character,'action':{'type':'encapsulate','options':{'pre':character}}};}else if(0 in character&&1 in character){character={'label':character[0],'action':{'type':'encapsulate','options':{'pre':character[1]}}};}
262 -if('action'in character&&'label'in character){actions[character.label]=character.action;return'<a rel="'+character.label+'" href="#">'+character.label+'</a>';}},buildTab:function(context,id,section){var selected=$.cookie('wikiEditor-'+context.instance+'-toolbar-section');return $('<span />').attr({'class':'tab tab-'+id,'rel':id}).append($('<a />').addClass(selected==id?'current':null).attr('href','#').text($.wikiEditor.autoMsg(section,'label')).data('context',context).bind('mouseup',function(e){$(this).blur();}).bind('click',function(e){var $sections=$(this).data('context').$ui.find('.sections');var $section=$(this).data('context').$ui.find('.section-'+$(this).parent().attr('rel'));var show=$section.css('display')=='none';$previousSections=$section.parent().find('.section:visible');var dH=$previousSections.outerHeight();$previousSections.css('position','absolute');$previousSections.fadeOut('fast',function(){$(this).css('position','relative');});$(this).parent().parent().find('a').removeClass('current');$sections.css('overflow','hidden');if(show){$section.fadeIn('fast');dH=$section.outerHeight()-dH;if('toc'in context.modules){context.modules.toc.$toc.animate({'height':"+="+dH},$section.outerHeight()*2);}
263 -$sections.animate({'height':$section.outerHeight()},$section.outerHeight()*2,function(){$(this).css('overflow','visible').css('height','auto');context.fn.trigger('resize');});$(this).addClass('current');}else{$sections.css('height',$section.outerHeight()).animate({'height':0},$section.outerHeight()*2,function(){$(this).css('overflow','visible');context.fn.trigger('resize');});if('toc'in context.modules){context.modules.toc.$toc.animate({'height':"-="+$section.outerHeight()},$section.outerHeight()*2);}}
 262+if('action'in character&&'label'in character){actions[character.label]=character.action;return'<a rel="'+character.label+'" href="#">'+character.label+'</a>';}},buildTab:function(context,id,section){var selected=$.cookie('wikiEditor-'+context.instance+'-toolbar-section');return $('<span />').attr({'class':'tab tab-'+id,'rel':id}).append($('<a />').addClass(selected==id?'current':null).attr('href','#').text($.wikiEditor.autoMsg(section,'label')).data('context',context).bind('mouseup',function(e){$(this).blur();}).bind('click',function(e){var $sections=$(this).data('context').$ui.find('.sections');var $section=$(this).data('context').$ui.find('.section-'+$(this).parent().attr('rel'));var show=$section.css('display')=='none';$previousSections=$section.parent().find('.section:visible');var dH=$previousSections.outerHeight();$previousSections.css('position','absolute');$previousSections.fadeOut('fast',function(){$(this).css('position','relative');});$(this).parent().parent().find('a').removeClass('current');$sections.css('overflow','hidden');if(show){$section.fadeIn('fast');dH=$section.outerHeight()-dH;$sections.animate({'height':$section.outerHeight()},$section.outerHeight()*2,function(){$(this).css('overflow','visible').css('height','auto');context.fn.trigger('resize');});$(this).addClass('current');}else{$sections.css('height',$section.outerHeight()).animate({'height':'hide'},$section.outerHeight()*2,function(){$(this).css('overflow','visible');context.fn.trigger('resize');});}
264263 if($.trackAction!=undefined){$.trackAction($section.attr('rel')+'.'+(show?'show':'hide'));}
265264 $.cookie('wikiEditor-'+$(this).data('context').instance+'-toolbar-section',show?$section.attr('rel'):null);return false;}));},buildSection:function(context,id,section){context.$textarea.trigger('wikiEditor-toolbar-buildSection-'+id,[section]);var selected=$.cookie('wikiEditor-'+context.instance+'-toolbar-section');var $section;switch(section.type){case'toolbar':var $section=$('<div />').attr({'class':'toolbar section section-'+id,'rel':id});if('groups'in section){for(group in section.groups){$section.append($.wikiEditor.modules.toolbar.fn.buildGroup(context,group,section.groups[group]));}}
266265 break;case'booklet':var $pages=$('<div />').addClass('pages');var $index=$('<div />').addClass('index');if('pages'in section){for(page in section.pages){$pages.append($.wikiEditor.modules.toolbar.fn.buildPage(context,page,section.pages[page]));$index.append($.wikiEditor.modules.toolbar.fn.buildBookmark(context,page,section.pages[page]));}}
@@ -267,4 +266,4 @@
268267 if($section!==null&&id!=='main'){var show=selected==id;$section.css('display',show?'block':'none');}
269268 return $section;},updateBookletSelection:function(context,id,$pages,$index){var cookie='wikiEditor-'+context.instance+'-booklet-'+id+'-page';var selected=$.cookie(cookie);var $selectedIndex=$index.find('*[rel='+selected+']');if($selectedIndex.size()==0){selected=$index.children().eq(0).attr('rel');$.cookie(cookie,selected);}
270269 $pages.children().hide();$pages.find('*[rel='+selected+']').show();$index.children().removeClass('current');$selectedIndex.addClass('current');},build:function(context,config){var $tabs=$('<div />').addClass('tabs').appendTo(context.modules.toolbar.$toolbar);var $sections=$('<div />').addClass('sections').appendTo(context.modules.toolbar.$toolbar);context.modules.toolbar.$toolbar.append($('<div />').css('clear','both'));var sectionQueue=[];for(section in config){if(section=='main'){context.modules.toolbar.$toolbar.prepend($.wikiEditor.modules.toolbar.fn.buildSection(context,section,config[section]));}else{sectionQueue.push({'$sections':$sections,'context':context,'id':section,'config':config[section]});$tabs.append($.wikiEditor.modules.toolbar.fn.buildTab(context,section,config[section]));}}
271 -$.eachAsync(sectionQueue,{'bulk':0,'end':function(){$('body').css('position','static');$('body').css('position','relative');},'loop':function(i,s){s.$sections.append($.wikiEditor.modules.toolbar.fn.buildSection(s.context,s.id,s.config));var $section=s.$sections.find('.section:visible');if($section.size()){$sections.animate({'height':$section.outerHeight()},$section.outerHeight()*2,function(){if('toc'in context.modules){context.modules.toc.$toc.height(context.$ui.find('.wikiEditor-ui-left').outerHeight()-context.$ui.find('.tab-toc').outerHeight())}});}}});}}};})(jQuery);
\ No newline at end of file
 270+$.eachAsync(sectionQueue,{'bulk':0,'end':function(){$('body').css('position','static');$('body').css('position','relative');},'loop':function(i,s){s.$sections.append($.wikiEditor.modules.toolbar.fn.buildSection(s.context,s.id,s.config));var $section=s.$sections.find('.section:visible');if($section.size()){$sections.animate({'height':$section.outerHeight()},$section.outerHeight()*2,function(){context.fn.trigger('resize');});}}});}}};})(jQuery);
\ No newline at end of file

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r60041Removed now unneeded TOC UI updating code from Toolbar code. The resize event...tparscal19:25, 14 December 2009

Status & tagging log