Merge lp:~widelands-dev/widelands-website/update_jvascript into lp:widelands-website
- update_jvascript
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | 470 |
Proposed branch: | lp:~widelands-dev/widelands-website/update_jvascript |
Merge into: | lp:widelands-website |
Diff against target: |
37174 lines (+11398/-25416) 41 files modified
media/fancybox/helpers/jquery.fancybox-buttons.css (+0/-85) media/fancybox/helpers/jquery.fancybox-buttons.js (+0/-115) media/fancybox/helpers/jquery.fancybox-media.js (+0/-85) media/fancybox/helpers/jquery.fancybox-thumbs.css (+0/-54) media/fancybox/helpers/jquery.fancybox-thumbs.js (+0/-157) media/fancybox/jquery.fancybox.css (+0/-234) media/fancybox/jquery.fancybox.js (+0/-1463) media/fancybox/jquery.fancybox.pack.js (+0/-35) media/js/disableOnSubmit.js (+2/-2) media/js/encyclopedia.js (+2/-3) media/js/highcharts_219/adapters/mootools-adapter.js (+0/-12) media/js/highcharts_219/adapters/mootools-adapter.src.js (+0/-264) media/js/highcharts_219/adapters/prototype-adapter.js (+0/-15) media/js/highcharts_219/adapters/prototype-adapter.src.js (+0/-331) media/js/highcharts_219/highcharts.js (+0/-176) media/js/highcharts_219/highcharts.src.js (+0/-11454) media/js/highcharts_219/modules/exporting.js (+0/-24) media/js/highcharts_219/modules/exporting.src.js (+0/-758) media/js/highcharts_219/themes/dark-blue.js (+0/-263) media/js/highcharts_219/themes/dark-green.js (+0/-263) media/js/highcharts_219/themes/gray.js (+0/-262) media/js/highcharts_219/themes/grid.js (+0/-96) media/js/highcharts_v5/highcharts.js (+803/-0) media/js/hoverIntent.js (+0/-9) media/js/jqModal.js (+0/-100) media/js/jquery-3.2.1.js (+10253/-0) media/js/jquery.js (+0/-8981) media/js/jquery.sexy-vote.js (+6/-6) media/js/superfish.js (+0/-121) media/lightbox_v2/LICENSE (+21/-0) media/lightbox_v2/css/custom.css (+11/-0) media/lightbox_v2/css/lightbox.css (+213/-0) media/lightbox_v2/lightbox-plus-jquery.min.js (+38/-0) templates/base.html (+3/-1) templates/navigation.html (+1/-1) templates/wlhelp/base.html (+0/-1) templates/wlhelp/buildings.html (+5/-0) templates/wlpoll/base.html (+1/-1) templates/wlpoll/poll_detail.html (+2/-1) templates/wlscreens/index.html (+25/-37) wlpoll/templatetags/wlpoll_extras.py (+12/-6) |
To merge this branch: | bzr merge lp:~widelands-dev/widelands-website/update_jvascript |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
SirVer | testing | Approve | |
kaputtnik (community) | Needs Resubmitting | ||
Review via email: mp+331244@code.launchpad.net |
Commit message
Description of the change
Update jquery from version 1.6.2 to 3.2.1
This needs adjustments to some other javascript files. To find incompatible/
Because Highcharts (used for polls) didn't work with the new jquery library, it is now updated to version 5, adjusted and i did some small beautification (e.g. labels are not in one row anymore like here for the left label: https:/
Highcharts throws an error shown in browsers console, but it works. The description of the error: https:/
Deleted some js files which i believe were forgotten to remove in the past.
I am busy today and tomorrow, but next week i have a lot of time.
kaputtnik (franku) wrote : | # |
This should work now and i have started alpha for testing. Things you could test:
- Rating a map
- Showing Polls
- Viewing screenshots
- Preview posts
SirVer (sirver) wrote : | # |
This is not reviable - too many changed lines.
I clicked around the alphe page and tested all the things you asked for. No issues. I suggest rolling this out and looking what breaks.
SirVer (sirver) : | # |
kaputtnik (franku) wrote : | # |
Thanks :-)
I am not fully satisfied with the border if a single screenshot is shown, but this could be changed later on.
Merged and deployed.
Preview Diff
1 | === removed directory 'media/fancybox' | |||
2 | === removed file 'media/fancybox/blank.gif' | |||
3 | 0 | Binary files media/fancybox/blank.gif 2012-04-24 13:30:24 +0000 and media/fancybox/blank.gif 1970-01-01 00:00:00 +0000 differ | 0 | Binary files media/fancybox/blank.gif 2012-04-24 13:30:24 +0000 and media/fancybox/blank.gif 1970-01-01 00:00:00 +0000 differ |
4 | === removed file 'media/fancybox/fancybox_loading.gif' | |||
5 | 1 | Binary files media/fancybox/fancybox_loading.gif 2012-04-24 13:30:24 +0000 and media/fancybox/fancybox_loading.gif 1970-01-01 00:00:00 +0000 differ | 1 | Binary files media/fancybox/fancybox_loading.gif 2012-04-24 13:30:24 +0000 and media/fancybox/fancybox_loading.gif 1970-01-01 00:00:00 +0000 differ |
6 | === removed file 'media/fancybox/fancybox_sprite.png' | |||
7 | 2 | Binary files media/fancybox/fancybox_sprite.png 2012-04-24 13:30:24 +0000 and media/fancybox/fancybox_sprite.png 1970-01-01 00:00:00 +0000 differ | 2 | Binary files media/fancybox/fancybox_sprite.png 2012-04-24 13:30:24 +0000 and media/fancybox/fancybox_sprite.png 1970-01-01 00:00:00 +0000 differ |
8 | === removed directory 'media/fancybox/helpers' | |||
9 | === removed file 'media/fancybox/helpers/fancybox_buttons.png' | |||
10 | 3 | Binary files media/fancybox/helpers/fancybox_buttons.png 2012-04-24 13:30:24 +0000 and media/fancybox/helpers/fancybox_buttons.png 1970-01-01 00:00:00 +0000 differ | 3 | Binary files media/fancybox/helpers/fancybox_buttons.png 2012-04-24 13:30:24 +0000 and media/fancybox/helpers/fancybox_buttons.png 1970-01-01 00:00:00 +0000 differ |
11 | === removed file 'media/fancybox/helpers/jquery.fancybox-buttons.css' | |||
12 | --- media/fancybox/helpers/jquery.fancybox-buttons.css 2012-04-24 13:30:24 +0000 | |||
13 | +++ media/fancybox/helpers/jquery.fancybox-buttons.css 1970-01-01 00:00:00 +0000 | |||
14 | @@ -1,85 +0,0 @@ | |||
15 | 1 | #fancybox-buttons { | ||
16 | 2 | position: fixed; | ||
17 | 3 | left: 0; | ||
18 | 4 | width: 100%; | ||
19 | 5 | z-index: 8050; | ||
20 | 6 | } | ||
21 | 7 | |||
22 | 8 | #fancybox-buttons.top { | ||
23 | 9 | top: 10px; | ||
24 | 10 | } | ||
25 | 11 | |||
26 | 12 | #fancybox-buttons.bottom { | ||
27 | 13 | bottom: 10px; | ||
28 | 14 | } | ||
29 | 15 | |||
30 | 16 | #fancybox-buttons ul { | ||
31 | 17 | display: block; | ||
32 | 18 | width: 170px; | ||
33 | 19 | height: 30px; | ||
34 | 20 | margin: 0 auto; | ||
35 | 21 | padding: 0; | ||
36 | 22 | list-style: none; | ||
37 | 23 | background: #111; | ||
38 | 24 | -webkit-box-shadow: 0 1px 3px #000,0 0 0 1px rgba(0,0,0,.7),inset 0 0 0 1px rgba(255,255,255,.05); | ||
39 | 25 | -moz-box-shadow: 0 1px 3px #000,0 0 0 1px rgba(0,0,0,.7),inset 0 0 0 1px rgba(255,255,255,.05); | ||
40 | 26 | background: #111 -webkit-gradient(linear,0% 0%,0% 100%,from(rgba(255,255,255,.2)),color-stop(.5,rgba(255,255,255,.15)),color-stop(.5,rgba(255,255,255,.1)),to(rgba(255,255,255,.15))); | ||
41 | 27 | background: #111 -moz-linear-gradient(top,rgba(255,255,255,.2) 0%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.1) 50%,rgba(255,255,255,.15) 100%); | ||
42 | 28 | border-radius: 3px; | ||
43 | 29 | } | ||
44 | 30 | |||
45 | 31 | #fancybox-buttons ul li { | ||
46 | 32 | float: left; | ||
47 | 33 | margin: 0; | ||
48 | 34 | padding: 0; | ||
49 | 35 | } | ||
50 | 36 | |||
51 | 37 | #fancybox-buttons a { | ||
52 | 38 | display: block; | ||
53 | 39 | width: 30px; | ||
54 | 40 | height: 30px; | ||
55 | 41 | text-indent: -9999px; | ||
56 | 42 | background-image: url('fancybox_buttons.png'); | ||
57 | 43 | background-repeat: no-repeat; | ||
58 | 44 | outline: none; | ||
59 | 45 | } | ||
60 | 46 | |||
61 | 47 | #fancybox-buttons a.btnPrev { | ||
62 | 48 | width: 32px; | ||
63 | 49 | background-position: 6px 0; | ||
64 | 50 | } | ||
65 | 51 | |||
66 | 52 | #fancybox-buttons a.btnNext { | ||
67 | 53 | background-position: -33px 0; | ||
68 | 54 | border-right: 1px solid #3e3e3e; | ||
69 | 55 | } | ||
70 | 56 | |||
71 | 57 | #fancybox-buttons a.btnPlay { | ||
72 | 58 | background-position: 0 -30px; | ||
73 | 59 | } | ||
74 | 60 | |||
75 | 61 | #fancybox-buttons a.btnPlayOn { | ||
76 | 62 | background-position: -30px -30px; | ||
77 | 63 | } | ||
78 | 64 | |||
79 | 65 | #fancybox-buttons a.btnToggle { | ||
80 | 66 | background-position: 3px -60px; | ||
81 | 67 | border-left: 1px solid #111; | ||
82 | 68 | border-right: 1px solid #3e3e3e; | ||
83 | 69 | width: 35px | ||
84 | 70 | } | ||
85 | 71 | |||
86 | 72 | #fancybox-buttons a.btnToggleOn { | ||
87 | 73 | background-position: -27px -60px; | ||
88 | 74 | } | ||
89 | 75 | |||
90 | 76 | #fancybox-buttons a.btnClose { | ||
91 | 77 | border-left: 1px solid #111; | ||
92 | 78 | width: 38px; | ||
93 | 79 | background-position: -57px 0px; | ||
94 | 80 | } | ||
95 | 81 | |||
96 | 82 | #fancybox-buttons a.btnDisabled { | ||
97 | 83 | opacity : 0.5; | ||
98 | 84 | cursor: default; | ||
99 | 85 | } | ||
100 | 86 | \ No newline at end of file | 0 | \ No newline at end of file |
101 | 87 | 1 | ||
102 | === removed file 'media/fancybox/helpers/jquery.fancybox-buttons.js' | |||
103 | --- media/fancybox/helpers/jquery.fancybox-buttons.js 2012-04-24 13:30:24 +0000 | |||
104 | +++ media/fancybox/helpers/jquery.fancybox-buttons.js 1970-01-01 00:00:00 +0000 | |||
105 | @@ -1,115 +0,0 @@ | |||
106 | 1 | /*! | ||
107 | 2 | * Buttons helper for fancyBox | ||
108 | 3 | * version: 1.0.2 | ||
109 | 4 | * @requires fancyBox v2.0 or later | ||
110 | 5 | * | ||
111 | 6 | * Usage: | ||
112 | 7 | * $(".fancybox").fancybox({ | ||
113 | 8 | * buttons: { | ||
114 | 9 | * position : 'top' | ||
115 | 10 | * } | ||
116 | 11 | * }); | ||
117 | 12 | * | ||
118 | 13 | * Options: | ||
119 | 14 | * tpl - HTML template | ||
120 | 15 | * position - 'top' or 'bottom' | ||
121 | 16 | * | ||
122 | 17 | */ | ||
123 | 18 | (function ($) { | ||
124 | 19 | //Shortcut for fancyBox object | ||
125 | 20 | var F = $.fancybox; | ||
126 | 21 | |||
127 | 22 | //Add helper object | ||
128 | 23 | F.helpers.buttons = { | ||
129 | 24 | tpl: '<div id="fancybox-buttons"><ul><li><a class="btnPrev" title="Previous" href="javascript:;"></a></li><li><a class="btnPlay" title="Start slideshow" href="javascript:;"></a></li><li><a class="btnNext" title="Next" href="javascript:;"></a></li><li><a class="btnToggle" title="Toggle size" href="javascript:;"></a></li><li><a class="btnClose" title="Close" href="javascript:jQuery.fancybox.close();"></a></li></ul></div>', | ||
130 | 25 | list: null, | ||
131 | 26 | buttons: {}, | ||
132 | 27 | |||
133 | 28 | update: function () { | ||
134 | 29 | var toggle = this.buttons.toggle.removeClass('btnDisabled btnToggleOn'); | ||
135 | 30 | |||
136 | 31 | //Size toggle button | ||
137 | 32 | if (F.current.canShrink) { | ||
138 | 33 | toggle.addClass('btnToggleOn'); | ||
139 | 34 | |||
140 | 35 | } else if (!F.current.canExpand) { | ||
141 | 36 | toggle.addClass('btnDisabled'); | ||
142 | 37 | } | ||
143 | 38 | }, | ||
144 | 39 | |||
145 | 40 | beforeLoad: function (opts) { | ||
146 | 41 | //Remove self if gallery do not have at least two items | ||
147 | 42 | if (F.group.length < 2) { | ||
148 | 43 | F.coming.helpers.buttons = false; | ||
149 | 44 | F.coming.closeBtn = true; | ||
150 | 45 | |||
151 | 46 | return; | ||
152 | 47 | } | ||
153 | 48 | |||
154 | 49 | //Increase top margin to give space for buttons | ||
155 | 50 | F.coming.margin[ opts.position === 'bottom' ? 2 : 0 ] += 30; | ||
156 | 51 | }, | ||
157 | 52 | |||
158 | 53 | onPlayStart: function () { | ||
159 | 54 | if (this.list) { | ||
160 | 55 | this.buttons.play.attr('title', 'Pause slideshow').addClass('btnPlayOn'); | ||
161 | 56 | } | ||
162 | 57 | }, | ||
163 | 58 | |||
164 | 59 | onPlayEnd: function () { | ||
165 | 60 | if (this.list) { | ||
166 | 61 | this.buttons.play.attr('title', 'Start slideshow').removeClass('btnPlayOn'); | ||
167 | 62 | } | ||
168 | 63 | }, | ||
169 | 64 | |||
170 | 65 | afterShow: function (opts) { | ||
171 | 66 | var buttons; | ||
172 | 67 | |||
173 | 68 | if (!this.list) { | ||
174 | 69 | this.list = $(opts.tpl || this.tpl).addClass(opts.position || 'top').appendTo('body'); | ||
175 | 70 | |||
176 | 71 | this.buttons = { | ||
177 | 72 | prev : this.list.find('.btnPrev').click( F.prev ), | ||
178 | 73 | next : this.list.find('.btnNext').click( F.next ), | ||
179 | 74 | play : this.list.find('.btnPlay').click( F.play ), | ||
180 | 75 | toggle : this.list.find('.btnToggle').click( F.toggle ) | ||
181 | 76 | } | ||
182 | 77 | } | ||
183 | 78 | |||
184 | 79 | buttons = this.buttons; | ||
185 | 80 | |||
186 | 81 | //Prev | ||
187 | 82 | if (F.current.index > 0 || F.current.loop) { | ||
188 | 83 | buttons.prev.removeClass('btnDisabled'); | ||
189 | 84 | } else { | ||
190 | 85 | buttons.prev.addClass('btnDisabled'); | ||
191 | 86 | } | ||
192 | 87 | |||
193 | 88 | //Next / Play | ||
194 | 89 | if (F.current.loop || F.current.index < F.group.length - 1) { | ||
195 | 90 | buttons.next.removeClass('btnDisabled'); | ||
196 | 91 | buttons.play.removeClass('btnDisabled'); | ||
197 | 92 | |||
198 | 93 | } else { | ||
199 | 94 | buttons.next.addClass('btnDisabled'); | ||
200 | 95 | buttons.play.addClass('btnDisabled'); | ||
201 | 96 | } | ||
202 | 97 | |||
203 | 98 | this.update(); | ||
204 | 99 | }, | ||
205 | 100 | |||
206 | 101 | onUpdate: function () { | ||
207 | 102 | this.update(); | ||
208 | 103 | }, | ||
209 | 104 | |||
210 | 105 | beforeClose: function () { | ||
211 | 106 | if (this.list) { | ||
212 | 107 | this.list.remove(); | ||
213 | 108 | } | ||
214 | 109 | |||
215 | 110 | this.list = null; | ||
216 | 111 | this.buttons = {}; | ||
217 | 112 | } | ||
218 | 113 | }; | ||
219 | 114 | |||
220 | 115 | }(jQuery)); | ||
221 | 116 | \ No newline at end of file | 0 | \ No newline at end of file |
222 | 117 | 1 | ||
223 | === removed file 'media/fancybox/helpers/jquery.fancybox-media.js' | |||
224 | --- media/fancybox/helpers/jquery.fancybox-media.js 2012-04-24 13:30:24 +0000 | |||
225 | +++ media/fancybox/helpers/jquery.fancybox-media.js 1970-01-01 00:00:00 +0000 | |||
226 | @@ -1,85 +0,0 @@ | |||
227 | 1 | /*! | ||
228 | 2 | * Media helper for fancyBox | ||
229 | 3 | * version: 1.0.0 | ||
230 | 4 | * @requires fancyBox v2.0 or later | ||
231 | 5 | * | ||
232 | 6 | * Usage: | ||
233 | 7 | * $(".fancybox").fancybox({ | ||
234 | 8 | * media: {} | ||
235 | 9 | * }); | ||
236 | 10 | * | ||
237 | 11 | * Supports: | ||
238 | 12 | * Youtube | ||
239 | 13 | * http://www.youtube.com/watch?v=opj24KnzrWo | ||
240 | 14 | * http://youtu.be/opj24KnzrWo | ||
241 | 15 | * Vimeo | ||
242 | 16 | * http://vimeo.com/25634903 | ||
243 | 17 | * Metacafe | ||
244 | 18 | * http://www.metacafe.com/watch/7635964/dr_seuss_the_lorax_movie_trailer/ | ||
245 | 19 | * http://www.metacafe.com/watch/7635964/ | ||
246 | 20 | * Dailymotion | ||
247 | 21 | * http://www.dailymotion.com/video/xoytqh_dr-seuss-the-lorax-premiere_people | ||
248 | 22 | * Twitvid | ||
249 | 23 | * http://twitvid.com/QY7MD | ||
250 | 24 | * Twitpic | ||
251 | 25 | * http://twitpic.com/7p93st | ||
252 | 26 | |||
253 | 27 | * http://instagr.am/p/IejkuUGxQn/ | ||
254 | 28 | * http://instagram.com/p/IejkuUGxQn/ | ||
255 | 29 | * Google maps | ||
256 | 30 | * http://maps.google.com/maps?q=Eiffel+Tower,+Avenue+Gustave+Eiffel,+Paris,+France&t=h&z=17 | ||
257 | 31 | * http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16 | ||
258 | 32 | * http://maps.google.com/?ll=48.859463,2.292626&spn=0.000965,0.002642&t=m&z=19&layer=c&cbll=48.859524,2.292532&panoid=YJ0lq28OOy3VT2IqIuVY0g&cbp=12,151.58,,0,-15.56 | ||
259 | 33 | */ | ||
260 | 34 | (function ($) { | ||
261 | 35 | //Shortcut for fancyBox object | ||
262 | 36 | var F = $.fancybox; | ||
263 | 37 | |||
264 | 38 | //Add helper object | ||
265 | 39 | F.helpers.media = { | ||
266 | 40 | beforeLoad : function(opts, obj) { | ||
267 | 41 | var href = obj.href || '', | ||
268 | 42 | type = false, | ||
269 | 43 | rez; | ||
270 | 44 | |||
271 | 45 | if ((rez = href.match(/(youtube\.com|youtu\.be)\/(v\/|u\/|embed\/|watch\?v=)?([^#\&\?]*).*/i))) { | ||
272 | 46 | href = '//www.youtube.com/embed/' + rez[3] + '?autoplay=1&autohide=1&fs=1&rel=0&enablejsapi=1'; | ||
273 | 47 | type = 'iframe'; | ||
274 | 48 | |||
275 | 49 | } else if ((rez = href.match(/vimeo.com\/(\d+)\/?(.*)/))) { | ||
276 | 50 | href = '//player.vimeo.com/video/' + rez[1] + '?hd=1&autoplay=1&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1'; | ||
277 | 51 | type = 'iframe'; | ||
278 | 52 | |||
279 | 53 | } else if ((rez = href.match(/metacafe.com\/watch\/(\d+)\/?(.*)/))) { | ||
280 | 54 | href = '//www.metacafe.com/fplayer/' + rez[1] + '/.swf?playerVars=autoPlay=yes'; | ||
281 | 55 | type = 'swf'; | ||
282 | 56 | |||
283 | 57 | } else if ((rez = href.match(/dailymotion.com\/video\/(.*)\/?(.*)/))) { | ||
284 | 58 | href = '//www.dailymotion.com/swf/video/' + rez[1] + '?additionalInfos=0&autoStart=1'; | ||
285 | 59 | type = 'swf'; | ||
286 | 60 | |||
287 | 61 | } else if ((rez = href.match(/twitvid\.com\/([a-zA-Z0-9_\-\?\=]+)/i))) { | ||
288 | 62 | href = '//www.twitvid.com/embed.php?autoplay=0&guid=' + rez[1]; | ||
289 | 63 | type = 'iframe'; | ||
290 | 64 | |||
291 | 65 | } else if ((rez = href.match(/twitpic\.com\/(?!(?:place|photos|events)\/)([a-zA-Z0-9\?\=\-]+)/i))) { | ||
292 | 66 | href = '//twitpic.com/show/full/' + rez[1]; | ||
293 | 67 | type = 'image'; | ||
294 | 68 | |||
295 | 69 | } else if ((rez = href.match(/(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i))) { | ||
296 | 70 | href = '//' + rez[1] + '/p/' + rez[2] + '/media/?size=l'; | ||
297 | 71 | type = 'image'; | ||
298 | 72 | |||
299 | 73 | } else if ((rez = href.match(/maps\.google\.com\/(\?ll=|maps\/?\?q=)(.*)/i))) { | ||
300 | 74 | href = '//maps.google.com/' + rez[1] + '' + rez[2] + '&output=' + (rez[2].indexOf('layer=c') ? 'svembed' : 'embed'); | ||
301 | 75 | type = 'iframe'; | ||
302 | 76 | } | ||
303 | 77 | |||
304 | 78 | if (type) { | ||
305 | 79 | obj.href = href; | ||
306 | 80 | obj.type = type; | ||
307 | 81 | } | ||
308 | 82 | } | ||
309 | 83 | } | ||
310 | 84 | |||
311 | 85 | }(jQuery)); | ||
312 | 86 | \ No newline at end of file | 0 | \ No newline at end of file |
313 | 87 | 1 | ||
314 | === removed file 'media/fancybox/helpers/jquery.fancybox-thumbs.css' | |||
315 | --- media/fancybox/helpers/jquery.fancybox-thumbs.css 2012-04-24 13:30:24 +0000 | |||
316 | +++ media/fancybox/helpers/jquery.fancybox-thumbs.css 1970-01-01 00:00:00 +0000 | |||
317 | @@ -1,54 +0,0 @@ | |||
318 | 1 | #fancybox-thumbs { | ||
319 | 2 | position: fixed; | ||
320 | 3 | left: 0; | ||
321 | 4 | width: 100%; | ||
322 | 5 | overflow: hidden; | ||
323 | 6 | z-index: 8050; | ||
324 | 7 | } | ||
325 | 8 | |||
326 | 9 | #fancybox-thumbs.bottom { | ||
327 | 10 | bottom: 2px; | ||
328 | 11 | } | ||
329 | 12 | |||
330 | 13 | #fancybox-thumbs.top { | ||
331 | 14 | top: 2px; | ||
332 | 15 | } | ||
333 | 16 | |||
334 | 17 | #fancybox-thumbs ul { | ||
335 | 18 | position: relative; | ||
336 | 19 | list-style: none; | ||
337 | 20 | margin: 0; | ||
338 | 21 | padding: 0; | ||
339 | 22 | } | ||
340 | 23 | |||
341 | 24 | #fancybox-thumbs ul li { | ||
342 | 25 | float: left; | ||
343 | 26 | padding: 1px; | ||
344 | 27 | opacity: 0.5; | ||
345 | 28 | } | ||
346 | 29 | |||
347 | 30 | #fancybox-thumbs ul li.active { | ||
348 | 31 | opacity: 0.75; | ||
349 | 32 | padding: 0; | ||
350 | 33 | border: 1px solid #fff; | ||
351 | 34 | } | ||
352 | 35 | |||
353 | 36 | #fancybox-thumbs ul li:hover { | ||
354 | 37 | opacity: 1; | ||
355 | 38 | } | ||
356 | 39 | |||
357 | 40 | #fancybox-thumbs ul li a { | ||
358 | 41 | display: block; | ||
359 | 42 | position: relative; | ||
360 | 43 | overflow: hidden; | ||
361 | 44 | border: 1px solid #222; | ||
362 | 45 | background: #111; | ||
363 | 46 | outline: none; | ||
364 | 47 | } | ||
365 | 48 | |||
366 | 49 | #fancybox-thumbs ul li img { | ||
367 | 50 | display: block; | ||
368 | 51 | position: relative; | ||
369 | 52 | border: 0; | ||
370 | 53 | padding: 0; | ||
371 | 54 | } | ||
372 | 55 | \ No newline at end of file | 0 | \ No newline at end of file |
373 | 56 | 1 | ||
374 | === removed file 'media/fancybox/helpers/jquery.fancybox-thumbs.js' | |||
375 | --- media/fancybox/helpers/jquery.fancybox-thumbs.js 2012-04-24 13:30:24 +0000 | |||
376 | +++ media/fancybox/helpers/jquery.fancybox-thumbs.js 1970-01-01 00:00:00 +0000 | |||
377 | @@ -1,157 +0,0 @@ | |||
378 | 1 | /*! | ||
379 | 2 | * Thumbnail helper for fancyBox | ||
380 | 3 | * version: 1.0.4 | ||
381 | 4 | * @requires fancyBox v2.0 or later | ||
382 | 5 | * | ||
383 | 6 | * Usage: | ||
384 | 7 | * $(".fancybox").fancybox({ | ||
385 | 8 | * thumbs: { | ||
386 | 9 | * width : 50, | ||
387 | 10 | * height : 50 | ||
388 | 11 | * } | ||
389 | 12 | * }); | ||
390 | 13 | * | ||
391 | 14 | * Options: | ||
392 | 15 | * width - thumbnail width | ||
393 | 16 | * height - thumbnail height | ||
394 | 17 | * source - function to obtain the URL of the thumbnail image | ||
395 | 18 | * position - 'top' or 'bottom' | ||
396 | 19 | * | ||
397 | 20 | */ | ||
398 | 21 | (function ($) { | ||
399 | 22 | //Shortcut for fancyBox object | ||
400 | 23 | var F = $.fancybox; | ||
401 | 24 | |||
402 | 25 | //Add helper object | ||
403 | 26 | F.helpers.thumbs = { | ||
404 | 27 | wrap: null, | ||
405 | 28 | list: null, | ||
406 | 29 | width: 0, | ||
407 | 30 | |||
408 | 31 | //Default function to obtain the URL of the thumbnail image | ||
409 | 32 | source: function (el) { | ||
410 | 33 | var img; | ||
411 | 34 | |||
412 | 35 | if ($.type(el) === 'string') { | ||
413 | 36 | return el; | ||
414 | 37 | } | ||
415 | 38 | |||
416 | 39 | img = $(el).find('img'); | ||
417 | 40 | |||
418 | 41 | return img.length ? img.attr('src') : el.href; | ||
419 | 42 | }, | ||
420 | 43 | |||
421 | 44 | init: function (opts) { | ||
422 | 45 | var that = this, | ||
423 | 46 | list, | ||
424 | 47 | thumbWidth = opts.width || 50, | ||
425 | 48 | thumbHeight = opts.height || 50, | ||
426 | 49 | thumbSource = opts.source || this.source; | ||
427 | 50 | |||
428 | 51 | //Build list structure | ||
429 | 52 | list = ''; | ||
430 | 53 | |||
431 | 54 | for (var n = 0; n < F.group.length; n++) { | ||
432 | 55 | list += '<li><a style="width:' + thumbWidth + 'px;height:' + thumbHeight + 'px;" href="javascript:jQuery.fancybox.jumpto(' + n + ');"></a></li>'; | ||
433 | 56 | } | ||
434 | 57 | |||
435 | 58 | this.wrap = $('<div id="fancybox-thumbs"></div>').addClass(opts.position || 'bottom').appendTo('body'); | ||
436 | 59 | this.list = $('<ul>' + list + '</ul>').appendTo(this.wrap); | ||
437 | 60 | |||
438 | 61 | //Load each thumbnail | ||
439 | 62 | $.each(F.group, function (i) { | ||
440 | 63 | $("<img />").load(function () { | ||
441 | 64 | var width = this.width, | ||
442 | 65 | height = this.height, | ||
443 | 66 | widthRatio, heightRatio, parent; | ||
444 | 67 | |||
445 | 68 | if (!that.list || !width || !height) { | ||
446 | 69 | return; | ||
447 | 70 | } | ||
448 | 71 | |||
449 | 72 | //Calculate thumbnail width/height and center it | ||
450 | 73 | widthRatio = width / thumbWidth; | ||
451 | 74 | heightRatio = height / thumbHeight; | ||
452 | 75 | parent = that.list.children().eq(i).find('a'); | ||
453 | 76 | |||
454 | 77 | if (widthRatio >= 1 && heightRatio >= 1) { | ||
455 | 78 | if (widthRatio > heightRatio) { | ||
456 | 79 | width = Math.floor(width / heightRatio); | ||
457 | 80 | height = thumbHeight; | ||
458 | 81 | |||
459 | 82 | } else { | ||
460 | 83 | width = thumbWidth; | ||
461 | 84 | height = Math.floor(height / widthRatio); | ||
462 | 85 | } | ||
463 | 86 | } | ||
464 | 87 | |||
465 | 88 | $(this).css({ | ||
466 | 89 | width: width, | ||
467 | 90 | height: height, | ||
468 | 91 | top: Math.floor(thumbHeight / 2 - height / 2), | ||
469 | 92 | left: Math.floor(thumbWidth / 2 - width / 2) | ||
470 | 93 | }); | ||
471 | 94 | |||
472 | 95 | parent.width(thumbWidth).height(thumbHeight); | ||
473 | 96 | |||
474 | 97 | $(this).hide().appendTo(parent).fadeIn(300); | ||
475 | 98 | |||
476 | 99 | }).attr('src', thumbSource( F.group[ i ] )); | ||
477 | 100 | }); | ||
478 | 101 | |||
479 | 102 | //Set initial width | ||
480 | 103 | this.width = this.list.children().eq(0).outerWidth(true); | ||
481 | 104 | |||
482 | 105 | this.list.width(this.width * (F.group.length + 1)).css('left', Math.floor($(window).width() * 0.5 - (F.current.index * this.width + this.width * 0.5))); | ||
483 | 106 | }, | ||
484 | 107 | |||
485 | 108 | //Center list | ||
486 | 109 | update: function (opts) { | ||
487 | 110 | if (this.list) { | ||
488 | 111 | this.list.stop(true).animate({ | ||
489 | 112 | 'left': Math.floor($(window).width() * 0.5 - (F.current.index * this.width + this.width * 0.5)) | ||
490 | 113 | }, 150); | ||
491 | 114 | } | ||
492 | 115 | }, | ||
493 | 116 | |||
494 | 117 | beforeLoad: function (opts) { | ||
495 | 118 | //Remove self if gallery do not have at least two items | ||
496 | 119 | if (F.group.length < 2) { | ||
497 | 120 | F.coming.helpers.thumbs = false; | ||
498 | 121 | |||
499 | 122 | return; | ||
500 | 123 | } | ||
501 | 124 | |||
502 | 125 | //Increase bottom margin to give space for thumbs | ||
503 | 126 | F.coming.margin[ opts.position === 'top' ? 0 : 2 ] = opts.height + 30; | ||
504 | 127 | }, | ||
505 | 128 | |||
506 | 129 | afterShow: function (opts) { | ||
507 | 130 | //Check if exists and create or update list | ||
508 | 131 | if (this.list) { | ||
509 | 132 | this.update(opts); | ||
510 | 133 | |||
511 | 134 | } else { | ||
512 | 135 | this.init(opts); | ||
513 | 136 | } | ||
514 | 137 | |||
515 | 138 | //Set active element | ||
516 | 139 | this.list.children().removeClass('active').eq(F.current.index).addClass('active'); | ||
517 | 140 | }, | ||
518 | 141 | |||
519 | 142 | onUpdate: function () { | ||
520 | 143 | this.update(); | ||
521 | 144 | }, | ||
522 | 145 | |||
523 | 146 | beforeClose: function () { | ||
524 | 147 | if (this.wrap) { | ||
525 | 148 | this.wrap.remove(); | ||
526 | 149 | } | ||
527 | 150 | |||
528 | 151 | this.wrap = null; | ||
529 | 152 | this.list = null; | ||
530 | 153 | this.width = 0; | ||
531 | 154 | } | ||
532 | 155 | } | ||
533 | 156 | |||
534 | 157 | }(jQuery)); | ||
535 | 158 | \ No newline at end of file | 0 | \ No newline at end of file |
536 | 159 | 1 | ||
537 | === removed file 'media/fancybox/jquery.fancybox.css' | |||
538 | --- media/fancybox/jquery.fancybox.css 2012-04-24 13:30:24 +0000 | |||
539 | +++ media/fancybox/jquery.fancybox.css 1970-01-01 00:00:00 +0000 | |||
540 | @@ -1,234 +0,0 @@ | |||
541 | 1 | /*! fancyBox v2.0.6 fancyapps.com | fancyapps.com/fancybox/#license */ | ||
542 | 2 | .fancybox-tmp iframe, .fancybox-tmp object { | ||
543 | 3 | vertical-align: top; | ||
544 | 4 | padding: 0; | ||
545 | 5 | margin: 0; | ||
546 | 6 | } | ||
547 | 7 | |||
548 | 8 | .fancybox-wrap { | ||
549 | 9 | position: absolute; | ||
550 | 10 | top: 0; | ||
551 | 11 | left: 0; | ||
552 | 12 | z-index: 8020; | ||
553 | 13 | } | ||
554 | 14 | |||
555 | 15 | .fancybox-skin { | ||
556 | 16 | position: relative; | ||
557 | 17 | padding: 0; | ||
558 | 18 | margin: 0; | ||
559 | 19 | background: #f9f9f9; | ||
560 | 20 | color: #444; | ||
561 | 21 | text-shadow: none; | ||
562 | 22 | -webkit-border-radius: 4px; | ||
563 | 23 | -moz-border-radius: 4px; | ||
564 | 24 | border-radius: 4px; | ||
565 | 25 | } | ||
566 | 26 | |||
567 | 27 | .fancybox-opened { | ||
568 | 28 | z-index: 8030; | ||
569 | 29 | } | ||
570 | 30 | |||
571 | 31 | .fancybox-opened .fancybox-skin { | ||
572 | 32 | -webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); | ||
573 | 33 | -moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); | ||
574 | 34 | box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); | ||
575 | 35 | } | ||
576 | 36 | |||
577 | 37 | .fancybox-outer, .fancybox-inner { | ||
578 | 38 | padding: 0; | ||
579 | 39 | margin: 0; | ||
580 | 40 | position: relative; | ||
581 | 41 | outline: none; | ||
582 | 42 | } | ||
583 | 43 | |||
584 | 44 | .fancybox-inner { | ||
585 | 45 | overflow: hidden; | ||
586 | 46 | } | ||
587 | 47 | |||
588 | 48 | .fancybox-type-iframe .fancybox-inner { | ||
589 | 49 | -webkit-overflow-scrolling: touch; | ||
590 | 50 | } | ||
591 | 51 | |||
592 | 52 | .fancybox-error { | ||
593 | 53 | color: #444; | ||
594 | 54 | font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif; | ||
595 | 55 | margin: 0; | ||
596 | 56 | padding: 10px; | ||
597 | 57 | } | ||
598 | 58 | |||
599 | 59 | .fancybox-image, .fancybox-iframe { | ||
600 | 60 | display: block; | ||
601 | 61 | width: 100%; | ||
602 | 62 | height: 100%; | ||
603 | 63 | border: 0; | ||
604 | 64 | padding: 0; | ||
605 | 65 | margin: 0; | ||
606 | 66 | vertical-align: top; | ||
607 | 67 | } | ||
608 | 68 | |||
609 | 69 | .fancybox-image { | ||
610 | 70 | max-width: 100%; | ||
611 | 71 | max-height: 100%; | ||
612 | 72 | } | ||
613 | 73 | |||
614 | 74 | #fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span { | ||
615 | 75 | background-image: url('fancybox_sprite.png'); | ||
616 | 76 | } | ||
617 | 77 | |||
618 | 78 | #fancybox-loading { | ||
619 | 79 | position: fixed; | ||
620 | 80 | top: 50%; | ||
621 | 81 | left: 50%; | ||
622 | 82 | margin-top: -22px; | ||
623 | 83 | margin-left: -22px; | ||
624 | 84 | background-position: 0 -108px; | ||
625 | 85 | opacity: 0.8; | ||
626 | 86 | cursor: pointer; | ||
627 | 87 | z-index: 8020; | ||
628 | 88 | } | ||
629 | 89 | |||
630 | 90 | #fancybox-loading div { | ||
631 | 91 | width: 44px; | ||
632 | 92 | height: 44px; | ||
633 | 93 | background: url('fancybox_loading.gif') center center no-repeat; | ||
634 | 94 | } | ||
635 | 95 | |||
636 | 96 | .fancybox-close { | ||
637 | 97 | position: absolute; | ||
638 | 98 | top: -18px; | ||
639 | 99 | right: -18px; | ||
640 | 100 | width: 36px; | ||
641 | 101 | height: 36px; | ||
642 | 102 | cursor: pointer; | ||
643 | 103 | z-index: 8040; | ||
644 | 104 | } | ||
645 | 105 | |||
646 | 106 | .fancybox-nav { | ||
647 | 107 | position: absolute; | ||
648 | 108 | top: 0; | ||
649 | 109 | width: 40%; | ||
650 | 110 | height: 100%; | ||
651 | 111 | cursor: pointer; | ||
652 | 112 | background: transparent url('blank.gif'); /* helps IE */ | ||
653 | 113 | -webkit-tap-highlight-color: rgba(0,0,0,0); | ||
654 | 114 | z-index: 8040; | ||
655 | 115 | } | ||
656 | 116 | |||
657 | 117 | .fancybox-prev { | ||
658 | 118 | left: 0; | ||
659 | 119 | } | ||
660 | 120 | |||
661 | 121 | .fancybox-next { | ||
662 | 122 | right: 0; | ||
663 | 123 | } | ||
664 | 124 | |||
665 | 125 | .fancybox-nav span { | ||
666 | 126 | position: absolute; | ||
667 | 127 | top: 50%; | ||
668 | 128 | width: 36px; | ||
669 | 129 | height: 34px; | ||
670 | 130 | margin-top: -18px; | ||
671 | 131 | cursor: pointer; | ||
672 | 132 | z-index: 8040; | ||
673 | 133 | visibility: hidden; | ||
674 | 134 | } | ||
675 | 135 | |||
676 | 136 | .fancybox-prev span { | ||
677 | 137 | left: 20px; | ||
678 | 138 | background-position: 0 -36px; | ||
679 | 139 | } | ||
680 | 140 | |||
681 | 141 | .fancybox-next span { | ||
682 | 142 | right: 20px; | ||
683 | 143 | background-position: 0 -72px; | ||
684 | 144 | } | ||
685 | 145 | |||
686 | 146 | .fancybox-nav:hover span { | ||
687 | 147 | visibility: visible; | ||
688 | 148 | } | ||
689 | 149 | |||
690 | 150 | .fancybox-tmp { | ||
691 | 151 | position: absolute; | ||
692 | 152 | top: -9999px; | ||
693 | 153 | left: -9999px; | ||
694 | 154 | padding: 0; | ||
695 | 155 | overflow: visible; | ||
696 | 156 | visibility: hidden; | ||
697 | 157 | } | ||
698 | 158 | |||
699 | 159 | /* Overlay helper */ | ||
700 | 160 | |||
701 | 161 | #fancybox-overlay { | ||
702 | 162 | position: absolute; | ||
703 | 163 | top: 0; | ||
704 | 164 | left: 0; | ||
705 | 165 | overflow: hidden; | ||
706 | 166 | display: none; | ||
707 | 167 | z-index: 8010; | ||
708 | 168 | background: #000; | ||
709 | 169 | } | ||
710 | 170 | |||
711 | 171 | #fancybox-overlay.overlay-fixed { | ||
712 | 172 | position: fixed; | ||
713 | 173 | bottom: 0; | ||
714 | 174 | right: 0; | ||
715 | 175 | } | ||
716 | 176 | |||
717 | 177 | /* Title helper */ | ||
718 | 178 | |||
719 | 179 | .fancybox-title { | ||
720 | 180 | visibility: hidden; | ||
721 | 181 | font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif; | ||
722 | 182 | position: relative; | ||
723 | 183 | text-shadow: none; | ||
724 | 184 | z-index: 8050; | ||
725 | 185 | } | ||
726 | 186 | |||
727 | 187 | .fancybox-opened .fancybox-title { | ||
728 | 188 | visibility: visible; | ||
729 | 189 | } | ||
730 | 190 | |||
731 | 191 | .fancybox-title-float-wrap { | ||
732 | 192 | position: absolute; | ||
733 | 193 | bottom: 0; | ||
734 | 194 | right: 50%; | ||
735 | 195 | margin-bottom: -35px; | ||
736 | 196 | z-index: 8030; | ||
737 | 197 | text-align: center; | ||
738 | 198 | } | ||
739 | 199 | |||
740 | 200 | .fancybox-title-float-wrap .child { | ||
741 | 201 | display: inline-block; | ||
742 | 202 | margin-right: -100%; | ||
743 | 203 | padding: 2px 20px; | ||
744 | 204 | background: transparent; /* Fallback for web browsers that doesn't support RGBa */ | ||
745 | 205 | background: rgba(0, 0, 0, 0.8); | ||
746 | 206 | -webkit-border-radius: 15px; | ||
747 | 207 | -moz-border-radius: 15px; | ||
748 | 208 | border-radius: 15px; | ||
749 | 209 | text-shadow: 0 1px 2px #222; | ||
750 | 210 | color: #FFF; | ||
751 | 211 | font-weight: bold; | ||
752 | 212 | line-height: 24px; | ||
753 | 213 | white-space: nowrap; | ||
754 | 214 | } | ||
755 | 215 | |||
756 | 216 | .fancybox-title-outside-wrap { | ||
757 | 217 | position: relative; | ||
758 | 218 | margin-top: 10px; | ||
759 | 219 | color: #fff; | ||
760 | 220 | } | ||
761 | 221 | |||
762 | 222 | .fancybox-title-inside-wrap { | ||
763 | 223 | margin-top: 10px; | ||
764 | 224 | } | ||
765 | 225 | |||
766 | 226 | .fancybox-title-over-wrap { | ||
767 | 227 | position: absolute; | ||
768 | 228 | bottom: 0; | ||
769 | 229 | left: 0; | ||
770 | 230 | color: #fff; | ||
771 | 231 | padding: 10px; | ||
772 | 232 | background: #000; | ||
773 | 233 | background: rgba(0, 0, 0, .8); | ||
774 | 234 | } | ||
775 | 235 | \ No newline at end of file | 0 | \ No newline at end of file |
776 | 236 | 1 | ||
777 | === removed file 'media/fancybox/jquery.fancybox.js' | |||
778 | --- media/fancybox/jquery.fancybox.js 2012-04-24 13:30:24 +0000 | |||
779 | +++ media/fancybox/jquery.fancybox.js 1970-01-01 00:00:00 +0000 | |||
780 | @@ -1,1463 +0,0 @@ | |||
781 | 1 | /*! | ||
782 | 2 | * fancyBox - jQuery Plugin | ||
783 | 3 | * version: 2.0.6 (16/04/2012) | ||
784 | 4 | * @requires jQuery v1.6 or later | ||
785 | 5 | * | ||
786 | 6 | * Examples at http://fancyapps.com/fancybox/ | ||
787 | 7 | * License: www.fancyapps.com/fancybox/#license | ||
788 | 8 | * | ||
789 | 9 | * Copyright 2012 Janis Skarnelis - janis@fancyapps.com | ||
790 | 10 | * | ||
791 | 11 | */ | ||
792 | 12 | |||
793 | 13 | (function (window, document, $, undefined) { | ||
794 | 14 | "use strict"; | ||
795 | 15 | |||
796 | 16 | var W = $(window), | ||
797 | 17 | D = $(document), | ||
798 | 18 | F = $.fancybox = function () { | ||
799 | 19 | F.open.apply( this, arguments ); | ||
800 | 20 | }, | ||
801 | 21 | didResize = false, | ||
802 | 22 | resizeTimer = null, | ||
803 | 23 | isTouch = document.createTouch !== undefined, | ||
804 | 24 | isString = function(str) { | ||
805 | 25 | return $.type(str) === "string"; | ||
806 | 26 | }, | ||
807 | 27 | isPercentage = function(str) { | ||
808 | 28 | return isString(str) && str.indexOf('%') > 0; | ||
809 | 29 | }, | ||
810 | 30 | getValue = function(value, dim) { | ||
811 | 31 | if (dim && isPercentage(value)) { | ||
812 | 32 | value = F.getViewport()[ dim ] / 100 * parseInt(value, 10); | ||
813 | 33 | } | ||
814 | 34 | |||
815 | 35 | return Math.round(value) + 'px'; | ||
816 | 36 | }; | ||
817 | 37 | |||
818 | 38 | $.extend(F, { | ||
819 | 39 | // The current version of fancyBox | ||
820 | 40 | version: '2.0.5', | ||
821 | 41 | |||
822 | 42 | defaults: { | ||
823 | 43 | padding: 15, | ||
824 | 44 | margin: 20, | ||
825 | 45 | |||
826 | 46 | width: 800, | ||
827 | 47 | height: 600, | ||
828 | 48 | minWidth: 100, | ||
829 | 49 | minHeight: 100, | ||
830 | 50 | maxWidth: 9999, | ||
831 | 51 | maxHeight: 9999, | ||
832 | 52 | |||
833 | 53 | autoSize: true, | ||
834 | 54 | autoResize: !isTouch, | ||
835 | 55 | autoCenter : !isTouch, | ||
836 | 56 | fitToView: true, | ||
837 | 57 | aspectRatio: false, | ||
838 | 58 | topRatio: 0.5, | ||
839 | 59 | |||
840 | 60 | fixed: false, | ||
841 | 61 | scrolling: 'auto', // 'auto', 'yes' or 'no' | ||
842 | 62 | wrapCSS: '', | ||
843 | 63 | |||
844 | 64 | arrows: true, | ||
845 | 65 | closeBtn: true, | ||
846 | 66 | closeClick: false, | ||
847 | 67 | nextClick : false, | ||
848 | 68 | mouseWheel: true, | ||
849 | 69 | autoPlay: false, | ||
850 | 70 | playSpeed: 3000, | ||
851 | 71 | preload : 3, | ||
852 | 72 | |||
853 | 73 | modal: false, | ||
854 | 74 | loop: true, | ||
855 | 75 | ajax: { dataType: 'html', headers: { 'X-fancyBox': true } }, | ||
856 | 76 | keys: { | ||
857 | 77 | next: [13, 32, 34, 39, 40], // enter, space, page down, right arrow, down arrow | ||
858 | 78 | prev: [8, 33, 37, 38], // backspace, page up, left arrow, up arrow | ||
859 | 79 | close: [27] // escape key | ||
860 | 80 | }, | ||
861 | 81 | |||
862 | 82 | // Override some properties | ||
863 | 83 | index: 0, | ||
864 | 84 | type: null, | ||
865 | 85 | href: null, | ||
866 | 86 | content: null, | ||
867 | 87 | title: null, | ||
868 | 88 | |||
869 | 89 | // HTML templates | ||
870 | 90 | tpl: { | ||
871 | 91 | wrap: '<div class="fancybox-wrap"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>', | ||
872 | 92 | image: '<img class="fancybox-image" src="{href}" alt="" />', | ||
873 | 93 | iframe: '<iframe class="fancybox-iframe" name="fancybox-frame{rnd}" frameborder="0" hspace="0"' + ($.browser.msie ? ' allowtransparency="true"' : '') + '></iframe>', | ||
874 | 94 | swf: '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="wmode" value="transparent" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{href}" /><embed src="{href}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="100%" height="100%" wmode="transparent"></embed></object>', | ||
875 | 95 | error: '<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>', | ||
876 | 96 | closeBtn: '<div title="Close" class="fancybox-item fancybox-close"></div>', | ||
877 | 97 | next: '<a title="Next" class="fancybox-nav fancybox-next"><span></span></a>', | ||
878 | 98 | prev: '<a title="Previous" class="fancybox-nav fancybox-prev"><span></span></a>' | ||
879 | 99 | }, | ||
880 | 100 | |||
881 | 101 | // Properties for each animation type | ||
882 | 102 | // Opening fancyBox | ||
883 | 103 | openEffect: 'fade', // 'elastic', 'fade' or 'none' | ||
884 | 104 | openSpeed: 300, | ||
885 | 105 | openEasing: 'swing', | ||
886 | 106 | openOpacity: true, | ||
887 | 107 | openMethod: 'zoomIn', | ||
888 | 108 | |||
889 | 109 | // Closing fancyBox | ||
890 | 110 | closeEffect: 'fade', // 'elastic', 'fade' or 'none' | ||
891 | 111 | closeSpeed: 300, | ||
892 | 112 | closeEasing: 'swing', | ||
893 | 113 | closeOpacity: true, | ||
894 | 114 | closeMethod: 'zoomOut', | ||
895 | 115 | |||
896 | 116 | // Changing next gallery item | ||
897 | 117 | nextEffect: 'elastic', // 'elastic', 'fade' or 'none' | ||
898 | 118 | nextSpeed: 300, | ||
899 | 119 | nextEasing: 'swing', | ||
900 | 120 | nextMethod: 'changeIn', | ||
901 | 121 | |||
902 | 122 | // Changing previous gallery item | ||
903 | 123 | prevEffect: 'elastic', // 'elastic', 'fade' or 'none' | ||
904 | 124 | prevSpeed: 300, | ||
905 | 125 | prevEasing: 'swing', | ||
906 | 126 | prevMethod: 'changeOut', | ||
907 | 127 | |||
908 | 128 | // Enabled helpers | ||
909 | 129 | helpers: { | ||
910 | 130 | overlay: { | ||
911 | 131 | speedIn: 0, | ||
912 | 132 | speedOut: 300, | ||
913 | 133 | opacity: 0.8, | ||
914 | 134 | css: { | ||
915 | 135 | cursor: 'pointer' | ||
916 | 136 | }, | ||
917 | 137 | closeClick: true | ||
918 | 138 | }, | ||
919 | 139 | title: { | ||
920 | 140 | type: 'float' // 'float', 'inside', 'outside' or 'over' | ||
921 | 141 | } | ||
922 | 142 | }, | ||
923 | 143 | |||
924 | 144 | // Callbacks | ||
925 | 145 | onCancel: $.noop, // If canceling | ||
926 | 146 | beforeLoad: $.noop, // Before loading | ||
927 | 147 | afterLoad: $.noop, // After loading | ||
928 | 148 | beforeShow: $.noop, // Before changing in current item | ||
929 | 149 | afterShow: $.noop, // After opening | ||
930 | 150 | beforeClose: $.noop, // Before closing | ||
931 | 151 | afterClose: $.noop // After closing | ||
932 | 152 | }, | ||
933 | 153 | |||
934 | 154 | //Current state | ||
935 | 155 | group: {}, // Selected group | ||
936 | 156 | opts: {}, // Group options | ||
937 | 157 | coming: null, // Element being loaded | ||
938 | 158 | current: null, // Currently loaded element | ||
939 | 159 | isOpen: false, // Is currently open | ||
940 | 160 | isOpened: false, // Have been fully opened at least once | ||
941 | 161 | wrap: null, | ||
942 | 162 | skin: null, | ||
943 | 163 | outer: null, | ||
944 | 164 | inner: null, | ||
945 | 165 | |||
946 | 166 | player: { | ||
947 | 167 | timer: null, | ||
948 | 168 | isActive: false | ||
949 | 169 | }, | ||
950 | 170 | |||
951 | 171 | // Loaders | ||
952 | 172 | ajaxLoad: null, | ||
953 | 173 | imgPreload: null, | ||
954 | 174 | |||
955 | 175 | // Some collections | ||
956 | 176 | transitions: {}, | ||
957 | 177 | helpers: {}, | ||
958 | 178 | |||
959 | 179 | /* | ||
960 | 180 | * Static methods | ||
961 | 181 | */ | ||
962 | 182 | |||
963 | 183 | open: function (group, opts) { | ||
964 | 184 | //Kill existing instances | ||
965 | 185 | F.close(true); | ||
966 | 186 | |||
967 | 187 | //Normalize group | ||
968 | 188 | if (group && !$.isArray(group)) { | ||
969 | 189 | group = group instanceof $ ? $(group).get() : [group]; | ||
970 | 190 | } | ||
971 | 191 | |||
972 | 192 | F.isActive = true; | ||
973 | 193 | |||
974 | 194 | //Extend the defaults | ||
975 | 195 | F.opts = $.extend(true, {}, F.defaults, opts); | ||
976 | 196 | |||
977 | 197 | //All options are merged recursive except keys | ||
978 | 198 | if ($.isPlainObject(opts) && opts.keys !== undefined) { | ||
979 | 199 | F.opts.keys = opts.keys ? $.extend({}, F.defaults.keys, opts.keys) : false; | ||
980 | 200 | } | ||
981 | 201 | |||
982 | 202 | F.group = group; | ||
983 | 203 | |||
984 | 204 | F._start(F.opts.index || 0); | ||
985 | 205 | }, | ||
986 | 206 | |||
987 | 207 | cancel: function () { | ||
988 | 208 | if (F.coming && false === F.trigger('onCancel')) { | ||
989 | 209 | return; | ||
990 | 210 | } | ||
991 | 211 | |||
992 | 212 | F.coming = null; | ||
993 | 213 | |||
994 | 214 | F.hideLoading(); | ||
995 | 215 | |||
996 | 216 | if (F.ajaxLoad) { | ||
997 | 217 | F.ajaxLoad.abort(); | ||
998 | 218 | } | ||
999 | 219 | |||
1000 | 220 | F.ajaxLoad = null; | ||
1001 | 221 | |||
1002 | 222 | if (F.imgPreload) { | ||
1003 | 223 | F.imgPreload.onload = F.imgPreload.onabort = F.imgPreload.onerror = null; | ||
1004 | 224 | } | ||
1005 | 225 | }, | ||
1006 | 226 | |||
1007 | 227 | close: function (a) { | ||
1008 | 228 | F.cancel(); | ||
1009 | 229 | |||
1010 | 230 | if (!F.current || false === F.trigger('beforeClose')) { | ||
1011 | 231 | return; | ||
1012 | 232 | } | ||
1013 | 233 | |||
1014 | 234 | F.unbindEvents(); | ||
1015 | 235 | |||
1016 | 236 | //If forced or is still opening then remove immediately | ||
1017 | 237 | if (!F.isOpen || (a && a[0] === true)) { | ||
1018 | 238 | $('.fancybox-wrap').stop().trigger('onReset').remove(); | ||
1019 | 239 | |||
1020 | 240 | F._afterZoomOut(); | ||
1021 | 241 | |||
1022 | 242 | } else { | ||
1023 | 243 | F.isOpen = F.isOpened = false; | ||
1024 | 244 | |||
1025 | 245 | $('.fancybox-item, .fancybox-nav').remove(); | ||
1026 | 246 | |||
1027 | 247 | F.wrap.stop(true).removeClass('fancybox-opened'); | ||
1028 | 248 | F.inner.css('overflow', 'hidden'); | ||
1029 | 249 | |||
1030 | 250 | F.transitions[F.current.closeMethod](); | ||
1031 | 251 | } | ||
1032 | 252 | }, | ||
1033 | 253 | |||
1034 | 254 | // Start/stop slideshow | ||
1035 | 255 | play: function (a) { | ||
1036 | 256 | var clear = function () { | ||
1037 | 257 | clearTimeout(F.player.timer); | ||
1038 | 258 | }, | ||
1039 | 259 | set = function () { | ||
1040 | 260 | clear(); | ||
1041 | 261 | |||
1042 | 262 | if (F.current && F.player.isActive) { | ||
1043 | 263 | F.player.timer = setTimeout(F.next, F.current.playSpeed); | ||
1044 | 264 | } | ||
1045 | 265 | }, | ||
1046 | 266 | stop = function () { | ||
1047 | 267 | clear(); | ||
1048 | 268 | |||
1049 | 269 | $('body').unbind('.player'); | ||
1050 | 270 | |||
1051 | 271 | F.player.isActive = false; | ||
1052 | 272 | |||
1053 | 273 | F.trigger('onPlayEnd'); | ||
1054 | 274 | }, | ||
1055 | 275 | start = function () { | ||
1056 | 276 | if (F.current && (F.current.loop || F.current.index < F.group.length - 1)) { | ||
1057 | 277 | F.player.isActive = true; | ||
1058 | 278 | |||
1059 | 279 | $('body').bind({ | ||
1060 | 280 | 'afterShow.player onUpdate.player': set, | ||
1061 | 281 | 'onCancel.player beforeClose.player': stop, | ||
1062 | 282 | 'beforeLoad.player': clear | ||
1063 | 283 | }); | ||
1064 | 284 | |||
1065 | 285 | set(); | ||
1066 | 286 | |||
1067 | 287 | F.trigger('onPlayStart'); | ||
1068 | 288 | } | ||
1069 | 289 | }; | ||
1070 | 290 | |||
1071 | 291 | if (F.player.isActive || (a && a[0] === false)) { | ||
1072 | 292 | stop(); | ||
1073 | 293 | } else { | ||
1074 | 294 | start(); | ||
1075 | 295 | } | ||
1076 | 296 | }, | ||
1077 | 297 | |||
1078 | 298 | next: function () { | ||
1079 | 299 | if (F.current) { | ||
1080 | 300 | F.jumpto(F.current.index + 1); | ||
1081 | 301 | } | ||
1082 | 302 | }, | ||
1083 | 303 | |||
1084 | 304 | prev: function () { | ||
1085 | 305 | if (F.current) { | ||
1086 | 306 | F.jumpto(F.current.index - 1); | ||
1087 | 307 | } | ||
1088 | 308 | }, | ||
1089 | 309 | |||
1090 | 310 | jumpto: function (index) { | ||
1091 | 311 | if (!F.current) { | ||
1092 | 312 | return; | ||
1093 | 313 | } | ||
1094 | 314 | |||
1095 | 315 | index = parseInt(index, 10); | ||
1096 | 316 | |||
1097 | 317 | if (F.group.length > 1 && F.current.loop) { | ||
1098 | 318 | if (index >= F.group.length) { | ||
1099 | 319 | index = 0; | ||
1100 | 320 | |||
1101 | 321 | } else if (index < 0) { | ||
1102 | 322 | index = F.group.length - 1; | ||
1103 | 323 | } | ||
1104 | 324 | } | ||
1105 | 325 | |||
1106 | 326 | if (F.group[index] !== undefined) { | ||
1107 | 327 | F.cancel(); | ||
1108 | 328 | |||
1109 | 329 | F._start(index); | ||
1110 | 330 | } | ||
1111 | 331 | }, | ||
1112 | 332 | |||
1113 | 333 | reposition: function (e, onlyAbsolute) { | ||
1114 | 334 | var pos; | ||
1115 | 335 | |||
1116 | 336 | if (F.isOpen) { | ||
1117 | 337 | pos = F._getPosition(onlyAbsolute); | ||
1118 | 338 | |||
1119 | 339 | if (e && e.type === 'scroll') { | ||
1120 | 340 | delete pos.position; | ||
1121 | 341 | |||
1122 | 342 | F.wrap.stop(true, true).animate(pos, 200); | ||
1123 | 343 | |||
1124 | 344 | } else { | ||
1125 | 345 | F.wrap.css(pos); | ||
1126 | 346 | } | ||
1127 | 347 | } | ||
1128 | 348 | }, | ||
1129 | 349 | |||
1130 | 350 | update: function (e) { | ||
1131 | 351 | if (!F.isOpen) { | ||
1132 | 352 | return; | ||
1133 | 353 | } | ||
1134 | 354 | |||
1135 | 355 | // Run this code after a delay for better performance | ||
1136 | 356 | if (!didResize) { | ||
1137 | 357 | resizeTimer = setTimeout(function () { | ||
1138 | 358 | var current = F.current, anyway = !e || (e && e.type === 'orientationchange'); | ||
1139 | 359 | |||
1140 | 360 | if (didResize) { | ||
1141 | 361 | didResize = false; | ||
1142 | 362 | |||
1143 | 363 | if (!current) { | ||
1144 | 364 | return; | ||
1145 | 365 | } | ||
1146 | 366 | |||
1147 | 367 | if ((!e || e.type !== 'scroll') || anyway) { | ||
1148 | 368 | if (current.autoSize && current.type !== 'iframe') { | ||
1149 | 369 | F.inner.height('auto'); | ||
1150 | 370 | current.height = F.inner.height(); | ||
1151 | 371 | } | ||
1152 | 372 | |||
1153 | 373 | if (current.autoResize || anyway) { | ||
1154 | 374 | F._setDimension(); | ||
1155 | 375 | } | ||
1156 | 376 | |||
1157 | 377 | if (current.canGrow && current.type !== 'iframe') { | ||
1158 | 378 | F.inner.height('auto'); | ||
1159 | 379 | } | ||
1160 | 380 | } | ||
1161 | 381 | |||
1162 | 382 | if (current.autoCenter || anyway) { | ||
1163 | 383 | F.reposition(e); | ||
1164 | 384 | } | ||
1165 | 385 | |||
1166 | 386 | F.trigger('onUpdate'); | ||
1167 | 387 | } | ||
1168 | 388 | }, 200); | ||
1169 | 389 | } | ||
1170 | 390 | |||
1171 | 391 | didResize = true; | ||
1172 | 392 | }, | ||
1173 | 393 | |||
1174 | 394 | toggle: function () { | ||
1175 | 395 | if (F.isOpen) { | ||
1176 | 396 | F.current.fitToView = !F.current.fitToView; | ||
1177 | 397 | |||
1178 | 398 | F.update(); | ||
1179 | 399 | } | ||
1180 | 400 | }, | ||
1181 | 401 | |||
1182 | 402 | hideLoading: function () { | ||
1183 | 403 | D.unbind('keypress.fb'); | ||
1184 | 404 | |||
1185 | 405 | $('#fancybox-loading').remove(); | ||
1186 | 406 | }, | ||
1187 | 407 | |||
1188 | 408 | showLoading: function () { | ||
1189 | 409 | F.hideLoading(); | ||
1190 | 410 | |||
1191 | 411 | //If user will press the escape-button, the request will be canceled | ||
1192 | 412 | D.bind('keypress.fb', function(e) { | ||
1193 | 413 | if (e.keyCode === 27) { | ||
1194 | 414 | e.preventDefault(); | ||
1195 | 415 | F.cancel(); | ||
1196 | 416 | } | ||
1197 | 417 | }); | ||
1198 | 418 | |||
1199 | 419 | $('<div id="fancybox-loading"><div></div></div>').click(F.cancel).appendTo('body'); | ||
1200 | 420 | }, | ||
1201 | 421 | |||
1202 | 422 | getViewport: function () { | ||
1203 | 423 | // See http://bugs.jquery.com/ticket/6724 | ||
1204 | 424 | return { | ||
1205 | 425 | x: W.scrollLeft(), | ||
1206 | 426 | y: W.scrollTop(), | ||
1207 | 427 | w: isTouch && window.innerWidth ? window.innerWidth : W.width(), | ||
1208 | 428 | h: isTouch && window.innerHeight ? window.innerHeight : W.height() | ||
1209 | 429 | }; | ||
1210 | 430 | }, | ||
1211 | 431 | |||
1212 | 432 | // Unbind the keyboard / clicking actions | ||
1213 | 433 | unbindEvents: function () { | ||
1214 | 434 | if (F.wrap) { | ||
1215 | 435 | F.wrap.unbind('.fb'); | ||
1216 | 436 | } | ||
1217 | 437 | |||
1218 | 438 | D.unbind('.fb'); | ||
1219 | 439 | W.unbind('.fb'); | ||
1220 | 440 | }, | ||
1221 | 441 | |||
1222 | 442 | bindEvents: function () { | ||
1223 | 443 | var current = F.current, | ||
1224 | 444 | keys = current.keys; | ||
1225 | 445 | |||
1226 | 446 | if (!current) { | ||
1227 | 447 | return; | ||
1228 | 448 | } | ||
1229 | 449 | |||
1230 | 450 | W.bind('resize.fb orientationchange.fb' + (current.autoCenter && !current.fixed ? ' scroll.fb' : ''), F.update); | ||
1231 | 451 | |||
1232 | 452 | if (keys) { | ||
1233 | 453 | D.bind('keydown.fb', function (e) { | ||
1234 | 454 | var code, target = e.target || e.srcElement; | ||
1235 | 455 | |||
1236 | 456 | // Ignore key combinations and key events within form elements | ||
1237 | 457 | if (!e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey && !(target && (target.type || $(target).is('[contenteditable]')))) { | ||
1238 | 458 | code = e.keyCode; | ||
1239 | 459 | |||
1240 | 460 | if ($.inArray(code, keys.close) > -1) { | ||
1241 | 461 | F.close(); | ||
1242 | 462 | e.preventDefault(); | ||
1243 | 463 | |||
1244 | 464 | } else if ($.inArray(code, keys.next) > -1) { | ||
1245 | 465 | F.next(); | ||
1246 | 466 | e.preventDefault(); | ||
1247 | 467 | |||
1248 | 468 | } else if ($.inArray(code, keys.prev) > -1) { | ||
1249 | 469 | F.prev(); | ||
1250 | 470 | e.preventDefault(); | ||
1251 | 471 | } | ||
1252 | 472 | } | ||
1253 | 473 | }); | ||
1254 | 474 | } | ||
1255 | 475 | |||
1256 | 476 | if ($.fn.mousewheel && current.mouseWheel && F.group.length > 1) { | ||
1257 | 477 | F.wrap.bind('mousewheel.fb', function (e, delta) { | ||
1258 | 478 | var target = e.target || null; | ||
1259 | 479 | |||
1260 | 480 | if (delta !== 0 && (!target || target.clientHeight === 0 || (target.scrollHeight === target.clientHeight && target.scrollWidth === target.clientWidth))) { | ||
1261 | 481 | e.preventDefault(); | ||
1262 | 482 | |||
1263 | 483 | F[delta > 0 ? 'prev' : 'next'](); | ||
1264 | 484 | } | ||
1265 | 485 | }); | ||
1266 | 486 | } | ||
1267 | 487 | }, | ||
1268 | 488 | |||
1269 | 489 | trigger: function (event, o) { | ||
1270 | 490 | var ret, obj = o || F[ $.inArray(event, ['onCancel', 'beforeLoad', 'afterLoad']) > -1 ? 'coming' : 'current' ]; | ||
1271 | 491 | |||
1272 | 492 | if (!obj) { | ||
1273 | 493 | return; | ||
1274 | 494 | } | ||
1275 | 495 | |||
1276 | 496 | if ($.isFunction( obj[event] )) { | ||
1277 | 497 | ret = obj[event].apply(obj, Array.prototype.slice.call(arguments, 1)); | ||
1278 | 498 | } | ||
1279 | 499 | |||
1280 | 500 | if (ret === false) { | ||
1281 | 501 | return false; | ||
1282 | 502 | } | ||
1283 | 503 | |||
1284 | 504 | if (obj.helpers) { | ||
1285 | 505 | $.each(obj.helpers, function (helper, opts) { | ||
1286 | 506 | if (opts && $.isPlainObject(F.helpers[helper]) && $.isFunction(F.helpers[helper][event])) { | ||
1287 | 507 | F.helpers[helper][event](opts, obj); | ||
1288 | 508 | } | ||
1289 | 509 | }); | ||
1290 | 510 | } | ||
1291 | 511 | |||
1292 | 512 | $.event.trigger(event + '.fb'); | ||
1293 | 513 | }, | ||
1294 | 514 | |||
1295 | 515 | isImage: function (str) { | ||
1296 | 516 | return isString(str) && str.match(/\.(jpe?g|gif|png|bmp)((\?|#).*)?$/i); | ||
1297 | 517 | }, | ||
1298 | 518 | |||
1299 | 519 | isSWF: function (str) { | ||
1300 | 520 | return isString(str) && str.match(/\.(swf)((\?|#).*)?$/i); | ||
1301 | 521 | }, | ||
1302 | 522 | |||
1303 | 523 | _start: function (index) { | ||
1304 | 524 | var coming = {}, | ||
1305 | 525 | element = F.group[index] || null, | ||
1306 | 526 | isDom, | ||
1307 | 527 | href, | ||
1308 | 528 | type, | ||
1309 | 529 | rez, | ||
1310 | 530 | hrefParts; | ||
1311 | 531 | |||
1312 | 532 | if (element && (element.nodeType || element instanceof $)) { | ||
1313 | 533 | isDom = true; | ||
1314 | 534 | |||
1315 | 535 | if ($.metadata) { | ||
1316 | 536 | coming = $(element).metadata(); | ||
1317 | 537 | } | ||
1318 | 538 | } | ||
1319 | 539 | |||
1320 | 540 | coming = $.extend(true, {}, F.opts, {index : index, element : element}, ($.isPlainObject(element) ? element : coming)); | ||
1321 | 541 | |||
1322 | 542 | // Re-check overridable options | ||
1323 | 543 | $.each(['href', 'title', 'content', 'type'], function(i,v) { | ||
1324 | 544 | coming[v] = F.opts[ v ] || (isDom && $(element).attr( v )) || coming[ v ] || null; | ||
1325 | 545 | }); | ||
1326 | 546 | |||
1327 | 547 | // Convert margin property to array - top, right, bottom, left | ||
1328 | 548 | if (typeof coming.margin === 'number') { | ||
1329 | 549 | coming.margin = [coming.margin, coming.margin, coming.margin, coming.margin]; | ||
1330 | 550 | } | ||
1331 | 551 | |||
1332 | 552 | // 'modal' propery is just a shortcut | ||
1333 | 553 | if (coming.modal) { | ||
1334 | 554 | $.extend(true, coming, { | ||
1335 | 555 | closeBtn : false, | ||
1336 | 556 | closeClick: false, | ||
1337 | 557 | nextClick : false, | ||
1338 | 558 | arrows : false, | ||
1339 | 559 | mouseWheel : false, | ||
1340 | 560 | keys : null, | ||
1341 | 561 | helpers: { | ||
1342 | 562 | overlay : { | ||
1343 | 563 | css: { | ||
1344 | 564 | cursor : 'auto' | ||
1345 | 565 | }, | ||
1346 | 566 | closeClick : false | ||
1347 | 567 | } | ||
1348 | 568 | } | ||
1349 | 569 | }); | ||
1350 | 570 | } | ||
1351 | 571 | |||
1352 | 572 | //Give a chance for callback or helpers to update coming item (type, title, etc) | ||
1353 | 573 | F.coming = coming; | ||
1354 | 574 | |||
1355 | 575 | if (false === F.trigger('beforeLoad')) { | ||
1356 | 576 | F.coming = null; | ||
1357 | 577 | return; | ||
1358 | 578 | } | ||
1359 | 579 | |||
1360 | 580 | type = coming.type; | ||
1361 | 581 | href = coming.href || element; | ||
1362 | 582 | |||
1363 | 583 | ///Check if content type is set, if not, try to get | ||
1364 | 584 | if (!type) { | ||
1365 | 585 | if (isDom) { | ||
1366 | 586 | type = $(element).data('fancybox-type'); | ||
1367 | 587 | |||
1368 | 588 | if (!type) { | ||
1369 | 589 | rez = element.className.match(/fancybox\.(\w+)/); | ||
1370 | 590 | type = rez ? rez[1] : null; | ||
1371 | 591 | } | ||
1372 | 592 | } | ||
1373 | 593 | |||
1374 | 594 | if (!type && isString(href)) { | ||
1375 | 595 | if (F.isImage(href)) { | ||
1376 | 596 | type = 'image'; | ||
1377 | 597 | |||
1378 | 598 | } else if (F.isSWF(href)) { | ||
1379 | 599 | type = 'swf'; | ||
1380 | 600 | |||
1381 | 601 | } else if (href.match(/^#/)) { | ||
1382 | 602 | type = 'inline'; | ||
1383 | 603 | } | ||
1384 | 604 | } | ||
1385 | 605 | |||
1386 | 606 | // ...if not - display element itself | ||
1387 | 607 | if (!type) { | ||
1388 | 608 | type = isDom ? 'inline' : 'html'; | ||
1389 | 609 | } | ||
1390 | 610 | |||
1391 | 611 | coming.type = type; | ||
1392 | 612 | } | ||
1393 | 613 | |||
1394 | 614 | // Check before try to load; 'inline' and 'html' types need content, others - href | ||
1395 | 615 | if (type === 'inline' || type === 'html') { | ||
1396 | 616 | if (!coming.content) { | ||
1397 | 617 | if (type === 'inline') { | ||
1398 | 618 | coming.content = $( isString(href) ? href.replace(/.*(?=#[^\s]+$)/, '') : href ); //strip for ie7 | ||
1399 | 619 | |||
1400 | 620 | } else { | ||
1401 | 621 | coming.content = element; | ||
1402 | 622 | } | ||
1403 | 623 | } | ||
1404 | 624 | |||
1405 | 625 | if (!coming.content || !coming.content.length) { | ||
1406 | 626 | type = null; | ||
1407 | 627 | } | ||
1408 | 628 | |||
1409 | 629 | } else if (!href) { | ||
1410 | 630 | type = null; | ||
1411 | 631 | } | ||
1412 | 632 | |||
1413 | 633 | /* | ||
1414 | 634 | * Add reference to the group, so it`s possible to access from callbacks, example: | ||
1415 | 635 | * afterLoad : function() { | ||
1416 | 636 | * this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : ''); | ||
1417 | 637 | * } | ||
1418 | 638 | */ | ||
1419 | 639 | |||
1420 | 640 | if (type === 'ajax' && isString(href)) { | ||
1421 | 641 | hrefParts = href.split(/\s+/, 2); | ||
1422 | 642 | |||
1423 | 643 | href = hrefParts.shift(); | ||
1424 | 644 | coming.selector = hrefParts.shift(); | ||
1425 | 645 | } | ||
1426 | 646 | |||
1427 | 647 | coming.href = href; | ||
1428 | 648 | coming.group = F.group; | ||
1429 | 649 | coming.isDom = isDom; | ||
1430 | 650 | |||
1431 | 651 | switch (type) { | ||
1432 | 652 | case 'image': | ||
1433 | 653 | F._loadImage(); | ||
1434 | 654 | break; | ||
1435 | 655 | |||
1436 | 656 | case 'ajax': | ||
1437 | 657 | F._loadAjax(); | ||
1438 | 658 | break; | ||
1439 | 659 | |||
1440 | 660 | case 'inline': | ||
1441 | 661 | case 'iframe': | ||
1442 | 662 | case 'swf': | ||
1443 | 663 | case 'html': | ||
1444 | 664 | F._afterLoad(); | ||
1445 | 665 | break; | ||
1446 | 666 | |||
1447 | 667 | default: | ||
1448 | 668 | F._error( 'type' ); | ||
1449 | 669 | } | ||
1450 | 670 | }, | ||
1451 | 671 | |||
1452 | 672 | _error: function ( type ) { | ||
1453 | 673 | F.hideLoading(); | ||
1454 | 674 | |||
1455 | 675 | $.extend(F.coming, { | ||
1456 | 676 | type : 'html', | ||
1457 | 677 | autoSize : true, | ||
1458 | 678 | minWidth : 0, | ||
1459 | 679 | minHeight : 0, | ||
1460 | 680 | padding : 15, | ||
1461 | 681 | hasError : type, | ||
1462 | 682 | content : F.coming.tpl.error | ||
1463 | 683 | }); | ||
1464 | 684 | |||
1465 | 685 | F._afterLoad(); | ||
1466 | 686 | }, | ||
1467 | 687 | |||
1468 | 688 | _loadImage: function () { | ||
1469 | 689 | // Reset preload image so it is later possible to check "complete" property | ||
1470 | 690 | var img = F.imgPreload = new Image(); | ||
1471 | 691 | |||
1472 | 692 | img.onload = function () { | ||
1473 | 693 | this.onload = this.onerror = null; | ||
1474 | 694 | |||
1475 | 695 | F.coming.width = this.width; | ||
1476 | 696 | F.coming.height = this.height; | ||
1477 | 697 | |||
1478 | 698 | F._afterLoad(); | ||
1479 | 699 | }; | ||
1480 | 700 | |||
1481 | 701 | img.onerror = function () { | ||
1482 | 702 | this.onload = this.onerror = null; | ||
1483 | 703 | |||
1484 | 704 | F._error( 'image' ); | ||
1485 | 705 | }; | ||
1486 | 706 | |||
1487 | 707 | img.src = F.coming.href; | ||
1488 | 708 | |||
1489 | 709 | if (img.complete === undefined || !img.complete) { | ||
1490 | 710 | F.showLoading(); | ||
1491 | 711 | } | ||
1492 | 712 | }, | ||
1493 | 713 | |||
1494 | 714 | _loadAjax: function () { | ||
1495 | 715 | F.showLoading(); | ||
1496 | 716 | |||
1497 | 717 | F.ajaxLoad = $.ajax($.extend({}, F.coming.ajax, { | ||
1498 | 718 | url: F.coming.href, | ||
1499 | 719 | error: function (jqXHR, textStatus) { | ||
1500 | 720 | if (F.coming && textStatus !== 'abort') { | ||
1501 | 721 | F._error( 'ajax', jqXHR ); | ||
1502 | 722 | |||
1503 | 723 | } else { | ||
1504 | 724 | F.hideLoading(); | ||
1505 | 725 | } | ||
1506 | 726 | }, | ||
1507 | 727 | success: function (data, textStatus) { | ||
1508 | 728 | if (textStatus === 'success') { | ||
1509 | 729 | F.coming.content = data; | ||
1510 | 730 | |||
1511 | 731 | F._afterLoad(); | ||
1512 | 732 | } | ||
1513 | 733 | } | ||
1514 | 734 | })); | ||
1515 | 735 | }, | ||
1516 | 736 | |||
1517 | 737 | _preloadImages: function() { | ||
1518 | 738 | var group = F.group, | ||
1519 | 739 | current = F.current, | ||
1520 | 740 | len = group.length, | ||
1521 | 741 | item, | ||
1522 | 742 | href, | ||
1523 | 743 | i, | ||
1524 | 744 | cnt = Math.min(current.preload, len - 1); | ||
1525 | 745 | |||
1526 | 746 | if (!current.preload || group.length < 2) { | ||
1527 | 747 | return; | ||
1528 | 748 | } | ||
1529 | 749 | |||
1530 | 750 | for (i = 1; i <= cnt; i += 1) { | ||
1531 | 751 | item = group[ (current.index + i ) % len ]; | ||
1532 | 752 | href = item.href || $( item ).attr('href') || item; | ||
1533 | 753 | |||
1534 | 754 | if (item.type === 'image' || F.isImage(href)) { | ||
1535 | 755 | new Image().src = href; | ||
1536 | 756 | } | ||
1537 | 757 | } | ||
1538 | 758 | }, | ||
1539 | 759 | |||
1540 | 760 | _afterLoad: function () { | ||
1541 | 761 | F.hideLoading(); | ||
1542 | 762 | |||
1543 | 763 | if (!F.coming || false === F.trigger('afterLoad', F.current)) { | ||
1544 | 764 | F.coming = false; | ||
1545 | 765 | |||
1546 | 766 | return; | ||
1547 | 767 | } | ||
1548 | 768 | |||
1549 | 769 | if (F.isOpened) { | ||
1550 | 770 | $('.fancybox-item, .fancybox-nav').remove(); | ||
1551 | 771 | |||
1552 | 772 | F.wrap.stop(true).removeClass('fancybox-opened'); | ||
1553 | 773 | F.inner.css('overflow', 'hidden'); | ||
1554 | 774 | |||
1555 | 775 | F.transitions[F.current.prevMethod](); | ||
1556 | 776 | |||
1557 | 777 | } else { | ||
1558 | 778 | $('.fancybox-wrap').stop().trigger('onReset').remove(); | ||
1559 | 779 | |||
1560 | 780 | F.trigger('afterClose'); | ||
1561 | 781 | } | ||
1562 | 782 | |||
1563 | 783 | F.unbindEvents(); | ||
1564 | 784 | |||
1565 | 785 | F.isOpen = false; | ||
1566 | 786 | F.current = F.coming; | ||
1567 | 787 | |||
1568 | 788 | //Build the neccessary markup | ||
1569 | 789 | F.wrap = $(F.current.tpl.wrap).addClass('fancybox-' + (isTouch ? 'mobile' : 'desktop') + ' fancybox-type-' + F.current.type + ' fancybox-tmp ' + F.current.wrapCSS).appendTo('body'); | ||
1570 | 790 | F.skin = $('.fancybox-skin', F.wrap).css('padding', getValue(F.current.padding)); | ||
1571 | 791 | F.outer = $('.fancybox-outer', F.wrap); | ||
1572 | 792 | F.inner = $('.fancybox-inner', F.wrap); | ||
1573 | 793 | |||
1574 | 794 | F._setContent(); | ||
1575 | 795 | }, | ||
1576 | 796 | |||
1577 | 797 | _setContent: function () { | ||
1578 | 798 | var current = F.current, | ||
1579 | 799 | content = current.content, | ||
1580 | 800 | type = current.type, | ||
1581 | 801 | minWidth = current.minWidth, | ||
1582 | 802 | minHeight = current.minHeight, | ||
1583 | 803 | maxWidth = current.maxWidth, | ||
1584 | 804 | maxHeight = current.maxHeight, | ||
1585 | 805 | loadingBay; | ||
1586 | 806 | |||
1587 | 807 | switch (type) { | ||
1588 | 808 | case 'inline': | ||
1589 | 809 | case 'ajax': | ||
1590 | 810 | case 'html': | ||
1591 | 811 | if (current.selector) { | ||
1592 | 812 | content = $('<div>').html(content).find(current.selector); | ||
1593 | 813 | |||
1594 | 814 | } else if (content instanceof $) { | ||
1595 | 815 | if (content.parent().hasClass('fancybox-inner')) { | ||
1596 | 816 | content.parents('.fancybox-wrap').unbind('onReset'); | ||
1597 | 817 | } | ||
1598 | 818 | |||
1599 | 819 | content = content.show().detach(); | ||
1600 | 820 | |||
1601 | 821 | $(F.wrap).bind('onReset', function () { | ||
1602 | 822 | content.appendTo('body').hide(); | ||
1603 | 823 | }); | ||
1604 | 824 | } | ||
1605 | 825 | |||
1606 | 826 | if (current.autoSize) { | ||
1607 | 827 | loadingBay = $('<div class="fancybox-wrap ' + F.current.wrapCSS + ' fancybox-tmp"></div>') | ||
1608 | 828 | .appendTo('body') | ||
1609 | 829 | .css({ | ||
1610 | 830 | minWidth : getValue(minWidth, 'w'), | ||
1611 | 831 | minHeight : getValue(minHeight, 'h'), | ||
1612 | 832 | maxWidth : getValue(maxWidth, 'w'), | ||
1613 | 833 | maxHeight : getValue(maxHeight, 'h') | ||
1614 | 834 | }) | ||
1615 | 835 | .append(content); | ||
1616 | 836 | |||
1617 | 837 | current.width = loadingBay.width(); | ||
1618 | 838 | current.height = loadingBay.height(); | ||
1619 | 839 | |||
1620 | 840 | // Re-check to fix 1px bug in some browsers | ||
1621 | 841 | loadingBay.width( F.current.width ); | ||
1622 | 842 | |||
1623 | 843 | if (loadingBay.height() > current.height) { | ||
1624 | 844 | loadingBay.width(current.width + 1); | ||
1625 | 845 | |||
1626 | 846 | current.width = loadingBay.width(); | ||
1627 | 847 | current.height = loadingBay.height(); | ||
1628 | 848 | } | ||
1629 | 849 | |||
1630 | 850 | content = loadingBay.contents().detach(); | ||
1631 | 851 | |||
1632 | 852 | loadingBay.remove(); | ||
1633 | 853 | } | ||
1634 | 854 | |||
1635 | 855 | break; | ||
1636 | 856 | |||
1637 | 857 | case 'image': | ||
1638 | 858 | content = current.tpl.image.replace('{href}', current.href); | ||
1639 | 859 | |||
1640 | 860 | current.aspectRatio = true; | ||
1641 | 861 | break; | ||
1642 | 862 | |||
1643 | 863 | case 'swf': | ||
1644 | 864 | content = current.tpl.swf.replace(/\{width\}/g, current.width).replace(/\{height\}/g, current.height).replace(/\{href\}/g, current.href); | ||
1645 | 865 | break; | ||
1646 | 866 | |||
1647 | 867 | case 'iframe': | ||
1648 | 868 | content = $(current.tpl.iframe.replace('{rnd}', new Date().getTime()) ) | ||
1649 | 869 | .attr('scrolling', current.scrolling) | ||
1650 | 870 | .attr('src', current.href); | ||
1651 | 871 | |||
1652 | 872 | current.scrolling = isTouch ? 'scroll' : 'auto'; | ||
1653 | 873 | |||
1654 | 874 | break; | ||
1655 | 875 | } | ||
1656 | 876 | |||
1657 | 877 | if (type === 'image' || type === 'swf') { | ||
1658 | 878 | current.autoSize = false; | ||
1659 | 879 | current.scrolling = 'visible'; | ||
1660 | 880 | } | ||
1661 | 881 | |||
1662 | 882 | if (type === 'iframe' && current.autoSize) { | ||
1663 | 883 | F.showLoading(); | ||
1664 | 884 | |||
1665 | 885 | F._setDimension(); | ||
1666 | 886 | |||
1667 | 887 | F.inner.css('overflow', current.scrolling); | ||
1668 | 888 | |||
1669 | 889 | content.bind({ | ||
1670 | 890 | onCancel : function() { | ||
1671 | 891 | $(this).unbind(); | ||
1672 | 892 | |||
1673 | 893 | F._afterZoomOut(); | ||
1674 | 894 | }, | ||
1675 | 895 | load : function() { | ||
1676 | 896 | F.hideLoading(); | ||
1677 | 897 | |||
1678 | 898 | try { | ||
1679 | 899 | if (this.contentWindow.document.location) { | ||
1680 | 900 | F.current.height = $(this).contents().find('body').height(); | ||
1681 | 901 | } | ||
1682 | 902 | } catch (e) { | ||
1683 | 903 | F.current.autoSize = false; | ||
1684 | 904 | } | ||
1685 | 905 | |||
1686 | 906 | F[ F.isOpen ? '_afterZoomIn' : '_beforeShow'](); | ||
1687 | 907 | } | ||
1688 | 908 | }).appendTo(F.inner); | ||
1689 | 909 | |||
1690 | 910 | } else { | ||
1691 | 911 | F.inner.append(content); | ||
1692 | 912 | |||
1693 | 913 | F._beforeShow(); | ||
1694 | 914 | } | ||
1695 | 915 | }, | ||
1696 | 916 | |||
1697 | 917 | _beforeShow : function() { | ||
1698 | 918 | F.coming = null; | ||
1699 | 919 | |||
1700 | 920 | //Give a chance for helpers or callbacks to update elements | ||
1701 | 921 | F.trigger('beforeShow'); | ||
1702 | 922 | |||
1703 | 923 | //Set initial dimensions and hide | ||
1704 | 924 | F._setDimension(); | ||
1705 | 925 | F.wrap.hide().removeClass('fancybox-tmp'); | ||
1706 | 926 | |||
1707 | 927 | F.bindEvents(); | ||
1708 | 928 | |||
1709 | 929 | F._preloadImages(); | ||
1710 | 930 | |||
1711 | 931 | F.transitions[ F.isOpened ? F.current.nextMethod : F.current.openMethod ](); | ||
1712 | 932 | }, | ||
1713 | 933 | |||
1714 | 934 | _setDimension: function () { | ||
1715 | 935 | var wrap = F.wrap, | ||
1716 | 936 | inner = F.inner, | ||
1717 | 937 | current = F.current, | ||
1718 | 938 | viewport = F.getViewport(), | ||
1719 | 939 | margin = current.margin, | ||
1720 | 940 | padding2 = current.padding * 2, | ||
1721 | 941 | width = current.width, | ||
1722 | 942 | height = current.height, | ||
1723 | 943 | maxWidth = current.maxWidth + padding2, | ||
1724 | 944 | maxHeight = current.maxHeight + padding2, | ||
1725 | 945 | minWidth = current.minWidth + padding2, | ||
1726 | 946 | minHeight = current.minHeight + padding2, | ||
1727 | 947 | ratio, | ||
1728 | 948 | height_; | ||
1729 | 949 | |||
1730 | 950 | viewport.w -= (margin[1] + margin[3]); | ||
1731 | 951 | viewport.h -= (margin[0] + margin[2]); | ||
1732 | 952 | |||
1733 | 953 | if (isPercentage(width)) { | ||
1734 | 954 | width = (((viewport.w - padding2) * parseFloat(width)) / 100); | ||
1735 | 955 | } | ||
1736 | 956 | |||
1737 | 957 | if (isPercentage(height)) { | ||
1738 | 958 | height = (((viewport.h - padding2) * parseFloat(height)) / 100); | ||
1739 | 959 | } | ||
1740 | 960 | |||
1741 | 961 | ratio = width / height; | ||
1742 | 962 | width += padding2; | ||
1743 | 963 | height += padding2; | ||
1744 | 964 | |||
1745 | 965 | if (current.fitToView) { | ||
1746 | 966 | maxWidth = Math.min(viewport.w, maxWidth); | ||
1747 | 967 | maxHeight = Math.min(viewport.h, maxHeight); | ||
1748 | 968 | } | ||
1749 | 969 | |||
1750 | 970 | if (current.aspectRatio) { | ||
1751 | 971 | if (width > maxWidth) { | ||
1752 | 972 | width = maxWidth; | ||
1753 | 973 | height = ((width - padding2) / ratio) + padding2; | ||
1754 | 974 | } | ||
1755 | 975 | |||
1756 | 976 | if (height > maxHeight) { | ||
1757 | 977 | height = maxHeight; | ||
1758 | 978 | width = ((height - padding2) * ratio) + padding2; | ||
1759 | 979 | } | ||
1760 | 980 | |||
1761 | 981 | if (width < minWidth) { | ||
1762 | 982 | width = minWidth; | ||
1763 | 983 | height = ((width - padding2) / ratio) + padding2; | ||
1764 | 984 | } | ||
1765 | 985 | |||
1766 | 986 | if (height < minHeight) { | ||
1767 | 987 | height = minHeight; | ||
1768 | 988 | width = ((height - padding2) * ratio) + padding2; | ||
1769 | 989 | } | ||
1770 | 990 | |||
1771 | 991 | } else { | ||
1772 | 992 | width = Math.max(minWidth, Math.min(width, maxWidth)); | ||
1773 | 993 | height = Math.max(minHeight, Math.min(height, maxHeight)); | ||
1774 | 994 | } | ||
1775 | 995 | |||
1776 | 996 | width = Math.round(width); | ||
1777 | 997 | height = Math.round(height); | ||
1778 | 998 | |||
1779 | 999 | //Reset dimensions | ||
1780 | 1000 | $(wrap.add(inner)).width('auto').height('auto'); | ||
1781 | 1001 | |||
1782 | 1002 | inner.width(width - padding2).height(height - padding2); | ||
1783 | 1003 | wrap.width(width); | ||
1784 | 1004 | |||
1785 | 1005 | height_ = wrap.height(); // Real wrap height | ||
1786 | 1006 | |||
1787 | 1007 | //Fit wrapper inside | ||
1788 | 1008 | if (width > maxWidth || height_ > maxHeight) { | ||
1789 | 1009 | while ((width > maxWidth || height_ > maxHeight) && width > minWidth && height_ > minHeight) { | ||
1790 | 1010 | height = height - 10; | ||
1791 | 1011 | |||
1792 | 1012 | if (current.aspectRatio) { | ||
1793 | 1013 | width = Math.round(((height - padding2) * ratio) + padding2); | ||
1794 | 1014 | |||
1795 | 1015 | if (width < minWidth) { | ||
1796 | 1016 | width = minWidth; | ||
1797 | 1017 | height = ((width - padding2) / ratio) + padding2; | ||
1798 | 1018 | } | ||
1799 | 1019 | |||
1800 | 1020 | } else { | ||
1801 | 1021 | width = width - 10; | ||
1802 | 1022 | } | ||
1803 | 1023 | |||
1804 | 1024 | inner.width(width - padding2).height(height - padding2); | ||
1805 | 1025 | wrap.width(width); | ||
1806 | 1026 | |||
1807 | 1027 | height_ = wrap.height(); | ||
1808 | 1028 | } | ||
1809 | 1029 | } | ||
1810 | 1030 | |||
1811 | 1031 | current.dim = { | ||
1812 | 1032 | width : getValue(width), | ||
1813 | 1033 | height : getValue(height_) | ||
1814 | 1034 | }; | ||
1815 | 1035 | |||
1816 | 1036 | current.canGrow = current.autoSize && height > minHeight && height < maxHeight; | ||
1817 | 1037 | current.canShrink = false; | ||
1818 | 1038 | current.canExpand = false; | ||
1819 | 1039 | |||
1820 | 1040 | if ((width - padding2) < current.width || (height - padding2) < current.height) { | ||
1821 | 1041 | current.canExpand = true; | ||
1822 | 1042 | |||
1823 | 1043 | } else if ((width > viewport.w || height_ > viewport.h) && width > minWidth && height > minHeight) { | ||
1824 | 1044 | current.canShrink = true; | ||
1825 | 1045 | } | ||
1826 | 1046 | |||
1827 | 1047 | F.innerSpace = height_ - padding2 - inner.height(); | ||
1828 | 1048 | }, | ||
1829 | 1049 | |||
1830 | 1050 | _getPosition: function (onlyAbsolute) { | ||
1831 | 1051 | var current = F.current, | ||
1832 | 1052 | viewport = F.getViewport(), | ||
1833 | 1053 | margin = current.margin, | ||
1834 | 1054 | width = F.wrap.width() + margin[1] + margin[3], | ||
1835 | 1055 | height = F.wrap.height() + margin[0] + margin[2], | ||
1836 | 1056 | rez = { | ||
1837 | 1057 | position: 'absolute', | ||
1838 | 1058 | top : margin[0] + viewport.y, | ||
1839 | 1059 | left : margin[3] + viewport.x | ||
1840 | 1060 | }; | ||
1841 | 1061 | |||
1842 | 1062 | if (current.autoCenter && current.fixed && !onlyAbsolute && height <= viewport.h && width <= viewport.w) { | ||
1843 | 1063 | rez = { | ||
1844 | 1064 | position: 'fixed', | ||
1845 | 1065 | top : margin[0], | ||
1846 | 1066 | left : margin[3] | ||
1847 | 1067 | }; | ||
1848 | 1068 | } | ||
1849 | 1069 | |||
1850 | 1070 | rez.top = getValue(Math.max(rez.top, rez.top + ((viewport.h - height) * current.topRatio))); | ||
1851 | 1071 | rez.left = getValue(Math.max(rez.left, rez.left + ((viewport.w - width) * 0.5))); | ||
1852 | 1072 | |||
1853 | 1073 | return rez; | ||
1854 | 1074 | }, | ||
1855 | 1075 | |||
1856 | 1076 | _afterZoomIn: function () { | ||
1857 | 1077 | var current = F.current, scrolling = current ? current.scrolling : 'no'; | ||
1858 | 1078 | |||
1859 | 1079 | if (!current) { | ||
1860 | 1080 | return; | ||
1861 | 1081 | } | ||
1862 | 1082 | |||
1863 | 1083 | F.isOpen = F.isOpened = true; | ||
1864 | 1084 | |||
1865 | 1085 | F.wrap.addClass('fancybox-opened'); | ||
1866 | 1086 | |||
1867 | 1087 | F.inner.css('overflow', scrolling === 'yes' ? 'scroll' : (scrolling === 'no' ? 'hidden' : scrolling)); | ||
1868 | 1088 | |||
1869 | 1089 | F.trigger('afterShow'); | ||
1870 | 1090 | |||
1871 | 1091 | F.update(); | ||
1872 | 1092 | |||
1873 | 1093 | //Assign a click event | ||
1874 | 1094 | if (current.closeClick || current.nextClick) { | ||
1875 | 1095 | F.inner.css('cursor', 'pointer').bind('click.fb', function(e) { | ||
1876 | 1096 | if (!$(e.target).is('a') && !$(e.target).parent().is('a')) { | ||
1877 | 1097 | F[ current.closeClick ? 'close' : 'next' ](); | ||
1878 | 1098 | } | ||
1879 | 1099 | }); | ||
1880 | 1100 | } | ||
1881 | 1101 | |||
1882 | 1102 | //Create a close button | ||
1883 | 1103 | if (current.closeBtn) { | ||
1884 | 1104 | $(current.tpl.closeBtn).appendTo(F.skin).bind('click.fb', F.close); | ||
1885 | 1105 | } | ||
1886 | 1106 | |||
1887 | 1107 | //Create navigation arrows | ||
1888 | 1108 | if (current.arrows && F.group.length > 1) { | ||
1889 | 1109 | if (current.loop || current.index > 0) { | ||
1890 | 1110 | $(current.tpl.prev).appendTo(F.outer).bind('click.fb', F.prev); | ||
1891 | 1111 | } | ||
1892 | 1112 | |||
1893 | 1113 | if (current.loop || current.index < F.group.length - 1) { | ||
1894 | 1114 | $(current.tpl.next).appendTo(F.outer).bind('click.fb', F.next); | ||
1895 | 1115 | } | ||
1896 | 1116 | } | ||
1897 | 1117 | |||
1898 | 1118 | if (F.opts.autoPlay && !F.player.isActive) { | ||
1899 | 1119 | F.opts.autoPlay = false; | ||
1900 | 1120 | |||
1901 | 1121 | F.play(); | ||
1902 | 1122 | } | ||
1903 | 1123 | }, | ||
1904 | 1124 | |||
1905 | 1125 | _afterZoomOut: function () { | ||
1906 | 1126 | var current = F.current; | ||
1907 | 1127 | |||
1908 | 1128 | F.wrap.trigger('onReset').remove(); | ||
1909 | 1129 | |||
1910 | 1130 | $.extend(F, { | ||
1911 | 1131 | group: {}, | ||
1912 | 1132 | opts: {}, | ||
1913 | 1133 | current: null, | ||
1914 | 1134 | isActive: false, | ||
1915 | 1135 | isOpened: false, | ||
1916 | 1136 | isOpen: false, | ||
1917 | 1137 | wrap: null, | ||
1918 | 1138 | skin: null, | ||
1919 | 1139 | outer: null, | ||
1920 | 1140 | inner: null | ||
1921 | 1141 | }); | ||
1922 | 1142 | |||
1923 | 1143 | F.trigger('afterClose', current); | ||
1924 | 1144 | } | ||
1925 | 1145 | }); | ||
1926 | 1146 | |||
1927 | 1147 | /* | ||
1928 | 1148 | * Default transitions | ||
1929 | 1149 | */ | ||
1930 | 1150 | |||
1931 | 1151 | F.transitions = { | ||
1932 | 1152 | getOrigPosition: function () { | ||
1933 | 1153 | var current = F.current, | ||
1934 | 1154 | element = current.element, | ||
1935 | 1155 | padding = current.padding, | ||
1936 | 1156 | orig = $(current.orig), | ||
1937 | 1157 | pos = {}, | ||
1938 | 1158 | width = 50, | ||
1939 | 1159 | height = 50, | ||
1940 | 1160 | viewport; | ||
1941 | 1161 | |||
1942 | 1162 | if (!orig.length && current.isDom && $(element).is(':visible')) { | ||
1943 | 1163 | orig = $(element).find('img:first'); | ||
1944 | 1164 | |||
1945 | 1165 | if (!orig.length) { | ||
1946 | 1166 | orig = $(element); | ||
1947 | 1167 | } | ||
1948 | 1168 | } | ||
1949 | 1169 | |||
1950 | 1170 | if (orig.length) { | ||
1951 | 1171 | pos = orig.offset(); | ||
1952 | 1172 | |||
1953 | 1173 | if (orig.is('img')) { | ||
1954 | 1174 | width = orig.outerWidth(); | ||
1955 | 1175 | height = orig.outerHeight(); | ||
1956 | 1176 | } | ||
1957 | 1177 | |||
1958 | 1178 | } else { | ||
1959 | 1179 | viewport = F.getViewport(); | ||
1960 | 1180 | |||
1961 | 1181 | pos.top = viewport.y + (viewport.h - height) * 0.5; | ||
1962 | 1182 | pos.left = viewport.x + (viewport.w - width) * 0.5; | ||
1963 | 1183 | } | ||
1964 | 1184 | |||
1965 | 1185 | pos = { | ||
1966 | 1186 | top : getValue(pos.top - padding), | ||
1967 | 1187 | left : getValue(pos.left - padding), | ||
1968 | 1188 | width : getValue(width + padding * 2), | ||
1969 | 1189 | height : getValue(height + padding * 2) | ||
1970 | 1190 | }; | ||
1971 | 1191 | |||
1972 | 1192 | return pos; | ||
1973 | 1193 | }, | ||
1974 | 1194 | |||
1975 | 1195 | step: function (now, fx) { | ||
1976 | 1196 | var prop = fx.prop, value, ratio; | ||
1977 | 1197 | |||
1978 | 1198 | if (prop === 'width' || prop === 'height') { | ||
1979 | 1199 | value = Math.ceil(now - (F.current.padding * 2)); | ||
1980 | 1200 | |||
1981 | 1201 | if (prop === 'height') { | ||
1982 | 1202 | ratio = (now - fx.start) / (fx.end - fx.start); | ||
1983 | 1203 | |||
1984 | 1204 | if (fx.start > fx.end) { | ||
1985 | 1205 | ratio = 1 - ratio; | ||
1986 | 1206 | } | ||
1987 | 1207 | |||
1988 | 1208 | value -= F.innerSpace * ratio; | ||
1989 | 1209 | } | ||
1990 | 1210 | |||
1991 | 1211 | F.inner[prop](value); | ||
1992 | 1212 | } | ||
1993 | 1213 | }, | ||
1994 | 1214 | |||
1995 | 1215 | zoomIn: function () { | ||
1996 | 1216 | var wrap = F.wrap, | ||
1997 | 1217 | current = F.current, | ||
1998 | 1218 | effect = current.openEffect, | ||
1999 | 1219 | elastic = effect === 'elastic', | ||
2000 | 1220 | dim = current.dim, | ||
2001 | 1221 | startPos = $.extend({}, dim, F._getPosition( elastic )), | ||
2002 | 1222 | endPos = $.extend({opacity : 1}, startPos); | ||
2003 | 1223 | |||
2004 | 1224 | //Remove "position" property that breaks older IE | ||
2005 | 1225 | delete endPos.position; | ||
2006 | 1226 | |||
2007 | 1227 | if (elastic) { | ||
2008 | 1228 | startPos = this.getOrigPosition(); | ||
2009 | 1229 | |||
2010 | 1230 | if (current.openOpacity) { | ||
2011 | 1231 | startPos.opacity = 0; | ||
2012 | 1232 | } | ||
2013 | 1233 | |||
2014 | 1234 | F.outer.add(F.inner).width('auto').height('auto'); | ||
2015 | 1235 | |||
2016 | 1236 | } else if (effect === 'fade') { | ||
2017 | 1237 | startPos.opacity = 0; | ||
2018 | 1238 | } | ||
2019 | 1239 | |||
2020 | 1240 | wrap.css(startPos) | ||
2021 | 1241 | .show() | ||
2022 | 1242 | .animate(endPos, { | ||
2023 | 1243 | duration : effect === 'none' ? 0 : current.openSpeed, | ||
2024 | 1244 | easing : current.openEasing, | ||
2025 | 1245 | step : elastic ? this.step : null, | ||
2026 | 1246 | complete : F._afterZoomIn | ||
2027 | 1247 | }); | ||
2028 | 1248 | }, | ||
2029 | 1249 | |||
2030 | 1250 | zoomOut: function () { | ||
2031 | 1251 | var wrap = F.wrap, | ||
2032 | 1252 | current = F.current, | ||
2033 | 1253 | effect = current.openEffect, | ||
2034 | 1254 | elastic = effect === 'elastic', | ||
2035 | 1255 | endPos = {opacity : 0}; | ||
2036 | 1256 | |||
2037 | 1257 | if (elastic) { | ||
2038 | 1258 | if (wrap.css('position') === 'fixed') { | ||
2039 | 1259 | wrap.css(F._getPosition(true)); | ||
2040 | 1260 | } | ||
2041 | 1261 | |||
2042 | 1262 | endPos = this.getOrigPosition(); | ||
2043 | 1263 | |||
2044 | 1264 | if (current.closeOpacity) { | ||
2045 | 1265 | endPos.opacity = 0; | ||
2046 | 1266 | } | ||
2047 | 1267 | } | ||
2048 | 1268 | |||
2049 | 1269 | wrap.animate(endPos, { | ||
2050 | 1270 | duration : effect === 'none' ? 0 : current.closeSpeed, | ||
2051 | 1271 | easing : current.closeEasing, | ||
2052 | 1272 | step : elastic ? this.step : null, | ||
2053 | 1273 | complete : F._afterZoomOut | ||
2054 | 1274 | }); | ||
2055 | 1275 | }, | ||
2056 | 1276 | |||
2057 | 1277 | changeIn: function () { | ||
2058 | 1278 | var wrap = F.wrap, | ||
2059 | 1279 | current = F.current, | ||
2060 | 1280 | effect = current.nextEffect, | ||
2061 | 1281 | elastic = effect === 'elastic', | ||
2062 | 1282 | startPos = F._getPosition( elastic ), | ||
2063 | 1283 | endPos = { opacity : 1 }; | ||
2064 | 1284 | |||
2065 | 1285 | startPos.opacity = 0; | ||
2066 | 1286 | |||
2067 | 1287 | if (elastic) { | ||
2068 | 1288 | startPos.top = getValue(parseInt(startPos.top, 10) - 200); | ||
2069 | 1289 | endPos.top = '+=200px'; | ||
2070 | 1290 | } | ||
2071 | 1291 | |||
2072 | 1292 | wrap.css(startPos) | ||
2073 | 1293 | .show() | ||
2074 | 1294 | .animate(endPos, { | ||
2075 | 1295 | duration : effect === 'none' ? 0 : current.nextSpeed, | ||
2076 | 1296 | easing : current.nextEasing, | ||
2077 | 1297 | complete : F._afterZoomIn | ||
2078 | 1298 | }); | ||
2079 | 1299 | }, | ||
2080 | 1300 | |||
2081 | 1301 | changeOut: function () { | ||
2082 | 1302 | var wrap = F.wrap, | ||
2083 | 1303 | current = F.current, | ||
2084 | 1304 | effect = current.prevEffect, | ||
2085 | 1305 | endPos = { opacity : 0 }, | ||
2086 | 1306 | cleanUp = function () { | ||
2087 | 1307 | $(this).trigger('onReset').remove(); | ||
2088 | 1308 | }; | ||
2089 | 1309 | |||
2090 | 1310 | wrap.removeClass('fancybox-opened'); | ||
2091 | 1311 | |||
2092 | 1312 | if (effect === 'elastic') { | ||
2093 | 1313 | endPos.top = '+=200px'; | ||
2094 | 1314 | } | ||
2095 | 1315 | |||
2096 | 1316 | wrap.animate(endPos, { | ||
2097 | 1317 | duration : effect === 'none' ? 0 : current.prevSpeed, | ||
2098 | 1318 | easing : current.prevEasing, | ||
2099 | 1319 | complete : cleanUp | ||
2100 | 1320 | }); | ||
2101 | 1321 | } | ||
2102 | 1322 | }; | ||
2103 | 1323 | |||
2104 | 1324 | /* | ||
2105 | 1325 | * Overlay helper | ||
2106 | 1326 | */ | ||
2107 | 1327 | |||
2108 | 1328 | F.helpers.overlay = { | ||
2109 | 1329 | overlay: null, | ||
2110 | 1330 | |||
2111 | 1331 | update: function () { | ||
2112 | 1332 | var width, scrollWidth, offsetWidth; | ||
2113 | 1333 | |||
2114 | 1334 | //Reset width/height so it will not mess | ||
2115 | 1335 | this.overlay.width('100%').height('100%'); | ||
2116 | 1336 | |||
2117 | 1337 | if ($.browser.msie || isTouch) { | ||
2118 | 1338 | scrollWidth = Math.max(document.documentElement.scrollWidth, document.body.scrollWidth); | ||
2119 | 1339 | offsetWidth = Math.max(document.documentElement.offsetWidth, document.body.offsetWidth); | ||
2120 | 1340 | |||
2121 | 1341 | width = scrollWidth < offsetWidth ? W.width() : scrollWidth; | ||
2122 | 1342 | |||
2123 | 1343 | } else { | ||
2124 | 1344 | width = D.width(); | ||
2125 | 1345 | } | ||
2126 | 1346 | |||
2127 | 1347 | this.overlay.width(width).height(D.height()); | ||
2128 | 1348 | }, | ||
2129 | 1349 | |||
2130 | 1350 | beforeShow: function (opts) { | ||
2131 | 1351 | if (this.overlay) { | ||
2132 | 1352 | return; | ||
2133 | 1353 | } | ||
2134 | 1354 | |||
2135 | 1355 | opts = $.extend(true, {}, F.defaults.helpers.overlay, opts); | ||
2136 | 1356 | |||
2137 | 1357 | this.overlay = $('<div id="fancybox-overlay"></div>').css(opts.css).appendTo('body'); | ||
2138 | 1358 | |||
2139 | 1359 | if (opts.closeClick) { | ||
2140 | 1360 | this.overlay.bind('click.fb', F.close); | ||
2141 | 1361 | } | ||
2142 | 1362 | |||
2143 | 1363 | if (F.current.fixed && !isTouch) { | ||
2144 | 1364 | this.overlay.addClass('overlay-fixed'); | ||
2145 | 1365 | |||
2146 | 1366 | } else { | ||
2147 | 1367 | this.update(); | ||
2148 | 1368 | |||
2149 | 1369 | this.onUpdate = function () { | ||
2150 | 1370 | this.update(); | ||
2151 | 1371 | }; | ||
2152 | 1372 | } | ||
2153 | 1373 | |||
2154 | 1374 | this.overlay.fadeTo(opts.speedIn, opts.opacity); | ||
2155 | 1375 | }, | ||
2156 | 1376 | |||
2157 | 1377 | afterClose: function (opts) { | ||
2158 | 1378 | if (this.overlay) { | ||
2159 | 1379 | this.overlay.fadeOut(opts.speedOut || 0, function () { | ||
2160 | 1380 | $(this).remove(); | ||
2161 | 1381 | }); | ||
2162 | 1382 | } | ||
2163 | 1383 | |||
2164 | 1384 | this.overlay = null; | ||
2165 | 1385 | } | ||
2166 | 1386 | }; | ||
2167 | 1387 | |||
2168 | 1388 | /* | ||
2169 | 1389 | * Title helper | ||
2170 | 1390 | */ | ||
2171 | 1391 | |||
2172 | 1392 | F.helpers.title = { | ||
2173 | 1393 | beforeShow: function (opts) { | ||
2174 | 1394 | var title, text = F.current.title; | ||
2175 | 1395 | |||
2176 | 1396 | if (text) { | ||
2177 | 1397 | title = $('<div class="fancybox-title fancybox-title-' + opts.type + '-wrap">' + text + '</div>').appendTo('body'); | ||
2178 | 1398 | |||
2179 | 1399 | if (opts.type === 'float') { | ||
2180 | 1400 | //This helps for some browsers | ||
2181 | 1401 | title.width(title.width()); | ||
2182 | 1402 | |||
2183 | 1403 | title.wrapInner('<span class="child"></span>'); | ||
2184 | 1404 | |||
2185 | 1405 | //Increase bottom margin so this title will also fit into viewport | ||
2186 | 1406 | F.current.margin[2] += Math.abs(parseInt(title.css('margin-bottom'), 10)); | ||
2187 | 1407 | } | ||
2188 | 1408 | |||
2189 | 1409 | title.appendTo(opts.type === 'over' ? F.inner : (opts.type === 'outside' ? F.wrap : F.skin)); | ||
2190 | 1410 | } | ||
2191 | 1411 | } | ||
2192 | 1412 | }; | ||
2193 | 1413 | |||
2194 | 1414 | // jQuery plugin initialization | ||
2195 | 1415 | $.fn.fancybox = function (options) { | ||
2196 | 1416 | var that = $(this), | ||
2197 | 1417 | selector = this.selector || '', | ||
2198 | 1418 | index, | ||
2199 | 1419 | run = function(e) { | ||
2200 | 1420 | var what = this, idx = index, relType, relVal; | ||
2201 | 1421 | |||
2202 | 1422 | if (!(e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) && !$(what).is('.fancybox-wrap')) { | ||
2203 | 1423 | e.preventDefault(); | ||
2204 | 1424 | |||
2205 | 1425 | relType = options.groupAttr || 'data-fancybox-group'; | ||
2206 | 1426 | relVal = $(what).attr(relType); | ||
2207 | 1427 | |||
2208 | 1428 | if (!relVal) { | ||
2209 | 1429 | relType = 'rel'; | ||
2210 | 1430 | relVal = what[ relType ]; | ||
2211 | 1431 | } | ||
2212 | 1432 | |||
2213 | 1433 | if (relVal && relVal !== '' && relVal !== 'nofollow') { | ||
2214 | 1434 | what = selector.length ? $(selector) : that; | ||
2215 | 1435 | what = what.filter('[' + relType + '="' + relVal + '"]'); | ||
2216 | 1436 | idx = what.index(this); | ||
2217 | 1437 | } | ||
2218 | 1438 | |||
2219 | 1439 | options.index = idx; | ||
2220 | 1440 | |||
2221 | 1441 | F.open(what, options); | ||
2222 | 1442 | } | ||
2223 | 1443 | }; | ||
2224 | 1444 | |||
2225 | 1445 | options = options || {}; | ||
2226 | 1446 | index = options.index || 0; | ||
2227 | 1447 | |||
2228 | 1448 | if (selector) { | ||
2229 | 1449 | D.undelegate(selector, 'click.fb-start').delegate(selector, 'click.fb-start', run); | ||
2230 | 1450 | |||
2231 | 1451 | } else { | ||
2232 | 1452 | that.unbind('click.fb-start').bind('click.fb-start', run); | ||
2233 | 1453 | } | ||
2234 | 1454 | |||
2235 | 1455 | return this; | ||
2236 | 1456 | }; | ||
2237 | 1457 | |||
2238 | 1458 | // Test for fixedPosition needs a body at doc ready | ||
2239 | 1459 | $(document).ready(function() { | ||
2240 | 1460 | F.defaults.fixed = $.support.fixedPosition || (!($.browser.msie && $.browser.version <= 6) && !isTouch); | ||
2241 | 1461 | }); | ||
2242 | 1462 | |||
2243 | 1463 | }(window, document, jQuery)); | ||
2244 | 1464 | \ No newline at end of file | 0 | \ No newline at end of file |
2245 | 1465 | 1 | ||
2246 | === removed file 'media/fancybox/jquery.fancybox.pack.js' | |||
2247 | --- media/fancybox/jquery.fancybox.pack.js 2012-04-24 13:30:24 +0000 | |||
2248 | +++ media/fancybox/jquery.fancybox.pack.js 1970-01-01 00:00:00 +0000 | |||
2249 | @@ -1,35 +0,0 @@ | |||
2250 | 1 | /*! fancyBox v2.0.6 fancyapps.com | fancyapps.com/fancybox/#license */ | ||
2251 | 2 | (function(s,l,d,t){var m=d(s),q=d(l),a=d.fancybox=function(){a.open.apply(this,arguments)},u=!1,k=l.createTouch!==t,o=function(a){return"string"===d.type(a)},n=function(b,c){c&&o(b)&&0<b.indexOf("%")&&(b=a.getViewport()[c]/100*parseInt(b,10));return Math.round(b)+"px"};d.extend(a,{version:"2.0.5",defaults:{padding:15,margin:20,width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,autoSize:!0,autoResize:!k,autoCenter:!k,fitToView:!0,aspectRatio:!1,topRatio:0.5,fixed:!1,scrolling:"auto", | ||
2252 | 3 | wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3E3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},keys:{next:[13,32,34,39,40],prev:[8,33,37,38],close:[27]},tpl:{wrap:'<div class="fancybox-wrap"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe class="fancybox-iframe" name="fancybox-frame{rnd}" frameborder="0" hspace="0"'+ | ||
2253 | 4 | (d.browser.msie?' allowtransparency="true"':"")+"></iframe>",swf:'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="wmode" value="transparent" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{href}" /><embed src="{href}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="100%" height="100%" wmode="transparent"></embed></object>',error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>', | ||
2254 | 5 | closeBtn:'<div title="Close" class="fancybox-item fancybox-close"></div>',next:'<a title="Next" class="fancybox-nav fancybox-next"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev"><span></span></a>'},openEffect:"fade",openSpeed:300,openEasing:"swing",openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:300,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:300,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic", | ||
2255 | 6 | prevSpeed:300,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:{speedIn:0,speedOut:300,opacity:0.8,css:{cursor:"pointer"},closeClick:!0},title:{type:"float"}}},group:{},opts:{},coming:null,current:null,isOpen:!1,isOpened:!1,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(b,c){a.close(!0);b&&!d.isArray(b)&&(b=b instanceof d?d(b).get():[b]);a.isActive=!0;a.opts=d.extend(!0,{},a.defaults,c);d.isPlainObject(c)&&c.keys!==t&&(a.opts.keys=c.keys? | ||
2256 | 7 | d.extend({},a.defaults.keys,c.keys):!1);a.group=b;a._start(a.opts.index||0)},cancel:function(){a.coming&&!1===a.trigger("onCancel")||(a.coming=null,a.hideLoading(),a.ajaxLoad&&a.ajaxLoad.abort(),a.ajaxLoad=null,a.imgPreload&&(a.imgPreload.onload=a.imgPreload.onabort=a.imgPreload.onerror=null))},close:function(b){a.cancel();a.current&&!1!==a.trigger("beforeClose")&&(a.unbindEvents(),!a.isOpen||b&&!0===b[0]?(d(".fancybox-wrap").stop().trigger("onReset").remove(),a._afterZoomOut()):(a.isOpen=a.isOpened= | ||
2257 | 8 | !1,d(".fancybox-item, .fancybox-nav").remove(),a.wrap.stop(!0).removeClass("fancybox-opened"),a.inner.css("overflow","hidden"),a.transitions[a.current.closeMethod]()))},play:function(b){var c=function(){clearTimeout(a.player.timer)},e=function(){c();a.current&&a.player.isActive&&(a.player.timer=setTimeout(a.next,a.current.playSpeed))},f=function(){c();d("body").unbind(".player");a.player.isActive=!1;a.trigger("onPlayEnd")};if(a.player.isActive||b&&!1===b[0])f();else if(a.current&&(a.current.loop|| | ||
2258 | 9 | a.current.index<a.group.length-1))a.player.isActive=!0,d("body").bind({"afterShow.player onUpdate.player":e,"onCancel.player beforeClose.player":f,"beforeLoad.player":c}),e(),a.trigger("onPlayStart")},next:function(){a.current&&a.jumpto(a.current.index+1)},prev:function(){a.current&&a.jumpto(a.current.index-1)},jumpto:function(b){a.current&&(b=parseInt(b,10),1<a.group.length&&a.current.loop&&(b>=a.group.length?b=0:0>b&&(b=a.group.length-1)),a.group[b]!==t&&(a.cancel(),a._start(b)))},reposition:function(b, | ||
2259 | 10 | c){var e;a.isOpen&&(e=a._getPosition(c),b&&"scroll"===b.type?(delete e.position,a.wrap.stop(!0,!0).animate(e,200)):a.wrap.css(e))},update:function(b){a.isOpen&&(u||setTimeout(function(){var c=a.current,e=!b||b&&"orientationchange"===b.type;if(u&&(u=!1,c)){if(!b||"scroll"!==b.type||e)c.autoSize&&"iframe"!==c.type&&(a.inner.height("auto"),c.height=a.inner.height()),(c.autoResize||e)&&a._setDimension(),c.canGrow&&"iframe"!==c.type&&a.inner.height("auto");(c.autoCenter||e)&&a.reposition(b);a.trigger("onUpdate")}}, | ||
2260 | 11 | 200),u=!0)},toggle:function(){a.isOpen&&(a.current.fitToView=!a.current.fitToView,a.update())},hideLoading:function(){q.unbind("keypress.fb");d("#fancybox-loading").remove()},showLoading:function(){a.hideLoading();q.bind("keypress.fb",function(b){27===b.keyCode&&(b.preventDefault(),a.cancel())});d('<div id="fancybox-loading"><div></div></div>').click(a.cancel).appendTo("body")},getViewport:function(){return{x:m.scrollLeft(),y:m.scrollTop(),w:k&&s.innerWidth?s.innerWidth:m.width(),h:k&&s.innerHeight? | ||
2261 | 12 | s.innerHeight:m.height()}},unbindEvents:function(){a.wrap&&a.wrap.unbind(".fb");q.unbind(".fb");m.unbind(".fb")},bindEvents:function(){var b=a.current,c=b.keys;b&&(m.bind("resize.fb orientationchange.fb"+(b.autoCenter&&!b.fixed?" scroll.fb":""),a.update),c&&q.bind("keydown.fb",function(b){var f;f=b.target||b.srcElement;if(!b.ctrlKey&&!b.altKey&&!b.shiftKey&&!b.metaKey&&(!f||!f.type&&!d(f).is("[contenteditable]")))f=b.keyCode,-1<d.inArray(f,c.close)?(a.close(),b.preventDefault()):-1<d.inArray(f,c.next)? | ||
2262 | 13 | (a.next(),b.preventDefault()):-1<d.inArray(f,c.prev)&&(a.prev(),b.preventDefault())}),d.fn.mousewheel&&b.mouseWheel&&1<a.group.length&&a.wrap.bind("mousewheel.fb",function(b,c){var d=b.target||null;if(0!==c&&(!d||0===d.clientHeight||d.scrollHeight===d.clientHeight&&d.scrollWidth===d.clientWidth))b.preventDefault(),a[0<c?"prev":"next"]()}))},trigger:function(b,c){var e,f=c||a[-1<d.inArray(b,["onCancel","beforeLoad","afterLoad"])?"coming":"current"];if(f){d.isFunction(f[b])&&(e=f[b].apply(f,Array.prototype.slice.call(arguments, | ||
2263 | 14 | 1)));if(!1===e)return!1;f.helpers&&d.each(f.helpers,function(c,e){if(e&&d.isPlainObject(a.helpers[c])&&d.isFunction(a.helpers[c][b]))a.helpers[c][b](e,f)});d.event.trigger(b+".fb")}},isImage:function(a){return o(a)&&a.match(/\.(jpe?g|gif|png|bmp)((\?|#).*)?$/i)},isSWF:function(a){return o(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(b){var c={},e=a.group[b]||null,f,g,i;if(e&&(e.nodeType||e instanceof d))f=!0,d.metadata&&(c=d(e).metadata());c=d.extend(!0,{},a.opts,{index:b,element:e},d.isPlainObject(e)? | ||
2264 | 15 | e:c);d.each(["href","title","content","type"],function(b,g){c[g]=a.opts[g]||f&&d(e).attr(g)||c[g]||null});"number"===typeof c.margin&&(c.margin=[c.margin,c.margin,c.margin,c.margin]);c.modal&&d.extend(!0,c,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{css:{cursor:"auto"},closeClick:!1}}});a.coming=c;if(!1===a.trigger("beforeLoad"))a.coming=null;else{g=c.type;b=c.href||e;g||(f&&(g=d(e).data("fancybox-type"),g||(g=(g=e.className.match(/fancybox\.(\w+)/))? | ||
2265 | 16 | g[1]:null)),!g&&o(b)&&(a.isImage(b)?g="image":a.isSWF(b)?g="swf":b.match(/^#/)&&(g="inline")),g||(g=f?"inline":"html"),c.type=g);if("inline"===g||"html"===g){if(c.content||(c.content="inline"===g?d(o(b)?b.replace(/.*(?=#[^\s]+$)/,""):b):e),!c.content||!c.content.length)g=null}else b||(g=null);"ajax"===g&&o(b)&&(i=b.split(/\s+/,2),b=i.shift(),c.selector=i.shift());c.href=b;c.group=a.group;c.isDom=f;switch(g){case "image":a._loadImage();break;case "ajax":a._loadAjax();break;case "inline":case "iframe":case "swf":case "html":a._afterLoad(); | ||
2266 | 17 | break;default:a._error("type")}}},_error:function(b){a.hideLoading();d.extend(a.coming,{type:"html",autoSize:!0,minWidth:0,minHeight:0,padding:15,hasError:b,content:a.coming.tpl.error});a._afterLoad()},_loadImage:function(){var b=a.imgPreload=new Image;b.onload=function(){this.onload=this.onerror=null;a.coming.width=this.width;a.coming.height=this.height;a._afterLoad()};b.onerror=function(){this.onload=this.onerror=null;a._error("image")};b.src=a.coming.href;(b.complete===t||!b.complete)&&a.showLoading()}, | ||
2267 | 18 | _loadAjax:function(){a.showLoading();a.ajaxLoad=d.ajax(d.extend({},a.coming.ajax,{url:a.coming.href,error:function(b,c){a.coming&&"abort"!==c?a._error("ajax",b):a.hideLoading()},success:function(b,c){"success"===c&&(a.coming.content=b,a._afterLoad())}}))},_preloadImages:function(){var b=a.group,c=a.current,e=b.length,f,g,i,h=Math.min(c.preload,e-1);if(c.preload&&!(2>b.length))for(i=1;i<=h;i+=1)if(f=b[(c.index+i)%e],g=f.href||d(f).attr("href")||f,"image"===f.type||a.isImage(g))(new Image).src=g},_afterLoad:function(){a.hideLoading(); | ||
2268 | 19 | !a.coming||!1===a.trigger("afterLoad",a.current)?a.coming=!1:(a.isOpened?(d(".fancybox-item, .fancybox-nav").remove(),a.wrap.stop(!0).removeClass("fancybox-opened"),a.inner.css("overflow","hidden"),a.transitions[a.current.prevMethod]()):(d(".fancybox-wrap").stop().trigger("onReset").remove(),a.trigger("afterClose")),a.unbindEvents(),a.isOpen=!1,a.current=a.coming,a.wrap=d(a.current.tpl.wrap).addClass("fancybox-"+(k?"mobile":"desktop")+" fancybox-type-"+a.current.type+" fancybox-tmp "+a.current.wrapCSS).appendTo("body"), | ||
2269 | 20 | a.skin=d(".fancybox-skin",a.wrap).css("padding",n(a.current.padding)),a.outer=d(".fancybox-outer",a.wrap),a.inner=d(".fancybox-inner",a.wrap),a._setContent())},_setContent:function(){var b=a.current,c=b.content,e=b.type,f=b.minWidth,g=b.minHeight,i=b.maxWidth,h=b.maxHeight;switch(e){case "inline":case "ajax":case "html":b.selector?c=d("<div>").html(c).find(b.selector):c instanceof d&&(c.parent().hasClass("fancybox-inner")&&c.parents(".fancybox-wrap").unbind("onReset"),c=c.show().detach(),d(a.wrap).bind("onReset", | ||
2270 | 21 | function(){c.appendTo("body").hide()}));b.autoSize&&(f=d('<div class="fancybox-wrap '+a.current.wrapCSS+' fancybox-tmp"></div>').appendTo("body").css({minWidth:n(f,"w"),minHeight:n(g,"h"),maxWidth:n(i,"w"),maxHeight:n(h,"h")}).append(c),b.width=f.width(),b.height=f.height(),f.width(a.current.width),f.height()>b.height&&(f.width(b.width+1),b.width=f.width(),b.height=f.height()),c=f.contents().detach(),f.remove());break;case "image":c=b.tpl.image.replace("{href}",b.href);b.aspectRatio=!0;break;case "swf":c= | ||
2271 | 22 | b.tpl.swf.replace(/\{width\}/g,b.width).replace(/\{height\}/g,b.height).replace(/\{href\}/g,b.href);break;case "iframe":c=d(b.tpl.iframe.replace("{rnd}",(new Date).getTime())).attr("scrolling",b.scrolling).attr("src",b.href),b.scrolling=k?"scroll":"auto"}if("image"===e||"swf"===e)b.autoSize=!1,b.scrolling="visible";"iframe"===e&&b.autoSize?(a.showLoading(),a._setDimension(),a.inner.css("overflow",b.scrolling),c.bind({onCancel:function(){d(this).unbind();a._afterZoomOut()},load:function(){a.hideLoading(); | ||
2272 | 23 | try{this.contentWindow.document.location&&(a.current.height=d(this).contents().find("body").height())}catch(b){a.current.autoSize=!1}a[a.isOpen?"_afterZoomIn":"_beforeShow"]()}}).appendTo(a.inner)):(a.inner.append(c),a._beforeShow())},_beforeShow:function(){a.coming=null;a.trigger("beforeShow");a._setDimension();a.wrap.hide().removeClass("fancybox-tmp");a.bindEvents();a._preloadImages();a.transitions[a.isOpened?a.current.nextMethod:a.current.openMethod]()},_setDimension:function(){var b=a.wrap,c= | ||
2273 | 24 | a.inner,e=a.current,f=a.getViewport(),g=e.margin,i=2*e.padding,h=e.width,j=e.height,r=e.maxWidth+i,k=e.maxHeight+i,l=e.minWidth+i,m=e.minHeight+i,p;f.w-=g[1]+g[3];f.h-=g[0]+g[2];o(h)&&0<h.indexOf("%")&&(h=(f.w-i)*parseFloat(h)/100);o(j)&&0<j.indexOf("%")&&(j=(f.h-i)*parseFloat(j)/100);g=h/j;h+=i;j+=i;e.fitToView&&(r=Math.min(f.w,r),k=Math.min(f.h,k));if(e.aspectRatio){if(h>r&&(h=r,j=(h-i)/g+i),j>k&&(j=k,h=(j-i)*g+i),h<l&&(h=l,j=(h-i)/g+i),j<m)j=m,h=(j-i)*g+i}else h=Math.max(l,Math.min(h,r)),j=Math.max(m, | ||
2274 | 25 | Math.min(j,k));h=Math.round(h);j=Math.round(j);d(b.add(c)).width("auto").height("auto");c.width(h-i).height(j-i);b.width(h);p=b.height();if(h>r||p>k)for(;(h>r||p>k)&&h>l&&p>m;)j-=10,e.aspectRatio?(h=Math.round((j-i)*g+i),h<l&&(h=l,j=(h-i)/g+i)):h-=10,c.width(h-i).height(j-i),b.width(h),p=b.height();e.dim={width:n(h),height:n(p)};e.canGrow=e.autoSize&&j>m&&j<k;e.canShrink=!1;e.canExpand=!1;if(h-i<e.width||j-i<e.height)e.canExpand=!0;else if((h>f.w||p>f.h)&&h>l&&j>m)e.canShrink=!0;a.innerSpace=p-i- | ||
2275 | 26 | c.height()},_getPosition:function(b){var c=a.current,e=a.getViewport(),f=c.margin,d=a.wrap.width()+f[1]+f[3],i=a.wrap.height()+f[0]+f[2],h={position:"absolute",top:f[0]+e.y,left:f[3]+e.x};c.autoCenter&&c.fixed&&!b&&i<=e.h&&d<=e.w&&(h={position:"fixed",top:f[0],left:f[3]});h.top=n(Math.max(h.top,h.top+(e.h-i)*c.topRatio));h.left=n(Math.max(h.left,h.left+0.5*(e.w-d)));return h},_afterZoomIn:function(){var b=a.current,c=b?b.scrolling:"no";if(b&&(a.isOpen=a.isOpened=!0,a.wrap.addClass("fancybox-opened"), | ||
2276 | 27 | a.inner.css("overflow","yes"===c?"scroll":"no"===c?"hidden":c),a.trigger("afterShow"),a.update(),(b.closeClick||b.nextClick)&&a.inner.css("cursor","pointer").bind("click.fb",function(c){if(!d(c.target).is("a")&&!d(c.target).parent().is("a"))a[b.closeClick?"close":"next"]()}),b.closeBtn&&d(b.tpl.closeBtn).appendTo(a.skin).bind("click.fb",a.close),b.arrows&&1<a.group.length&&((b.loop||0<b.index)&&d(b.tpl.prev).appendTo(a.outer).bind("click.fb",a.prev),(b.loop||b.index<a.group.length-1)&&d(b.tpl.next).appendTo(a.outer).bind("click.fb", | ||
2277 | 28 | a.next)),a.opts.autoPlay&&!a.player.isActive))a.opts.autoPlay=!1,a.play()},_afterZoomOut:function(){var b=a.current;a.wrap.trigger("onReset").remove();d.extend(a,{group:{},opts:{},current:null,isActive:!1,isOpened:!1,isOpen:!1,wrap:null,skin:null,outer:null,inner:null});a.trigger("afterClose",b)}});a.transitions={getOrigPosition:function(){var b=a.current,c=b.element,e=b.padding,f=d(b.orig),g={},i=50,h=50;!f.length&&b.isDom&&d(c).is(":visible")&&(f=d(c).find("img:first"),f.length||(f=d(c)));f.length? | ||
2278 | 29 | (g=f.offset(),f.is("img")&&(i=f.outerWidth(),h=f.outerHeight())):(b=a.getViewport(),g.top=b.y+0.5*(b.h-h),g.left=b.x+0.5*(b.w-i));return g={top:n(g.top-e),left:n(g.left-e),width:n(i+2*e),height:n(h+2*e)}},step:function(b,c){var e=c.prop,d,g;if("width"===e||"height"===e)d=Math.ceil(b-2*a.current.padding),"height"===e&&(g=(b-c.start)/(c.end-c.start),c.start>c.end&&(g=1-g),d-=a.innerSpace*g),a.inner[e](d)},zoomIn:function(){var b=a.wrap,c=a.current,e=c.openEffect,f="elastic"===e,g=d.extend({},c.dim, | ||
2279 | 30 | a._getPosition(f)),i=d.extend({opacity:1},g);delete i.position;f?(g=this.getOrigPosition(),c.openOpacity&&(g.opacity=0),a.outer.add(a.inner).width("auto").height("auto")):"fade"===e&&(g.opacity=0);b.css(g).show().animate(i,{duration:"none"===e?0:c.openSpeed,easing:c.openEasing,step:f?this.step:null,complete:a._afterZoomIn})},zoomOut:function(){var b=a.wrap,c=a.current,d=c.openEffect,f="elastic"===d,g={opacity:0};f&&("fixed"===b.css("position")&&b.css(a._getPosition(!0)),g=this.getOrigPosition(),c.closeOpacity&& | ||
2280 | 31 | (g.opacity=0));b.animate(g,{duration:"none"===d?0:c.closeSpeed,easing:c.closeEasing,step:f?this.step:null,complete:a._afterZoomOut})},changeIn:function(){var b=a.wrap,c=a.current,d=c.nextEffect,f="elastic"===d,g=a._getPosition(f),i={opacity:1};g.opacity=0;f&&(g.top=n(parseInt(g.top,10)-200),i.top="+=200px");b.css(g).show().animate(i,{duration:"none"===d?0:c.nextSpeed,easing:c.nextEasing,complete:a._afterZoomIn})},changeOut:function(){var b=a.wrap,c=a.current,e=c.prevEffect,f={opacity:0};b.removeClass("fancybox-opened"); | ||
2281 | 32 | "elastic"===e&&(f.top="+=200px");b.animate(f,{duration:"none"===e?0:c.prevSpeed,easing:c.prevEasing,complete:function(){d(this).trigger("onReset").remove()}})}};a.helpers.overlay={overlay:null,update:function(){var a,c;this.overlay.width("100%").height("100%");d.browser.msie||k?(a=Math.max(l.documentElement.scrollWidth,l.body.scrollWidth),c=Math.max(l.documentElement.offsetWidth,l.body.offsetWidth),a=a<c?m.width():a):a=q.width();this.overlay.width(a).height(q.height())},beforeShow:function(b){this.overlay|| | ||
2282 | 33 | (b=d.extend(!0,{},a.defaults.helpers.overlay,b),this.overlay=d('<div id="fancybox-overlay"></div>').css(b.css).appendTo("body"),b.closeClick&&this.overlay.bind("click.fb",a.close),a.current.fixed&&!k?this.overlay.addClass("overlay-fixed"):(this.update(),this.onUpdate=function(){this.update()}),this.overlay.fadeTo(b.speedIn,b.opacity))},afterClose:function(a){this.overlay&&this.overlay.fadeOut(a.speedOut||0,function(){d(this).remove()});this.overlay=null}};a.helpers.title={beforeShow:function(b){var c; | ||
2283 | 34 | if(c=a.current.title)c=d('<div class="fancybox-title fancybox-title-'+b.type+'-wrap">'+c+"</div>").appendTo("body"),"float"===b.type&&(c.width(c.width()),c.wrapInner('<span class="child"></span>'),a.current.margin[2]+=Math.abs(parseInt(c.css("margin-bottom"),10))),c.appendTo("over"===b.type?a.inner:"outside"===b.type?a.wrap:a.skin)}};d.fn.fancybox=function(b){var c=d(this),e=this.selector||"",f,g=function(g){var h=this,j=f,k;!g.ctrlKey&&!g.altKey&&!g.shiftKey&&!g.metaKey&&!d(h).is(".fancybox-wrap")&& | ||
2284 | 35 | (g.preventDefault(),g=b.groupAttr||"data-fancybox-group",k=d(h).attr(g),k||(g="rel",k=h[g]),k&&""!==k&&"nofollow"!==k&&(h=e.length?d(e):c,h=h.filter("["+g+'="'+k+'"]'),j=h.index(this)),b.index=j,a.open(h,b))},b=b||{};f=b.index||0;e?q.undelegate(e,"click.fb-start").delegate(e,"click.fb-start",g):c.unbind("click.fb-start").bind("click.fb-start",g);return this};d(l).ready(function(){a.defaults.fixed=d.support.fixedPosition||!(d.browser.msie&&6>=d.browser.version)&&!k})})(window,document,jQuery); | ||
2285 | 36 | \ No newline at end of file | 0 | \ No newline at end of file |
2286 | 37 | 1 | ||
2287 | === modified file 'media/js/disableOnSubmit.js' | |||
2288 | --- media/js/disableOnSubmit.js 2011-07-06 23:31:10 +0000 | |||
2289 | +++ media/js/disableOnSubmit.js 2017-09-26 21:12:14 +0000 | |||
2290 | @@ -6,11 +6,11 @@ | |||
2291 | 6 | */ | 6 | */ |
2292 | 7 | $.fn.disableOnSubmit = function(disableList){ | 7 | $.fn.disableOnSubmit = function(disableList){ |
2293 | 8 | 8 | ||
2295 | 9 | if(disableList == null){var $list = 'input[type=submit],input[type=button],input[type=reset],button';} | 9 | if(disableList === null){var $list = 'input[type=submit],input[type=button],input[type=reset],button';} |
2296 | 10 | else{var $list = disableList;} | 10 | else{var $list = disableList;} |
2297 | 11 | 11 | ||
2298 | 12 | // Makes sure button is enabled at start | 12 | // Makes sure button is enabled at start |
2300 | 13 | $(this).find($list).removeAttr('disabled'); | 13 | $(this).find($list).prop("disabled", true); |
2301 | 14 | 14 | ||
2302 | 15 | $(this).submit(function(){$(this).find($list).attr('disabled','disabled');}); | 15 | $(this).submit(function(){$(this).find($list).attr('disabled','disabled');}); |
2303 | 16 | return this; | 16 | return this; |
2304 | 17 | 17 | ||
2305 | === modified file 'media/js/encyclopedia.js' | |||
2306 | --- media/js/encyclopedia.js 2017-03-15 20:59:33 +0000 | |||
2307 | +++ media/js/encyclopedia.js 2017-09-26 21:12:14 +0000 | |||
2308 | @@ -1,6 +1,5 @@ | |||
2309 | 1 | $(document).ready(function() { | 1 | $(document).ready(function() { |
2312 | 2 | var elem = document.getElementById('apply_filter'); | 2 | $('#apply_filter').on('click', set_display); |
2311 | 3 | elem.addEventListener('click', set_display); | ||
2313 | 4 | // Find names of checkboxes: | 3 | // Find names of checkboxes: |
2314 | 5 | checkb_names = get_input_names(); | 4 | checkb_names = get_input_names(); |
2315 | 6 | // Initialize after reload, e.g. pressing F5: | 5 | // Initialize after reload, e.g. pressing F5: |
2316 | @@ -8,7 +7,7 @@ | |||
2317 | 8 | 7 | ||
2318 | 9 | // Smooth scrolling, taken from: | 8 | // Smooth scrolling, taken from: |
2319 | 10 | // http://stackoverflow.com/a/18795112 | 9 | // http://stackoverflow.com/a/18795112 |
2321 | 11 | $('a[href*=#]').click(function(event){ | 10 | $("a[href*='#']").click(function(event){ |
2322 | 12 | $('html, body').animate({ | 11 | $('html, body').animate({ |
2323 | 13 | scrollTop: $( $.attr(this, 'href') ).offset().top | 12 | scrollTop: $( $.attr(this, 'href') ).offset().top |
2324 | 14 | }, 500); | 13 | }, 500); |
2325 | 15 | 14 | ||
2326 | === removed directory 'media/js/highcharts_219' | |||
2327 | === removed directory 'media/js/highcharts_219/adapters' | |||
2328 | === removed file 'media/js/highcharts_219/adapters/mootools-adapter.js' | |||
2329 | --- media/js/highcharts_219/adapters/mootools-adapter.js 2011-11-18 22:51:37 +0000 | |||
2330 | +++ media/js/highcharts_219/adapters/mootools-adapter.js 1970-01-01 00:00:00 +0000 | |||
2331 | @@ -1,12 +0,0 @@ | |||
2332 | 1 | /* | ||
2333 | 2 | Highcharts JS v2.1.9 (2011-11-11) | ||
2334 | 3 | MooTools adapter | ||
2335 | 4 | |||
2336 | 5 | (c) 2010-2011 Torstein H?nsi | ||
2337 | 6 | |||
2338 | 7 | License: www.highcharts.com/license | ||
2339 | 8 | */ | ||
2340 | 9 | (function(){var e=window,h=e.MooTools.version.substring(0,3),i=h==="1.2"||h==="1.1",m=i||h==="1.3",j=e.$extend||function(){return Object.append.apply(Object,arguments)};e.HighchartsAdapter={init:function(a){var b=Fx.prototype,c=b.start,d=Fx.Morph.prototype,g=d.compute;b.start=function(f){var k=this.element;if(f.d)this.paths=a.init(k,k.d,this.toD);c.apply(this,arguments);return this};d.compute=function(f,k,n){var l=this.paths;if(l)this.element.attr("d",a.step(l[0],l[1],n,this.toD));else return g.apply(this, | ||
2341 | 10 | arguments)}},animate:function(a,b,c){var d=a.attr,g=c&&c.complete;if(d&&!a.setStyle){a.getStyle=a.attr;a.setStyle=function(){var f=arguments;a.attr.call(a,f[0],f[1][0])};a.$family=a.uid=true}e.HighchartsAdapter.stop(a);c=new Fx.Morph(d?a:$(a),j({transition:Fx.Transitions.Quad.easeInOut},c));if(b.d)c.toD=b.d;g&&c.addEvent("complete",g);c.start(b);a.fx=c},each:function(a,b){return i?$each(a,b):a.each(b)},map:function(a,b){return a.map(b)},grep:function(a,b){return a.filter(b)},merge:function(){var a= | ||
2342 | 11 | arguments,b=[{}],c=a.length;if(i)a=$merge.apply(null,a);else{for(;c--;)if(typeof a[c]!=="boolean")b[c+1]=a[c];a=Object.merge.apply(Object,b)}return a},extendWithEvents:function(a){a.addEvent||(a.nodeName?$(a):j(a,new Events))},addEvent:function(a,b,c){if(typeof b==="string"){if(b==="unload")b="beforeunload";e.HighchartsAdapter.extendWithEvents(a);a.addEvent(b,c)}},removeEvent:function(a,b,c){if(typeof a!=="string"){e.HighchartsAdapter.extendWithEvents(a);if(b){if(b==="unload")b="beforeunload";c?a.removeEvent(b, | ||
2343 | 12 | c):a.removeEvents(b)}else a.removeEvents()}},fireEvent:function(a,b,c,d){b={type:b,target:a};b=m?new Event(b):new DOMEvent(b);b=j(b,c);b.preventDefault=function(){d=null};a.fireEvent&&a.fireEvent(b.type,b);d&&d(b)},stop:function(a){a.fx&&a.fx.cancel()}}})(); | ||
2344 | 13 | 0 | ||
2345 | === removed file 'media/js/highcharts_219/adapters/mootools-adapter.src.js' | |||
2346 | --- media/js/highcharts_219/adapters/mootools-adapter.src.js 2011-11-18 22:51:37 +0000 | |||
2347 | +++ media/js/highcharts_219/adapters/mootools-adapter.src.js 1970-01-01 00:00:00 +0000 | |||
2348 | @@ -1,264 +0,0 @@ | |||
2349 | 1 | /** | ||
2350 | 2 | * @license Highcharts JS v2.1.9 (2011-11-11) | ||
2351 | 3 | * MooTools adapter | ||
2352 | 4 | * | ||
2353 | 5 | * (c) 2010-2011 Torstein Hønsi | ||
2354 | 6 | * | ||
2355 | 7 | * License: www.highcharts.com/license | ||
2356 | 8 | */ | ||
2357 | 9 | |||
2358 | 10 | // JSLint options: | ||
2359 | 11 | /*global Fx, $, $extend, $each, $merge, Events, Event, DOMEvent */ | ||
2360 | 12 | |||
2361 | 13 | (function () { | ||
2362 | 14 | |||
2363 | 15 | var win = window, | ||
2364 | 16 | mooVersion = win.MooTools.version.substring(0, 3), // Get the first three characters of the version number | ||
2365 | 17 | legacy = mooVersion === '1.2' || mooVersion === '1.1', // 1.1 && 1.2 considered legacy, 1.3 is not. | ||
2366 | 18 | legacyEvent = legacy || mooVersion === '1.3', // In versions 1.1 - 1.3 the event class is named Event, in newer versions it is named DOMEvent. | ||
2367 | 19 | $extend = win.$extend || function () { | ||
2368 | 20 | return Object.append.apply(Object, arguments); | ||
2369 | 21 | }; | ||
2370 | 22 | |||
2371 | 23 | win.HighchartsAdapter = { | ||
2372 | 24 | /** | ||
2373 | 25 | * Initialize the adapter. This is run once as Highcharts is first run. | ||
2374 | 26 | * @param {Object} pathAnim The helper object to do animations across adapters. | ||
2375 | 27 | */ | ||
2376 | 28 | init: function (pathAnim) { | ||
2377 | 29 | var fxProto = Fx.prototype, | ||
2378 | 30 | fxStart = fxProto.start, | ||
2379 | 31 | morphProto = Fx.Morph.prototype, | ||
2380 | 32 | morphCompute = morphProto.compute; | ||
2381 | 33 | |||
2382 | 34 | // override Fx.start to allow animation of SVG element wrappers | ||
2383 | 35 | /*jslint unparam: true*//* allow unused parameters in fx functions */ | ||
2384 | 36 | fxProto.start = function (from, to) { | ||
2385 | 37 | var fx = this, | ||
2386 | 38 | elem = fx.element; | ||
2387 | 39 | |||
2388 | 40 | // special for animating paths | ||
2389 | 41 | if (from.d) { | ||
2390 | 42 | //this.fromD = this.element.d.split(' '); | ||
2391 | 43 | fx.paths = pathAnim.init( | ||
2392 | 44 | elem, | ||
2393 | 45 | elem.d, | ||
2394 | 46 | fx.toD | ||
2395 | 47 | ); | ||
2396 | 48 | } | ||
2397 | 49 | fxStart.apply(fx, arguments); | ||
2398 | 50 | |||
2399 | 51 | return this; // chainable | ||
2400 | 52 | }; | ||
2401 | 53 | |||
2402 | 54 | // override Fx.step to allow animation of SVG element wrappers | ||
2403 | 55 | morphProto.compute = function (from, to, delta) { | ||
2404 | 56 | var fx = this, | ||
2405 | 57 | paths = fx.paths; | ||
2406 | 58 | |||
2407 | 59 | if (paths) { | ||
2408 | 60 | fx.element.attr( | ||
2409 | 61 | 'd', | ||
2410 | 62 | pathAnim.step(paths[0], paths[1], delta, fx.toD) | ||
2411 | 63 | ); | ||
2412 | 64 | } else { | ||
2413 | 65 | return morphCompute.apply(fx, arguments); | ||
2414 | 66 | } | ||
2415 | 67 | }; | ||
2416 | 68 | /*jslint unparam: false*/ | ||
2417 | 69 | }, | ||
2418 | 70 | |||
2419 | 71 | /** | ||
2420 | 72 | * Animate a HTML element or SVG element wrapper | ||
2421 | 73 | * @param {Object} el | ||
2422 | 74 | * @param {Object} params | ||
2423 | 75 | * @param {Object} options jQuery-like animation options: duration, easing, callback | ||
2424 | 76 | */ | ||
2425 | 77 | animate: function (el, params, options) { | ||
2426 | 78 | var isSVGElement = el.attr, | ||
2427 | 79 | effect, | ||
2428 | 80 | complete = options && options.complete; | ||
2429 | 81 | |||
2430 | 82 | if (isSVGElement && !el.setStyle) { | ||
2431 | 83 | // add setStyle and getStyle methods for internal use in Moo | ||
2432 | 84 | el.getStyle = el.attr; | ||
2433 | 85 | el.setStyle = function () { // property value is given as array in Moo - break it down | ||
2434 | 86 | var args = arguments; | ||
2435 | 87 | el.attr.call(el, args[0], args[1][0]); | ||
2436 | 88 | }; | ||
2437 | 89 | // dirty hack to trick Moo into handling el as an element wrapper | ||
2438 | 90 | el.$family = el.uid = true; | ||
2439 | 91 | } | ||
2440 | 92 | |||
2441 | 93 | // stop running animations | ||
2442 | 94 | win.HighchartsAdapter.stop(el); | ||
2443 | 95 | |||
2444 | 96 | // define and run the effect | ||
2445 | 97 | effect = new Fx.Morph( | ||
2446 | 98 | isSVGElement ? el : $(el), | ||
2447 | 99 | $extend({ | ||
2448 | 100 | transition: Fx.Transitions.Quad.easeInOut | ||
2449 | 101 | }, options) | ||
2450 | 102 | ); | ||
2451 | 103 | |||
2452 | 104 | // special treatment for paths | ||
2453 | 105 | if (params.d) { | ||
2454 | 106 | effect.toD = params.d; | ||
2455 | 107 | } | ||
2456 | 108 | |||
2457 | 109 | // jQuery-like events | ||
2458 | 110 | if (complete) { | ||
2459 | 111 | effect.addEvent('complete', complete); | ||
2460 | 112 | } | ||
2461 | 113 | |||
2462 | 114 | // run | ||
2463 | 115 | effect.start(params); | ||
2464 | 116 | |||
2465 | 117 | // record for use in stop method | ||
2466 | 118 | el.fx = effect; | ||
2467 | 119 | }, | ||
2468 | 120 | |||
2469 | 121 | /** | ||
2470 | 122 | * MooTool's each function | ||
2471 | 123 | * | ||
2472 | 124 | */ | ||
2473 | 125 | each: function (arr, fn) { | ||
2474 | 126 | return legacy ? | ||
2475 | 127 | $each(arr, fn) : | ||
2476 | 128 | arr.each(fn); | ||
2477 | 129 | }, | ||
2478 | 130 | |||
2479 | 131 | /** | ||
2480 | 132 | * Map an array | ||
2481 | 133 | * @param {Array} arr | ||
2482 | 134 | * @param {Function} fn | ||
2483 | 135 | */ | ||
2484 | 136 | map: function (arr, fn) { | ||
2485 | 137 | return arr.map(fn); | ||
2486 | 138 | }, | ||
2487 | 139 | |||
2488 | 140 | /** | ||
2489 | 141 | * Grep or filter an array | ||
2490 | 142 | * @param {Array} arr | ||
2491 | 143 | * @param {Function} fn | ||
2492 | 144 | */ | ||
2493 | 145 | grep: function (arr, fn) { | ||
2494 | 146 | return arr.filter(fn); | ||
2495 | 147 | }, | ||
2496 | 148 | |||
2497 | 149 | /** | ||
2498 | 150 | * Deep merge two objects and return a third | ||
2499 | 151 | */ | ||
2500 | 152 | merge: function () { | ||
2501 | 153 | var args = arguments, | ||
2502 | 154 | args13 = [{}], // MooTools 1.3+ | ||
2503 | 155 | i = args.length, | ||
2504 | 156 | ret; | ||
2505 | 157 | |||
2506 | 158 | if (legacy) { | ||
2507 | 159 | ret = $merge.apply(null, args); | ||
2508 | 160 | } else { | ||
2509 | 161 | while (i--) { | ||
2510 | 162 | // Boolean argumens should not be merged. | ||
2511 | 163 | // JQuery explicitly skips this, so we do it here as well. | ||
2512 | 164 | if (typeof args[i] !== 'boolean') { | ||
2513 | 165 | args13[i + 1] = args[i]; | ||
2514 | 166 | } | ||
2515 | 167 | } | ||
2516 | 168 | ret = Object.merge.apply(Object, args13); | ||
2517 | 169 | } | ||
2518 | 170 | |||
2519 | 171 | return ret; | ||
2520 | 172 | }, | ||
2521 | 173 | |||
2522 | 174 | /** | ||
2523 | 175 | * Extends an object with Events, if its not done | ||
2524 | 176 | */ | ||
2525 | 177 | extendWithEvents: function (el) { | ||
2526 | 178 | // if the addEvent method is not defined, el is a custom Highcharts object | ||
2527 | 179 | // like series or point | ||
2528 | 180 | if (!el.addEvent) { | ||
2529 | 181 | if (el.nodeName) { | ||
2530 | 182 | el = $(el); // a dynamically generated node | ||
2531 | 183 | } else { | ||
2532 | 184 | $extend(el, new Events()); // a custom object | ||
2533 | 185 | } | ||
2534 | 186 | } | ||
2535 | 187 | }, | ||
2536 | 188 | |||
2537 | 189 | /** | ||
2538 | 190 | * Add an event listener | ||
2539 | 191 | * @param {Object} el HTML element or custom object | ||
2540 | 192 | * @param {String} type Event type | ||
2541 | 193 | * @param {Function} fn Event handler | ||
2542 | 194 | */ | ||
2543 | 195 | addEvent: function (el, type, fn) { | ||
2544 | 196 | if (typeof type === 'string') { // chart broke due to el being string, type function | ||
2545 | 197 | |||
2546 | 198 | if (type === 'unload') { // Moo self destructs before custom unload events | ||
2547 | 199 | type = 'beforeunload'; | ||
2548 | 200 | } | ||
2549 | 201 | |||
2550 | 202 | win.HighchartsAdapter.extendWithEvents(el); | ||
2551 | 203 | |||
2552 | 204 | el.addEvent(type, fn); | ||
2553 | 205 | } | ||
2554 | 206 | }, | ||
2555 | 207 | |||
2556 | 208 | removeEvent: function (el, type, fn) { | ||
2557 | 209 | if (typeof el === 'string') { | ||
2558 | 210 | // el.removeEvents below apperantly calls this method again. Do not quite understand why, so for now just bail out. | ||
2559 | 211 | return; | ||
2560 | 212 | } | ||
2561 | 213 | win.HighchartsAdapter.extendWithEvents(el); | ||
2562 | 214 | if (type) { | ||
2563 | 215 | if (type === 'unload') { // Moo self destructs before custom unload events | ||
2564 | 216 | type = 'beforeunload'; | ||
2565 | 217 | } | ||
2566 | 218 | |||
2567 | 219 | if (fn) { | ||
2568 | 220 | el.removeEvent(type, fn); | ||
2569 | 221 | } else { | ||
2570 | 222 | el.removeEvents(type); | ||
2571 | 223 | } | ||
2572 | 224 | } else { | ||
2573 | 225 | el.removeEvents(); | ||
2574 | 226 | } | ||
2575 | 227 | }, | ||
2576 | 228 | |||
2577 | 229 | fireEvent: function (el, event, eventArguments, defaultFunction) { | ||
2578 | 230 | var eventArgs = { | ||
2579 | 231 | type: event, | ||
2580 | 232 | target: el | ||
2581 | 233 | }; | ||
2582 | 234 | // create an event object that keeps all functions | ||
2583 | 235 | event = legacyEvent ? new Event(eventArgs) : new DOMEvent(eventArgs); | ||
2584 | 236 | event = $extend(event, eventArguments); | ||
2585 | 237 | // override the preventDefault function to be able to use | ||
2586 | 238 | // this for custom events | ||
2587 | 239 | event.preventDefault = function () { | ||
2588 | 240 | defaultFunction = null; | ||
2589 | 241 | }; | ||
2590 | 242 | // if fireEvent is not available on the object, there hasn't been added | ||
2591 | 243 | // any events to it above | ||
2592 | 244 | if (el.fireEvent) { | ||
2593 | 245 | el.fireEvent(event.type, event); | ||
2594 | 246 | } | ||
2595 | 247 | |||
2596 | 248 | // fire the default if it is passed and it is not prevented above | ||
2597 | 249 | if (defaultFunction) { | ||
2598 | 250 | defaultFunction(event); | ||
2599 | 251 | } | ||
2600 | 252 | }, | ||
2601 | 253 | |||
2602 | 254 | /** | ||
2603 | 255 | * Stop running animations on the object | ||
2604 | 256 | */ | ||
2605 | 257 | stop: function (el) { | ||
2606 | 258 | if (el.fx) { | ||
2607 | 259 | el.fx.cancel(); | ||
2608 | 260 | } | ||
2609 | 261 | } | ||
2610 | 262 | }; | ||
2611 | 263 | |||
2612 | 264 | }()); | ||
2613 | 265 | 0 | ||
2614 | === removed file 'media/js/highcharts_219/adapters/prototype-adapter.js' | |||
2615 | --- media/js/highcharts_219/adapters/prototype-adapter.js 2011-11-18 22:51:37 +0000 | |||
2616 | +++ media/js/highcharts_219/adapters/prototype-adapter.js 1970-01-01 00:00:00 +0000 | |||
2617 | @@ -1,15 +0,0 @@ | |||
2618 | 1 | /* | ||
2619 | 2 | Highcharts JS v2.1.9 (2011-11-11) | ||
2620 | 3 | Prototype adapter | ||
2621 | 4 | |||
2622 | 5 | @author Michael Nelson, Torstein H?nsi. | ||
2623 | 6 | |||
2624 | 7 | Feel free to use and modify this script. | ||
2625 | 8 | Highcharts license: www.highcharts.com/license. | ||
2626 | 9 | */ | ||
2627 | 10 | var HighchartsAdapter=function(){var g=typeof Effect!=="undefined";return{init:function(c){if(g)Effect.HighchartsTransition=Class.create(Effect.Base,{initialize:function(a,b,d,e){var f;this.element=a;this.key=b;f=a.attr(b);if(b==="d"){this.paths=c.init(a,a.d,d);this.toD=d;f=0;d=1}this.start(Object.extend(e||{},{from:f,to:d,attribute:b}))},setup:function(){HighchartsAdapter._extend(this.element);if(!this.element._highchart_animation)this.element._highchart_animation={};this.element._highchart_animation[this.key]= | ||
2628 | 11 | this},update:function(a){var b=this.paths;if(b)a=c.step(b[0],b[1],a,this.toD);this.element.attr(this.options.attribute,a)},finish:function(){delete this.element._highchart_animation[this.key]}})},addNS:function(c){var a=/^(?:click|mouse(?:down|up|over|move|out))$/;return/^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$/.test(c)||a.test(c)?c:"h:"+c},addEvent:function(c,a,b){if(c.addEventListener||c.attachEvent)Event.observe($(c),HighchartsAdapter.addNS(a),b);else{HighchartsAdapter._extend(c); | ||
2629 | 12 | c._highcharts_observe(a,b)}},animate:function(c,a,b){var d;b=b||{};b.delay=0;b.duration=(b.duration||500)/1E3;if(g)for(d in a)new Effect.HighchartsTransition($(c),d,a[d],b);else for(d in a)c.attr(d,a[d]);if(!c.attr)throw"Todo: implement animate DOM objects";},stop:function(c){var a;if(c._highcharts_extended&&c._highchart_animation)for(a in c._highchart_animation)c._highchart_animation[a].cancel()},each:function(c,a){$A(c).each(a)},fireEvent:function(c,a,b,d){if(c.fire)c.fire(HighchartsAdapter.addNS(a), | ||
2630 | 13 | b);else if(c._highcharts_extended){b=b||{};c._highcharts_fire(a,b)}if(b&&b.defaultPrevented)d=null;d&&d(b)},removeEvent:function(c,a,b){if($(c).stopObserving){if(a)a=HighchartsAdapter.addNS(a);$(c).stopObserving(a,b)}if(window===c)Event.stopObserving(c,a,b);else{HighchartsAdapter._extend(c);c._highcharts_stop_observing(a,b)}},grep:function(c,a){return c.findAll(a)},map:function(c,a){return c.map(a)},merge:function(){function c(a,b){var d,e;for(e in b){d=b[e];a[e]=d&&typeof d==="object"&&d.constructor!== | ||
2631 | 14 | Array&&typeof d.nodeType!=="number"?c(a[e]||{},d):b[e]}return a}return function(){var a=arguments,b,d={};for(b=0;b<a.length;b++)d=c(d,a[b]);return d}.apply(this,arguments)},_extend:function(c){c._highcharts_extended||Object.extend(c,{_highchart_events:{},_highchart_animation:null,_highcharts_extended:true,_highcharts_observe:function(a,b){this._highchart_events[a]=[this._highchart_events[a],b].compact().flatten()},_highcharts_stop_observing:function(a,b){if(a)if(b)this._highchart_events[a]=[this._highchart_events[a]].compact().flatten().without(b); | ||
2632 | 15 | else delete this._highchart_events[a];else this._highchart_events={}},_highcharts_fire:function(a,b){(this._highchart_events[a]||[]).each(function(d){if(!b.stopped){b.preventDefault=function(){b.defaultPrevented=true};d.bind(this)(b)===false&&b.preventDefault()}}.bind(this))}})}}}(); | ||
2633 | 16 | 0 | ||
2634 | === removed file 'media/js/highcharts_219/adapters/prototype-adapter.src.js' | |||
2635 | --- media/js/highcharts_219/adapters/prototype-adapter.src.js 2011-11-18 22:51:37 +0000 | |||
2636 | +++ media/js/highcharts_219/adapters/prototype-adapter.src.js 1970-01-01 00:00:00 +0000 | |||
2637 | @@ -1,331 +0,0 @@ | |||
2638 | 1 | /** | ||
2639 | 2 | * @license Highcharts JS v2.1.9 (2011-11-11) | ||
2640 | 3 | * Prototype adapter | ||
2641 | 4 | * | ||
2642 | 5 | * @author Michael Nelson, Torstein Hønsi. | ||
2643 | 6 | * | ||
2644 | 7 | * Feel free to use and modify this script. | ||
2645 | 8 | * Highcharts license: www.highcharts.com/license. | ||
2646 | 9 | */ | ||
2647 | 10 | |||
2648 | 11 | /* | ||
2649 | 12 | * Known issues: | ||
2650 | 13 | * - Some grid lines land in wrong position - http://jsfiddle.net/highcharts/jaRhY/28 | ||
2651 | 14 | */ | ||
2652 | 15 | |||
2653 | 16 | // JSLint options: | ||
2654 | 17 | /*global Effect, Class, Event, $, $A */ | ||
2655 | 18 | |||
2656 | 19 | // Adapter interface between prototype and the Highcharts charting library | ||
2657 | 20 | var HighchartsAdapter = (function () { | ||
2658 | 21 | |||
2659 | 22 | var hasEffect = typeof Effect !== 'undefined'; | ||
2660 | 23 | |||
2661 | 24 | return { | ||
2662 | 25 | |||
2663 | 26 | /** | ||
2664 | 27 | * Initialize the adapter. This is run once as Highcharts is first run. | ||
2665 | 28 | * @param {Object} pathAnim The helper object to do animations across adapters. | ||
2666 | 29 | */ | ||
2667 | 30 | init: function (pathAnim) { | ||
2668 | 31 | if (hasEffect) { | ||
2669 | 32 | /** | ||
2670 | 33 | * Animation for Highcharts SVG element wrappers only | ||
2671 | 34 | * @param {Object} element | ||
2672 | 35 | * @param {Object} attribute | ||
2673 | 36 | * @param {Object} to | ||
2674 | 37 | * @param {Object} options | ||
2675 | 38 | */ | ||
2676 | 39 | Effect.HighchartsTransition = Class.create(Effect.Base, { | ||
2677 | 40 | initialize: function (element, attr, to, options) { | ||
2678 | 41 | var from, | ||
2679 | 42 | opts; | ||
2680 | 43 | |||
2681 | 44 | this.element = element; | ||
2682 | 45 | this.key = attr; | ||
2683 | 46 | from = element.attr(attr); | ||
2684 | 47 | |||
2685 | 48 | // special treatment for paths | ||
2686 | 49 | if (attr === 'd') { | ||
2687 | 50 | this.paths = pathAnim.init( | ||
2688 | 51 | element, | ||
2689 | 52 | element.d, | ||
2690 | 53 | to | ||
2691 | 54 | ); | ||
2692 | 55 | this.toD = to; | ||
2693 | 56 | |||
2694 | 57 | |||
2695 | 58 | // fake values in order to read relative position as a float in update | ||
2696 | 59 | from = 0; | ||
2697 | 60 | to = 1; | ||
2698 | 61 | } | ||
2699 | 62 | |||
2700 | 63 | opts = Object.extend((options || {}), { | ||
2701 | 64 | from: from, | ||
2702 | 65 | to: to, | ||
2703 | 66 | attribute: attr | ||
2704 | 67 | }); | ||
2705 | 68 | this.start(opts); | ||
2706 | 69 | }, | ||
2707 | 70 | setup: function () { | ||
2708 | 71 | HighchartsAdapter._extend(this.element); | ||
2709 | 72 | // If this is the first animation on this object, create the _highcharts_animation helper that | ||
2710 | 73 | // contain pointers to the animation objects. | ||
2711 | 74 | if (!this.element._highchart_animation) { | ||
2712 | 75 | this.element._highchart_animation = {}; | ||
2713 | 76 | } | ||
2714 | 77 | |||
2715 | 78 | // Store a reference to this animation instance. | ||
2716 | 79 | this.element._highchart_animation[this.key] = this; | ||
2717 | 80 | }, | ||
2718 | 81 | update: function (position) { | ||
2719 | 82 | var paths = this.paths; | ||
2720 | 83 | |||
2721 | 84 | if (paths) { | ||
2722 | 85 | position = pathAnim.step(paths[0], paths[1], position, this.toD); | ||
2723 | 86 | } | ||
2724 | 87 | |||
2725 | 88 | this.element.attr(this.options.attribute, position); | ||
2726 | 89 | }, | ||
2727 | 90 | finish: function () { | ||
2728 | 91 | // Delete the property that holds this animation now that it is finished. | ||
2729 | 92 | // Both canceled animations and complete ones gets a 'finish' call. | ||
2730 | 93 | delete this.element._highchart_animation[this.key]; | ||
2731 | 94 | } | ||
2732 | 95 | }); | ||
2733 | 96 | } | ||
2734 | 97 | }, | ||
2735 | 98 | |||
2736 | 99 | /** | ||
2737 | 100 | * Custom events in prototype needs to be namespaced. This method adds a namespace 'h:' in front of | ||
2738 | 101 | * events that are not recognized as native. | ||
2739 | 102 | */ | ||
2740 | 103 | addNS: function (eventName) { | ||
2741 | 104 | var HTMLEvents = /^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$/, | ||
2742 | 105 | MouseEvents = /^(?:click|mouse(?:down|up|over|move|out))$/; | ||
2743 | 106 | return (HTMLEvents.test(eventName) || MouseEvents.test(eventName)) ? | ||
2744 | 107 | eventName : | ||
2745 | 108 | 'h:' + eventName; | ||
2746 | 109 | }, | ||
2747 | 110 | |||
2748 | 111 | // el needs an event to be attached. el is not necessarily a dom element | ||
2749 | 112 | addEvent: function (el, event, fn) { | ||
2750 | 113 | if (el.addEventListener || el.attachEvent) { | ||
2751 | 114 | Event.observe($(el), HighchartsAdapter.addNS(event), fn); | ||
2752 | 115 | |||
2753 | 116 | } else { | ||
2754 | 117 | HighchartsAdapter._extend(el); | ||
2755 | 118 | el._highcharts_observe(event, fn); | ||
2756 | 119 | } | ||
2757 | 120 | }, | ||
2758 | 121 | |||
2759 | 122 | // motion makes things pretty. use it if effects is loaded, if not... still get to the end result. | ||
2760 | 123 | animate: function (el, params, options) { | ||
2761 | 124 | var key, | ||
2762 | 125 | fx; | ||
2763 | 126 | |||
2764 | 127 | // default options | ||
2765 | 128 | options = options || {}; | ||
2766 | 129 | options.delay = 0; | ||
2767 | 130 | options.duration = (options.duration || 500) / 1000; | ||
2768 | 131 | |||
2769 | 132 | // animate wrappers and DOM elements | ||
2770 | 133 | if (hasEffect) { | ||
2771 | 134 | for (key in params) { | ||
2772 | 135 | // The fx variable is seemingly thrown away here, but the Effect.setup will add itself to the _highcharts_animation object | ||
2773 | 136 | // on the element itself so its not really lost. | ||
2774 | 137 | fx = new Effect.HighchartsTransition($(el), key, params[key], options); | ||
2775 | 138 | } | ||
2776 | 139 | } else { | ||
2777 | 140 | for (key in params) { | ||
2778 | 141 | el.attr(key, params[key]); | ||
2779 | 142 | } | ||
2780 | 143 | } | ||
2781 | 144 | |||
2782 | 145 | if (!el.attr) { | ||
2783 | 146 | throw 'Todo: implement animate DOM objects'; | ||
2784 | 147 | } | ||
2785 | 148 | }, | ||
2786 | 149 | |||
2787 | 150 | // this only occurs in higcharts 2.0+ | ||
2788 | 151 | stop: function (el) { | ||
2789 | 152 | var key; | ||
2790 | 153 | if (el._highcharts_extended && el._highchart_animation) { | ||
2791 | 154 | for (key in el._highchart_animation) { | ||
2792 | 155 | // Cancel the animation | ||
2793 | 156 | // The 'finish' function in the Effect object will remove the reference | ||
2794 | 157 | el._highchart_animation[key].cancel(); | ||
2795 | 158 | } | ||
2796 | 159 | } | ||
2797 | 160 | }, | ||
2798 | 161 | |||
2799 | 162 | // um.. each | ||
2800 | 163 | each: function (arr, fn) { | ||
2801 | 164 | $A(arr).each(fn); | ||
2802 | 165 | }, | ||
2803 | 166 | |||
2804 | 167 | // fire an event based on an event name (event) and an object (el). | ||
2805 | 168 | // again, el may not be a dom element | ||
2806 | 169 | fireEvent: function (el, event, eventArguments, defaultFunction) { | ||
2807 | 170 | if (el.fire) { | ||
2808 | 171 | el.fire(HighchartsAdapter.addNS(event), eventArguments); | ||
2809 | 172 | } else if (el._highcharts_extended) { | ||
2810 | 173 | eventArguments = eventArguments || {}; | ||
2811 | 174 | el._highcharts_fire(event, eventArguments); | ||
2812 | 175 | } | ||
2813 | 176 | |||
2814 | 177 | if (eventArguments && eventArguments.defaultPrevented) { | ||
2815 | 178 | defaultFunction = null; | ||
2816 | 179 | } | ||
2817 | 180 | |||
2818 | 181 | if (defaultFunction) { | ||
2819 | 182 | defaultFunction(eventArguments); | ||
2820 | 183 | } | ||
2821 | 184 | }, | ||
2822 | 185 | |||
2823 | 186 | removeEvent: function (el, event, handler) { | ||
2824 | 187 | if ($(el).stopObserving) { | ||
2825 | 188 | if (event) { | ||
2826 | 189 | event = HighchartsAdapter.addNS(event); | ||
2827 | 190 | } | ||
2828 | 191 | $(el).stopObserving(event, handler); | ||
2829 | 192 | } if (window === el) { | ||
2830 | 193 | Event.stopObserving(el, event, handler); | ||
2831 | 194 | } else { | ||
2832 | 195 | HighchartsAdapter._extend(el); | ||
2833 | 196 | el._highcharts_stop_observing(event, handler); | ||
2834 | 197 | } | ||
2835 | 198 | }, | ||
2836 | 199 | |||
2837 | 200 | // um, grep | ||
2838 | 201 | grep: function (arr, fn) { | ||
2839 | 202 | return arr.findAll(fn); | ||
2840 | 203 | }, | ||
2841 | 204 | |||
2842 | 205 | // um, map | ||
2843 | 206 | map: function (arr, fn) { | ||
2844 | 207 | return arr.map(fn); | ||
2845 | 208 | }, | ||
2846 | 209 | |||
2847 | 210 | // deep merge. merge({a : 'a', b : {b1 : 'b1', b2 : 'b2'}}, {b : {b2 : 'b2_prime'}, c : 'c'}) => {a : 'a', b : {b1 : 'b1', b2 : 'b2_prime'}, c : 'c'} | ||
2848 | 211 | /*merge: function(){ | ||
2849 | 212 | function doCopy(copy, original) { | ||
2850 | 213 | var value, | ||
2851 | 214 | key, | ||
2852 | 215 | undef, | ||
2853 | 216 | nil, | ||
2854 | 217 | same, | ||
2855 | 218 | obj, | ||
2856 | 219 | arr, | ||
2857 | 220 | node; | ||
2858 | 221 | |||
2859 | 222 | for (key in original) { | ||
2860 | 223 | value = original[key]; | ||
2861 | 224 | undef = typeof(value) === 'undefined'; | ||
2862 | 225 | nil = value === null; | ||
2863 | 226 | same = original === copy[key]; | ||
2864 | 227 | |||
2865 | 228 | if (undef || nil || same) { | ||
2866 | 229 | continue; | ||
2867 | 230 | } | ||
2868 | 231 | |||
2869 | 232 | obj = typeof(value) === 'object'; | ||
2870 | 233 | arr = value && obj && value.constructor == Array; | ||
2871 | 234 | node = !!value.nodeType; | ||
2872 | 235 | |||
2873 | 236 | if (obj && !arr && !node) { | ||
2874 | 237 | copy[key] = doCopy(typeof copy[key] == 'object' ? copy[key] : {}, value); | ||
2875 | 238 | } | ||
2876 | 239 | else { | ||
2877 | 240 | copy[key] = original[key]; | ||
2878 | 241 | } | ||
2879 | 242 | } | ||
2880 | 243 | return copy; | ||
2881 | 244 | } | ||
2882 | 245 | |||
2883 | 246 | var args = arguments, retVal = {}; | ||
2884 | 247 | |||
2885 | 248 | for (var i = 0; i < args.length; i++) { | ||
2886 | 249 | retVal = doCopy(retVal, args[i]); | ||
2887 | 250 | } | ||
2888 | 251 | |||
2889 | 252 | return retVal; | ||
2890 | 253 | },*/ | ||
2891 | 254 | merge: function () { // the built-in prototype merge function doesn't do deep copy | ||
2892 | 255 | function doCopy(copy, original) { | ||
2893 | 256 | var value, key; | ||
2894 | 257 | |||
2895 | 258 | for (key in original) { | ||
2896 | 259 | value = original[key]; | ||
2897 | 260 | if (value && typeof value === 'object' && value.constructor !== Array && | ||
2898 | 261 | typeof value.nodeType !== 'number') { | ||
2899 | 262 | copy[key] = doCopy(copy[key] || {}, value); // copy | ||
2900 | 263 | |||
2901 | 264 | } else { | ||
2902 | 265 | copy[key] = original[key]; | ||
2903 | 266 | } | ||
2904 | 267 | } | ||
2905 | 268 | return copy; | ||
2906 | 269 | } | ||
2907 | 270 | |||
2908 | 271 | function merge() { | ||
2909 | 272 | var args = arguments, | ||
2910 | 273 | i, | ||
2911 | 274 | retVal = {}; | ||
2912 | 275 | |||
2913 | 276 | for (i = 0; i < args.length; i++) { | ||
2914 | 277 | retVal = doCopy(retVal, args[i]); | ||
2915 | 278 | |||
2916 | 279 | } | ||
2917 | 280 | return retVal; | ||
2918 | 281 | } | ||
2919 | 282 | |||
2920 | 283 | return merge.apply(this, arguments); | ||
2921 | 284 | }, | ||
2922 | 285 | |||
2923 | 286 | // extend an object to handle highchart events (highchart objects, not svg elements). | ||
2924 | 287 | // this is a very simple way of handling events but whatever, it works (i think) | ||
2925 | 288 | _extend: function (object) { | ||
2926 | 289 | if (!object._highcharts_extended) { | ||
2927 | 290 | Object.extend(object, { | ||
2928 | 291 | _highchart_events: {}, | ||
2929 | 292 | _highchart_animation: null, | ||
2930 | 293 | _highcharts_extended: true, | ||
2931 | 294 | _highcharts_observe: function (name, fn) { | ||
2932 | 295 | this._highchart_events[name] = [this._highchart_events[name], fn].compact().flatten(); | ||
2933 | 296 | }, | ||
2934 | 297 | _highcharts_stop_observing: function (name, fn) { | ||
2935 | 298 | if (name) { | ||
2936 | 299 | if (fn) { | ||
2937 | 300 | this._highchart_events[name] = [this._highchart_events[name]].compact().flatten().without(fn); | ||
2938 | 301 | } else { | ||
2939 | 302 | delete this._highchart_events[name]; | ||
2940 | 303 | } | ||
2941 | 304 | } else { | ||
2942 | 305 | this._highchart_events = {}; | ||
2943 | 306 | } | ||
2944 | 307 | }, | ||
2945 | 308 | _highcharts_fire: function (name, args) { | ||
2946 | 309 | (this._highchart_events[name] || []).each(function (fn) { | ||
2947 | 310 | // args is never null here | ||
2948 | 311 | if (args.stopped) { | ||
2949 | 312 | return; // "throw $break" wasn't working. i think because of the scope of 'this'. | ||
2950 | 313 | } | ||
2951 | 314 | |||
2952 | 315 | // Attach a simple preventDefault function to skip default handler if called | ||
2953 | 316 | args.preventDefault = function () { | ||
2954 | 317 | args.defaultPrevented = true; | ||
2955 | 318 | }; | ||
2956 | 319 | |||
2957 | 320 | // If the event handler return false, prevent the default handler from executing | ||
2958 | 321 | if (fn.bind(this)(args) === false) { | ||
2959 | 322 | args.preventDefault(); | ||
2960 | 323 | } | ||
2961 | 324 | } | ||
2962 | 325 | .bind(this)); | ||
2963 | 326 | } | ||
2964 | 327 | }); | ||
2965 | 328 | } | ||
2966 | 329 | } | ||
2967 | 330 | }; | ||
2968 | 331 | }()); | ||
2969 | 332 | 0 | ||
2970 | === removed file 'media/js/highcharts_219/highcharts.js' | |||
2971 | --- media/js/highcharts_219/highcharts.js 2011-11-18 22:51:37 +0000 | |||
2972 | +++ media/js/highcharts_219/highcharts.js 1970-01-01 00:00:00 +0000 | |||
2973 | @@ -1,176 +0,0 @@ | |||
2974 | 1 | /* | ||
2975 | 2 | Highcharts JS v2.1.9 (2011-11-11) | ||
2976 | 3 | |||
2977 | 4 | (c) 2009-2011 Torstein H?nsi | ||
2978 | 5 | |||
2979 | 6 | License: www.highcharts.com/license | ||
2980 | 7 | */ | ||
2981 | 8 | (function(){function sa(a,b){var c;a||(a={});for(c in b)a[c]=b[c];return a}function ja(a,b){return parseInt(a,b||10)}function Sb(a){return typeof a==="string"}function Nb(a){return typeof a==="object"}function lc(a){return typeof a==="number"}function mc(a){return Fa.log(a)/Fa.LN10}function nc(a,b){for(var c=a.length;c--;)if(a[c]===b){a.splice(c,1);break}}function K(a){return a!==Wa&&a!==null}function Ga(a,b,c){var d,e;if(Sb(b))if(K(c))a.setAttribute(b,c);else{if(a&&a.getAttribute)e=a.getAttribute(b)}else if(K(b)&& | ||
2982 | 9 | Nb(b))for(d in b)a.setAttribute(d,b[d]);return e}function zc(a){return Object.prototype.toString.call(a)==="[object Array]"?a:[a]}function A(){var a=arguments,b,c,d=a.length;for(b=0;b<d;b++){c=a[b];if(typeof c!=="undefined"&&c!==null)return c}}function Ja(a,b){if(Pc)if(b&&b.opacity!==Wa)b.filter="alpha(opacity="+b.opacity*100+")";sa(a.style,b)}function hb(a,b,c,d,e){a=ua.createElement(a);b&&sa(a,b);e&&Ja(a,{padding:0,border:jb,margin:0});c&&Ja(a,c);d&&d.appendChild(a);return a}function yb(a,b){var c= | ||
2983 | 10 | function(){};c.prototype=new a;sa(c.prototype,b);return c}function Ed(a,b,c,d){var e=Xa.lang;a=a;var f=isNaN(b=bb(b))?2:b;b=c===undefined?e.decimalPoint:c;d=d===undefined?e.thousandsSep:d;e=a<0?"-":"";c=String(ja(a=bb(+a||0).toFixed(f)));var g=c.length>3?c.length%3:0;return e+(g?c.substr(0,g)+d:"")+c.substr(g).replace(/(\d{3})(?=\d)/g,"$1"+d)+(f?b+bb(a-c).toFixed(f).slice(2):"")}function Fd(a){var b={left:a.offsetLeft,top:a.offsetTop};for(a=a.offsetParent;a;){b.left+=a.offsetLeft;b.top+=a.offsetTop; | ||
2984 | 11 | if(a!==ua.body&&a!==ua.documentElement){b.left-=a.scrollLeft;b.top-=a.scrollTop}a=a.offsetParent}return b}function Gd(){this.symbol=this.color=0}function fe(a,b,c,d,e,f,g){var h=g.x;g=g.y;var i=h-a+c-25,j=g-b+d+10,m;if(i<7)i=c+h+15;if(i+a>c+e){i-=i+a-(c+e);j-=b;m=true}if(j<5){j=5;if(m&&g>=j&&g<=j+b)j=g+b-5}else if(j+b>d+f)j=d+f-b-5;return{x:i,y:j}}function Hd(a,b){var c=a.length,d;for(d=0;d<c;d++)a[d].ss_i=d;a.sort(function(e,f){var g=b(e,f);return g===0?e.ss_i-f.ss_i:g});for(d=0;d<c;d++)delete a[d].ss_i} | ||
2985 | 12 | function Ac(a){for(var b in a){a[b]&&a[b].destroy&&a[b].destroy();delete a[b]}}function oc(a,b){Bc=A(a,b.animation)}function Id(){var a=Xa.global.useUTC;Qc=a?Date.UTC:function(b,c,d,e,f,g){return(new Date(b,c,A(d,1),A(e,0),A(f,0),A(g,0))).getTime()};id=a?"getUTCMinutes":"getMinutes";jd=a?"getUTCHours":"getHours";kd=a?"getUTCDay":"getDay";Cc=a?"getUTCDate":"getDate";Rc=a?"getUTCMonth":"getMonth";Sc=a?"getUTCFullYear":"getFullYear";Jd=a?"setUTCMinutes":"setMinutes";Kd=a?"setUTCHours":"setHours";ld= | ||
2986 | 13 | a?"setUTCDate":"setDate";Ld=a?"setUTCMonth":"setMonth";Md=a?"setUTCFullYear":"setFullYear"}function pc(a){Tc||(Tc=hb(Tb));a&&Tc.appendChild(a);Tc.innerHTML=""}function Uc(){}function Nd(a,b){function c(p){function q(k,n){this.pos=k;this.minor=n;this.isNew=true;n||this.addLabel()}function w(k){if(k){this.options=k;this.id=k.id}return this}function x(k,n,t,r){this.isNegative=n;this.options=k;this.x=t;this.stack=r;this.alignOptions={align:k.align||(va?n?"left":"right":"center"),verticalAlign:k.verticalAlign|| | ||
2987 | 14 | (va?"middle":n?"bottom":"top"),y:A(k.y,va?4:n?14:-6),x:A(k.x,va?n?-6:6:0)};this.textAlign=k.textAlign||(va?n?"right":"left":"center")}function V(){var k=[],n=[],t;pa=wa=null;zb=[];u(Ha,function(r){t=false;u(["xAxis","yAxis"],function(F){if(r.isCartesian&&(F==="xAxis"&&xa||F==="yAxis"&&!xa)&&(r.options[F]===o.index||r.options[F]===Wa&&o.index===0)){r[F]=I;zb.push(r);t=true}});if(!r.visible&&z.ignoreHiddenSeries)t=false;if(t){var J,E,Q,fa,ka,$;if(!xa){J=r.options.stacking;Vc=J==="percent";if(J){ka= | ||
2988 | 15 | r.options.stack;fa=r.type+A(ka,"");$="-"+fa;r.stackKey=fa;E=k[fa]||[];k[fa]=E;Q=n[$]||[];n[$]=Q}if(Vc){pa=0;wa=99}}if(r.isCartesian){u(r.data,function(F){var O=F.x,S=F.y,aa=S<0,Eb=aa?Q:E,kb=aa?$:fa;if(pa===null)pa=wa=F[qa];if(xa)if(O>wa)wa=O;else{if(O<pa)pa=O}else if(K(S)){if(J)Eb[O]=K(Eb[O])?Eb[O]+S:S;S=Eb?Eb[O]:S;F=A(F.low,S);if(!Vc)if(S>wa)wa=S;else if(F<pa)pa=F;if(J){s[kb]||(s[kb]={});s[kb][O]||(s[kb][O]=new x(o.stackLabels,aa,O,ka));s[kb][O].setTotal(S)}}});if(/(area|column|bar)/.test(r.type)&& | ||
2989 | 16 | !xa)if(pa>=0){pa=0;Od=true}else if(wa<0){wa=0;Pd=true}}}})}function N(k,n){var t,r;Fb=n?1:Fa.pow(10,lb(Fa.log(k)/Fa.LN10));t=k/Fb;if(!n){n=[1,2,2.5,5,10];if(o.allowDecimals===false||ca)if(Fb===1)n=[1,2,5,10];else if(Fb<=0.1)n=[1/Fb]}for(r=0;r<n.length;r++){k=n[r];if(t<=(n[r]+(n[r+1]||n[r]))/2)break}k*=Fb;return k}function ta(k){var n;n=k;Fb=A(Fb,Fa.pow(10,lb(Fa.log(Ta)/Fa.LN10)));if(Fb<1){n=W(1/Fb)*10;n=W(k*n)/n}return n}function da(){var k,n,t,r,J=o.tickInterval,E=o.tickPixelInterval;k=o.maxZoom|| | ||
2990 | 17 | (xa&&!K(o.min)&&!K(o.max)?tb(l.smallestInterval*5,wa-pa):null);ya=R?Da:Aa;if(Ub){t=l[xa?"xAxis":"yAxis"][o.linkedTo];r=t.getExtremes();ia=A(r.min,r.dataMin);ra=A(r.max,r.dataMax)}else{ia=A(Vb,o.min,pa);ra=A(Gb,o.max,wa)}if(ca){ia=mc(ia);ra=mc(ra)}if(ra-ia<k){r=(k-ra+ia)/2;ia=Ia(ia-r,A(o.min,ia-r),pa);ra=tb(ia+k,A(o.max,ia+k),wa)}if(!Ya&&!Vc&&!Ub&&K(ia)&&K(ra)){k=ra-ia||1;if(!K(o.min)&&!K(Vb)&&Qd&&(pa<0||!Od))ia-=k*Qd;if(!K(o.max)&&!K(Gb)&&Rd&&(wa>0||!Pd))ra+=k*Rd}Ta=ia===ra?1:Ub&&!J&&E===t.options.tickPixelInterval? | ||
2991 | 18 | t.tickInterval:A(J,Ya?1:(ra-ia)*E/ya);if(!D&&!K(o.tickInterval))Ta=N(Ta);I.tickInterval=Ta;Wc=o.minorTickInterval==="auto"&&Ta?Ta/5:o.minorTickInterval;if(D){Ba=[];J=Xa.global.useUTC;var Q=1E3/ub,fa=6E4/ub,ka=36E5/ub;E=864E5/ub;k=6048E5/ub;r=2592E6/ub;var $=31556952E3/ub,F=[["second",Q,[1,2,5,10,15,30]],["minute",fa,[1,2,5,10,15,30]],["hour",ka,[1,2,3,4,6,8,12]],["day",E,[1,2]],["week",k,[1,2]],["month",r,[1,2,3,4,6]],["year",$,null]],O=F[6],S=O[1],aa=O[2];for(t=0;t<F.length;t++){O=F[t];S=O[1];aa= | ||
2992 | 19 | O[2];if(F[t+1])if(Ta<=(S*aa[aa.length-1]+F[t+1][1])/2)break}if(S===$&&Ta<5*S)aa=[1,2,5];F=N(Ta/S,aa);aa=new Date(ia*ub);aa.setMilliseconds(0);if(S>=Q)aa.setSeconds(S>=fa?0:F*lb(aa.getSeconds()/F));if(S>=fa)aa[Jd](S>=ka?0:F*lb(aa[id]()/F));if(S>=ka)aa[Kd](S>=E?0:F*lb(aa[jd]()/F));if(S>=E)aa[ld](S>=r?1:F*lb(aa[Cc]()/F));if(S>=r){aa[Ld](S>=$?0:F*lb(aa[Rc]()/F));n=aa[Sc]()}if(S>=$){n-=n%F;aa[Md](n)}S===k&&aa[ld](aa[Cc]()-aa[kd]()+o.startOfWeek);t=1;n=aa[Sc]();Q=aa.getTime()/ub;fa=aa[Rc]();for(ka=aa[Cc]();Q< | ||
2993 | 20 | ra&&t<Da;){Ba.push(Q);if(S===$)Q=Qc(n+t*F,0)/ub;else if(S===r)Q=Qc(n,fa+t*F)/ub;else if(!J&&(S===E||S===k))Q=Qc(n,fa,ka+t*F*(S===E?1:7));else Q+=S*F;t++}Ba.push(Q);Xc=o.dateTimeLabelFormats[O[0]]}else{t=ta(lb(ia/Ta)*Ta);n=ta(md(ra/Ta)*Ta);Ba=[];for(t=ta(t);t<=n;){Ba.push(t);t=ta(t+Ta)}}if(!Ub){if(Ya||xa&&l.hasColumn){n=(Ya?1:Ta)*0.5;if(Ya||!K(A(o.min,Vb)))ia-=n;if(Ya||!K(A(o.max,Gb)))ra+=n}n=Ba[0];t=Ba[Ba.length-1];if(o.startOnTick)ia=n;else ia>n&&Ba.shift();if(o.endOnTick)ra=t;else ra<t&&Ba.pop(); | ||
2994 | 21 | Ob||(Ob={x:0,y:0});if(!D&&Ba.length>Ob[qa])Ob[qa]=Ba.length}}function Ma(){var k,n;Dc=ia;Sd=ra;V();da();Hb=fb;fb=ya/(ra-ia||1);if(!xa)for(k in s)for(n in s[k])s[k][n].cum=s[k][n].total;if(!I.isDirty)I.isDirty=ia!==Dc||ra!==Sd}function za(k){k=(new w(k)).render();Pb.push(k);return k}function eb(){var k=o.title,n=o.stackLabels,t=o.alternateGridColor,r=o.lineWidth,J,E,Q=(J=l.hasRendered)&&K(Dc)&&!isNaN(Dc);E=zb.length&&K(ia)&&K(ra);ya=R?Da:Aa;fb=ya/(ra-ia||1);cc=R?X:vb;if(E||Ub){if(Wc&&!Ya)for(E=ia+ | ||
2995 | 22 | (Ba[0]-ia)%Wc;E<=ra;E+=Wc){Wb[E]||(Wb[E]=new q(E,true));Q&&Wb[E].isNew&&Wb[E].render(null,true);Wb[E].isActive=true;Wb[E].render()}u(Ba,function($,F){if(!Ub||$>=ia&&$<=ra){Q&&mb[$].isNew&&mb[$].render(F,true);mb[$].isActive=true;mb[$].render(F)}});t&&u(Ba,function($,F){if(F%2===0&&$<ra){dc[$]||(dc[$]=new w);dc[$].options={from:$,to:Ba[F+1]!==Wa?Ba[F+1]:ra,color:t};dc[$].render();dc[$].isActive=true}});J||u((o.plotLines||[]).concat(o.plotBands||[]),function($){Pb.push((new w($)).render())})}u([mb, | ||
2996 | 23 | Wb,dc],function($){for(var F in $)if($[F].isActive)$[F].isActive=false;else{$[F].destroy();delete $[F]}});if(r){J=X+(Oa?Da:0)+la;E=cb-vb-(Oa?Aa:0)+la;J=ga.crispLine([Za,R?X:J,R?E:ea,Ka,R?$a-Ib:J,R?E:cb-vb],r);if(La)La.animate({d:J});else La=ga.path(J).attr({stroke:o.lineColor,"stroke-width":r,zIndex:7}).add()}if(ba){J=R?X:ea;r=ja(k.style.fontSize||12);J={low:J+(R?0:ya),middle:J+ya/2,high:J+(R?ya:0)}[k.align];r=(R?ea+Aa:X)+(R?1:-1)*(Oa?-1:1)*nd+(L===2?r:0);ba[ba.isNew?"attr":"animate"]({x:R?J:r+(Oa? | ||
2997 | 24 | Da:0)+la+(k.x||0),y:R?r-(Oa?Aa:0)+la:J+(k.y||0)});ba.isNew=false}if(n&&n.enabled){var fa,ka;n=I.stackTotalGroup;if(!n)I.stackTotalGroup=n=ga.g("stack-labels").attr({visibility:Ab,zIndex:6}).translate(X,ea).add();for(fa in s){k=s[fa];for(ka in k)k[ka].render(n)}}I.isDirty=false}function ab(k){for(var n=Pb.length;n--;)Pb[n].id===k&&Pb[n].destroy()}var xa=p.isX,Oa=p.opposite,R=va?!xa:xa,L=R?Oa?0:2:Oa?1:3,s={},o=Ca(xa?Yc:od,[ge,he,Td,ie][L],p),I=this,ba,B=o.type,D=B==="datetime",ca=B==="logarithmic", | ||
2998 | 25 | la=o.offset||0,qa=xa?"x":"y",ya,fb,Hb,cc=R?X:vb,G,ha,na,Ra,La,pa,wa,zb,Vb,Gb,ra=null,ia=null,Dc,Sd,Qd=o.minPadding,Rd=o.maxPadding,Ub=K(o.linkedTo),Od,Pd,Vc;B=o.events;var pd,Pb=[],Ta,Wc,Fb,Ba,mb={},Wb={},dc={},qc,rc,nd,Xc,Ya=o.categories,je=o.labels.formatter||function(){var k=this.value;return Xc?Zc(Xc,k):Ta%1E6===0?k/1E6+"M":Ta%1E3===0?k/1E3+"k":!Ya&&k>=1E3?Ed(k,0):k},$c=R&&o.labels.staggerLines,ec=o.reversed,fc=Ya&&o.tickmarkPlacement==="between"?0.5:0;q.prototype={addLabel:function(){var k=this.pos, | ||
2999 | 26 | n=o.labels,t=!(k===ia&&!A(o.showFirstLabel,1)||k===ra&&!A(o.showLastLabel,0)),r=Ya&&R&&Ya.length&&!n.step&&!n.staggerLines&&!n.rotation&&Da/Ya.length||!R&&Da/2,J=Ya&&K(Ya[k])?Ya[k]:k,E=this.label;k=je.call({isFirst:k===Ba[0],isLast:k===Ba[Ba.length-1],dateTimeLabelFormat:Xc,value:ca?Fa.pow(10,J):J});r=r&&{width:Ia(1,W(r-2*(n.padding||10)))+Ua};r=sa(r,n.style);if(E===Wa)this.label=K(k)&&t&&n.enabled?ga.text(k,0,0,n.useHTML).attr({align:n.align,rotation:n.rotation}).css(r).add(na):null;else E&&E.attr({text:k}).css(r)}, | ||
3000 | 27 | getLabelSize:function(){var k=this.label;return k?(this.labelBBox=k.getBBox())[R?"height":"width"]:0},render:function(k,n){var t=!this.minor,r=this.label,J=this.pos,E=o.labels,Q=this.gridLine,fa=t?o.gridLineWidth:o.minorGridLineWidth,ka=t?o.gridLineColor:o.minorGridLineColor,$=t?o.gridLineDashStyle:o.minorGridLineDashStyle,F=this.mark,O=t?o.tickLength:o.minorTickLength,S=t?o.tickWidth:o.minorTickWidth||0,aa=t?o.tickColor:o.minorTickColor,Eb=t?o.tickPosition:o.minorTickPosition,kb=E.step,nb=n&&ad|| | ||
3001 | 28 | cb,Qb;Qb=R?G(J+fc,null,null,n)+cc:X+la+(Oa?(n&&qd||$a)-Ib-X:0);nb=R?nb-vb+la-(Oa?Aa:0):nb-G(J+fc,null,null,n)-cc;if(fa){J=ha(J+fc,fa,n);if(Q===Wa){Q={stroke:ka,"stroke-width":fa};if($)Q.dashstyle=$;if(t)Q.zIndex=1;this.gridLine=Q=fa?ga.path(J).attr(Q).add(Ra):null}!n&&Q&&J&&Q.animate({d:J})}if(S){if(Eb==="inside")O=-O;if(Oa)O=-O;t=ga.crispLine([Za,Qb,nb,Ka,Qb+(R?0:-O),nb+(R?O:0)],S);if(F)F.animate({d:t});else this.mark=ga.path(t).attr({stroke:aa,"stroke-width":S}).add(na)}if(r&&!isNaN(Qb)){Qb=Qb+ | ||
3002 | 29 | E.x-(fc&&R?fc*fb*(ec?-1:1):0);nb=nb+E.y-(fc&&!R?fc*fb*(ec?1:-1):0);K(E.y)||(nb+=ja(r.styles.lineHeight)*0.9-r.getBBox().height/2);if($c)nb+=k/(kb||1)%$c*16;if(kb)r[k%kb?"hide":"show"]();r[this.isNew?"attr":"animate"]({x:Qb,y:nb})}this.isNew=false},destroy:function(){Ac(this)}};w.prototype={render:function(){var k=this,n=k.options,t=n.label,r=k.label,J=n.width,E=n.to,Q=n.from,fa=n.value,ka,$=n.dashStyle,F=k.svgElem,O=[],S,aa,Eb=n.color;aa=n.zIndex;var kb=n.events;if(ca){Q=mc(Q);E=mc(E);fa=mc(fa)}if(J){O= | ||
3003 | 30 | ha(fa,J);n={stroke:Eb,"stroke-width":J};if($)n.dashstyle=$}else if(K(Q)&&K(E)){Q=Ia(Q,ia);E=tb(E,ra);ka=ha(E);if((O=ha(Q))&&ka)O.push(ka[4],ka[5],ka[1],ka[2]);else O=null;n={fill:Eb}}else return;if(K(aa))n.zIndex=aa;if(F)if(O)F.animate({d:O},null,F.onGetPath);else{F.hide();F.onGetPath=function(){F.show()}}else if(O&&O.length){k.svgElem=F=ga.path(O).attr(n).add();if(kb){$=function(nb){F.on(nb,function(Qb){kb[nb].apply(k,[Qb])})};for(S in kb)$(S)}}if(t&&K(t.text)&&O&&O.length&&Da>0&&Aa>0){t=Ca({align:R&& | ||
3004 | 31 | ka&&"center",x:R?!ka&&4:10,verticalAlign:!R&&ka&&"middle",y:R?ka?16:10:ka?6:-4,rotation:R&&!ka&&90},t);if(!r)k.label=r=ga.text(t.text,0,0).attr({align:t.textAlign||t.align,rotation:t.rotation,zIndex:aa}).css(t.style).add();ka=[O[1],O[4],A(O[6],O[1])];O=[O[2],O[5],A(O[7],O[2])];S=tb.apply(Fa,ka);aa=tb.apply(Fa,O);r.align(t,false,{x:S,y:aa,width:Ia.apply(Fa,ka)-S,height:Ia.apply(Fa,O)-aa});r.show()}else r&&r.hide();return k},destroy:function(){Ac(this);nc(Pb,this)}};x.prototype={destroy:function(){Ac(this)}, | ||
3005 | 32 | setTotal:function(k){this.cum=this.total=k},render:function(k){var n=this.options.formatter.call(this);if(this.label)this.label.attr({text:n,visibility:ob});else this.label=l.renderer.text(n,0,0).css(this.options.style).attr({align:this.textAlign,rotation:this.options.rotation,visibility:ob}).add(k)},setOffset:function(k,n){var t=this.isNegative,r=I.translate(this.total),J=I.translate(0);J=bb(r-J);var E=l.xAxis[0].translate(this.x)+k,Q=l.plotHeight;t={x:va?t?r:r-J:E,y:va?Q-E-n:t?Q-r-J:Q-r,width:va? | ||
3006 | 33 | J:n,height:va?n:J};this.label&&this.label.align(this.alignOptions,null,t).attr({visibility:Ab})}};G=function(k,n,t,r,J){var E=1,Q=0,fa=r?Hb:fb;r=r?Dc:ia;fa||(fa=fb);if(t){E*=-1;Q=ya}if(ec){E*=-1;Q-=E*ya}if(n){if(ec)k=ya-k;k=k/fa+r;if(ca&&J)k=Fa.pow(10,k)}else{if(ca&&J)k=mc(k);k=E*(k-r)*fa+Q}return k};ha=function(k,n,t){var r,J,E;k=G(k,null,null,t);var Q=t&&ad||cb,fa=t&&qd||$a,ka;t=J=W(k+cc);r=E=W(Q-k-cc);if(isNaN(k))ka=true;else if(R){r=ea;E=Q-vb;if(t<X||t>X+Da)ka=true}else{t=X;J=fa-Ib;if(r<ea||r> | ||
3007 | 34 | ea+Aa)ka=true}return ka?null:ga.crispLine([Za,t,r,Ka,J,E],n||0)};if(va&&xa&&ec===Wa)ec=true;sa(I,{addPlotBand:za,addPlotLine:za,adjustTickAmount:function(){if(Ob&&!D&&!Ya&&!Ub){var k=qc,n=Ba.length;qc=Ob[qa];if(n<qc){for(;Ba.length<qc;)Ba.push(ta(Ba[Ba.length-1]+Ta));fb*=(n-1)/(qc-1);ra=Ba[Ba.length-1]}if(K(k)&&qc!==k)I.isDirty=true}},categories:Ya,getExtremes:function(){return{min:ia,max:ra,dataMin:pa,dataMax:wa,userMin:Vb,userMax:Gb}},getPlotLinePath:ha,getThreshold:function(k){if(ia>k)k=ia;else if(ra< | ||
3008 | 35 | k)k=ra;return G(k,0,1)},isXAxis:xa,options:o,plotLinesAndBands:Pb,getOffset:function(){var k=zb.length&&K(ia)&&K(ra),n=0,t=0,r=o.title,J=o.labels,E=[-1,1,1,-1][L],Q;if(!na){na=ga.g("axis").attr({zIndex:7}).add();Ra=ga.g("grid").attr({zIndex:1}).add()}rc=0;if(k||Ub){u(Ba,function(fa){if(mb[fa])mb[fa].addLabel();else mb[fa]=new q(fa);if(L===0||L===2||{1:"left",3:"right"}[L]===J.align)rc=Ia(mb[fa].getLabelSize(),rc)});if($c)rc+=($c-1)*16}else for(Q in mb){mb[Q].destroy();delete mb[Q]}if(r&&r.text){if(!ba){ba= | ||
3009 | 36 | I.axisTitle=ga.text(r.text,0,0,r.useHTML).attr({zIndex:7,rotation:r.rotation||0,align:r.textAlign||{low:"left",middle:"center",high:"right"}[r.align]}).css(r.style).add();ba.isNew=true}n=ba.getBBox()[R?"height":"width"];t=A(r.margin,R?5:10)}la=E*(o.offset||Xb[L]);nd=rc+(L!==2&&rc&&E*o.labels[R?"y":"x"])+t;Xb[L]=Ia(Xb[L],nd+n+E*la)},render:eb,setCategories:function(k,n){I.categories=p.categories=Ya=k;u(zb,function(t){t.translate();t.setTooltipPoints(true)});I.isDirty=true;A(n,true)&&l.redraw()},setExtremes:function(k, | ||
3010 | 37 | n,t,r){t=A(t,true);Pa(I,"setExtremes",{min:k,max:n},function(){Vb=k;Gb=n;t&&l.redraw(r)})},setScale:Ma,setTickPositions:da,translate:G,redraw:function(){Yb.resetTracker&&Yb.resetTracker();eb();u(Pb,function(k){k.render()});u(zb,function(k){k.isDirty=true})},removePlotBand:ab,removePlotLine:ab,reversed:ec,stacks:s,destroy:function(){var k;pb(I);for(k in s){Ac(s[k]);s[k]=null}if(I.stackTotalGroup)I.stackTotalGroup=I.stackTotalGroup.destroy();u([mb,Wb,dc,Pb],function(n){Ac(n)});u([La,na,Ra,ba],function(n){n&& | ||
3011 | 38 | n.destroy()});La=na=Ra=ba=null}});for(pd in B)Qa(I,pd,B[pd]);Ma()}function d(){var p={};return{add:function(q,w,x,V){if(!p[q]){w=ga.text(w,0,0).css(a.toolbar.itemStyle).align({align:"right",x:-Ib-20,y:ea+30}).on("click",V).attr({align:"right",zIndex:20}).add();p[q]=w}},remove:function(q){pc(p[q].element);p[q]=null}}}function e(p){function q(){var B=this.points||zc(this),D=B[0].series.xAxis,ca=this.x;D=D&&D.options.type==="datetime";var la=Sb(ca)||D,qa;qa=la?['<span style="font-size: 10px">'+(D?Zc("%A, %b %e, %Y", | ||
3012 | 39 | ca):ca)+"</span>"]:[];u(B,function(ya){qa.push(ya.point.tooltipFormatter(la))});return qa.join("<br/>")}function w(B,D){L=xa?B:(2*L+B)/3;s=xa?D:(s+D)/2;o.translate(L,s);rd=bb(B-L)>1||bb(D-s)>1?function(){w(B,D)}:null}function x(){if(!xa){var B=l.hoverPoints;o.hide();u(da,function(D){D&&D.hide()});B&&u(B,function(D){D.setState()});l.hoverPoints=null;xa=true}}var V,N=p.borderWidth,ta=p.crosshairs,da=[],Ma=p.style,za=p.shared,eb=ja(Ma.padding),ab=N+eb,xa=true,Oa,R,L=0,s=0;Ma.padding=0;var o=ga.g("tooltip").attr({zIndex:8}).add(), | ||
3013 | 40 | I=ga.rect(ab,ab,0,0,p.borderRadius,N).attr({fill:p.backgroundColor,"stroke-width":N}).add(o).shadow(p.shadow),ba=ga.text("",eb+ab,ja(Ma.fontSize)+eb+ab,p.useHTML).attr({zIndex:1}).css(Ma).add(o);o.hide();return{shared:za,refresh:function(B){var D,ca,la,qa=0,ya={},fb=[];la=B.tooltipPos;D=p.formatter||q;ya=l.hoverPoints;if(za){ya&&u(ya,function(Hb){Hb.setState()});l.hoverPoints=B;u(B,function(Hb){Hb.setState(Bb);qa+=Hb.plotY;fb.push(Hb.getLabelConfig())});ca=B[0].plotX;qa=W(qa)/B.length;ya={x:B[0].category}; | ||
3014 | 41 | ya.points=fb;B=B[0]}else ya=B.getLabelConfig();ya=D.call(ya);V=B.series;ca=za?ca:B.plotX;qa=za?qa:B.plotY;D=W(la?la[0]:va?Da-qa:ca);ca=W(la?la[1]:va?Aa-ca:qa);la=za||!B.series.isCartesian||gc(D,ca);if(ya===false||!la)x();else{if(xa){o.show();xa=false}ba.attr({text:ya});la=ba.getBBox();Oa=la.width+2*eb;R=la.height+2*eb;I.attr({width:Oa,height:R,stroke:p.borderColor||B.color||V.color||"#606060"});D=fe(Oa,R,X,ea,Da,Aa,{x:D,y:ca});w(W(D.x-ab),W(D.y-ab))}if(ta){ta=zc(ta);for(D=ta.length;D--;){ca=B.series[D? | ||
3015 | 42 | "yAxis":"xAxis"];if(ta[D]&&ca){ca=ca.getPlotLinePath(B[D?"y":"x"],1);if(da[D])da[D].attr({d:ca,visibility:Ab});else{la={"stroke-width":ta[D].width||1,stroke:ta[D].color||"#C0C0C0",zIndex:2};if(ta[D].dashStyle)la.dashstyle=ta[D].dashStyle;da[D]=ga.path(ca).attr(la).add()}}}}},hide:x,destroy:function(){u(da,function(B){B&&B.destroy()});u([I,ba,o],function(B){B&&B.destroy()});I=ba=o=null}}}function f(p){function q(L){var s,o=Ud&&ua.width/ua.body.scrollWidth-1,I,ba,B;L=L||db.event;if(!L.target)L.target= | ||
3016 | 43 | L.srcElement;s=L.touches?L.touches.item(0):L;if(L.type!=="mousemove"||db.opera||o){Jb=Fd(oa);I=Jb.left;ba=Jb.top}if(Pc){B=L.x;s=L.y}else if(s.layerX===Wa){B=s.pageX-I;s=s.pageY-ba}else{B=L.layerX;s=L.layerY}if(o){B+=W((o+1)*I-I);s+=W((o+1)*ba-ba)}return sa(L,{chartX:B,chartY:s})}function w(L){var s={xAxis:[],yAxis:[]};u(Va,function(o){var I=o.translate,ba=o.isXAxis;s[ba?"xAxis":"yAxis"].push({axis:o,value:I((va?!ba:ba)?L.chartX-X:Aa-L.chartY+ea,true)})});return s}function x(){var L=l.hoverSeries, | ||
3017 | 44 | s=l.hoverPoint;s&&s.onMouseOut();L&&L.onMouseOut();hc&&hc.hide();sd=null}function V(){if(za){var L={xAxis:[],yAxis:[]},s=za.getBBox(),o=s.x-X,I=s.y-ea;if(Ma){u(Va,function(ba){var B=ba.translate,D=ba.isXAxis,ca=va?!D:D,la=B(ca?o:Aa-I-s.height,true,0,0,1);B=B(ca?o+s.width:Aa-I,true,0,0,1);L[D?"xAxis":"yAxis"].push({axis:ba,min:tb(la,B),max:Ia(la,B)})});Pa(l,"selection",L,td)}za=za.destroy()}l.mouseIsDown=ud=Ma=false;pb(ua,Kb?"touchend":"mouseup",V)}function N(L){var s=K(L.pageX)?L.pageX:L.page.x;L= | ||
3018 | 45 | K(L.pageX)?L.pageY:L.page.y;Jb&&!gc(s-Jb.left-X,L-Jb.top-ea)&&x()}var ta,da,Ma,za,eb=z.zoomType,ab=/x/.test(eb),xa=/y/.test(eb),Oa=ab&&!va||xa&&va,R=xa&&!va||ab&&va;bd=function(){if(Ec){Ec.translate(X,ea);va&&Ec.attr({width:l.plotWidth,height:l.plotHeight}).invert()}else l.trackerGroup=Ec=ga.g("tracker").attr({zIndex:9}).add()};bd();if(p.enabled)l.tooltip=hc=e(p);(function(){oa.onmousedown=function(s){s=q(s);!Kb&&s.preventDefault&&s.preventDefault();l.mouseIsDown=ud=true;ta=s.chartX;da=s.chartY;Qa(ua, | ||
3019 | 46 | Kb?"touchend":"mouseup",V)};var L=function(s){if(!(s&&s.touches&&s.touches.length>1)){s=q(s);if(!Kb)s.returnValue=false;var o=s.chartX,I=s.chartY,ba=!gc(o-X,I-ea);Jb||(Jb=Fd(oa));if(Kb&&s.type==="touchstart")if(Ga(s.target,"isTracker"))l.runTrackerClick||s.preventDefault();else!ke&&!ba&&s.preventDefault();if(ba){if(o<X)o=X;else if(o>X+Da)o=X+Da;if(I<ea)I=ea;else if(I>ea+Aa)I=ea+Aa}if(ud&&s.type!=="touchstart"){Ma=Math.sqrt(Math.pow(ta-o,2)+Math.pow(da-I,2));if(Ma>10){if(sc&&(ab||xa)&&gc(ta-X,da-ea))za|| | ||
3020 | 47 | (za=ga.rect(X,ea,Oa?1:Da,R?1:Aa,0).attr({fill:z.selectionMarkerFill||"rgba(69,114,167,0.25)",zIndex:7}).add());if(za&&Oa){o=o-ta;za.attr({width:bb(o),x:(o>0?0:o)+ta})}if(za&&R){I=I-da;za.attr({height:bb(I),y:(I>0?0:I)+da})}}}else if(!ba){var B;I=l.hoverPoint;o=l.hoverSeries;var D,ca,la=$a,qa=va?s.chartY:s.chartX-X;if(hc&&p.shared){B=[];D=Ha.length;for(ca=0;ca<D;ca++)if(Ha[ca].visible&&Ha[ca].tooltipPoints.length){s=Ha[ca].tooltipPoints[qa];s._dist=bb(qa-s.plotX);la=tb(la,s._dist);B.push(s)}for(D= | ||
3021 | 48 | B.length;D--;)B[D]._dist>la&&B.splice(D,1);if(B.length&&B[0].plotX!==sd){hc.refresh(B);sd=B[0].plotX}}if(o&&o.tracker)(s=o.tooltipPoints[qa])&&s!==I&&s.onMouseOver()}return ba||!sc}};oa.onmousemove=L;Qa(oa,"mouseleave",x);Qa(ua,"mousemove",N);oa.ontouchstart=function(s){if(ab||xa)oa.onmousedown(s);L(s)};oa.ontouchmove=L;oa.ontouchend=function(){Ma&&x()};oa.onclick=function(s){var o=l.hoverPoint;s=q(s);s.cancelBubble=true;if(!Ma)if(o&&Ga(s.target,"isTracker")){var I=o.plotX,ba=o.plotY;sa(o,{pageX:Jb.left+ | ||
3022 | 49 | X+(va?Da-ba:I),pageY:Jb.top+ea+(va?Aa-I:ba)});Pa(o.series,"click",sa(s,{point:o}));o.firePointEvent("click",s)}else{sa(s,w(s));gc(s.chartX-X,s.chartY-ea)&&Pa(l,"click",s)}Ma=false}})();Vd=setInterval(function(){rd&&rd()},32);sa(this,{zoomX:ab,zoomY:xa,resetTracker:x,destroy:function(){if(l.trackerGroup)l.trackerGroup=Ec=l.trackerGroup.destroy();pb(ua,"mousemove",N);oa.onclick=oa.onmousedown=oa.onmousemove=oa.ontouchstart=oa.ontouchend=oa.ontouchmove=null}})}function g(p){var q=p.type||z.type||z.defaultSeriesType, | ||
3023 | 50 | w=wb[q],x=l.hasRendered;if(x)if(va&&q==="column")w=wb.bar;else if(!va&&q==="bar")w=wb.column;q=new w;q.init(l,p);if(!x&&q.inverted)va=true;if(q.isCartesian)sc=q.isCartesian;Ha.push(q);return q}function h(){z.alignTicks!==false&&u(Va,function(p){p.adjustTickAmount()});Ob=null}function i(p){var q=l.isDirtyLegend,w,x=l.isDirtyBox,V=Ha.length,N=V,ta=l.clipRect;for(oc(p,l);N--;){p=Ha[N];if(p.isDirty&&p.options.stacking){w=true;break}}if(w)for(N=V;N--;){p=Ha[N];if(p.options.stacking)p.isDirty=true}u(Ha, | ||
3024 | 51 | function(da){if(da.isDirty){da.cleanData();da.getSegments();if(da.options.legendType==="point")q=true}});if(q&&Fc.renderLegend){Fc.renderLegend();l.isDirtyLegend=false}if(sc){if(!cd){Ob=null;u(Va,function(da){da.setScale()})}h();Gc();u(Va,function(da){if(da.isDirty||x){da.redraw();x=true}})}if(x){vd();bd();if(ta){Hc(ta);ta.animate({width:l.plotSizeX,height:l.plotSizeY})}}u(Ha,function(da){if(da.isDirty&&da.visible&&(!da.isCartesian||da.xAxis))da.redraw()});Yb&&Yb.resetTracker&&Yb.resetTracker();Pa(l, | ||
3025 | 52 | "redraw")}function j(){var p=a.xAxis||{},q=a.yAxis||{},w;p=zc(p);u(p,function(x,V){x.index=V;x.isX=true});q=zc(q);u(q,function(x,V){x.index=V});Va=p.concat(q);l.xAxis=[];l.yAxis=[];Va=tc(Va,function(x){w=new c(x);l[w.isXAxis?"xAxis":"yAxis"].push(w);return w});h()}function m(p,q){uc=Ca(a.title,p);Ic=Ca(a.subtitle,q);u([["title",p,uc],["subtitle",q,Ic]],function(w){var x=w[0],V=l[x],N=w[1];w=w[2];if(V&&N)V=V.destroy();if(w&&w.text&&!V)l[x]=ga.text(w.text,0,0,w.useHTML).attr({align:w.align,"class":"highcharts-"+ | ||
3026 | 53 | x,zIndex:1}).css(w.style).add().align(w,false,Rb)})}function v(){qb=z.renderTo;Wd=vc+wd++;if(Sb(qb))qb=ua.getElementById(qb);qb.innerHTML="";if(!qb.offsetWidth){Zb=qb.cloneNode(0);Ja(Zb,{position:ic,top:"-9999px",display:""});ua.body.appendChild(Zb)}dd=(Zb||qb).offsetWidth;Jc=(Zb||qb).offsetHeight;l.chartWidth=$a=z.width||dd||600;l.chartHeight=cb=z.height||(Jc>19?Jc:400);l.container=oa=hb(Tb,{className:"highcharts-container"+(z.className?" "+z.className:""),id:Wd},sa({position:Xd,overflow:ob,width:$a+ | ||
3027 | 54 | Ua,height:cb+Ua,textAlign:"left"},z.style),Zb||qb);l.renderer=ga=z.forExport?new ed(oa,$a,cb,true):new fd(oa,$a,cb);var p,q;if(Yd&&oa.getBoundingClientRect){p=function(){Ja(oa,{left:0,top:0});q=oa.getBoundingClientRect();Ja(oa,{left:-(q.left-ja(q.left))+Ua,top:-(q.top-ja(q.top))+Ua})};p();Qa(db,"resize",p);Qa(l,"destroy",function(){pb(db,"resize",p)})}}function P(){function p(){var w=z.width||qb.offsetWidth,x=z.height||qb.offsetHeight;if(w&&x){if(w!==dd||x!==Jc){clearTimeout(q);q=setTimeout(function(){xd(w, | ||
3028 | 55 | x,false)},100)}dd=w;Jc=x}}var q;Qa(db,"resize",p);Qa(l,"destroy",function(){pb(db,"resize",p)})}function T(){Pa(l,"endResize",null,function(){cd-=1})}function Y(){var p=a.labels,q=a.credits,w;m();Fc=l.legend=new le;Gc();u(Va,function(x){x.setTickPositions(true)});h();Gc();vd();sc&&u(Va,function(x){x.render()});if(!l.seriesGroup)l.seriesGroup=ga.g("series-group").attr({zIndex:3}).add();u(Ha,function(x){x.translate();x.setTooltipPoints();x.render()});p.items&&u(p.items,function(){var x=sa(p.style,this.style), | ||
3029 | 56 | V=ja(x.left)+X,N=ja(x.top)+ea+12;delete x.left;delete x.top;ga.text(this.html,V,N).attr({zIndex:2}).css(x).add()});if(!l.toolbar)l.toolbar=d();if(q.enabled&&!l.credits){w=q.href;l.credits=ga.text(q.text,0,0).on("click",function(){if(w)location.href=w}).attr({align:q.position.align,zIndex:8}).css(q.style).add().align(q.position)}bd();l.hasRendered=true;if(Zb){qb.appendChild(oa);pc(Zb)}}function H(){var p,q=oa&&oa.parentNode;if(l!==null){Pa(l,"destroy");pb(db,"unload",H);pb(l);for(p=Va.length;p--;)Va[p]= | ||
3030 | 57 | Va[p].destroy();for(p=Ha.length;p--;)Ha[p]=Ha[p].destroy();u(["title","subtitle","seriesGroup","clipRect","credits","tracker"],function(w){var x=l[w];if(x)l[w]=x.destroy()});u([wc,xc,Kc,Fc,hc,ga,Yb],function(w){w&&w.destroy&&w.destroy()});wc=xc=Kc=Fc=hc=ga=Yb=null;if(oa){oa.innerHTML="";pb(oa);q&&pc(oa);oa=null}clearInterval(Vd);for(p in l)delete l[p];l=null}}function U(){if(!Lc&&db==db.top&&ua.readyState!=="complete")ua.attachEvent("onreadystatechange",function(){ua.detachEvent("onreadystatechange", | ||
3031 | 58 | U);ua.readyState==="complete"&&U()});else{v();yd();zd();u(a.series||[],function(p){g(p)});l.inverted=va=A(va,a.chart.inverted);j();l.render=Y;l.tracker=Yb=new f(a.tooltip);Y();Pa(l,"load");b&&b.apply(l,[l]);u(l.callbacks,function(p){p.apply(l,[l])})}}Yc=Ca(Yc,Xa.xAxis);od=Ca(od,Xa.yAxis);Xa.xAxis=Xa.yAxis=null;a=Ca(Xa,a);var z=a.chart,M=z.margin;M=Nb(M)?M:[M,M,M,M];var y=A(z.marginTop,M[0]),C=A(z.marginRight,M[1]),Z=A(z.marginBottom,M[2]),Sa=A(z.marginLeft,M[3]),Na=z.spacingTop,Ea=z.spacingRight, | ||
3032 | 59 | gb=z.spacingBottom,Lb=z.spacingLeft,Rb,uc,Ic,ea,Ib,vb,X,Xb,qb,Zb,oa,Wd,dd,Jc,$a,cb,qd,ad,wc,Kc,Ad,xc,l=this,ke=(M=z.events)&&!!M.click,Bd,gc,hc,ud,jc,Zd,Cd,Aa,Da,Yb,Ec,bd,Fc,$b,ac,Jb,sc=z.showAxes,cd=0,Va=[],Ob,Ha=[],va,ga,rd,Vd,sd,vd,Gc,yd,zd,xd,td,$d,le=function(){function p(G,ha){var na=G.legendItem,Ra=G.legendLine,La=G.legendSymbol,pa=Oa.color,wa=ha?N.itemStyle.color:pa,zb=ha?G.color:pa;pa=ha?G.pointAttr[ib]:{stroke:pa,fill:pa};na&&na.css({fill:wa});Ra&&Ra.attr({stroke:zb});La&&La.attr(pa)}function q(G, | ||
3033 | 60 | ha,na){var Ra=G.legendItem,La=G.legendLine,pa=G.legendSymbol;G=G.checkbox;Ra&&Ra.attr({x:ha,y:na});La&&La.translate(ha,na-4);pa&&pa.attr({x:ha+pa.xOff,y:na+pa.yOff});if(G){G.x=ha;G.y=na}}function w(){u(za,function(G){var ha=G.checkbox,na=qa.alignAttr;ha&&Ja(ha,{left:na.translateX+G.legendItemWidth+ha.x-40+Ua,top:na.translateY+ha.y-11+Ua})})}function x(G){var ha,na,Ra,La,pa=G.legendItem;La=G.series||G;var wa=La.options,zb=wa&&wa.borderWidth||0;if(!pa){La=/^(bar|pie|area|column)$/.test(La.type);G.legendItem= | ||
3034 | 61 | pa=ga.text(N.labelFormatter.call(G),0,0).css(G.visible?ab:Oa).on("mouseover",function(){G.setState(Bb);pa.css(xa)}).on("mouseout",function(){pa.css(G.visible?ab:Oa);G.setState()}).on("click",function(){var Gb=function(){G.setVisible()};G.firePointEvent?G.firePointEvent("legendItemClick",null,Gb):Pa(G,"legendItemClick",null,Gb)}).attr({zIndex:2}).add(qa);if(!La&&wa&&wa.lineWidth){var Vb={"stroke-width":wa.lineWidth,zIndex:2};if(wa.dashStyle)Vb.dashstyle=wa.dashStyle;G.legendLine=ga.path([Za,-da-Ma, | ||
3035 | 62 | 0,Ka,-Ma,0]).attr(Vb).add(qa)}if(La)ha=ga.rect(na=-da-Ma,Ra=-11,da,12,2).attr({zIndex:3}).add(qa);else if(wa&&wa.marker&&wa.marker.enabled)ha=ga.symbol(G.symbol,na=-da/2-Ma,Ra=-4,wa.marker.radius).attr({zIndex:3}).add(qa);if(ha){ha.xOff=na+zb%2/2;ha.yOff=Ra+zb%2/2}G.legendSymbol=ha;p(G,G.visible);if(wa&&wa.showCheckbox){G.checkbox=hb("input",{type:"checkbox",checked:G.selected,defaultChecked:G.selected},N.itemCheckboxStyle,oa);Qa(G.checkbox,"click",function(Gb){Pa(G,"checkboxClick",{checked:Gb.target.checked}, | ||
3036 | 63 | function(){G.select()})})}}ha=pa.getBBox();na=G.legendItemWidth=N.itemWidth||da+Ma+ha.width+R;B=ha.height;if(ta&&o-s+na>(fb||$a-2*R-s)){o=s;I+=B}ba=I;q(G,o,I);if(ta)o+=na;else I+=B;ya=fb||Ia(ta?o-s:na,ya)}function V(){o=s;I=L;ba=ya=0;qa||(qa=ga.g("legend").attr({zIndex:7}).add());za=[];u(Hb,function(Ra){var La=Ra.options;if(La.showInLegend)za=za.concat(La.legendType==="point"?Ra.data:Ra)});Hd(za,function(Ra,La){return(Ra.options.legendIndex||0)-(La.options.legendIndex||0)});cc&&za.reverse();u(za, | ||
3037 | 64 | x);$b=fb||ya;ac=ba-L+B;if(ca||la){$b+=2*R;ac+=2*R;if(D){if($b>0&&ac>0){D[D.isNew?"attr":"animate"](D.crisp(null,null,null,$b,ac));D.isNew=false}}else{D=ga.rect(0,0,$b,ac,N.borderRadius,ca||0).attr({stroke:N.borderColor,"stroke-width":ca||0,fill:la||jb}).add(qa).shadow(N.shadow);D.isNew=true}D[za.length?"show":"hide"]()}for(var G=["left","right","top","bottom"],ha,na=4;na--;){ha=G[na];if(eb[ha]&&eb[ha]!=="auto"){N[na<2?"align":"verticalAlign"]=ha;N[na<2?"x":"y"]=ja(eb[ha])*(na%2?-1:1)}}za.length&& | ||
3038 | 65 | qa.align(sa(N,{width:$b,height:ac}),true,Rb);cd||w()}var N=l.options.legend;if(N.enabled){var ta=N.layout==="horizontal",da=N.symbolWidth,Ma=N.symbolPadding,za,eb=N.style,ab=N.itemStyle,xa=N.itemHoverStyle,Oa=N.itemHiddenStyle,R=ja(eb.padding),L=18,s=4+R+da+Ma,o,I,ba,B=0,D,ca=N.borderWidth,la=N.backgroundColor,qa,ya,fb=N.width,Hb=l.series,cc=N.reversed;V();Qa(l,"endResize",w);return{colorizeItem:p,destroyItem:function(G){var ha=G.checkbox;u(["legendItem","legendLine","legendSymbol"],function(na){G[na]&& | ||
3039 | 66 | G[na].destroy()});ha&&pc(G.checkbox)},renderLegend:V,destroy:function(){if(D)D=D.destroy();if(qa)qa=qa.destroy()}}}};gc=function(p,q){return p>=0&&p<=Da&&q>=0&&q<=Aa};$d=function(){Pa(l,"selection",{resetSelection:true},td);l.toolbar.remove("zoom")};td=function(p){var q=Xa.lang,w=l.pointCount<100;l.toolbar.add("zoom",q.resetZoom,q.resetZoomTitle,$d);!p||p.resetSelection?u(Va,function(x){x.setExtremes(null,null,false,w)}):u(p.xAxis.concat(p.yAxis),function(x){var V=x.axis;if(l.tracker[V.isXAxis?"zoomX": | ||
3040 | 67 | "zoomY"])V.setExtremes(x.min,x.max,false,w)});i()};Gc=function(){var p=a.legend,q=A(p.margin,10),w=p.x,x=p.y,V=p.align,N=p.verticalAlign,ta;yd();if((l.title||l.subtitle)&&!K(y))if(ta=Ia(l.title&&!uc.floating&&!uc.verticalAlign&&uc.y||0,l.subtitle&&!Ic.floating&&!Ic.verticalAlign&&Ic.y||0))ea=Ia(ea,ta+A(uc.margin,15)+Na);if(p.enabled&&!p.floating)if(V==="right")K(C)||(Ib=Ia(Ib,$b-w+q+Ea));else if(V==="left")K(Sa)||(X=Ia(X,$b+w+q+Lb));else if(N==="top")K(y)||(ea=Ia(ea,ac+x+q+Na));else if(N==="bottom")K(Z)|| | ||
3041 | 68 | (vb=Ia(vb,ac-x+q+gb));sc&&u(Va,function(da){da.getOffset()});K(Sa)||(X+=Xb[3]);K(y)||(ea+=Xb[0]);K(Z)||(vb+=Xb[2]);K(C)||(Ib+=Xb[1]);zd()};xd=function(p,q,w){var x=l.title,V=l.subtitle;cd+=1;oc(w,l);ad=cb;qd=$a;l.chartWidth=$a=W(p);l.chartHeight=cb=W(q);Ja(oa,{width:$a+Ua,height:cb+Ua});ga.setSize($a,cb,w);Da=$a-X-Ib;Aa=cb-ea-vb;Ob=null;u(Va,function(N){N.isDirty=true;N.setScale()});u(Ha,function(N){N.isDirty=true});l.isDirtyLegend=true;l.isDirtyBox=true;Gc();x&&x.align(null,null,Rb);V&&V.align(null, | ||
3042 | 69 | null,Rb);i(w);ad=null;Pa(l,"resize");Bc===false?T():setTimeout(T,Bc&&Bc.duration||500)};zd=function(){l.plotLeft=X=W(X);l.plotTop=ea=W(ea);l.plotWidth=Da=W($a-X-Ib);l.plotHeight=Aa=W(cb-ea-vb);l.plotSizeX=va?Aa:Da;l.plotSizeY=va?Da:Aa;Rb={x:Lb,y:Na,width:$a-Lb-Ea,height:cb-Na-gb}};yd=function(){ea=A(y,Na);Ib=A(C,Ea);vb=A(Z,gb);X=A(Sa,Lb);Xb=[0,0,0,0]};vd=function(){var p=z.borderWidth||0,q=z.backgroundColor,w=z.plotBackgroundColor,x=z.plotBackgroundImage,V,N={x:X,y:ea,width:Da,height:Aa};V=p+(z.shadow? | ||
3043 | 70 | 8:0);if(p||q)if(wc)wc.animate(wc.crisp(null,null,null,$a-V,cb-V));else wc=ga.rect(V/2,V/2,$a-V,cb-V,z.borderRadius,p).attr({stroke:z.borderColor,"stroke-width":p,fill:q||jb}).add().shadow(z.shadow);if(w)if(Kc)Kc.animate(N);else Kc=ga.rect(X,ea,Da,Aa,0).attr({fill:w}).add().shadow(z.plotShadow);if(x)if(Ad)Ad.animate(N);else Ad=ga.image(x,X,ea,Da,Aa).add();if(z.plotBorderWidth)if(xc)xc.animate(xc.crisp(null,X,ea,Da,Aa));else xc=ga.rect(X,ea,Da,Aa,0,z.plotBorderWidth).attr({stroke:z.plotBorderColor, | ||
3044 | 71 | "stroke-width":z.plotBorderWidth,zIndex:4}).add();l.isDirtyBox=false};Qa(db,"unload",H);z.reflow!==false&&Qa(l,"load",P);if(M)for(Bd in M)Qa(l,Bd,M[Bd]);l.options=a;l.series=Ha;l.addSeries=function(p,q,w){var x;if(p){oc(w,l);q=A(q,true);Pa(l,"addSeries",{options:p},function(){x=g(p);x.isDirty=true;l.isDirtyLegend=true;q&&l.redraw()})}return x};l.animation=A(z.animation,true);l.destroy=H;l.get=function(p){var q,w,x;for(q=0;q<Va.length;q++)if(Va[q].options.id===p)return Va[q];for(q=0;q<Ha.length;q++)if(Ha[q].options.id=== | ||
3045 | 72 | p)return Ha[q];for(q=0;q<Ha.length;q++){x=Ha[q].data;for(w=0;w<x.length;w++)if(x[w].id===p)return x[w]}return null};l.getSelectedPoints=function(){var p=[];u(Ha,function(q){p=p.concat(Dd(q.data,function(w){return w.selected}))});return p};l.getSelectedSeries=function(){return Dd(Ha,function(p){return p.selected})};l.hideLoading=function(){gd(jc,{opacity:0},{duration:a.loading.hideDuration,complete:function(){Ja(jc,{display:jb})}});Cd=false};l.isInsidePlot=gc;l.redraw=i;l.setSize=xd;l.setTitle=m;l.showLoading= | ||
3046 | 73 | function(p){var q=a.loading;if(!jc){jc=hb(Tb,{className:"highcharts-loading"},sa(q.style,{left:X+Ua,top:ea+Ua,width:Da+Ua,height:Aa+Ua,zIndex:10,display:jb}),oa);Zd=hb("span",null,q.labelStyle,jc)}Zd.innerHTML=p||a.lang.loading;if(!Cd){Ja(jc,{opacity:0,display:""});gd(jc,{opacity:q.style.opacity},{duration:q.showDuration});Cd=true}};l.pointCount=0;l.counters=new Gd;U()}var ua=document,db=window,Fa=Math,W=Fa.round,lb=Fa.floor,md=Fa.ceil,Ia=Fa.max,tb=Fa.min,bb=Fa.abs,rb=Fa.cos,Cb=Fa.sin,kc=Fa.PI,ae= | ||
3047 | 74 | kc*2/360,yc=navigator.userAgent,Pc=/msie/i.test(yc)&&!db.opera,Mc=ua.documentMode===8,Ud=/AppleWebKit/.test(yc),Yd=/Firefox/.test(yc),Lc=!!ua.createElementNS&&!!ua.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,me=Yd&&parseInt(yc.split("Firefox/")[1],10)<4,fd,Kb=ua.documentElement.ontouchstart!==undefined,be={},wd=0,ub=1,Tc,Xa,Zc,Bc,Nc,Wa,Tb="div",ic="absolute",Xd="relative",ob="hidden",vc="highcharts-",Ab="visible",Ua="px",jb="none",Za="M",Ka="L",ce="rgba(192,192,192,"+(Lc?1.0E-6: | ||
3048 | 75 | 0.0020)+")",ib="",Bb="hover",Qc,id,jd,kd,Cc,Rc,Sc,Jd,Kd,ld,Ld,Md,ma=db.HighchartsAdapter,Db=ma||{},u=Db.each,Dd=Db.grep,tc=Db.map,Ca=Db.merge,Qa=Db.addEvent,pb=Db.removeEvent,Pa=Db.fireEvent,gd=Db.animate,Hc=Db.stop,wb={};Zc=function(a,b,c){function d(P){return P.toString().replace(/^([0-9])$/,"0$1")}if(!K(b)||isNaN(b))return"Invalid date";a=A(a,"%Y-%m-%d %H:%M:%S");b=new Date(b*ub);var e,f=b[jd](),g=b[kd](),h=b[Cc](),i=b[Rc](),j=b[Sc](),m=Xa.lang,v=m.weekdays;b={a:v[g].substr(0,3),A:v[g],d:d(h), | ||
3049 | 76 | e:h,b:m.shortMonths[i],B:m.months[i],m:d(i+1),y:j.toString().substr(2,2),Y:j,H:d(f),I:d(f%12||12),l:f%12||12,M:d(b[id]()),p:f<12?"AM":"PM",P:f<12?"am":"pm",S:d(b.getSeconds())};for(e in b)a=a.replace("%"+e,b[e]);return c?a.substr(0,1).toUpperCase()+a.substr(1):a};Gd.prototype={wrapColor:function(a){if(this.color>=a)this.color=0},wrapSymbol:function(a){if(this.symbol>=a)this.symbol=0}};Nc={init:function(a,b,c){b=b||"";var d=a.shift,e=b.indexOf("C")>-1,f=e?7:3,g;b=b.split(" ");c=[].concat(c);var h, | ||
3050 | 77 | i,j=function(m){for(g=m.length;g--;)m[g]===Za&&m.splice(g+1,0,m[g+1],m[g+2],m[g+1],m[g+2])};if(e){j(b);j(c)}if(a.isArea){h=b.splice(b.length-6,6);i=c.splice(c.length-6,6)}if(d){c=[].concat(c).splice(0,f).concat(c);a.shift=false}if(b.length)for(a=c.length;b.length<a;){d=[].concat(b).splice(b.length-f,f);if(e){d[f-6]=d[f-2];d[f-5]=d[f-1]}b=b.concat(d)}if(h){b=b.concat(h);c=c.concat(i)}return[b,c]},step:function(a,b,c,d){var e=[],f=a.length;if(c===1)e=d;else if(f===b.length&&c<1)for(;f--;){d=parseFloat(a[f]); | ||
3051 | 78 | e[f]=isNaN(d)?a[f]:c*parseFloat(b[f]-d)+d}else e=b;return e}};ma&&ma.init&&ma.init(Nc);if(!ma&&db.jQuery){var Mb=jQuery;u=function(a,b){for(var c=0,d=a.length;c<d;c++)if(b.call(a[c],a[c],c,a)===false)return c};Dd=Mb.grep;tc=function(a,b){for(var c=[],d=0,e=a.length;d<e;d++)c[d]=b.call(a[d],a[d],d,a);return c};Ca=function(){var a=arguments;return Mb.extend(true,null,a[0],a[1],a[2],a[3])};Qa=function(a,b,c){Mb(a).bind(b,c)};pb=function(a,b,c){var d=ua.removeEventListener?"removeEventListener":"detachEvent"; | ||
3052 | 79 | if(ua[d]&&!a[d])a[d]=function(){};Mb(a).unbind(b,c)};Pa=function(a,b,c,d){var e=Mb.Event(b),f="detached"+b;sa(e,c);if(a[b]){a[f]=a[b];a[b]=null}Mb(a).trigger(e);if(a[f]){a[b]=a[f];a[f]=null}d&&!e.isDefaultPrevented()&&d(e)};gd=function(a,b,c){var d=Mb(a);if(b.d){a.toD=b.d;b.d=1}d.stop();d.animate(b,c)};Hc=function(a){Mb(a).stop()};Mb.extend(Mb.easing,{easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c}});var de=jQuery.fx,ee=de.step;u(["cur","_default","width","height"],function(a,b){var c=b? | ||
3053 | 80 | ee:de.prototype,d=c[a],e;if(d)c[a]=function(f){f=b?f:this;e=f.elem;return e.attr?e.attr(f.prop,f.now):d.apply(this,arguments)}});ee.d=function(a){var b=a.elem;if(!a.started){var c=Nc.init(b,b.d,b.toD);a.start=c[0];a.end=c[1];a.started=true}b.attr("d",Nc.step(a.start,a.end,a.pos,b.toD))}}ma={enabled:true,align:"center",x:0,y:15,style:{color:"#666",fontSize:"11px",lineHeight:"14px"}};Xa={colors:["#4572A7","#AA4643","#89A54E","#80699B","#3D96AE","#DB843D","#92A8CD","#A47D7C","#B5CA92"],symbols:["circle", | ||
3054 | 81 | "diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","June","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],decimalPoint:".",resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:","},global:{useUTC:true},chart:{borderColor:"#4572A7", | ||
3055 | 82 | borderRadius:5,defaultSeriesType:"line",ignoreHiddenSeries:true,spacingTop:10,spacingRight:10,spacingBottom:15,spacingLeft:10,style:{fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif',fontSize:"12px"},backgroundColor:"#FFFFFF",plotBorderColor:"#C0C0C0"},title:{text:"Chart title",align:"center",y:15,style:{color:"#3E576F",fontSize:"16px"}},subtitle:{text:"",align:"center",y:30,style:{color:"#6D869F"}},plotOptions:{line:{allowPointSelect:false,showCheckbox:false, | ||
3056 | 83 | animation:{duration:1E3},events:{},lineWidth:2,shadow:true,marker:{enabled:true,lineWidth:0,radius:4,lineColor:"#FFFFFF",states:{hover:{},select:{fillColor:"#FFFFFF",lineColor:"#000000",lineWidth:2}}},point:{events:{}},dataLabels:Ca(ma,{enabled:false,y:-6,formatter:function(){return this.y}}),showInLegend:true,states:{hover:{marker:{}},select:{marker:{}}},stickyTracking:true}},labels:{style:{position:ic,color:"#3E576F"}},legend:{enabled:true,align:"center",layout:"horizontal",labelFormatter:function(){return this.name}, | ||
3057 | 84 | borderWidth:1,borderColor:"#909090",borderRadius:5,shadow:false,style:{padding:"5px"},itemStyle:{cursor:"pointer",color:"#3E576F"},itemHoverStyle:{cursor:"pointer",color:"#000000"},itemHiddenStyle:{color:"#C0C0C0"},itemCheckboxStyle:{position:ic,width:"13px",height:"13px"},symbolWidth:16,symbolPadding:5,verticalAlign:"bottom",x:0,y:0},loading:{hideDuration:100,labelStyle:{fontWeight:"bold",position:Xd,top:"1em"},showDuration:100,style:{position:ic,backgroundColor:"white",opacity:0.5,textAlign:"center"}}, | ||
3058 | 85 | tooltip:{enabled:true,backgroundColor:"rgba(255, 255, 255, .85)",borderWidth:2,borderRadius:5,shadow:true,snap:Kb?25:10,style:{color:"#333333",fontSize:"12px",padding:"5px",whiteSpace:"nowrap"}},toolbar:{itemStyle:{color:"#4572A7",cursor:"pointer"}},credits:{enabled:true,text:"Highcharts.com",href:"http://www.highcharts.com",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#909090",fontSize:"10px"}}};var Yc={dateTimeLabelFormats:{second:"%H:%M:%S",minute:"%H:%M", | ||
3059 | 86 | hour:"%H:%M",day:"%e. %b",week:"%e. %b",month:"%b '%y",year:"%Y"},endOnTick:false,gridLineColor:"#C0C0C0",labels:ma,lineColor:"#C0D0E0",lineWidth:1,max:null,min:null,minPadding:0.01,maxPadding:0.01,minorGridLineColor:"#E0E0E0",minorGridLineWidth:1,minorTickColor:"#A0A0A0",minorTickLength:2,minorTickPosition:"outside",startOfWeek:1,startOnTick:false,tickColor:"#C0D0E0",tickLength:5,tickmarkPlacement:"between",tickPixelInterval:100,tickPosition:"outside",tickWidth:1,title:{align:"middle",style:{color:"#6D869F", | ||
3060 | 87 | fontWeight:"bold"}},type:"linear"},od=Ca(Yc,{endOnTick:true,gridLineWidth:1,tickPixelInterval:72,showLastLabel:true,labels:{align:"right",x:-8,y:3},lineWidth:0,maxPadding:0.05,minPadding:0.05,startOnTick:true,tickWidth:0,title:{rotation:270,text:"Y-values"},stackLabels:{enabled:false,formatter:function(){return this.total},style:ma.style}}),ie={labels:{align:"right",x:-8,y:null},title:{rotation:270}},he={labels:{align:"left",x:8,y:null},title:{rotation:90}},Td={labels:{align:"center",x:0,y:14},title:{rotation:0}}, | ||
3061 | 88 | ge=Ca(Td,{labels:{y:-5}}),xb=Xa.plotOptions;ma=xb.line;xb.spline=Ca(ma);xb.scatter=Ca(ma,{lineWidth:0,states:{hover:{lineWidth:0}}});xb.area=Ca(ma,{});xb.areaspline=Ca(xb.area);xb.column=Ca(ma,{borderColor:"#FFFFFF",borderWidth:1,borderRadius:0,groupPadding:0.2,marker:null,pointPadding:0.1,minPointLength:0,states:{hover:{brightness:0.1,shadow:false},select:{color:"#C0C0C0",borderColor:"#000000",shadow:false}},dataLabels:{y:null,verticalAlign:null}});xb.bar=Ca(xb.column,{dataLabels:{align:"left",x:5, | ||
3062 | 89 | y:0}});xb.pie=Ca(ma,{borderColor:"#FFFFFF",borderWidth:1,center:["50%","50%"],colorByPoint:true,dataLabels:{distance:30,enabled:true,formatter:function(){return this.point.name},y:5},legendType:"point",marker:null,size:"75%",showInLegend:false,slicedOffset:10,states:{hover:{brightness:0.1,shadow:false}}});Id();var bc=function(a){var b=[],c;(function(d){if(c=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/.exec(d))b=[ja(c[1]),ja(c[2]),ja(c[3]),parseFloat(c[4], | ||
3063 | 90 | 10)];else if(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(d))b=[ja(c[1],16),ja(c[2],16),ja(c[3],16),1]})(a);return{get:function(d){return b&&!isNaN(b[0])?d==="rgb"?"rgb("+b[0]+","+b[1]+","+b[2]+")":d==="a"?b[3]:"rgba("+b.join(",")+")":a},brighten:function(d){if(lc(d)&&d!==0){var e;for(e=0;e<3;e++){b[e]+=ja(d*255);if(b[e]<0)b[e]=0;if(b[e]>255)b[e]=255}}return this},setOpacity:function(d){b[3]=d;return this}}};Uc.prototype={init:function(a,b){this.element=ua.createElementNS("http://www.w3.org/2000/svg", | ||
3064 | 91 | b);this.renderer=a},animate:function(a,b,c){if(b=A(b,Bc,true)){b=Ca(b);if(c)b.complete=c;gd(this,a,b)}else{this.attr(a);c&&c()}},attr:function(a,b){var c,d,e,f,g=this.element,h=g.nodeName,i=this.renderer,j,m=this.shadows,v=this.htmlNode,P,T=this;if(Sb(a)&&K(b)){c=a;a={};a[c]=b}if(Sb(a)){c=a;if(h==="circle")c={x:"cx",y:"cy"}[c]||c;else if(c==="strokeWidth")c="stroke-width";T=Ga(g,c)||this[c]||0;if(c!=="d"&&c!=="visibility")T=parseFloat(T)}else for(c in a){j=false;d=a[c];if(c==="d"){if(d&&d.join)d= | ||
3065 | 92 | d.join(" ");if(/(NaN| {2}|^$)/.test(d))d="M 0 0";this.d=d}else if(c==="x"&&h==="text"){for(e=0;e<g.childNodes.length;e++){f=g.childNodes[e];Ga(f,"x")===Ga(g,"x")&&Ga(f,"x",d)}if(this.rotation)Ga(g,"transform","rotate("+this.rotation+" "+d+" "+ja(a.y||Ga(g,"y"))+")")}else if(c==="fill")d=i.color(d,g,c);else if(h==="circle"&&(c==="x"||c==="y"))c={x:"cx",y:"cy"}[c]||c;else if(c==="translateX"||c==="translateY"||c==="rotation"||c==="verticalAlign"){this[c]=d;this.updateTransform();j=true}else if(c=== | ||
3066 | 93 | "stroke")d=i.color(d,g,c);else if(c==="dashstyle"){c="stroke-dasharray";d=d&&d.toLowerCase();if(d==="solid")d=jb;else if(d){d=d.replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot","3,1,1,1").replace("shortdot","1,1,").replace("shortdash","3,1,").replace("longdash","8,3,").replace(/dot/g,"1,3,").replace("dash","4,3,").replace(/,$/,"").split(",");for(e=d.length;e--;)d[e]=ja(d[e])*a["stroke-width"];d=d.join(",")}}else if(c==="isTracker")this[c]=d;else if(c==="width")d=ja(d);else if(c=== | ||
3067 | 94 | "align"){c="text-anchor";d={left:"start",center:"middle",right:"end"}[d]}else if(c==="title"){e=ua.createElementNS("http://www.w3.org/2000/svg","title");e.appendChild(ua.createTextNode(d));g.appendChild(e)}if(c==="strokeWidth")c="stroke-width";if(Ud&&c==="stroke-width"&&d===0)d=1.0E-6;if(this.symbolName&&/^(x|y|r|start|end|innerR)/.test(c)){if(!P){this.symbolAttr(a);P=true}j=true}if(m&&/^(width|height|visibility|x|y|d)$/.test(c))for(e=m.length;e--;)Ga(m[e],c,d);if((c==="width"||c==="height")&&h=== | ||
3068 | 95 | "rect"&&d<0)d=0;if(c==="text"){this.textStr=d;this.added&&i.buildText(this)}else j||Ga(g,c,d);if(v&&(c==="x"||c==="y"||c==="translateX"||c==="translateY"||c==="visibility")){e=v.length?v:[this];f=e.length;var Y;for(Y=0;Y<f;Y++){v=e[Y];j=v.getBBox();v=v.htmlNode;Ja(v,sa(this.styles,{left:j.x+(this.translateX||0)+Ua,top:j.y+(this.translateY||0)+Ua}));c==="visibility"&&Ja(v,{visibility:d})}}}return T},symbolAttr:function(a){var b=this;u(["x","y","r","start","end","width","height","innerR"],function(c){b[c]= | ||
3069 | 96 | A(a[c],b[c])});b.attr({d:b.renderer.symbols[b.symbolName](W(b.x*2)/2,W(b.y*2)/2,b.r,{start:b.start,end:b.end,width:b.width,height:b.height,innerR:b.innerR})})},clip:function(a){return this.attr("clip-path","url("+this.renderer.url+"#"+a.id+")")},crisp:function(a,b,c,d,e){var f,g={},h={},i;a=a||this.strokeWidth||0;i=a%2/2;h.x=lb(b||this.x||0)+i;h.y=lb(c||this.y||0)+i;h.width=lb((d||this.width||0)-2*i);h.height=lb((e||this.height||0)-2*i);h.strokeWidth=a;for(f in h)if(this[f]!==h[f])this[f]=g[f]=h[f]; | ||
3070 | 97 | return g},css:function(a){var b=this.element;b=a&&a.width&&b.nodeName==="text";var c,d="",e=function(f,g){return"-"+g.toLowerCase()};if(a&&a.color)a.fill=a.color;this.styles=a=sa(this.styles,a);if(Pc&&!Lc){b&&delete a.width;Ja(this.element,a)}else{for(c in a)d+=c.replace(/([A-Z])/g,e)+":"+a[c]+";";this.attr({style:d})}b&&this.added&&this.renderer.buildText(this);return this},on:function(a,b){var c=b;if(Kb&&a==="click"){a="touchstart";c=function(d){d.preventDefault();b()}}this.element["on"+a]=c;return this}, | ||
3071 | 98 | translate:function(a,b){return this.attr({translateX:a,translateY:b})},invert:function(){this.inverted=true;this.updateTransform();return this},updateTransform:function(){var a=this.translateX||0,b=this.translateY||0,c=this.inverted,d=this.rotation,e=[];if(c){a+=this.attr("width");b+=this.attr("height")}if(a||b)e.push("translate("+a+","+b+")");if(c)e.push("rotate(90) scale(-1,1)");else d&&e.push("rotate("+d+" "+this.x+" "+this.y+")");e.length&&Ga(this.element,"transform",e.join(" "))},toFront:function(){var a= | ||
3072 | 99 | this.element;a.parentNode.appendChild(a);return this},align:function(a,b,c){if(a){this.alignOptions=a;this.alignByTranslate=b;c||this.renderer.alignedObjects.push(this)}else{a=this.alignOptions;b=this.alignByTranslate}c=A(c,this.renderer);var d=a.align,e=a.verticalAlign,f=(c.x||0)+(a.x||0),g=(c.y||0)+(a.y||0),h={};if(/^(right|center)$/.test(d))f+=(c.width-(a.width||0))/{right:1,center:2}[d];h[b?"translateX":"x"]=W(f);if(/^(bottom|middle)$/.test(e))g+=(c.height-(a.height||0))/({bottom:1,middle:2}[e]|| | ||
3073 | 100 | 1);h[b?"translateY":"y"]=W(g);this[this.placed?"animate":"attr"](h);this.placed=true;this.alignAttr=h;return this},getBBox:function(){var a,b,c,d=this.rotation,e=d*ae;try{a=sa({},this.element.getBBox())}catch(f){a={width:0,height:0}}b=a.width;c=a.height;if(d){a.width=bb(c*Cb(e))+bb(b*rb(e));a.height=bb(c*rb(e))+bb(b*Cb(e))}return a},show:function(){return this.attr({visibility:Ab})},hide:function(){return this.attr({visibility:ob})},add:function(a){var b=this.renderer,c=a||b,d=c.element||b.box,e= | ||
3074 | 101 | d.childNodes,f=this.element,g=Ga(f,"zIndex");this.parentInverted=a&&a.inverted;this.textStr!==undefined&&b.buildText(this);if(a&&this.htmlNode){if(!a.htmlNode)a.htmlNode=[];a.htmlNode.push(this)}if(g){c.handleZ=true;g=ja(g)}if(c.handleZ)for(c=0;c<e.length;c++){a=e[c];b=Ga(a,"zIndex");if(a!==f&&(ja(b)>g||!K(g)&&K(b))){d.insertBefore(f,a);return this}}d.appendChild(f);this.added=true;return this},safeRemoveChild:function(a){var b=a.parentNode;b&&b.removeChild(a)},destroy:function(){var a=this,b=a.element|| | ||
3075 | 102 | {},c=a.shadows,d,e;b.onclick=b.onmouseout=b.onmouseover=b.onmousemove=null;Hc(a);if(a.clipPath)a.clipPath=a.clipPath.destroy();if(a.stops){for(e=0;e<a.stops.length;e++)a.stops[e]=a.stops[e].destroy();a.stops=null}a.safeRemoveChild(b);c&&u(c,function(f){a.safeRemoveChild(f)});nc(a.renderer.alignedObjects,a);for(d in a)delete a[d];return null},empty:function(){for(var a=this.element,b=a.childNodes,c=b.length;c--;)a.removeChild(b[c])},shadow:function(a,b){var c=[],d,e,f=this.element,g=this.parentInverted? | ||
3076 | 103 | "(-1,-1)":"(1,1)";if(a){for(d=1;d<=3;d++){e=f.cloneNode(0);Ga(e,{isShadow:"true",stroke:"rgb(0, 0, 0)","stroke-opacity":0.05*d,"stroke-width":7-2*d,transform:"translate"+g,fill:jb});b?b.element.appendChild(e):f.parentNode.insertBefore(e,f);c.push(e)}this.shadows=c}return this}};var ed=function(){this.init.apply(this,arguments)};ed.prototype={Element:Uc,init:function(a,b,c,d){var e=location,f;f=this.createElement("svg").attr({xmlns:"http://www.w3.org/2000/svg",version:"1.1"});a.appendChild(f.element); | ||
3077 | 104 | this.box=f.element;this.boxWrapper=f;this.alignedObjects=[];this.url=Pc?"":e.href.replace(/#.*?$/,"");this.defs=this.createElement("defs").add();this.forExport=d;this.gradients=[];this.setSize(b,c,false)},destroy:function(){var a,b=this.gradients,c=this.defs;this.box=null;this.boxWrapper=this.boxWrapper.destroy();if(b){for(a=0;a<b.length;a++)this.gradients[a]=b[a].destroy();this.gradients=null}if(c)this.defs=c.destroy();return this.alignedObjects=null},createElement:function(a){var b=new this.Element; | ||
3078 | 105 | b.init(this,a);return b},buildText:function(a){for(var b=a.element,c=A(a.textStr,"").toString().replace(/<(b|strong)>/g,'<span style="font-weight:bold">').replace(/<(i|em)>/g,'<span style="font-style:italic">').replace(/<a/g,"<span").replace(/<\/(b|strong|i|em|a)>/g,"</span>").split(/<br.*?>/g),d=b.childNodes,e=/style="([^"]+)"/,f=/href="([^"]+)"/,g=Ga(b,"x"),h=a.styles,i=h&&a.useHTML&&!this.forExport,j=a.htmlNode,m=h&&ja(h.width),v=h&&h.lineHeight,P,T=d.length;T--;)b.removeChild(d[T]);m&&!a.added&& | ||
3079 | 106 | this.box.appendChild(b);u(c,function(Y,H){var U,z=0,M;Y=Y.replace(/<span/g,"|||<span").replace(/<\/span>/g,"</span>|||");U=Y.split("|||");u(U,function(y){if(y!==""||U.length===1){var C={},Z=ua.createElementNS("http://www.w3.org/2000/svg","tspan");e.test(y)&&Ga(Z,"style",y.match(e)[1].replace(/(;| |^)color([ :])/,"$1fill$2"));if(f.test(y)){Ga(Z,"onclick",'location.href="'+y.match(f)[1]+'"');Ja(Z,{cursor:"pointer"})}y=(y.replace(/<(.|\n)*?>/g,"")||" ").replace(/</g,"<").replace(/>/g,">");Z.appendChild(ua.createTextNode(y)); | ||
3080 | 107 | if(z)C.dx=3;else C.x=g;if(!z){if(H){!Lc&&a.renderer.forExport&&Ja(Z,{display:"block"});M=db.getComputedStyle&&ja(db.getComputedStyle(P,null).getPropertyValue("line-height"));if(!M||isNaN(M))M=v||P.offsetHeight||18;Ga(Z,"dy",M)}P=Z}Ga(Z,C);b.appendChild(Z);z++;if(m){y=y.replace(/-/g,"- ").split(" ");for(var Sa,Na=[];y.length||Na.length;){Sa=b.getBBox().width;C=Sa>m;if(!C||y.length===1){y=Na;Na=[];if(y.length){Z=ua.createElementNS("http://www.w3.org/2000/svg","tspan");Ga(Z,{dy:v||16,x:g});b.appendChild(Z); | ||
3081 | 108 | if(Sa>m)m=Sa}}else{Z.removeChild(Z.firstChild);Na.unshift(y.pop())}y.length&&Z.appendChild(ua.createTextNode(y.join(" ").replace(/- /g,"-")))}}}})});if(i){if(!j)j=a.htmlNode=hb("span",null,sa(h,{position:ic,top:0,left:0}),this.box.parentNode);j.innerHTML=a.textStr;for(T=d.length;T--;)d[T].style.visibility=ob}},crispLine:function(a,b){if(a[1]===a[4])a[1]=a[4]=W(a[1])+b%2/2;if(a[2]===a[5])a[2]=a[5]=W(a[2])+b%2/2;return a},path:function(a){return this.createElement("path").attr({d:a,fill:jb})},circle:function(a, | ||
3082 | 109 | b,c){a=Nb(a)?a:{x:a,y:b,r:c};return this.createElement("circle").attr(a)},arc:function(a,b,c,d,e,f){if(Nb(a)){b=a.y;c=a.r;d=a.innerR;e=a.start;f=a.end;a=a.x}return this.symbol("arc",a||0,b||0,c||0,{innerR:d||0,start:e||0,end:f||0})},rect:function(a,b,c,d,e,f){if(Nb(a)){b=a.y;c=a.width;d=a.height;e=a.r;f=a.strokeWidth;a=a.x}e=this.createElement("rect").attr({rx:e,ry:e,fill:jb});return e.attr(e.crisp(f,a,b,Ia(c,0),Ia(d,0)))},setSize:function(a,b,c){var d=this.alignedObjects,e=d.length;this.width=a; | ||
3083 | 110 | this.height=b;for(this.boxWrapper[A(c,true)?"animate":"attr"]({width:a,height:b});e--;)d[e].align()},g:function(a){var b=this.createElement("g");return K(a)?b.attr({"class":vc+a}):b},image:function(a,b,c,d,e){var f={preserveAspectRatio:jb};arguments.length>1&&sa(f,{x:b,y:c,width:d,height:e});f=this.createElement("image").attr(f);f.element.setAttributeNS?f.element.setAttributeNS("http://www.w3.org/1999/xlink","href",a):f.element.setAttribute("hc-svg-href",a);return f},symbol:function(a,b,c,d,e){var f, | ||
3084 | 111 | g=this.symbols[a];g=g&&g(W(b),W(c),d,e);var h=/^url\((.*?)\)$/,i;if(g){f=this.path(g);sa(f,{symbolName:a,x:b,y:c,r:d});e&&sa(f,e)}else if(h.test(a)){var j=function(m,v){m.attr({width:v[0],height:v[1]}).translate(-W(v[0]/2),-W(v[1]/2))};i=a.match(h)[1];a=be[i];f=this.image(i).attr({x:b,y:c});if(a)j(f,a);else{f.attr({width:0,height:0});hb("img",{onload:function(){j(f,be[i]=[this.width,this.height])},src:i})}}else f=this.circle(b,c,d);return f},symbols:{square:function(a,b,c){c=0.707*c;return[Za,a-c, | ||
3085 | 112 | b-c,Ka,a+c,b-c,a+c,b+c,a-c,b+c,"Z"]},triangle:function(a,b,c){return[Za,a,b-1.33*c,Ka,a+c,b+0.67*c,a-c,b+0.67*c,"Z"]},"triangle-down":function(a,b,c){return[Za,a,b+1.33*c,Ka,a-c,b-0.67*c,a+c,b-0.67*c,"Z"]},diamond:function(a,b,c){return[Za,a,b-c,Ka,a+c,b,a,b+c,a-c,b,"Z"]},arc:function(a,b,c,d){var e=d.start,f=d.end-1.0E-6,g=d.innerR,h=rb(e),i=Cb(e),j=rb(f);f=Cb(f);d=d.end-e<kc?0:1;return[Za,a+c*h,b+c*i,"A",c,c,0,d,1,a+c*j,b+c*f,Ka,a+g*j,b+g*f,"A",g,g,0,d,0,a+g*h,b+g*i,"Z"]}},clipRect:function(a,b, | ||
3086 | 113 | c,d){var e=vc+wd++,f=this.createElement("clipPath").attr({id:e}).add(this.defs);a=this.rect(a,b,c,d,0).add(f);a.id=e;a.clipPath=f;return a},color:function(a,b,c){var d,e=/^rgba/;if(a&&a.linearGradient){var f=this;b=a.linearGradient;c=vc+wd++;var g,h,i;g=f.createElement("linearGradient").attr({id:c,gradientUnits:"userSpaceOnUse",x1:b[0],y1:b[1],x2:b[2],y2:b[3]}).add(f.defs);f.gradients.push(g);g.stops=[];u(a.stops,function(j){if(e.test(j[1])){d=bc(j[1]);h=d.get("rgb");i=d.get("a")}else{h=j[1];i=1}j= | ||
3087 | 114 | f.createElement("stop").attr({offset:j[0],"stop-color":h,"stop-opacity":i}).add(g);g.stops.push(j)});return"url("+this.url+"#"+c+")"}else if(e.test(a)){d=bc(a);Ga(b,c+"-opacity",d.get("a"));return d.get("rgb")}else{b.removeAttribute(c+"-opacity");return a}},text:function(a,b,c,d){var e=Xa.chart.style;b=W(A(b,0));c=W(A(c,0));a=this.createElement("text").attr({x:b,y:c,text:a}).css({fontFamily:e.fontFamily,fontSize:e.fontSize});a.x=b;a.y=c;a.useHTML=d;return a}};fd=ed;if(!Lc){Db=yb(Uc,{init:function(a, | ||
3088 | 115 | b){var c=["<",b,' filled="f" stroked="f"'],d=["position: ",ic,";"];if(b==="shape"||b===Tb)d.push("left:0;top:0;width:10px;height:10px;");if(Mc)d.push("visibility: ",b===Tb?ob:Ab);c.push(' style="',d.join(""),'"/>');if(b){c=b===Tb||b==="span"||b==="img"?c.join(""):a.prepVML(c);this.element=hb(c)}this.renderer=a},add:function(a){var b=this.renderer,c=this.element,d=b.box;d=a?a.element||a:d;a&&a.inverted&&b.invertChild(c,d);Mc&&d.gVis===ob&&Ja(c,{visibility:ob});d.appendChild(c);this.added=true;this.alignOnAdd&& | ||
3089 | 116 | this.updateTransform();return this},attr:function(a,b){var c,d,e,f=this.element||{},g=f.style,h=f.nodeName,i=this.renderer,j=this.symbolName,m,v,P=this.shadows,T=this;if(Sb(a)&&K(b)){c=a;a={};a[c]=b}if(Sb(a)){c=a;T=c==="strokeWidth"||c==="stroke-width"?this.strokeweight:this[c]}else for(c in a){d=a[c];m=false;if(j&&/^(x|y|r|start|end|width|height|innerR)/.test(c)){if(!v){this.symbolAttr(a);v=true}m=true}else if(c==="d"){d=d||[];this.d=d.join(" ");e=d.length;for(m=[];e--;)m[e]=lc(d[e])?W(d[e]*10)- | ||
3090 | 117 | 5:d[e]==="Z"?"x":d[e];d=m.join(" ")||"x";f.path=d;if(P)for(e=P.length;e--;)P[e].path=d;m=true}else if(c==="zIndex"||c==="visibility"){if(Mc&&c==="visibility"&&h==="DIV"){f.gVis=d;m=f.childNodes;for(e=m.length;e--;)Ja(m[e],{visibility:d});if(d===Ab)d=null}if(d)g[c]=d;m=true}else if(/^(width|height)$/.test(c)){this[c]=d;if(this.updateClipping){this[c]=d;this.updateClipping()}else g[c]=d;m=true}else if(/^(x|y)$/.test(c)){this[c]=d;if(f.tagName==="SPAN")this.updateTransform();else g[{x:"left",y:"top"}[c]]= | ||
3091 | 118 | d}else if(c==="class")f.className=d;else if(c==="stroke"){d=i.color(d,f,c);c="strokecolor"}else if(c==="stroke-width"||c==="strokeWidth"){f.stroked=d?true:false;c="strokeweight";this[c]=d;if(lc(d))d+=Ua}else if(c==="dashstyle"){(f.getElementsByTagName("stroke")[0]||hb(i.prepVML(["<stroke/>"]),null,null,f))[c]=d||"solid";this.dashstyle=d;m=true}else if(c==="fill")if(h==="SPAN")g.color=d;else{f.filled=d!==jb?true:false;d=i.color(d,f,c);c="fillcolor"}else if(c==="translateX"||c==="translateY"||c==="rotation"|| | ||
3092 | 119 | c==="align"){if(c==="align")c="textAlign";this[c]=d;this.updateTransform();m=true}else if(c==="text"){this.bBox=null;f.innerHTML=d;m=true}if(P&&c==="visibility")for(e=P.length;e--;)P[e].style[c]=d;if(!m)if(Mc)f[c]=d;else Ga(f,c,d)}return T},clip:function(a){var b=this,c=a.members;c.push(b);b.destroyClip=function(){nc(c,b)};return b.css(a.getCSS(b.inverted))},css:function(a){var b=this.element;if(b=a&&b.tagName==="SPAN"&&a.width){delete a.width;this.textWidth=b;this.updateTransform()}this.styles=sa(this.styles, | ||
3093 | 120 | a);Ja(this.element,a);return this},safeRemoveChild:function(a){a.parentNode&&pc(a)},destroy:function(){this.destroyClip&&this.destroyClip();return Uc.prototype.destroy.apply(this)},empty:function(){for(var a=this.element.childNodes,b=a.length,c;b--;){c=a[b];c.parentNode.removeChild(c)}},getBBox:function(){var a=this.element,b=this.bBox;if(!b){if(a.nodeName==="text")a.style.position=ic;b=this.bBox={x:a.offsetLeft,y:a.offsetTop,width:a.offsetWidth,height:a.offsetHeight}}return b},on:function(a,b){this.element["on"+ | ||
3094 | 121 | a]=function(){var c=db.event;c.target=c.srcElement;b(c)};return this},updateTransform:function(){if(this.added){var a=this,b=a.element,c=a.translateX||0,d=a.translateY||0,e=a.x||0,f=a.y||0,g=a.textAlign||"left",h={left:0,center:0.5,right:1}[g],i=g&&g!=="left";if(c||d)a.css({marginLeft:c,marginTop:d});a.inverted&&u(b.childNodes,function(z){a.renderer.invertChild(z,b)});if(b.tagName==="SPAN"){var j,m;c=a.rotation;var v;j=0;d=1;var P=0,T;v=ja(a.textWidth);var Y=a.xCorr||0,H=a.yCorr||0,U=[c,g,b.innerHTML, | ||
3095 | 122 | a.textWidth].join(",");if(U!==a.cTT){if(K(c)){j=c*ae;d=rb(j);P=Cb(j);Ja(b,{filter:c?["progid:DXImageTransform.Microsoft.Matrix(M11=",d,", M12=",-P,", M21=",P,", M22=",d,", sizingMethod='auto expand')"].join(""):jb})}j=b.offsetWidth;m=b.offsetHeight;if(j>v){Ja(b,{width:v+Ua,display:"block",whiteSpace:"normal"});j=v}v=W((ja(b.style.fontSize)||12)*1.2);Y=d<0&&-j;H=P<0&&-m;T=d*P<0;Y+=P*v*(T?1-h:h);H-=d*v*(c?T?h:1-h:1);if(i){Y-=j*h*(d<0?-1:1);if(c)H-=m*h*(P<0?-1:1);Ja(b,{textAlign:g})}a.xCorr=Y;a.yCorr= | ||
3096 | 123 | H}Ja(b,{left:e+Y,top:f+H});a.cTT=U}}else this.alignOnAdd=true},shadow:function(a,b){var c=[],d,e=this.element,f=this.renderer,g,h=e.style,i,j=e.path;if(j&&typeof j.value!=="string")j="x";if(a){for(d=1;d<=3;d++){i=['<shape isShadow="true" strokeweight="',7-2*d,'" filled="false" path="',j,'" coordsize="100,100" style="',e.style.cssText,'" />'];g=hb(f.prepVML(i),null,{left:ja(h.left)+1,top:ja(h.top)+1});i=['<stroke color="black" opacity="',0.05*d,'"/>'];hb(f.prepVML(i),null,null,g);b?b.element.appendChild(g): | ||
3097 | 124 | e.parentNode.insertBefore(g,e);c.push(g)}this.shadows=c}return this}});ma=function(){this.init.apply(this,arguments)};ma.prototype=Ca(ed.prototype,{Element:Db,isIE8:yc.indexOf("MSIE 8.0")>-1,init:function(a,b,c){var d;this.alignedObjects=[];d=this.createElement(Tb);a.appendChild(d.element);this.box=d.element;this.boxWrapper=d;this.setSize(b,c,false);if(!ua.namespaces.hcv){ua.namespaces.add("hcv","urn:schemas-microsoft-com:vml");ua.createStyleSheet().cssText="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}}, | ||
3098 | 125 | clipRect:function(a,b,c,d){var e=this.createElement();return sa(e,{members:[],left:a,top:b,width:c,height:d,getCSS:function(f){var g=this.top,h=this.left,i=h+this.width,j=g+this.height;g={clip:"rect("+W(f?h:g)+"px,"+W(f?j:i)+"px,"+W(f?i:j)+"px,"+W(f?g:h)+"px)"};!f&&Mc&&sa(g,{width:i+Ua,height:j+Ua});return g},updateClipping:function(){u(e.members,function(f){f.css(e.getCSS(f.inverted))})}})},color:function(a,b,c){var d,e=/^rgba/;if(a&&a.linearGradient){var f,g,h=a.linearGradient,i,j,m,v;u(a.stops, | ||
3099 | 126 | function(P,T){if(e.test(P[1])){d=bc(P[1]);f=d.get("rgb");g=d.get("a")}else{f=P[1];g=1}if(T){m=f;v=g}else{i=f;j=g}});a=90-Fa.atan((h[3]-h[1])/(h[2]-h[0]))*180/kc;a=["<",c,' colors="0% ',i,",100% ",m,'" angle="',a,'" opacity="',v,'" o:opacity2="',j,'" type="gradient" focus="100%" />'];hb(this.prepVML(a),null,null,b)}else if(e.test(a)&&b.tagName!=="IMG"){d=bc(a);a=["<",c,' opacity="',d.get("a"),'"/>'];hb(this.prepVML(a),null,null,b);return d.get("rgb")}else{b=b.getElementsByTagName(c);if(b.length)b[0].opacity= | ||
3100 | 127 | 1;return a}},prepVML:function(a){var b=this.isIE8;a=a.join("");if(b){a=a.replace("/>",' xmlns="urn:schemas-microsoft-com:vml" />');a=a.indexOf('style="')===-1?a.replace("/>",' style="display:inline-block;behavior:url(#default#VML);" />'):a.replace('style="','style="display:inline-block;behavior:url(#default#VML);')}else a=a.replace("<","<hcv:");return a},text:function(a,b,c){var d=Xa.chart.style;return this.createElement("span").attr({text:a,x:W(b),y:W(c)}).css({whiteSpace:"nowrap",fontFamily:d.fontFamily, | ||
3101 | 128 | fontSize:d.fontSize})},path:function(a){return this.createElement("shape").attr({coordsize:"100 100",d:a})},circle:function(a,b,c){return this.symbol("circle").attr({x:a,y:b,r:c})},g:function(a){var b;if(a)b={className:vc+a,"class":vc+a};return this.createElement(Tb).attr(b)},image:function(a,b,c,d,e){var f=this.createElement("img").attr({src:a});arguments.length>1&&f.css({left:b,top:c,width:d,height:e});return f},rect:function(a,b,c,d,e,f){if(Nb(a)){b=a.y;c=a.width;d=a.height;e=a.r;f=a.strokeWidth; | ||
3102 | 129 | a=a.x}var g=this.symbol("rect");g.r=e;return g.attr(g.crisp(f,a,b,Ia(c,0),Ia(d,0)))},invertChild:function(a,b){var c=b.style;Ja(a,{flip:"x",left:ja(c.width)-10,top:ja(c.height)-10,rotation:-90})},symbols:{arc:function(a,b,c,d){var e=d.start,f=d.end,g=rb(e),h=Cb(e),i=rb(f),j=Cb(f);d=d.innerR;var m=0.07/c,v=d&&0.1/d||0;if(f-e===0)return["x"];else if(2*kc-f+e<m)i=-m;else if(f-e<v)i=rb(e+v);return["wa",a-c,b-c,a+c,b+c,a+c*g,b+c*h,a+c*i,b+c*j,"at",a-d,b-d,a+d,b+d,a+d*i,b+d*j,a+d*g,b+d*h,"x","e"]},circle:function(a, | ||
3103 | 130 | b,c){return["wa",a-c,b-c,a+c,b+c,a+c,b,a+c,b,"e"]},rect:function(a,b,c,d){if(!K(d))return[];var e=d.width;d=d.height;var f=a+e,g=b+d;c=tb(c,e,d);return[Za,a+c,b,Ka,f-c,b,"wa",f-2*c,b,f,b+2*c,f-c,b,f,b+c,Ka,f,g-c,"wa",f-2*c,g-2*c,f,g,f,g-c,f-c,g,Ka,a+c,g,"wa",a,g-2*c,a+2*c,g,a+c,g,a,g-c,Ka,a,b+c,"wa",a,b,a+2*c,b+2*c,a,b+c,a+c,b,"x","e"]}}});fd=ma}Nd.prototype.callbacks=[];var Oc=function(){};Oc.prototype={init:function(a,b){var c=a.chart.counters,d;this.series=a;this.applyOptions(b);this.pointAttr= | ||
3104 | 131 | {};if(a.options.colorByPoint){d=a.chart.options.colors;if(!this.options)this.options={};this.color=this.options.color=this.color||d[c.color++];c.wrapColor(d.length)}a.chart.pointCount++;return this},applyOptions:function(a){var b=this.series;this.config=a;if(lc(a)||a===null)this.y=a;else if(Nb(a)&&!lc(a.length)){sa(this,a);this.options=a}else if(Sb(a[0])){this.name=a[0];this.y=a[1]}else if(lc(a[0])){this.x=a[0];this.y=a[1]}if(this.x===Wa)this.x=b.autoIncrement()},destroy:function(){var a=this,b=a.series, | ||
3105 | 132 | c=b.chart.hoverPoints,d;b.chart.pointCount--;if(c){a.setState();nc(c,a)}a===b.chart.hoverPoint&&a.onMouseOut();pb(a);u(["graphic","tracker","group","dataLabel","connector","shadowGroup"],function(e){a[e]&&a[e].destroy()});a.legendItem&&a.series.chart.legend.destroyItem(a);for(d in a)a[d]=null},getLabelConfig:function(){return{x:this.category,y:this.y,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}},select:function(a,b){var c=this,d=c.series.chart;a=A(a, | ||
3106 | 133 | !c.selected);c.firePointEvent(a?"select":"unselect",{accumulate:b},function(){c.selected=a;c.setState(a&&"select");b||u(d.getSelectedPoints(),function(e){if(e.selected&&e!==c){e.selected=false;e.setState(ib);e.firePointEvent("unselect")}})})},onMouseOver:function(){var a=this.series.chart,b=a.tooltip,c=a.hoverPoint;c&&c!==this&&c.onMouseOut();this.firePointEvent("mouseOver");b&&!b.shared&&b.refresh(this);this.setState(Bb);a.hoverPoint=this},onMouseOut:function(){this.firePointEvent("mouseOut");this.setState(); | ||
3107 | 134 | this.series.chart.hoverPoint=null},tooltipFormatter:function(a){var b=this.series;return['<span style="color:'+b.color+'">',this.name||b.name,"</span>: ",!a?"<b>x = "+(this.name||this.x)+",</b> ":"","<b>",!a?"y = ":"",this.y,"</b>"].join("")},update:function(a,b,c){var d=this,e=d.series,f=d.graphic,g=e.chart;b=A(b,true);d.firePointEvent("update",{options:a},function(){d.applyOptions(a);if(Nb(a)){e.getAttribs();f&&f.attr(d.pointAttr[e.state])}e.isDirty=true;b&&g.redraw(c)})},remove:function(a,b){var c= | ||
3108 | 135 | this,d=c.series,e=d.chart,f=d.data;oc(b,e);a=A(a,true);c.firePointEvent("remove",null,function(){nc(f,c);c.destroy();d.isDirty=true;a&&e.redraw()})},firePointEvent:function(a,b,c){var d=this,e=this.series.options;if(e.point.events[a]||d.options&&d.options.events&&d.options.events[a])this.importEvents();if(a==="click"&&e.allowPointSelect)c=function(f){d.select(null,f.ctrlKey||f.metaKey||f.shiftKey)};Pa(this,a,b,c)},importEvents:function(){if(!this.hasImportedEvents){var a=Ca(this.series.options.point, | ||
3109 | 136 | this.options).events,b;this.events=a;for(b in a)Qa(this,b,a[b]);this.hasImportedEvents=true}},setState:function(a){var b=this.series,c=b.options.states,d=xb[b.type].marker&&b.options.marker,e=d&&!d.enabled,f=(d=d&&d.states[a])&&d.enabled===false,g=b.stateMarkerGraphic,h=b.chart,i=this.pointAttr;a=a||ib;if(!(a===this.state||this.selected&&a!=="select"||c[a]&&c[a].enabled===false||a&&(f||e&&!d.enabled))){if(this.graphic)this.graphic.attr(i[a]);else{if(a){if(!g)b.stateMarkerGraphic=g=h.renderer.circle(0, | ||
3110 | 137 | 0,i[a].r).attr(i[a]).add(b.group);g.translate(this.plotX,this.plotY)}if(g)g[a?"show":"hide"]()}this.state=a}}};var sb=function(){};sb.prototype={isCartesian:true,type:"line",pointClass:Oc,pointAttrToOptions:{stroke:"lineColor","stroke-width":"lineWidth",fill:"fillColor",r:"radius"},init:function(a,b){var c,d;d=a.series.length;this.chart=a;b=this.setOptions(b);sa(this,{index:d,options:b,name:b.name||"Series "+(d+1),state:ib,pointAttr:{},visible:b.visible!==false,selected:b.selected===true});d=b.events; | ||
3111 | 138 | for(c in d)Qa(this,c,d[c]);if(d&&d.click||b.point&&b.point.events&&b.point.events.click||b.allowPointSelect)a.runTrackerClick=true;this.getColor();this.getSymbol();this.setData(b.data,false)},autoIncrement:function(){var a=this.options,b=this.xIncrement;b=A(b,a.pointStart,0);this.pointInterval=A(this.pointInterval,a.pointInterval,1);this.xIncrement=b+this.pointInterval;return b},cleanData:function(){var a=this.chart,b=this.data,c,d,e=a.smallestInterval,f,g;Hd(b,function(h,i){return h.x-i.x});if(this.options.connectNulls)for(g= | ||
3112 | 139 | b.length-1;g>=0;g--)b[g].y===null&&b[g-1]&&b[g+1]&&b.splice(g,1);for(g=b.length-1;g>=0;g--)if(b[g-1]){f=b[g].x-b[g-1].x;if(f>0&&(d===Wa||f<d)){d=f;c=g}}if(e===Wa||d<e)a.smallestInterval=d;this.closestPoints=c},getSegments:function(){var a=-1,b=[],c=this.data;u(c,function(d,e){if(d.y===null){e>a+1&&b.push(c.slice(a+1,e));a=e}else e===c.length-1&&b.push(c.slice(a+1,e+1))});this.segments=b},setOptions:function(a){var b=this.chart.options.plotOptions;return Ca(b[this.type],b.series,a)},getColor:function(){var a= | ||
3113 | 140 | this.chart.options.colors,b=this.chart.counters;this.color=this.options.color||a[b.color++]||"#0000ff";b.wrapColor(a.length)},getSymbol:function(){var a=this.chart.options.symbols,b=this.chart.counters;this.symbol=this.options.marker.symbol||a[b.symbol++];b.wrapSymbol(a.length)},addPoint:function(a,b,c,d){var e=this.data,f=this.graph,g=this.area,h=this.chart;a=(new this.pointClass).init(this,a);oc(d,h);if(f&&c)f.shift=c;if(g){g.shift=c;g.isArea=true}b=A(b,true);e.push(a);c&&e[0].remove(false);this.getAttribs(); | ||
3114 | 141 | this.isDirty=true;b&&h.redraw()},setData:function(a,b){var c=this,d=c.data,e=c.initialColor,f=c.chart,g=d&&d.length||0;c.xIncrement=null;if(K(e))f.counters.color=e;for(a=tc(zc(a||[]),function(h){return(new c.pointClass).init(c,h)});g--;)d[g].destroy();c.data=a;c.cleanData();c.getSegments();c.getAttribs();c.isDirty=true;f.isDirtyBox=true;A(b,true)&&f.redraw(false)},remove:function(a,b){var c=this,d=c.chart;a=A(a,true);if(!c.isRemoving){c.isRemoving=true;Pa(c,"remove",null,function(){c.destroy();d.isDirtyLegend= | ||
3115 | 142 | d.isDirtyBox=true;a&&d.redraw(b)})}c.isRemoving=false},translate:function(){for(var a=this.chart,b=this.options.stacking,c=this.xAxis.categories,d=this.yAxis,e=this.data,f=e.length;f--;){var g=e[f],h=g.x,i=g.y,j=g.low,m=d.stacks[(i<0?"-":"")+this.stackKey];g.plotX=this.xAxis.translate(h);if(b&&this.visible&&m&&m[h]){j=m[h];h=j.total;j.cum=j=j.cum-i;i=j+i;if(b==="percent"){j=h?j*100/h:0;i=h?i*100/h:0}g.percentage=h?g.y*100/h:0;g.stackTotal=h}if(K(j))g.yBottom=d.translate(j,0,1,0,1);if(i!==null)g.plotY= | ||
3116 | 143 | d.translate(i,0,1,0,1);g.clientX=a.inverted?a.plotHeight-g.plotX:g.plotX;g.category=c&&c[g.x]!==Wa?c[g.x]:g.x}},setTooltipPoints:function(a){var b=this.chart,c=b.inverted,d=[],e=W((c?b.plotTop:b.plotLeft)+b.plotSizeX),f,g,h=[];if(a)this.tooltipPoints=null;u(this.segments,function(i){d=d.concat(i)});if(this.xAxis&&this.xAxis.reversed)d=d.reverse();u(d,function(i,j){f=d[j-1]?d[j-1]._high+1:0;for(g=i._high=d[j+1]?lb((i.plotX+(d[j+1]?d[j+1].plotX:e))/2):e;f<=g;)h[c?e-f++:f++]=i});this.tooltipPoints=h}, | ||
3117 | 144 | onMouseOver:function(){var a=this.chart,b=a.hoverSeries;if(!(!Kb&&a.mouseIsDown)){b&&b!==this&&b.onMouseOut();this.options.events.mouseOver&&Pa(this,"mouseOver");this.tracker&&this.tracker.toFront();this.setState(Bb);a.hoverSeries=this}},onMouseOut:function(){var a=this.options,b=this.chart,c=b.tooltip,d=b.hoverPoint;d&&d.onMouseOut();this&&a.events.mouseOut&&Pa(this,"mouseOut");c&&!a.stickyTracking&&c.hide();this.setState();b.hoverSeries=null},animate:function(a){var b=this.chart,c=this.clipRect, | ||
3118 | 145 | d=this.options.animation;if(d&&!Nb(d))d={};if(a){if(!c.isAnimating){c.attr("width",0);c.isAnimating=true}}else{c.animate({width:b.plotSizeX},d);this.animate=null}},drawPoints:function(){var a,b=this.data,c=this.chart,d,e,f,g,h,i;if(this.options.marker.enabled)for(f=b.length;f--;){g=b[f];d=g.plotX;e=g.plotY;i=g.graphic;if(e!==Wa&&!isNaN(e)){a=g.pointAttr[g.selected?"select":ib];h=a.r;if(i)i.animate({x:d,y:e,r:h});else g.graphic=c.renderer.symbol(A(g.marker&&g.marker.symbol,this.symbol),d,e,h).attr(a).add(this.group)}}}, | ||
3119 | 146 | convertAttribs:function(a,b,c,d){var e=this.pointAttrToOptions,f,g,h={};a=a||{};b=b||{};c=c||{};d=d||{};for(f in e){g=e[f];h[f]=A(a[g],b[f],c[f],d[f])}return h},getAttribs:function(){var a=this,b=xb[a.type].marker?a.options.marker:a.options,c=b.states,d=c[Bb],e,f=a.color,g={stroke:f,fill:f},h=a.data,i=[],j,m=a.pointAttrToOptions,v;if(a.options.marker){d.radius=d.radius||b.radius+2;d.lineWidth=d.lineWidth||b.lineWidth+1}else d.color=d.color||bc(d.color||f).brighten(d.brightness).get();i[ib]=a.convertAttribs(b, | ||
3120 | 147 | g);u([Bb,"select"],function(P){i[P]=a.convertAttribs(c[P],i[ib])});a.pointAttr=i;for(f=h.length;f--;){g=h[f];if((b=g.options&&g.options.marker||g.options)&&b.enabled===false)b.radius=0;e=false;if(g.options)for(v in m)if(K(b[m[v]]))e=true;if(e){j=[];c=b.states||{};e=c[Bb]=c[Bb]||{};if(!a.options.marker)e.color=bc(e.color||g.options.color).brighten(e.brightness||d.brightness).get();j[ib]=a.convertAttribs(b,i[ib]);j[Bb]=a.convertAttribs(c[Bb],i[Bb],j[ib]);j.select=a.convertAttribs(c.select,i.select, | ||
3121 | 148 | j[ib])}else j=i;g.pointAttr=j}},destroy:function(){var a=this,b=a.chart,c=a.clipRect,d=/\/5[0-9\.]+ (Safari|Mobile)\//.test(yc),e,f;Pa(a,"destroy");pb(a);a.legendItem&&a.chart.legend.destroyItem(a);u(a.data,function(g){g.destroy()});if(c&&c!==b.clipRect)a.clipRect=c.destroy();u(["area","graph","dataLabelsGroup","group","tracker"],function(g){if(a[g]){e=d&&g==="group"?"hide":"destroy";a[g][e]()}});if(b.hoverSeries===a)b.hoverSeries=null;nc(b.series,a);for(f in a)delete a[f]},drawDataLabels:function(){if(this.options.dataLabels.enabled){var a, | ||
3122 | 149 | b,c=this.data,d=this.options,e=d.dataLabels,f,g=this.dataLabelsGroup,h=this.chart,i=h.renderer,j=h.inverted,m=this.type,v;v=d.stacking;var P=m==="column"||m==="bar",T=e.verticalAlign===null,Y=e.y===null;if(P)if(v){if(T)e=Ca(e,{verticalAlign:"middle"});if(Y)e=Ca(e,{y:{top:14,middle:4,bottom:-6}[e.verticalAlign]})}else if(T)e=Ca(e,{verticalAlign:"top"});if(g)g.translate(h.plotLeft,h.plotTop);else g=this.dataLabelsGroup=i.g("data-labels").attr({visibility:this.visible?Ab:ob,zIndex:6}).translate(h.plotLeft, | ||
3123 | 150 | h.plotTop).add();v=e.color;if(v==="auto")v=null;e.style.color=A(v,this.color,"black");u(c,function(H){var U=H.barX,z=U&&U+H.barW/2||H.plotX||-999,M=A(H.plotY,-999),y=H.dataLabel,C=e.align,Z=Y?H.y>=0?-6:12:e.y;f=e.formatter.call(H.getLabelConfig());a=(j?h.plotWidth-M:z)+e.x;b=(j?h.plotHeight-z:M)+Z;if(m==="column")a+={left:-1,right:1}[C]*H.barW/2||0;if(j&&H.y<0){C="right";a-=10}if(y){if(j&&!e.y)b=b+ja(y.styles.lineHeight)*0.9-y.getBBox().height/2;y.attr({text:f}).animate({x:a,y:b})}else if(K(f)){y= | ||
3124 | 151 | H.dataLabel=i.text(f,a,b).attr({align:C,rotation:e.rotation,zIndex:1}).css(e.style).add(g);j&&!e.y&&y.attr({y:b+ja(y.styles.lineHeight)*0.9-y.getBBox().height/2})}if(P&&d.stacking&&y){z=H.barY;M=H.barW;H=H.barH;y.align(e,null,{x:j?h.plotWidth-z-H:U,y:j?h.plotHeight-U-M:z,width:j?H:M,height:j?M:H})}})}},drawGraph:function(){var a=this,b=a.options,c=a.graph,d=[],e,f=a.area,g=a.group,h=b.lineColor||a.color,i=b.lineWidth,j=b.dashStyle,m,v=a.chart.renderer,P=a.yAxis.getThreshold(b.threshold||0),T=/^area/.test(a.type), | ||
3125 | 152 | Y=[],H=[];u(a.segments,function(U){m=[];u(U,function(C,Z){if(a.getPointSpline)m.push.apply(m,a.getPointSpline(U,C,Z));else{m.push(Z?Ka:Za);Z&&b.step&&m.push(C.plotX,U[Z-1].plotY);m.push(C.plotX,C.plotY)}});if(U.length>1)d=d.concat(m);else Y.push(U[0]);if(T){var z=[],M,y=m.length;for(M=0;M<y;M++)z.push(m[M]);y===3&&z.push(Ka,m[1],m[2]);if(b.stacking&&a.type!=="areaspline")for(M=U.length-1;M>=0;M--)z.push(U[M].plotX,U[M].yBottom);else z.push(Ka,U[U.length-1].plotX,P,Ka,U[0].plotX,P);H=H.concat(z)}}); | ||
3126 | 153 | a.graphPath=d;a.singlePoints=Y;if(T){e=A(b.fillColor,bc(a.color).setOpacity(b.fillOpacity||0.75).get());if(f)f.animate({d:H});else a.area=a.chart.renderer.path(H).attr({fill:e}).add(g)}if(c){Hc(c);c.animate({d:d})}else if(i){c={stroke:h,"stroke-width":i};if(j)c.dashstyle=j;a.graph=v.path(d).attr(c).add(g).shadow(b.shadow)}},render:function(){var a=this,b=a.chart,c,d,e=a.options,f=e.animation,g=f&&a.animate;f=g?f&&f.duration||500:0;var h=a.clipRect,i=b.renderer;if(!h){h=a.clipRect=!b.hasRendered&& | ||
3127 | 154 | b.clipRect?b.clipRect:i.clipRect(0,0,b.plotSizeX,b.plotSizeY);if(!b.clipRect)b.clipRect=h}if(!a.group){c=a.group=i.g("series");if(b.inverted){d=function(){c.attr({width:b.plotWidth,height:b.plotHeight}).invert()};d();Qa(b,"resize",d);Qa(a,"destroy",function(){pb(b,"resize",d)})}c.clip(a.clipRect).attr({visibility:a.visible?Ab:ob,zIndex:e.zIndex}).translate(b.plotLeft,b.plotTop).add(b.seriesGroup)}a.drawDataLabels();g&&a.animate(true);a.drawGraph&&a.drawGraph();a.drawPoints();a.options.enableMouseTracking!== | ||
3128 | 155 | false&&a.drawTracker();g&&a.animate();setTimeout(function(){h.isAnimating=false;if((c=a.group)&&h!==b.clipRect&&h.renderer){c.clip(a.clipRect=b.clipRect);h.destroy()}},f);a.isDirty=false},redraw:function(){var a=this.chart,b=this.group;if(b){a.inverted&&b.attr({width:a.plotWidth,height:a.plotHeight});b.animate({translateX:a.plotLeft,translateY:a.plotTop})}this.translate();this.setTooltipPoints(true);this.render()},setState:function(a){var b=this.options,c=this.graph,d=b.states;b=b.lineWidth;a=a|| | ||
3129 | 156 | ib;if(this.state!==a){this.state=a;if(!(d[a]&&d[a].enabled===false)){if(a)b=d[a].lineWidth||b+1;if(c&&!c.dashstyle)c.attr({"stroke-width":b},a?0:500)}}},setVisible:function(a,b){var c=this.chart,d=this.legendItem,e=this.group,f=this.tracker,g=this.dataLabelsGroup,h,i=this.data,j=c.options.chart.ignoreHiddenSeries;h=this.visible;h=(this.visible=a=a===Wa?!h:a)?"show":"hide";e&&e[h]();if(f)f[h]();else for(e=i.length;e--;){f=i[e];f.tracker&&f.tracker[h]()}g&&g[h]();d&&c.legend.colorizeItem(this,a);this.isDirty= | ||
3130 | 157 | true;this.options.stacking&&u(c.series,function(m){if(m.options.stacking&&m.visible)m.isDirty=true});if(j)c.isDirtyBox=true;b!==false&&c.redraw();Pa(this,h)},show:function(){this.setVisible(true)},hide:function(){this.setVisible(false)},select:function(a){this.selected=a=a===Wa?!this.selected:a;if(this.checkbox)this.checkbox.checked=a;Pa(this,a?"select":"unselect")},drawTracker:function(){var a=this,b=a.options,c=[].concat(a.graphPath),d=c.length,e=a.chart,f=e.options.tooltip.snap,g=a.tracker,h=b.cursor; | ||
3131 | 158 | h=h&&{cursor:h};var i=a.singlePoints,j;if(d)for(j=d+1;j--;){c[j]===Za&&c.splice(j+1,0,c[j+1]-f,c[j+2],Ka);if(j&&c[j]===Za||j===d)c.splice(j,0,Ka,c[j-2]+f,c[j-1])}for(j=0;j<i.length;j++){d=i[j];c.push(Za,d.plotX-f,d.plotY,Ka,d.plotX+f,d.plotY)}if(g)g.attr({d:c});else a.tracker=e.renderer.path(c).attr({isTracker:true,stroke:ce,fill:jb,"stroke-width":b.lineWidth+2*f,visibility:a.visible?Ab:ob,zIndex:b.zIndex||1}).on(Kb?"touchstart":"mouseover",function(){e.hoverSeries!==a&&a.onMouseOver()}).on("mouseout", | ||
3132 | 159 | function(){b.stickyTracking||a.onMouseOut()}).css(h).add(e.trackerGroup)}};ma=yb(sb);wb.line=ma;ma=yb(sb,{type:"area"});wb.area=ma;ma=yb(sb,{type:"spline",getPointSpline:function(a,b,c){var d=b.plotX,e=b.plotY,f=a[c-1],g=a[c+1],h,i,j,m;if(c&&c<a.length-1){a=f.plotY;j=g.plotX;g=g.plotY;var v;h=(1.5*d+f.plotX)/2.5;i=(1.5*e+a)/2.5;j=(1.5*d+j)/2.5;m=(1.5*e+g)/2.5;v=(m-i)*(j-d)/(j-h)+e-m;i+=v;m+=v;if(i>a&&i>e){i=Ia(a,e);m=2*e-i}else if(i<a&&i<e){i=tb(a,e);m=2*e-i}if(m>g&&m>e){m=Ia(g,e);i=2*e-m}else if(m< | ||
3133 | 160 | g&&m<e){m=tb(g,e);i=2*e-m}b.rightContX=j;b.rightContY=m}if(c){b=["C",f.rightContX||f.plotX,f.rightContY||f.plotY,h||d,i||e,d,e];f.rightContX=f.rightContY=null}else b=[Za,d,e];return b}});wb.spline=ma;ma=yb(ma,{type:"areaspline"});wb.areaspline=ma;var hd=yb(sb,{type:"column",pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color",r:"borderRadius"},init:function(){sb.prototype.init.apply(this,arguments);var a=this,b=a.chart;b.hasColumn=true;b.hasRendered&&u(b.series,function(c){if(c.type=== | ||
3134 | 161 | a.type)c.isDirty=true})},translate:function(){var a=this,b=a.chart,c=a.options,d=c.stacking,e=c.borderWidth,f=0,g=a.xAxis.reversed,h=a.xAxis.categories,i={},j,m;sb.prototype.translate.apply(a);u(b.series,function(C){if(C.type===a.type&&C.visible){if(C.options.stacking){j=C.stackKey;if(i[j]===Wa)i[j]=f++;m=i[j]}else m=f++;C.columnIndex=m}});var v=a.data,P=a.closestPoints;h=bb(v[1]?v[P].plotX-v[P-1].plotX:b.plotSizeX/(h&&h.length||1));P=h*c.groupPadding;var T=(h-2*P)/f,Y=c.pointWidth,H=K(Y)?(T-Y)/2: | ||
3135 | 162 | T*c.pointPadding,U=Ia(A(Y,T-2*H),1),z=H+(P+((g?f-a.columnIndex:a.columnIndex)||0)*T-h/2)*(g?-1:1),M=a.yAxis.getThreshold(c.threshold||0),y=A(c.minPointLength,5);u(v,function(C){var Z=C.plotY,Sa=C.yBottom||M,Na=C.plotX+z,Ea=md(tb(Z,Sa)),gb=md(Ia(Z,Sa)-Ea),Lb=a.yAxis.stacks[(C.y<0?"-":"")+a.stackKey],Rb;d&&a.visible&&Lb&&Lb[C.x]&&Lb[C.x].setOffset(z,U);if(bb(gb)<y){if(y){gb=y;Ea=bb(Ea-M)>y?Sa-y:M-(Z<=M?y:0)}Rb=Ea-3}sa(C,{barX:Na,barY:Ea,barW:U,barH:gb});C.shapeType="rect";Z=sa(b.renderer.Element.prototype.crisp.apply({}, | ||
3136 | 163 | [e,Na,Ea,U,gb]),{r:c.borderRadius});if(e%2){Z.y-=1;Z.height+=1}C.shapeArgs=Z;C.trackerArgs=K(Rb)&&Ca(C.shapeArgs,{height:Ia(6,gb+3),y:Rb})})},getSymbol:function(){},drawGraph:function(){},drawPoints:function(){var a=this,b=a.options,c=a.chart.renderer,d,e;u(a.data,function(f){var g=f.plotY;if(g!==Wa&&!isNaN(g)&&f.y!==null){d=f.graphic;e=f.shapeArgs;if(d){Hc(d);d.animate(e)}else f.graphic=c[f.shapeType](e).attr(f.pointAttr[f.selected?"select":ib]).add(a.group).shadow(b.shadow)}})},drawTracker:function(){var a= | ||
3137 | 164 | this,b=a.chart,c=b.renderer,d,e,f=+new Date,g=a.options,h=g.cursor,i=h&&{cursor:h},j;u(a.data,function(m){e=m.tracker;d=m.trackerArgs||m.shapeArgs;delete d.strokeWidth;if(m.y!==null)if(e)e.attr(d);else m.tracker=c[m.shapeType](d).attr({isTracker:f,fill:ce,visibility:a.visible?Ab:ob,zIndex:g.zIndex||1}).on(Kb?"touchstart":"mouseover",function(v){j=v.relatedTarget||v.fromElement;b.hoverSeries!==a&&Ga(j,"isTracker")!==f&&a.onMouseOver();m.onMouseOver()}).on("mouseout",function(v){if(!g.stickyTracking){j= | ||
3138 | 165 | v.relatedTarget||v.toElement;Ga(j,"isTracker")!==f&&a.onMouseOut()}}).css(i).add(m.group||b.trackerGroup)})},animate:function(a){var b=this,c=b.data;if(!a){u(c,function(d){var e=d.graphic;d=d.shapeArgs;if(e){e.attr({height:0,y:b.yAxis.translate(0,0,1)});e.animate({height:d.height,y:d.y},b.options.animation)}});b.animate=null}},remove:function(){var a=this,b=a.chart;b.hasRendered&&u(b.series,function(c){if(c.type===a.type)c.isDirty=true});sb.prototype.remove.apply(a,arguments)}});wb.column=hd;ma=yb(hd, | ||
3139 | 166 | {type:"bar",init:function(a){a.inverted=this.inverted=true;hd.prototype.init.apply(this,arguments)}});wb.bar=ma;ma=yb(sb,{type:"scatter",translate:function(){var a=this;sb.prototype.translate.apply(a);u(a.data,function(b){b.shapeType="circle";b.shapeArgs={x:b.plotX,y:b.plotY,r:a.chart.options.tooltip.snap}})},drawTracker:function(){var a=this,b=a.options.cursor,c=b&&{cursor:b},d;u(a.data,function(e){(d=e.graphic)&&d.attr({isTracker:true}).on("mouseover",function(){a.onMouseOver();e.onMouseOver()}).on("mouseout", | ||
3140 | 167 | function(){a.options.stickyTracking||a.onMouseOut()}).css(c)})},cleanData:function(){}});wb.scatter=ma;ma=yb(Oc,{init:function(){Oc.prototype.init.apply(this,arguments);var a=this,b;sa(a,{visible:a.visible!==false,name:A(a.name,"Slice")});b=function(){a.slice()};Qa(a,"select",b);Qa(a,"unselect",b);return a},setVisible:function(a){var b=this.series.chart,c=this.tracker,d=this.dataLabel,e=this.connector,f=this.shadowGroup,g;g=(this.visible=a=a===Wa?!this.visible:a)?"show":"hide";this.group[g]();c&& | ||
3141 | 168 | c[g]();d&&d[g]();e&&e[g]();f&&f[g]();this.legendItem&&b.legend.colorizeItem(this,a)},slice:function(a,b,c){var d=this.series.chart,e=this.slicedTranslation;oc(c,d);A(b,true);a=this.sliced=K(a)?a:!this.sliced;a={translateX:a?e[0]:d.plotLeft,translateY:a?e[1]:d.plotTop};this.group.animate(a);this.shadowGroup&&this.shadowGroup.animate(a)}});ma=yb(sb,{type:"pie",isCartesian:false,pointClass:ma,pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color"},getColor:function(){this.initialColor= | ||
3142 | 169 | this.chart.counters.color},animate:function(){var a=this;u(a.data,function(b){var c=b.graphic;b=b.shapeArgs;var d=-kc/2;if(c){c.attr({r:0,start:d,end:d});c.animate({r:b.r,start:b.start,end:b.end},a.options.animation)}});a.animate=null},translate:function(){var a=0,b=-0.25,c=this.options,d=c.slicedOffset,e=d+c.borderWidth,f=c.center.concat([c.size,c.innerSize||0]),g=this.chart,h=g.plotWidth,i=g.plotHeight,j,m,v,P=this.data,T=2*kc,Y,H=tb(h,i),U,z,M,y=c.dataLabels.distance;f=tc(f,function(C,Z){return(U= | ||
3143 | 170 | /%$/.test(C))?[h,i,H,H][Z]*ja(C)/100:C});this.getX=function(C,Z){v=Fa.asin((C-f[1])/(f[2]/2+y));return f[0]+(Z?-1:1)*rb(v)*(f[2]/2+y)};this.center=f;u(P,function(C){a+=C.y});u(P,function(C){Y=a?C.y/a:0;j=W(b*T*1E3)/1E3;b+=Y;m=W(b*T*1E3)/1E3;C.shapeType="arc";C.shapeArgs={x:f[0],y:f[1],r:f[2]/2,innerR:f[3]/2,start:j,end:m};v=(m+j)/2;C.slicedTranslation=tc([rb(v)*d+g.plotLeft,Cb(v)*d+g.plotTop],W);z=rb(v)*f[2]/2;M=Cb(v)*f[2]/2;C.tooltipPos=[f[0]+z*0.7,f[1]+M*0.7];C.labelPos=[f[0]+z+rb(v)*y,f[1]+M+Cb(v)* | ||
3144 | 171 | y,f[0]+z+rb(v)*e,f[1]+M+Cb(v)*e,f[0]+z,f[1]+M,y<0?"center":v<T/4?"left":"right",v];C.percentage=Y*100;C.total=a});this.setTooltipPoints()},render:function(){this.drawPoints();this.options.enableMouseTracking!==false&&this.drawTracker();this.drawDataLabels();this.options.animation&&this.animate&&this.animate();this.isDirty=false},drawPoints:function(){var a=this.chart,b=a.renderer,c,d,e,f=this.options.shadow,g,h;u(this.data,function(i){d=i.graphic;h=i.shapeArgs;e=i.group;g=i.shadowGroup;if(f&&!g)g= | ||
3145 | 172 | i.shadowGroup=b.g("shadow").attr({zIndex:4}).add();if(!e)e=i.group=b.g("point").attr({zIndex:5}).add();c=i.sliced?i.slicedTranslation:[a.plotLeft,a.plotTop];e.translate(c[0],c[1]);g&&g.translate(c[0],c[1]);if(d)d.animate(h);else i.graphic=b.arc(h).attr(sa(i.pointAttr[ib],{"stroke-linejoin":"round"})).add(i.group).shadow(f,g);i.visible===false&&i.setVisible(false)})},drawDataLabels:function(){var a=this.data,b,c=this.chart,d=this.options.dataLabels,e=A(d.connectorPadding,10),f=A(d.connectorWidth,1), | ||
3146 | 173 | g,h,i=A(d.softConnector,true),j=d.distance,m=this.center,v=m[2]/2;m=m[1];var P=j>0,T=[[],[]],Y,H,U,z,M=2,y;if(d.enabled){sb.prototype.drawDataLabels.apply(this);u(a,function(gb){if(gb.dataLabel)T[gb.labelPos[7]<kc/2?0:1].push(gb)});T[1].reverse();z=function(gb,Lb){return Lb.y-gb.y};for(a=T[0][0]&&T[0][0].dataLabel&&ja(T[0][0].dataLabel.styles.lineHeight);M--;){var C=[],Z=[],Sa=T[M],Na=Sa.length,Ea;for(y=m-v-j;y<=m+v+j;y+=a)C.push(y);U=C.length;if(Na>U){h=[].concat(Sa);h.sort(z);for(y=Na;y--;)h[y].rank= | ||
3147 | 174 | y;for(y=Na;y--;)Sa[y].rank>=U&&Sa.splice(y,1);Na=Sa.length}for(y=0;y<Na;y++){b=Sa[y];h=b.labelPos;b=9999;for(H=0;H<U;H++){g=bb(C[H]-h[1]);if(g<b){b=g;Ea=H}}if(Ea<y&&C[y]!==null)Ea=y;else{if(U<Na-y+Ea&&C[y]!==null)Ea=U-Na+y;for(;C[Ea]===null;)Ea++}Z.push({i:Ea,y:C[Ea]});C[Ea]=null}Z.sort(z);for(y=0;y<Na;y++){b=Sa[y];h=b.labelPos;g=b.dataLabel;H=Z.pop();Y=h[1];U=b.visible===false?ob:Ab;Ea=H.i;H=H.y;if(Y>H&&C[Ea+1]!==null||Y<H&&C[Ea-1]!==null)H=Y;Y=this.getX(Ea===0||Ea===C.length-1?Y:H,M);g.attr({visibility:U, | ||
3148 | 175 | align:h[6]})[g.moved?"animate":"attr"]({x:Y+d.x+({left:e,right:-e}[h[6]]||0),y:H+d.y});g.moved=true;if(P&&f){g=b.connector;h=i?[Za,Y+(h[6]==="left"?5:-5),H,"C",Y,H,2*h[2]-h[4],2*h[3]-h[5],h[2],h[3],Ka,h[4],h[5]]:[Za,Y+(h[6]==="left"?5:-5),H,Ka,h[2],h[3],Ka,h[4],h[5]];if(g){g.animate({d:h});g.attr("visibility",U)}else b.connector=g=this.chart.renderer.path(h).attr({"stroke-width":f,stroke:d.connectorColor||b.color||"#606060",visibility:U,zIndex:3}).translate(c.plotLeft,c.plotTop).add()}}}}},drawTracker:hd.prototype.drawTracker, | ||
3149 | 176 | getSymbol:function(){}});wb.pie=ma;db.Highcharts={Chart:Nd,dateFormat:Zc,pathAnim:Nc,getOptions:function(){return Xa},hasRtlBug:me,numberFormat:Ed,Point:Oc,Color:bc,Renderer:fd,seriesTypes:wb,setOptions:function(a){Xa=Ca(Xa,a);Id();return Xa},Series:sb,addEvent:Qa,removeEvent:pb,createElement:hb,discardElement:pc,css:Ja,each:u,extend:sa,map:tc,merge:Ca,pick:A,extendClass:yb,product:"Highcharts",version:"2.1.9"}})(); | ||
3150 | 177 | 0 | ||
3151 | === removed file 'media/js/highcharts_219/highcharts.src.js' | |||
3152 | --- media/js/highcharts_219/highcharts.src.js 2011-11-18 22:51:37 +0000 | |||
3153 | +++ media/js/highcharts_219/highcharts.src.js 1970-01-01 00:00:00 +0000 | |||
3154 | @@ -1,11454 +0,0 @@ | |||
3155 | 1 | // ==ClosureCompiler== | ||
3156 | 2 | // @compilation_level SIMPLE_OPTIMIZATIONS | ||
3157 | 3 | |||
3158 | 4 | /** | ||
3159 | 5 | * @license Highcharts JS v2.1.9 (2011-11-11) | ||
3160 | 6 | * | ||
3161 | 7 | * (c) 2009-2011 Torstein Hønsi | ||
3162 | 8 | * | ||
3163 | 9 | * License: www.highcharts.com/license | ||
3164 | 10 | */ | ||
3165 | 11 | |||
3166 | 12 | // JSLint options: | ||
3167 | 13 | /*global document, window, navigator, setInterval, clearInterval, clearTimeout, setTimeout, location, jQuery, $ */ | ||
3168 | 14 | |||
3169 | 15 | (function () { | ||
3170 | 16 | // encapsulated variables | ||
3171 | 17 | var doc = document, | ||
3172 | 18 | win = window, | ||
3173 | 19 | math = Math, | ||
3174 | 20 | mathRound = math.round, | ||
3175 | 21 | mathFloor = math.floor, | ||
3176 | 22 | mathCeil = math.ceil, | ||
3177 | 23 | mathMax = math.max, | ||
3178 | 24 | mathMin = math.min, | ||
3179 | 25 | mathAbs = math.abs, | ||
3180 | 26 | mathCos = math.cos, | ||
3181 | 27 | mathSin = math.sin, | ||
3182 | 28 | mathPI = math.PI, | ||
3183 | 29 | deg2rad = mathPI * 2 / 360, | ||
3184 | 30 | |||
3185 | 31 | |||
3186 | 32 | // some variables | ||
3187 | 33 | userAgent = navigator.userAgent, | ||
3188 | 34 | isIE = /msie/i.test(userAgent) && !win.opera, | ||
3189 | 35 | docMode8 = doc.documentMode === 8, | ||
3190 | 36 | isWebKit = /AppleWebKit/.test(userAgent), | ||
3191 | 37 | isFirefox = /Firefox/.test(userAgent), | ||
3192 | 38 | SVG_NS = 'http://www.w3.org/2000/svg', | ||
3193 | 39 | hasSVG = !!doc.createElementNS && !!doc.createElementNS(SVG_NS, 'svg').createSVGRect, | ||
3194 | 40 | hasRtlBug = isFirefox && parseInt(userAgent.split('Firefox/')[1], 10) < 4, // issue #38 | ||
3195 | 41 | Renderer, | ||
3196 | 42 | hasTouch = doc.documentElement.ontouchstart !== undefined, | ||
3197 | 43 | symbolSizes = {}, | ||
3198 | 44 | idCounter = 0, | ||
3199 | 45 | timeFactor = 1, // 1 = JavaScript time, 1000 = Unix time | ||
3200 | 46 | garbageBin, | ||
3201 | 47 | defaultOptions, | ||
3202 | 48 | dateFormat, // function | ||
3203 | 49 | globalAnimation, | ||
3204 | 50 | pathAnim, | ||
3205 | 51 | |||
3206 | 52 | |||
3207 | 53 | // some constants for frequently used strings | ||
3208 | 54 | UNDEFINED, | ||
3209 | 55 | DIV = 'div', | ||
3210 | 56 | ABSOLUTE = 'absolute', | ||
3211 | 57 | RELATIVE = 'relative', | ||
3212 | 58 | HIDDEN = 'hidden', | ||
3213 | 59 | PREFIX = 'highcharts-', | ||
3214 | 60 | VISIBLE = 'visible', | ||
3215 | 61 | PX = 'px', | ||
3216 | 62 | NONE = 'none', | ||
3217 | 63 | M = 'M', | ||
3218 | 64 | L = 'L', | ||
3219 | 65 | /* | ||
3220 | 66 | * Empirical lowest possible opacities for TRACKER_FILL | ||
3221 | 67 | * IE6: 0.002 | ||
3222 | 68 | * IE7: 0.002 | ||
3223 | 69 | * IE8: 0.002 | ||
3224 | 70 | * IE9: 0.00000000001 (unlimited) | ||
3225 | 71 | * FF: 0.00000000001 (unlimited) | ||
3226 | 72 | * Chrome: 0.000001 | ||
3227 | 73 | * Safari: 0.000001 | ||
3228 | 74 | * Opera: 0.00000000001 (unlimited) | ||
3229 | 75 | */ | ||
3230 | 76 | TRACKER_FILL = 'rgba(192,192,192,' + (hasSVG ? 0.000001 : 0.002) + ')', // invisible but clickable | ||
3231 | 77 | NORMAL_STATE = '', | ||
3232 | 78 | HOVER_STATE = 'hover', | ||
3233 | 79 | SELECT_STATE = 'select', | ||
3234 | 80 | |||
3235 | 81 | // time methods, changed based on whether or not UTC is used | ||
3236 | 82 | makeTime, | ||
3237 | 83 | getMinutes, | ||
3238 | 84 | getHours, | ||
3239 | 85 | getDay, | ||
3240 | 86 | getDate, | ||
3241 | 87 | getMonth, | ||
3242 | 88 | getFullYear, | ||
3243 | 89 | setMinutes, | ||
3244 | 90 | setHours, | ||
3245 | 91 | setDate, | ||
3246 | 92 | setMonth, | ||
3247 | 93 | setFullYear, | ||
3248 | 94 | |||
3249 | 95 | // check for a custom HighchartsAdapter defined prior to this file | ||
3250 | 96 | globalAdapter = win.HighchartsAdapter, | ||
3251 | 97 | adapter = globalAdapter || {}, | ||
3252 | 98 | |||
3253 | 99 | // Utility functions. If the HighchartsAdapter is not defined, adapter is an empty object | ||
3254 | 100 | // and all the utility functions will be null. In that case they are populated by the | ||
3255 | 101 | // default adapters below. | ||
3256 | 102 | each = adapter.each, | ||
3257 | 103 | grep = adapter.grep, | ||
3258 | 104 | map = adapter.map, | ||
3259 | 105 | merge = adapter.merge, | ||
3260 | 106 | addEvent = adapter.addEvent, | ||
3261 | 107 | removeEvent = adapter.removeEvent, | ||
3262 | 108 | fireEvent = adapter.fireEvent, | ||
3263 | 109 | animate = adapter.animate, | ||
3264 | 110 | stop = adapter.stop, | ||
3265 | 111 | |||
3266 | 112 | // lookup over the types and the associated classes | ||
3267 | 113 | seriesTypes = {}; | ||
3268 | 114 | |||
3269 | 115 | /** | ||
3270 | 116 | * Extend an object with the members of another | ||
3271 | 117 | * @param {Object} a The object to be extended | ||
3272 | 118 | * @param {Object} b The object to add to the first one | ||
3273 | 119 | */ | ||
3274 | 120 | function extend(a, b) { | ||
3275 | 121 | var n; | ||
3276 | 122 | if (!a) { | ||
3277 | 123 | a = {}; | ||
3278 | 124 | } | ||
3279 | 125 | for (n in b) { | ||
3280 | 126 | a[n] = b[n]; | ||
3281 | 127 | } | ||
3282 | 128 | return a; | ||
3283 | 129 | } | ||
3284 | 130 | |||
3285 | 131 | /** | ||
3286 | 132 | * Shortcut for parseInt | ||
3287 | 133 | * @param {Object} s | ||
3288 | 134 | */ | ||
3289 | 135 | function pInt(s, mag) { | ||
3290 | 136 | return parseInt(s, mag || 10); | ||
3291 | 137 | } | ||
3292 | 138 | |||
3293 | 139 | /** | ||
3294 | 140 | * Check for string | ||
3295 | 141 | * @param {Object} s | ||
3296 | 142 | */ | ||
3297 | 143 | function isString(s) { | ||
3298 | 144 | return typeof s === 'string'; | ||
3299 | 145 | } | ||
3300 | 146 | |||
3301 | 147 | /** | ||
3302 | 148 | * Check for object | ||
3303 | 149 | * @param {Object} obj | ||
3304 | 150 | */ | ||
3305 | 151 | function isObject(obj) { | ||
3306 | 152 | return typeof obj === 'object'; | ||
3307 | 153 | } | ||
3308 | 154 | |||
3309 | 155 | /** | ||
3310 | 156 | * Check for array | ||
3311 | 157 | * @param {Object} obj | ||
3312 | 158 | */ | ||
3313 | 159 | function isArray(obj) { | ||
3314 | 160 | return Object.prototype.toString.call(obj) === '[object Array]'; | ||
3315 | 161 | } | ||
3316 | 162 | |||
3317 | 163 | /** | ||
3318 | 164 | * Check for number | ||
3319 | 165 | * @param {Object} n | ||
3320 | 166 | */ | ||
3321 | 167 | function isNumber(n) { | ||
3322 | 168 | return typeof n === 'number'; | ||
3323 | 169 | } | ||
3324 | 170 | |||
3325 | 171 | function log2lin(num) { | ||
3326 | 172 | return math.log(num) / math.LN10; | ||
3327 | 173 | } | ||
3328 | 174 | function lin2log(num) { | ||
3329 | 175 | return math.pow(10, num); | ||
3330 | 176 | } | ||
3331 | 177 | |||
3332 | 178 | /** | ||
3333 | 179 | * Remove last occurence of an item from an array | ||
3334 | 180 | * @param {Array} arr | ||
3335 | 181 | * @param {Mixed} item | ||
3336 | 182 | */ | ||
3337 | 183 | function erase(arr, item) { | ||
3338 | 184 | var i = arr.length; | ||
3339 | 185 | while (i--) { | ||
3340 | 186 | if (arr[i] === item) { | ||
3341 | 187 | arr.splice(i, 1); | ||
3342 | 188 | break; | ||
3343 | 189 | } | ||
3344 | 190 | } | ||
3345 | 191 | //return arr; | ||
3346 | 192 | } | ||
3347 | 193 | |||
3348 | 194 | /** | ||
3349 | 195 | * Returns true if the object is not null or undefined. Like MooTools' $.defined. | ||
3350 | 196 | * @param {Object} obj | ||
3351 | 197 | */ | ||
3352 | 198 | function defined(obj) { | ||
3353 | 199 | return obj !== UNDEFINED && obj !== null; | ||
3354 | 200 | } | ||
3355 | 201 | |||
3356 | 202 | /** | ||
3357 | 203 | * Set or get an attribute or an object of attributes. Can't use jQuery attr because | ||
3358 | 204 | * it attempts to set expando properties on the SVG element, which is not allowed. | ||
3359 | 205 | * | ||
3360 | 206 | * @param {Object} elem The DOM element to receive the attribute(s) | ||
3361 | 207 | * @param {String|Object} prop The property or an abject of key-value pairs | ||
3362 | 208 | * @param {String} value The value if a single property is set | ||
3363 | 209 | */ | ||
3364 | 210 | function attr(elem, prop, value) { | ||
3365 | 211 | var key, | ||
3366 | 212 | setAttribute = 'setAttribute', | ||
3367 | 213 | ret; | ||
3368 | 214 | |||
3369 | 215 | // if the prop is a string | ||
3370 | 216 | if (isString(prop)) { | ||
3371 | 217 | // set the value | ||
3372 | 218 | if (defined(value)) { | ||
3373 | 219 | |||
3374 | 220 | elem[setAttribute](prop, value); | ||
3375 | 221 | |||
3376 | 222 | // get the value | ||
3377 | 223 | } else if (elem && elem.getAttribute) { // elem not defined when printing pie demo... | ||
3378 | 224 | ret = elem.getAttribute(prop); | ||
3379 | 225 | } | ||
3380 | 226 | |||
3381 | 227 | // else if prop is defined, it is a hash of key/value pairs | ||
3382 | 228 | } else if (defined(prop) && isObject(prop)) { | ||
3383 | 229 | for (key in prop) { | ||
3384 | 230 | elem[setAttribute](key, prop[key]); | ||
3385 | 231 | } | ||
3386 | 232 | } | ||
3387 | 233 | return ret; | ||
3388 | 234 | } | ||
3389 | 235 | /** | ||
3390 | 236 | * Check if an element is an array, and if not, make it into an array. Like | ||
3391 | 237 | * MooTools' $.splat. | ||
3392 | 238 | */ | ||
3393 | 239 | function splat(obj) { | ||
3394 | 240 | return isArray(obj) ? obj : [obj]; | ||
3395 | 241 | } | ||
3396 | 242 | |||
3397 | 243 | |||
3398 | 244 | /** | ||
3399 | 245 | * Return the first value that is defined. Like MooTools' $.pick. | ||
3400 | 246 | */ | ||
3401 | 247 | function pick() { | ||
3402 | 248 | var args = arguments, | ||
3403 | 249 | i, | ||
3404 | 250 | arg, | ||
3405 | 251 | length = args.length; | ||
3406 | 252 | for (i = 0; i < length; i++) { | ||
3407 | 253 | arg = args[i]; | ||
3408 | 254 | if (typeof arg !== 'undefined' && arg !== null) { | ||
3409 | 255 | return arg; | ||
3410 | 256 | } | ||
3411 | 257 | } | ||
3412 | 258 | } | ||
3413 | 259 | |||
3414 | 260 | /** | ||
3415 | 261 | * Set CSS on a given element | ||
3416 | 262 | * @param {Object} el | ||
3417 | 263 | * @param {Object} styles Style object with camel case property names | ||
3418 | 264 | */ | ||
3419 | 265 | function css(el, styles) { | ||
3420 | 266 | if (isIE) { | ||
3421 | 267 | if (styles && styles.opacity !== UNDEFINED) { | ||
3422 | 268 | styles.filter = 'alpha(opacity=' + (styles.opacity * 100) + ')'; | ||
3423 | 269 | } | ||
3424 | 270 | } | ||
3425 | 271 | extend(el.style, styles); | ||
3426 | 272 | } | ||
3427 | 273 | |||
3428 | 274 | /** | ||
3429 | 275 | * Utility function to create element with attributes and styles | ||
3430 | 276 | * @param {Object} tag | ||
3431 | 277 | * @param {Object} attribs | ||
3432 | 278 | * @param {Object} styles | ||
3433 | 279 | * @param {Object} parent | ||
3434 | 280 | * @param {Object} nopad | ||
3435 | 281 | */ | ||
3436 | 282 | function createElement(tag, attribs, styles, parent, nopad) { | ||
3437 | 283 | var el = doc.createElement(tag); | ||
3438 | 284 | if (attribs) { | ||
3439 | 285 | extend(el, attribs); | ||
3440 | 286 | } | ||
3441 | 287 | if (nopad) { | ||
3442 | 288 | css(el, {padding: 0, border: NONE, margin: 0}); | ||
3443 | 289 | } | ||
3444 | 290 | if (styles) { | ||
3445 | 291 | css(el, styles); | ||
3446 | 292 | } | ||
3447 | 293 | if (parent) { | ||
3448 | 294 | parent.appendChild(el); | ||
3449 | 295 | } | ||
3450 | 296 | return el; | ||
3451 | 297 | } | ||
3452 | 298 | |||
3453 | 299 | /** | ||
3454 | 300 | * Extend a prototyped class by new members | ||
3455 | 301 | * @param {Object} parent | ||
3456 | 302 | * @param {Object} members | ||
3457 | 303 | */ | ||
3458 | 304 | function extendClass(parent, members) { | ||
3459 | 305 | var object = function () {}; | ||
3460 | 306 | object.prototype = new parent(); | ||
3461 | 307 | extend(object.prototype, members); | ||
3462 | 308 | return object; | ||
3463 | 309 | } | ||
3464 | 310 | |||
3465 | 311 | /** | ||
3466 | 312 | * Format a number and return a string based on input settings | ||
3467 | 313 | * @param {Number} number The input number to format | ||
3468 | 314 | * @param {Number} decimals The amount of decimals | ||
3469 | 315 | * @param {String} decPoint The decimal point, defaults to the one given in the lang options | ||
3470 | 316 | * @param {String} thousandsSep The thousands separator, defaults to the one given in the lang options | ||
3471 | 317 | */ | ||
3472 | 318 | function numberFormat(number, decimals, decPoint, thousandsSep) { | ||
3473 | 319 | var lang = defaultOptions.lang, | ||
3474 | 320 | // http://kevin.vanzonneveld.net/techblog/article/javascript_equivalent_for_phps_number_format/ | ||
3475 | 321 | n = number, | ||
3476 | 322 | c = isNaN(decimals = mathAbs(decimals)) ? 2 : decimals, | ||
3477 | 323 | d = decPoint === undefined ? lang.decimalPoint : decPoint, | ||
3478 | 324 | t = thousandsSep === undefined ? lang.thousandsSep : thousandsSep, | ||
3479 | 325 | s = n < 0 ? "-" : "", | ||
3480 | 326 | i = String(pInt(n = mathAbs(+n || 0).toFixed(c))), | ||
3481 | 327 | j = i.length > 3 ? i.length % 3 : 0; | ||
3482 | 328 | |||
3483 | 329 | return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + | ||
3484 | 330 | (c ? d + mathAbs(n - i).toFixed(c).slice(2) : ""); | ||
3485 | 331 | } | ||
3486 | 332 | |||
3487 | 333 | /** | ||
3488 | 334 | * Based on http://www.php.net/manual/en/function.strftime.php | ||
3489 | 335 | * @param {String} format | ||
3490 | 336 | * @param {Number} timestamp | ||
3491 | 337 | * @param {Boolean} capitalize | ||
3492 | 338 | */ | ||
3493 | 339 | dateFormat = function (format, timestamp, capitalize) { | ||
3494 | 340 | function pad(number) { | ||
3495 | 341 | return number.toString().replace(/^([0-9])$/, '0$1'); | ||
3496 | 342 | } | ||
3497 | 343 | |||
3498 | 344 | if (!defined(timestamp) || isNaN(timestamp)) { | ||
3499 | 345 | return 'Invalid date'; | ||
3500 | 346 | } | ||
3501 | 347 | format = pick(format, '%Y-%m-%d %H:%M:%S'); | ||
3502 | 348 | |||
3503 | 349 | var date = new Date(timestamp * timeFactor), | ||
3504 | 350 | key, // used in for constuct below | ||
3505 | 351 | // get the basic time values | ||
3506 | 352 | hours = date[getHours](), | ||
3507 | 353 | day = date[getDay](), | ||
3508 | 354 | dayOfMonth = date[getDate](), | ||
3509 | 355 | month = date[getMonth](), | ||
3510 | 356 | fullYear = date[getFullYear](), | ||
3511 | 357 | lang = defaultOptions.lang, | ||
3512 | 358 | langWeekdays = lang.weekdays, | ||
3513 | 359 | /* // uncomment this and the 'W' format key below to enable week numbers | ||
3514 | 360 | weekNumber = function() { | ||
3515 | 361 | var clone = new Date(date.valueOf()), | ||
3516 | 362 | day = clone[getDay]() == 0 ? 7 : clone[getDay](), | ||
3517 | 363 | dayNumber; | ||
3518 | 364 | clone.setDate(clone[getDate]() + 4 - day); | ||
3519 | 365 | dayNumber = mathFloor((clone.getTime() - new Date(clone[getFullYear](), 0, 1, -6)) / 86400000); | ||
3520 | 366 | return 1 + mathFloor(dayNumber / 7); | ||
3521 | 367 | }, | ||
3522 | 368 | */ | ||
3523 | 369 | |||
3524 | 370 | // list all format keys | ||
3525 | 371 | replacements = { | ||
3526 | 372 | |||
3527 | 373 | // Day | ||
3528 | 374 | 'a': langWeekdays[day].substr(0, 3), // Short weekday, like 'Mon' | ||
3529 | 375 | 'A': langWeekdays[day], // Long weekday, like 'Monday' | ||
3530 | 376 | 'd': pad(dayOfMonth), // Two digit day of the month, 01 to 31 | ||
3531 | 377 | 'e': dayOfMonth, // Day of the month, 1 through 31 | ||
3532 | 378 | |||
3533 | 379 | // Week (none implemented) | ||
3534 | 380 | //'W': weekNumber(), | ||
3535 | 381 | |||
3536 | 382 | // Month | ||
3537 | 383 | 'b': lang.shortMonths[month], // Short month, like 'Jan' | ||
3538 | 384 | 'B': lang.months[month], // Long month, like 'January' | ||
3539 | 385 | 'm': pad(month + 1), // Two digit month number, 01 through 12 | ||
3540 | 386 | |||
3541 | 387 | // Year | ||
3542 | 388 | 'y': fullYear.toString().substr(2, 2), // Two digits year, like 09 for 2009 | ||
3543 | 389 | 'Y': fullYear, // Four digits year, like 2009 | ||
3544 | 390 | |||
3545 | 391 | // Time | ||
3546 | 392 | 'H': pad(hours), // Two digits hours in 24h format, 00 through 23 | ||
3547 | 393 | 'I': pad((hours % 12) || 12), // Two digits hours in 12h format, 00 through 11 | ||
3548 | 394 | 'l': (hours % 12) || 12, // Hours in 12h format, 1 through 12 | ||
3549 | 395 | 'M': pad(date[getMinutes]()), // Two digits minutes, 00 through 59 | ||
3550 | 396 | 'p': hours < 12 ? 'AM' : 'PM', // Upper case AM or PM | ||
3551 | 397 | 'P': hours < 12 ? 'am' : 'pm', // Lower case AM or PM | ||
3552 | 398 | 'S': pad(date.getSeconds()) // Two digits seconds, 00 through 59 | ||
3553 | 399 | |||
3554 | 400 | }; | ||
3555 | 401 | |||
3556 | 402 | |||
3557 | 403 | // do the replaces | ||
3558 | 404 | for (key in replacements) { | ||
3559 | 405 | format = format.replace('%' + key, replacements[key]); | ||
3560 | 406 | } | ||
3561 | 407 | |||
3562 | 408 | // Optionally capitalize the string and return | ||
3563 | 409 | return capitalize ? format.substr(0, 1).toUpperCase() + format.substr(1) : format; | ||
3564 | 410 | }; | ||
3565 | 411 | |||
3566 | 412 | /** | ||
3567 | 413 | * Loop up the node tree and add offsetWidth and offsetHeight to get the | ||
3568 | 414 | * total page offset for a given element. Used by Opera and iOS on hover and | ||
3569 | 415 | * all browsers on point click. | ||
3570 | 416 | * | ||
3571 | 417 | * @param {Object} el | ||
3572 | 418 | * | ||
3573 | 419 | */ | ||
3574 | 420 | function getPosition(el) { | ||
3575 | 421 | var p = { left: el.offsetLeft, top: el.offsetTop }; | ||
3576 | 422 | el = el.offsetParent; | ||
3577 | 423 | while (el) { | ||
3578 | 424 | p.left += el.offsetLeft; | ||
3579 | 425 | p.top += el.offsetTop; | ||
3580 | 426 | if (el !== doc.body && el !== doc.documentElement) { | ||
3581 | 427 | p.left -= el.scrollLeft; | ||
3582 | 428 | p.top -= el.scrollTop; | ||
3583 | 429 | } | ||
3584 | 430 | el = el.offsetParent; | ||
3585 | 431 | } | ||
3586 | 432 | return p; | ||
3587 | 433 | } | ||
3588 | 434 | |||
3589 | 435 | /** | ||
3590 | 436 | * Helper class that contains variuos counters that are local to the chart. | ||
3591 | 437 | */ | ||
3592 | 438 | function ChartCounters() { | ||
3593 | 439 | this.color = 0; | ||
3594 | 440 | this.symbol = 0; | ||
3595 | 441 | } | ||
3596 | 442 | |||
3597 | 443 | ChartCounters.prototype = { | ||
3598 | 444 | /** | ||
3599 | 445 | * Wraps the color counter if it reaches the specified length. | ||
3600 | 446 | */ | ||
3601 | 447 | wrapColor: function (length) { | ||
3602 | 448 | if (this.color >= length) { | ||
3603 | 449 | this.color = 0; | ||
3604 | 450 | } | ||
3605 | 451 | }, | ||
3606 | 452 | |||
3607 | 453 | /** | ||
3608 | 454 | * Wraps the symbol counter if it reaches the specified length. | ||
3609 | 455 | */ | ||
3610 | 456 | wrapSymbol: function (length) { | ||
3611 | 457 | if (this.symbol >= length) { | ||
3612 | 458 | this.symbol = 0; | ||
3613 | 459 | } | ||
3614 | 460 | } | ||
3615 | 461 | }; | ||
3616 | 462 | |||
3617 | 463 | /** | ||
3618 | 464 | * Utility method extracted from Tooltip code that places a tooltip in a chart without spilling over | ||
3619 | 465 | * and not covering the point it self. | ||
3620 | 466 | */ | ||
3621 | 467 | function placeBox(boxWidth, boxHeight, outerLeft, outerTop, outerWidth, outerHeight, point) { | ||
3622 | 468 | // keep the box within the chart area | ||
3623 | 469 | var pointX = point.x, | ||
3624 | 470 | pointY = point.y, | ||
3625 | 471 | x = pointX - boxWidth + outerLeft - 25, | ||
3626 | 472 | y = pointY - boxHeight + outerTop + 10, | ||
3627 | 473 | alignedRight; | ||
3628 | 474 | |||
3629 | 475 | // it is too far to the left, adjust it | ||
3630 | 476 | if (x < 7) { | ||
3631 | 477 | x = outerLeft + pointX + 15; | ||
3632 | 478 | } | ||
3633 | 479 | |||
3634 | 480 | // Test to see if the tooltip is to far to the right, | ||
3635 | 481 | // if it is, move it back to be inside and then up to not cover the point. | ||
3636 | 482 | if ((x + boxWidth) > (outerLeft + outerWidth)) { | ||
3637 | 483 | x -= (x + boxWidth) - (outerLeft + outerWidth); | ||
3638 | 484 | y -= boxHeight; | ||
3639 | 485 | alignedRight = true; | ||
3640 | 486 | } | ||
3641 | 487 | |||
3642 | 488 | if (y < 5) { | ||
3643 | 489 | y = 5; // above | ||
3644 | 490 | |||
3645 | 491 | // If the tooltip is still covering the point, move it below instead | ||
3646 | 492 | if (alignedRight && pointY >= y && pointY <= (y + boxHeight)) { | ||
3647 | 493 | y = pointY + boxHeight - 5; // below | ||
3648 | 494 | } | ||
3649 | 495 | } else if (y + boxHeight > outerTop + outerHeight) { | ||
3650 | 496 | y = outerTop + outerHeight - boxHeight - 5; // below | ||
3651 | 497 | } | ||
3652 | 498 | |||
3653 | 499 | return {x: x, y: y}; | ||
3654 | 500 | } | ||
3655 | 501 | |||
3656 | 502 | /** | ||
3657 | 503 | * Utility method that sorts an object array and keeping the order of equal items. | ||
3658 | 504 | * ECMA script standard does not specify the behaviour when items are equal. | ||
3659 | 505 | */ | ||
3660 | 506 | function stableSort(arr, sortFunction) { | ||
3661 | 507 | var length = arr.length, | ||
3662 | 508 | i; | ||
3663 | 509 | |||
3664 | 510 | // Add index to each item | ||
3665 | 511 | for (i = 0; i < length; i++) { | ||
3666 | 512 | arr[i].ss_i = i; // stable sort index | ||
3667 | 513 | } | ||
3668 | 514 | |||
3669 | 515 | arr.sort(function (a, b) { | ||
3670 | 516 | var sortValue = sortFunction(a, b); | ||
3671 | 517 | return sortValue === 0 ? a.ss_i - b.ss_i : sortValue; | ||
3672 | 518 | }); | ||
3673 | 519 | |||
3674 | 520 | // Remove index from items | ||
3675 | 521 | for (i = 0; i < length; i++) { | ||
3676 | 522 | delete arr[i].ss_i; // stable sort index | ||
3677 | 523 | } | ||
3678 | 524 | } | ||
3679 | 525 | |||
3680 | 526 | /** | ||
3681 | 527 | * Utility method that destroys any SVGElement or VMLElement that are properties on the given object. | ||
3682 | 528 | * It loops all properties and invokes destroy if there is a destroy method. The property is | ||
3683 | 529 | * then delete'ed. | ||
3684 | 530 | */ | ||
3685 | 531 | function destroyObjectProperties(obj) { | ||
3686 | 532 | var n; | ||
3687 | 533 | for (n in obj) { | ||
3688 | 534 | // If the object is non-null and destroy is defined | ||
3689 | 535 | if (obj[n] && obj[n].destroy) { | ||
3690 | 536 | // Invoke the destroy | ||
3691 | 537 | obj[n].destroy(); | ||
3692 | 538 | } | ||
3693 | 539 | |||
3694 | 540 | // Delete the property from the object. | ||
3695 | 541 | delete obj[n]; | ||
3696 | 542 | } | ||
3697 | 543 | } | ||
3698 | 544 | |||
3699 | 545 | /** | ||
3700 | 546 | * Path interpolation algorithm used across adapters | ||
3701 | 547 | */ | ||
3702 | 548 | pathAnim = { | ||
3703 | 549 | /** | ||
3704 | 550 | * Prepare start and end values so that the path can be animated one to one | ||
3705 | 551 | */ | ||
3706 | 552 | init: function (elem, fromD, toD) { | ||
3707 | 553 | fromD = fromD || ''; | ||
3708 | 554 | var shift = elem.shift, | ||
3709 | 555 | bezier = fromD.indexOf('C') > -1, | ||
3710 | 556 | numParams = bezier ? 7 : 3, | ||
3711 | 557 | endLength, | ||
3712 | 558 | slice, | ||
3713 | 559 | i, | ||
3714 | 560 | start = fromD.split(' '), | ||
3715 | 561 | end = [].concat(toD), // copy | ||
3716 | 562 | startBaseLine, | ||
3717 | 563 | endBaseLine, | ||
3718 | 564 | sixify = function (arr) { // in splines make move points have six parameters like bezier curves | ||
3719 | 565 | i = arr.length; | ||
3720 | 566 | while (i--) { | ||
3721 | 567 | if (arr[i] === M) { | ||
3722 | 568 | arr.splice(i + 1, 0, arr[i + 1], arr[i + 2], arr[i + 1], arr[i + 2]); | ||
3723 | 569 | } | ||
3724 | 570 | } | ||
3725 | 571 | }; | ||
3726 | 572 | |||
3727 | 573 | if (bezier) { | ||
3728 | 574 | sixify(start); | ||
3729 | 575 | sixify(end); | ||
3730 | 576 | } | ||
3731 | 577 | |||
3732 | 578 | // pull out the base lines before padding | ||
3733 | 579 | if (elem.isArea) { | ||
3734 | 580 | startBaseLine = start.splice(start.length - 6, 6); | ||
3735 | 581 | endBaseLine = end.splice(end.length - 6, 6); | ||
3736 | 582 | } | ||
3737 | 583 | |||
3738 | 584 | // if shifting points, prepend a dummy point to the end path | ||
3739 | 585 | if (shift) { | ||
3740 | 586 | |||
3741 | 587 | end = [].concat(end).splice(0, numParams).concat(end); | ||
3742 | 588 | elem.shift = false; // reset for following animations | ||
3743 | 589 | } | ||
3744 | 590 | |||
3745 | 591 | // copy and append last point until the length matches the end length | ||
3746 | 592 | if (start.length) { | ||
3747 | 593 | endLength = end.length; | ||
3748 | 594 | while (start.length < endLength) { | ||
3749 | 595 | |||
3750 | 596 | //bezier && sixify(start); | ||
3751 | 597 | slice = [].concat(start).splice(start.length - numParams, numParams); | ||
3752 | 598 | if (bezier) { // disable first control point | ||
3753 | 599 | slice[numParams - 6] = slice[numParams - 2]; | ||
3754 | 600 | slice[numParams - 5] = slice[numParams - 1]; | ||
3755 | 601 | } | ||
3756 | 602 | start = start.concat(slice); | ||
3757 | 603 | } | ||
3758 | 604 | } | ||
3759 | 605 | |||
3760 | 606 | if (startBaseLine) { // append the base lines for areas | ||
3761 | 607 | start = start.concat(startBaseLine); | ||
3762 | 608 | end = end.concat(endBaseLine); | ||
3763 | 609 | } | ||
3764 | 610 | return [start, end]; | ||
3765 | 611 | }, | ||
3766 | 612 | |||
3767 | 613 | /** | ||
3768 | 614 | * Interpolate each value of the path and return the array | ||
3769 | 615 | */ | ||
3770 | 616 | step: function (start, end, pos, complete) { | ||
3771 | 617 | var ret = [], | ||
3772 | 618 | i = start.length, | ||
3773 | 619 | startVal; | ||
3774 | 620 | |||
3775 | 621 | if (pos === 1) { // land on the final path without adjustment points appended in the ends | ||
3776 | 622 | ret = complete; | ||
3777 | 623 | |||
3778 | 624 | } else if (i === end.length && pos < 1) { | ||
3779 | 625 | while (i--) { | ||
3780 | 626 | startVal = parseFloat(start[i]); | ||
3781 | 627 | ret[i] = | ||
3782 | 628 | isNaN(startVal) ? // a letter instruction like M or L | ||
3783 | 629 | start[i] : | ||
3784 | 630 | pos * (parseFloat(end[i] - startVal)) + startVal; | ||
3785 | 631 | |||
3786 | 632 | } | ||
3787 | 633 | } else { // if animation is finished or length not matching, land on right value | ||
3788 | 634 | ret = end; | ||
3789 | 635 | } | ||
3790 | 636 | return ret; | ||
3791 | 637 | } | ||
3792 | 638 | }; | ||
3793 | 639 | |||
3794 | 640 | |||
3795 | 641 | /** | ||
3796 | 642 | * Set the global animation to either a given value, or fall back to the | ||
3797 | 643 | * given chart's animation option | ||
3798 | 644 | * @param {Object} animation | ||
3799 | 645 | * @param {Object} chart | ||
3800 | 646 | */ | ||
3801 | 647 | function setAnimation(animation, chart) { | ||
3802 | 648 | globalAnimation = pick(animation, chart.animation); | ||
3803 | 649 | } | ||
3804 | 650 | |||
3805 | 651 | /* | ||
3806 | 652 | * Define the adapter for frameworks. If an external adapter is not defined, | ||
3807 | 653 | * Highcharts reverts to the built-in jQuery adapter. | ||
3808 | 654 | */ | ||
3809 | 655 | if (globalAdapter && globalAdapter.init) { | ||
3810 | 656 | // Initialize the adapter with the pathAnim object that takes care | ||
3811 | 657 | // of path animations. | ||
3812 | 658 | globalAdapter.init(pathAnim); | ||
3813 | 659 | } | ||
3814 | 660 | if (!globalAdapter && win.jQuery) { | ||
3815 | 661 | var jQ = jQuery; | ||
3816 | 662 | |||
3817 | 663 | /** | ||
3818 | 664 | * Utility for iterating over an array. Parameters are reversed compared to jQuery. | ||
3819 | 665 | * @param {Array} arr | ||
3820 | 666 | * @param {Function} fn | ||
3821 | 667 | */ | ||
3822 | 668 | each = function (arr, fn) { | ||
3823 | 669 | var i = 0, | ||
3824 | 670 | len = arr.length; | ||
3825 | 671 | for (; i < len; i++) { | ||
3826 | 672 | if (fn.call(arr[i], arr[i], i, arr) === false) { | ||
3827 | 673 | return i; | ||
3828 | 674 | } | ||
3829 | 675 | } | ||
3830 | 676 | }; | ||
3831 | 677 | |||
3832 | 678 | /** | ||
3833 | 679 | * Filter an array | ||
3834 | 680 | */ | ||
3835 | 681 | grep = jQ.grep; | ||
3836 | 682 | |||
3837 | 683 | /** | ||
3838 | 684 | * Map an array | ||
3839 | 685 | * @param {Array} arr | ||
3840 | 686 | * @param {Function} fn | ||
3841 | 687 | */ | ||
3842 | 688 | map = function (arr, fn) { | ||
3843 | 689 | //return jQuery.map(arr, fn); | ||
3844 | 690 | var results = [], | ||
3845 | 691 | i = 0, | ||
3846 | 692 | len = arr.length; | ||
3847 | 693 | for (; i < len; i++) { | ||
3848 | 694 | results[i] = fn.call(arr[i], arr[i], i, arr); | ||
3849 | 695 | } | ||
3850 | 696 | return results; | ||
3851 | 697 | |||
3852 | 698 | }; | ||
3853 | 699 | |||
3854 | 700 | /** | ||
3855 | 701 | * Deep merge two objects and return a third object | ||
3856 | 702 | */ | ||
3857 | 703 | merge = function () { | ||
3858 | 704 | var args = arguments; | ||
3859 | 705 | return jQ.extend(true, null, args[0], args[1], args[2], args[3]); | ||
3860 | 706 | }; | ||
3861 | 707 | |||
3862 | 708 | /** | ||
3863 | 709 | * Add an event listener | ||
3864 | 710 | * @param {Object} el A HTML element or custom object | ||
3865 | 711 | * @param {String} event The event type | ||
3866 | 712 | * @param {Function} fn The event handler | ||
3867 | 713 | */ | ||
3868 | 714 | addEvent = function (el, event, fn) { | ||
3869 | 715 | jQ(el).bind(event, fn); | ||
3870 | 716 | }; | ||
3871 | 717 | |||
3872 | 718 | /** | ||
3873 | 719 | * Remove event added with addEvent | ||
3874 | 720 | * @param {Object} el The object | ||
3875 | 721 | * @param {String} eventType The event type. Leave blank to remove all events. | ||
3876 | 722 | * @param {Function} handler The function to remove | ||
3877 | 723 | */ | ||
3878 | 724 | removeEvent = function (el, eventType, handler) { | ||
3879 | 725 | // workaround for jQuery issue with unbinding custom events: | ||
3880 | 726 | // http://forum.jquery.com/topic/javascript-error-when-unbinding-a-custom-event-using-jquery-1-4-2 | ||
3881 | 727 | var func = doc.removeEventListener ? 'removeEventListener' : 'detachEvent'; | ||
3882 | 728 | if (doc[func] && !el[func]) { | ||
3883 | 729 | el[func] = function () {}; | ||
3884 | 730 | } | ||
3885 | 731 | |||
3886 | 732 | jQ(el).unbind(eventType, handler); | ||
3887 | 733 | }; | ||
3888 | 734 | |||
3889 | 735 | /** | ||
3890 | 736 | * Fire an event on a custom object | ||
3891 | 737 | * @param {Object} el | ||
3892 | 738 | * @param {String} type | ||
3893 | 739 | * @param {Object} eventArguments | ||
3894 | 740 | * @param {Function} defaultFunction | ||
3895 | 741 | */ | ||
3896 | 742 | fireEvent = function (el, type, eventArguments, defaultFunction) { | ||
3897 | 743 | var event = jQ.Event(type), | ||
3898 | 744 | detachedType = 'detached' + type; | ||
3899 | 745 | extend(event, eventArguments); | ||
3900 | 746 | |||
3901 | 747 | // Prevent jQuery from triggering the object method that is named the | ||
3902 | 748 | // same as the event. For example, if the event is 'select', jQuery | ||
3903 | 749 | // attempts calling el.select and it goes into a loop. | ||
3904 | 750 | if (el[type]) { | ||
3905 | 751 | el[detachedType] = el[type]; | ||
3906 | 752 | el[type] = null; | ||
3907 | 753 | } | ||
3908 | 754 | |||
3909 | 755 | // trigger it | ||
3910 | 756 | jQ(el).trigger(event); | ||
3911 | 757 | |||
3912 | 758 | // attach the method | ||
3913 | 759 | if (el[detachedType]) { | ||
3914 | 760 | el[type] = el[detachedType]; | ||
3915 | 761 | el[detachedType] = null; | ||
3916 | 762 | } | ||
3917 | 763 | |||
3918 | 764 | if (defaultFunction && !event.isDefaultPrevented()) { | ||
3919 | 765 | defaultFunction(event); | ||
3920 | 766 | } | ||
3921 | 767 | }; | ||
3922 | 768 | |||
3923 | 769 | /** | ||
3924 | 770 | * Animate a HTML element or SVG element wrapper | ||
3925 | 771 | * @param {Object} el | ||
3926 | 772 | * @param {Object} params | ||
3927 | 773 | * @param {Object} options jQuery-like animation options: duration, easing, callback | ||
3928 | 774 | */ | ||
3929 | 775 | animate = function (el, params, options) { | ||
3930 | 776 | var $el = jQ(el); | ||
3931 | 777 | if (params.d) { | ||
3932 | 778 | el.toD = params.d; // keep the array form for paths, used in jQ.fx.step.d | ||
3933 | 779 | params.d = 1; // because in jQuery, animating to an array has a different meaning | ||
3934 | 780 | } | ||
3935 | 781 | |||
3936 | 782 | $el.stop(); | ||
3937 | 783 | $el.animate(params, options); | ||
3938 | 784 | |||
3939 | 785 | }; | ||
3940 | 786 | /** | ||
3941 | 787 | * Stop running animation | ||
3942 | 788 | */ | ||
3943 | 789 | stop = function (el) { | ||
3944 | 790 | jQ(el).stop(); | ||
3945 | 791 | }; | ||
3946 | 792 | |||
3947 | 793 | |||
3948 | 794 | //=== Extend jQuery on init | ||
3949 | 795 | |||
3950 | 796 | /*jslint unparam: true*//* allow unused param x in this function */ | ||
3951 | 797 | jQ.extend(jQ.easing, { | ||
3952 | 798 | easeOutQuad: function (x, t, b, c, d) { | ||
3953 | 799 | return -c * (t /= d) * (t - 2) + b; | ||
3954 | 800 | } | ||
3955 | 801 | }); | ||
3956 | 802 | /*jslint unparam: false*/ | ||
3957 | 803 | |||
3958 | 804 | // extend the animate function to allow SVG animations | ||
3959 | 805 | var jFx = jQuery.fx, | ||
3960 | 806 | jStep = jFx.step; | ||
3961 | 807 | |||
3962 | 808 | // extend some methods to check for elem.attr, which means it is a Highcharts SVG object | ||
3963 | 809 | each(['cur', '_default', 'width', 'height'], function (fn, i) { | ||
3964 | 810 | var obj = i ? jStep : jFx.prototype, // 'cur', the getter' relates to jFx.prototype | ||
3965 | 811 | base = obj[fn], | ||
3966 | 812 | elem; | ||
3967 | 813 | |||
3968 | 814 | if (base) { // step.width and step.height don't exist in jQuery < 1.7 | ||
3969 | 815 | |||
3970 | 816 | // create the extended function replacement | ||
3971 | 817 | obj[fn] = function (fx) { | ||
3972 | 818 | |||
3973 | 819 | // jFx.prototype.cur does not use fx argument | ||
3974 | 820 | fx = i ? fx : this; | ||
3975 | 821 | |||
3976 | 822 | // shortcut | ||
3977 | 823 | elem = fx.elem; | ||
3978 | 824 | |||
3979 | 825 | // jFX.prototype.cur returns the current value. The other ones are setters | ||
3980 | 826 | // and returning a value has no effect. | ||
3981 | 827 | return elem.attr ? // is SVG element wrapper | ||
3982 | 828 | elem.attr(fx.prop, fx.now) : // apply the SVG wrapper's method | ||
3983 | 829 | base.apply(this, arguments); // use jQuery's built-in method | ||
3984 | 830 | }; | ||
3985 | 831 | } | ||
3986 | 832 | }); | ||
3987 | 833 | |||
3988 | 834 | // animate paths | ||
3989 | 835 | jStep.d = function (fx) { | ||
3990 | 836 | var elem = fx.elem; | ||
3991 | 837 | |||
3992 | 838 | |||
3993 | 839 | // Normally start and end should be set in state == 0, but sometimes, | ||
3994 | 840 | // for reasons unknown, this doesn't happen. Perhaps state == 0 is skipped | ||
3995 | 841 | // in these cases | ||
3996 | 842 | if (!fx.started) { | ||
3997 | 843 | var ends = pathAnim.init(elem, elem.d, elem.toD); | ||
3998 | 844 | fx.start = ends[0]; | ||
3999 | 845 | fx.end = ends[1]; | ||
4000 | 846 | fx.started = true; | ||
4001 | 847 | } | ||
4002 | 848 | |||
4003 | 849 | |||
4004 | 850 | // interpolate each value of the path | ||
4005 | 851 | elem.attr('d', pathAnim.step(fx.start, fx.end, fx.pos, elem.toD)); | ||
4006 | 852 | |||
4007 | 853 | }; | ||
4008 | 854 | } | ||
4009 | 855 | |||
4010 | 856 | |||
4011 | 857 | /** | ||
4012 | 858 | * Add a global listener for mousemove events | ||
4013 | 859 | */ | ||
4014 | 860 | /*addEvent(doc, 'mousemove', function(e) { | ||
4015 | 861 | if (globalMouseMove) { | ||
4016 | 862 | globalMouseMove(e); | ||
4017 | 863 | } | ||
4018 | 864 | });*/ | ||
4019 | 865 | /** | ||
4020 | 866 | * Set the time methods globally based on the useUTC option. Time method can be either | ||
4021 | 867 | * local time or UTC (default). | ||
4022 | 868 | */ | ||
4023 | 869 | function setTimeMethods() { | ||
4024 | 870 | var useUTC = defaultOptions.global.useUTC; | ||
4025 | 871 | |||
4026 | 872 | makeTime = useUTC ? Date.UTC : function (year, month, date, hours, minutes, seconds) { | ||
4027 | 873 | return new Date( | ||
4028 | 874 | year, | ||
4029 | 875 | month, | ||
4030 | 876 | pick(date, 1), | ||
4031 | 877 | pick(hours, 0), | ||
4032 | 878 | pick(minutes, 0), | ||
4033 | 879 | pick(seconds, 0) | ||
4034 | 880 | ).getTime(); | ||
4035 | 881 | }; | ||
4036 | 882 | getMinutes = useUTC ? 'getUTCMinutes' : 'getMinutes'; | ||
4037 | 883 | getHours = useUTC ? 'getUTCHours' : 'getHours'; | ||
4038 | 884 | getDay = useUTC ? 'getUTCDay' : 'getDay'; | ||
4039 | 885 | getDate = useUTC ? 'getUTCDate' : 'getDate'; | ||
4040 | 886 | getMonth = useUTC ? 'getUTCMonth' : 'getMonth'; | ||
4041 | 887 | getFullYear = useUTC ? 'getUTCFullYear' : 'getFullYear'; | ||
4042 | 888 | setMinutes = useUTC ? 'setUTCMinutes' : 'setMinutes'; | ||
4043 | 889 | setHours = useUTC ? 'setUTCHours' : 'setHours'; | ||
4044 | 890 | setDate = useUTC ? 'setUTCDate' : 'setDate'; | ||
4045 | 891 | setMonth = useUTC ? 'setUTCMonth' : 'setMonth'; | ||
4046 | 892 | setFullYear = useUTC ? 'setUTCFullYear' : 'setFullYear'; | ||
4047 | 893 | |||
4048 | 894 | } | ||
4049 | 895 | |||
4050 | 896 | /** | ||
4051 | 897 | * Merge the default options with custom options and return the new options structure | ||
4052 | 898 | * @param {Object} options The new custom options | ||
4053 | 899 | */ | ||
4054 | 900 | function setOptions(options) { | ||
4055 | 901 | defaultOptions = merge(defaultOptions, options); | ||
4056 | 902 | |||
4057 | 903 | // apply UTC | ||
4058 | 904 | setTimeMethods(); | ||
4059 | 905 | |||
4060 | 906 | return defaultOptions; | ||
4061 | 907 | } | ||
4062 | 908 | |||
4063 | 909 | /** | ||
4064 | 910 | * Get the updated default options. Merely exposing defaultOptions for outside modules | ||
4065 | 911 | * isn't enough because the setOptions method creates a new object. | ||
4066 | 912 | */ | ||
4067 | 913 | function getOptions() { | ||
4068 | 914 | return defaultOptions; | ||
4069 | 915 | } | ||
4070 | 916 | |||
4071 | 917 | /** | ||
4072 | 918 | * Discard an element by moving it to the bin and delete | ||
4073 | 919 | * @param {Object} The HTML node to discard | ||
4074 | 920 | */ | ||
4075 | 921 | function discardElement(element) { | ||
4076 | 922 | // create a garbage bin element, not part of the DOM | ||
4077 | 923 | if (!garbageBin) { | ||
4078 | 924 | garbageBin = createElement(DIV); | ||
4079 | 925 | } | ||
4080 | 926 | |||
4081 | 927 | // move the node and empty bin | ||
4082 | 928 | if (element) { | ||
4083 | 929 | garbageBin.appendChild(element); | ||
4084 | 930 | } | ||
4085 | 931 | garbageBin.innerHTML = ''; | ||
4086 | 932 | } | ||
4087 | 933 | |||
4088 | 934 | /* **************************************************************************** | ||
4089 | 935 | * Handle the options * | ||
4090 | 936 | *****************************************************************************/ | ||
4091 | 937 | var | ||
4092 | 938 | |||
4093 | 939 | defaultLabelOptions = { | ||
4094 | 940 | enabled: true, | ||
4095 | 941 | // rotation: 0, | ||
4096 | 942 | align: 'center', | ||
4097 | 943 | x: 0, | ||
4098 | 944 | y: 15, | ||
4099 | 945 | /*formatter: function() { | ||
4100 | 946 | return this.value; | ||
4101 | 947 | },*/ | ||
4102 | 948 | style: { | ||
4103 | 949 | color: '#666', | ||
4104 | 950 | fontSize: '11px', | ||
4105 | 951 | lineHeight: '14px' | ||
4106 | 952 | } | ||
4107 | 953 | }; | ||
4108 | 954 | |||
4109 | 955 | defaultOptions = { | ||
4110 | 956 | colors: ['#4572A7', '#AA4643', '#89A54E', '#80699B', '#3D96AE', | ||
4111 | 957 | '#DB843D', '#92A8CD', '#A47D7C', '#B5CA92'], | ||
4112 | 958 | symbols: ['circle', 'diamond', 'square', 'triangle', 'triangle-down'], | ||
4113 | 959 | lang: { | ||
4114 | 960 | loading: 'Loading...', | ||
4115 | 961 | months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', | ||
4116 | 962 | 'August', 'September', 'October', 'November', 'December'], | ||
4117 | 963 | shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], | ||
4118 | 964 | weekdays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], | ||
4119 | 965 | decimalPoint: '.', | ||
4120 | 966 | resetZoom: 'Reset zoom', | ||
4121 | 967 | resetZoomTitle: 'Reset zoom level 1:1', | ||
4122 | 968 | thousandsSep: ',' | ||
4123 | 969 | }, | ||
4124 | 970 | global: { | ||
4125 | 971 | useUTC: true | ||
4126 | 972 | }, | ||
4127 | 973 | chart: { | ||
4128 | 974 | //animation: true, | ||
4129 | 975 | //alignTicks: false, | ||
4130 | 976 | //reflow: true, | ||
4131 | 977 | //className: null, | ||
4132 | 978 | //events: { load, selection }, | ||
4133 | 979 | //margin: [null], | ||
4134 | 980 | //marginTop: null, | ||
4135 | 981 | //marginRight: null, | ||
4136 | 982 | //marginBottom: null, | ||
4137 | 983 | //marginLeft: null, | ||
4138 | 984 | borderColor: '#4572A7', | ||
4139 | 985 | //borderWidth: 0, | ||
4140 | 986 | borderRadius: 5, | ||
4141 | 987 | defaultSeriesType: 'line', | ||
4142 | 988 | ignoreHiddenSeries: true, | ||
4143 | 989 | //inverted: false, | ||
4144 | 990 | //shadow: false, | ||
4145 | 991 | spacingTop: 10, | ||
4146 | 992 | spacingRight: 10, | ||
4147 | 993 | spacingBottom: 15, | ||
4148 | 994 | spacingLeft: 10, | ||
4149 | 995 | style: { | ||
4150 | 996 | fontFamily: '"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif', // default font | ||
4151 | 997 | fontSize: '12px' | ||
4152 | 998 | }, | ||
4153 | 999 | backgroundColor: '#FFFFFF', | ||
4154 | 1000 | //plotBackgroundColor: null, | ||
4155 | 1001 | plotBorderColor: '#C0C0C0' | ||
4156 | 1002 | //plotBorderWidth: 0, | ||
4157 | 1003 | //plotShadow: false, | ||
4158 | 1004 | //zoomType: '' | ||
4159 | 1005 | }, | ||
4160 | 1006 | title: { | ||
4161 | 1007 | text: 'Chart title', | ||
4162 | 1008 | align: 'center', | ||
4163 | 1009 | // floating: false, | ||
4164 | 1010 | // margin: 15, | ||
4165 | 1011 | // x: 0, | ||
4166 | 1012 | // verticalAlign: 'top', | ||
4167 | 1013 | y: 15, | ||
4168 | 1014 | style: { | ||
4169 | 1015 | color: '#3E576F', | ||
4170 | 1016 | fontSize: '16px' | ||
4171 | 1017 | } | ||
4172 | 1018 | |||
4173 | 1019 | }, | ||
4174 | 1020 | subtitle: { | ||
4175 | 1021 | text: '', | ||
4176 | 1022 | align: 'center', | ||
4177 | 1023 | // floating: false | ||
4178 | 1024 | // x: 0, | ||
4179 | 1025 | // verticalAlign: 'top', | ||
4180 | 1026 | y: 30, | ||
4181 | 1027 | style: { | ||
4182 | 1028 | color: '#6D869F' | ||
4183 | 1029 | } | ||
4184 | 1030 | }, | ||
4185 | 1031 | |||
4186 | 1032 | plotOptions: { | ||
4187 | 1033 | line: { // base series options | ||
4188 | 1034 | allowPointSelect: false, | ||
4189 | 1035 | showCheckbox: false, | ||
4190 | 1036 | animation: { | ||
4191 | 1037 | duration: 1000 | ||
4192 | 1038 | }, | ||
4193 | 1039 | //connectNulls: false, | ||
4194 | 1040 | //cursor: 'default', | ||
4195 | 1041 | //dashStyle: null, | ||
4196 | 1042 | //enableMouseTracking: true, | ||
4197 | 1043 | events: {}, | ||
4198 | 1044 | //legendIndex: 0, | ||
4199 | 1045 | lineWidth: 2, | ||
4200 | 1046 | shadow: true, | ||
4201 | 1047 | // stacking: null, | ||
4202 | 1048 | marker: { | ||
4203 | 1049 | enabled: true, | ||
4204 | 1050 | //symbol: null, | ||
4205 | 1051 | lineWidth: 0, | ||
4206 | 1052 | radius: 4, | ||
4207 | 1053 | lineColor: '#FFFFFF', | ||
4208 | 1054 | //fillColor: null, | ||
4209 | 1055 | states: { // states for a single point | ||
4210 | 1056 | hover: { | ||
4211 | 1057 | //radius: base + 2 | ||
4212 | 1058 | }, | ||
4213 | 1059 | select: { | ||
4214 | 1060 | fillColor: '#FFFFFF', | ||
4215 | 1061 | lineColor: '#000000', | ||
4216 | 1062 | lineWidth: 2 | ||
4217 | 1063 | } | ||
4218 | 1064 | } | ||
4219 | 1065 | }, | ||
4220 | 1066 | point: { | ||
4221 | 1067 | events: {} | ||
4222 | 1068 | }, | ||
4223 | 1069 | dataLabels: merge(defaultLabelOptions, { | ||
4224 | 1070 | enabled: false, | ||
4225 | 1071 | y: -6, | ||
4226 | 1072 | formatter: function () { | ||
4227 | 1073 | return this.y; | ||
4228 | 1074 | } | ||
4229 | 1075 | }), | ||
4230 | 1076 | |||
4231 | 1077 | //pointStart: 0, | ||
4232 | 1078 | //pointInterval: 1, | ||
4233 | 1079 | showInLegend: true, | ||
4234 | 1080 | states: { // states for the entire series | ||
4235 | 1081 | hover: { | ||
4236 | 1082 | //enabled: false, | ||
4237 | 1083 | //lineWidth: base + 1, | ||
4238 | 1084 | marker: { | ||
4239 | 1085 | // lineWidth: base + 1, | ||
4240 | 1086 | // radius: base + 1 | ||
4241 | 1087 | } | ||
4242 | 1088 | }, | ||
4243 | 1089 | select: { | ||
4244 | 1090 | marker: {} | ||
4245 | 1091 | } | ||
4246 | 1092 | }, | ||
4247 | 1093 | stickyTracking: true | ||
4248 | 1094 | //zIndex: null | ||
4249 | 1095 | } | ||
4250 | 1096 | }, | ||
4251 | 1097 | labels: { | ||
4252 | 1098 | //items: [], | ||
4253 | 1099 | style: { | ||
4254 | 1100 | //font: defaultFont, | ||
4255 | 1101 | position: ABSOLUTE, | ||
4256 | 1102 | color: '#3E576F' | ||
4257 | 1103 | } | ||
4258 | 1104 | }, | ||
4259 | 1105 | legend: { | ||
4260 | 1106 | enabled: true, | ||
4261 | 1107 | align: 'center', | ||
4262 | 1108 | //floating: false, | ||
4263 | 1109 | layout: 'horizontal', | ||
4264 | 1110 | labelFormatter: function () { | ||
4265 | 1111 | return this.name; | ||
4266 | 1112 | }, | ||
4267 | 1113 | borderWidth: 1, | ||
4268 | 1114 | borderColor: '#909090', | ||
4269 | 1115 | borderRadius: 5, | ||
4270 | 1116 | // margin: 10, | ||
4271 | 1117 | // reversed: false, | ||
4272 | 1118 | shadow: false, | ||
4273 | 1119 | // backgroundColor: null, | ||
4274 | 1120 | style: { | ||
4275 | 1121 | padding: '5px' | ||
4276 | 1122 | }, | ||
4277 | 1123 | itemStyle: { | ||
4278 | 1124 | cursor: 'pointer', | ||
4279 | 1125 | color: '#3E576F' | ||
4280 | 1126 | }, | ||
4281 | 1127 | itemHoverStyle: { | ||
4282 | 1128 | cursor: 'pointer', | ||
4283 | 1129 | color: '#000000' | ||
4284 | 1130 | }, | ||
4285 | 1131 | itemHiddenStyle: { | ||
4286 | 1132 | color: '#C0C0C0' | ||
4287 | 1133 | }, | ||
4288 | 1134 | itemCheckboxStyle: { | ||
4289 | 1135 | position: ABSOLUTE, | ||
4290 | 1136 | width: '13px', // for IE precision | ||
4291 | 1137 | height: '13px' | ||
4292 | 1138 | }, | ||
4293 | 1139 | // itemWidth: undefined, | ||
4294 | 1140 | symbolWidth: 16, | ||
4295 | 1141 | symbolPadding: 5, | ||
4296 | 1142 | verticalAlign: 'bottom', | ||
4297 | 1143 | // width: undefined, | ||
4298 | 1144 | x: 0, | ||
4299 | 1145 | y: 0 | ||
4300 | 1146 | }, | ||
4301 | 1147 | |||
4302 | 1148 | loading: { | ||
4303 | 1149 | hideDuration: 100, | ||
4304 | 1150 | labelStyle: { | ||
4305 | 1151 | fontWeight: 'bold', | ||
4306 | 1152 | position: RELATIVE, | ||
4307 | 1153 | top: '1em' | ||
4308 | 1154 | }, | ||
4309 | 1155 | showDuration: 100, | ||
4310 | 1156 | style: { | ||
4311 | 1157 | position: ABSOLUTE, | ||
4312 | 1158 | backgroundColor: 'white', | ||
4313 | 1159 | opacity: 0.5, | ||
4314 | 1160 | textAlign: 'center' | ||
4315 | 1161 | } | ||
4316 | 1162 | }, | ||
4317 | 1163 | |||
4318 | 1164 | tooltip: { | ||
4319 | 1165 | enabled: true, | ||
4320 | 1166 | //crosshairs: null, | ||
4321 | 1167 | backgroundColor: 'rgba(255, 255, 255, .85)', | ||
4322 | 1168 | borderWidth: 2, | ||
4323 | 1169 | borderRadius: 5, | ||
4324 | 1170 | //formatter: defaultFormatter, | ||
4325 | 1171 | shadow: true, | ||
4326 | 1172 | //shared: false, | ||
4327 | 1173 | snap: hasTouch ? 25 : 10, | ||
4328 | 1174 | style: { | ||
4329 | 1175 | color: '#333333', | ||
4330 | 1176 | fontSize: '12px', | ||
4331 | 1177 | padding: '5px', | ||
4332 | 1178 | whiteSpace: 'nowrap' | ||
4333 | 1179 | } | ||
4334 | 1180 | }, | ||
4335 | 1181 | |||
4336 | 1182 | toolbar: { | ||
4337 | 1183 | itemStyle: { | ||
4338 | 1184 | color: '#4572A7', | ||
4339 | 1185 | cursor: 'pointer' | ||
4340 | 1186 | } | ||
4341 | 1187 | }, | ||
4342 | 1188 | |||
4343 | 1189 | credits: { | ||
4344 | 1190 | enabled: true, | ||
4345 | 1191 | text: 'Highcharts.com', | ||
4346 | 1192 | href: 'http://www.highcharts.com', | ||
4347 | 1193 | position: { | ||
4348 | 1194 | align: 'right', | ||
4349 | 1195 | x: -10, | ||
4350 | 1196 | verticalAlign: 'bottom', | ||
4351 | 1197 | y: -5 | ||
4352 | 1198 | }, | ||
4353 | 1199 | style: { | ||
4354 | 1200 | cursor: 'pointer', | ||
4355 | 1201 | color: '#909090', | ||
4356 | 1202 | fontSize: '10px' | ||
4357 | 1203 | } | ||
4358 | 1204 | } | ||
4359 | 1205 | }; | ||
4360 | 1206 | |||
4361 | 1207 | // Axis defaults | ||
4362 | 1208 | var defaultXAxisOptions = { | ||
4363 | 1209 | // allowDecimals: null, | ||
4364 | 1210 | // alternateGridColor: null, | ||
4365 | 1211 | // categories: [], | ||
4366 | 1212 | dateTimeLabelFormats: { | ||
4367 | 1213 | second: '%H:%M:%S', | ||
4368 | 1214 | minute: '%H:%M', | ||
4369 | 1215 | hour: '%H:%M', | ||
4370 | 1216 | day: '%e. %b', | ||
4371 | 1217 | week: '%e. %b', | ||
4372 | 1218 | month: '%b \'%y', | ||
4373 | 1219 | year: '%Y' | ||
4374 | 1220 | }, | ||
4375 | 1221 | endOnTick: false, | ||
4376 | 1222 | gridLineColor: '#C0C0C0', | ||
4377 | 1223 | // gridLineDashStyle: 'solid', // docs | ||
4378 | 1224 | // gridLineWidth: 0, | ||
4379 | 1225 | // reversed: false, | ||
4380 | 1226 | |||
4381 | 1227 | labels: defaultLabelOptions, | ||
4382 | 1228 | // { step: null }, | ||
4383 | 1229 | lineColor: '#C0D0E0', | ||
4384 | 1230 | lineWidth: 1, | ||
4385 | 1231 | //linkedTo: null, | ||
4386 | 1232 | max: null, | ||
4387 | 1233 | min: null, | ||
4388 | 1234 | minPadding: 0.01, | ||
4389 | 1235 | maxPadding: 0.01, | ||
4390 | 1236 | //maxZoom: null, | ||
4391 | 1237 | minorGridLineColor: '#E0E0E0', | ||
4392 | 1238 | // minorGridLineDashStyle: null, | ||
4393 | 1239 | minorGridLineWidth: 1, | ||
4394 | 1240 | minorTickColor: '#A0A0A0', | ||
4395 | 1241 | //minorTickInterval: null, | ||
4396 | 1242 | minorTickLength: 2, | ||
4397 | 1243 | minorTickPosition: 'outside', // inside or outside | ||
4398 | 1244 | //minorTickWidth: 0, | ||
4399 | 1245 | //opposite: false, | ||
4400 | 1246 | //offset: 0, | ||
4401 | 1247 | //plotBands: [{ | ||
4402 | 1248 | // events: {}, | ||
4403 | 1249 | // zIndex: 1, | ||
4404 | 1250 | // labels: { align, x, verticalAlign, y, style, rotation, textAlign } | ||
4405 | 1251 | //}], | ||
4406 | 1252 | //plotLines: [{ | ||
4407 | 1253 | // events: {} | ||
4408 | 1254 | // dashStyle: {} | ||
4409 | 1255 | // zIndex: | ||
4410 | 1256 | // labels: { align, x, verticalAlign, y, style, rotation, textAlign } | ||
4411 | 1257 | //}], | ||
4412 | 1258 | //reversed: false, | ||
4413 | 1259 | // showFirstLabel: true, | ||
4414 | 1260 | // showLastLabel: false, | ||
4415 | 1261 | startOfWeek: 1, | ||
4416 | 1262 | startOnTick: false, | ||
4417 | 1263 | tickColor: '#C0D0E0', | ||
4418 | 1264 | //tickInterval: null, | ||
4419 | 1265 | tickLength: 5, | ||
4420 | 1266 | tickmarkPlacement: 'between', // on or between | ||
4421 | 1267 | tickPixelInterval: 100, | ||
4422 | 1268 | tickPosition: 'outside', | ||
4423 | 1269 | tickWidth: 1, | ||
4424 | 1270 | title: { | ||
4425 | 1271 | //text: null, | ||
4426 | 1272 | align: 'middle', // low, middle or high | ||
4427 | 1273 | //margin: 0 for horizontal, 10 for vertical axes, | ||
4428 | 1274 | //rotation: 0, | ||
4429 | 1275 | //side: 'outside', | ||
4430 | 1276 | style: { | ||
4431 | 1277 | color: '#6D869F', | ||
4432 | 1278 | //font: defaultFont.replace('normal', 'bold') | ||
4433 | 1279 | fontWeight: 'bold' | ||
4434 | 1280 | } | ||
4435 | 1281 | //x: 0, | ||
4436 | 1282 | //y: 0 | ||
4437 | 1283 | }, | ||
4438 | 1284 | type: 'linear' // linear, logarithmic or datetime | ||
4439 | 1285 | }, | ||
4440 | 1286 | |||
4441 | 1287 | defaultYAxisOptions = merge(defaultXAxisOptions, { | ||
4442 | 1288 | endOnTick: true, | ||
4443 | 1289 | gridLineWidth: 1, | ||
4444 | 1290 | tickPixelInterval: 72, | ||
4445 | 1291 | showLastLabel: true, | ||
4446 | 1292 | labels: { | ||
4447 | 1293 | align: 'right', | ||
4448 | 1294 | x: -8, | ||
4449 | 1295 | y: 3 | ||
4450 | 1296 | }, | ||
4451 | 1297 | lineWidth: 0, | ||
4452 | 1298 | maxPadding: 0.05, | ||
4453 | 1299 | minPadding: 0.05, | ||
4454 | 1300 | startOnTick: true, | ||
4455 | 1301 | tickWidth: 0, | ||
4456 | 1302 | title: { | ||
4457 | 1303 | rotation: 270, | ||
4458 | 1304 | text: 'Y-values' | ||
4459 | 1305 | }, | ||
4460 | 1306 | stackLabels: { | ||
4461 | 1307 | enabled: false, | ||
4462 | 1308 | //align: dynamic, | ||
4463 | 1309 | //y: dynamic, | ||
4464 | 1310 | //x: dynamic, | ||
4465 | 1311 | //verticalAlign: dynamic, | ||
4466 | 1312 | //textAlign: dynamic, | ||
4467 | 1313 | //rotation: 0, | ||
4468 | 1314 | formatter: function () { | ||
4469 | 1315 | return this.total; | ||
4470 | 1316 | }, | ||
4471 | 1317 | style: defaultLabelOptions.style | ||
4472 | 1318 | } | ||
4473 | 1319 | }), | ||
4474 | 1320 | |||
4475 | 1321 | defaultLeftAxisOptions = { | ||
4476 | 1322 | labels: { | ||
4477 | 1323 | align: 'right', | ||
4478 | 1324 | x: -8, | ||
4479 | 1325 | y: null | ||
4480 | 1326 | }, | ||
4481 | 1327 | title: { | ||
4482 | 1328 | rotation: 270 | ||
4483 | 1329 | } | ||
4484 | 1330 | }, | ||
4485 | 1331 | defaultRightAxisOptions = { | ||
4486 | 1332 | labels: { | ||
4487 | 1333 | align: 'left', | ||
4488 | 1334 | x: 8, | ||
4489 | 1335 | y: null | ||
4490 | 1336 | }, | ||
4491 | 1337 | title: { | ||
4492 | 1338 | rotation: 90 | ||
4493 | 1339 | } | ||
4494 | 1340 | }, | ||
4495 | 1341 | defaultBottomAxisOptions = { // horizontal axis | ||
4496 | 1342 | labels: { | ||
4497 | 1343 | align: 'center', | ||
4498 | 1344 | x: 0, | ||
4499 | 1345 | y: 14 | ||
4500 | 1346 | // staggerLines: null | ||
4501 | 1347 | }, | ||
4502 | 1348 | title: { | ||
4503 | 1349 | rotation: 0 | ||
4504 | 1350 | } | ||
4505 | 1351 | }, | ||
4506 | 1352 | defaultTopAxisOptions = merge(defaultBottomAxisOptions, { | ||
4507 | 1353 | labels: { | ||
4508 | 1354 | y: -5 | ||
4509 | 1355 | // staggerLines: null | ||
4510 | 1356 | } | ||
4511 | 1357 | }); | ||
4512 | 1358 | |||
4513 | 1359 | |||
4514 | 1360 | |||
4515 | 1361 | |||
4516 | 1362 | // Series defaults | ||
4517 | 1363 | var defaultPlotOptions = defaultOptions.plotOptions, | ||
4518 | 1364 | defaultSeriesOptions = defaultPlotOptions.line; | ||
4519 | 1365 | //defaultPlotOptions.line = merge(defaultSeriesOptions); | ||
4520 | 1366 | defaultPlotOptions.spline = merge(defaultSeriesOptions); | ||
4521 | 1367 | defaultPlotOptions.scatter = merge(defaultSeriesOptions, { | ||
4522 | 1368 | lineWidth: 0, | ||
4523 | 1369 | states: { | ||
4524 | 1370 | hover: { | ||
4525 | 1371 | lineWidth: 0 | ||
4526 | 1372 | } | ||
4527 | 1373 | } | ||
4528 | 1374 | }); | ||
4529 | 1375 | defaultPlotOptions.area = merge(defaultSeriesOptions, { | ||
4530 | 1376 | // threshold: 0, | ||
4531 | 1377 | // lineColor: null, // overrides color, but lets fillColor be unaltered | ||
4532 | 1378 | // fillOpacity: 0.75, | ||
4533 | 1379 | // fillColor: null | ||
4534 | 1380 | |||
4535 | 1381 | }); | ||
4536 | 1382 | defaultPlotOptions.areaspline = merge(defaultPlotOptions.area); | ||
4537 | 1383 | defaultPlotOptions.column = merge(defaultSeriesOptions, { | ||
4538 | 1384 | borderColor: '#FFFFFF', | ||
4539 | 1385 | borderWidth: 1, | ||
4540 | 1386 | borderRadius: 0, | ||
4541 | 1387 | //colorByPoint: undefined, | ||
4542 | 1388 | groupPadding: 0.2, | ||
4543 | 1389 | marker: null, // point options are specified in the base options | ||
4544 | 1390 | pointPadding: 0.1, | ||
4545 | 1391 | //pointWidth: null, | ||
4546 | 1392 | minPointLength: 0, | ||
4547 | 1393 | states: { | ||
4548 | 1394 | hover: { | ||
4549 | 1395 | brightness: 0.1, | ||
4550 | 1396 | shadow: false | ||
4551 | 1397 | }, | ||
4552 | 1398 | select: { | ||
4553 | 1399 | color: '#C0C0C0', | ||
4554 | 1400 | borderColor: '#000000', | ||
4555 | 1401 | shadow: false | ||
4556 | 1402 | } | ||
4557 | 1403 | }, | ||
4558 | 1404 | dataLabels: { | ||
4559 | 1405 | y: null, | ||
4560 | 1406 | verticalAlign: null | ||
4561 | 1407 | } | ||
4562 | 1408 | }); | ||
4563 | 1409 | defaultPlotOptions.bar = merge(defaultPlotOptions.column, { | ||
4564 | 1410 | dataLabels: { | ||
4565 | 1411 | align: 'left', | ||
4566 | 1412 | x: 5, | ||
4567 | 1413 | y: 0 | ||
4568 | 1414 | } | ||
4569 | 1415 | }); | ||
4570 | 1416 | defaultPlotOptions.pie = merge(defaultSeriesOptions, { | ||
4571 | 1417 | //dragType: '', // n/a | ||
4572 | 1418 | borderColor: '#FFFFFF', | ||
4573 | 1419 | borderWidth: 1, | ||
4574 | 1420 | center: ['50%', '50%'], | ||
4575 | 1421 | colorByPoint: true, // always true for pies | ||
4576 | 1422 | dataLabels: { | ||
4577 | 1423 | // align: null, | ||
4578 | 1424 | // connectorWidth: 1, | ||
4579 | 1425 | // connectorColor: point.color, | ||
4580 | 1426 | // connectorPadding: 5, | ||
4581 | 1427 | distance: 30, | ||
4582 | 1428 | enabled: true, | ||
4583 | 1429 | formatter: function () { | ||
4584 | 1430 | return this.point.name; | ||
4585 | 1431 | }, | ||
4586 | 1432 | // softConnector: true, | ||
4587 | 1433 | y: 5 | ||
4588 | 1434 | }, | ||
4589 | 1435 | //innerSize: 0, | ||
4590 | 1436 | legendType: 'point', | ||
4591 | 1437 | marker: null, // point options are specified in the base options | ||
4592 | 1438 | size: '75%', | ||
4593 | 1439 | showInLegend: false, | ||
4594 | 1440 | slicedOffset: 10, | ||
4595 | 1441 | states: { | ||
4596 | 1442 | hover: { | ||
4597 | 1443 | brightness: 0.1, | ||
4598 | 1444 | shadow: false | ||
4599 | 1445 | } | ||
4600 | 1446 | } | ||
4601 | 1447 | |||
4602 | 1448 | }); | ||
4603 | 1449 | |||
4604 | 1450 | // set the default time methods | ||
4605 | 1451 | setTimeMethods(); | ||
4606 | 1452 | |||
4607 | 1453 | |||
4608 | 1454 | /** | ||
4609 | 1455 | * Handle color operations. The object methods are chainable. | ||
4610 | 1456 | * @param {String} input The input color in either rbga or hex format | ||
4611 | 1457 | */ | ||
4612 | 1458 | var Color = function (input) { | ||
4613 | 1459 | // declare variables | ||
4614 | 1460 | var rgba = [], result; | ||
4615 | 1461 | |||
4616 | 1462 | /** | ||
4617 | 1463 | * Parse the input color to rgba array | ||
4618 | 1464 | * @param {String} input | ||
4619 | 1465 | */ | ||
4620 | 1466 | function init(input) { | ||
4621 | 1467 | |||
4622 | 1468 | // rgba | ||
4623 | 1469 | result = /rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/.exec(input); | ||
4624 | 1470 | if (result) { | ||
4625 | 1471 | rgba = [pInt(result[1]), pInt(result[2]), pInt(result[3]), parseFloat(result[4], 10)]; | ||
4626 | 1472 | } else { // hex | ||
4627 | 1473 | result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(input); | ||
4628 | 1474 | if (result) { | ||
4629 | 1475 | rgba = [pInt(result[1], 16), pInt(result[2], 16), pInt(result[3], 16), 1]; | ||
4630 | 1476 | } | ||
4631 | 1477 | } | ||
4632 | 1478 | |||
4633 | 1479 | } | ||
4634 | 1480 | /** | ||
4635 | 1481 | * Return the color a specified format | ||
4636 | 1482 | * @param {String} format | ||
4637 | 1483 | */ | ||
4638 | 1484 | function get(format) { | ||
4639 | 1485 | var ret; | ||
4640 | 1486 | |||
4641 | 1487 | // it's NaN if gradient colors on a column chart | ||
4642 | 1488 | if (rgba && !isNaN(rgba[0])) { | ||
4643 | 1489 | if (format === 'rgb') { | ||
4644 | 1490 | ret = 'rgb(' + rgba[0] + ',' + rgba[1] + ',' + rgba[2] + ')'; | ||
4645 | 1491 | } else if (format === 'a') { | ||
4646 | 1492 | ret = rgba[3]; | ||
4647 | 1493 | } else { | ||
4648 | 1494 | ret = 'rgba(' + rgba.join(',') + ')'; | ||
4649 | 1495 | } | ||
4650 | 1496 | } else { | ||
4651 | 1497 | ret = input; | ||
4652 | 1498 | } | ||
4653 | 1499 | return ret; | ||
4654 | 1500 | } | ||
4655 | 1501 | |||
4656 | 1502 | /** | ||
4657 | 1503 | * Brighten the color | ||
4658 | 1504 | * @param {Number} alpha | ||
4659 | 1505 | */ | ||
4660 | 1506 | function brighten(alpha) { | ||
4661 | 1507 | if (isNumber(alpha) && alpha !== 0) { | ||
4662 | 1508 | var i; | ||
4663 | 1509 | for (i = 0; i < 3; i++) { | ||
4664 | 1510 | rgba[i] += pInt(alpha * 255); | ||
4665 | 1511 | |||
4666 | 1512 | if (rgba[i] < 0) { | ||
4667 | 1513 | rgba[i] = 0; | ||
4668 | 1514 | } | ||
4669 | 1515 | if (rgba[i] > 255) { | ||
4670 | 1516 | rgba[i] = 255; | ||
4671 | 1517 | } | ||
4672 | 1518 | } | ||
4673 | 1519 | } | ||
4674 | 1520 | return this; | ||
4675 | 1521 | } | ||
4676 | 1522 | /** | ||
4677 | 1523 | * Set the color's opacity to a given alpha value | ||
4678 | 1524 | * @param {Number} alpha | ||
4679 | 1525 | */ | ||
4680 | 1526 | function setOpacity(alpha) { | ||
4681 | 1527 | rgba[3] = alpha; | ||
4682 | 1528 | return this; | ||
4683 | 1529 | } | ||
4684 | 1530 | |||
4685 | 1531 | // initialize: parse the input | ||
4686 | 1532 | init(input); | ||
4687 | 1533 | |||
4688 | 1534 | // public methods | ||
4689 | 1535 | return { | ||
4690 | 1536 | get: get, | ||
4691 | 1537 | brighten: brighten, | ||
4692 | 1538 | setOpacity: setOpacity | ||
4693 | 1539 | }; | ||
4694 | 1540 | }; | ||
4695 | 1541 | |||
4696 | 1542 | /** | ||
4697 | 1543 | * A wrapper object for SVG elements | ||
4698 | 1544 | */ | ||
4699 | 1545 | function SVGElement() {} | ||
4700 | 1546 | |||
4701 | 1547 | SVGElement.prototype = { | ||
4702 | 1548 | /** | ||
4703 | 1549 | * Initialize the SVG renderer | ||
4704 | 1550 | * @param {Object} renderer | ||
4705 | 1551 | * @param {String} nodeName | ||
4706 | 1552 | */ | ||
4707 | 1553 | init: function (renderer, nodeName) { | ||
4708 | 1554 | this.element = doc.createElementNS(SVG_NS, nodeName); | ||
4709 | 1555 | this.renderer = renderer; | ||
4710 | 1556 | }, | ||
4711 | 1557 | /** | ||
4712 | 1558 | * Animate a given attribute | ||
4713 | 1559 | * @param {Object} params | ||
4714 | 1560 | * @param {Number} options The same options as in jQuery animation | ||
4715 | 1561 | * @param {Function} complete Function to perform at the end of animation | ||
4716 | 1562 | */ | ||
4717 | 1563 | animate: function (params, options, complete) { | ||
4718 | 1564 | var animOptions = pick(options, globalAnimation, true); | ||
4719 | 1565 | if (animOptions) { | ||
4720 | 1566 | animOptions = merge(animOptions); | ||
4721 | 1567 | if (complete) { // allows using a callback with the global animation without overwriting it | ||
4722 | 1568 | animOptions.complete = complete; | ||
4723 | 1569 | } | ||
4724 | 1570 | animate(this, params, animOptions); | ||
4725 | 1571 | } else { | ||
4726 | 1572 | this.attr(params); | ||
4727 | 1573 | if (complete) { | ||
4728 | 1574 | complete(); | ||
4729 | 1575 | } | ||
4730 | 1576 | } | ||
4731 | 1577 | }, | ||
4732 | 1578 | /** | ||
4733 | 1579 | * Set or get a given attribute | ||
4734 | 1580 | * @param {Object|String} hash | ||
4735 | 1581 | * @param {Mixed|Undefined} val | ||
4736 | 1582 | */ | ||
4737 | 1583 | attr: function (hash, val) { | ||
4738 | 1584 | var key, | ||
4739 | 1585 | value, | ||
4740 | 1586 | i, | ||
4741 | 1587 | child, | ||
4742 | 1588 | element = this.element, | ||
4743 | 1589 | nodeName = element.nodeName, | ||
4744 | 1590 | renderer = this.renderer, | ||
4745 | 1591 | skipAttr, | ||
4746 | 1592 | shadows = this.shadows, | ||
4747 | 1593 | htmlNode = this.htmlNode, | ||
4748 | 1594 | hasSetSymbolSize, | ||
4749 | 1595 | ret = this; | ||
4750 | 1596 | |||
4751 | 1597 | // single key-value pair | ||
4752 | 1598 | if (isString(hash) && defined(val)) { | ||
4753 | 1599 | key = hash; | ||
4754 | 1600 | hash = {}; | ||
4755 | 1601 | hash[key] = val; | ||
4756 | 1602 | } | ||
4757 | 1603 | |||
4758 | 1604 | // used as a getter: first argument is a string, second is undefined | ||
4759 | 1605 | if (isString(hash)) { | ||
4760 | 1606 | key = hash; | ||
4761 | 1607 | if (nodeName === 'circle') { | ||
4762 | 1608 | key = { x: 'cx', y: 'cy' }[key] || key; | ||
4763 | 1609 | } else if (key === 'strokeWidth') { | ||
4764 | 1610 | key = 'stroke-width'; | ||
4765 | 1611 | } | ||
4766 | 1612 | ret = attr(element, key) || this[key] || 0; | ||
4767 | 1613 | |||
4768 | 1614 | if (key !== 'd' && key !== 'visibility') { // 'd' is string in animation step | ||
4769 | 1615 | ret = parseFloat(ret); | ||
4770 | 1616 | } | ||
4771 | 1617 | |||
4772 | 1618 | // setter | ||
4773 | 1619 | } else { | ||
4774 | 1620 | |||
4775 | 1621 | for (key in hash) { | ||
4776 | 1622 | skipAttr = false; // reset | ||
4777 | 1623 | value = hash[key]; | ||
4778 | 1624 | |||
4779 | 1625 | // paths | ||
4780 | 1626 | if (key === 'd') { | ||
4781 | 1627 | if (value && value.join) { // join path | ||
4782 | 1628 | value = value.join(' '); | ||
4783 | 1629 | } | ||
4784 | 1630 | if (/(NaN| {2}|^$)/.test(value)) { | ||
4785 | 1631 | value = 'M 0 0'; | ||
4786 | 1632 | } | ||
4787 | 1633 | this.d = value; // shortcut for animations | ||
4788 | 1634 | |||
4789 | 1635 | // update child tspans x values | ||
4790 | 1636 | } else if (key === 'x' && nodeName === 'text') { | ||
4791 | 1637 | for (i = 0; i < element.childNodes.length; i++) { | ||
4792 | 1638 | child = element.childNodes[i]; | ||
4793 | 1639 | // if the x values are equal, the tspan represents a linebreak | ||
4794 | 1640 | if (attr(child, 'x') === attr(element, 'x')) { | ||
4795 | 1641 | //child.setAttribute('x', value); | ||
4796 | 1642 | attr(child, 'x', value); | ||
4797 | 1643 | } | ||
4798 | 1644 | } | ||
4799 | 1645 | |||
4800 | 1646 | if (this.rotation) { | ||
4801 | 1647 | attr(element, 'transform', 'rotate(' + this.rotation + ' ' + value + ' ' + | ||
4802 | 1648 | pInt(hash.y || attr(element, 'y')) + ')'); | ||
4803 | 1649 | } | ||
4804 | 1650 | |||
4805 | 1651 | // apply gradients | ||
4806 | 1652 | } else if (key === 'fill') { | ||
4807 | 1653 | value = renderer.color(value, element, key); | ||
4808 | 1654 | |||
4809 | 1655 | // circle x and y | ||
4810 | 1656 | } else if (nodeName === 'circle' && (key === 'x' || key === 'y')) { | ||
4811 | 1657 | key = { x: 'cx', y: 'cy' }[key] || key; | ||
4812 | 1658 | |||
4813 | 1659 | // translation and text rotation | ||
4814 | 1660 | } else if (key === 'translateX' || key === 'translateY' || key === 'rotation' || key === 'verticalAlign') { | ||
4815 | 1661 | this[key] = value; | ||
4816 | 1662 | this.updateTransform(); | ||
4817 | 1663 | skipAttr = true; | ||
4818 | 1664 | |||
4819 | 1665 | // apply opacity as subnode (required by legacy WebKit and Batik) | ||
4820 | 1666 | } else if (key === 'stroke') { | ||
4821 | 1667 | value = renderer.color(value, element, key); | ||
4822 | 1668 | |||
4823 | 1669 | // emulate VML's dashstyle implementation | ||
4824 | 1670 | } else if (key === 'dashstyle') { | ||
4825 | 1671 | key = 'stroke-dasharray'; | ||
4826 | 1672 | value = value && value.toLowerCase(); | ||
4827 | 1673 | if (value === 'solid') { | ||
4828 | 1674 | value = NONE; | ||
4829 | 1675 | } else if (value) { | ||
4830 | 1676 | value = value | ||
4831 | 1677 | .replace('shortdashdotdot', '3,1,1,1,1,1,') | ||
4832 | 1678 | .replace('shortdashdot', '3,1,1,1') | ||
4833 | 1679 | .replace('shortdot', '1,1,') | ||
4834 | 1680 | .replace('shortdash', '3,1,') | ||
4835 | 1681 | .replace('longdash', '8,3,') | ||
4836 | 1682 | .replace(/dot/g, '1,3,') | ||
4837 | 1683 | .replace('dash', '4,3,') | ||
4838 | 1684 | .replace(/,$/, '') | ||
4839 | 1685 | .split(','); // ending comma | ||
4840 | 1686 | |||
4841 | 1687 | i = value.length; | ||
4842 | 1688 | while (i--) { | ||
4843 | 1689 | value[i] = pInt(value[i]) * hash['stroke-width']; | ||
4844 | 1690 | } | ||
4845 | 1691 | |||
4846 | 1692 | value = value.join(','); | ||
4847 | 1693 | } | ||
4848 | 1694 | |||
4849 | 1695 | // special | ||
4850 | 1696 | } else if (key === 'isTracker') { | ||
4851 | 1697 | this[key] = value; | ||
4852 | 1698 | |||
4853 | 1699 | // IE9/MooTools combo: MooTools returns objects instead of numbers and IE9 Beta 2 | ||
4854 | 1700 | // is unable to cast them. Test again with final IE9. | ||
4855 | 1701 | } else if (key === 'width') { | ||
4856 | 1702 | value = pInt(value); | ||
4857 | 1703 | |||
4858 | 1704 | // Text alignment | ||
4859 | 1705 | } else if (key === 'align') { | ||
4860 | 1706 | key = 'text-anchor'; | ||
4861 | 1707 | value = { left: 'start', center: 'middle', right: 'end' }[value]; | ||
4862 | 1708 | |||
4863 | 1709 | |||
4864 | 1710 | // Title requires a subnode, #431 | ||
4865 | 1711 | } else if (key === 'title') { | ||
4866 | 1712 | var title = doc.createElementNS(SVG_NS, 'title'); | ||
4867 | 1713 | title.appendChild(doc.createTextNode(value)); | ||
4868 | 1714 | element.appendChild(title); | ||
4869 | 1715 | } | ||
4870 | 1716 | |||
4871 | 1717 | |||
4872 | 1718 | |||
4873 | 1719 | // jQuery animate changes case | ||
4874 | 1720 | if (key === 'strokeWidth') { | ||
4875 | 1721 | key = 'stroke-width'; | ||
4876 | 1722 | } | ||
4877 | 1723 | |||
4878 | 1724 | // Chrome/Win < 6 bug (http://code.google.com/p/chromium/issues/detail?id=15461) | ||
4879 | 1725 | if (isWebKit && key === 'stroke-width' && value === 0) { | ||
4880 | 1726 | value = 0.000001; | ||
4881 | 1727 | } | ||
4882 | 1728 | |||
4883 | 1729 | // symbols | ||
4884 | 1730 | if (this.symbolName && /^(x|y|r|start|end|innerR)/.test(key)) { | ||
4885 | 1731 | |||
4886 | 1732 | |||
4887 | 1733 | if (!hasSetSymbolSize) { | ||
4888 | 1734 | this.symbolAttr(hash); | ||
4889 | 1735 | hasSetSymbolSize = true; | ||
4890 | 1736 | } | ||
4891 | 1737 | skipAttr = true; | ||
4892 | 1738 | } | ||
4893 | 1739 | |||
4894 | 1740 | // let the shadow follow the main element | ||
4895 | 1741 | if (shadows && /^(width|height|visibility|x|y|d)$/.test(key)) { | ||
4896 | 1742 | i = shadows.length; | ||
4897 | 1743 | while (i--) { | ||
4898 | 1744 | attr(shadows[i], key, value); | ||
4899 | 1745 | } | ||
4900 | 1746 | } | ||
4901 | 1747 | |||
4902 | 1748 | // validate heights | ||
4903 | 1749 | if ((key === 'width' || key === 'height') && nodeName === 'rect' && value < 0) { | ||
4904 | 1750 | value = 0; | ||
4905 | 1751 | } | ||
4906 | 1752 | |||
4907 | 1753 | if (key === 'text') { | ||
4908 | 1754 | // only one node allowed | ||
4909 | 1755 | this.textStr = value; | ||
4910 | 1756 | if (this.added) { | ||
4911 | 1757 | renderer.buildText(this); | ||
4912 | 1758 | } | ||
4913 | 1759 | } else if (!skipAttr) { | ||
4914 | 1760 | //element.setAttribute(key, value); | ||
4915 | 1761 | attr(element, key, value); | ||
4916 | 1762 | } | ||
4917 | 1763 | |||
4918 | 1764 | // Issue #38 | ||
4919 | 1765 | if (htmlNode && (key === 'x' || key === 'y' || | ||
4920 | 1766 | key === 'translateX' || key === 'translateY' || key === 'visibility')) { | ||
4921 | 1767 | var wrapper = this, | ||
4922 | 1768 | bBox, | ||
4923 | 1769 | arr = htmlNode.length ? htmlNode : [this], | ||
4924 | 1770 | length = arr.length, | ||
4925 | 1771 | itemWrapper, | ||
4926 | 1772 | j; | ||
4927 | 1773 | |||
4928 | 1774 | for (j = 0; j < length; j++) { | ||
4929 | 1775 | itemWrapper = arr[j]; | ||
4930 | 1776 | bBox = itemWrapper.getBBox(); | ||
4931 | 1777 | htmlNode = itemWrapper.htmlNode; // reassign to child item | ||
4932 | 1778 | css(htmlNode, extend(wrapper.styles, { | ||
4933 | 1779 | left: (bBox.x + (wrapper.translateX || 0)) + PX, | ||
4934 | 1780 | top: (bBox.y + (wrapper.translateY || 0)) + PX | ||
4935 | 1781 | })); | ||
4936 | 1782 | |||
4937 | 1783 | if (key === 'visibility') { | ||
4938 | 1784 | css(htmlNode, { | ||
4939 | 1785 | visibility: value | ||
4940 | 1786 | }); | ||
4941 | 1787 | } | ||
4942 | 1788 | } | ||
4943 | 1789 | } | ||
4944 | 1790 | |||
4945 | 1791 | } | ||
4946 | 1792 | |||
4947 | 1793 | } | ||
4948 | 1794 | return ret; | ||
4949 | 1795 | }, | ||
4950 | 1796 | |||
4951 | 1797 | /** | ||
4952 | 1798 | * If one of the symbol size affecting parameters are changed, | ||
4953 | 1799 | * check all the others only once for each call to an element's | ||
4954 | 1800 | * .attr() method | ||
4955 | 1801 | * @param {Object} hash | ||
4956 | 1802 | */ | ||
4957 | 1803 | symbolAttr: function (hash) { | ||
4958 | 1804 | var wrapper = this; | ||
4959 | 1805 | |||
4960 | 1806 | each(['x', 'y', 'r', 'start', 'end', 'width', 'height', 'innerR'], function (key) { | ||
4961 | 1807 | wrapper[key] = pick(hash[key], wrapper[key]); | ||
4962 | 1808 | }); | ||
4963 | 1809 | |||
4964 | 1810 | wrapper.attr({ | ||
4965 | 1811 | d: wrapper.renderer.symbols[wrapper.symbolName]( | ||
4966 | 1812 | mathRound(wrapper.x * 2) / 2, // Round to halves. Issue #274. | ||
4967 | 1813 | mathRound(wrapper.y * 2) / 2, | ||
4968 | 1814 | wrapper.r, | ||
4969 | 1815 | { | ||
4970 | 1816 | start: wrapper.start, | ||
4971 | 1817 | end: wrapper.end, | ||
4972 | 1818 | width: wrapper.width, | ||
4973 | 1819 | height: wrapper.height, | ||
4974 | 1820 | innerR: wrapper.innerR | ||
4975 | 1821 | } | ||
4976 | 1822 | ) | ||
4977 | 1823 | }); | ||
4978 | 1824 | }, | ||
4979 | 1825 | |||
4980 | 1826 | /** | ||
4981 | 1827 | * Apply a clipping path to this object | ||
4982 | 1828 | * @param {String} id | ||
4983 | 1829 | */ | ||
4984 | 1830 | clip: function (clipRect) { | ||
4985 | 1831 | return this.attr('clip-path', 'url(' + this.renderer.url + '#' + clipRect.id + ')'); | ||
4986 | 1832 | }, | ||
4987 | 1833 | |||
4988 | 1834 | /** | ||
4989 | 1835 | * Calculate the coordinates needed for drawing a rectangle crisply and return the | ||
4990 | 1836 | * calculated attributes | ||
4991 | 1837 | * @param {Number} strokeWidth | ||
4992 | 1838 | * @param {Number} x | ||
4993 | 1839 | * @param {Number} y | ||
4994 | 1840 | * @param {Number} width | ||
4995 | 1841 | * @param {Number} height | ||
4996 | 1842 | */ | ||
4997 | 1843 | crisp: function (strokeWidth, x, y, width, height) { | ||
4998 | 1844 | |||
4999 | 1845 | var wrapper = this, | ||
5000 | 1846 | key, |
I forgot to check wlscreens and fancybox.js