compass-jquery-plugin 0.3.0.beta.19 → 0.3.0.beta.20

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,190 +1,190 @@
1
- /* jQuery plugin themeswitcher
2
- ---------------------------------------------------------------------*/
3
- $.fn.themeswitcher = function(settings){
4
- var options = jQuery.extend({
5
- loadTheme: null,
6
- initialText: 'Switch Theme',
7
- width: 150,
8
- height: 200,
9
- buttonPreText: 'Theme: ',
10
- closeOnSelect: true,
11
- buttonHeight: 14,
12
- cookieName: 'jquery-ui-theme',
13
- onOpen: function(){},
14
- onClose: function(){},
15
- onSelect: function(){}
16
- }, settings);
17
-
18
- //markup
19
- var button = $('<a href="#" class="jquery-ui-themeswitcher-trigger"><span class="jquery-ui-themeswitcher-icon"></span><span class="jquery-ui-themeswitcher-title">'+ options.initialText +'</span></a>');
20
- var switcherpane = $('<div class="jquery-ui-themeswitcher"><div id="themeGallery"> <ul> <li><a href="compiled/jquery.ui/ui-lightness.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_ui_light.png" alt="UI Lightness" title="UI Lightness" /> <span class="themeName">UI lightness</span></a></li> <li><a href="compiled/jquery.ui/ui-darkness.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_ui_dark.png" alt="UI Darkness" title="UI Darkness" /> <span class="themeName">UI darkness</span> </a></li> <li><a href="compiled/jquery.ui/smoothness.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_smoothness.png" alt="Smoothness" title="Smoothness" /> <span class="themeName">Smoothness</span> </a></li> <li><a href="compiled/jquery.ui/start.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_start_menu.png" alt="Start" title="Start" /> <span class="themeName">Start</span></a></li></li> <li><a href="compiled/jquery.ui/redmond.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_windoze.png" alt="Redmond" title="Redmond" /> <span class="themeName">Redmond</span></a></li></li> <li><a href="compiled/jquery.ui/sunny.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_sunny.png" alt="Sunny" title="Sunny" /> <span class="themeName">Sunny</span></a></li></li> <li><a href="compiled/jquery.ui/overcast.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_overcast.png" alt="Overcast" title="Overcast" /> <span class="themeName">Overcast</span></a></li> <li><a href="compiled/jquery.ui/le-frog.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_le_frog.png" alt="Le Frog" title="Le Frog" /> <span class="themeName">Le Frog</span></a></li></li> <li><a href="compiled/jquery.ui/flick.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_flick.png" alt="Flick" title="Flick" /> <span class="themeName">Flick</span></a></li> <li><a href="compiled/jquery.ui/pepper-grinder.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_pepper_grinder.png" alt="Pepper Grinder" title="Pepper Grinder" /> <span class="themeName">Pepper Grinder</span></a></li> <li><a href="compiled/jquery.ui/eggplant.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_eggplant.png" alt="Eggplant" title="Eggplant" /> <span class="themeName">Eggplant</span></a></li> <li><a href="compiled/jquery.ui/dark-hive.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_dark_hive.png" alt="Dark Hive" title="Dark Hive" /> <span class="themeName">Dark Hive</span></a></li></li> <li><a href="compiled/jquery.ui/cupertino.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_cupertino.png" alt="Cupertino" title="Cupertino" /> <span class="themeName">Cupertino</span></a></li> <li><a href="compiled/jquery.ui/south-street.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_south_street.png" alt="South St" title="South St" /> <span class="themeName">South Street</span></a></li> <li><a href="compiled/jquery.ui/blitzer.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_blitzer.png" alt="Blitzer" title="Blitzer" /> <span class="themeName">Blitzer</span></a></li></li> <li><a href="compiled/jquery.ui/humanity.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_humanity.png" alt="Humanity" title="Humanity" /> <span class="themeName">Humanity</span></a></li></li> <li><a href="compiled/jquery.ui/hot-sneaks.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_hot_sneaks.png" alt="Hot Sneaks" title="Hot Sneaks" /> <span class="themeName">Hot sneaks</span></a></li></li> <li><a href="compiled/jquery.ui/excite-bike.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_excite_bike.png" alt="Excite Bike" title="Excite Bike" /> <span class="themeName">Excite Bike</span></a></li> <li><a href="compiled/jquery.ui/vader.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_black_matte.png" alt="Vader" title="Vader" /> <span class="themeName">Vader</span></a></li> <li><a href="compiled/jquery.ui/dot-luv.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_dot_luv.png" alt="Dot Luv" title="Dot Luv" /> <span class="themeName">Dot Luv</span></a></li> <li><a href="compiled/jquery.ui/mint-choc.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_mint_choco.png" alt="Mint Choc" title="Mint Choc" /> <span class="themeName">Mint Choc</span></a></li></li> <li><a href="compiled/jquery.ui/black-tie.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_black_tie.png" alt="Black Tie" title="Black Tie" /> <span class="themeName">Black Tie</span></a></li></li> <li><a href="compiled/jquery.ui/trontastic.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_trontastic.png" alt="Trontastic" title="Trontastic" /><span class="themeName">Trontastic</span></a></li> <li><a href="compiled/jquery.ui/swanky-purse.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_swanky_purse.png" alt="Swanky Purse" title="Swanky Purse" /> <span class="themeName">Swanky Purse</span></a></li></ul></div></div>').find('div').removeAttr('id');
21
- //button events
22
- button.click(
23
- function(){
24
- if(switcherpane.is(':visible')){ switcherpane.spHide(); }
25
- else{ switcherpane.spShow(); }
26
- return false;
27
- }
28
- );
29
-
30
- //menu events (mouseout didn't work...)
31
- switcherpane.hover(
32
- function(){},
33
- function(){if(switcherpane.is(':visible')){$(this).spHide();}}
34
- );
35
-
36
- //show/hide panel functions
37
- $.fn.spShow = function(){ $(this).css({top: button.offset().top + options.buttonHeight + 6, left: button.offset().left}).slideDown(50); button.css(button_active); options.onOpen(); }
38
- $.fn.spHide = function(){ $(this).slideUp(50, function(){options.onClose();}); button.css(button_default); }
39
-
40
-
41
- /* Theme Loading
42
- ---------------------------------------------------------------------*/
43
- switcherpane.find('a').click(function(){
44
- updateCSS( $(this).attr('href') );
45
- var themeName = $(this).find('span').text();
46
- button.find('.jquery-ui-themeswitcher-title').text( options.buttonPreText + themeName );
47
- $.cookie(options.cookieName, themeName);
48
- options.onSelect();
49
- if(options.closeOnSelect && switcherpane.is(':visible')){ switcherpane.spHide(); }
50
- return false;
51
- });
52
-
53
- //function to append a new theme stylesheet with the new style changes
54
- function updateCSS(locStr){
55
- var cssLink = $('<link href="/stylesheets/'+locStr+'" type="text/css" rel="Stylesheet" class="ui-theme" />');
56
- $("head").append(cssLink);
57
-
58
-
59
- if( $("link.ui-theme").size() > 3){
60
- $("link.ui-theme:first").remove();
61
- }
62
- }
63
-
64
- /* Inline CSS
65
- ---------------------------------------------------------------------*/
66
- var button_default = {
67
- fontFamily: 'Trebuchet MS, Verdana, sans-serif',
68
- fontSize: '11px',
69
- color: '#666',
70
- background: '#eee image_url("jquery.ui/themeSwitcher/buttonbg.png") 50% 50% repeat-x',
71
- border: '1px solid #ccc',
72
- '-moz-border-radius': '6px',
73
- '-webkit-border-radius': '6px',
74
- textDecoration: 'none',
75
- padding: '3px 3px 3px 8px',
76
- width: options.width - 11,//minus must match left and right padding
77
- display: 'block',
78
- height: options.buttonHeight,
79
- outline: '0'
80
- };
81
- var button_hover = {
82
- 'borderColor':'#bbb',
83
- 'background': '#f0f0f0',
84
- cursor: 'pointer',
85
- color: '#444'
86
- };
87
- var button_active = {
88
- color: '#aaa',
89
- background: '#000',
90
- border: '1px solid #ccc',
91
- borderBottom: 0,
92
- '-moz-border-radius-bottomleft': 0,
93
- '-webkit-border-bottom-left-radius': 0,
94
- '-moz-border-radius-bottomright': 0,
95
- '-webkit-border-bottom-right-radius': 0,
96
- outline: '0'
97
- };
98
-
99
- //button css
100
- button.css(button_default)
101
- .hover(
102
- function(){
103
- $(this).css(button_hover);
104
- },
105
- function(){
106
- if( !switcherpane.is(':animated') && switcherpane.is(':hidden') ){ $(this).css(button_default); }
107
- }
108
- )
109
- .find('.jquery-ui-themeswitcher-icon').css({
110
- 'float': 'right',
111
- width: '16px',
112
- height: '16px',
113
- background: 'image_url("jquery.ui/themeSwitcher/icon_color_arrow.gif") 50% 50% no-repeat'
114
- });
115
- //pane css
116
- switcherpane.css({
117
- position: 'absolute',
118
- 'float': 'left',
119
- fontFamily: 'Trebuchet MS, Verdana, sans-serif',
120
- fontSize: '12px',
121
- background: '#000',
122
- color: '#fff',
123
- padding: '8px 3px 3px',
124
- border: '1px solid #ccc',
125
- '-moz-border-radius-bottomleft': '6px',
126
- '-webkit-border-bottom-left-radius': '6px',
127
- '-moz-border-radius-bottomright': '6px',
128
- '-webkit-border-bottom-right-radius': '6px',
129
- borderTop: 0,
130
- zIndex: 999999,
131
- width: options.width-6//minus must match left and right padding
132
- })
133
- .find('ul').css({
134
- listStyle: 'none',
135
- margin: '0',
136
- padding: '0',
137
- overflow: 'auto',
138
- height: options.height
139
- }).end()
140
- .find('li').hover(
141
- function(){
142
- $(this).css({
143
- 'borderColor':'#555',
144
- 'background': 'image_url("jquery.ui/themeSwitcher/menuhoverbg.png") 50% 50% repeat-x',
145
- cursor: 'pointer'
146
- });
147
- },
148
- function(){
149
- $(this).css({
150
- 'borderColor':'#111',
151
- 'background': '#000',
152
- cursor: 'auto'
153
- });
154
- }
155
- ).css({
156
- width: options.width-30,
157
- height: '',
158
- padding: '2px',
159
- margin: '1px',
160
- border: '1px solid #111',
161
- '-moz-border-radius': '4px',
162
- clear: 'left',
163
- 'float': 'left'
164
- }).end()
165
- .find('a').css({
166
- color: '#aaa',
167
- textDecoration: 'none',
168
- 'float': 'left',
169
- width: '100%',
170
- outline: '0'
171
- }).end()
172
- .find('img').css({
173
- 'float': 'left',
174
- border: '1px solid #333',
175
- margin: '0 2px'
176
- }).end()
177
- .find('.themeName').css({
178
- 'float': 'left',
179
- margin: '3px 0'
180
- }).end();
181
-
182
- $(this).append(button);
183
- $('body').append(switcherpane);
184
- switcherpane.hide();
185
- if( $.cookie(options.cookieName) || options.loadTheme ){
186
- var themeName = $.cookie(options.cookieName) || options.loadTheme;
187
- switcherpane.find('a:contains('+ themeName +')').trigger('click');
188
- }
189
- return this;
190
- };
1
+ /* jQuery plugin themeswitcher
2
+ ---------------------------------------------------------------------*/
3
+ $.fn.themeswitcher = function(settings){
4
+ var options = jQuery.extend({
5
+ loadTheme: null,
6
+ initialText: 'Switch Theme',
7
+ width: 150,
8
+ height: 400,
9
+ buttonPreText: 'Theme: ',
10
+ closeOnSelect: true,
11
+ buttonHeight: 14,
12
+ cookieName: 'jquery-ui-theme',
13
+ onOpen: function(){},
14
+ onClose: function(){},
15
+ onSelect: function(){}
16
+ }, settings);
17
+
18
+ //markup
19
+ var button = $('<a href="#" class="jquery-ui-themeswitcher-trigger"><span class="jquery-ui-themeswitcher-icon"></span><span class="jquery-ui-themeswitcher-title">'+ options.initialText +'</span></a>');
20
+ var switcherpane = $('<div class="jquery-ui-themeswitcher"><div id="themeGallery"> <ul> <li><a href="compiled/jquery.ui/ui-lightness.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_ui_light.png" alt="UI Lightness" title="UI Lightness" /> <span class="themeName">UI lightness</span></a></li> <li><a href="compiled/jquery.ui/ui-darkness.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_ui_dark.png" alt="UI Darkness" title="UI Darkness" /> <span class="themeName">UI darkness</span> </a></li> <li><a href="compiled/jquery.ui/smoothness.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_smoothness.png" alt="Smoothness" title="Smoothness" /> <span class="themeName">Smoothness</span> </a></li> <li><a href="compiled/jquery.ui/start.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_start_menu.png" alt="Start" title="Start" /> <span class="themeName">Start</span></a></li></li> <li><a href="compiled/jquery.ui/redmond.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_windoze.png" alt="Redmond" title="Redmond" /> <span class="themeName">Redmond</span></a></li></li> <li><a href="compiled/jquery.ui/sunny.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_sunny.png" alt="Sunny" title="Sunny" /> <span class="themeName">Sunny</span></a></li></li> <li><a href="compiled/jquery.ui/overcast.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_overcast.png" alt="Overcast" title="Overcast" /> <span class="themeName">Overcast</span></a></li> <li><a href="compiled/jquery.ui/le-frog.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_le_frog.png" alt="Le Frog" title="Le Frog" /> <span class="themeName">Le Frog</span></a></li></li> <li><a href="compiled/jquery.ui/flick.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_flick.png" alt="Flick" title="Flick" /> <span class="themeName">Flick</span></a></li> <li><a href="compiled/jquery.ui/pepper-grinder.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_pepper_grinder.png" alt="Pepper Grinder" title="Pepper Grinder" /> <span class="themeName">Pepper Grinder</span></a></li> <li><a href="compiled/jquery.ui/eggplant.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_eggplant.png" alt="Eggplant" title="Eggplant" /> <span class="themeName">Eggplant</span></a></li> <li><a href="compiled/jquery.ui/dark-hive.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_dark_hive.png" alt="Dark Hive" title="Dark Hive" /> <span class="themeName">Dark Hive</span></a></li></li> <li><a href="compiled/jquery.ui/cupertino.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_cupertino.png" alt="Cupertino" title="Cupertino" /> <span class="themeName">Cupertino</span></a></li> <li><a href="compiled/jquery.ui/south-street.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_south_street.png" alt="South St" title="South St" /> <span class="themeName">South Street</span></a></li> <li><a href="compiled/jquery.ui/blitzer.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_blitzer.png" alt="Blitzer" title="Blitzer" /> <span class="themeName">Blitzer</span></a></li></li> <li><a href="compiled/jquery.ui/humanity.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_humanity.png" alt="Humanity" title="Humanity" /> <span class="themeName">Humanity</span></a></li></li> <li><a href="compiled/jquery.ui/hot-sneaks.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_hot_sneaks.png" alt="Hot Sneaks" title="Hot Sneaks" /> <span class="themeName">Hot sneaks</span></a></li></li> <li><a href="compiled/jquery.ui/excite-bike.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_excite_bike.png" alt="Excite Bike" title="Excite Bike" /> <span class="themeName">Excite Bike</span></a></li> <li><a href="compiled/jquery.ui/vader.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_black_matte.png" alt="Vader" title="Vader" /> <span class="themeName">Vader</span></a></li> <li><a href="compiled/jquery.ui/dot-luv.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_dot_luv.png" alt="Dot Luv" title="Dot Luv" /> <span class="themeName">Dot Luv</span></a></li> <li><a href="compiled/jquery.ui/mint-choc.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_mint_choco.png" alt="Mint Choc" title="Mint Choc" /> <span class="themeName">Mint Choc</span></a></li></li> <li><a href="compiled/jquery.ui/black-tie.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_black_tie.png" alt="Black Tie" title="Black Tie" /> <span class="themeName">Black Tie</span></a></li></li> <li><a href="compiled/jquery.ui/trontastic.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_trontastic.png" alt="Trontastic" title="Trontastic" /><span class="themeName">Trontastic</span></a></li> <li><a href="compiled/jquery.ui/swanky-purse.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_swanky_purse.png" alt="Swanky Purse" title="Swanky Purse" /> <span class="themeName">Swanky Purse</span></a></li></ul></div></div>').find('div').removeAttr('id');
21
+ //button events
22
+ button.click(
23
+ function(){
24
+ if(switcherpane.is(':visible')){ switcherpane.spHide(); }
25
+ else{ switcherpane.spShow(); }
26
+ return false;
27
+ }
28
+ );
29
+
30
+ //menu events (mouseout didn't work...)
31
+ switcherpane.hover(
32
+ function(){},
33
+ function(){if(switcherpane.is(':visible')){$(this).spHide();}}
34
+ );
35
+
36
+ //show/hide panel functions
37
+ $.fn.spShow = function(){ $(this).css({top: button.offset().top + options.buttonHeight + 6, left: button.offset().left}).slideDown(50); button.css(button_active); options.onOpen(); }
38
+ $.fn.spHide = function(){ $(this).slideUp(50, function(){options.onClose();}); button.css(button_default); }
39
+
40
+
41
+ /* Theme Loading
42
+ ---------------------------------------------------------------------*/
43
+ switcherpane.find('a').click(function(){
44
+ updateCSS( $(this).attr('href') );
45
+ var themeName = $(this).find('span').text();
46
+ button.find('.jquery-ui-themeswitcher-title').text( options.buttonPreText + themeName );
47
+ $.cookie(options.cookieName, themeName);
48
+ options.onSelect();
49
+ if(options.closeOnSelect && switcherpane.is(':visible')){ switcherpane.spHide(); }
50
+ return false;
51
+ });
52
+
53
+ //function to append a new theme stylesheet with the new style changes
54
+ function updateCSS(locStr){
55
+ var cssLink = $('<link href="/stylesheets/'+locStr+'" type="text/css" rel="Stylesheet" class="ui-theme" />');
56
+ $("head").append(cssLink);
57
+
58
+
59
+ if( $("link.ui-theme").size() > 3){
60
+ $("link.ui-theme:first").remove();
61
+ }
62
+ }
63
+
64
+ /* Inline CSS
65
+ ---------------------------------------------------------------------*/
66
+ var button_default = {
67
+ fontFamily: 'Trebuchet MS, Verdana, sans-serif',
68
+ fontSize: '11px',
69
+ color: '#666',
70
+ background: '#eee image_url("jquery.ui/themeSwitcher/buttonbg.png") 50% 50% repeat-x',
71
+ border: '1px solid #ccc',
72
+ '-moz-border-radius': '6px',
73
+ '-webkit-border-radius': '6px',
74
+ textDecoration: 'none',
75
+ padding: '3px 3px 3px 8px',
76
+ width: options.width - 11,//minus must match left and right padding
77
+ display: 'block',
78
+ height: options.buttonHeight,
79
+ outline: '0'
80
+ };
81
+ var button_hover = {
82
+ 'borderColor':'#bbb',
83
+ 'background': '#f0f0f0',
84
+ cursor: 'pointer',
85
+ color: '#444'
86
+ };
87
+ var button_active = {
88
+ color: '#aaa',
89
+ background: '#000',
90
+ border: '1px solid #ccc',
91
+ borderBottom: 0,
92
+ '-moz-border-radius-bottomleft': 0,
93
+ '-webkit-border-bottom-left-radius': 0,
94
+ '-moz-border-radius-bottomright': 0,
95
+ '-webkit-border-bottom-right-radius': 0,
96
+ outline: '0'
97
+ };
98
+
99
+ //button css
100
+ button.css(button_default)
101
+ .hover(
102
+ function(){
103
+ $(this).css(button_hover);
104
+ },
105
+ function(){
106
+ if( !switcherpane.is(':animated') && switcherpane.is(':hidden') ){ $(this).css(button_default); }
107
+ }
108
+ )
109
+ .find('.jquery-ui-themeswitcher-icon').css({
110
+ 'float': 'right',
111
+ width: '16px',
112
+ height: '16px',
113
+ background: 'image_url("jquery.ui/themeSwitcher/icon_color_arrow.gif") 50% 50% no-repeat'
114
+ });
115
+ //pane css
116
+ switcherpane.css({
117
+ position: 'absolute',
118
+ 'float': 'left',
119
+ fontFamily: 'Trebuchet MS, Verdana, sans-serif',
120
+ fontSize: '12px',
121
+ background: '#000',
122
+ color: '#fff',
123
+ padding: '8px 3px 3px',
124
+ border: '1px solid #ccc',
125
+ '-moz-border-radius-bottomleft': '6px',
126
+ '-webkit-border-bottom-left-radius': '6px',
127
+ '-moz-border-radius-bottomright': '6px',
128
+ '-webkit-border-bottom-right-radius': '6px',
129
+ borderTop: 0,
130
+ zIndex: 999999,
131
+ width: options.width-6//minus must match left and right padding
132
+ })
133
+ .find('ul').css({
134
+ listStyle: 'none',
135
+ margin: '0',
136
+ padding: '0',
137
+ overflow: 'auto',
138
+ height: options.height
139
+ }).end()
140
+ .find('li').hover(
141
+ function(){
142
+ $(this).css({
143
+ 'borderColor':'#555',
144
+ 'background': 'image_url("jquery.ui/themeSwitcher/menuhoverbg.png") 50% 50% repeat-x',
145
+ cursor: 'pointer'
146
+ });
147
+ },
148
+ function(){
149
+ $(this).css({
150
+ 'borderColor':'#111',
151
+ 'background': '#000',
152
+ cursor: 'auto'
153
+ });
154
+ }
155
+ ).css({
156
+ width: options.width-30,
157
+ height: '',
158
+ padding: '2px',
159
+ margin: '1px',
160
+ border: '1px solid #111',
161
+ '-moz-border-radius': '4px',
162
+ clear: 'left',
163
+ 'float': 'left'
164
+ }).end()
165
+ .find('a').css({
166
+ color: '#aaa',
167
+ textDecoration: 'none',
168
+ 'float': 'left',
169
+ width: '100%',
170
+ outline: '0'
171
+ }).end()
172
+ .find('img').css({
173
+ 'float': 'left',
174
+ border: '1px solid #333',
175
+ margin: '0 2px'
176
+ }).end()
177
+ .find('.themeName').css({
178
+ 'float': 'left',
179
+ margin: '3px 0'
180
+ }).end();
181
+
182
+ $(this).append(button);
183
+ $('body').append(switcherpane);
184
+ switcherpane.hide();
185
+ if( $.cookie(options.cookieName) || options.loadTheme ){
186
+ var themeName = $.cookie(options.cookieName) || options.loadTheme;
187
+ switcherpane.find('a:contains('+ themeName +')').trigger('click');
188
+ }
189
+ return this;
190
+ };
@@ -1,7 +1,7 @@
1
- $.fn.themeswitcher=function(e){var a=jQuery.extend({loadTheme:null,initialText:"Switch Theme",width:150,height:200,buttonPreText:"Theme: ",closeOnSelect:true,buttonHeight:14,cookieName:"jquery-ui-theme",onOpen:function(){},onClose:function(){},onSelect:function(){}},e),c=$('<a href="#" class="jquery-ui-themeswitcher-trigger"><span class="jquery-ui-themeswitcher-icon"></span><span class="jquery-ui-themeswitcher-title">'+a.initialText+"</span></a>"),b=$('<div class="jquery-ui-themeswitcher"><div id="themeGallery"> <ul> <li><a href="compiled/jquery.ui/ui-lightness.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_ui_light.png" alt="UI Lightness" title="UI Lightness" /> <span class="themeName">UI lightness</span></a></li> <li><a href="compiled/jquery.ui/ui-darkness.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_ui_dark.png" alt="UI Darkness" title="UI Darkness" /> <span class="themeName">UI darkness</span> </a></li> <li><a href="compiled/jquery.ui/smoothness.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_smoothness.png" alt="Smoothness" title="Smoothness" /> <span class="themeName">Smoothness</span> </a></li> <li><a href="compiled/jquery.ui/start.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_start_menu.png" alt="Start" title="Start" /> <span class="themeName">Start</span></a></li></li> <li><a href="compiled/jquery.ui/redmond.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_windoze.png" alt="Redmond" title="Redmond" /> <span class="themeName">Redmond</span></a></li></li> <li><a href="compiled/jquery.ui/sunny.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_sunny.png" alt="Sunny" title="Sunny" /> <span class="themeName">Sunny</span></a></li></li> <li><a href="compiled/jquery.ui/overcast.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_overcast.png" alt="Overcast" title="Overcast" /> <span class="themeName">Overcast</span></a></li> <li><a href="compiled/jquery.ui/le-frog.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_le_frog.png" alt="Le Frog" title="Le Frog" /> <span class="themeName">Le Frog</span></a></li></li> <li><a href="compiled/jquery.ui/flick.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_flick.png" alt="Flick" title="Flick" /> <span class="themeName">Flick</span></a></li> <li><a href="compiled/jquery.ui/pepper-grinder.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_pepper_grinder.png" alt="Pepper Grinder" title="Pepper Grinder" /> <span class="themeName">Pepper Grinder</span></a></li> <li><a href="compiled/jquery.ui/eggplant.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_eggplant.png" alt="Eggplant" title="Eggplant" /> <span class="themeName">Eggplant</span></a></li> <li><a href="compiled/jquery.ui/dark-hive.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_dark_hive.png" alt="Dark Hive" title="Dark Hive" /> <span class="themeName">Dark Hive</span></a></li></li> <li><a href="compiled/jquery.ui/cupertino.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_cupertino.png" alt="Cupertino" title="Cupertino" /> <span class="themeName">Cupertino</span></a></li> <li><a href="compiled/jquery.ui/south-street.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_south_street.png" alt="South St" title="South St" /> <span class="themeName">South Street</span></a></li> <li><a href="compiled/jquery.ui/blitzer.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_blitzer.png" alt="Blitzer" title="Blitzer" /> <span class="themeName">Blitzer</span></a></li></li> <li><a href="compiled/jquery.ui/humanity.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_humanity.png" alt="Humanity" title="Humanity" /> <span class="themeName">Humanity</span></a></li></li> <li><a href="compiled/jquery.ui/hot-sneaks.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_hot_sneaks.png" alt="Hot Sneaks" title="Hot Sneaks" /> <span class="themeName">Hot sneaks</span></a></li></li> <li><a href="compiled/jquery.ui/excite-bike.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_excite_bike.png" alt="Excite Bike" title="Excite Bike" /> <span class="themeName">Excite Bike</span></a></li> <li><a href="compiled/jquery.ui/vader.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_black_matte.png" alt="Vader" title="Vader" /> <span class="themeName">Vader</span></a></li> <li><a href="compiled/jquery.ui/dot-luv.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_dot_luv.png" alt="Dot Luv" title="Dot Luv" /> <span class="themeName">Dot Luv</span></a></li> <li><a href="compiled/jquery.ui/mint-choc.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_mint_choco.png" alt="Mint Choc" title="Mint Choc" /> <span class="themeName">Mint Choc</span></a></li></li> <li><a href="compiled/jquery.ui/black-tie.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_black_tie.png" alt="Black Tie" title="Black Tie" /> <span class="themeName">Black Tie</span></a></li></li> <li><a href="compiled/jquery.ui/trontastic.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_trontastic.png" alt="Trontastic" title="Trontastic" /><span class="themeName">Trontastic</span></a></li> <li><a href="compiled/jquery.ui/swanky-purse.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_swanky_purse.png" alt="Swanky Purse" title="Swanky Purse" /> <span class="themeName">Swanky Purse</span></a></li></ul></div></div>').find("div").removeAttr("id");
2
- c.click(function(){b.is(":visible")?b.spHide():b.spShow();return false});b.hover(function(){},function(){b.is(":visible")&&$(this).spHide()});$.fn.spShow=function(){$(this).css({top:c.offset().top+a.buttonHeight+6,left:c.offset().left}).slideDown(50);c.css(g);a.onOpen()};$.fn.spHide=function(){$(this).slideUp(50,function(){a.onClose()});c.css(f)};b.find("a").click(function(){var d=$(this).attr("href");d=$('<link href="/stylesheets/'+d+'" type="text/css" rel="Stylesheet" class="ui-theme" />');$("head").append(d);
3
- $("link.ui-theme").size()>3&&$("link.ui-theme:first").remove();d=$(this).find("span").text();c.find(".jquery-ui-themeswitcher-title").text(a.buttonPreText+d);$.cookie(a.cookieName,d);a.onSelect();a.closeOnSelect&&b.is(":visible")&&b.spHide();return false});var f={fontFamily:"Trebuchet MS, Verdana, sans-serif",fontSize:"11px",color:"#666",background:'#eee image_url("jquery.ui/themeSwitcher/buttonbg.png") 50% 50% repeat-x',border:"1px solid #ccc","-moz-border-radius":"6px","-webkit-border-radius":"6px",
4
- textDecoration:"none",padding:"3px 3px 3px 8px",width:a.width-11,display:"block",height:a.buttonHeight,outline:"0"},h={borderColor:"#bbb",background:"#f0f0f0",cursor:"pointer",color:"#444"},g={color:"#aaa",background:"#000",border:"1px solid #ccc",borderBottom:0,"-moz-border-radius-bottomleft":0,"-webkit-border-bottom-left-radius":0,"-moz-border-radius-bottomright":0,"-webkit-border-bottom-right-radius":0,outline:"0"};c.css(f).hover(function(){$(this).css(h)},function(){!b.is(":animated")&&b.is(":hidden")&&
5
- $(this).css(f)}).find(".jquery-ui-themeswitcher-icon").css({"float":"right",width:"16px",height:"16px",background:'image_url("jquery.ui/themeSwitcher/icon_color_arrow.gif") 50% 50% no-repeat'});b.css({position:"absolute","float":"left",fontFamily:"Trebuchet MS, Verdana, sans-serif",fontSize:"12px",background:"#000",color:"#fff",padding:"8px 3px 3px",border:"1px solid #ccc","-moz-border-radius-bottomleft":"6px","-webkit-border-bottom-left-radius":"6px","-moz-border-radius-bottomright":"6px","-webkit-border-bottom-right-radius":"6px",
6
- borderTop:0,zIndex:999999,width:a.width-6}).find("ul").css({listStyle:"none",margin:"0",padding:"0",overflow:"auto",height:a.height}).end().find("li").hover(function(){$(this).css({borderColor:"#555",background:'image_url("jquery.ui/themeSwitcher/menuhoverbg.png") 50% 50% repeat-x',cursor:"pointer"})},function(){$(this).css({borderColor:"#111",background:"#000",cursor:"auto"})}).css({width:a.width-30,height:"",padding:"2px",margin:"1px",border:"1px solid #111","-moz-border-radius":"4px",clear:"left",
7
- "float":"left"}).end().find("a").css({color:"#aaa",textDecoration:"none","float":"left",width:"100%",outline:"0"}).end().find("img").css({"float":"left",border:"1px solid #333",margin:"0 2px"}).end().find(".themeName").css({"float":"left",margin:"3px 0"}).end();$(this).append(c);$("body").append(b);b.hide();if($.cookie(a.cookieName)||a.loadTheme){e=$.cookie(a.cookieName)||a.loadTheme;b.find("a:contains("+e+")").trigger("click")}return this};
1
+ $.fn.themeswitcher=function(e){var a=jQuery.extend({loadTheme:null,initialText:"Switch Theme",width:150,height:400,buttonPreText:"Theme: ",closeOnSelect:true,buttonHeight:14,cookieName:"jquery-ui-theme",onOpen:function(){},onClose:function(){},onSelect:function(){}},e),c=$('<a href="#" class="jquery-ui-themeswitcher-trigger"><span class="jquery-ui-themeswitcher-icon"></span><span class="jquery-ui-themeswitcher-title">'+a.initialText+"</span></a>"),b=$('<div class="jquery-ui-themeswitcher"><div id="themeGallery"> <ul> <li><a href="compiled/jquery.ui/ui-lightness.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_ui_light.png" alt="UI Lightness" title="UI Lightness" /> <span class="themeName">UI lightness</span></a></li> <li><a href="compiled/jquery.ui/ui-darkness.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_ui_dark.png" alt="UI Darkness" title="UI Darkness" /> <span class="themeName">UI darkness</span> </a></li> <li><a href="compiled/jquery.ui/smoothness.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_smoothness.png" alt="Smoothness" title="Smoothness" /> <span class="themeName">Smoothness</span> </a></li> <li><a href="compiled/jquery.ui/start.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_start_menu.png" alt="Start" title="Start" /> <span class="themeName">Start</span></a></li></li> <li><a href="compiled/jquery.ui/redmond.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_windoze.png" alt="Redmond" title="Redmond" /> <span class="themeName">Redmond</span></a></li></li> <li><a href="compiled/jquery.ui/sunny.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_sunny.png" alt="Sunny" title="Sunny" /> <span class="themeName">Sunny</span></a></li></li> <li><a href="compiled/jquery.ui/overcast.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_overcast.png" alt="Overcast" title="Overcast" /> <span class="themeName">Overcast</span></a></li> <li><a href="compiled/jquery.ui/le-frog.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_le_frog.png" alt="Le Frog" title="Le Frog" /> <span class="themeName">Le Frog</span></a></li></li> <li><a href="compiled/jquery.ui/flick.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_flick.png" alt="Flick" title="Flick" /> <span class="themeName">Flick</span></a></li> <li><a href="compiled/jquery.ui/pepper-grinder.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_pepper_grinder.png" alt="Pepper Grinder" title="Pepper Grinder" /> <span class="themeName">Pepper Grinder</span></a></li> <li><a href="compiled/jquery.ui/eggplant.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_eggplant.png" alt="Eggplant" title="Eggplant" /> <span class="themeName">Eggplant</span></a></li> <li><a href="compiled/jquery.ui/dark-hive.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_dark_hive.png" alt="Dark Hive" title="Dark Hive" /> <span class="themeName">Dark Hive</span></a></li></li> <li><a href="compiled/jquery.ui/cupertino.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_cupertino.png" alt="Cupertino" title="Cupertino" /> <span class="themeName">Cupertino</span></a></li> <li><a href="compiled/jquery.ui/south-street.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_south_street.png" alt="South St" title="South St" /> <span class="themeName">South Street</span></a></li> <li><a href="compiled/jquery.ui/blitzer.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_blitzer.png" alt="Blitzer" title="Blitzer" /> <span class="themeName">Blitzer</span></a></li></li> <li><a href="compiled/jquery.ui/humanity.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_humanity.png" alt="Humanity" title="Humanity" /> <span class="themeName">Humanity</span></a></li></li> <li><a href="compiled/jquery.ui/hot-sneaks.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_hot_sneaks.png" alt="Hot Sneaks" title="Hot Sneaks" /> <span class="themeName">Hot sneaks</span></a></li></li> <li><a href="compiled/jquery.ui/excite-bike.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_excite_bike.png" alt="Excite Bike" title="Excite Bike" /> <span class="themeName">Excite Bike</span></a></li> <li><a href="compiled/jquery.ui/vader.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_black_matte.png" alt="Vader" title="Vader" /> <span class="themeName">Vader</span></a></li> <li><a href="compiled/jquery.ui/dot-luv.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_dot_luv.png" alt="Dot Luv" title="Dot Luv" /> <span class="themeName">Dot Luv</span></a></li> <li><a href="compiled/jquery.ui/mint-choc.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_mint_choco.png" alt="Mint Choc" title="Mint Choc" /> <span class="themeName">Mint Choc</span></a></li></li> <li><a href="compiled/jquery.ui/black-tie.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_black_tie.png" alt="Black Tie" title="Black Tie" /> <span class="themeName">Black Tie</span></a></li></li> <li><a href="compiled/jquery.ui/trontastic.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_trontastic.png" alt="Trontastic" title="Trontastic" /><span class="themeName">Trontastic</span></a></li> <li><a href="compiled/jquery.ui/swanky-purse.css"> <img src="/images/jquery.ui/themeSwitcher/theme_90_swanky_purse.png" alt="Swanky Purse" title="Swanky Purse" /> <span class="themeName">Swanky Purse</span></a></li></ul></div></div>').find("div").removeAttr("id");
2
+ c.click(function(){b.is(":visible")?b.spHide():b.spShow();return false});b.hover(function(){},function(){b.is(":visible")&&$(this).spHide()});$.fn.spShow=function(){$(this).css({top:c.offset().top+a.buttonHeight+6,left:c.offset().left}).slideDown(50);c.css(g);a.onOpen()};$.fn.spHide=function(){$(this).slideUp(50,function(){a.onClose()});c.css(f)};b.find("a").click(function(){var d=$(this).attr("href");d=$('<link href="/stylesheets/'+d+'" type="text/css" rel="Stylesheet" class="ui-theme" />');$("head").append(d);
3
+ $("link.ui-theme").size()>3&&$("link.ui-theme:first").remove();d=$(this).find("span").text();c.find(".jquery-ui-themeswitcher-title").text(a.buttonPreText+d);$.cookie(a.cookieName,d);a.onSelect();a.closeOnSelect&&b.is(":visible")&&b.spHide();return false});var f={fontFamily:"Trebuchet MS, Verdana, sans-serif",fontSize:"11px",color:"#666",background:'#eee image_url("jquery.ui/themeSwitcher/buttonbg.png") 50% 50% repeat-x',border:"1px solid #ccc","-moz-border-radius":"6px","-webkit-border-radius":"6px",
4
+ textDecoration:"none",padding:"3px 3px 3px 8px",width:a.width-11,display:"block",height:a.buttonHeight,outline:"0"},h={borderColor:"#bbb",background:"#f0f0f0",cursor:"pointer",color:"#444"},g={color:"#aaa",background:"#000",border:"1px solid #ccc",borderBottom:0,"-moz-border-radius-bottomleft":0,"-webkit-border-bottom-left-radius":0,"-moz-border-radius-bottomright":0,"-webkit-border-bottom-right-radius":0,outline:"0"};c.css(f).hover(function(){$(this).css(h)},function(){!b.is(":animated")&&b.is(":hidden")&&
5
+ $(this).css(f)}).find(".jquery-ui-themeswitcher-icon").css({"float":"right",width:"16px",height:"16px",background:'image_url("jquery.ui/themeSwitcher/icon_color_arrow.gif") 50% 50% no-repeat'});b.css({position:"absolute","float":"left",fontFamily:"Trebuchet MS, Verdana, sans-serif",fontSize:"12px",background:"#000",color:"#fff",padding:"8px 3px 3px",border:"1px solid #ccc","-moz-border-radius-bottomleft":"6px","-webkit-border-bottom-left-radius":"6px","-moz-border-radius-bottomright":"6px","-webkit-border-bottom-right-radius":"6px",
6
+ borderTop:0,zIndex:999999,width:a.width-6}).find("ul").css({listStyle:"none",margin:"0",padding:"0",overflow:"auto",height:a.height}).end().find("li").hover(function(){$(this).css({borderColor:"#555",background:'image_url("jquery.ui/themeSwitcher/menuhoverbg.png") 50% 50% repeat-x',cursor:"pointer"})},function(){$(this).css({borderColor:"#111",background:"#000",cursor:"auto"})}).css({width:a.width-30,height:"",padding:"2px",margin:"1px",border:"1px solid #111","-moz-border-radius":"4px",clear:"left",
7
+ "float":"left"}).end().find("a").css({color:"#aaa",textDecoration:"none","float":"left",width:"100%",outline:"0"}).end().find("img").css({"float":"left",border:"1px solid #333",margin:"0 2px"}).end().find(".themeName").css({"float":"left",margin:"3px 0"}).end();$(this).append(c);$("body").append(b);b.hide();if($.cookie(a.cookieName)||a.loadTheme){e=$.cookie(a.cookieName)||a.loadTheme;b.find("a:contains("+e+")").trigger("click")}return this};