http://www.mediawiki.org/wiki/Special:Code/MediaWiki/60792
Revision: 60792 Author: demon Date: 2010-01-07 13:47:58 +0000 (Thu, 07 Jan 2010) Log Message: ----------- Fixme on r56220: Fix spelling ellipse -> ellipsis Modified Paths: -------------- trunk/extensions/UsabilityInitiative/Makefile trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php trunk/extensions/UsabilityInitiative/Vector/Modules/SimpleSearch/SimpleSearch.js trunk/extensions/UsabilityInitiative/Vector/Vector.combined.js trunk/extensions/UsabilityInitiative/Vector/Vector.combined.min.js trunk/extensions/UsabilityInitiative/js/plugins/jquery.suggestions.js trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toc.js trunk/extensions/UsabilityInitiative/js/plugins.combined.js trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js Added Paths: ----------- trunk/extensions/UsabilityInitiative/js/plugins/jquery.autoEllipsis.js Removed Paths: ------------- trunk/extensions/UsabilityInitiative/js/plugins/jquery.autoEllipse.js Modified: trunk/extensions/UsabilityInitiative/Makefile =================================================================== --- trunk/extensions/UsabilityInitiative/Makefile 2010-01-07 10:44:55 UTC (rev 60791) +++ trunk/extensions/UsabilityInitiative/Makefile 2010-01-07 13:47:58 UTC (rev 60792) @@ -13,7 +13,7 @@ PLUGINS := \ js/plugins/jquery.async.js\ - js/plugins/jquery.autoEllipse.js\ + js/plugins/jquery.autoEllipsis.js\ js/plugins/jquery.browser.js\ js/plugins/jquery.collapsibleTabs.js\ js/plugins/jquery.cookie.js\ Modified: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php =================================================================== --- trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php 2010-01-07 10:44:55 UTC (rev 60791) +++ trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php 2010-01-07 13:47:58 UTC (rev 60792) @@ -63,7 +63,7 @@ 'base_sets' => array( 'raw' => array( array( 'src' => 'js/plugins/jquery.async.js', 'version' => 3 ), - array( 'src' => 'js/plugins/jquery.autoEllipse.js', 'version' => 4 ), + array( 'src' => 'js/plugins/jquery.autoEllipsis.js', 'version' => 5 ), array( 'src' => 'js/plugins/jquery.browser.js', 'version' => 3 ), array( 'src' => 'js/plugins/jquery.collapsibleTabs.js', 'version' => 5 ), array( 'src' => 'js/plugins/jquery.cookie.js', 'version' => 3 ), @@ -82,10 +82,10 @@ array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 1 ), ), 'combined' => array( - array( 'src' => 'js/plugins.combined.js', 'version' => 133 ), + array( 'src' => 'js/plugins.combined.js', 'version' => 134 ), ), 'minified' => array( - array( 'src' => 'js/plugins.combined.min.js', 'version' => 133 ), + array( 'src' => 'js/plugins.combined.min.js', 'version' => 134 ), ), ), ); Modified: trunk/extensions/UsabilityInitiative/Vector/Modules/SimpleSearch/SimpleSearch.js =================================================================== --- trunk/extensions/UsabilityInitiative/Vector/Modules/SimpleSearch/SimpleSearch.js 2010-01-07 10:44:55 UTC (rev 60791) +++ trunk/extensions/UsabilityInitiative/Vector/Modules/SimpleSearch/SimpleSearch.js 2010-01-07 13:47:58 UTC (rev 60792) @@ -100,12 +100,12 @@ .addClass( 'special-query' ) .text( query ) .appendTo( $j(this) ); - $query.autoEllipse(); + $query.autoEllipsis(); } else { $j(this).find( '.special-query' ) .empty() .text( query ) - .autoEllipse(); + .autoEllipsis(); } } else { $j(this).hide(); Modified: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.js =================================================================== --- trunk/extensions/UsabilityInitiative/Vector/Vector.combined.js 2010-01-07 10:44:55 UTC (rev 60791) +++ trunk/extensions/UsabilityInitiative/Vector/Vector.combined.js 2010-01-07 13:47:58 UTC (rev 60792) @@ -263,12 +263,12 @@ .addClass( 'special-query' ) .text( query ) .appendTo( $j(this) ); - $query.autoEllipse(); + $query.autoEllipsis(); } else { $j(this).find( '.special-query' ) .empty() .text( query ) - .autoEllipse(); + .autoEllipsis(); } } else { $j(this).hide(); Modified: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.min.js =================================================================== --- trunk/extensions/UsabilityInitiative/Vector/Vector.combined.min.js 2010-01-07 10:44:55 UTC (rev 60791) +++ trunk/extensions/UsabilityInitiative/Vector/Vector.combined.min.js 2010-01-07 13:47:58 UTC (rev 60792) @@ -9,4 +9,4 @@ if(wgAction=='submit'||$j('#wpTextbox1').data('origtext')!=$j('#wpTextbox1').val()||$j('#wpSummary').data('origtext')!=$j('#wpSummary').val()){return gM('vector-editwarning-warning');}} $j('form').submit(function(){window.onbeforeunload=fallbackWindowOnBeforeUnload;});});var fallbackWindowOnBeforeUnload=null;if(typeof os_autoload_inputs!=='undefined'&&os_autoload_forms!=='undefined'){os_autoload_inputs=[];os_autoload_forms=[];} mw.addOnloadHook(function(){if(!wgVectorEnabledModules.simplesearch||skin!='vector'){return true;} -$j('div#simpleSearch > input#searchInput').each(function(){$j('<label />').text(gM('vector-simplesearch-search')).css({'display':'none','position':'absolute','bottom':0,'padding':'0.25em','color':'#999999','cursor':'text'}).css(($j('body').is('.rtl')?'right':'left'),0).click(function(){$j(this).parent().find('input#searchInput').focus();}).appendTo($j(this).parent());if($j(this).val()==''){$j(this).parent().find('label').show();}}).focus(function(){$j(this).parent().find('label').hide();}).blur(function(){if($j(this).val()==''){$j(this).parent().find('label').show();}});$j('#searchInput, #searchInput2, #powerSearchText, #searchText').suggestions({fetch:function(query){var $this=$j(this);var request=$j.ajax({url:wgScriptPath+'/api.php',data:{'action':'opensearch','search':query,'namespace':0,'suggest':''},dataType:'json',success:function(data){$this.suggestions('suggestions',data[1]);}});$j(this).data('request',request);},cancel:function(){var request=$j(this).data('request');if(request&&typeof request.abort=='function'){request.abort();$j(this).removeData('request');}},result:{select:function($textbox){$textbox.closest('form').submit();}},delay:120});$j('#searchInput').suggestions({result:{select:function($textbox){$textbox.closest('form').submit();}},special:{render:function(query){var perfectMatch=false;$j(this).closest('.suggestions').find('.suggestions-results div').each(function(){if($j(this).data('text')==query){perfectMatch=true;}});if(perfectMatch){if($j(this).children().size()==0){$j(this).show();$label=$j('<div />').addClass('special-label').text(gM('vector-simplesearch-containing')).appendTo($j(this));$query=$j('<div />').addClass('special-query').text(query).appendTo($j(this));$query.autoEllipse();}else{$j(this).find('.special-query').empty().text(query).autoEllipse();}}else{$j(this).hide();$j(this).empty();}},select:function($textbox){$textbox.closest('form').append($j('<input />').attr({'type':'hidden','name':'fulltext','value':1}));$textbox.closest('form').submit();}},$region:$j('#simpleSearch')});}); \ No newline at end of file +$j('div#simpleSearch > input#searchInput').each(function(){$j('<label />').text(gM('vector-simplesearch-search')).css({'display':'none','position':'absolute','bottom':0,'padding':'0.25em','color':'#999999','cursor':'text'}).css(($j('body').is('.rtl')?'right':'left'),0).click(function(){$j(this).parent().find('input#searchInput').focus();}).appendTo($j(this).parent());if($j(this).val()==''){$j(this).parent().find('label').show();}}).focus(function(){$j(this).parent().find('label').hide();}).blur(function(){if($j(this).val()==''){$j(this).parent().find('label').show();}});$j('#searchInput, #searchInput2, #powerSearchText, #searchText').suggestions({fetch:function(query){var $this=$j(this);var request=$j.ajax({url:wgScriptPath+'/api.php',data:{'action':'opensearch','search':query,'namespace':0,'suggest':''},dataType:'json',success:function(data){$this.suggestions('suggestions',data[1]);}});$j(this).data('request',request);},cancel:function(){var request=$j(this).data('request');if(request&&typeof request.abort=='function'){request.abort();$j(this).removeData('request');}},result:{select:function($textbox){$textbox.closest('form').submit();}},delay:120});$j('#searchInput').suggestions({result:{select:function($textbox){$textbox.closest('form').submit();}},special:{render:function(query){var perfectMatch=false;$j(this).closest('.suggestions').find('.suggestions-results div').each(function(){if($j(this).data('text')==query){perfectMatch=true;}});if(perfectMatch){if($j(this).children().size()==0){$j(this).show();$label=$j('<div />').addClass('special-label').text(gM('vector-simplesearch-containing')).appendTo($j(this));$query=$j('<div />').addClass('special-query').text(query).appendTo($j(this));$query.autoEllipsis();}else{$j(this).find('.special-query').empty().text(query).autoEllipsis();}}else{$j(this).hide();$j(this).empty();}},select:function($textbox){$textbox.closest('form').append($j('<input />').attr({'type':'hidden','name':'fulltext','value':1}));$textbox.closest('form').submit();}},$region:$j('#simpleSearch')});}); \ No newline at end of file Deleted: trunk/extensions/UsabilityInitiative/js/plugins/jquery.autoEllipse.js =================================================================== --- trunk/extensions/UsabilityInitiative/js/plugins/jquery.autoEllipse.js 2010-01-07 10:44:55 UTC (rev 60791) +++ trunk/extensions/UsabilityInitiative/js/plugins/jquery.autoEllipse.js 2010-01-07 13:47:58 UTC (rev 60792) @@ -1,65 +0,0 @@ -/** - * Plugin that automatically truncates the plain text contents of an element and adds an ellipsis - */ -( function( $ ) { - -$.fn.autoEllipse = function( options ) { - $(this).each( function() { - options = $.extend( { - 'position': 'center', - 'tooltip': false - }, options ); - var text = $(this).text(); - var $text = $( '<span />' ).text( text ).css( 'whiteSpace', 'nowrap' ); - $(this).empty().append( $text ); - if ( $text.width() > $(this).width() ) { - switch ( options.position ) { - case 'right': - // Use binary search-like technique for efficiency - var l = 0, r = text.length; - do { - var m = Math.ceil( ( l + r ) / 2 ); - $text.text( text.substr( 0, m ) + '...' ); - if ( $text.width() > $(this).width() ) { - // Text is too long - r = m - 1; - } else { - l = m; - } - } while ( l < r ); - $text.text( text.substr( 0, l ) + '...' ); - break; - case 'center': - // TODO: Use binary search like for 'right' - var i = [Math.round( text.length / 2 ), Math.round( text.length / 2 )]; - var side = 1; // Begin with making the end shorter - while ( $text.outerWidth() > ( $(this).width() ) && i[0] > 0 ) { - $text.text( text.substr( 0, i[0] ) + '...' + text.substr( i[1] ) ); - // Alternate between trimming the end and begining - if ( side == 0 ) { - // Make the begining shorter - i[0]--; - side = 1; - } else { - // Make the end shorter - i[1]++; - side = 0; - } - } - break; - case 'left': - // TODO: Use binary search like for 'right' - var r = 0; - while ( $text.outerWidth() > $(this).width() && r < text.length ) { - $text.text( '...' + text.substr( r ) ); - r++; - } - break; - } - if ( options.tooltip ) - $text.attr( 'title', text ); - } - } ); -}; - -} )( jQuery ); \ No newline at end of file Copied: trunk/extensions/UsabilityInitiative/js/plugins/jquery.autoEllipsis.js (from rev 60791, trunk/extensions/UsabilityInitiative/js/plugins/jquery.autoEllipse.js) =================================================================== --- trunk/extensions/UsabilityInitiative/js/plugins/jquery.autoEllipsis.js (rev 0) +++ trunk/extensions/UsabilityInitiative/js/plugins/jquery.autoEllipsis.js 2010-01-07 13:47:58 UTC (rev 60792) @@ -0,0 +1,65 @@ +/** + * Plugin that automatically truncates the plain text contents of an element and adds an ellipsis + */ +( function( $ ) { + +$.fn.autoEllipsis = function( options ) { + $(this).each( function() { + options = $.extend( { + 'position': 'center', + 'tooltip': false + }, options ); + var text = $(this).text(); + var $text = $( '<span />' ).text( text ).css( 'whiteSpace', 'nowrap' ); + $(this).empty().append( $text ); + if ( $text.width() > $(this).width() ) { + switch ( options.position ) { + case 'right': + // Use binary search-like technique for efficiency + var l = 0, r = text.length; + do { + var m = Math.ceil( ( l + r ) / 2 ); + $text.text( text.substr( 0, m ) + '...' ); + if ( $text.width() > $(this).width() ) { + // Text is too long + r = m - 1; + } else { + l = m; + } + } while ( l < r ); + $text.text( text.substr( 0, l ) + '...' ); + break; + case 'center': + // TODO: Use binary search like for 'right' + var i = [Math.round( text.length / 2 ), Math.round( text.length / 2 )]; + var side = 1; // Begin with making the end shorter + while ( $text.outerWidth() > ( $(this).width() ) && i[0] > 0 ) { + $text.text( text.substr( 0, i[0] ) + '...' + text.substr( i[1] ) ); + // Alternate between trimming the end and begining + if ( side == 0 ) { + // Make the begining shorter + i[0]--; + side = 1; + } else { + // Make the end shorter + i[1]++; + side = 0; + } + } + break; + case 'left': + // TODO: Use binary search like for 'right' + var r = 0; + while ( $text.outerWidth() > $(this).width() && r < text.length ) { + $text.text( '...' + text.substr( r ) ); + r++; + } + break; + } + if ( options.tooltip ) + $text.attr( 'title', text ); + } + } ); +}; + +} )( jQuery ); \ No newline at end of file Modified: trunk/extensions/UsabilityInitiative/js/plugins/jquery.suggestions.js =================================================================== --- trunk/extensions/UsabilityInitiative/js/plugins/jquery.suggestions.js 2010-01-07 10:44:55 UTC (rev 60791) +++ trunk/extensions/UsabilityInitiative/js/plugins/jquery.suggestions.js 2010-01-07 13:47:58 UTC (rev 60792) @@ -141,7 +141,7 @@ if ( typeof context.config.result.render == 'function' ) { context.config.result.render.call( $result, context.config.suggestions[i] ); } else { - $result.text( context.config.suggestions[i] ).autoEllipse(); + $result.text( context.config.suggestions[i] ).autoEllipsis(); } } } Modified: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toc.js =================================================================== --- trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toc.js 2010-01-07 10:44:55 UTC (rev 60791) +++ trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toc.js 2010-01-07 13:47:58 UTC (rev 60792) @@ -409,7 +409,7 @@ buildResizeControls(); buildCollapseControls(); } - context.modules.toc.$toc.find( 'div' ).autoEllipse( { 'position': 'right', 'tooltip': true } ); + context.modules.toc.$toc.find( 'div' ).autoEllipsis( { 'position': 'right', 'tooltip': true } ); } } Modified: trunk/extensions/UsabilityInitiative/js/plugins.combined.js =================================================================== --- trunk/extensions/UsabilityInitiative/js/plugins.combined.js 2010-01-07 10:44:55 UTC (rev 60791) +++ trunk/extensions/UsabilityInitiative/js/plugins.combined.js 2010-01-07 13:47:58 UTC (rev 60792) @@ -81,7 +81,7 @@ */ ( function( $ ) { -$.fn.autoEllipse = function( options ) { +$.fn.autoEllipsis = function( options ) { $(this).each( function() { options = $.extend( { 'position': 'center', @@ -651,7 +651,7 @@ if ( typeof context.config.result.render == 'function' ) { context.config.result.render.call( $result, context.config.suggestions[i] ); } else { - $result.text( context.config.suggestions[i] ).autoEllipse(); + $result.text( context.config.suggestions[i] ).autoEllipsis(); } } } @@ -3627,7 +3627,7 @@ buildResizeControls(); buildCollapseControls(); } - context.modules.toc.$toc.find( 'div' ).autoEllipse( { 'position': 'right', 'tooltip': true } ); + context.modules.toc.$toc.find( 'div' ).autoEllipsis( { 'position': 'right', 'tooltip': true } ); } } Modified: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js =================================================================== --- trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js 2010-01-07 10:44:55 UTC (rev 60791) +++ trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js 2010-01-07 13:47:58 UTC (rev 60792) @@ -11,7 +11,7 @@ {var i=0,l=array.length,loop=opts.loop||function(){};$.whileAsync($.extend(opts,{test:function(){return i<l;},loop:function() {var val=array[i];return loop.call(val,i++,val);}}));} $.fn.eachAsync=function(opts) -{$.eachAsync(this,opts);return this;}})(jQuery);(function($){$.fn.autoEllipse=function(options){$(this).each(function(){options=$.extend({'position':'center','tooltip':false},options);var text=$(this).text();var $text=$('<span />').text(text).css('whiteSpace','nowrap');$(this).empty().append($text);if($text.width()>$(this).width()){switch(options.position){case'right':var l=0,r=text.length;do{var m=Math.ceil((l+r)/2);$text.text(text.substr(0,m)+'...');if($text.width()>$(this).width()){r=m-1;}else{l=m;}}while(l<r);$text.text(text.substr(0,l)+'...');break;case'center':var i=[Math.round(text.length/2),Math.round(text.length/2)];var side=1;while($text.outerWidth()>($(this).width())&&i[0]>0){$text.text(text.substr(0,i[0])+'...'+text.substr(i[1]));if(side==0){i[0]--;side=1;}else{i[1]++;side=0;}} +{$.eachAsync(this,opts);return this;}})(jQuery);(function($){$.fn.autoEllipsis=function(options){$(this).each(function(){options=$.extend({'position':'center','tooltip':false},options);var text=$(this).text();var $text=$('<span />').text(text).css('whiteSpace','nowrap');$(this).empty().append($text);if($text.width()>$(this).width()){switch(options.position){case'right':var l=0,r=text.length;do{var m=Math.ceil((l+r)/2);$text.text(text.substr(0,m)+'...');if($text.width()>$(this).width()){r=m-1;}else{l=m;}}while(l<r);$text.text(text.substr(0,l)+'...');break;case'center':var i=[Math.round(text.length/2),Math.round(text.length/2)];var side=1;while($text.outerWidth()>($(this).width())&&i[0]>0){$text.text(text.substr(0,i[0])+'...'+text.substr(i[1]));if(side==0){i[0]--;side=1;}else{i[1]++;side=0;}} break;case'left':var r=0;while($text.outerWidth()>$(this).width()&&r<text.length){$text.text('...'+text.substr(r));r++;} break;} if(options.tooltip) @@ -34,7 +34,7 @@ if(typeof context.config.cancel=='function'){context.config.cancel.call(context.data.$textbox);}},restore:function(context){context.data.$textbox.val(context.data.prevText);},update:function(context,delayed){function maybeFetch(){if(context.data.$textbox.val()!==context.data.prevText){context.data.prevText=context.data.$textbox.val();if(typeof context.config.fetch=='function'){context.config.fetch.call(context.data.$textbox,context.data.$textbox.val());}}} if(context.data.timerID!=null){clearTimeout(context.data.timerID);} if(delayed){context.data.timerID=setTimeout(maybeFetch,context.config.delay);}else{maybeFetch();} -$.suggestions.special(context);},special:function(context){if(typeof context.config.special.render=='function'){setTimeout(function(){$special=context.data.$container.find('.suggestions-special');context.config.special.render.call($special,context.data.$textbox.val());},1);}},configure:function(context,property,value){switch(property){case'fetch':case'cancel':case'special':case'result':case'$region':context.config[property]=value;break;case'suggestions':context.config[property]=value;if(typeof context.data!=='undefined'){if(typeof context.config.suggestions=='undefined'||context.config.suggestions.length==0){context.data.$container.hide();}else{context.data.$container.show();context.data.$container.css({'top':context.config.$region.offset().top+context.config.$region.outerHeight(),'bottom':'auto','width':context.config.$region.outerWidth(),'height':'auto','left':context.config.$region.offset().left,'right':'auto'});var $results=context.data.$container.children('.suggestions-results');$results.empty();for(var i=0;i<context.config.suggestions.length;i++){$result=$('<div />').addClass('suggestions-result').attr('rel',i).data('text',context.config.suggestions[i]).appendTo($results);if(typeof context.config.result.render=='function'){context.config.result.render.call($result,context.config.suggestions[i]);}else{$result.text(context.config.suggestions[i]).autoEllipse();}}}} +$.suggestions.special(context);},special:function(context){if(typeof context.config.special.render=='function'){setTimeout(function(){$special=context.data.$container.find('.suggestions-special');context.config.special.render.call($special,context.data.$textbox.val());},1);}},configure:function(context,property,value){switch(property){case'fetch':case'cancel':case'special':case'result':case'$region':context.config[property]=value;break;case'suggestions':context.config[property]=value;if(typeof context.data!=='undefined'){if(typeof context.config.suggestions=='undefined'||context.config.suggestions.length==0){context.data.$container.hide();}else{context.data.$container.show();context.data.$container.css({'top':context.config.$region.offset().top+context.config.$region.outerHeight(),'bottom':'auto','width':context.config.$region.outerWidth(),'height':'auto','left':context.config.$region.offset().left,'right':'auto'});var $results=context.data.$container.children('.suggestions-results');$results.empty();for(var i=0;i<context.config.suggestions.length;i++){$result=$('<div />').addClass('suggestions-result').attr('rel',i).data('text',context.config.suggestions[i]).appendTo($results);if(typeof context.config.result.render=='function'){context.config.result.render.call($result,context.config.suggestions[i]);}else{$result.text(context.config.suggestions[i]).autoEllipsis();}}}} break;case'maxRows':context.config[property]=Math.max(1,Math.min(100,value));break;case'delay':context.config[property]=Math.max(0,Math.min(1200,value));break;case'submitOnClick':context.config[property]=value?true:false;break;}},highlight:function(context,result,updateTextbox){var selected=context.data.$container.find('.suggestions-result-current');if(!result.get||selected.get(0)!=result.get(0)){if(result=='prev'){result=selected.prev();}else if(result=='next'){if(selected.size()==0) result=context.data.$container.find('.suggestions-results div:first');else{result=selected.next();if(result.size()==0) result=selected;}} @@ -227,7 +227,7 @@ outline[i].nLevel=nLevel;lastLevel=outline[i].level;} var structure=buildStructure(outline);if($('input[name=wpSection]').val()==''){structure.unshift({'text':wgPageName.replace(/_/g,' '),'level':1,'index':0});} context.modules.toc.$toc.html(buildList(structure));if(wgNavigableTOCResizable&&!context.$ui.data('resizableDone')){buildResizeControls();buildCollapseControls();} -context.modules.toc.$toc.find('div').autoEllipse({'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;} +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;} $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');}} break;case'groups':if(!('section'in data)){continue;} 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]));} _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs