Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -57,7 +57,7 @@ |
58 | 58 | |
59 | 59 | // Core functionality of extension scripts |
60 | 60 | array( 'src' => 'js/plugins/jquery.async.js', 'version' => 3 ), |
61 | | - array( 'src' => 'js/plugins/jquery.autoEllipsis.js', 'version' => 12 ), |
| 61 | + array( 'src' => 'js/plugins/jquery.autoEllipsis.js', 'version' => 13 ), |
62 | 62 | array( 'src' => 'js/plugins/jquery.browser.js', 'version' => 8 ), |
63 | 63 | array( 'src' => 'js/plugins/jquery.collapsibleTabs.js', 'version' => 6 ), |
64 | 64 | array( 'src' => 'js/plugins/jquery.color.js', 'version' => 1 ), |
— | — | @@ -80,10 +80,10 @@ |
81 | 81 | array( 'src' => 'js/thirdparty/contentCollector.js', 'version' => 2 ), |
82 | 82 | ), |
83 | 83 | 'combined' => array( |
84 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 438 ), |
| 84 | + array( 'src' => 'js/plugins.combined.js', 'version' => 439 ), |
85 | 85 | ), |
86 | 86 | 'minified' => array( |
87 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 442 ), |
| 87 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 443 ), |
88 | 88 | ), |
89 | 89 | ), |
90 | 90 | ); |
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.hooks.php |
— | — | @@ -13,7 +13,7 @@ |
14 | 14 | static $scripts = array( |
15 | 15 | 'raw' => array( |
16 | 16 | array( 'src' => 'Modules/Highlight/Highlight.js', 'version' => 5 ), |
17 | | - array( 'src' => 'Modules/Preview/Preview.js', 'version' => 6 ), |
| 17 | + array( 'src' => 'Modules/Preview/Preview.js', 'version' => 7 ), |
18 | 18 | array( 'src' => 'Modules/Publish/Publish.js', 'version' => 6 ), |
19 | 19 | array( 'src' => 'Modules/Toc/Toc.js', 'version' => 7 ), |
20 | 20 | array( 'src' => 'Modules/Toolbar/Toolbar.js', 'version' => 96 ), |
— | — | @@ -22,10 +22,10 @@ |
23 | 23 | array( 'src' => 'Modules/AddMediaWizard/AddMediaWizard.js', 'version' => 6 ), |
24 | 24 | ), |
25 | 25 | 'combined' => array( |
26 | | - array( 'src' => 'WikiEditor.combined.js', 'version' => 103 ), |
| 26 | + array( 'src' => 'WikiEditor.combined.js', 'version' => 104 ), |
27 | 27 | ), |
28 | 28 | 'minified' => array( |
29 | | - array( 'src' => 'WikiEditor.combined.min.js', 'version' => 103 ), |
| 29 | + array( 'src' => 'WikiEditor.combined.min.js', 'version' => 104 ), |
30 | 30 | ), |
31 | 31 | ); |
32 | 32 | static $messages = array( |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.autoEllipsis.js |
— | — | @@ -5,6 +5,8 @@ |
6 | 6 | |
7 | 7 | // Cache ellipsed substrings for every string-width combination |
8 | 8 | var cache = { }; |
| 9 | +// Use a seperate cache when match highlighting is enabled |
| 10 | +var matchTextCache = { }; |
9 | 11 | |
10 | 12 | $.fn.autoEllipsis = function( options ) { |
11 | 13 | options = $.extend( { |
— | — | @@ -67,8 +69,8 @@ |
68 | 70 | if ( !( text in cache ) ) { |
69 | 71 | cache[text] = {}; |
70 | 72 | } |
71 | | - if ( options.matchText && !( options.matchText in cache[text] ) ) { |
72 | | - cache[text][options.matchText] = {}; |
| 73 | + if ( options.matchText && !( options.matchText in matchTextCache[text] ) ) { |
| 74 | + matchTextCache[text][options.matchText] = {}; |
73 | 75 | } |
74 | 76 | if ( !options.matchText && w in cache[text] ) { |
75 | 77 | $container.html( cache[text][w] ); |
— | — | @@ -76,8 +78,8 @@ |
77 | 79 | $container.attr( 'title', text ); |
78 | 80 | return; |
79 | 81 | } |
80 | | - if( options.matchText && options.matchText in cache[text] && w in cache[text][options.matchText] ) { |
81 | | - $container.html( cache[text][options.matchText][w] ); |
| 82 | + if( options.matchText && options.matchText in matchTextCache[text] && w in matchTextCache[text][options.matchText] ) { |
| 83 | + $container.html( matchTextCache[text][options.matchText][w] ); |
82 | 84 | if ( options.tooltip ) |
83 | 85 | $container.attr( 'title', text ); |
84 | 86 | return; |
— | — | @@ -131,7 +133,7 @@ |
132 | 134 | $container.attr( 'title', text ); |
133 | 135 | } |
134 | 136 | if ( options.matchText ) { |
135 | | - cache[text][options.matchText][w] = $container.html(); |
| 137 | + matchTextCache[text][options.matchText][w] = $container.html(); |
136 | 138 | } else { |
137 | 139 | cache[text][w] = $container.html(); |
138 | 140 | } |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -213,6 +213,8 @@ |
214 | 214 | |
215 | 215 | // Cache ellipsed substrings for every string-width combination |
216 | 216 | var cache = { }; |
| 217 | +// Use a seperate cache when match highlighting is enabled |
| 218 | +var matchTextCache = { }; |
217 | 219 | |
218 | 220 | $.fn.autoEllipsis = function( options ) { |
219 | 221 | options = $.extend( { |
— | — | @@ -275,8 +277,8 @@ |
276 | 278 | if ( !( text in cache ) ) { |
277 | 279 | cache[text] = {}; |
278 | 280 | } |
279 | | - if ( options.matchText && !( options.matchText in cache[text] ) ) { |
280 | | - cache[text][options.matchText] = {}; |
| 281 | + if ( options.matchText && !( options.matchText in matchTextCache[text] ) ) { |
| 282 | + matchTextCache[text][options.matchText] = {}; |
281 | 283 | } |
282 | 284 | if ( !options.matchText && w in cache[text] ) { |
283 | 285 | $container.html( cache[text][w] ); |
— | — | @@ -284,8 +286,8 @@ |
285 | 287 | $container.attr( 'title', text ); |
286 | 288 | return; |
287 | 289 | } |
288 | | - if( options.matchText && options.matchText in cache[text] && w in cache[text][options.matchText] ) { |
289 | | - $container.html( cache[text][options.matchText][w] ); |
| 290 | + if( options.matchText && options.matchText in matchTextCache[text] && w in matchTextCache[text][options.matchText] ) { |
| 291 | + $container.html( matchTextCache[text][options.matchText][w] ); |
290 | 292 | if ( options.tooltip ) |
291 | 293 | $container.attr( 'title', text ); |
292 | 294 | return; |
— | — | @@ -339,7 +341,7 @@ |
340 | 342 | $container.attr( 'title', text ); |
341 | 343 | } |
342 | 344 | if ( options.matchText ) { |
343 | | - cache[text][options.matchText][w] = $container.html(); |
| 345 | + matchTextCache[text][options.matchText][w] = $container.html(); |
344 | 346 | } else { |
345 | 347 | cache[text][w] = $container.html(); |
346 | 348 | } |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -18,19 +18,19 @@ |
19 | 19 | {var i=0,l=array.length,loop=opts.loop||function(){};$.whileAsync($.extend(opts,{test:function(){return i<l;},loop:function() |
20 | 20 | {var val=array[i];return loop.call(val,i++,val);}}));} |
21 | 21 | $.fn.eachAsync=function(opts) |
22 | | -{$.eachAsync(this,opts);return this;}})(jQuery);(function($){var cache={};$.fn.autoEllipsis=function(options){options=$.extend({'position':'center','tooltip':false,'restoreText':false,'hasSpan':false,'matchText':null},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'));}} |
| 22 | +{$.eachAsync(this,opts);return this;}})(jQuery);(function($){var cache={};var matchTextCache={};$.fn.autoEllipsis=function(options){options=$.extend({'position':'center','tooltip':false,'restoreText':false,'hasSpan':false,'matchText':null},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'));}} |
23 | 23 | var $container=$this;var $trimmableText=null;var $protectedText=null;if(options.matchText){var text=$this.text();var matchedText=options.matchText;$trimmableText=$('<span />').css('whiteSpace','nowrap').addClass('autoellipsis-trimmed').text($this.text().substr(matchedText.length,$this.text().length));$protectedText=$('<span />').addClass('autoellipsis-matched').css('whiteSpace','nowrap').text(options.matchText);$container.empty().append($protectedText).append($trimmableText);}else{if(options.hasSpan){$trimmableText=$this.children(options.selector);}else{$trimmableText=$('<span />').css('whiteSpace','nowrap').text($this.text());$this.empty().append($trimmableText);}} |
24 | 24 | var text=$container.text();var trimmableText=$trimmableText.text();var w=$container.width();var pw=$protectedText?$protectedText.width():0;if(!(text in cache)){cache[text]={};} |
25 | | -if(options.matchText&&!(options.matchText in cache[text])){cache[text][options.matchText]={};} |
| 25 | +if(options.matchText&&!(options.matchText in matchTextCache[text])){matchTextCache[text][options.matchText]={};} |
26 | 26 | if(!options.matchText&&w in cache[text]){$container.html(cache[text][w]);if(options.tooltip) |
27 | 27 | $container.attr('title',text);return;} |
28 | | -if(options.matchText&&options.matchText in cache[text]&&w in cache[text][options.matchText]){$container.html(cache[text][options.matchText][w]);if(options.tooltip) |
| 28 | +if(options.matchText&&options.matchText in matchTextCache[text]&&w in matchTextCache[text][options.matchText]){$container.html(matchTextCache[text][options.matchText][w]);if(options.tooltip) |
29 | 29 | $container.attr('title',text);return;} |
30 | 30 | if($trimmableText.width()+pw>w){switch(options.position){case'right':var l=0,r=trimmableText.length;do{var m=Math.ceil((l+r)/2);$trimmableText.text(trimmableText.substr(0,m)+'...');if($trimmableText.width()+pw>w){r=m-1;}else{l=m;}}while(l<r);$trimmableText.text(trimmableText.substr(0,l)+'...');break;case'center':var i=[Math.round(trimmableText.length/2),Math.round(trimmableText.length/2)];var side=1;while($trimmableText.outerWidth()+pw>w&&i[0]>0){$trimmableText.text(trimmableText.substr(0,i[0])+'...'+trimmableText.substr(i[1]));if(side==0){i[0]--;side=1;}else{i[1]++;side=0;}} |
31 | 31 | break;case'left':var r=0;while($trimmableText.outerWidth()+pw>w&&r<trimmableText.length){$trimmableText.text('...'+trimmableText.substr(r));r++;} |
32 | 32 | break;}} |
33 | 33 | if(options.tooltip){$container.attr('title',text);} |
34 | | -if(options.matchText){cache[text][options.matchText][w]=$container.html();}else{cache[text][w]=$container.html();}});};})(jQuery);(function($){$.browserTest=function(a,z){var u='unknown',x='X',m=function(r,h){for(var i=0;i<h.length;i=i+1){r=r.replace(h[i][0],h[i][1]);} |
| 34 | +if(options.matchText){matchTextCache[text][options.matchText][w]=$container.html();}else{cache[text][w]=$container.html();}});};})(jQuery);(function($){$.browserTest=function(a,z){var u='unknown',x='X',m=function(r,h){for(var i=0;i<h.length;i=i+1){r=r.replace(h[i][0],h[i][1]);} |
35 | 35 | return r;},c=function(i,a,b,c){var r={name:m((a.exec(i)||[u,u])[1],b)};r[r.name]=true;r.version=(c.exec(i)||[x,x,x,x])[3];if(r.name.match(/safari/)&&r.version>400){r.version='2.0';} |
36 | 36 | if(r.name==='presto'){r.version=($.browser.version>9.27)?'futhark':'linear_b';} |
37 | 37 | if(r.name==='opera'&&$.browser.version>=9.8){r.version=i.match(/version\/([0-9\.]*)/i)[1]||10;} |