1 | (function (b)
|
---|
2 | {
|
---|
3 | b.fn.themeswitcher = function (c)
|
---|
4 | {
|
---|
5 | function d(f)
|
---|
6 | {
|
---|
7 | a.onselect !== null && a.onselect();
|
---|
8 | m.text(a.buttonpretext + " " + f.title);
|
---|
9 | var e = b("<link/>").attr("type", "text/css").attr("rel", "stylesheet");
|
---|
10 | if(f.url)
|
---|
11 | {
|
---|
12 | e.attr("href", f.url);
|
---|
13 | $.ajax({url:gs.xsltParams.library_name + "?a=g&rt=r&configChangeName=cssTheme&configChangeValue=" + f.url});
|
---|
14 | }
|
---|
15 | else
|
---|
16 | {
|
---|
17 | var themeUrl = "https://code.jquery.com/ui/" + a.jqueryuiversion + "/themes/" + f.name + "/theme.css";
|
---|
18 |
|
---|
19 | e.attr("href", themeUrl);
|
---|
20 | $.ajax({url: gs.xsltParams.library_name + "?a=g&rt=r&configChangeName=cssTheme&configChangeValue=" + themeUrl});
|
---|
21 | }
|
---|
22 | e.appendTo("head");
|
---|
23 | b.cookie(a.cookiename, f.name);
|
---|
24 | g.find(".jquery-ui-switcher-title").text(a.buttonpretext + " " + f.title);
|
---|
25 | a.closeonselect && h()
|
---|
26 | }
|
---|
27 |
|
---|
28 | function j(f)
|
---|
29 | {
|
---|
30 | var e = null;
|
---|
31 | b.each(l, function (n, i)
|
---|
32 | {
|
---|
33 | if (i.name.toLowerCase() === f.toLowerCase() || i.title.toLowerCase() === f.toLowerCase())
|
---|
34 | {
|
---|
35 | e = i;
|
---|
36 | return false
|
---|
37 | }
|
---|
38 | });
|
---|
39 | if (!e) return l[0];
|
---|
40 | return e
|
---|
41 | }
|
---|
42 |
|
---|
43 | function h()
|
---|
44 | {
|
---|
45 | a.onclose !== null && a.onclose();
|
---|
46 | g.find(".jquery-ui-switcher-list-hldr").slideUp("fast", function ()
|
---|
47 | {
|
---|
48 | g.find(".jquery-ui-switcher-link").css(
|
---|
49 | {
|
---|
50 | color: "#000",
|
---|
51 | background: "#fff"
|
---|
52 | })
|
---|
53 | })
|
---|
54 | }
|
---|
55 | var g = this,
|
---|
56 | o = {},
|
---|
57 | a = {
|
---|
58 | loadtheme: "",
|
---|
59 | height: 200,
|
---|
60 | width: 175,
|
---|
61 | rounded: true,
|
---|
62 | imgpath: "",
|
---|
63 | jqueryuiversion: "1.13.0",
|
---|
64 | initialtext: gs.text.pref.switch_theme,
|
---|
65 | buttonpretext: "Theme:",
|
---|
66 | closeonselect: true,
|
---|
67 | buttonheight: 14,
|
---|
68 | cookiename: "jquery-ui-theme",
|
---|
69 | themes: [],
|
---|
70 | additionalthemes: [],
|
---|
71 | onopen: null,
|
---|
72 | onclose: null,
|
---|
73 | onselect: null
|
---|
74 | };
|
---|
75 | if (c)
|
---|
76 | {
|
---|
77 | b.each(c, function (f, e)
|
---|
78 | {
|
---|
79 | o[f.toLowerCase()] = e
|
---|
80 | });
|
---|
81 | b.extend(a, o)
|
---|
82 | }
|
---|
83 | var l = a.themes.length ? a.themes : [
|
---|
84 | {
|
---|
85 | title: "Black Tie",
|
---|
86 | name: "black-tie",
|
---|
87 | icon: "theme_90_black_tie.png"
|
---|
88 | }, {
|
---|
89 | title: "Blitzer",
|
---|
90 | name: "blitzer",
|
---|
91 | icon: "theme_90_blitzer.png"
|
---|
92 | }, {
|
---|
93 | title: "Cupertino",
|
---|
94 | name: "cupertino",
|
---|
95 | icon: "theme_90_cupertino.png"
|
---|
96 | }, {
|
---|
97 | title: "Dark Hive",
|
---|
98 | name: "dark-hive",
|
---|
99 | icon: "theme_90_dark_hive.png"
|
---|
100 | }, {
|
---|
101 | title: "Dot Luv",
|
---|
102 | name: "dot-luv",
|
---|
103 | icon: "theme_90_dot_luv.png"
|
---|
104 | }, {
|
---|
105 | title: "Eggplant",
|
---|
106 | name: "eggplant",
|
---|
107 | icon: "theme_90_eggplant.png"
|
---|
108 | }, {
|
---|
109 | title: "Excite Bike",
|
---|
110 | name: "excite-bike",
|
---|
111 | icon: "theme_90_excite_bike.png"
|
---|
112 | }, {
|
---|
113 | title: "Flick",
|
---|
114 | name: "flick",
|
---|
115 | icon: "theme_90_flick.png"
|
---|
116 | }, {
|
---|
117 | title: "Hot Sneaks",
|
---|
118 | name: "hot-sneaks",
|
---|
119 | icon: "theme_90_hot_sneaks.png"
|
---|
120 | }, {
|
---|
121 | title: "Humanity",
|
---|
122 | name: "humanity",
|
---|
123 | icon: "theme_90_humanity.png"
|
---|
124 | }, {
|
---|
125 | title: "Le Frog",
|
---|
126 | name: "le-frog",
|
---|
127 | icon: "theme_90_le_frog.png"
|
---|
128 | }, {
|
---|
129 | title: "Mint Choc",
|
---|
130 | name: "mint-choc",
|
---|
131 | icon: "theme_90_mint_choco.png"
|
---|
132 | }, {
|
---|
133 | title: "Overcast",
|
---|
134 | name: "overcast",
|
---|
135 | icon: "theme_90_overcast.png"
|
---|
136 | }, {
|
---|
137 | title: "Pepper Grinder",
|
---|
138 | name: "pepper-grinder",
|
---|
139 | icon: "theme_90_pepper_grinder.png"
|
---|
140 | }, {
|
---|
141 | title: "Redmond",
|
---|
142 | name: "redmond",
|
---|
143 | icon: "theme_90_windoze.png"
|
---|
144 | }, {
|
---|
145 | title: "Smoothness",
|
---|
146 | name: "smoothness",
|
---|
147 | icon: "theme_90_smoothness.png"
|
---|
148 | }, {
|
---|
149 | title: "South Street",
|
---|
150 | name: "south-street",
|
---|
151 | icon: "theme_90_south_street.png"
|
---|
152 | }, {
|
---|
153 | title: "Start",
|
---|
154 | name: "start",
|
---|
155 | icon: "theme_90_start_menu.png"
|
---|
156 | }, {
|
---|
157 | title: "Sunny",
|
---|
158 | name: "sunny",
|
---|
159 | icon: "theme_90_sunny.png"
|
---|
160 | }, {
|
---|
161 | title: "Swanky Purse",
|
---|
162 | name: "swanky-purse",
|
---|
163 | icon: "theme_90_swanky_purse.png"
|
---|
164 | }, {
|
---|
165 | title: "Trontastic",
|
---|
166 | name: "trontastic",
|
---|
167 | icon: "theme_90_trontastic.png"
|
---|
168 | }, {
|
---|
169 | title: "UI Darkness",
|
---|
170 | name: "ui-darkness",
|
---|
171 | icon: "theme_90_ui_dark.png"
|
---|
172 | }, {
|
---|
173 | title: "UI Lightness",
|
---|
174 | name: "ui-lightness",
|
---|
175 | icon: "theme_90_ui_light.png"
|
---|
176 | }, {
|
---|
177 | title: "Vader",
|
---|
178 | name: "vader",
|
---|
179 | icon: "theme_90_black_matte.png"
|
---|
180 | }];
|
---|
181 | a.additionalthemes.length && b.extend(l, a.additionalthemes);
|
---|
182 | c = {
|
---|
183 | cursor: "pointer",
|
---|
184 | "font-family": "'Trebuchet MS', Verdana, sans-serif",
|
---|
185 | "font-size": "11px",
|
---|
186 | color: "#000",
|
---|
187 | background: "#fff",
|
---|
188 | border: "1px solid #CCC",
|
---|
189 | "text-decoration": "none",
|
---|
190 | padding: "3px 3px 3px 8px",
|
---|
191 | width: a.width + "px",
|
---|
192 | display: "block",
|
---|
193 | height: a.buttonheight + "px",
|
---|
194 | outline: "0px",
|
---|
195 | "line-height": a.buttonheight + "px"
|
---|
196 | };
|
---|
197 | if (a.rounded)
|
---|
198 | {
|
---|
199 | //c["border-radius"] = "6px";
|
---|
200 | //c["-moz-border-radius"] = "6px";
|
---|
201 | //c["-webkit-border-radius"] = "6px"
|
---|
202 | }
|
---|
203 | c = b("<a/>").addClass("jquery-ui-switcher-link").css(c).bind(
|
---|
204 | {
|
---|
205 | mouseenter: function ()
|
---|
206 | {
|
---|
207 | b(this).css(
|
---|
208 | {
|
---|
209 | background: "#fff"
|
---|
210 | })
|
---|
211 | },
|
---|
212 | mouseleave: function ()
|
---|
213 | {
|
---|
214 | g.find(".jquery-ui-switcher-list-hldr").is(":visible") || b(this).css(
|
---|
215 | {
|
---|
216 | background: "#fff"
|
---|
217 | })
|
---|
218 | },
|
---|
219 | click: function ()
|
---|
220 | {
|
---|
221 | if (g.find(".jquery-ui-switcher-list-hldr").is(":visible")) h();
|
---|
222 | else
|
---|
223 | {
|
---|
224 | a.onopen !== null && a.onopen();
|
---|
225 | g.find(".jquery-ui-switcher-link").css(
|
---|
226 | {
|
---|
227 | color: "#AAA",
|
---|
228 | background: "#000"
|
---|
229 | });
|
---|
230 | g.find(".jquery-ui-switcher-list-hldr").slideDown("fast")
|
---|
231 | }
|
---|
232 | }
|
---|
233 | });
|
---|
234 | var m = b("<span/>").addClass("jquery-ui-switcher-title").appendTo(c);
|
---|
235 | b("<span/>").addClass("jquery-ui-switcher-arrow").css(
|
---|
236 | {
|
---|
237 | "float": "right",
|
---|
238 | width: "16px",
|
---|
239 | height: "16px",
|
---|
240 | background: "url(" + a.imgpath + "icon_color_arrow.gif) no-repeat 50% 50%"
|
---|
241 | }).appendTo(c);
|
---|
242 | if (b.cookie(a.cookiename)) d(j(b.cookie(a.cookiename)));
|
---|
243 | else a.loadtheme.length ? d(j(a.loadtheme)) : m.text(a.initialtext);
|
---|
244 | var k = b("<div/>").addClass("jquery-ui-switcher-list-hldr").css(
|
---|
245 | {
|
---|
246 | width: eval(a.width + 8) + "px",
|
---|
247 | background: "#000",
|
---|
248 | color: "#FFF",
|
---|
249 | "font-family": "'Trebuchet MS', Verdana, sans-serif",
|
---|
250 | "font-size": "12px",
|
---|
251 | border: "1px solid #CCC",
|
---|
252 | "border-top": "none",
|
---|
253 | "z-index": "999999",
|
---|
254 | position: "absolute",
|
---|
255 | top: eval(a.buttonheight + 3) + "px",
|
---|
256 | left: "0px",
|
---|
257 | padding: "3px 3px 3px 0",
|
---|
258 | display: "none"
|
---|
259 | }).bind(
|
---|
260 | {
|
---|
261 | mouseleave: function ()
|
---|
262 | {
|
---|
263 | h()
|
---|
264 | }
|
---|
265 | });
|
---|
266 | if (a.rounded)
|
---|
267 | {
|
---|
268 | k.css("border-radius", "0 0 6px 6px");
|
---|
269 | k.css("-moz-border-radius", "0 0 6px 6px");
|
---|
270 | k.css("-webkit-border-radius", "0 0 6px 6px")
|
---|
271 | }
|
---|
272 | var p = b("<ul/>").css(
|
---|
273 | {
|
---|
274 | "list-style": "none",
|
---|
275 | margin: "0",
|
---|
276 | padding: "0",
|
---|
277 | "overflow-y": "auto",
|
---|
278 | "overflow-x": "hidden",
|
---|
279 | height: a.height + "px"
|
---|
280 | }).appendTo(k);
|
---|
281 | b.each(l, function (f, e)
|
---|
282 | {
|
---|
283 | var n = b("<li>").css("height", "90px").appendTo(p),
|
---|
284 | i = b("<a>").css(
|
---|
285 | {
|
---|
286 | display: "block",
|
---|
287 | padding: "5px 3px 5px 5px",
|
---|
288 | "text-decoration": "none",
|
---|
289 | "float": "left",
|
---|
290 | width: "100%",
|
---|
291 | clear: "left"
|
---|
292 | }).bind(
|
---|
293 | {
|
---|
294 | mouseenter: function ()
|
---|
295 | {
|
---|
296 | i.css("background", "url(" + a.imgpath + "menuhoverbg.png) repeat-x 50% 50%")
|
---|
297 | },
|
---|
298 | mouseleave: function ()
|
---|
299 | {
|
---|
300 | i.css("background", "none")
|
---|
301 | },
|
---|
302 | click: function (q)
|
---|
303 | {
|
---|
304 | console.log(b(this).data());
|
---|
305 | d(b(this).data());
|
---|
306 | q.preventDefault()
|
---|
307 | }
|
---|
308 | }).attr("href", "#").data(e).appendTo(n);
|
---|
309 | b("<img>").attr("src", a.imgpath + e.icon).attr("title", e.title).css(
|
---|
310 | {
|
---|
311 | "float": "left",
|
---|
312 | "margin-right": "5px",
|
---|
313 | border: "1px solid #333"
|
---|
314 | }).appendTo(i);
|
---|
315 | b("<span>").css(
|
---|
316 | {
|
---|
317 | "float": "left",
|
---|
318 | "padding-top": "5px",
|
---|
319 | color: "#AAA"
|
---|
320 | }).text(e.title).appendTo(i)
|
---|
321 | });
|
---|
322 | this.css("position", "relative");
|
---|
323 | this.append(c);
|
---|
324 | this.append(k);
|
---|
325 | return this
|
---|
326 | }
|
---|
327 | })(jQuery);
|
---|
328 | jQuery.cookie = function (b, c, d)
|
---|
329 | {
|
---|
330 | if (arguments.length > 1 && String(c) !== "[object Object]")
|
---|
331 | {
|
---|
332 | d = jQuery.extend(
|
---|
333 | {}, d);
|
---|
334 | if (c === null || c === undefined) d.expires = -1;
|
---|
335 | if (typeof d.expires === "number")
|
---|
336 | {
|
---|
337 | var j = d.expires,
|
---|
338 | h = d.expires = new Date;
|
---|
339 | h.setDate(h.getDate() + j)
|
---|
340 | }
|
---|
341 | c = String(c);
|
---|
342 | return document.cookie = [encodeURIComponent(b), "=", d.raw ? c : encodeURIComponent(c), d.expires ? "; expires=" + d.expires.toUTCString() : "", d.path ? "; path=" + d.path : "", d.domain ? "; domain=" + d.domain : "", d.secure ? "; secure" : ""].join("")
|
---|
343 | }
|
---|
344 | d = c || {};
|
---|
345 | h = d.raw ?
|
---|
346 | function (g)
|
---|
347 | {
|
---|
348 | return g
|
---|
349 | } : decodeURIComponent;
|
---|
350 | return (j = RegExp("(?:^|; )" + encodeURIComponent(b) + "=([^;]*)").exec(document.cookie)) ? h(j[1]) : null
|
---|
351 | }; |
---|