Index: trunk/phase3/resources/jquery/jquery.textSelection.js |
— | — | @@ -1,7 +1,6 @@ |
2 | 2 | /** |
3 | 3 | * These plugins provide extra functionality for interaction with textareas. |
4 | 4 | */ |
5 | | -( function( $ ) { |
6 | 5 | $.fn.textSelection = function( command, options ) { |
7 | 6 | var fn = { |
8 | 7 | /** |
— | — | @@ -399,6 +398,4 @@ |
400 | 399 | context.fn.saveSelection(); |
401 | 400 | } |
402 | 401 | return retval; |
403 | | -}; |
404 | | - |
405 | | -} )( jQuery ); |
| 402 | +}; |
\ No newline at end of file |
Index: trunk/phase3/resources/jquery/jquery.checkboxShiftClick.js |
— | — | @@ -7,21 +7,21 @@ |
8 | 8 | * @license GPL v2 |
9 | 9 | */ |
10 | 10 | |
11 | | -jQuery.fn.checkboxShiftClick = function( text ) { |
| 11 | +$.fn.checkboxShiftClick = function( text ) { |
12 | 12 | var prevCheckbox = null; |
13 | 13 | var $box = this; |
14 | 14 | // When our boxes are clicked.. |
15 | | - $box.click(function (e) { |
| 15 | + $box.click( function( e ) { |
16 | 16 | // And one has been clicked before... |
17 | | - if (prevCheckbox !== null && e.shiftKey) { |
| 17 | + if ( prevCheckbox !== null && e.shiftKey ) { |
18 | 18 | // Check or uncheck this one and all in-between checkboxes |
19 | 19 | $box.slice( |
20 | | - Math.min($box.index(prevCheckbox), $box.index(e.target)), |
21 | | - Math.max($box.index(prevCheckbox), $box.index(e.target)) + 1 |
22 | | - ).attr({checked: e.target.checked ? 'checked' : ''}); |
| 20 | + Math.min( $box.index( prevCheckbox ), $box.index( e.target ) ), |
| 21 | + Math.max( $box.index( prevCheckbox ), $box.index( e.target ) ) + 1 |
| 22 | + ).attr( {checked: e.target.checked ? 'checked' : ''} ); |
23 | 23 | } |
24 | 24 | // Either way, update the prevCheckbox variable to the one clicked now |
25 | 25 | prevCheckbox = e.target; |
26 | | - }); |
| 26 | + } ); |
27 | 27 | return $box; |
28 | 28 | }; |
\ No newline at end of file |
Index: trunk/phase3/resources/jquery/jquery.tabIndex.js |
— | — | @@ -1,27 +1,28 @@ |
2 | 2 | /** |
3 | 3 | * Finds the lowerst tabindex in use within a selection |
4 | 4 | * |
5 | | - * @return Integer of lowest tabindex on the page |
| 5 | + * @return number Lowest tabindex on the page |
6 | 6 | */ |
7 | | -jQuery.fn.firstTabIndex = function() { |
| 7 | +$.fn.firstTabIndex = function() { |
8 | 8 | var minTabIndex = 0; |
9 | | - jQuery(this).find( '[tabindex]' ).each( function() { |
10 | | - var tabIndex = parseInt( jQuery(this).attr( 'tabindex' ) ); |
| 9 | + $(this).find( '[tabindex]' ).each( function() { |
| 10 | + var tabIndex = parseInt( $(this).attr( 'tabindex' ) ); |
11 | 11 | if ( tabIndex > minTabIndex ) { |
12 | 12 | minTabIndex = tabIndex; |
13 | 13 | } |
14 | 14 | } ); |
15 | 15 | return minTabIndex; |
16 | 16 | }; |
| 17 | + |
17 | 18 | /** |
18 | 19 | * Finds the highest tabindex in use within a selection |
19 | 20 | * |
20 | | - * @return Integer of highest tabindex on the page |
| 21 | + * @return number Highest tabindex on the page |
21 | 22 | */ |
22 | | -jQuery.fn.lastTabIndex = function() { |
| 23 | +$.fn.lastTabIndex = function() { |
23 | 24 | var maxTabIndex = 0; |
24 | | - jQuery(this).find( '[tabindex]' ).each( function() { |
25 | | - var tabIndex = parseInt( jQuery(this).attr( 'tabindex' ) ); |
| 25 | + $(this).find( '[tabindex]' ).each( function() { |
| 26 | + var tabIndex = parseInt( $(this).attr( 'tabindex' ) ); |
26 | 27 | if ( tabIndex > maxTabIndex ) { |
27 | 28 | maxTabIndex = tabIndex; |
28 | 29 | } |
Index: trunk/phase3/resources/jquery/jquery.localize.js |
— | — | @@ -1,58 +1,53 @@ |
2 | 2 | /** |
3 | | - * Simple Placeholder-based Localization |
4 | | - * |
| 3 | + * Simple Placeholder-based Localization |
| 4 | + * |
5 | 5 | * Call on a selection of HTML which contains <msg key="message-key" /> elements or elements with |
6 | 6 | * title-msg="message-key" or alt-msg="message-key" attributes. <msg /> elements will be replaced |
7 | 7 | * with localized text, elements with title-msg and alt-msg attributes will receive localized title |
8 | 8 | * and alt attributes. |
9 | | - * |
| 9 | + * |
10 | 10 | * Example: |
11 | | - * |
12 | | - * <p class="somethingCool"> |
13 | | - * <msg key="my-message" /> |
14 | | - * <img src="something.jpg" title-msg="my-title-message" alt-msg="my-alt-message" /> |
15 | | - * </p> |
16 | | - * |
| 11 | + * <p class="somethingCool"> |
| 12 | + * <msg key="my-message" /> |
| 13 | + * <img src="something.jpg" title-msg="my-title-message" alt-msg="my-alt-message" /> |
| 14 | + * </p> |
| 15 | + * |
17 | 16 | * Localizes to... |
18 | | - * |
19 | | - * <p class="somethingCool"> |
20 | | - * My Message |
21 | | - * <img src="something.jpg" title="My Title Message" alt="My Alt Message" /> |
22 | | - * </p> |
| 17 | + * <p class="somethingCool"> |
| 18 | + * My Message |
| 19 | + * <img src="something.jpg" title="My Title Message" alt="My Alt Message" /> |
| 20 | + * </p> |
23 | 21 | */ |
24 | | - |
25 | | -( function( $, mw ) { |
26 | | - /** |
27 | | - * Localizes a DOM selection by replacing <msg /> elements with localized text and adding |
28 | | - * localized title and alt attributes to elements with title-msg and alt-msg attributes |
29 | | - * respectively. |
30 | | - * |
31 | | - * @param Object: options Map of options |
32 | | - * * prefix: Message prefix to use when localizing elements and attributes |
33 | | - */ |
34 | | - $.fn.localize = function( options ) { |
35 | | - options = $.extend( { 'prefix': '' }, options ); |
36 | | - return $(this) |
37 | | - .find( 'msg' ) |
38 | | - .each( function() { |
39 | | - $(this) |
40 | | - .text( mediaWiki.msg( options.prefix + $(this).attr( 'key' ) ) ) |
41 | | - .replaceWith( $(this).html() ); |
42 | | - } ) |
43 | | - .end() |
44 | | - .find( '[title-msg]' ) |
45 | | - .each( function() { |
46 | | - $(this) |
47 | | - .attr( 'title', mw.msg( options.prefix + $(this).attr( 'title-msg' ) ) ) |
48 | | - .removeAttr( 'title-msg' ); |
49 | | - } ) |
50 | | - .end() |
51 | | - .find( '[alt-msg]' ) |
52 | | - .each( function() { |
53 | | - $(this) |
54 | | - .attr( 'alt', mw.msg( options.prefix + $(this).attr( 'alt-msg' ) ) ) |
55 | | - .removeAttr( 'alt-msg' ); |
56 | | - } ) |
57 | | - .end(); |
58 | | - }; |
59 | | -} )( jQuery, mediaWiki ); |
| 22 | +/** |
| 23 | + * Localizes a DOM selection by replacing <msg /> elements with localized text and adding |
| 24 | + * localized title and alt attributes to elements with title-msg and alt-msg attributes |
| 25 | + * respectively. |
| 26 | + * |
| 27 | + * @param Object: options Map of options |
| 28 | + * * prefix: Message prefix to use when localizing elements and attributes |
| 29 | + */ |
| 30 | +$.fn.localize = function( options ) { |
| 31 | + options = $.extend( { 'prefix': '' }, options ); |
| 32 | + return $(this) |
| 33 | + .find( 'msg' ) |
| 34 | + .each( function() { |
| 35 | + $(this) |
| 36 | + .text( mediaWiki.msg( options.prefix + $(this).attr( 'key' ) ) ) |
| 37 | + .replaceWith( $(this).html() ); |
| 38 | + } ) |
| 39 | + .end() |
| 40 | + .find( '[title-msg]' ) |
| 41 | + .each( function() { |
| 42 | + $(this) |
| 43 | + .attr( 'title', mw.msg( options.prefix + $(this).attr( 'title-msg' ) ) ) |
| 44 | + .removeAttr( 'title-msg' ); |
| 45 | + } ) |
| 46 | + .end() |
| 47 | + .find( '[alt-msg]' ) |
| 48 | + .each( function() { |
| 49 | + $(this) |
| 50 | + .attr( 'alt', mw.msg( options.prefix + $(this).attr( 'alt-msg' ) ) ) |
| 51 | + .removeAttr( 'alt-msg' ); |
| 52 | + } ) |
| 53 | + .end(); |
| 54 | +}; |
\ No newline at end of file |
Index: trunk/phase3/resources/jquery/jquery.hoverIntent.js |
— | — | @@ -81,7 +81,7 @@ |
82 | 82 | if ( p == this ) { return false; } |
83 | 83 | |
84 | 84 | // copy objects to be passed into t (required for event object to be passed in IE) |
85 | | - var ev = jQuery.extend({},e); |
| 85 | + var ev = $.extend({},e); |
86 | 86 | var ob = this; |
87 | 87 | |
88 | 88 | // cancel hoverIntent timer if it exists |
Index: trunk/phase3/resources/jquery/jquery.suggestions.js |
— | — | @@ -41,7 +41,6 @@ |
42 | 42 | * highlightInput: Whether to hightlight matched portions of the input or not |
43 | 43 | * Type: Boolean, Default: false |
44 | 44 | */ |
45 | | -( function( $ ) { |
46 | 45 | |
47 | 46 | $.suggestions = { |
48 | 47 | /** |
— | — | @@ -516,6 +515,4 @@ |
517 | 516 | $(this).data( 'suggestions-context', context ); |
518 | 517 | } ); |
519 | 518 | return returnValue !== null ? returnValue : $(this); |
520 | | -}; |
521 | | - |
522 | | -} )( jQuery ); |
| 519 | +}; |
\ No newline at end of file |
Index: trunk/phase3/resources/jquery/jquery.colorUtil.js |
— | — | @@ -1,195 +1,191 @@ |
2 | | -/* |
| 2 | +/** |
3 | 3 | * jQuery Color Utilities |
4 | 4 | * Written by Krinkle in 2011 |
5 | 5 | * Released under the MIT and GPL licenses. |
6 | 6 | * Mostly based on other plugins and functions (taken through JSLint and optimized a little). |
7 | 7 | * Sources cited locally. |
8 | 8 | */ |
9 | | -( function( $ ) { |
| 9 | +$.colorUtil = { |
10 | 10 | |
11 | | - $.colorUtil = { |
| 11 | + // Color Conversion function from highlightFade |
| 12 | + // By Blair Mitchelmore |
| 13 | + // http://jquery.offput.ca/highlightFade/ |
| 14 | + // Parse strings looking for color tuples [255,255,255] |
| 15 | + getRGB : function( color ) { |
| 16 | + var result; |
12 | 17 | |
13 | | - // Color Conversion function from highlightFade |
14 | | - // By Blair Mitchelmore |
15 | | - // http://jquery.offput.ca/highlightFade/ |
16 | | - // Parse strings looking for color tuples [255,255,255] |
17 | | - getRGB : function( color ) { |
18 | | - var result; |
| 18 | + // Check if we're already dealing with an array of colors |
| 19 | + if ( color && color.constructor == Array && color.length == 3 ){ |
| 20 | + return color; |
| 21 | + } |
19 | 22 | |
20 | | - // Check if we're already dealing with an array of colors |
21 | | - if ( color && color.constructor == Array && color.length == 3 ){ |
22 | | - return color; |
23 | | - } |
| 23 | + // Look for rgb(num,num,num) |
| 24 | + if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color)) { |
| 25 | + return [parseInt(result[1],10), parseInt(result[2],10), parseInt(result[3],10)]; |
| 26 | + } |
24 | 27 | |
25 | | - // Look for rgb(num,num,num) |
26 | | - if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color)) { |
27 | | - return [parseInt(result[1],10), parseInt(result[2],10), parseInt(result[3],10)]; |
28 | | - } |
| 28 | + // Look for rgb(num%,num%,num%) |
| 29 | + if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color)) { |
| 30 | + return [parseFloat(result[1],10)*2.55, parseFloat(result[2],10)*2.55, parseFloat(result[3])*2.55]; |
| 31 | + } |
29 | 32 | |
30 | | - // Look for rgb(num%,num%,num%) |
31 | | - if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color)) { |
32 | | - return [parseFloat(result[1],10)*2.55, parseFloat(result[2],10)*2.55, parseFloat(result[3])*2.55]; |
33 | | - } |
| 33 | + // Look for #a0b1c2 |
| 34 | + if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color)) { |
| 35 | + return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)]; |
| 36 | + } |
34 | 37 | |
35 | | - // Look for #a0b1c2 |
36 | | - if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color)) { |
37 | | - return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)]; |
38 | | - } |
| 38 | + // Look for #fff |
| 39 | + if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color)) { |
| 40 | + return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)]; |
| 41 | + } |
39 | 42 | |
40 | | - // Look for #fff |
41 | | - if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color)) { |
42 | | - return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)]; |
43 | | - } |
| 43 | + // Look for rgba(0, 0, 0, 0) == transparent in Safari 3 |
| 44 | + if (result = /rgba\(0, 0, 0, 0\)/.exec(color)) { |
| 45 | + return $.colorUtil.colors.transparent; |
| 46 | + } |
44 | 47 | |
45 | | - // Look for rgba(0, 0, 0, 0) == transparent in Safari 3 |
46 | | - if (result = /rgba\(0, 0, 0, 0\)/.exec(color)) { |
47 | | - return $.colorUtil.colors.transparent; |
48 | | - } |
| 48 | + // Otherwise, we're most likely dealing with a named color |
| 49 | + return $.colorUtil.colors[jQuery.trim(color).toLowerCase()]; |
| 50 | + }, |
49 | 51 | |
50 | | - // Otherwise, we're most likely dealing with a named color |
51 | | - return $.colorUtil.colors[jQuery.trim(color).toLowerCase()]; |
52 | | - }, |
| 52 | + // Some named colors to work with |
| 53 | + // From Interface by Stefan Petre |
| 54 | + // http://interface.eyecon.ro/ |
| 55 | + colors: { |
| 56 | + aqua:[0,255,255], |
| 57 | + azure:[240,255,255], |
| 58 | + beige:[245,245,220], |
| 59 | + black:[0,0,0], |
| 60 | + blue:[0,0,255], |
| 61 | + brown:[165,42,42], |
| 62 | + cyan:[0,255,255], |
| 63 | + darkblue:[0,0,139], |
| 64 | + darkcyan:[0,139,139], |
| 65 | + darkgrey:[169,169,169], |
| 66 | + darkgreen:[0,100,0], |
| 67 | + darkkhaki:[189,183,107], |
| 68 | + darkmagenta:[139,0,139], |
| 69 | + darkolivegreen:[85,107,47], |
| 70 | + darkorange:[255,140,0], |
| 71 | + darkorchid:[153,50,204], |
| 72 | + darkred:[139,0,0], |
| 73 | + darksalmon:[233,150,122], |
| 74 | + darkviolet:[148,0,211], |
| 75 | + fuchsia:[255,0,255], |
| 76 | + gold:[255,215,0], |
| 77 | + green:[0,128,0], |
| 78 | + indigo:[75,0,130], |
| 79 | + khaki:[240,230,140], |
| 80 | + lightblue:[173,216,230], |
| 81 | + lightcyan:[224,255,255], |
| 82 | + lightgreen:[144,238,144], |
| 83 | + lightgrey:[211,211,211], |
| 84 | + lightpink:[255,182,193], |
| 85 | + lightyellow:[255,255,224], |
| 86 | + lime:[0,255,0], |
| 87 | + magenta:[255,0,255], |
| 88 | + maroon:[128,0,0], |
| 89 | + navy:[0,0,128], |
| 90 | + olive:[128,128,0], |
| 91 | + orange:[255,165,0], |
| 92 | + pink:[255,192,203], |
| 93 | + purple:[128,0,128], |
| 94 | + violet:[128,0,128], |
| 95 | + red:[255,0,0], |
| 96 | + silver:[192,192,192], |
| 97 | + white:[255,255,255], |
| 98 | + yellow:[255,255,0], |
| 99 | + transparent: [255,255,255] |
| 100 | + }, |
| 101 | + /** |
| 102 | + * http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript |
| 103 | + * Converts an RGB color value to HSL. Conversion formula |
| 104 | + * adapted from http://en.wikipedia.org/wiki/HSL_color_space. |
| 105 | + * Assumes r, g, and b are contained in the set [0, 255] and |
| 106 | + * returns h, s, and l in the set [0, 1]. |
| 107 | + * |
| 108 | + * @param Number R The red color value |
| 109 | + * @param Number G The green color value |
| 110 | + * @param Number B The blue color value |
| 111 | + * @return Array The HSL representation |
| 112 | + */ |
| 113 | + rgbToHsl: function( R, G, B ) { |
| 114 | + var r = R / 255, |
| 115 | + g = G / 255, |
| 116 | + b = B / 255; |
| 117 | + var max = Math.max(r, g, b), min = Math.min(r, g, b); |
| 118 | + var h, s, l = (max + min) / 2; |
53 | 119 | |
54 | | - // Some named colors to work with |
55 | | - // From Interface by Stefan Petre |
56 | | - // http://interface.eyecon.ro/ |
57 | | - colors: { |
58 | | - aqua:[0,255,255], |
59 | | - azure:[240,255,255], |
60 | | - beige:[245,245,220], |
61 | | - black:[0,0,0], |
62 | | - blue:[0,0,255], |
63 | | - brown:[165,42,42], |
64 | | - cyan:[0,255,255], |
65 | | - darkblue:[0,0,139], |
66 | | - darkcyan:[0,139,139], |
67 | | - darkgrey:[169,169,169], |
68 | | - darkgreen:[0,100,0], |
69 | | - darkkhaki:[189,183,107], |
70 | | - darkmagenta:[139,0,139], |
71 | | - darkolivegreen:[85,107,47], |
72 | | - darkorange:[255,140,0], |
73 | | - darkorchid:[153,50,204], |
74 | | - darkred:[139,0,0], |
75 | | - darksalmon:[233,150,122], |
76 | | - darkviolet:[148,0,211], |
77 | | - fuchsia:[255,0,255], |
78 | | - gold:[255,215,0], |
79 | | - green:[0,128,0], |
80 | | - indigo:[75,0,130], |
81 | | - khaki:[240,230,140], |
82 | | - lightblue:[173,216,230], |
83 | | - lightcyan:[224,255,255], |
84 | | - lightgreen:[144,238,144], |
85 | | - lightgrey:[211,211,211], |
86 | | - lightpink:[255,182,193], |
87 | | - lightyellow:[255,255,224], |
88 | | - lime:[0,255,0], |
89 | | - magenta:[255,0,255], |
90 | | - maroon:[128,0,0], |
91 | | - navy:[0,0,128], |
92 | | - olive:[128,128,0], |
93 | | - orange:[255,165,0], |
94 | | - pink:[255,192,203], |
95 | | - purple:[128,0,128], |
96 | | - violet:[128,0,128], |
97 | | - red:[255,0,0], |
98 | | - silver:[192,192,192], |
99 | | - white:[255,255,255], |
100 | | - yellow:[255,255,0], |
101 | | - transparent: [255,255,255] |
102 | | - }, |
103 | | - /** |
104 | | - * http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript |
105 | | - * Converts an RGB color value to HSL. Conversion formula |
106 | | - * adapted from http://en.wikipedia.org/wiki/HSL_color_space. |
107 | | - * Assumes r, g, and b are contained in the set [0, 255] and |
108 | | - * returns h, s, and l in the set [0, 1]. |
109 | | - * |
110 | | - * @param Number R The red color value |
111 | | - * @param Number G The green color value |
112 | | - * @param Number B The blue color value |
113 | | - * @return Array The HSL representation |
114 | | - */ |
115 | | - rgbToHsl: function( R, G, B ) { |
116 | | - var r = R / 255, |
117 | | - g = G / 255, |
118 | | - b = B / 255; |
119 | | - var max = Math.max(r, g, b), min = Math.min(r, g, b); |
120 | | - var h, s, l = (max + min) / 2; |
121 | | - |
122 | | - if(max == min){ |
123 | | - h = s = 0; // achromatic |
124 | | - }else{ |
125 | | - var d = max - min; |
126 | | - s = l > 0.5 ? d / (2 - max - min) : d / (max + min); |
127 | | - switch(max){ |
128 | | - case r: h = (g - b) / d + (g < b ? 6 : 0); break; |
129 | | - case g: h = (b - r) / d + 2; break; |
130 | | - case b: h = (r - g) / d + 4; break; |
131 | | - } |
132 | | - h /= 6; |
| 120 | + if(max == min){ |
| 121 | + h = s = 0; // achromatic |
| 122 | + }else{ |
| 123 | + var d = max - min; |
| 124 | + s = l > 0.5 ? d / (2 - max - min) : d / (max + min); |
| 125 | + switch(max){ |
| 126 | + case r: h = (g - b) / d + (g < b ? 6 : 0); break; |
| 127 | + case g: h = (b - r) / d + 2; break; |
| 128 | + case b: h = (r - g) / d + 4; break; |
133 | 129 | } |
| 130 | + h /= 6; |
| 131 | + } |
134 | 132 | |
135 | | - return [h, s, l]; |
136 | | - }, |
137 | | - /** |
138 | | - * http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript |
139 | | - * Converts an HSL color value to RGB. Conversion formula |
140 | | - * adapted from http://en.wikipedia.org/wiki/HSL_color_space. |
141 | | - * Assumes h, s, and l are contained in the set [0, 1] and |
142 | | - * returns r, g, and b in the set [0, 255]. |
143 | | - * |
144 | | - * @param Number h The hue |
145 | | - * @param Number s The saturation |
146 | | - * @param Number l The lightness |
147 | | - * @return Array The RGB representation |
148 | | - */ |
149 | | - hslToRgb: function( h, s, l ) { |
150 | | - var r, g, b; |
| 133 | + return [h, s, l]; |
| 134 | + }, |
| 135 | + /** |
| 136 | + * http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript |
| 137 | + * Converts an HSL color value to RGB. Conversion formula |
| 138 | + * adapted from http://en.wikipedia.org/wiki/HSL_color_space. |
| 139 | + * Assumes h, s, and l are contained in the set [0, 1] and |
| 140 | + * returns r, g, and b in the set [0, 255]. |
| 141 | + * |
| 142 | + * @param Number h The hue |
| 143 | + * @param Number s The saturation |
| 144 | + * @param Number l The lightness |
| 145 | + * @return Array The RGB representation |
| 146 | + */ |
| 147 | + hslToRgb: function( h, s, l ) { |
| 148 | + var r, g, b; |
151 | 149 | |
152 | | - if(s === 0){ |
153 | | - r = g = b = l; // achromatic |
154 | | - }else{ |
155 | | - var hue2rgb = function(p, q, t){ |
156 | | - if(t < 0){ t += 1; } |
157 | | - if(t > 1){ t -= 1; } |
158 | | - if(t < 1/6){ return p + (q - p) * 6 * t; } |
159 | | - if(t < 1/2){ return q; } |
160 | | - if(t < 2/3){ return p + (q - p) * (2/3 - t) * 6; } |
161 | | - return p; |
162 | | - }; |
| 150 | + if(s === 0){ |
| 151 | + r = g = b = l; // achromatic |
| 152 | + }else{ |
| 153 | + var hue2rgb = function(p, q, t){ |
| 154 | + if(t < 0){ t += 1; } |
| 155 | + if(t > 1){ t -= 1; } |
| 156 | + if(t < 1/6){ return p + (q - p) * 6 * t; } |
| 157 | + if(t < 1/2){ return q; } |
| 158 | + if(t < 2/3){ return p + (q - p) * (2/3 - t) * 6; } |
| 159 | + return p; |
| 160 | + }; |
163 | 161 | |
164 | | - var q = l < 0.5 ? l * (1 + s) : l + s - l * s; |
165 | | - var p = 2 * l - q; |
166 | | - r = hue2rgb(p, q, h + 1/3); |
167 | | - g = hue2rgb(p, q, h); |
168 | | - b = hue2rgb(p, q, h - 1/3); |
169 | | - } |
170 | | - |
171 | | - return [r * 255, g * 255, b * 255]; |
172 | | - }, |
173 | | - /** |
174 | | - * Get's a brighter or darker rgb() value string. |
175 | | - * |
176 | | - * @author Krinkle |
177 | | - * |
178 | | - * @example getCSSColorMod( 'red', +0.1 ) |
179 | | - * @example getCSSColorMod( 'rgb(200,50,50)', -0.2 ) |
180 | | - * |
181 | | - * @param Mixed currentColor current value in css |
182 | | - * @param Number mod wanted brightness modification between -1 and 1 |
183 | | - * @return String 'rgb(r,g,b)' |
184 | | - */ |
185 | | - getColorBrightness: function( currentColor, mod ) { |
186 | | - var rgbArr = $.colorUtil.getRGB( currentColor ), |
187 | | - hslArr = $.colorUtil.rgbToHsl(rgbArr[0], rgbArr[1], rgbArr[2] ); |
188 | | - rgbArr = $.colorUtil.hslToRgb(hslArr[0], hslArr[1], hslArr[2]+mod); |
189 | | - return 'rgb(' + |
190 | | - [parseInt( rgbArr[0], 10), parseInt( rgbArr[1], 10 ), parseInt( rgbArr[2], 10 )].join( ',' ) + |
191 | | - ')'; |
| 162 | + var q = l < 0.5 ? l * (1 + s) : l + s - l * s; |
| 163 | + var p = 2 * l - q; |
| 164 | + r = hue2rgb(p, q, h + 1/3); |
| 165 | + g = hue2rgb(p, q, h); |
| 166 | + b = hue2rgb(p, q, h - 1/3); |
192 | 167 | } |
193 | 168 | |
194 | | - }; |
| 169 | + return [r * 255, g * 255, b * 255]; |
| 170 | + }, |
| 171 | + /** |
| 172 | + * Get's a brighter or darker rgb() value string. |
| 173 | + * |
| 174 | + * @author Krinkle |
| 175 | + * |
| 176 | + * @example getCSSColorMod( 'red', +0.1 ) |
| 177 | + * @example getCSSColorMod( 'rgb(200,50,50)', -0.2 ) |
| 178 | + * |
| 179 | + * @param Mixed currentColor current value in css |
| 180 | + * @param Number mod wanted brightness modification between -1 and 1 |
| 181 | + * @return String 'rgb(r,g,b)' |
| 182 | + */ |
| 183 | + getColorBrightness: function( currentColor, mod ) { |
| 184 | + var rgbArr = $.colorUtil.getRGB( currentColor ), |
| 185 | + hslArr = $.colorUtil.rgbToHsl(rgbArr[0], rgbArr[1], rgbArr[2] ); |
| 186 | + rgbArr = $.colorUtil.hslToRgb(hslArr[0], hslArr[1], hslArr[2]+mod); |
| 187 | + return 'rgb(' + |
| 188 | + [parseInt( rgbArr[0], 10), parseInt( rgbArr[1], 10 ), parseInt( rgbArr[2], 10 )].join( ',' ) + |
| 189 | + ')'; |
| 190 | + } |
195 | 191 | |
196 | | -} )( jQuery ); |
\ No newline at end of file |
| 192 | +}; |
\ No newline at end of file |
Index: trunk/phase3/resources/jquery/jquery.color.js |
— | — | @@ -1,43 +1,44 @@ |
2 | | -/* |
| 2 | +/** |
3 | 3 | * jQuery Color Animations |
4 | 4 | * Copyright 2007 John Resig |
5 | 5 | * Released under the MIT and GPL licenses. |
6 | 6 | * |
7 | | - * - 2011-01-05: Modified by Krinkle to use the jQuery.colorUtil plugin (needs to be loaded first) |
| 7 | + * - 2011-01-05: Modified by Krinkle to use the jQuery.colorUtil plugin (has to be loaded first) |
8 | 8 | */ |
| 9 | +(function( $ ) { |
9 | 10 | |
10 | | -(function(jQuery){ |
11 | | - |
12 | 11 | // We override the animation for all of these color styles |
13 | | - jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){ |
14 | | - jQuery.fx.step[attr] = function(fx){ |
15 | | - if ( fx.state == 0 ) { |
16 | | - fx.start = getColor( fx.elem, attr ); |
17 | | - fx.end = $.colorUtil.getRGB( fx.end ); |
| 12 | + $.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], |
| 13 | + function( i, attr ) { |
| 14 | + $.fx.step[attr] = function( fx ) { |
| 15 | + if ( fx.state == 0 ) { |
| 16 | + fx.start = getColor( fx.elem, attr ); |
| 17 | + fx.end = $.colorUtil.getRGB( fx.end ); |
| 18 | + } |
| 19 | + |
| 20 | + fx.elem.style[attr] = 'rgb(' + [ |
| 21 | + Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0), |
| 22 | + Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0), |
| 23 | + Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0) |
| 24 | + ].join( ',' ) + ')'; |
18 | 25 | } |
19 | | - |
20 | | - fx.elem.style[attr] = "rgb(" + [ |
21 | | - Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0), |
22 | | - Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0), |
23 | | - Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0) |
24 | | - ].join(",") + ")"; |
25 | 26 | } |
26 | | - }); |
| 27 | + ); |
27 | 28 | |
28 | 29 | function getColor(elem, attr) { |
29 | 30 | var color; |
30 | 31 | |
31 | 32 | do { |
32 | | - color = jQuery.curCSS(elem, attr); |
| 33 | + color = $.curCSS(elem, attr); |
33 | 34 | |
34 | 35 | // Keep going until we find an element that has color, or we hit the body |
35 | | - if ( color != '' && color != 'transparent' || jQuery.nodeName(elem, "body") ) |
| 36 | + if ( color != '' && color != 'transparent' || $.nodeName(elem, 'body') ) |
36 | 37 | break; |
37 | 38 | |
38 | | - attr = "backgroundColor"; |
| 39 | + attr = 'backgroundColor'; |
39 | 40 | } while ( elem = elem.parentNode ); |
40 | 41 | |
41 | 42 | return $.colorUtil.getRGB(color); |
42 | 43 | }; |
43 | 44 | |
44 | | -})(jQuery); |
| 45 | +} )( jQuery ); |
Index: trunk/phase3/resources/jquery/jquery.client.js |
— | — | @@ -1,7 +1,7 @@ |
2 | | -/* |
| 2 | +/** |
3 | 3 | * User-agent detection |
4 | 4 | */ |
5 | | -jQuery.client = new ( function() { |
| 5 | +$.client = new ( function() { |
6 | 6 | |
7 | 7 | /* Private Members */ |
8 | 8 | |
— | — | @@ -166,8 +166,8 @@ |
167 | 167 | * @return Boolean true if browser known or assumed to be supported, false if blacklisted |
168 | 168 | */ |
169 | 169 | this.test = function( map ) { |
170 | | - var profile = jQuery.client.profile(); |
171 | | - var dir = jQuery( 'body' ).is( '.rtl' ) ? 'rtl' : 'ltr'; |
| 170 | + var profile = $.client.profile(); |
| 171 | + var dir = $( 'body' ).is( '.rtl' ) ? 'rtl' : 'ltr'; |
172 | 172 | // Check over each browser condition to determine if we are running in a compatible client |
173 | 173 | if ( typeof map[dir] !== 'object' || map[dir][profile.name] !== 'object' ) { |
174 | 174 | // Unknown, so we assume it's working |
Index: trunk/phase3/resources/jquery/jquery.placeholder.js |
— | — | @@ -9,7 +9,7 @@ |
10 | 10 | * @license GPL v2 |
11 | 11 | */ |
12 | 12 | |
13 | | -jQuery.fn.placeholder = function() { |
| 13 | +$.fn.placeholder = function() { |
14 | 14 | |
15 | 15 | return this.each( function() { |
16 | 16 | |
— | — | @@ -19,7 +19,7 @@ |
20 | 20 | } |
21 | 21 | |
22 | 22 | var placeholder = this.getAttribute('placeholder'); |
23 | | - var $input = jQuery(this); |
| 23 | + var $input = $(this); |
24 | 24 | |
25 | 25 | // Show initially, if empty |
26 | 26 | if ( this.value === '' || this.value == placeholder ) { |
Index: trunk/phase3/resources/mediawiki.special/mediawiki.special.changeslist.css |
— | — | @@ -4,18 +4,18 @@ |
5 | 5 | |
6 | 6 | table.mw-enhanced-rc { |
7 | 7 | background: none; |
8 | | - border:0; |
9 | | - border-spacing:0; |
| 8 | + border: 0; |
| 9 | + border-spacing: 0; |
10 | 10 | } |
11 | 11 | |
12 | 12 | table.mw-enhanced-rc th, table.mw-enhanced-rc td { |
13 | | - padding:0; |
14 | | - vertical-align:top; |
| 13 | + padding: 0; |
| 14 | + vertical-align: top; |
15 | 15 | } |
16 | 16 | |
17 | 17 | td.mw-enhanced-rc { |
18 | | - white-space:nowrap; |
19 | | - font-family:monospace; |
| 18 | + white-space: nowrap; |
| 19 | + font-family: monospace; |
20 | 20 | } |
21 | 21 | |
22 | 22 | .mw-enhanced-rc-time { |
— | — | @@ -32,7 +32,7 @@ |
33 | 33 | } |
34 | 34 | |
35 | 35 | /* If JS is disabled, the arrow is still needed |
36 | | - for spacing, but ideally shouldn't be shown */ |
| 36 | + for spacing, but ideally shouldn't be shown */ |
37 | 37 | .mw-enhanced-rc .mw-rc-openarrow { |
38 | 38 | visibility: hidden; |
39 | 39 | } |