Index: trunk/phase3/resources/jquery/jquery.autoEllipsis.js |
— | — | @@ -17,29 +17,29 @@ |
18 | 18 | 'matchText': null |
19 | 19 | }, options ); |
20 | 20 | $(this).each( function() { |
21 | | - var $this = $(this); |
| 21 | + var $el = $(this); |
22 | 22 | if ( options.restoreText ) { |
23 | | - if ( ! $this.data( 'autoEllipsis.originalText' ) ) { |
24 | | - $this.data( 'autoEllipsis.originalText', $this.text() ); |
| 23 | + if ( !$el.data( 'autoEllipsis.originalText' ) ) { |
| 24 | + $el.data( 'autoEllipsis.originalText', $el.text() ); |
25 | 25 | } else { |
26 | | - $this.text( $this.data( 'autoEllipsis.originalText' ) ); |
| 26 | + $el.text( $el.data( 'autoEllipsis.originalText' ) ); |
27 | 27 | } |
28 | 28 | } |
29 | 29 | |
30 | 30 | // container element - used for measuring against |
31 | | - var $container = $this; |
| 31 | + var $container = $el; |
32 | 32 | // trimmable text element - only the text within this element will be trimmed |
33 | 33 | var $trimmableText = null; |
34 | 34 | // protected text element - the width of this element is counted, but next is never trimmed from it |
35 | 35 | var $protectedText = null; |
36 | 36 | |
37 | 37 | if ( options.hasSpan ) { |
38 | | - $trimmableText = $this.children( options.selector ); |
| 38 | + $trimmableText = $el.children( options.selector ); |
39 | 39 | } else { |
40 | 40 | $trimmableText = $( '<span />' ) |
41 | 41 | .css( 'whiteSpace', 'nowrap' ) |
42 | | - .text( $this.text() ); |
43 | | - $this |
| 42 | + .text( $el.text() ); |
| 43 | + $el |
44 | 44 | .empty() |
45 | 45 | .append( $trimmableText ); |
46 | 46 | } |
— | — | @@ -60,14 +60,16 @@ |
61 | 61 | } |
62 | 62 | if ( !options.matchText && w in cache[text] ) { |
63 | 63 | $container.html( cache[text][w] ); |
64 | | - if ( options.tooltip ) |
| 64 | + if ( options.tooltip ) { |
65 | 65 | $container.attr( 'title', text ); |
| 66 | + } |
66 | 67 | return; |
67 | 68 | } |
68 | 69 | if( options.matchText && options.matchText in matchTextCache[text] && w in matchTextCache[text][options.matchText] ) { |
69 | 70 | $container.html( matchTextCache[text][options.matchText][w] ); |
70 | | - if ( options.tooltip ) |
| 71 | + if ( options.tooltip ) { |
71 | 72 | $container.attr( 'title', text ); |
| 73 | + } |
72 | 74 | return; |
73 | 75 | } |
74 | 76 | if ( $trimmableText.width() + pw > w ) { |
— | — | @@ -94,7 +96,7 @@ |
95 | 97 | while ( $trimmableText.outerWidth() + pw > w && i[0] > 0 ) { |
96 | 98 | $trimmableText.text( trimmableText.substr( 0, i[0] ) + '...' + trimmableText.substr( i[1] ) ); |
97 | 99 | // Alternate between trimming the end and begining |
98 | | - if ( side == 0 ) { |
| 100 | + if ( side === 0 ) { |
99 | 101 | // Make the begining shorter |
100 | 102 | i[0]--; |
101 | 103 | side = 1; |
Index: trunk/phase3/resources/jquery/jquery.async.js |
— | — | @@ -13,33 +13,28 @@ |
14 | 14 | // opts.test : (default true) function to test in the while test part |
15 | 15 | // opts.loop : (default empty) function to call in the while loop part |
16 | 16 | // opts.end : (default empty) function to call at the end of the while loop |
17 | | -$.whileAsync = function(opts) |
18 | | -{ |
| 17 | +$.whileAsync = function(opts) { |
19 | 18 | var delay = Math.abs(opts.delay) || 10, |
20 | 19 | bulk = isNaN(opts.bulk) ? 500 : Math.abs(opts.bulk), |
21 | 20 | test = opts.test || function(){ return true; }, |
22 | 21 | loop = opts.loop || function(){}, |
23 | | - end = opts.end || function(){}; |
| 22 | + end = opts.end || function(){}; |
24 | 23 | |
25 | 24 | (function(){ |
26 | 25 | |
27 | 26 | var t = false, |
28 | 27 | begin = new Date(); |
29 | 28 | |
30 | | - while( t = test() ) |
31 | | - { |
| 29 | + while( t = test() ) { |
32 | 30 | loop(); |
33 | | - if( bulk === 0 || (new Date() - begin) > bulk ) |
34 | | - { |
| 31 | + if( bulk === 0 || (new Date() - begin) > bulk ) { |
35 | 32 | break; |
36 | 33 | } |
37 | 34 | } |
38 | | - if( t ) |
39 | | - { |
| 35 | + if( t ) { |
40 | 36 | setTimeout(arguments.callee, delay); |
41 | 37 | } |
42 | | - else |
43 | | - { |
| 38 | + else { |
44 | 39 | end(); |
45 | 40 | } |
46 | 41 | |
— | — | @@ -50,17 +45,15 @@ |
51 | 46 | // opts.bulk : (default 500) delay during which the loop can continue synchronously without yielding the CPU |
52 | 47 | // opts.loop : (default empty) function to call in the each loop part, signature: function(index, value) this = value |
53 | 48 | // opts.end : (default empty) function to call at the end of the each loop |
54 | | -$.eachAsync = function(array, opts) |
55 | | -{ |
56 | | - var i = 0, |
| 49 | +$.eachAsync = function(array, opts) { |
| 50 | + var i = 0, |
57 | 51 | l = array.length, |
58 | 52 | loop = opts.loop || function(){}; |
59 | 53 | |
60 | 54 | $.whileAsync( |
61 | 55 | $.extend(opts, { |
62 | | - test: function(){ return i < l; }, |
63 | | - loop: function() |
64 | | - { |
| 56 | + test: function() { return i < l; }, |
| 57 | + loop: function() { |
65 | 58 | var val = array[i]; |
66 | 59 | return loop.call(val, i++, val); |
67 | 60 | } |
— | — | @@ -68,11 +61,9 @@ |
69 | 62 | ); |
70 | 63 | }; |
71 | 64 | |
72 | | -$.fn.eachAsync = function(opts) |
73 | | -{ |
| 65 | +$.fn.eachAsync = function(opts) { |
74 | 66 | $.eachAsync(this, opts); |
75 | 67 | return this; |
76 | 68 | } |
77 | 69 | |
78 | | -})(jQuery); |
79 | | - |
| 70 | +})(jQuery); |
\ No newline at end of file |
Index: trunk/phase3/resources/jquery/jquery.client.js |
— | — | @@ -1,7 +1,6 @@ |
2 | 2 | /** |
3 | 3 | * User-agent detection |
4 | 4 | */ |
5 | | - */ |
6 | 5 | ( function( $ ) { |
7 | 6 | $.client = new ( function() { |
8 | 7 | |
— | — | @@ -15,15 +14,15 @@ |
16 | 15 | * Returns an object containing information about the browser |
17 | 16 | * |
18 | 17 | * The resulting client object will be in the following format: |
19 | | - * { |
20 | | - * 'name': 'firefox', |
21 | | - * 'layout': 'gecko', |
22 | | - * 'layoutVersion': '20101026', |
23 | | - * 'platform': 'linux' |
24 | | - * 'version': '3.5.1', |
25 | | - * 'versionBase': '3', |
26 | | - * 'versionNumber': 3.5, |
27 | | - * } |
| 18 | + * { |
| 19 | + * 'name': 'firefox', |
| 20 | + * 'layout': 'gecko', |
| 21 | + * 'layoutVersion': '20101026', |
| 22 | + * 'platform': 'linux' |
| 23 | + * 'version': '3.5.1', |
| 24 | + * 'versionBase': '3', |
| 25 | + * 'versionNumber': 3.5, |
| 26 | + * } |
28 | 27 | */ |
29 | 28 | this.profile = function() { |
30 | 29 | // Use the cached version if possible |
— | — | @@ -50,7 +49,7 @@ |
51 | 50 | // This helps keep differnt versions consistent |
52 | 51 | ['Navigator', 'Netscape'], |
53 | 52 | // This prevents version extraction issues, otherwise translation would happen later |
54 | | - ['PLAYSTATION 3', 'PS3'], |
| 53 | + ['PLAYSTATION 3', 'PS3'] |
55 | 54 | ]; |
56 | 55 | // Strings which precede a version number in a user agent string - combined and used as match 1 in |
57 | 56 | // version detectection |
— | — | @@ -62,8 +61,8 @@ |
63 | 62 | var versionSuffix = '(\\/|\\;?\\s|)([a-z0-9\\.\\+]*?)(\\;|dev|rel|\\)|\\s|$)'; |
64 | 63 | // Names of known browsers |
65 | 64 | var names = [ |
66 | | - 'camino', 'chrome', 'firefox', 'netscape', 'konqueror', 'lynx', 'msie', 'opera', 'safari', 'ipod', |
67 | | - 'iphone', 'blackberry', 'ps3' |
| 65 | + 'camino', 'chrome', 'firefox', 'netscape', 'konqueror', 'lynx', 'msie', 'opera', 'safari', 'ipod', |
| 66 | + 'iphone', 'blackberry', 'ps3' |
68 | 67 | ]; |
69 | 68 | // Tanslations for conforming browser names |
70 | 69 | var nameTranslations = []; |
— | — | @@ -81,7 +80,7 @@ |
82 | 81 | /* Methods */ |
83 | 82 | |
84 | 83 | // Performs multiple replacements on a string |
85 | | - function translate( source, translations ) { |
| 84 | + var translate = function( source, translations ) { |
86 | 85 | for ( var i = 0; i < translations.length; i++ ) { |
87 | 86 | source = source.replace( translations[i][0], translations[i][1] ); |
88 | 87 | } |
— | — | @@ -107,7 +106,7 @@ |
108 | 107 | layout = translate( match[1], layoutTranslations ); |
109 | 108 | } |
110 | 109 | if ( match = new RegExp( '(' + layoutVersions.join( '|' ) + ')\\\/(\\d+)').exec( navigator.userAgent.toLowerCase() ) ) { |
111 | | - layoutversion = parseInt(match[2]); |
| 110 | + layoutversion = parseInt( match[2], 10 ); |
112 | 111 | } |
113 | 112 | if ( match = new RegExp( '(' + platforms.join( '|' ) + ')' ).exec( navigator.platform.toLowerCase() ) ) { |
114 | 113 | platform = translate( match[1], platformTranslations ); |
— | — | @@ -148,20 +147,20 @@ |
149 | 148 | * element is classified as either "ltr" or "rtl". If neither is set, "ltr" is assumed. |
150 | 149 | * |
151 | 150 | * A browser map is in the following format: |
152 | | - * { |
153 | | - * 'ltr': { |
154 | | - * // Multiple rules with configurable operators |
155 | | - * 'msie': [['>=', 7], ['!=', 9]], |
156 | | - * // Blocked entirely |
157 | | - * 'iphone': false |
158 | | - * }, |
159 | | - * 'rtl': { |
160 | | - * // Test against a string |
161 | | - * 'msie': [['!==', '8.1.2.3']], |
162 | | - * // RTL rules do not fall through to LTR rules, you must explicity set each of them |
163 | | - * 'iphone': false |
164 | | - * } |
165 | | - * } |
| 151 | + * { |
| 152 | + * 'ltr': { |
| 153 | + * // Multiple rules with configurable operators |
| 154 | + * 'msie': [['>=', 7], ['!=', 9]], |
| 155 | + * // Blocked entirely |
| 156 | + * 'iphone': false |
| 157 | + * }, |
| 158 | + * 'rtl': { |
| 159 | + * // Test against a string |
| 160 | + * 'msie': [['!==', '8.1.2.3']], |
| 161 | + * // RTL rules do not fall through to LTR rules, you must explicity set each of them |
| 162 | + * 'iphone': false |
| 163 | + * } |
| 164 | + * } |
166 | 165 | * |
167 | 166 | * @param map Object of browser support map |
168 | 167 | * |