r57678 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57677‎ | r57678 | r57679 >
Date:19:32, 13 October 2009
Author:brion
Status:deferred
Tags:
Comment:
Merge r57443 fix to jquery.wikiEditor.toolbar.js per Trevor
and rebuild minified files
Modified paths:
  • /branches/wmf-deployment/extensions/UsabilityInitiative/css/combined.min.css (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins.combined.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins.combined.min.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js (modified) (history)

Diff [purge]

Index: branches/wmf-deployment/extensions/UsabilityInitiative/css/combined.min.css
@@ -453,4 +453,4 @@
454454 background-color:white;
455455 text-decoration:none;
456456 border-color:#a8d7f9;
457 -}
\ No newline at end of file
 457+}
Index: branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js
@@ -114,9 +114,6 @@
115115 }
116116 }
117117 },
118 - modifyTool : function( context, data ){
119 -
120 - },
121118 removeFromToolbar : function( context, data ) {
122119 js_log("f:removeFromToolbar");
123120 if ( typeof data.section == 'string' ) {
@@ -476,8 +473,8 @@
477474 );
478475 },
479476 buildSection : function( context, id, section ) {
480 - var selected = $
481 - .cookie( 'wikiEditor-' + context.instance + '-toolbar-section' );
 477+ context.$textarea.trigger( 'wikiEditor-toolbar-buildSection-' + id, [section] );
 478+ var selected = $.cookie( 'wikiEditor-' + context.instance + '-toolbar-section' );
482479 var $section;
483480 switch ( section.type ) {
484481 case 'toolbar':
Property changes on: branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js
___________________________________________________________________
Name: svn:mergeinfo
485482 + /branches/REL1_15/phase3/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js:51646
/trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js:56151-57234,57443
/trunk/phase3/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,57154-57447
Index: branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -1557,9 +1557,6 @@
15581558 }
15591559 }
15601560 },
1561 - modifyTool : function( context, data ){
1562 -
1563 - },
15641561 removeFromToolbar : function( context, data ) {
15651562 js_log("f:removeFromToolbar");
15661563 if ( typeof data.section == 'string' ) {
@@ -1919,8 +1916,8 @@
19201917 );
19211918 },
19221919 buildSection : function( context, id, section ) {
1923 - var selected = $
1924 - .cookie( 'wikiEditor-' + context.instance + '-toolbar-section' );
 1920+ context.$textarea.trigger( 'wikiEditor-toolbar-buildSection-' + id, [section] );
 1921+ var selected = $.cookie( 'wikiEditor-' + context.instance + '-toolbar-section' );
19251922 var $section;
19261923 switch ( section.type ) {
19271924 case 'toolbar':
Index: branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -102,7 +102,7 @@
103103 var $table=context.modules.$toolbar.find('div[rel='+data.section+'].section '+'div[rel='+data.page+'].page table');for(row in data[type]){$table.append($.wikiEditor.modules.toolbar.fn.buildRow(context,data[type][row]));}
104104 break;case'characters':if(!('section'in data&&'page'in data)){continue;}
105105 $characters=context.modules.$toolbar.find('div[rel='+data.section+'].section '+'div[rel='+data.page+'].page div');var actions=$characters.data('actions');for(character in data[type]){$characters.append($($.wikiEditor.modules.toolbar.fn.buildCharacter(data[type][character],actions)).click(function(){$.wikiEditor.modules.toolbar.fn.doAction($(this).parent().data('context'),$(this).parent().data('actions')[$(this).attr('rel')]);return false;}));}
106 -break;default:break;}}},modifyTool:function(context,data){},removeFromToolbar:function(context,data){js_log("f:removeFromToolbar");if(typeof data.section=='string'){var tab='div.tabs span[rel='+data.section+'].tab';var target='div[rel='+data.section+'].section';if(typeof data.group=='string'){target+=' div[rel='+data.group+'].group';if(typeof data.tool=='string'){target+=' div[rel='+data.tool+'].tool';}}else if(typeof data.page=='string'){var index=target+' div.index div[rel='+data.page+']';target+=' div.pages div[rel='+data.page+'].page';if(typeof data.character=='string'){target+=' a[rel='+data.character+']';}else if(typeof data.row=='number'){target+=' table tr:not(:has(th)):eq('+data.row+')';}else{context.modules.$toolbar.find(index).remove();$.wikiEditor.modules.toolbar.fn.updateBookletSelection(context,null,context.modules.$toolbar.find(target),context.modules.$toolbar.find(index));}}else{context.modules.$toolbar.find(tab).remove();}
 106+break;default:break;}}},removeFromToolbar:function(context,data){js_log("f:removeFromToolbar");if(typeof data.section=='string'){var tab='div.tabs span[rel='+data.section+'].tab';var target='div[rel='+data.section+'].section';if(typeof data.group=='string'){target+=' div[rel='+data.group+'].group';if(typeof data.tool=='string'){target+=' div[rel='+data.tool+'].tool';}}else if(typeof data.page=='string'){var index=target+' div.index div[rel='+data.page+']';target+=' div.pages div[rel='+data.page+'].page';if(typeof data.character=='string'){target+=' a[rel='+data.character+']';}else if(typeof data.row=='number'){target+=' table tr:not(:has(th)):eq('+data.row+')';}else{context.modules.$toolbar.find(index).remove();$.wikiEditor.modules.toolbar.fn.updateBookletSelection(context,null,context.modules.$toolbar.find(target),context.modules.$toolbar.find(index));}}else{context.modules.$toolbar.find(tab).remove();}
107107 js_log('target is: '+target);context.modules.$toolbar.find(target).remove();}}},fn:{create:function(context,config){if('$toolbar'in context.modules){return;}
108108 context.modules.$toolbar=$('<div />').addClass('wikiEditor-ui-toolbar').attr('id','wikiEditor-ui-toolbar');$.wikiEditor.modules.toolbar.fn.build(context,config);context.$ui.find('.wikiEditor-ui-top').append(context.modules.$toolbar);},doAction:function(context,action,source){if($.trackAction!=undefined&&source.closest('.wikiEditor-ui-toolbar').size()){var rels=[];var step=source;var i=0;while(!step.hasClass('wikiEditor-ui-toolbar')){if(i>25){break;}
109109 i++;var rel=step.attr('rel');if(rel){rels.push(step.attr('rel'));}
@@ -130,7 +130,7 @@
131131 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]}}};}
132132 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).click(function(){var $section=$(this).data('context').$ui.find('.section-'+$(this).parent().attr('rel'));$(this).blur();var show=$section.css('display')=='none';$section.parent().children().hide("fast");$(this).parent().parent().find('a').removeClass('current');if(show){$section.show("fast");$(this).addClass('current');}
133133 if($.trackAction!=undefined){$.trackAction($section.attr('rel')+'.'+(show?'show':'hide'));}
134 -$.cookie('wikiEditor-'+$(this).data('context').instance+'-toolbar-section',show?$section.attr('rel'):null);return false;}));},buildSection:function(context,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]));}}
 134+$.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]));}}
135135 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]));}}
136136 $section=$('<div />').attr({'class':'booklet section section-'+id,'rel':id}).append($index).append($pages);$.wikiEditor.modules.toolbar.fn.updateBookletSelection(context,page,$pages,$index);break;}
137137 if($section!==null&&id!=='main'){$section.css('display',selected==id?'block':'none');}

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r57443Added a trigger for modifying the configuration of a section just before it's...tparscal22:42, 6 October 2009

Status & tagging log