Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -64,7 +64,7 @@ |
65 | 65 | |
66 | 66 | // Core functionality of extension scripts |
67 | 67 | array( 'src' => 'js/plugins/jquery.async.js', 'version' => 3 ), |
68 | | - array( 'src' => 'js/plugins/jquery.autoEllipsis.js', 'version' => 8 ), |
| 68 | + array( 'src' => 'js/plugins/jquery.autoEllipsis.js', 'version' => 9 ), |
69 | 69 | array( 'src' => 'js/plugins/jquery.browser.js', 'version' => 6 ), |
70 | 70 | array( 'src' => 'js/plugins/jquery.collapsibleTabs.js', 'version' => 6 ), |
71 | 71 | array( 'src' => 'js/plugins/jquery.color.js', 'version' => 1 ), |
— | — | @@ -72,7 +72,7 @@ |
73 | 73 | array( 'src' => 'js/plugins/jquery.delayedBind.js', 'version' => 1 ), |
74 | 74 | array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 18 ), |
75 | 75 | array( 'src' => 'js/plugins/jquery.expandableField.js', 'version' => 15 ), |
76 | | - array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 20 ), |
| 76 | + array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 21 ), |
77 | 77 | array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 33 ), |
78 | 78 | array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 188 ), |
79 | 79 | array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 53 ), |
— | — | @@ -85,10 +85,10 @@ |
86 | 86 | array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 5 ), |
87 | 87 | ), |
88 | 88 | 'combined' => array( |
89 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 405 ), |
| 89 | + array( 'src' => 'js/plugins.combined.js', 'version' => 406 ), |
90 | 90 | ), |
91 | 91 | 'minified' => array( |
92 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 405 ), |
| 92 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 406 ), |
93 | 93 | ), |
94 | 94 | ), |
95 | 95 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.suggestions.js |
— | — | @@ -195,7 +195,7 @@ |
196 | 196 | context.data.$container.width( Math.min( expWidth, maxWidth ) ); |
197 | 197 | } |
198 | 198 | // autoEllipse the results. Has to be done after changing the width |
199 | | - $autoEllipseMe.autoEllipsis( { hasSpan: true, tooltip: true } ); |
| 199 | + $autoEllipseMe.autoEllipsis( { hasSpan: true, tooltip: true, selector: 'div' } ); |
200 | 200 | } |
201 | 201 | } |
202 | 202 | break; |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.autoEllipsis.js |
— | — | @@ -10,6 +10,7 @@ |
11 | 11 | options = $.extend( { |
12 | 12 | 'position': 'center', |
13 | 13 | 'tooltip': false, |
| 14 | + 'selector': 'span', |
14 | 15 | 'restoreText': false, |
15 | 16 | 'hasSpan': false |
16 | 17 | }, options ); |
— | — | @@ -26,7 +27,7 @@ |
27 | 28 | var w = $this.width(); |
28 | 29 | var $text; |
29 | 30 | if ( options.hasSpan ) { |
30 | | - $text = $this.children( 'span' ); |
| 31 | + $text = $this.children( options.selector ); |
31 | 32 | } else { |
32 | 33 | $text = $( '<span />' ).css( 'whiteSpace', 'nowrap' ); |
33 | 34 | $this.empty().append( $text ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -5182,6 +5182,7 @@ |
5183 | 5183 | options = $.extend( { |
5184 | 5184 | 'position': 'center', |
5185 | 5185 | 'tooltip': false, |
| 5186 | + 'selector': 'span', |
5186 | 5187 | 'restoreText': false, |
5187 | 5188 | 'hasSpan': false |
5188 | 5189 | }, options ); |
— | — | @@ -5198,7 +5199,7 @@ |
5199 | 5200 | var w = $this.width(); |
5200 | 5201 | var $text; |
5201 | 5202 | if ( options.hasSpan ) { |
5202 | | - $text = $this.children( 'span' ); |
| 5203 | + $text = $this.children( options.selector ); |
5203 | 5204 | } else { |
5204 | 5205 | $text = $( '<span />' ).css( 'whiteSpace', 'nowrap' ); |
5205 | 5206 | $this.empty().append( $text ); |
— | — | @@ -5952,7 +5953,7 @@ |
5953 | 5954 | context.data.$container.width( Math.min( expWidth, maxWidth ) ); |
5954 | 5955 | } |
5955 | 5956 | // autoEllipse the results. Has to be done after changing the width |
5956 | | - $autoEllipseMe.autoEllipsis( { hasSpan: true, tooltip: true } ); |
| 5957 | + $autoEllipseMe.autoEllipsis( { hasSpan: true, tooltip: true, selector: 'div' } ); |
5957 | 5958 | } |
5958 | 5959 | } |
5959 | 5960 | break; |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -359,8 +359,8 @@ |
360 | 360 | {var i=0,l=array.length,loop=opts.loop||function(){};$.whileAsync($.extend(opts,{test:function(){return i<l;},loop:function() |
361 | 361 | {var val=array[i];return loop.call(val,i++,val);}}));} |
362 | 362 | $.fn.eachAsync=function(opts) |
363 | | -{$.eachAsync(this,opts);return this;}})(jQuery);(function($){var cache={};$.fn.autoEllipsis=function(options){options=$.extend({'position':'center','tooltip':false,'restoreText':false,'hasSpan':false},options);$(this).each(function(){var $this=$(this);if(options.restoreText){if(!$this.data('autoEllipsis.originalText')){$this.data('autoEllipsis.originalText',$this.text());}else{$this.text($this.data('autoEllipsis.originalText'));}} |
364 | | -var text=$this.text();var w=$this.width();var $text;if(options.hasSpan){$text=$this.children('span');}else{$text=$('<span />').css('whiteSpace','nowrap');$this.empty().append($text);} |
| 363 | +{$.eachAsync(this,opts);return this;}})(jQuery);(function($){var cache={};$.fn.autoEllipsis=function(options){options=$.extend({'position':'center','tooltip':false,'selector':'span','restoreText':false,'hasSpan':false},options);$(this).each(function(){var $this=$(this);if(options.restoreText){if(!$this.data('autoEllipsis.originalText')){$this.data('autoEllipsis.originalText',$this.text());}else{$this.text($this.data('autoEllipsis.originalText'));}} |
| 364 | +var text=$this.text();var w=$this.width();var $text;if(options.hasSpan){$text=$this.children(options.selector);}else{$text=$('<span />').css('whiteSpace','nowrap');$this.empty().append($text);} |
365 | 365 | if(!(text in cache)){cache[text]={};} |
366 | 366 | if(w in cache[text]){$text.text(cache[text][w]);return;} |
367 | 367 | $text.text(text);if($text.width()>w){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()>w){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()>w&&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;}} |
— | — | @@ -401,7 +401,7 @@ |
402 | 402 | var $span=$result.children('div');if($span.outerWidth()>$result.width()&&$span.outerWidth()>expWidth){expWidth=$span.outerWidth();} |
403 | 403 | $autoEllipseMe=$autoEllipseMe.add($result);}} |
404 | 404 | if(expWidth>context.data.$container.width()){var maxWidth=context.config.maxExpandFactor*context.data.$textbox.width();context.data.$container.width(Math.min(expWidth,maxWidth));} |
405 | | -$autoEllipseMe.autoEllipsis({hasSpan:true,tooltip:true});}} |
| 405 | +$autoEllipseMe.autoEllipsis({hasSpan:true,tooltip:true,selector:'div'});}} |
406 | 406 | 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'maxExpandFactor':context.config[property]=Math.max(1,value);break;case'submitOnClick':case'positionFromLeft':case'highlightInput':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'){if(selected.is('.suggestions-special')){result=context.data.$container.find('.suggestions-results div:last')}else{result=selected.prev();if(selected.length==0){if(context.data.$container.find('.suggestions-special').html()!=""){result=context.data.$container.find('.suggestions-special');}else{result=context.data.$container.find('.suggestions-results div:last');}}}}else if(result=='next'){if(selected.length==0){result=context.data.$container.find('.suggestions-results div:first');if(result.length==0&&context.data.$container.find('.suggestions-special').html()!=""){result=context.data.$container.find('.suggestions-special');}}else{result=selected.next();if(selected.is('.suggestions-special')){result=$([]);}else if(result.length==0&&context.data.$container.find('.suggestions-special').html()!=""){result=context.data.$container.find('.suggestions-special');}}} |
407 | 407 | selected.removeClass('suggestions-result-current');result.addClass('suggestions-result-current');} |
408 | 408 | if(updateTextbox){if(result.length==0){$.suggestions.restore(context);}else{context.data.$textbox.val(result.data('text'));context.data.$textbox.change();} |