Merge lp:~openerp-dev/openerp-web/trunk-graphview-ged into lp:openerp-web

Proposed by Géry Debongnie
Status: Work in progress
Proposed branch: lp:~openerp-dev/openerp-web/trunk-graphview-ged
Merge into: lp:openerp-web
Diff against target: 54324 lines (+27858/-26037)
67 files modified
addons/web/static/src/js/data.js (+1/-1)
addons/web_graph/__openerp__.py (+5/-32)
addons/web_graph/static/lib/bootstrap/bootstrap.js (+1992/-0)
addons/web_graph/static/lib/dropdown.js (+0/-92)
addons/web_graph/static/lib/flotr2/LICENSE (+0/-19)
addons/web_graph/static/lib/flotr2/Makefile (+0/-40)
addons/web_graph/static/lib/flotr2/README.md (+0/-89)
addons/web_graph/static/lib/flotr2/dev/notes.txt (+0/-86)
addons/web_graph/static/lib/flotr2/flotr2.examples.min.js (+0/-2)
addons/web_graph/static/lib/flotr2/flotr2.examples.types.js (+0/-1425)
addons/web_graph/static/lib/flotr2/flotr2.ie.min.js (+0/-33)
addons/web_graph/static/lib/flotr2/flotr2.js (+0/-6865)
addons/web_graph/static/lib/flotr2/flotr2.min.js (+0/-27)
addons/web_graph/static/lib/flotr2/js/Axis.js (+0/-303)
addons/web_graph/static/lib/flotr2/js/Color.js (+0/-163)
addons/web_graph/static/lib/flotr2/js/DOM.js (+0/-88)
addons/web_graph/static/lib/flotr2/js/Date.js (+0/-207)
addons/web_graph/static/lib/flotr2/js/DefaultOptions.js (+0/-98)
addons/web_graph/static/lib/flotr2/js/EventAdapter.js (+0/-52)
addons/web_graph/static/lib/flotr2/js/Flotr.js (+0/-250)
addons/web_graph/static/lib/flotr2/js/Graph.js (+0/-745)
addons/web_graph/static/lib/flotr2/js/Series.js (+0/-74)
addons/web_graph/static/lib/flotr2/js/Text.js (+0/-88)
addons/web_graph/static/lib/flotr2/js/plugins/crosshair.js (+0/-84)
addons/web_graph/static/lib/flotr2/js/plugins/download.js (+0/-51)
addons/web_graph/static/lib/flotr2/js/plugins/grid.js (+0/-208)
addons/web_graph/static/lib/flotr2/js/plugins/handles.js (+0/-199)
addons/web_graph/static/lib/flotr2/js/plugins/hit.js (+0/-337)
addons/web_graph/static/lib/flotr2/js/plugins/labels.js (+0/-227)
addons/web_graph/static/lib/flotr2/js/plugins/legend.js (+0/-179)
addons/web_graph/static/lib/flotr2/js/plugins/selection.js (+0/-278)
addons/web_graph/static/lib/flotr2/js/plugins/spreadsheet.js (+0/-296)
addons/web_graph/static/lib/flotr2/js/plugins/titles.js (+0/-177)
addons/web_graph/static/lib/flotr2/js/types/bars.js (+0/-274)
addons/web_graph/static/lib/flotr2/js/types/bubbles.js (+0/-119)
addons/web_graph/static/lib/flotr2/js/types/candles.js (+0/-127)
addons/web_graph/static/lib/flotr2/js/types/gantt.js (+0/-229)
addons/web_graph/static/lib/flotr2/js/types/lines.js (+0/-275)
addons/web_graph/static/lib/flotr2/js/types/markers.js (+0/-140)
addons/web_graph/static/lib/flotr2/js/types/pie.js (+0/-210)
addons/web_graph/static/lib/flotr2/js/types/points.js (+0/-66)
addons/web_graph/static/lib/flotr2/js/types/radar.js (+0/-60)
addons/web_graph/static/lib/flotr2/js/types/timeline.js (+0/-90)
addons/web_graph/static/lib/flotr2/lib/base64.js (+0/-113)
addons/web_graph/static/lib/flotr2/lib/bean-min.js (+0/-10)
addons/web_graph/static/lib/flotr2/lib/bean.js (+0/-501)
addons/web_graph/static/lib/flotr2/lib/canvas2image.js (+0/-198)
addons/web_graph/static/lib/flotr2/lib/canvastext.js (+0/-429)
addons/web_graph/static/lib/flotr2/lib/excanvas.js (+0/-1425)
addons/web_graph/static/lib/flotr2/lib/imagediff.js (+0/-343)
addons/web_graph/static/lib/flotr2/lib/jasmine/MIT.LICENSE (+0/-20)
addons/web_graph/static/lib/flotr2/lib/jasmine/jasmine-html.js (+0/-190)
addons/web_graph/static/lib/flotr2/lib/jasmine/jasmine.css (+0/-166)
addons/web_graph/static/lib/flotr2/lib/jasmine/jasmine.js (+0/-2476)
addons/web_graph/static/lib/flotr2/lib/prototype.js (+0/-4320)
addons/web_graph/static/lib/flotr2/lib/underscore-min.js (+0/-27)
addons/web_graph/static/lib/flotr2/lib/underscore.js (+0/-839)
addons/web_graph/static/lib/flotr2/lib/yepnope.js (+0/-1)
addons/web_graph/static/lib/nvd3/d3.v3.js (+8436/-0)
addons/web_graph/static/lib/nvd3/nv.d3.js (+14303/-0)
addons/web_graph/static/src/css/bootstrap.css (+1560/-0)
addons/web_graph/static/src/css/flotr2.css (+0/-69)
addons/web_graph/static/src/css/graph.css (+57/-76)
addons/web_graph/static/src/css/nv.d3.css (+769/-0)
addons/web_graph/static/src/fonts/glyphicons-halflings-regular.svg (+229/-0)
addons/web_graph/static/src/js/graph.js (+460/-393)
addons/web_graph/static/src/xml/web_graph.xml (+46/-36)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/trunk-graphview-ged
Reviewer Review Type Date Requested Status
OpenERP R&D Web Team Pending
Review via email: mp+193414@code.launchpad.net
To post a comment you must log in.
3906. By Géry Debongnie

[REF] very small code improvements in addon web_graph

3907. By Géry Debongnie

[FIX] fixes a bug in method subgroup, in data.js (web client). it was getting the wrong context

3908. By Géry Debongnie

[IMP] first pass at supporting multiples groupings, in x coordinates (addon web_graph)

3909. By Géry Debongnie

[ADD] add bootstrap library to web_graph addon. (customized minimalist version)

3910. By Géry Debongnie

[FIX] better handling of default groupings in web_graph addon

3911. By Géry Debongnie

[IMP] improves bar chart display in web_graph addon

3912. By Géry Debongnie

[IMP] slightly improve look when displaying charts in addon web_graph

3913. By Géry Debongnie

[FIX] add bootstrap.js file to module import (web_graph)

3914. By Géry Debongnie

[IMP] add button dropdown to chart view interface (module web_graph)

3915. By Géry Debongnie

[IMP] add button dropdown to select measure (module web_graph)

3916. By Géry Debongnie

[IMP] add row and columns buttons in graph view (addon web_graph)

3917. By Géry Debongnie

[IMP] add important fields to row and columns buttons in graph view (addon web_graph)

3918. By Géry Debongnie

[IMP] add clear columns and clear rows field to row and columns buttons in graph view (addon web_graph)

3919. By Géry Debongnie

[IMP] correct code to detect fields to display in row and col buttons in graph view (addon web_graph)

3920. By Géry Debongnie

[IMP] properly handles the case when there are no groupbys defined (graph view, addon web_graph)

3921. By Géry Debongnie

[IMP] work in progress. implementing multidimensional table view in graph view (module web_graph)

3922. By Géry Debongnie

[IMP] work in progress. implementing multidimensional table view in graph view (module web_graph)

3923. By Géry Debongnie

[IMP] implement the headers rendering in table view (in graph_view) (addon web_graph)

Unmerged revisions

3923. By Géry Debongnie

[IMP] implement the headers rendering in table view (in graph_view) (addon web_graph)

3922. By Géry Debongnie

[IMP] work in progress. implementing multidimensional table view in graph view (module web_graph)

3921. By Géry Debongnie

[IMP] work in progress. implementing multidimensional table view in graph view (module web_graph)

3920. By Géry Debongnie

[IMP] properly handles the case when there are no groupbys defined (graph view, addon web_graph)

3919. By Géry Debongnie

[IMP] correct code to detect fields to display in row and col buttons in graph view (addon web_graph)

3918. By Géry Debongnie

[IMP] add clear columns and clear rows field to row and columns buttons in graph view (addon web_graph)

3917. By Géry Debongnie

[IMP] add important fields to row and columns buttons in graph view (addon web_graph)

3916. By Géry Debongnie

[IMP] add row and columns buttons in graph view (addon web_graph)

3915. By Géry Debongnie

[IMP] add button dropdown to select measure (module web_graph)

3914. By Géry Debongnie

[IMP] add button dropdown to chart view interface (module web_graph)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/web/static/src/js/data.js'
2--- addons/web/static/src/js/data.js 2013-09-10 12:52:23 +0000
3+++ addons/web/static/src/js/data.js 2013-11-07 14:49:39 +0000
4@@ -249,7 +249,7 @@
5 return this.attributes[key];
6 },
7 subgroups: function () {
8- return this.model.query().group_by(this.model.context().group_by);
9+ return this.model.query().group_by(this.model._context.group_by);
10 },
11 query: function () {
12 return this.model.query.apply(this.model, arguments);
13
14=== modified file 'addons/web_graph/__openerp__.py'
15--- addons/web_graph/__openerp__.py 2012-08-22 13:03:36 +0000
16+++ addons/web_graph/__openerp__.py 2013-11-07 14:49:39 +0000
17@@ -15,38 +15,10 @@
18 'version': '3.0',
19 'depends': ['web'],
20 'js': [
21- 'static/lib/dropdown.js',
22- 'static/lib/flotr2/lib/bean.js',
23- 'static/lib/flotr2/js/Flotr.js',
24- 'static/lib/flotr2/js/DefaultOptions.js',
25- 'static/lib/flotr2/js/Color.js',
26- 'static/lib/flotr2/js/Date.js',
27- 'static/lib/flotr2/js/DOM.js',
28- 'static/lib/flotr2/js/EventAdapter.js',
29- 'static/lib/flotr2/js/Text.js',
30- 'static/lib/flotr2/js/Graph.js',
31- 'static/lib/flotr2/js/Axis.js',
32- 'static/lib/flotr2/js/Series.js',
33- 'static/lib/flotr2/js/types/lines.js',
34- 'static/lib/flotr2/js/types/bars.js',
35- 'static/lib/flotr2/js/types/bubbles.js',
36- 'static/lib/flotr2/js/types/candles.js',
37- 'static/lib/flotr2/js/types/gantt.js',
38- 'static/lib/flotr2/js/types/markers.js',
39- 'static/lib/flotr2/js/types/pie.js',
40- 'static/lib/flotr2/js/types/points.js',
41- 'static/lib/flotr2/js/types/radar.js',
42- 'static/lib/flotr2/js/types/timeline.js',
43- 'static/lib/flotr2/js/plugins/crosshair.js',
44- 'static/lib/flotr2/js/plugins/download.js',
45- 'static/lib/flotr2/js/plugins/grid.js',
46- 'static/lib/flotr2/js/plugins/hit.js',
47- 'static/lib/flotr2/js/plugins/selection.js',
48- 'static/lib/flotr2/js/plugins/labels.js',
49- 'static/lib/flotr2/js/plugins/legend.js',
50- 'static/lib/flotr2/js/plugins/spreadsheet.js',
51- 'static/lib/flotr2/js/plugins/titles.js',
52- 'static/src/js/graph.js'
53+ 'static/lib/nvd3/d3.v3.js',
54+ 'static/lib/nvd3/nv.d3.js',
55+ 'static/src/js/graph.js',
56+ 'static/lib/bootstrap/bootstrap.js',
57 ],
58 'css': [
59 'static/src/css/*.css',
60@@ -56,3 +28,4 @@
61 ],
62 'auto_install': True
63 }
64+
65
66=== added directory 'addons/web_graph/static/lib/bootstrap'
67=== added file 'addons/web_graph/static/lib/bootstrap/bootstrap.js'
68--- addons/web_graph/static/lib/bootstrap/bootstrap.js 1970-01-01 00:00:00 +0000
69+++ addons/web_graph/static/lib/bootstrap/bootstrap.js 2013-11-07 14:49:39 +0000
70@@ -0,0 +1,1992 @@
71+/* ========================================================================
72+ * Bootstrap: alert.js v3.0.0
73+ * http://getbootstrap.com/javascript/#alerts
74+ * ========================================================================
75+ * Copyright 2013 Twitter, Inc.
76+ *
77+ * Licensed under the Apache License, Version 2.0 (the "License");
78+ * you may not use this file except in compliance with the License.
79+ * You may obtain a copy of the License at
80+ *
81+ * http://www.apache.org/licenses/LICENSE-2.0
82+ *
83+ * Unless required by applicable law or agreed to in writing, software
84+ * distributed under the License is distributed on an "AS IS" BASIS,
85+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
86+ * See the License for the specific language governing permissions and
87+ * limitations under the License.
88+ * ======================================================================== */
89+
90+
91++function ($) { "use strict";
92+
93+ // ALERT CLASS DEFINITION
94+ // ======================
95+
96+ var dismiss = '[data-dismiss="alert"]'
97+ var Alert = function (el) {
98+ $(el).on('click', dismiss, this.close)
99+ }
100+
101+ Alert.prototype.close = function (e) {
102+ var $this = $(this)
103+ var selector = $this.attr('data-target')
104+
105+ if (!selector) {
106+ selector = $this.attr('href')
107+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
108+ }
109+
110+ var $parent = $(selector)
111+
112+ if (e) e.preventDefault()
113+
114+ if (!$parent.length) {
115+ $parent = $this.hasClass('alert') ? $this : $this.parent()
116+ }
117+
118+ $parent.trigger(e = $.Event('close.bs.alert'))
119+
120+ if (e.isDefaultPrevented()) return
121+
122+ $parent.removeClass('in')
123+
124+ function removeElement() {
125+ $parent.trigger('closed.bs.alert').remove()
126+ }
127+
128+ $.support.transition && $parent.hasClass('fade') ?
129+ $parent
130+ .one($.support.transition.end, removeElement)
131+ .emulateTransitionEnd(150) :
132+ removeElement()
133+ }
134+
135+
136+ // ALERT PLUGIN DEFINITION
137+ // =======================
138+
139+ var old = $.fn.alert
140+
141+ $.fn.alert = function (option) {
142+ return this.each(function () {
143+ var $this = $(this)
144+ var data = $this.data('bs.alert')
145+
146+ if (!data) $this.data('bs.alert', (data = new Alert(this)))
147+ if (typeof option == 'string') data[option].call($this)
148+ })
149+ }
150+
151+ $.fn.alert.Constructor = Alert
152+
153+
154+ // ALERT NO CONFLICT
155+ // =================
156+
157+ $.fn.alert.noConflict = function () {
158+ $.fn.alert = old
159+ return this
160+ }
161+
162+
163+ // ALERT DATA-API
164+ // ==============
165+
166+ $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
167+
168+}(window.jQuery);
169+
170+/* ========================================================================
171+ * Bootstrap: button.js v3.0.0
172+ * http://getbootstrap.com/javascript/#buttons
173+ * ========================================================================
174+ * Copyright 2013 Twitter, Inc.
175+ *
176+ * Licensed under the Apache License, Version 2.0 (the "License");
177+ * you may not use this file except in compliance with the License.
178+ * You may obtain a copy of the License at
179+ *
180+ * http://www.apache.org/licenses/LICENSE-2.0
181+ *
182+ * Unless required by applicable law or agreed to in writing, software
183+ * distributed under the License is distributed on an "AS IS" BASIS,
184+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
185+ * See the License for the specific language governing permissions and
186+ * limitations under the License.
187+ * ======================================================================== */
188+
189+
190++function ($) { "use strict";
191+
192+ // BUTTON PUBLIC CLASS DEFINITION
193+ // ==============================
194+
195+ var Button = function (element, options) {
196+ this.$element = $(element)
197+ this.options = $.extend({}, Button.DEFAULTS, options)
198+ }
199+
200+ Button.DEFAULTS = {
201+ loadingText: 'loading...'
202+ }
203+
204+ Button.prototype.setState = function (state) {
205+ var d = 'disabled'
206+ var $el = this.$element
207+ var val = $el.is('input') ? 'val' : 'html'
208+ var data = $el.data()
209+
210+ state = state + 'Text'
211+
212+ if (!data.resetText) $el.data('resetText', $el[val]())
213+
214+ $el[val](data[state] || this.options[state])
215+
216+ // push to event loop to allow forms to submit
217+ setTimeout(function () {
218+ state == 'loadingText' ?
219+ $el.addClass(d).attr(d, d) :
220+ $el.removeClass(d).removeAttr(d);
221+ }, 0)
222+ }
223+
224+ Button.prototype.toggle = function () {
225+ var $parent = this.$element.closest('[data-toggle="buttons"]')
226+
227+ if ($parent.length) {
228+ var $input = this.$element.find('input')
229+ .prop('checked', !this.$element.hasClass('active'))
230+ .trigger('change')
231+ if ($input.prop('type') === 'radio') $parent.find('.active').removeClass('active')
232+ }
233+
234+ this.$element.toggleClass('active')
235+ }
236+
237+
238+ // BUTTON PLUGIN DEFINITION
239+ // ========================
240+
241+ var old = $.fn.button
242+
243+ $.fn.button = function (option) {
244+ return this.each(function () {
245+ var $this = $(this)
246+ var data = $this.data('bs.button')
247+ var options = typeof option == 'object' && option
248+
249+ if (!data) $this.data('bs.button', (data = new Button(this, options)))
250+
251+ if (option == 'toggle') data.toggle()
252+ else if (option) data.setState(option)
253+ })
254+ }
255+
256+ $.fn.button.Constructor = Button
257+
258+
259+ // BUTTON NO CONFLICT
260+ // ==================
261+
262+ $.fn.button.noConflict = function () {
263+ $.fn.button = old
264+ return this
265+ }
266+
267+
268+ // BUTTON DATA-API
269+ // ===============
270+
271+ $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) {
272+ var $btn = $(e.target)
273+ if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
274+ $btn.button('toggle')
275+ e.preventDefault()
276+ })
277+
278+}(window.jQuery);
279+
280+/* ========================================================================
281+ * Bootstrap: carousel.js v3.0.0
282+ * http://getbootstrap.com/javascript/#carousel
283+ * ========================================================================
284+ * Copyright 2013 Twitter, Inc.
285+ *
286+ * Licensed under the Apache License, Version 2.0 (the "License");
287+ * you may not use this file except in compliance with the License.
288+ * You may obtain a copy of the License at
289+ *
290+ * http://www.apache.org/licenses/LICENSE-2.0
291+ *
292+ * Unless required by applicable law or agreed to in writing, software
293+ * distributed under the License is distributed on an "AS IS" BASIS,
294+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
295+ * See the License for the specific language governing permissions and
296+ * limitations under the License.
297+ * ======================================================================== */
298+
299+
300++function ($) { "use strict";
301+
302+ // CAROUSEL CLASS DEFINITION
303+ // =========================
304+
305+ var Carousel = function (element, options) {
306+ this.$element = $(element)
307+ this.$indicators = this.$element.find('.carousel-indicators')
308+ this.options = options
309+ this.paused =
310+ this.sliding =
311+ this.interval =
312+ this.$active =
313+ this.$items = null
314+
315+ this.options.pause == 'hover' && this.$element
316+ .on('mouseenter', $.proxy(this.pause, this))
317+ .on('mouseleave', $.proxy(this.cycle, this))
318+ }
319+
320+ Carousel.DEFAULTS = {
321+ interval: 5000
322+ , pause: 'hover'
323+ , wrap: true
324+ }
325+
326+ Carousel.prototype.cycle = function (e) {
327+ e || (this.paused = false)
328+
329+ this.interval && clearInterval(this.interval)
330+
331+ this.options.interval
332+ && !this.paused
333+ && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
334+
335+ return this
336+ }
337+
338+ Carousel.prototype.getActiveIndex = function () {
339+ this.$active = this.$element.find('.item.active')
340+ this.$items = this.$active.parent().children()
341+
342+ return this.$items.index(this.$active)
343+ }
344+
345+ Carousel.prototype.to = function (pos) {
346+ var that = this
347+ var activeIndex = this.getActiveIndex()
348+
349+ if (pos > (this.$items.length - 1) || pos < 0) return
350+
351+ if (this.sliding) return this.$element.one('slid', function () { that.to(pos) })
352+ if (activeIndex == pos) return this.pause().cycle()
353+
354+ return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
355+ }
356+
357+ Carousel.prototype.pause = function (e) {
358+ e || (this.paused = true)
359+
360+ if (this.$element.find('.next, .prev').length && $.support.transition.end) {
361+ this.$element.trigger($.support.transition.end)
362+ this.cycle(true)
363+ }
364+
365+ this.interval = clearInterval(this.interval)
366+
367+ return this
368+ }
369+
370+ Carousel.prototype.next = function () {
371+ if (this.sliding) return
372+ return this.slide('next')
373+ }
374+
375+ Carousel.prototype.prev = function () {
376+ if (this.sliding) return
377+ return this.slide('prev')
378+ }
379+
380+ Carousel.prototype.slide = function (type, next) {
381+ var $active = this.$element.find('.item.active')
382+ var $next = next || $active[type]()
383+ var isCycling = this.interval
384+ var direction = type == 'next' ? 'left' : 'right'
385+ var fallback = type == 'next' ? 'first' : 'last'
386+ var that = this
387+
388+ if (!$next.length) {
389+ if (!this.options.wrap) return
390+ $next = this.$element.find('.item')[fallback]()
391+ }
392+
393+ this.sliding = true
394+
395+ isCycling && this.pause()
396+
397+ var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
398+
399+ if ($next.hasClass('active')) return
400+
401+ if (this.$indicators.length) {
402+ this.$indicators.find('.active').removeClass('active')
403+ this.$element.one('slid', function () {
404+ var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
405+ $nextIndicator && $nextIndicator.addClass('active')
406+ })
407+ }
408+
409+ if ($.support.transition && this.$element.hasClass('slide')) {
410+ this.$element.trigger(e)
411+ if (e.isDefaultPrevented()) return
412+ $next.addClass(type)
413+ $next[0].offsetWidth // force reflow
414+ $active.addClass(direction)
415+ $next.addClass(direction)
416+ $active
417+ .one($.support.transition.end, function () {
418+ $next.removeClass([type, direction].join(' ')).addClass('active')
419+ $active.removeClass(['active', direction].join(' '))
420+ that.sliding = false
421+ setTimeout(function () { that.$element.trigger('slid') }, 0)
422+ })
423+ .emulateTransitionEnd(600)
424+ } else {
425+ this.$element.trigger(e)
426+ if (e.isDefaultPrevented()) return
427+ $active.removeClass('active')
428+ $next.addClass('active')
429+ this.sliding = false
430+ this.$element.trigger('slid')
431+ }
432+
433+ isCycling && this.cycle()
434+
435+ return this
436+ }
437+
438+
439+ // CAROUSEL PLUGIN DEFINITION
440+ // ==========================
441+
442+ var old = $.fn.carousel
443+
444+ $.fn.carousel = function (option) {
445+ return this.each(function () {
446+ var $this = $(this)
447+ var data = $this.data('bs.carousel')
448+ var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
449+ var action = typeof option == 'string' ? option : options.slide
450+
451+ if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
452+ if (typeof option == 'number') data.to(option)
453+ else if (action) data[action]()
454+ else if (options.interval) data.pause().cycle()
455+ })
456+ }
457+
458+ $.fn.carousel.Constructor = Carousel
459+
460+
461+ // CAROUSEL NO CONFLICT
462+ // ====================
463+
464+ $.fn.carousel.noConflict = function () {
465+ $.fn.carousel = old
466+ return this
467+ }
468+
469+
470+ // CAROUSEL DATA-API
471+ // =================
472+
473+ $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
474+ var $this = $(this), href
475+ var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
476+ var options = $.extend({}, $target.data(), $this.data())
477+ var slideIndex = $this.attr('data-slide-to')
478+ if (slideIndex) options.interval = false
479+
480+ $target.carousel(options)
481+
482+ if (slideIndex = $this.attr('data-slide-to')) {
483+ $target.data('bs.carousel').to(slideIndex)
484+ }
485+
486+ e.preventDefault()
487+ })
488+
489+ $(window).on('load', function () {
490+ $('[data-ride="carousel"]').each(function () {
491+ var $carousel = $(this)
492+ $carousel.carousel($carousel.data())
493+ })
494+ })
495+
496+}(window.jQuery);
497+
498+/* ========================================================================
499+ * Bootstrap: dropdown.js v3.0.0
500+ * http://getbootstrap.com/javascript/#dropdowns
501+ * ========================================================================
502+ * Copyright 2013 Twitter, Inc.
503+ *
504+ * Licensed under the Apache License, Version 2.0 (the "License");
505+ * you may not use this file except in compliance with the License.
506+ * You may obtain a copy of the License at
507+ *
508+ * http://www.apache.org/licenses/LICENSE-2.0
509+ *
510+ * Unless required by applicable law or agreed to in writing, software
511+ * distributed under the License is distributed on an "AS IS" BASIS,
512+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
513+ * See the License for the specific language governing permissions and
514+ * limitations under the License.
515+ * ======================================================================== */
516+
517+
518++function ($) { "use strict";
519+
520+ // DROPDOWN CLASS DEFINITION
521+ // =========================
522+
523+ var backdrop = '.dropdown-backdrop'
524+ var toggle = '[data-toggle=dropdown]'
525+ var Dropdown = function (element) {
526+ var $el = $(element).on('click.bs.dropdown', this.toggle)
527+ }
528+
529+ Dropdown.prototype.toggle = function (e) {
530+ var $this = $(this)
531+
532+ if ($this.is('.disabled, :disabled')) return
533+
534+ var $parent = getParent($this)
535+ var isActive = $parent.hasClass('open')
536+
537+ clearMenus()
538+
539+ if (!isActive) {
540+ if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
541+ // if mobile we we use a backdrop because click events don't delegate
542+ $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
543+ }
544+
545+ $parent.trigger(e = $.Event('show.bs.dropdown'))
546+
547+ if (e.isDefaultPrevented()) return
548+
549+ $parent
550+ .toggleClass('open')
551+ .trigger('shown.bs.dropdown')
552+
553+ $this.focus()
554+ }
555+
556+ return false
557+ }
558+
559+ Dropdown.prototype.keydown = function (e) {
560+ if (!/(38|40|27)/.test(e.keyCode)) return
561+
562+ var $this = $(this)
563+
564+ e.preventDefault()
565+ e.stopPropagation()
566+
567+ if ($this.is('.disabled, :disabled')) return
568+
569+ var $parent = getParent($this)
570+ var isActive = $parent.hasClass('open')
571+
572+ if (!isActive || (isActive && e.keyCode == 27)) {
573+ if (e.which == 27) $parent.find(toggle).focus()
574+ return $this.click()
575+ }
576+
577+ var $items = $('[role=menu] li:not(.divider):visible a', $parent)
578+
579+ if (!$items.length) return
580+
581+ var index = $items.index($items.filter(':focus'))
582+
583+ if (e.keyCode == 38 && index > 0) index-- // up
584+ if (e.keyCode == 40 && index < $items.length - 1) index++ // down
585+ if (!~index) index=0
586+
587+ $items.eq(index).focus()
588+ }
589+
590+ function clearMenus() {
591+ $(backdrop).remove()
592+ $(toggle).each(function (e) {
593+ var $parent = getParent($(this))
594+ if (!$parent.hasClass('open')) return
595+ $parent.trigger(e = $.Event('hide.bs.dropdown'))
596+ if (e.isDefaultPrevented()) return
597+ $parent.removeClass('open').trigger('hidden.bs.dropdown')
598+ })
599+ }
600+
601+ function getParent($this) {
602+ var selector = $this.attr('data-target')
603+
604+ if (!selector) {
605+ selector = $this.attr('href')
606+ selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
607+ }
608+
609+ var $parent = selector && $(selector)
610+
611+ return $parent && $parent.length ? $parent : $this.parent()
612+ }
613+
614+
615+ // DROPDOWN PLUGIN DEFINITION
616+ // ==========================
617+
618+ var old = $.fn.dropdown
619+
620+ $.fn.dropdown = function (option) {
621+ return this.each(function () {
622+ var $this = $(this)
623+ var data = $this.data('dropdown')
624+
625+ if (!data) $this.data('dropdown', (data = new Dropdown(this)))
626+ if (typeof option == 'string') data[option].call($this)
627+ })
628+ }
629+
630+ $.fn.dropdown.Constructor = Dropdown
631+
632+
633+ // DROPDOWN NO CONFLICT
634+ // ====================
635+
636+ $.fn.dropdown.noConflict = function () {
637+ $.fn.dropdown = old
638+ return this
639+ }
640+
641+
642+ // APPLY TO STANDARD DROPDOWN ELEMENTS
643+ // ===================================
644+
645+ $(document)
646+ .on('click.bs.dropdown.data-api', clearMenus)
647+ .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
648+ .on('click.bs.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
649+ .on('keydown.bs.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
650+
651+}(window.jQuery);
652+
653+/* ========================================================================
654+ * Bootstrap: modal.js v3.0.0
655+ * http://getbootstrap.com/javascript/#modals
656+ * ========================================================================
657+ * Copyright 2013 Twitter, Inc.
658+ *
659+ * Licensed under the Apache License, Version 2.0 (the "License");
660+ * you may not use this file except in compliance with the License.
661+ * You may obtain a copy of the License at
662+ *
663+ * http://www.apache.org/licenses/LICENSE-2.0
664+ *
665+ * Unless required by applicable law or agreed to in writing, software
666+ * distributed under the License is distributed on an "AS IS" BASIS,
667+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
668+ * See the License for the specific language governing permissions and
669+ * limitations under the License.
670+ * ======================================================================== */
671+
672+
673++function ($) { "use strict";
674+
675+ // MODAL CLASS DEFINITION
676+ // ======================
677+
678+ var Modal = function (element, options) {
679+ this.options = options
680+ this.$element = $(element)
681+ this.$backdrop =
682+ this.isShown = null
683+
684+ if (this.options.remote) this.$element.load(this.options.remote)
685+ }
686+
687+ Modal.DEFAULTS = {
688+ backdrop: true
689+ , keyboard: true
690+ , show: true
691+ }
692+
693+ Modal.prototype.toggle = function (_relatedTarget) {
694+ return this[!this.isShown ? 'show' : 'hide'](_relatedTarget)
695+ }
696+
697+ Modal.prototype.show = function (_relatedTarget) {
698+ var that = this
699+ var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
700+
701+ this.$element.trigger(e)
702+
703+ if (this.isShown || e.isDefaultPrevented()) return
704+
705+ this.isShown = true
706+
707+ this.escape()
708+
709+ this.$element.on('click.dismiss.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
710+
711+ this.backdrop(function () {
712+ var transition = $.support.transition && that.$element.hasClass('fade')
713+
714+ if (!that.$element.parent().length) {
715+ that.$element.appendTo(document.body) // don't move modals dom position
716+ }
717+
718+ that.$element.show()
719+
720+ if (transition) {
721+ that.$element[0].offsetWidth // force reflow
722+ }
723+
724+ that.$element
725+ .addClass('in')
726+ .attr('aria-hidden', false)
727+
728+ that.enforceFocus()
729+
730+ var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
731+
732+ transition ?
733+ that.$element.find('.modal-dialog') // wait for modal to slide in
734+ .one($.support.transition.end, function () {
735+ that.$element.focus().trigger(e)
736+ })
737+ .emulateTransitionEnd(300) :
738+ that.$element.focus().trigger(e)
739+ })
740+ }
741+
742+ Modal.prototype.hide = function (e) {
743+ if (e) e.preventDefault()
744+
745+ e = $.Event('hide.bs.modal')
746+
747+ this.$element.trigger(e)
748+
749+ if (!this.isShown || e.isDefaultPrevented()) return
750+
751+ this.isShown = false
752+
753+ this.escape()
754+
755+ $(document).off('focusin.bs.modal')
756+
757+ this.$element
758+ .removeClass('in')
759+ .attr('aria-hidden', true)
760+ .off('click.dismiss.modal')
761+
762+ $.support.transition && this.$element.hasClass('fade') ?
763+ this.$element
764+ .one($.support.transition.end, $.proxy(this.hideModal, this))
765+ .emulateTransitionEnd(300) :
766+ this.hideModal()
767+ }
768+
769+ Modal.prototype.enforceFocus = function () {
770+ $(document)
771+ .off('focusin.bs.modal') // guard against infinite focus loop
772+ .on('focusin.bs.modal', $.proxy(function (e) {
773+ if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
774+ this.$element.focus()
775+ }
776+ }, this))
777+ }
778+
779+ Modal.prototype.escape = function () {
780+ if (this.isShown && this.options.keyboard) {
781+ this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {
782+ e.which == 27 && this.hide()
783+ }, this))
784+ } else if (!this.isShown) {
785+ this.$element.off('keyup.dismiss.bs.modal')
786+ }
787+ }
788+
789+ Modal.prototype.hideModal = function () {
790+ var that = this
791+ this.$element.hide()
792+ this.backdrop(function () {
793+ that.removeBackdrop()
794+ that.$element.trigger('hidden.bs.modal')
795+ })
796+ }
797+
798+ Modal.prototype.removeBackdrop = function () {
799+ this.$backdrop && this.$backdrop.remove()
800+ this.$backdrop = null
801+ }
802+
803+ Modal.prototype.backdrop = function (callback) {
804+ var that = this
805+ var animate = this.$element.hasClass('fade') ? 'fade' : ''
806+
807+ if (this.isShown && this.options.backdrop) {
808+ var doAnimate = $.support.transition && animate
809+
810+ this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
811+ .appendTo(document.body)
812+
813+ this.$element.on('click.dismiss.modal', $.proxy(function (e) {
814+ if (e.target !== e.currentTarget) return
815+ this.options.backdrop == 'static'
816+ ? this.$element[0].focus.call(this.$element[0])
817+ : this.hide.call(this)
818+ }, this))
819+
820+ if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
821+
822+ this.$backdrop.addClass('in')
823+
824+ if (!callback) return
825+
826+ doAnimate ?
827+ this.$backdrop
828+ .one($.support.transition.end, callback)
829+ .emulateTransitionEnd(150) :
830+ callback()
831+
832+ } else if (!this.isShown && this.$backdrop) {
833+ this.$backdrop.removeClass('in')
834+
835+ $.support.transition && this.$element.hasClass('fade')?
836+ this.$backdrop
837+ .one($.support.transition.end, callback)
838+ .emulateTransitionEnd(150) :
839+ callback()
840+
841+ } else if (callback) {
842+ callback()
843+ }
844+ }
845+
846+
847+ // MODAL PLUGIN DEFINITION
848+ // =======================
849+
850+ var old = $.fn.modal
851+
852+ $.fn.modal = function (option, _relatedTarget) {
853+ return this.each(function () {
854+ var $this = $(this)
855+ var data = $this.data('bs.modal')
856+ var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
857+
858+ if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
859+ if (typeof option == 'string') data[option](_relatedTarget)
860+ else if (options.show) data.show(_relatedTarget)
861+ })
862+ }
863+
864+ $.fn.modal.Constructor = Modal
865+
866+
867+ // MODAL NO CONFLICT
868+ // =================
869+
870+ $.fn.modal.noConflict = function () {
871+ $.fn.modal = old
872+ return this
873+ }
874+
875+
876+ // MODAL DATA-API
877+ // ==============
878+
879+ $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
880+ var $this = $(this)
881+ var href = $this.attr('href')
882+ var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
883+ var option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
884+
885+ e.preventDefault()
886+
887+ $target
888+ .modal(option, this)
889+ .one('hide', function () {
890+ $this.is(':visible') && $this.focus()
891+ })
892+ })
893+
894+ $(document)
895+ .on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') })
896+ .on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') })
897+
898+}(window.jQuery);
899+
900+/* ========================================================================
901+ * Bootstrap: tooltip.js v3.0.0
902+ * http://getbootstrap.com/javascript/#tooltip
903+ * Inspired by the original jQuery.tipsy by Jason Frame
904+ * ========================================================================
905+ * Copyright 2013 Twitter, Inc.
906+ *
907+ * Licensed under the Apache License, Version 2.0 (the "License");
908+ * you may not use this file except in compliance with the License.
909+ * You may obtain a copy of the License at
910+ *
911+ * http://www.apache.org/licenses/LICENSE-2.0
912+ *
913+ * Unless required by applicable law or agreed to in writing, software
914+ * distributed under the License is distributed on an "AS IS" BASIS,
915+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
916+ * See the License for the specific language governing permissions and
917+ * limitations under the License.
918+ * ======================================================================== */
919+
920+
921++function ($) { "use strict";
922+
923+ // TOOLTIP PUBLIC CLASS DEFINITION
924+ // ===============================
925+
926+ var Tooltip = function (element, options) {
927+ this.type =
928+ this.options =
929+ this.enabled =
930+ this.timeout =
931+ this.hoverState =
932+ this.$element = null
933+
934+ this.init('tooltip', element, options)
935+ }
936+
937+ Tooltip.DEFAULTS = {
938+ animation: true
939+ , placement: 'top'
940+ , selector: false
941+ , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
942+ , trigger: 'hover focus'
943+ , title: ''
944+ , delay: 0
945+ , html: false
946+ , container: false
947+ }
948+
949+ Tooltip.prototype.init = function (type, element, options) {
950+ this.enabled = true
951+ this.type = type
952+ this.$element = $(element)
953+ this.options = this.getOptions(options)
954+
955+ var triggers = this.options.trigger.split(' ')
956+
957+ for (var i = triggers.length; i--;) {
958+ var trigger = triggers[i]
959+
960+ if (trigger == 'click') {
961+ this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
962+ } else if (trigger != 'manual') {
963+ var eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
964+ var eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
965+
966+ this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
967+ this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
968+ }
969+ }
970+
971+ this.options.selector ?
972+ (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
973+ this.fixTitle()
974+ }
975+
976+ Tooltip.prototype.getDefaults = function () {
977+ return Tooltip.DEFAULTS
978+ }
979+
980+ Tooltip.prototype.getOptions = function (options) {
981+ options = $.extend({}, this.getDefaults(), this.$element.data(), options)
982+
983+ if (options.delay && typeof options.delay == 'number') {
984+ options.delay = {
985+ show: options.delay
986+ , hide: options.delay
987+ }
988+ }
989+
990+ return options
991+ }
992+
993+ Tooltip.prototype.getDelegateOptions = function () {
994+ var options = {}
995+ var defaults = this.getDefaults()
996+
997+ this._options && $.each(this._options, function (key, value) {
998+ if (defaults[key] != value) options[key] = value
999+ })
1000+
1001+ return options
1002+ }
1003+
1004+ Tooltip.prototype.enter = function (obj) {
1005+ var self = obj instanceof this.constructor ?
1006+ obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
1007+
1008+ clearTimeout(self.timeout)
1009+
1010+ self.hoverState = 'in'
1011+
1012+ if (!self.options.delay || !self.options.delay.show) return self.show()
1013+
1014+ self.timeout = setTimeout(function () {
1015+ if (self.hoverState == 'in') self.show()
1016+ }, self.options.delay.show)
1017+ }
1018+
1019+ Tooltip.prototype.leave = function (obj) {
1020+ var self = obj instanceof this.constructor ?
1021+ obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
1022+
1023+ clearTimeout(self.timeout)
1024+
1025+ self.hoverState = 'out'
1026+
1027+ if (!self.options.delay || !self.options.delay.hide) return self.hide()
1028+
1029+ self.timeout = setTimeout(function () {
1030+ if (self.hoverState == 'out') self.hide()
1031+ }, self.options.delay.hide)
1032+ }
1033+
1034+ Tooltip.prototype.show = function () {
1035+ var e = $.Event('show.bs.'+ this.type)
1036+
1037+ if (this.hasContent() && this.enabled) {
1038+ this.$element.trigger(e)
1039+
1040+ if (e.isDefaultPrevented()) return
1041+
1042+ var $tip = this.tip()
1043+
1044+ this.setContent()
1045+
1046+ if (this.options.animation) $tip.addClass('fade')
1047+
1048+ var placement = typeof this.options.placement == 'function' ?
1049+ this.options.placement.call(this, $tip[0], this.$element[0]) :
1050+ this.options.placement
1051+
1052+ var autoToken = /\s?auto?\s?/i
1053+ var autoPlace = autoToken.test(placement)
1054+ if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
1055+
1056+ $tip
1057+ .detach()
1058+ .css({ top: 0, left: 0, display: 'block' })
1059+ .addClass(placement)
1060+
1061+ this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
1062+
1063+ var pos = this.getPosition()
1064+ var actualWidth = $tip[0].offsetWidth
1065+ var actualHeight = $tip[0].offsetHeight
1066+
1067+ if (autoPlace) {
1068+ var $parent = this.$element.parent()
1069+
1070+ var orgPlacement = placement
1071+ var docScroll = document.documentElement.scrollTop || document.body.scrollTop
1072+ var parentWidth = this.options.container == 'body' ? window.innerWidth : $parent.outerWidth()
1073+ var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight()
1074+ var parentLeft = this.options.container == 'body' ? 0 : $parent.offset().left
1075+
1076+ placement = placement == 'bottom' && pos.top + pos.height + actualHeight - docScroll > parentHeight ? 'top' :
1077+ placement == 'top' && pos.top - docScroll - actualHeight < 0 ? 'bottom' :
1078+ placement == 'right' && pos.right + actualWidth > parentWidth ? 'left' :
1079+ placement == 'left' && pos.left - actualWidth < parentLeft ? 'right' :
1080+ placement
1081+
1082+ $tip
1083+ .removeClass(orgPlacement)
1084+ .addClass(placement)
1085+ }
1086+
1087+ var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
1088+
1089+ this.applyPlacement(calculatedOffset, placement)
1090+ this.$element.trigger('shown.bs.' + this.type)
1091+ }
1092+ }
1093+
1094+ Tooltip.prototype.applyPlacement = function(offset, placement) {
1095+ var replace
1096+ var $tip = this.tip()
1097+ var width = $tip[0].offsetWidth
1098+ var height = $tip[0].offsetHeight
1099+
1100+ // manually read margins because getBoundingClientRect includes difference
1101+ var marginTop = parseInt($tip.css('margin-top'), 10)
1102+ var marginLeft = parseInt($tip.css('margin-left'), 10)
1103+
1104+ // we must check for NaN for ie 8/9
1105+ if (isNaN(marginTop)) marginTop = 0
1106+ if (isNaN(marginLeft)) marginLeft = 0
1107+
1108+ offset.top = offset.top + marginTop
1109+ offset.left = offset.left + marginLeft
1110+
1111+ $tip
1112+ .offset(offset)
1113+ .addClass('in')
1114+
1115+ // check to see if placing tip in new offset caused the tip to resize itself
1116+ var actualWidth = $tip[0].offsetWidth
1117+ var actualHeight = $tip[0].offsetHeight
1118+
1119+ if (placement == 'top' && actualHeight != height) {
1120+ replace = true
1121+ offset.top = offset.top + height - actualHeight
1122+ }
1123+
1124+ if (/bottom|top/.test(placement)) {
1125+ var delta = 0
1126+
1127+ if (offset.left < 0) {
1128+ delta = offset.left * -2
1129+ offset.left = 0
1130+
1131+ $tip.offset(offset)
1132+
1133+ actualWidth = $tip[0].offsetWidth
1134+ actualHeight = $tip[0].offsetHeight
1135+ }
1136+
1137+ this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
1138+ } else {
1139+ this.replaceArrow(actualHeight - height, actualHeight, 'top')
1140+ }
1141+
1142+ if (replace) $tip.offset(offset)
1143+ }
1144+
1145+ Tooltip.prototype.replaceArrow = function(delta, dimension, position) {
1146+ this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
1147+ }
1148+
1149+ Tooltip.prototype.setContent = function () {
1150+ var $tip = this.tip()
1151+ var title = this.getTitle()
1152+
1153+ $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
1154+ $tip.removeClass('fade in top bottom left right')
1155+ }
1156+
1157+ Tooltip.prototype.hide = function () {
1158+ var that = this
1159+ var $tip = this.tip()
1160+ var e = $.Event('hide.bs.' + this.type)
1161+
1162+ function complete() {
1163+ if (that.hoverState != 'in') $tip.detach()
1164+ }
1165+
1166+ this.$element.trigger(e)
1167+
1168+ if (e.isDefaultPrevented()) return
1169+
1170+ $tip.removeClass('in')
1171+
1172+ $.support.transition && this.$tip.hasClass('fade') ?
1173+ $tip
1174+ .one($.support.transition.end, complete)
1175+ .emulateTransitionEnd(150) :
1176+ complete()
1177+
1178+ this.$element.trigger('hidden.bs.' + this.type)
1179+
1180+ return this
1181+ }
1182+
1183+ Tooltip.prototype.fixTitle = function () {
1184+ var $e = this.$element
1185+ if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
1186+ $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
1187+ }
1188+ }
1189+
1190+ Tooltip.prototype.hasContent = function () {
1191+ return this.getTitle()
1192+ }
1193+
1194+ Tooltip.prototype.getPosition = function () {
1195+ var el = this.$element[0]
1196+ return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
1197+ width: el.offsetWidth
1198+ , height: el.offsetHeight
1199+ }, this.$element.offset())
1200+ }
1201+
1202+ Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
1203+ return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
1204+ placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
1205+ placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
1206+ /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
1207+ }
1208+
1209+ Tooltip.prototype.getTitle = function () {
1210+ var title
1211+ var $e = this.$element
1212+ var o = this.options
1213+
1214+ title = $e.attr('data-original-title')
1215+ || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
1216+
1217+ return title
1218+ }
1219+
1220+ Tooltip.prototype.tip = function () {
1221+ return this.$tip = this.$tip || $(this.options.template)
1222+ }
1223+
1224+ Tooltip.prototype.arrow = function () {
1225+ return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')
1226+ }
1227+
1228+ Tooltip.prototype.validate = function () {
1229+ if (!this.$element[0].parentNode) {
1230+ this.hide()
1231+ this.$element = null
1232+ this.options = null
1233+ }
1234+ }
1235+
1236+ Tooltip.prototype.enable = function () {
1237+ this.enabled = true
1238+ }
1239+
1240+ Tooltip.prototype.disable = function () {
1241+ this.enabled = false
1242+ }
1243+
1244+ Tooltip.prototype.toggleEnabled = function () {
1245+ this.enabled = !this.enabled
1246+ }
1247+
1248+ Tooltip.prototype.toggle = function (e) {
1249+ var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this
1250+ self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
1251+ }
1252+
1253+ Tooltip.prototype.destroy = function () {
1254+ this.hide().$element.off('.' + this.type).removeData('bs.' + this.type)
1255+ }
1256+
1257+
1258+ // TOOLTIP PLUGIN DEFINITION
1259+ // =========================
1260+
1261+ var old = $.fn.tooltip
1262+
1263+ $.fn.tooltip = function (option) {
1264+ return this.each(function () {
1265+ var $this = $(this)
1266+ var data = $this.data('bs.tooltip')
1267+ var options = typeof option == 'object' && option
1268+
1269+ if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
1270+ if (typeof option == 'string') data[option]()
1271+ })
1272+ }
1273+
1274+ $.fn.tooltip.Constructor = Tooltip
1275+
1276+
1277+ // TOOLTIP NO CONFLICT
1278+ // ===================
1279+
1280+ $.fn.tooltip.noConflict = function () {
1281+ $.fn.tooltip = old
1282+ return this
1283+ }
1284+
1285+}(window.jQuery);
1286+
1287+/* ========================================================================
1288+ * Bootstrap: popover.js v3.0.0
1289+ * http://getbootstrap.com/javascript/#popovers
1290+ * ========================================================================
1291+ * Copyright 2013 Twitter, Inc.
1292+ *
1293+ * Licensed under the Apache License, Version 2.0 (the "License");
1294+ * you may not use this file except in compliance with the License.
1295+ * You may obtain a copy of the License at
1296+ *
1297+ * http://www.apache.org/licenses/LICENSE-2.0
1298+ *
1299+ * Unless required by applicable law or agreed to in writing, software
1300+ * distributed under the License is distributed on an "AS IS" BASIS,
1301+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1302+ * See the License for the specific language governing permissions and
1303+ * limitations under the License.
1304+ * ======================================================================== */
1305+
1306+
1307++function ($) { "use strict";
1308+
1309+ // POPOVER PUBLIC CLASS DEFINITION
1310+ // ===============================
1311+
1312+ var Popover = function (element, options) {
1313+ this.init('popover', element, options)
1314+ }
1315+
1316+ if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
1317+
1318+ Popover.DEFAULTS = $.extend({} , $.fn.tooltip.Constructor.DEFAULTS, {
1319+ placement: 'right'
1320+ , trigger: 'click'
1321+ , content: ''
1322+ , template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
1323+ })
1324+
1325+
1326+ // NOTE: POPOVER EXTENDS tooltip.js
1327+ // ================================
1328+
1329+ Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
1330+
1331+ Popover.prototype.constructor = Popover
1332+
1333+ Popover.prototype.getDefaults = function () {
1334+ return Popover.DEFAULTS
1335+ }
1336+
1337+ Popover.prototype.setContent = function () {
1338+ var $tip = this.tip()
1339+ var title = this.getTitle()
1340+ var content = this.getContent()
1341+
1342+ $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
1343+ $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
1344+
1345+ $tip.removeClass('fade top bottom left right in')
1346+
1347+ // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
1348+ // this manually by checking the contents.
1349+ if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
1350+ }
1351+
1352+ Popover.prototype.hasContent = function () {
1353+ return this.getTitle() || this.getContent()
1354+ }
1355+
1356+ Popover.prototype.getContent = function () {
1357+ var $e = this.$element
1358+ var o = this.options
1359+
1360+ return $e.attr('data-content')
1361+ || (typeof o.content == 'function' ?
1362+ o.content.call($e[0]) :
1363+ o.content)
1364+ }
1365+
1366+ Popover.prototype.arrow = function () {
1367+ return this.$arrow = this.$arrow || this.tip().find('.arrow')
1368+ }
1369+
1370+ Popover.prototype.tip = function () {
1371+ if (!this.$tip) this.$tip = $(this.options.template)
1372+ return this.$tip
1373+ }
1374+
1375+
1376+ // POPOVER PLUGIN DEFINITION
1377+ // =========================
1378+
1379+ var old = $.fn.popover
1380+
1381+ $.fn.popover = function (option) {
1382+ return this.each(function () {
1383+ var $this = $(this)
1384+ var data = $this.data('bs.popover')
1385+ var options = typeof option == 'object' && option
1386+
1387+ if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
1388+ if (typeof option == 'string') data[option]()
1389+ })
1390+ }
1391+
1392+ $.fn.popover.Constructor = Popover
1393+
1394+
1395+ // POPOVER NO CONFLICT
1396+ // ===================
1397+
1398+ $.fn.popover.noConflict = function () {
1399+ $.fn.popover = old
1400+ return this
1401+ }
1402+
1403+}(window.jQuery);
1404+
1405+/* ========================================================================
1406+ * Bootstrap: tab.js v3.0.0
1407+ * http://getbootstrap.com/javascript/#tabs
1408+ * ========================================================================
1409+ * Copyright 2013 Twitter, Inc.
1410+ *
1411+ * Licensed under the Apache License, Version 2.0 (the "License");
1412+ * you may not use this file except in compliance with the License.
1413+ * You may obtain a copy of the License at
1414+ *
1415+ * http://www.apache.org/licenses/LICENSE-2.0
1416+ *
1417+ * Unless required by applicable law or agreed to in writing, software
1418+ * distributed under the License is distributed on an "AS IS" BASIS,
1419+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1420+ * See the License for the specific language governing permissions and
1421+ * limitations under the License.
1422+ * ======================================================================== */
1423+
1424+
1425++function ($) { "use strict";
1426+
1427+ // TAB CLASS DEFINITION
1428+ // ====================
1429+
1430+ var Tab = function (element) {
1431+ this.element = $(element)
1432+ }
1433+
1434+ Tab.prototype.show = function () {
1435+ var $this = this.element
1436+ var $ul = $this.closest('ul:not(.dropdown-menu)')
1437+ var selector = $this.data('target')
1438+
1439+ if (!selector) {
1440+ selector = $this.attr('href')
1441+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
1442+ }
1443+
1444+ if ($this.parent('li').hasClass('active')) return
1445+
1446+ var previous = $ul.find('.active:last a')[0]
1447+ var e = $.Event('show.bs.tab', {
1448+ relatedTarget: previous
1449+ })
1450+
1451+ $this.trigger(e)
1452+
1453+ if (e.isDefaultPrevented()) return
1454+
1455+ var $target = $(selector)
1456+
1457+ this.activate($this.parent('li'), $ul)
1458+ this.activate($target, $target.parent(), function () {
1459+ $this.trigger({
1460+ type: 'shown.bs.tab'
1461+ , relatedTarget: previous
1462+ })
1463+ })
1464+ }
1465+
1466+ Tab.prototype.activate = function (element, container, callback) {
1467+ var $active = container.find('> .active')
1468+ var transition = callback
1469+ && $.support.transition
1470+ && $active.hasClass('fade')
1471+
1472+ function next() {
1473+ $active
1474+ .removeClass('active')
1475+ .find('> .dropdown-menu > .active')
1476+ .removeClass('active')
1477+
1478+ element.addClass('active')
1479+
1480+ if (transition) {
1481+ element[0].offsetWidth // reflow for transition
1482+ element.addClass('in')
1483+ } else {
1484+ element.removeClass('fade')
1485+ }
1486+
1487+ if (element.parent('.dropdown-menu')) {
1488+ element.closest('li.dropdown').addClass('active')
1489+ }
1490+
1491+ callback && callback()
1492+ }
1493+
1494+ transition ?
1495+ $active
1496+ .one($.support.transition.end, next)
1497+ .emulateTransitionEnd(150) :
1498+ next()
1499+
1500+ $active.removeClass('in')
1501+ }
1502+
1503+
1504+ // TAB PLUGIN DEFINITION
1505+ // =====================
1506+
1507+ var old = $.fn.tab
1508+
1509+ $.fn.tab = function ( option ) {
1510+ return this.each(function () {
1511+ var $this = $(this)
1512+ var data = $this.data('bs.tab')
1513+
1514+ if (!data) $this.data('bs.tab', (data = new Tab(this)))
1515+ if (typeof option == 'string') data[option]()
1516+ })
1517+ }
1518+
1519+ $.fn.tab.Constructor = Tab
1520+
1521+
1522+ // TAB NO CONFLICT
1523+ // ===============
1524+
1525+ $.fn.tab.noConflict = function () {
1526+ $.fn.tab = old
1527+ return this
1528+ }
1529+
1530+
1531+ // TAB DATA-API
1532+ // ============
1533+
1534+ $(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
1535+ e.preventDefault()
1536+ $(this).tab('show')
1537+ })
1538+
1539+}(window.jQuery);
1540+
1541+/* ========================================================================
1542+ * Bootstrap: affix.js v3.0.0
1543+ * http://getbootstrap.com/javascript/#affix
1544+ * ========================================================================
1545+ * Copyright 2013 Twitter, Inc.
1546+ *
1547+ * Licensed under the Apache License, Version 2.0 (the "License");
1548+ * you may not use this file except in compliance with the License.
1549+ * You may obtain a copy of the License at
1550+ *
1551+ * http://www.apache.org/licenses/LICENSE-2.0
1552+ *
1553+ * Unless required by applicable law or agreed to in writing, software
1554+ * distributed under the License is distributed on an "AS IS" BASIS,
1555+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1556+ * See the License for the specific language governing permissions and
1557+ * limitations under the License.
1558+ * ======================================================================== */
1559+
1560+
1561++function ($) { "use strict";
1562+
1563+ // AFFIX CLASS DEFINITION
1564+ // ======================
1565+
1566+ var Affix = function (element, options) {
1567+ this.options = $.extend({}, Affix.DEFAULTS, options)
1568+ this.$window = $(window)
1569+ .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
1570+ .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
1571+
1572+ this.$element = $(element)
1573+ this.affixed =
1574+ this.unpin = null
1575+
1576+ this.checkPosition()
1577+ }
1578+
1579+ Affix.RESET = 'affix affix-top affix-bottom'
1580+
1581+ Affix.DEFAULTS = {
1582+ offset: 0
1583+ }
1584+
1585+ Affix.prototype.checkPositionWithEventLoop = function () {
1586+ setTimeout($.proxy(this.checkPosition, this), 1)
1587+ }
1588+
1589+ Affix.prototype.checkPosition = function () {
1590+ if (!this.$element.is(':visible')) return
1591+
1592+ var scrollHeight = $(document).height()
1593+ var scrollTop = this.$window.scrollTop()
1594+ var position = this.$element.offset()
1595+ var offset = this.options.offset
1596+ var offsetTop = offset.top
1597+ var offsetBottom = offset.bottom
1598+
1599+ if (typeof offset != 'object') offsetBottom = offsetTop = offset
1600+ if (typeof offsetTop == 'function') offsetTop = offset.top()
1601+ if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
1602+
1603+ var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false :
1604+ offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
1605+ offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
1606+
1607+ if (this.affixed === affix) return
1608+ if (this.unpin) this.$element.css('top', '')
1609+
1610+ this.affixed = affix
1611+ this.unpin = affix == 'bottom' ? position.top - scrollTop : null
1612+
1613+ this.$element.removeClass(Affix.RESET).addClass('affix' + (affix ? '-' + affix : ''))
1614+
1615+ if (affix == 'bottom') {
1616+ this.$element.offset({ top: document.body.offsetHeight - offsetBottom - this.$element.height() })
1617+ }
1618+ }
1619+
1620+
1621+ // AFFIX PLUGIN DEFINITION
1622+ // =======================
1623+
1624+ var old = $.fn.affix
1625+
1626+ $.fn.affix = function (option) {
1627+ return this.each(function () {
1628+ var $this = $(this)
1629+ var data = $this.data('bs.affix')
1630+ var options = typeof option == 'object' && option
1631+
1632+ if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
1633+ if (typeof option == 'string') data[option]()
1634+ })
1635+ }
1636+
1637+ $.fn.affix.Constructor = Affix
1638+
1639+
1640+ // AFFIX NO CONFLICT
1641+ // =================
1642+
1643+ $.fn.affix.noConflict = function () {
1644+ $.fn.affix = old
1645+ return this
1646+ }
1647+
1648+
1649+ // AFFIX DATA-API
1650+ // ==============
1651+
1652+ $(window).on('load', function () {
1653+ $('[data-spy="affix"]').each(function () {
1654+ var $spy = $(this)
1655+ var data = $spy.data()
1656+
1657+ data.offset = data.offset || {}
1658+
1659+ if (data.offsetBottom) data.offset.bottom = data.offsetBottom
1660+ if (data.offsetTop) data.offset.top = data.offsetTop
1661+
1662+ $spy.affix(data)
1663+ })
1664+ })
1665+
1666+}(window.jQuery);
1667+
1668+/* ========================================================================
1669+ * Bootstrap: collapse.js v3.0.0
1670+ * http://getbootstrap.com/javascript/#collapse
1671+ * ========================================================================
1672+ * Copyright 2013 Twitter, Inc.
1673+ *
1674+ * Licensed under the Apache License, Version 2.0 (the "License");
1675+ * you may not use this file except in compliance with the License.
1676+ * You may obtain a copy of the License at
1677+ *
1678+ * http://www.apache.org/licenses/LICENSE-2.0
1679+ *
1680+ * Unless required by applicable law or agreed to in writing, software
1681+ * distributed under the License is distributed on an "AS IS" BASIS,
1682+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1683+ * See the License for the specific language governing permissions and
1684+ * limitations under the License.
1685+ * ======================================================================== */
1686+
1687+
1688++function ($) { "use strict";
1689+
1690+ // COLLAPSE PUBLIC CLASS DEFINITION
1691+ // ================================
1692+
1693+ var Collapse = function (element, options) {
1694+ this.$element = $(element)
1695+ this.options = $.extend({}, Collapse.DEFAULTS, options)
1696+ this.transitioning = null
1697+
1698+ if (this.options.parent) this.$parent = $(this.options.parent)
1699+ if (this.options.toggle) this.toggle()
1700+ }
1701+
1702+ Collapse.DEFAULTS = {
1703+ toggle: true
1704+ }
1705+
1706+ Collapse.prototype.dimension = function () {
1707+ var hasWidth = this.$element.hasClass('width')
1708+ return hasWidth ? 'width' : 'height'
1709+ }
1710+
1711+ Collapse.prototype.show = function () {
1712+ if (this.transitioning || this.$element.hasClass('in')) return
1713+
1714+ var startEvent = $.Event('show.bs.collapse')
1715+ this.$element.trigger(startEvent)
1716+ if (startEvent.isDefaultPrevented()) return
1717+
1718+ var actives = this.$parent && this.$parent.find('> .panel > .in')
1719+
1720+ if (actives && actives.length) {
1721+ var hasData = actives.data('bs.collapse')
1722+ if (hasData && hasData.transitioning) return
1723+ actives.collapse('hide')
1724+ hasData || actives.data('bs.collapse', null)
1725+ }
1726+
1727+ var dimension = this.dimension()
1728+
1729+ this.$element
1730+ .removeClass('collapse')
1731+ .addClass('collapsing')
1732+ [dimension](0)
1733+
1734+ this.transitioning = 1
1735+
1736+ var complete = function () {
1737+ this.$element
1738+ .removeClass('collapsing')
1739+ .addClass('in')
1740+ [dimension]('auto')
1741+ this.transitioning = 0
1742+ this.$element.trigger('shown.bs.collapse')
1743+ }
1744+
1745+ if (!$.support.transition) return complete.call(this)
1746+
1747+ var scrollSize = $.camelCase(['scroll', dimension].join('-'))
1748+
1749+ this.$element
1750+ .one($.support.transition.end, $.proxy(complete, this))
1751+ .emulateTransitionEnd(350)
1752+ [dimension](this.$element[0][scrollSize])
1753+ }
1754+
1755+ Collapse.prototype.hide = function () {
1756+ if (this.transitioning || !this.$element.hasClass('in')) return
1757+
1758+ var startEvent = $.Event('hide.bs.collapse')
1759+ this.$element.trigger(startEvent)
1760+ if (startEvent.isDefaultPrevented()) return
1761+
1762+ var dimension = this.dimension()
1763+
1764+ this.$element
1765+ [dimension](this.$element[dimension]())
1766+ [0].offsetHeight
1767+
1768+ this.$element
1769+ .addClass('collapsing')
1770+ .removeClass('collapse')
1771+ .removeClass('in')
1772+
1773+ this.transitioning = 1
1774+
1775+ var complete = function () {
1776+ this.transitioning = 0
1777+ this.$element
1778+ .trigger('hidden.bs.collapse')
1779+ .removeClass('collapsing')
1780+ .addClass('collapse')
1781+ }
1782+
1783+ if (!$.support.transition) return complete.call(this)
1784+
1785+ this.$element
1786+ [dimension](0)
1787+ .one($.support.transition.end, $.proxy(complete, this))
1788+ .emulateTransitionEnd(350)
1789+ }
1790+
1791+ Collapse.prototype.toggle = function () {
1792+ this[this.$element.hasClass('in') ? 'hide' : 'show']()
1793+ }
1794+
1795+
1796+ // COLLAPSE PLUGIN DEFINITION
1797+ // ==========================
1798+
1799+ var old = $.fn.collapse
1800+
1801+ $.fn.collapse = function (option) {
1802+ return this.each(function () {
1803+ var $this = $(this)
1804+ var data = $this.data('bs.collapse')
1805+ var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
1806+
1807+ if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
1808+ if (typeof option == 'string') data[option]()
1809+ })
1810+ }
1811+
1812+ $.fn.collapse.Constructor = Collapse
1813+
1814+
1815+ // COLLAPSE NO CONFLICT
1816+ // ====================
1817+
1818+ $.fn.collapse.noConflict = function () {
1819+ $.fn.collapse = old
1820+ return this
1821+ }
1822+
1823+
1824+ // COLLAPSE DATA-API
1825+ // =================
1826+
1827+ $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) {
1828+ var $this = $(this), href
1829+ var target = $this.attr('data-target')
1830+ || e.preventDefault()
1831+ || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
1832+ var $target = $(target)
1833+ var data = $target.data('bs.collapse')
1834+ var option = data ? 'toggle' : $this.data()
1835+ var parent = $this.attr('data-parent')
1836+ var $parent = parent && $(parent)
1837+
1838+ if (!data || !data.transitioning) {
1839+ if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed')
1840+ $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
1841+ }
1842+
1843+ $target.collapse(option)
1844+ })
1845+
1846+}(window.jQuery);
1847+
1848+/* ========================================================================
1849+ * Bootstrap: scrollspy.js v3.0.0
1850+ * http://getbootstrap.com/javascript/#scrollspy
1851+ * ========================================================================
1852+ * Copyright 2013 Twitter, Inc.
1853+ *
1854+ * Licensed under the Apache License, Version 2.0 (the "License");
1855+ * you may not use this file except in compliance with the License.
1856+ * You may obtain a copy of the License at
1857+ *
1858+ * http://www.apache.org/licenses/LICENSE-2.0
1859+ *
1860+ * Unless required by applicable law or agreed to in writing, software
1861+ * distributed under the License is distributed on an "AS IS" BASIS,
1862+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1863+ * See the License for the specific language governing permissions and
1864+ * limitations under the License.
1865+ * ======================================================================== */
1866+
1867+
1868++function ($) { "use strict";
1869+
1870+ // SCROLLSPY CLASS DEFINITION
1871+ // ==========================
1872+
1873+ function ScrollSpy(element, options) {
1874+ var href
1875+ var process = $.proxy(this.process, this)
1876+
1877+ this.$element = $(element).is('body') ? $(window) : $(element)
1878+ this.$body = $('body')
1879+ this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process)
1880+ this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
1881+ this.selector = (this.options.target
1882+ || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
1883+ || '') + ' .nav li > a'
1884+ this.offsets = $([])
1885+ this.targets = $([])
1886+ this.activeTarget = null
1887+
1888+ this.refresh()
1889+ this.process()
1890+ }
1891+
1892+ ScrollSpy.DEFAULTS = {
1893+ offset: 10
1894+ }
1895+
1896+ ScrollSpy.prototype.refresh = function () {
1897+ var offsetMethod = this.$element[0] == window ? 'offset' : 'position'
1898+
1899+ this.offsets = $([])
1900+ this.targets = $([])
1901+
1902+ var self = this
1903+ var $targets = this.$body
1904+ .find(this.selector)
1905+ .map(function () {
1906+ var $el = $(this)
1907+ var href = $el.data('target') || $el.attr('href')
1908+ var $href = /^#\w/.test(href) && $(href)
1909+
1910+ return ($href
1911+ && $href.length
1912+ && [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null
1913+ })
1914+ .sort(function (a, b) { return a[0] - b[0] })
1915+ .each(function () {
1916+ self.offsets.push(this[0])
1917+ self.targets.push(this[1])
1918+ })
1919+ }
1920+
1921+ ScrollSpy.prototype.process = function () {
1922+ var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
1923+ var scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
1924+ var maxScroll = scrollHeight - this.$scrollElement.height()
1925+ var offsets = this.offsets
1926+ var targets = this.targets
1927+ var activeTarget = this.activeTarget
1928+ var i
1929+
1930+ if (scrollTop >= maxScroll) {
1931+ return activeTarget != (i = targets.last()[0]) && this.activate(i)
1932+ }
1933+
1934+ for (i = offsets.length; i--;) {
1935+ activeTarget != targets[i]
1936+ && scrollTop >= offsets[i]
1937+ && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
1938+ && this.activate( targets[i] )
1939+ }
1940+ }
1941+
1942+ ScrollSpy.prototype.activate = function (target) {
1943+ this.activeTarget = target
1944+
1945+ $(this.selector)
1946+ .parents('.active')
1947+ .removeClass('active')
1948+
1949+ var selector = this.selector
1950+ + '[data-target="' + target + '"],'
1951+ + this.selector + '[href="' + target + '"]'
1952+
1953+ var active = $(selector)
1954+ .parents('li')
1955+ .addClass('active')
1956+
1957+ if (active.parent('.dropdown-menu').length) {
1958+ active = active
1959+ .closest('li.dropdown')
1960+ .addClass('active')
1961+ }
1962+
1963+ active.trigger('activate')
1964+ }
1965+
1966+
1967+ // SCROLLSPY PLUGIN DEFINITION
1968+ // ===========================
1969+
1970+ var old = $.fn.scrollspy
1971+
1972+ $.fn.scrollspy = function (option) {
1973+ return this.each(function () {
1974+ var $this = $(this)
1975+ var data = $this.data('bs.scrollspy')
1976+ var options = typeof option == 'object' && option
1977+
1978+ if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
1979+ if (typeof option == 'string') data[option]()
1980+ })
1981+ }
1982+
1983+ $.fn.scrollspy.Constructor = ScrollSpy
1984+
1985+
1986+ // SCROLLSPY NO CONFLICT
1987+ // =====================
1988+
1989+ $.fn.scrollspy.noConflict = function () {
1990+ $.fn.scrollspy = old
1991+ return this
1992+ }
1993+
1994+
1995+ // SCROLLSPY DATA-API
1996+ // ==================
1997+
1998+ $(window).on('load', function () {
1999+ $('[data-spy="scroll"]').each(function () {
2000+ var $spy = $(this)
2001+ $spy.scrollspy($spy.data())
2002+ })
2003+ })
2004+
2005+}(window.jQuery);
2006+
2007+/* ========================================================================
2008+ * Bootstrap: transition.js v3.0.0
2009+ * http://getbootstrap.com/javascript/#transitions
2010+ * ========================================================================
2011+ * Copyright 2013 Twitter, Inc.
2012+ *
2013+ * Licensed under the Apache License, Version 2.0 (the "License");
2014+ * you may not use this file except in compliance with the License.
2015+ * You may obtain a copy of the License at
2016+ *
2017+ * http://www.apache.org/licenses/LICENSE-2.0
2018+ *
2019+ * Unless required by applicable law or agreed to in writing, software
2020+ * distributed under the License is distributed on an "AS IS" BASIS,
2021+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2022+ * See the License for the specific language governing permissions and
2023+ * limitations under the License.
2024+ * ======================================================================== */
2025+
2026+
2027++function ($) { "use strict";
2028+
2029+ // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
2030+ // ============================================================
2031+
2032+ function transitionEnd() {
2033+ var el = document.createElement('bootstrap')
2034+
2035+ var transEndEventNames = {
2036+ 'WebkitTransition' : 'webkitTransitionEnd'
2037+ , 'MozTransition' : 'transitionend'
2038+ , 'OTransition' : 'oTransitionEnd otransitionend'
2039+ , 'transition' : 'transitionend'
2040+ }
2041+
2042+ for (var name in transEndEventNames) {
2043+ if (el.style[name] !== undefined) {
2044+ return { end: transEndEventNames[name] }
2045+ }
2046+ }
2047+ }
2048+
2049+ // http://blog.alexmaccaw.com/css-transitions
2050+ $.fn.emulateTransitionEnd = function (duration) {
2051+ var called = false, $el = this
2052+ $(this).one($.support.transition.end, function () { called = true })
2053+ var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
2054+ setTimeout(callback, duration)
2055+ return this
2056+ }
2057+
2058+ $(function () {
2059+ $.support.transition = transitionEnd()
2060+ })
2061+
2062+}(window.jQuery);
2063
2064=== removed file 'addons/web_graph/static/lib/dropdown.js'
2065--- addons/web_graph/static/lib/dropdown.js 2012-05-07 13:38:21 +0000
2066+++ addons/web_graph/static/lib/dropdown.js 1970-01-01 00:00:00 +0000
2067@@ -1,92 +0,0 @@
2068-/* ============================================================
2069- * bootstrap-dropdown.js v2.0.2
2070- * http://twitter.github.com/bootstrap/javascript.html#dropdowns
2071- * ============================================================
2072- * Copyright 2012 Twitter, Inc.
2073- *
2074- * Licensed under the Apache License, Version 2.0 (the "License");
2075- * you may not use this file except in compliance with the License.
2076- * You may obtain a copy of the License at
2077- *
2078- * http://www.apache.org/licenses/LICENSE-2.0
2079- *
2080- * Unless required by applicable law or agreed to in writing, software
2081- * distributed under the License is distributed on an "AS IS" BASIS,
2082- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2083- * See the License for the specific language governing permissions and
2084- * limitations under the License.
2085- * ============================================================ */
2086-
2087-
2088-!function( $ ){
2089-
2090- "use strict"
2091-
2092- /* DROPDOWN CLASS DEFINITION
2093- * ========================= */
2094-
2095- var toggle = '[data-toggle="dropdown"]'
2096- , Dropdown = function ( element ) {
2097- var $el = $(element).on('click.dropdown.data-api', this.toggle)
2098- $('html').on('click.dropdown.data-api', function () {
2099- $el.parent().removeClass('open')
2100- })
2101- }
2102-
2103- Dropdown.prototype = {
2104-
2105- constructor: Dropdown
2106-
2107- , toggle: function ( e ) {
2108- var $this = $(this)
2109- , selector = $this.attr('data-target')
2110- , $parent
2111- , isActive
2112-
2113- if (!selector) {
2114- selector = $this.attr('href')
2115- selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
2116- }
2117-
2118- $parent = $(selector)
2119- $parent.length || ($parent = $this.parent())
2120-
2121- isActive = $parent.hasClass('open')
2122-
2123- clearMenus()
2124- !isActive && $parent.toggleClass('open')
2125-
2126- return false
2127- }
2128-
2129- }
2130-
2131- function clearMenus() {
2132- $(toggle).parent().removeClass('open')
2133- }
2134-
2135-
2136- /* DROPDOWN PLUGIN DEFINITION
2137- * ========================== */
2138-
2139- $.fn.dropdown = function ( option ) {
2140- return this.each(function () {
2141- var $this = $(this)
2142- , data = $this.data('dropdown')
2143- if (!data) $this.data('dropdown', (data = new Dropdown(this)))
2144- if (typeof option == 'string') data[option].call($this)
2145- })
2146- }
2147-
2148- $.fn.dropdown.Constructor = Dropdown
2149-
2150-
2151- /* APPLY TO STANDARD DROPDOWN ELEMENTS
2152- * =================================== */
2153-
2154- $(function () {
2155- $('html').on('click.dropdown.data-api', clearMenus)
2156- $('body').on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
2157- })
2158-
2159-}( window.jQuery );
2160\ No newline at end of file
2161
2162=== removed directory 'addons/web_graph/static/lib/flotr2'
2163=== removed file 'addons/web_graph/static/lib/flotr2/LICENSE'
2164--- addons/web_graph/static/lib/flotr2/LICENSE 2012-05-07 08:19:08 +0000
2165+++ addons/web_graph/static/lib/flotr2/LICENSE 1970-01-01 00:00:00 +0000
2166@@ -1,19 +0,0 @@
2167-Copyright (c) 2012 Carl Sutherland
2168-
2169-Permission is hereby granted, free of charge, to any person obtaining a copy
2170-of this software and associated documentation files (the "Software"), to deal
2171-in the Software without restriction, including without limitation the rights
2172-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2173-copies of the Software, and to permit persons to whom the Software is
2174-furnished to do so, subject to the following conditions:
2175-
2176-The above copyright notice and this permission notice shall be included in
2177-all copies or substantial portions of the Software.
2178-
2179-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2180-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2181-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2182-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2183-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2184-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2185-THE SOFTWARE.
2186
2187=== removed file 'addons/web_graph/static/lib/flotr2/Makefile'
2188--- addons/web_graph/static/lib/flotr2/Makefile 2012-05-07 10:34:07 +0000
2189+++ addons/web_graph/static/lib/flotr2/Makefile 1970-01-01 00:00:00 +0000
2190@@ -1,40 +0,0 @@
2191-all: test flotr2
2192-
2193-test:
2194- cd spec; jasmine-headless-webkit -j jasmine.yml -c
2195-
2196-libraries:
2197- smoosh make/lib.json
2198- cat ./build/bean.js > build/lib.js
2199- cat ./build/underscore.js >> build/lib.js
2200- cat ./build/bean.min.js > build/lib.min.js
2201- echo ";" >> build/lib.min.js
2202- cat ./build/underscore.min.js >> build/lib.min.js
2203- echo ";" >> build/lib.min.js
2204-
2205-ie:
2206- smoosh make/ie.json
2207-
2208-flotr2: libraries ie
2209- smoosh make/flotr2.json
2210- cat build/lib.js build/flotr2.js > flotr2.js
2211- cat build/lib.min.js > flotr2.min.js
2212- cat build/flotr2.min.js >> flotr2.min.js
2213- echo ';' >> flotr2.min.js
2214- cp build/ie.min.js flotr2.ie.min.js
2215-
2216-flotr2-basic: libraries ie
2217- smoosh make/basic.json
2218- cat build/lib.min.js > flotr2-basic.min.js
2219- cat build/flotr2-basic.min.js >> flotr2-basic.min.js
2220-
2221-flotr2-standalone: ie
2222- smoosh make/flotr2.json
2223- cat build/flotr2.js > flotr2.js
2224- cp build/ie.min.js flotr2.ie.min.js
2225-
2226-flotr-examples:
2227- smoosh make/examples.json
2228- cp build/examples.min.js flotr2.examples.min.js
2229- cp build/examples-types.js flotr2.examples.types.js
2230-
2231
2232=== removed file 'addons/web_graph/static/lib/flotr2/README.md'
2233--- addons/web_graph/static/lib/flotr2/README.md 2012-05-07 08:19:08 +0000
2234+++ addons/web_graph/static/lib/flotr2/README.md 1970-01-01 00:00:00 +0000
2235@@ -1,89 +0,0 @@
2236-Flotr2
2237-======
2238-
2239-The Canvas graphing library.
2240-
2241-![Google Groups](http://groups.google.com/intl/en/images/logos/groups_logo_sm.gif)
2242-
2243-http://groups.google.com/group/flotr2/
2244-
2245-Please fork http://jsfiddle.net/cesutherland/ZFBj5/ with your question or bug reproduction case.
2246-
2247-
2248-API
2249----
2250-
2251-The API consists of a primary draw method which accepts a configuration object, helper methods, and several microlibs.
2252-
2253-### Example
2254-
2255-```javascript
2256- var
2257- // Container div:
2258- container = document.getElementById("flotr-example-graph"),
2259- // First data series:
2260- d1 = [[0, 3], [4, 8], [8, 5], [9, 13]],
2261- // Second data series:
2262- d2 = [],
2263- // A couple flotr configuration options:
2264- options = {
2265- xaxis: {
2266- minorTickFreq: 4
2267- },
2268- grid: {
2269- minorVerticalLines: true
2270- }
2271- },
2272- i, graph;
2273-
2274- // Generated second data set:
2275- for (i = 0; i < 14; i += 0.5) {
2276- d2.push([i, Math.sin(i)]);
2277- }
2278-
2279- // Draw the graph:
2280- graph = Flotr.draw(
2281- container, // Container element
2282- [ d1, d2 ], // Array of data series
2283- options // Configuration options
2284- );
2285-```
2286-
2287-### Microlibs
2288-
2289-* [underscore.js](http://documentcloud.github.com/underscore/)
2290-* [bean.js](https://github.com/fat/bean)
2291-
2292-Extending
2293----------
2294-
2295-Flotr may be extended by adding new plugins and graph types.
2296-
2297-### Graph Types
2298-
2299-Graph types define how a particular chart is rendered. Examples include line, bar, pie.
2300-
2301-Existing graph types are found in `js/types/`.
2302-
2303-### Plugins
2304-
2305-Plugins extend the core of flotr with new functionality. They can add interactions, new decorations, etc. Examples
2306-include titles, labels and selection.
2307-
2308-The plugins included are found in `js/plugins/`.
2309-
2310-Development
2311------------
2312-
2313-This project uses [smoosh](https://github.com/fat/smoosh) to build and [jasmine](http://pivotal.github.com/jasmine/)
2314-with [js-imagediff](https://github.com/HumbleSoftware/js-imagediff) to test. Tests may be executed by
2315-[jasmine-headless-webkit](http://johnbintz.github.com/jasmine-headless-webkit/) with
2316-`cd spec; jasmine-headless-webkit -j jasmine.yml -c` or by a browser by navigating to
2317-`flotr2/spec/SpecRunner.html`.
2318-
2319-Shoutouts
2320----------
2321-
2322-Thanks to Bas Wenneker, Fabien Ménager and others for all the work on the original Flotr.
2323-Thanks to Jochen Berger and Jordan Santell for their contributions to Flotr2.
2324-
2325
2326=== removed directory 'addons/web_graph/static/lib/flotr2/dev'
2327=== removed file 'addons/web_graph/static/lib/flotr2/dev/notes.txt'
2328--- addons/web_graph/static/lib/flotr2/dev/notes.txt 2012-05-07 08:19:08 +0000
2329+++ addons/web_graph/static/lib/flotr2/dev/notes.txt 1970-01-01 00:00:00 +0000
2330@@ -1,86 +0,0 @@
2331-Flotr 2 Architecture Notes
2332-
2333-
2334-Global:
2335-======
2336-
2337-Flotr.js -
2338- versioning information
2339- browser detection
2340- extension (plugins, graph types)
2341- draw
2342- clone / merge
2343- tick size
2344- tick formatter
2345- engineering notation
2346- magnitude
2347- rad, pixel, floor
2348- drawText
2349- measureText
2350- getBestTextAlign
2351- align map
2352- compatibility
2353-
2354-
2355-Graph Architecture:
2356-===================
2357-
2358-Axis -
2359- all series
2360- orientation
2361- ticks (major, minor)
2362- scale (d2p, p2d, logarithmic)
2363- notion of stacks
2364-
2365-Series -
2366- per 'data'
2367- notion of range (x, y, min, max)
2368-
2369-Graph -
2370- DOM constructon
2371- event attachment
2372- options initialization
2373- data range calculations
2374- canvas spacing calculations
2375- event normalization
2376- draw methods
2377- DOM cleanup
2378- event cleanup
2379-
2380-
2381-Utilities:
2382-==========
2383-
2384-Color
2385- build colors
2386- parse textual color data
2387- convert colors
2388- clone colors
2389-
2390-Text
2391- calculate text size
2392- canvas size
2393- html size
2394-
2395-Date
2396- formatting
2397- constants
2398-
2399-
2400-Spacing Calculation
2401-===================
2402-
2403-Flotr
2404- calculate data
2405- calculate margins
2406-
2407-Chart
2408- calculate Data Ranges - Explicit or auto data minimum, maximums
2409- calculate Data Range Extensions - By chart type, extend data range with needs of chart type (ie. stacked bars, stacked lines)
2410- add Chart Padding - By chart type
2411-
2412-Text
2413- use explicit margins
2414- calculate label margins
2415- calculate title margins
2416-
2417
2418=== removed file 'addons/web_graph/static/lib/flotr2/flotr2.examples.min.js'
2419--- addons/web_graph/static/lib/flotr2/flotr2.examples.min.js 2012-05-07 08:19:08 +0000
2420+++ addons/web_graph/static/lib/flotr2/flotr2.examples.min.js 1970-01-01 00:00:00 +0000
2421@@ -1,2 +0,0 @@
2422-
2423-(function(){var a=Flotr.EventAdapter,b=Flotr._,c="click",d="example",e="mouseenter",f="mouseleave",g=".",h="flotr-examples",i="flotr-examples-container",j="flotr-examples-reset",k="flotr-examples-thumbs",l="flotr-examples-thumb",m="flotr-examples-collapsed",n="flotr-examples-highlight",o="flotr-examples-large",p="flotr-examples-medium",q="flotr-examples-small",r="flotr-examples-mobile",s='<div class="'+l+'"></div>',t='<div class="'+h+'">'+'<div class="'+j+'">View All</div>'+'<div class="'+k+'"></div>'+'<div class="'+i+'"></div>'+"</div>";Examples=function(a){if(b.isUndefined(Flotr.ExampleList))throw"Flotr.ExampleList not defined.";this.options=a,this.list=Flotr.ExampleList,this.current=null,this.single=!1,this._initNodes(),this._example=new Flotr.Examples.Example({node:this._exampleNode}),this._initExamples()},Examples.prototype={examples:function(){function f(b){var c=$(b.currentTarget),e=c.data("example"),f=b.data.orientation;f^c.hasClass(n)&&(c.toggleClass(n).css(a),d._example.executeCallback(e,c))}var a={cursor:"pointer"},b=this._thumbsNode,c=this.list.get(),d=this,e=["basic","basic-axis","basic-bars","basic-bars-horizontal","basic-bar-stacked","basic-stacked-horizontal","basic-pie","basic-radar","basic-bubble","basic-candle","basic-legend","mouse-tracking","mouse-zoom","mouse-drag","basic-time","negative-values","click-example","download-image","download-data","advanced-titles","color-gradients","basic-timeline","advanced-markers"];(function h(){var a=e.shift(),f=c[a];if(f.type==="profile"||f.type==="test")return;var g=$(s);g.data("example",f),b.append(g),d._example.executeCallback(f,g),g.click(function(){d._loadExample(f)}),e.length&&setTimeout(h,20)})(),b.delegate(g+l,"mouseenter",{orientation:!0},f),b.delegate(g+l,"mouseleave",{orientation:!1},f)},_loadExample:function(a){a&&(window.location.hash="!"+(this.single?"single/":"")+a.key,u||(this._thumbsNode.css({position:"absolute",height:"0px",overflow:"hidden",width:"0px"}),this._resetNode.css({top:"16px"})),this._examplesNode.addClass(m),this._exampleNode.show(),this._example.setExample(a),this._resize(),$(document).scrollTop(0))},_reset:function(){window.location.hash="",u||this._thumbsNode.css({position:"",height:"",overflow:"",width:""}),this._examplesNode.removeClass(m),this._thumbsNode.height(""),this._exampleNode.hide()},_initNodes:function(){var a=$(this.options.node),b=this,c=$(t);b._resetNode=c.find(g+j),b._exampleNode=c.find(g+i),b._thumbsNode=c.find(g+k),b._examplesNode=c,b._resetNode.click(function(){b._reset()}),a.append(c),this._initResizer()},_initResizer:function(){function e(){var b=c.height()-(a.options.thumbPadding||0),e=c.width(),f;e>1760?(f=o,a._thumbsNode.height(b)):e>1140?(f=p,a._thumbsNode.height(b)):(f=q,a._thumbsNode.height("")),d!==f&&(d&&a._examplesNode.removeClass(d),a._examplesNode.addClass(f),d=f)}var a=this,b=a._examplesNode,c=$(window),d;$(window).resize(e),e(),this._resize=e},_initExamples:function(){var a=window.location.hash,b,c;a?(a=a.substring(2),c=a.split("/"),c.length==1?(b=this.list.get(a),this.examples()):c[0]=="single"&&(this.single=!0,b=this.list.get(c[1])),this._loadExample(b)):this.examples()}};var u=function(){var a=!!(navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPod/i)),b=!!$.browser.mozilla;return!a||b}();Flotr.Examples=Examples})(),function(){var a=Flotr._,b=".",c="flotr-example",d="flotr-example-label",e="flotr-example-title",f="flotr-example-description",g="flotr-example-editor",h="flotr-example-graph",i='<div class="'+c+'">'+'<div class="'+d+" "+e+'"></div>'+'<div class="'+f+'"></div>'+'<div class="'+g+'"></div>'+"</div>",j=function(a){this.options=a,this.example=null,this._initNodes()};j.prototype={setExample:function(a){var b=this.getSource(a),c=this._editorNode;this.example=a,Math.seedrandom(a.key),this._exampleNode.css({display:"block"}),this._titleNode.html(a.name||""),this._markupNode.html(a.description||""),this._editor?this._editor.setExample(b):this._editor=new Flotr.Examples.Editor(c,{example:b,teardown:function(){Flotr.EventAdapter.stopObserving($(c).find(".render")[0]),$(c).find("canvas").each(function(a,b){Flotr.EventAdapter.stopObserving(b)})}})},getSource:function(a){var b=a.callback.toString();return navigator.userAgent.search(/firefox/i)!==-1&&(b=js_beautify(b)),b},executeCallback:function(b,c){a.isElement(c)||(c=c[0]);var d=b.args?[c].concat(b.args):[c];return Math.seedrandom(b.key),b.callback.apply(this,d)},_initNodes:function(){var a=this.options.node,c=$(i);this._titleNode=c.find(b+e),this._markupNode=c.find(b+f),this._editorNode=c.find(b+g),this._exampleNode=c,a.append(c)}},Flotr.Examples.Example=j}(),function(){function Editor(a,b){function o(){i.hide(),f&&f.call(),m.render({example:d,render:h})}function p(a,b,c){var d=!1,e='<span class="error">Error: </span>',f,g;e+='<span class="message">'+a+"</span>",typeof c!="undefined"&&(e+='<span class="position">',e+='Line <span class="line">'+c+"</span>",console.log(b),b&&(e+=" of ",b==window.location?(e+='<span class="url">script</span>',!d):e+='<span class="url">'+b+"</span>"),e+=".</span>"),i.show(),i.html(e)}var c=b.type||"javascript",d=b.example||"",e=b.noRun||!1,f=b.teardown||!1,g=$(T_CONTROLS),h=$(T_RENDER),i=$(T_ERRORS),j=$(T_SOURCE),k=$(T_EDITOR),l="editor-render-"+COUNT,m,h,n;m=new TYPES[c]({onerror:p});if(!m)throw"Invalid type: API not found for type `"+c+"`.";h.attr("id",l),i.hide(),k.append(h).append(g).append(j).addClass(c).addClass(e?"no-run":""),a=$(a),a.append(k),j.append(i),d=m.example({example:d,render:h}),n=CodeMirror(j[0],{value:d,readOnly:e,lineNumbers:!0,mode:m.codeMirrorType}),e||(g.delegate(".run","click",function(){d=n.getValue(),o()}),o()),window.onerror=function(a,b,c){return p(a,b,c),console.log(a),ONERROR&&$.isFunction(ONERROR)?ONERROR(a,b,c):!1},COUNT++,this.setExample=function(a){d=m.example({example:a,render:h}),n.setValue(d),n.refresh(),o()}}var ONERROR=window.onerror,COUNT=0,TYPES={},T_CONTROLS='<div class="controls"><button class="run btn large primary">Run</button></div>',T_EDITOR='<div class="editor"></div>',T_SOURCE='<div class="source"></div>',T_ERRORS='<div class="errors"></div>',T_RENDER='<div class="render"></div>',T_IFRAME="<iframe></iframe>";TYPES.javascript=function(b){this.onerror=b.onerror},TYPES.javascript.prototype={codeMirrorType:"javascript",example:function(a){var b=a.example,c=a.render,d=$(c).attr("id");return"("+b+')(document.getElementById("'+d+'"));'},render:function(o){eval(o.example)}},TYPES.html=function(b){this.onerror=b.onerror},TYPES.html.prototype={codeMirrorType:"htmlmixed",example:function(a){return $.trim(a.example)},render:function(a){var b=a.example,c=a.render,d=$(T_IFRAME),e=this,f,g;c.html(d),f=d[0].contentWindow,g=f.document,g.open(),f.onerror=d.onerror=function(){e.onerror.apply(null,arguments)},g.write(b),g.close()}},typeof Flotr.Examples=="undefined"&&(Flotr.Examples={}),Flotr.Examples.Editor=Editor}(),function(){var a=Flotr.DOM,b=Flotr.EventAdapter,c=Flotr._,d="click",e="example-profile",f="examples",g=function(a){if(c.isUndefined(Flotr.ExampleList))throw"Flotr.ExampleList not defined.";this.editMode="off",this.list=Flotr.ExampleList,this.current=null,this.single=!1,this.init()};g.prototype=c.extend({},Flotr.Examples.prototype,{examples:function(){var e=document.getElementById(f),g=a.node("<ul></ul>"),h;c.each(this.list.getType("profile"),function(e){h=a.node("<li>"+e.name+"</li>"),a.insert(g,h),b.observe(h,d,c.bind(function(){this.example(e)},this))},this),a.insert(e,g)},example:function(a){this._renderSource(a),this.profileStart(a),setTimeout(c.bind(function(){this._renderGraph(a),this.profileEnd()},this),50)},profileStart:function(a){var b=document.getElementById(e);this._startTime=new Date,b.innerHTML='<div>Profile started for "'+a.name+'"...</div>'},profileEnd:function(a){var b=document.getElementById(e);profileTime=new Date-this._startTime,this._startTime=null,b.innerHTML+="<div>Profile complete: "+profileTime+"ms<div>"}}),Flotr.Profile=g}()
2424\ No newline at end of file
2425
2426=== removed file 'addons/web_graph/static/lib/flotr2/flotr2.examples.types.js'
2427--- addons/web_graph/static/lib/flotr2/flotr2.examples.types.js 2012-05-07 08:19:08 +0000
2428+++ addons/web_graph/static/lib/flotr2/flotr2.examples.types.js 1970-01-01 00:00:00 +0000
2429@@ -1,1425 +0,0 @@
2430-(function () {
2431-
2432-var ExampleList = function () {
2433-
2434- // Map of examples.
2435- this.examples = {};
2436-
2437-};
2438-
2439-ExampleList.prototype = {
2440-
2441- add : function (example) {
2442- this.examples[example.key] = example;
2443- },
2444-
2445- get : function (key) {
2446- return key ? (this.examples[key] || null) : this.examples;
2447- },
2448-
2449- getType : function (type) {
2450- return Flotr._.select(this.examples, function (example) {
2451- return (example.type === type);
2452- });
2453- }
2454-}
2455-
2456-Flotr.ExampleList = new ExampleList();
2457-
2458-})();
2459-
2460-(function () {
2461-
2462-Flotr.ExampleList.add({
2463- key : 'basic',
2464- name : 'Basic',
2465- callback : basic
2466-});
2467-
2468-function basic (container) {
2469-
2470- var
2471- d1 = [[0, 3], [4, 8], [8, 5], [9, 13]], // First data series
2472- d2 = [], // Second data series
2473- i, graph;
2474-
2475- // Generate first data set
2476- for (i = 0; i < 14; i += 0.5) {
2477- d2.push([i, Math.sin(i)]);
2478- }
2479-
2480- // Draw Graph
2481- graph = Flotr.draw(container, [ d1, d2 ], {
2482- xaxis: {
2483- minorTickFreq: 4
2484- },
2485- grid: {
2486- minorVerticalLines: true
2487- }
2488- });
2489-}
2490-
2491-})();
2492-
2493-(function () {
2494-
2495-Flotr.ExampleList.add({
2496- key : 'basic-stacked',
2497- name : 'Basic Stacked',
2498- callback : basic_stacked,
2499- type : 'test'
2500-});
2501-
2502-function basic_stacked (container) {
2503-
2504- var
2505- d1 = [[0, 3], [4, 8], [8, 2], [9, 3]], // First data series
2506- d2 = [[0, 2], [4, 3], [8, 8], [9, 4]], // Second data series
2507- i, graph;
2508-
2509- // Draw Graph
2510- graph = Flotr.draw(container, [ d1, d2 ], {
2511- lines: {
2512- show : true,
2513- stacked: true
2514- },
2515- xaxis: {
2516- minorTickFreq: 4
2517- },
2518- grid: {
2519- minorVerticalLines: true
2520- }
2521- });
2522-}
2523-
2524-})();
2525-
2526-(function () {
2527-
2528-Flotr.ExampleList.add({
2529- key : 'basic-stepped',
2530- name : 'Basic Stepped',
2531- callback : basic_stepped,
2532- type : 'test'
2533-});
2534-
2535-function basic_stepped (container) {
2536-
2537- var
2538- d1 = [[0, 3], [4, 8], [8, 5], [9, 13]], // First data series
2539- d2 = [], // Second data series
2540- i, graph;
2541-
2542- // Generate first data set
2543- for (i = 0; i < 14; i += 0.5) {
2544- d2.push([i, Math.sin(i)]);
2545- }
2546-
2547- // Draw Graph
2548- graph = Flotr.draw(container, [ d1, d2 ], {
2549- lines: {
2550- steps : true,
2551- show : true
2552- },
2553- xaxis: {
2554- minorTickFreq: 4
2555- },
2556- yaxis: {
2557- autoscale: true
2558- },
2559- grid: {
2560- minorVerticalLines: true
2561- },
2562- mouse : {
2563- track : true,
2564- relative : true
2565- }
2566- });
2567-}
2568-
2569-})();
2570-
2571-(function () {
2572-
2573-Flotr.ExampleList.add({
2574- key : 'basic-axis',
2575- name : 'Basic Axis',
2576- callback : basic_axis
2577-});
2578-
2579-function basic_axis (container) {
2580-
2581- var
2582- d1 = [],
2583- d2 = [],
2584- d3 = [],
2585- d4 = [],
2586- d5 = [], // Data
2587- ticks = [[ 0, "Lower"], 10, 20, 30, [40, "Upper"]], // Ticks for the Y-Axis
2588- graph;
2589-
2590- for(var i = 0; i <= 10; i += 0.1){
2591- d1.push([i, 4 + Math.pow(i,1.5)]);
2592- d2.push([i, Math.pow(i,3)]);
2593- d3.push([i, i*5+3*Math.sin(i*4)]);
2594- d4.push([i, i]);
2595- if( i.toFixed(1)%1 == 0 ){
2596- d5.push([i, 2*i]);
2597- }
2598- }
2599-
2600- d3[30][1] = null;
2601- d3[31][1] = null;
2602-
2603- function ticksFn (n) { return '('+n+')'; }
2604-
2605- graph = Flotr.draw(container, [
2606- { data : d1, label : 'y = 4 + x^(1.5)', lines : { fill : true } },
2607- { data : d2, label : 'y = x^3'},
2608- { data : d3, label : 'y = 5x + 3sin(4x)'},
2609- { data : d4, label : 'y = x'},
2610- { data : d5, label : 'y = 2x', lines : { show : true }, points : { show : true } }
2611- ], {
2612- xaxis : {
2613- noTicks : 7, // Display 7 ticks.
2614- tickFormatter : ticksFn, // Displays tick values between brackets.
2615- min : 1, // Part of the series is not displayed.
2616- max : 7.5 // Part of the series is not displayed.
2617- },
2618- yaxis : {
2619- ticks : ticks, // Set Y-Axis ticks
2620- max : 40 // Maximum value along Y-Axis
2621- },
2622- grid : {
2623- verticalLines : false,
2624- backgroundColor : {
2625- colors : [[0,'#fff'], [1,'#ccc']],
2626- start : 'top',
2627- end : 'bottom'
2628- }
2629- },
2630- legend : {
2631- position : 'nw'
2632- },
2633- title : 'Basic Axis example',
2634- subtitle : 'This is a subtitle'
2635- });
2636-}
2637-
2638-})();
2639-
2640-(function () {
2641-
2642-Flotr.ExampleList.add({
2643- key : 'basic-bars',
2644- name : 'Basic Bars',
2645- callback : basic_bars
2646-});
2647-
2648-Flotr.ExampleList.add({
2649- key : 'basic-bars-horizontal',
2650- name : 'Horizontal Bars',
2651- args : [true],
2652- callback : basic_bars,
2653- tolerance : 5
2654-});
2655-
2656-function basic_bars (container, horizontal) {
2657-
2658- var
2659- horizontal = (horizontal ? true : false), // Show horizontal bars
2660- d1 = [], // First data series
2661- d2 = [], // Second data series
2662- point, // Data point variable declaration
2663- i;
2664-
2665- for (i = 0; i < 4; i++) {
2666-
2667- if (horizontal) {
2668- point = [Math.ceil(Math.random()*10), i];
2669- } else {
2670- point = [i, Math.ceil(Math.random()*10)];
2671- }
2672-
2673- d1.push(point);
2674-
2675- if (horizontal) {
2676- point = [Math.ceil(Math.random()*10), i+0.5];
2677- } else {
2678- point = [i+0.5, Math.ceil(Math.random()*10)];
2679- }
2680-
2681- d2.push(point);
2682- };
2683-
2684- // Draw the graph
2685- Flotr.draw(
2686- container,
2687- [d1, d2],
2688- {
2689- bars : {
2690- show : true,
2691- horizontal : horizontal,
2692- shadowSize : 0,
2693- barWidth : 0.5
2694- },
2695- mouse : {
2696- track : true,
2697- relative : true
2698- },
2699- yaxis : {
2700- min : 0,
2701- autoscaleMargin : 1
2702- }
2703- }
2704- );
2705-}
2706-
2707-})();
2708-
2709-(function () {
2710-
2711-Flotr.ExampleList.add({
2712- key : 'basic-bar-stacked',
2713- name : 'Stacked Bars',
2714- callback : bars_stacked
2715-});
2716-
2717-Flotr.ExampleList.add({
2718- key : 'basic-stacked-horizontal',
2719- name : 'Stacked Horizontal Bars',
2720- args : [true],
2721- callback : bars_stacked,
2722- tolerance : 5
2723-});
2724-
2725-function bars_stacked (container, horizontal) {
2726-
2727- var
2728- d1 = [],
2729- d2 = [],
2730- d3 = [],
2731- graph, i;
2732-
2733- for (i = -10; i < 10; i++) {
2734- if (horizontal) {
2735- d1.push([Math.random(), i]);
2736- d2.push([Math.random(), i]);
2737- d3.push([Math.random(), i]);
2738- } else {
2739- d1.push([i, Math.random()]);
2740- d2.push([i, Math.random()]);
2741- d3.push([i, Math.random()]);
2742- }
2743- }
2744-
2745- graph = Flotr.draw(container,[
2746- { data : d1, label : 'Serie 1' },
2747- { data : d2, label : 'Serie 2' },
2748- { data : d3, label : 'Serie 3' }
2749- ], {
2750- legend : {
2751- backgroundColor : '#D2E8FF' // Light blue
2752- },
2753- bars : {
2754- show : true,
2755- stacked : true,
2756- horizontal : horizontal,
2757- barWidth : 0.6,
2758- lineWidth : 1,
2759- shadowSize : 0
2760- },
2761- grid : {
2762- verticalLines : horizontal,
2763- horizontalLines : !horizontal
2764- }
2765- });
2766-}
2767-
2768-})();
2769-
2770-(function () {
2771-
2772-Flotr.ExampleList.add({
2773- key : 'basic-pie',
2774- name : 'Basic Pie',
2775- callback : basic_pie
2776-});
2777-
2778-function basic_pie (container) {
2779-
2780- var
2781- d1 = [[0, 4]],
2782- d2 = [[0, 3]],
2783- d3 = [[0, 1.03]],
2784- d4 = [[0, 3.5]],
2785- graph;
2786-
2787- graph = Flotr.draw(container, [
2788- { data : d1, label : 'Comedy' },
2789- { data : d2, label : 'Action' },
2790- { data : d3, label : 'Romance',
2791- pie : {
2792- explode : 50
2793- }
2794- },
2795- { data : d4, label : 'Drama' }
2796- ], {
2797- HtmlText : false,
2798- grid : {
2799- verticalLines : false,
2800- horizontalLines : false
2801- },
2802- xaxis : { showLabels : false },
2803- yaxis : { showLabels : false },
2804- pie : {
2805- show : true,
2806- explode : 6
2807- },
2808- mouse : { track : true },
2809- legend : {
2810- position : 'se',
2811- backgroundColor : '#D2E8FF'
2812- }
2813- });
2814-}
2815-
2816-})();
2817-
2818-(function () {
2819-
2820-Flotr.ExampleList.add({
2821- key : 'basic-radar',
2822- name : 'Basic Radar',
2823- callback : basic_radar
2824-});
2825-
2826-function basic_radar (container) {
2827-
2828- // Fill series s1 and s2.
2829- var
2830- s1 = { label : 'Actual', data : [[0, 3], [1, 8], [2, 5], [3, 5], [4, 3], [5, 9]] },
2831- s2 = { label : 'Target', data : [[0, 8], [1, 7], [2, 8], [3, 2], [4, 4], [5, 7]] },
2832- graph, ticks;
2833-
2834- // Radar Labels
2835- ticks = [
2836- [0, "Statutory"],
2837- [1, "External"],
2838- [2, "Videos"],
2839- [3, "Yippy"],
2840- [4, "Management"],
2841- [5, "oops"]
2842- ];
2843-
2844- // Draw the graph.
2845- graph = Flotr.draw(container, [ s1, s2 ], {
2846- radar : { show : true},
2847- grid : { circular : true, minorHorizontalLines : true},
2848- yaxis : { min : 0, max : 10, minorTickFreq : 2},
2849- xaxis : { ticks : ticks}
2850- });
2851-}
2852-
2853-})();
2854-
2855-(function () {
2856-
2857-Flotr.ExampleList.add({
2858- key : 'basic-bubble',
2859- name : 'Basic Bubble',
2860- callback : basic_bubble
2861-});
2862-
2863-function basic_bubble (container) {
2864-
2865- var
2866- d1 = [],
2867- d2 = [],
2868- point, graph, i;
2869-
2870- for (i = 0; i < 10; i++ ){
2871- point = [i, Math.ceil(Math.random()*10), Math.ceil(Math.random()*10)];
2872- d1.push(point);
2873-
2874- point = [i, Math.ceil(Math.random()*10), Math.ceil(Math.random()*10)];
2875- d2.push(point);
2876- }
2877-
2878- // Draw the graph
2879- graph = Flotr.draw(container, [d1, d2], {
2880- bubbles : { show : true, baseRadius : 5 },
2881- xaxis : { min : -4, max : 14 },
2882- yaxis : { min : -4, max : 14 }
2883- });
2884-}
2885-
2886-})();
2887-
2888-(function () {
2889-
2890-Flotr.ExampleList.add({
2891- key : 'basic-candle',
2892- name : 'Basic Candle',
2893- callback : basic_candle
2894-});
2895-
2896-function basic_candle (container) {
2897-
2898- var
2899- d1 = [],
2900- price = 3.206,
2901- graph,
2902- i, a, b, c;
2903-
2904- for (i = 0; i < 50; i++) {
2905- a = Math.random();
2906- b = Math.random();
2907- c = (Math.random() * (a + b)) - b;
2908- d1.push([i, price, price + a, price - b, price + c]);
2909- price = price + c;
2910- }
2911-
2912- // Graph
2913- graph = Flotr.draw(container, [ d1 ], {
2914- candles : { show : true, candleWidth : 0.6 },
2915- xaxis : { noTicks : 10 }
2916- });
2917-}
2918-
2919-})();
2920-
2921-
2922-(function () {
2923-
2924-Flotr.ExampleList.add({
2925- key : 'basic-legend',
2926- name : 'Basic Legend',
2927- callback : basic_legend
2928-});
2929-
2930-function basic_legend (container) {
2931-
2932- var
2933- d1 = [],
2934- d2 = [],
2935- d3 = [],
2936- data,
2937- graph, i;
2938-
2939- // Data Generation
2940- for (i = 0; i < 15; i += 0.5) {
2941- d1.push([i, i + Math.sin(i+Math.PI)]);
2942- d2.push([i, i]);
2943- d3.push([i, 15-Math.cos(i)]);
2944- }
2945-
2946- data = [
2947- { data : d1, label :'x + sin(x+&pi;)' },
2948- { data : d2, label :'x' },
2949- { data : d3, label :'15 - cos(x)' }
2950- ];
2951-
2952-
2953- // This function prepend each label with 'y = '
2954- function labelFn (label) {
2955- return 'y = ' + label;
2956- }
2957-
2958- // Draw graph
2959- graph = Flotr.draw(container, data, {
2960- legend : {
2961- position : 'se', // Position the legend 'south-east'.
2962- labelFormatter : labelFn, // Format the labels.
2963- backgroundColor : '#D2E8FF' // A light blue background color.
2964- },
2965- HtmlText : false
2966- });
2967-}
2968-
2969-})();
2970-
2971-(function () {
2972-
2973-Flotr.ExampleList.add({
2974- key : 'mouse-tracking',
2975- name : 'Mouse Tracking',
2976- callback : mouse_tracking
2977-});
2978-
2979-function mouse_tracking (container) {
2980-
2981- var
2982- d1 = [],
2983- d2 = [],
2984- d3 = [],
2985- graph, i;
2986-
2987- for (i = 0; i < 20; i += 0.5) {
2988- d1.push([i, 2*i]);
2989- d2.push([i, i*1.5+1.5*Math.sin(i)]);
2990- d3.push([i, 3*Math.cos(i)+10]);
2991- }
2992-
2993- graph = Flotr.draw(
2994- container,
2995- [
2996- {
2997- data : d1,
2998- mouse : { track : false } // Disable mouse tracking for d1
2999- },
3000- d2,
3001- d3
3002- ],
3003- {
3004- mouse : {
3005- track : true, // Enable mouse tracking
3006- lineColor : 'purple',
3007- relative : true,
3008- position : 'ne',
3009- sensibility : 1,
3010- trackDecimals : 2,
3011- trackFormatter : function (o) { return 'x = ' + o.x +', y = ' + o.y; }
3012- },
3013- crosshair : {
3014- mode : 'xy'
3015- }
3016- }
3017- );
3018-
3019-};
3020-
3021-})();
3022-
3023-(function () {
3024-
3025-Flotr.ExampleList.add({
3026- key : 'mouse-zoom',
3027- name : 'Mouse Zoom',
3028- callback : mouse_zoom,
3029- description : "<p>Select an area of the graph to zoom. Click to reset the chart.</p>"
3030-});
3031-
3032-function mouse_zoom (container) {
3033-
3034- var
3035- d1 = [],
3036- d2 = [],
3037- d3 = [],
3038- options,
3039- graph,
3040- i;
3041-
3042- for (i = 0; i < 40; i += 0.5) {
3043- d1.push([i, Math.sin(i)+3*Math.cos(i)]);
3044- d2.push([i, Math.pow(1.1, i)]);
3045- d3.push([i, 40 - i+Math.random()*10]);
3046- }
3047-
3048- options = {
3049- selection : { mode : 'x', fps : 30 },
3050- title : 'Mouse Zoom'
3051- };
3052-
3053- // Draw graph with default options, overwriting with passed options
3054- function drawGraph (opts) {
3055-
3056- // Clone the options, so the 'options' variable always keeps intact.
3057- var o = Flotr._.extend(Flotr._.clone(options), opts || {});
3058-
3059- // Return a new graph.
3060- return Flotr.draw(
3061- container,
3062- [ d1, d2, d3 ],
3063- o
3064- );
3065- }
3066-
3067- // Actually draw the graph.
3068- graph = drawGraph();
3069-
3070- // Hook into the 'flotr:select' event.
3071- Flotr.EventAdapter.observe(container, 'flotr:select', function (area) {
3072-
3073- // Draw graph with new area
3074- f = drawGraph({
3075- xaxis: {min:area.x1, max:area.x2},
3076- yaxis: {min:area.y1, max:area.y2}
3077- });
3078-
3079- });
3080-
3081- // When graph is clicked, draw the graph with default area.
3082- Flotr.EventAdapter.observe(container, 'flotr:click', function () { drawGraph(); });
3083-};
3084-
3085-})();
3086-
3087-
3088-(function () {
3089-
3090-Flotr.ExampleList.add({
3091- key : 'mouse-drag',
3092- name : 'Mouse Drag',
3093- callback : mouse_drag
3094-});
3095-
3096-function mouse_drag (container) {
3097-
3098- var
3099- d1 = [],
3100- d2 = [],
3101- d3 = [],
3102- options,
3103- graph,
3104- start,
3105- i;
3106-
3107- for (i = -40; i < 40; i += 0.5) {
3108- d1.push([i, Math.sin(i)+3*Math.cos(i)]);
3109- d2.push([i, Math.pow(1.1, i)]);
3110- d3.push([i, 40 - i+Math.random()*10]);
3111- }
3112-
3113- options = {
3114- xaxis: {min: 0, max: 20},
3115- title : 'Mouse Drag'
3116- };
3117-
3118- // Draw graph with default options, overwriting with passed options
3119- function drawGraph (opts) {
3120-
3121- // Clone the options, so the 'options' variable always keeps intact.
3122- var o = Flotr._.extend(Flotr._.clone(options), opts || {});
3123-
3124- // Return a new graph.
3125- return Flotr.draw(
3126- container,
3127- [ d1, d2, d3 ],
3128- o
3129- );
3130- }
3131-
3132- graph = drawGraph();
3133-
3134- function initializeDrag (e) {
3135- start = graph.getEventPosition(e);
3136- Flotr.EventAdapter.observe(document, 'mousemove', move);
3137- Flotr.EventAdapter.observe(document, 'mouseup', stopDrag);
3138- }
3139-
3140- function move (e) {
3141- var
3142- end = graph.getEventPosition(e),
3143- xaxis = graph.axes.x,
3144- offset = start.x - end.x;
3145-
3146- graph = drawGraph({
3147- xaxis : {
3148- min : xaxis.min + offset,
3149- max : xaxis.max + offset
3150- }
3151- });
3152- // @todo: refector initEvents in order not to remove other observed events
3153- Flotr.EventAdapter.observe(graph.overlay, 'mousedown', initializeDrag);
3154- }
3155-
3156- function stopDrag () {
3157- Flotr.EventAdapter.stopObserving(document, 'mousemove', move);
3158- }
3159-
3160- Flotr.EventAdapter.observe(graph.overlay, 'mousedown', initializeDrag);
3161-
3162-};
3163-
3164-})();
3165-
3166-(function () {
3167-
3168-Flotr.ExampleList.add({
3169- key : 'basic-time',
3170- name : 'Basic Time',
3171- callback : basic_time,
3172- description : "<p>Select an area of the graph to zoom. Click to reset the chart.</p>"
3173-});
3174-
3175-function basic_time (container) {
3176-
3177- var
3178- d1 = [],
3179- start = new Date("2009/01/01 01:00").getTime(),
3180- options,
3181- graph,
3182- i, x, o;
3183-
3184- for (i = 0; i < 100; i++) {
3185- x = start+(i*1000*3600*24*36.5);
3186- d1.push([x, i+Math.random()*30+Math.sin(i/20+Math.random()*2)*20+Math.sin(i/10+Math.random())*10]);
3187- }
3188-
3189- options = {
3190- xaxis : {
3191- mode : 'time',
3192- labelsAngle : 45
3193- },
3194- selection : {
3195- mode : 'x'
3196- },
3197- HtmlText : false,
3198- title : 'Time'
3199- };
3200-
3201- // Draw graph with default options, overwriting with passed options
3202- function drawGraph (opts) {
3203-
3204- // Clone the options, so the 'options' variable always keeps intact.
3205- o = Flotr._.extend(Flotr._.clone(options), opts || {});
3206-
3207- // Return a new graph.
3208- return Flotr.draw(
3209- container,
3210- [ d1 ],
3211- o
3212- );
3213- }
3214-
3215- graph = drawGraph();
3216-
3217- Flotr.EventAdapter.observe(container, 'flotr:select', function(area){
3218- // Draw selected area
3219- graph = drawGraph({
3220- xaxis : { min : area.x1, max : area.x2, mode : 'time', labelsAngle : 45 },
3221- yaxis : { min : area.y1, max : area.y2 }
3222- });
3223- });
3224-
3225- // When graph is clicked, draw the graph with default area.
3226- Flotr.EventAdapter.observe(container, 'flotr:click', function () { graph = drawGraph(); });
3227-};
3228-
3229-})();
3230-
3231-(function () {
3232-
3233-Flotr.ExampleList.add({
3234- key : 'negative-values',
3235- name : 'Negative Values',
3236- callback : negative_values
3237-});
3238-
3239-function negative_values (container) {
3240-
3241- var
3242- d0 = [], // Line through y = 0
3243- d1 = [], // Random data presented as a scatter plot.
3244- d2 = [], // A regression line for the scatter.
3245- sx = 0,
3246- sy = 0,
3247- sxy = 0,
3248- sxsq = 0,
3249- xmean,
3250- ymean,
3251- alpha,
3252- beta,
3253- n, x, y;
3254-
3255- for (n = 0; n < 20; n++){
3256-
3257- x = n;
3258- y = x + Math.random()*8 - 15;
3259-
3260- d0.push([x, 0]);
3261- d1.push([x, y]);
3262-
3263- // Computations used for regression line
3264- sx += x;
3265- sy += y;
3266- sxy += x*y;
3267- sxsq += Math.pow(x,2);
3268- }
3269-
3270- xmean = sx/n;
3271- ymean = sy/n;
3272- beta = ((n*sxy) - (sx*sy))/((n*sxsq)-(Math.pow(sx,2)));
3273- alpha = ymean - (beta * xmean);
3274-
3275- // Compute the regression line.
3276- for (n = 0; n < 20; n++){
3277- d2.push([n, alpha + beta*n])
3278- }
3279-
3280- // Draw the graph
3281- graph = Flotr.draw(
3282- container, [
3283- { data : d0, shadowSize : 0, color : '#545454' }, // Horizontal
3284- { data : d1, label : 'y = x + (Math.random() * 8) - 15', points : { show : true } }, // Scatter
3285- { data : d2, label : 'y = ' + alpha.toFixed(2) + ' + ' + beta.toFixed(2) + '*x' } // Regression
3286- ],
3287- {
3288- legend : { position : 'se', backgroundColor : '#D2E8FF' },
3289- title : 'Negative Values'
3290- }
3291- );
3292-};
3293-
3294-})();
3295-
3296-(function () {
3297-
3298-Flotr.ExampleList.add({
3299- key : 'click-example',
3300- name : 'Click Example',
3301- callback : click_example
3302-});
3303-
3304-function click_example (container) {
3305-
3306- var
3307- d1 = [[0,0]], // Point at origin
3308- options,
3309- graph;
3310-
3311- options = {
3312- xaxis: {min: 0, max: 15},
3313- yaxis: {min: 0, max: 15},
3314- lines: {show: true},
3315- points: {show: true},
3316- mouse: {track:true},
3317- title: 'Click Example'
3318- };
3319-
3320- graph = Flotr.draw(container, [d1], options);
3321-
3322- // Add a point to the series and redraw the graph
3323- Flotr.EventAdapter.observe(container, 'flotr:click', function(position){
3324-
3325- // Add a point to the series at the location of the click
3326- d1.push([position.x, position.y]);
3327-
3328- // Sort the series.
3329- d1 = d1.sort(function (a, b) { return a[0] - b[0]; });
3330-
3331- // Redraw the graph, with the new series.
3332- graph = Flotr.draw(container, [d1], options);
3333- });
3334-};
3335-
3336-})();
3337-
3338-(function () {
3339-
3340-Flotr.ExampleList.add({
3341- key : 'download-image',
3342- name : 'Download Image',
3343- callback : download_image,
3344- description : '' +
3345- '<form name="image-download" id="image-download" action="" onsubmit="return false">' +
3346- '<label><input type="radio" name="format" value="png" checked="checked" /> PNG</label>' +
3347- '<label><input type="radio" name="format" value="jpeg" /> JPEG</label>' +
3348-
3349- '<button name="to-image" onclick="CurrentExample(\'to-image\')">To Image</button>' +
3350- '<button name="download" onclick="CurrentExample(\'download\')">Download</button>' +
3351- '<button name="reset" onclick="CurrentExample(\'reset\')">Reset</button>' +
3352- '</form>'
3353-});
3354-
3355-function download_image (container) {
3356-
3357- var
3358- d1 = [],
3359- d2 = [],
3360- d3 = [],
3361- d4 = [],
3362- d5 = [],
3363- graph,
3364- i;
3365-
3366- for (i = 0; i <= 10; i += 0.1) {
3367- d1.push([i, 4 + Math.pow(i,1.5)]);
3368- d2.push([i, Math.pow(i,3)]);
3369- d3.push([i, i*5+3*Math.sin(i*4)]);
3370- d4.push([i, i]);
3371- if( i.toFixed(1)%1 == 0 ){
3372- d5.push([i, 2*i]);
3373- }
3374- }
3375-
3376- // Draw the graph
3377- graph = Flotr.draw(
3378- container,[
3379- {data:d1, label:'y = 4 + x^(1.5)', lines:{fill:true}},
3380- {data:d2, label:'y = x^3', yaxis:2},
3381- {data:d3, label:'y = 5x + 3sin(4x)'},
3382- {data:d4, label:'y = x'},
3383- {data:d5, label:'y = 2x', lines: {show: true}, points: {show: true}}
3384- ],{
3385- title: 'Download Image Example',
3386- subtitle: 'You can save me as an image',
3387- xaxis:{
3388- noTicks: 7, // Display 7 ticks.
3389- tickFormatter: function(n){ return '('+n+')'; }, // => displays tick values between brackets.
3390- min: 1, // => part of the series is not displayed.
3391- max: 7.5, // => part of the series is not displayed.
3392- labelsAngle: 45,
3393- title: 'x Axis'
3394- },
3395- yaxis:{
3396- ticks: [[0, "Lower"], 10, 20, 30, [40, "Upper"]],
3397- max: 40,
3398- title: 'y = f(x)'
3399- },
3400- y2axis:{color:'#FF0000', max: 500, title: 'y = x^3'},
3401- grid:{
3402- verticalLines: false,
3403- backgroundColor: 'white'
3404- },
3405- HtmlText: false,
3406- legend: {
3407- position: 'nw'
3408- }
3409- });
3410-
3411- this.CurrentExample = function (operation) {
3412-
3413- var
3414- format = $('#image-download input:radio[name=format]:checked').val();
3415- if (Flotr.isIE && Flotr.isIE < 9) {
3416- alert(
3417- "Your browser doesn't allow you to get a bitmap image from the plot, " +
3418- "you can only get a VML image that you can use in Microsoft Office.<br />"
3419- );
3420- }
3421-
3422- if (operation == 'to-image') {
3423- graph.download.saveImage(format, null, null, true)
3424- } else if (operation == 'download') {
3425- graph.download.saveImage(format);
3426- } else if (operation == 'reset') {
3427- graph.download.restoreCanvas();
3428- }
3429- };
3430-
3431- return graph;
3432-};
3433-
3434-})();
3435-
3436-(function () {
3437-
3438-Flotr.ExampleList.add({
3439- key : 'download-data',
3440- name : 'Download Data',
3441- callback : download_data
3442-});
3443-
3444-function download_data (container) {
3445-
3446- var
3447- d1 = [],
3448- d2 = [],
3449- d3 = [],
3450- d4 = [],
3451- d5 = [],
3452- graph,
3453- i,x;
3454-
3455- for (i = 0; i <= 100; i += 1) {
3456- x = i / 10;
3457- d1.push([x, 4 + Math.pow(x,1.5)]);
3458- d2.push([x, Math.pow(x,3)]);
3459- d3.push([x, i*5+3*Math.sin(x*4)]);
3460- d4.push([x, x]);
3461- if(x%1 === 0 ){
3462- d5.push([x, 2*x]);
3463- }
3464- }
3465-
3466- // Draw the graph.
3467- graph = Flotr.draw(
3468- container, [
3469- { data : d1, label : 'y = 4 + x^(1.5)', lines : { fill : true } },
3470- { data : d2, label : 'y = x^3' },
3471- { data : d3, label : 'y = 5x + 3sin(4x)' },
3472- { data : d4, label : 'y = x' },
3473- { data : d5, label : 'y = 2x', lines : { show : true }, points : { show : true } }
3474- ],{
3475- xaxis : {
3476- noTicks : 7,
3477- tickFormatter : function (n) { return '('+n+')'; },
3478- min: 1, // Part of the series is not displayed.
3479- max: 7.5
3480- },
3481- yaxis : {
3482- ticks : [[ 0, "Lower"], 10, 20, 30, [40, "Upper"]],
3483- max : 40
3484- },
3485- grid : {
3486- verticalLines : false,
3487- backgroundColor : 'white'
3488- },
3489- legend : {
3490- position : 'nw'
3491- },
3492- spreadsheet : {
3493- show : true,
3494- tickFormatter : function (e) { return e+''; }
3495- }
3496- });
3497-};
3498-
3499-})();
3500-
3501-(function () {
3502-
3503-Flotr.ExampleList.add({
3504- key : 'advanced-titles',
3505- name : 'Advanced Titles',
3506- callback : advanced_titles
3507-});
3508-
3509-function advanced_titles (container) {
3510-
3511- var
3512- d1 = [],
3513- d2 = [],
3514- d3 = [],
3515- d4 = [],
3516- d5 = [],
3517- graph,
3518- i;
3519-
3520- for (i = 0; i <= 10; i += 0.1) {
3521- d1.push([i, 4 + Math.pow(i,1.5)]);
3522- d2.push([i, Math.pow(i,3)]);
3523- d3.push([i, i*5+3*Math.sin(i*4)]);
3524- d4.push([i, i]);
3525- if (i.toFixed(1)%1 == 0) {
3526- d5.push([i, 2*i]);
3527- }
3528- }
3529-
3530- // Draw the graph.
3531- graph = Flotr.draw(
3532- container,[
3533- { data : d1, label : 'y = 4 + x^(1.5)', lines : { fill : true } },
3534- { data : d2, label : 'y = x^3', yaxis : 2 },
3535- { data : d3, label : 'y = 5x + 3sin(4x)' },
3536- { data : d4, label : 'y = x' },
3537- { data : d5, label : 'y = 2x', lines : { show : true }, points : { show : true } }
3538- ], {
3539- title : 'Advanced Titles Example',
3540- subtitle : 'You can save me as an image',
3541- xaxis : {
3542- noTicks : 7,
3543- tickFormatter : function (n) { return '('+n+')'; },
3544- min : 1,
3545- max : 7.5,
3546- labelsAngle : 45,
3547- title : 'x Axis'
3548- },
3549- yaxis : {
3550- ticks : [[0, "Lower"], 10, 20, 30, [40, "Upper"]],
3551- max : 40,
3552- title : 'y = f(x)'
3553- },
3554- y2axis : { color : '#FF0000', max : 500, title : 'y = x^3' },
3555- grid : {
3556- verticalLines : false,
3557- backgroundColor : 'white'
3558- },
3559- HtmlText : false,
3560- legend : {
3561- position : 'nw'
3562- }
3563- });
3564-};
3565-
3566-})();
3567-
3568-(function () {
3569-
3570-Flotr.ExampleList.add({
3571- key : 'color-gradients',
3572- name : 'Color Gradients',
3573- callback : color_gradients
3574-});
3575-
3576-function color_gradients (container) {
3577-
3578- var
3579- bars = {
3580- data: [],
3581- bars: {
3582- show: true,
3583- barWidth: 0.8,
3584- lineWidth: 0,
3585- fillColor: {
3586- colors: ['#CB4B4B', '#fff'],
3587- start: 'top',
3588- end: 'bottom'
3589- },
3590- fillOpacity: 0.8
3591- }
3592- }, markers = {
3593- data: [],
3594- markers: {
3595- show: true,
3596- position: 'ct'
3597- }
3598- }, lines = {
3599- data: [],
3600- lines: {
3601- show: true,
3602- fillColor: ['#00A8F0', '#fff'],
3603- fill: true,
3604- fillOpacity: 1
3605- }
3606- },
3607- point,
3608- graph,
3609- i;
3610-
3611- for (i = 0; i < 8; i++) {
3612- point = [i, Math.ceil(Math.random() * 10)];
3613- bars.data.push(point);
3614- markers.data.push(point);
3615- }
3616-
3617- for (i = -1; i < 9; i += 0.01){
3618- lines.data.push([i, i*i/8+2]);
3619- }
3620-
3621- graph = Flotr.draw(
3622- container,
3623- [lines, bars, markers], {
3624- yaxis: {
3625- min: 0,
3626- max: 11
3627- },
3628- xaxis: {
3629- min: -0.5,
3630- max: 7.5
3631- },
3632- grid: {
3633- verticalLines: false,
3634- backgroundColor: ['#fff', '#ccc']
3635- }
3636- }
3637- );
3638-};
3639-
3640-})();
3641-
3642-
3643-(function () {
3644-
3645-Flotr.ExampleList.add({
3646- key : 'profile-bars',
3647- name : 'Profile Bars',
3648- type : 'profile',
3649- callback : profile_bars
3650-});
3651-
3652-/*
3653-Flotr.ExampleList.add({
3654- key : 'basic-bars-horizontal',
3655- name : 'Horizontal Bars',
3656- args : [true],
3657- callback : basic_bars
3658-});
3659-*/
3660-
3661-function profile_bars (container, horizontal) {
3662-
3663- var
3664- horizontal = (horizontal ? true : false), // Show horizontal bars
3665- d1 = [], // First data series
3666- d2 = [], // Second data series
3667- point, // Data point variable declaration
3668- i;
3669-
3670- for (i = 0; i < 5000; i++) {
3671-
3672- if (horizontal) {
3673- point = [Math.ceil(Math.random()*10), i];
3674- } else {
3675- point = [i, Math.ceil(Math.random()*10)];
3676- }
3677-
3678- d1.push(point);
3679-
3680- if (horizontal) {
3681- point = [Math.ceil(Math.random()*10), i+0.5];
3682- } else {
3683- point = [i+0.5, Math.ceil(Math.random()*10)];
3684- }
3685-
3686- d2.push(point);
3687- };
3688-
3689- // Draw the graph
3690- Flotr.draw(
3691- container,
3692- [d1, d2],
3693- {
3694- bars : {
3695- show : true,
3696- horizontal : horizontal,
3697- barWidth : 0.5
3698- },
3699- mouse : {
3700- track : true,
3701- relative : true
3702- },
3703- yaxis : {
3704- min : 0,
3705- autoscaleMargin : 1
3706- }
3707- }
3708- );
3709-}
3710-
3711-})();
3712-
3713-(function () {
3714-
3715-Flotr.ExampleList.add({
3716- key : 'basic-timeline',
3717- name : 'Basic Timeline',
3718- callback : basic_timeline
3719-});
3720-
3721-function basic_timeline (container) {
3722-
3723- var
3724- d1 = [[1, 4, 5]],
3725- d2 = [[3.2, 3, 4]],
3726- d3 = [[1.9, 2, 2], [5, 2, 3.3]],
3727- d4 = [[1.55, 1, 9]],
3728- d5 = [[5, 0, 2.3]],
3729- data = [],
3730- timeline = { show : true, barWidth : .5 },
3731- markers = [],
3732- labels = ['Obama', 'Bush', 'Clinton', 'Palin', 'McCain'],
3733- i, graph, point;
3734-
3735- // Timeline
3736- Flotr._.each([d1, d2, d3, d4, d5], function (d) {
3737- data.push({
3738- data : d,
3739- timeline : Flotr._.clone(timeline)
3740- });
3741- });
3742-
3743- // Markers
3744- Flotr._.each([d1, d2, d3, d4, d5], function (d) {
3745- point = d[0];
3746- markers.push([point[0], point[1]]);
3747- });
3748- data.push({
3749- data: markers,
3750- markers: {
3751- show: true,
3752- position: 'rm',
3753- fontSize: 11,
3754- labelFormatter : function (o) { return labels[o.index]; }
3755- }
3756- });
3757-
3758- // Draw Graph
3759- graph = Flotr.draw(container, data, {
3760- xaxis: {
3761- noTicks: 3,
3762- tickFormatter: function (x) {
3763- var
3764- x = parseInt(x),
3765- months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
3766- return months[(x-1)%12];
3767- }
3768- },
3769- yaxis: {
3770- showLabels : false
3771- },
3772- grid: {
3773- horizontalLines : false
3774- }
3775- });
3776-}
3777-
3778-})();
3779-
3780-(function () {
3781-
3782-Flotr.ExampleList.add({
3783- key : 'advanced-markers',
3784- name : 'Advanced Markers',
3785- callback : advanced_markers,
3786- timeout : 150
3787-});
3788-
3789-function advanced_markers (container) {
3790-
3791- var
3792- xmark = new Image(),
3793- checkmark = new Image(),
3794- bars = {
3795- data: [],
3796- bars: {
3797- show: true,
3798- barWidth: 0.6,
3799- lineWidth: 0,
3800- fillOpacity: 0.8
3801- }
3802- }, markers = {
3803- data: [],
3804- markers: {
3805- show: true,
3806- position: 'ct',
3807- labelFormatter: function (o) {
3808- return (o.y >= 5) ? checkmark : xmark;
3809- }
3810- }
3811- },
3812- flotr = Flotr,
3813- point,
3814- graph,
3815- i;
3816-
3817-
3818- for (i = 0; i < 8; i++) {
3819- point = [i, Math.ceil(Math.random() * 10)];
3820- bars.data.push(point);
3821- markers.data.push(point);
3822- }
3823-
3824- var runner = function () {
3825- if (!xmark.complete || !checkmark.complete) {
3826- setTimeout(runner, 50);
3827- return;
3828- }
3829-
3830- graph = flotr.draw(
3831- container,
3832- [bars, markers], {
3833- yaxis: {
3834- min: 0,
3835- max: 11
3836- },
3837- xaxis: {
3838- min: -0.5,
3839- max: 7.5
3840- },
3841- grid: {
3842- verticalLines: false
3843- }
3844- }
3845- );
3846- }
3847-
3848- xmark.onload = runner;
3849- xmark.src = 'images/xmark.png';
3850- checkmark.src = 'images/checkmark.png';
3851-};
3852-
3853-})();
3854-
3855
3856=== removed file 'addons/web_graph/static/lib/flotr2/flotr2.ie.min.js'
3857--- addons/web_graph/static/lib/flotr2/flotr2.ie.min.js 2012-05-07 08:19:08 +0000
3858+++ addons/web_graph/static/lib/flotr2/flotr2.ie.min.js 1970-01-01 00:00:00 +0000
3859@@ -1,33 +0,0 @@
3860-// Copyright 2006 Google Inc.
3861-//
3862-// Licensed under the Apache License, Version 2.0 (the "License");
3863-// you may not use this file except in compliance with the License.
3864-// You may obtain a copy of the License at
3865-//
3866-// http://www.apache.org/licenses/LICENSE-2.0
3867-//
3868-// Unless required by applicable law or agreed to in writing, software
3869-// distributed under the License is distributed on an "AS IS" BASIS,
3870-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3871-// See the License for the specific language governing permissions and
3872-// limitations under the License.
3873-// Known Issues:
3874-//
3875-// * Patterns only support repeat.
3876-// * Radial gradient are not implemented. The VML version of these look very
3877-// different from the canvas one.
3878-// * Clipping paths are not implemented.
3879-// * Coordsize. The width and height attribute have higher priority than the
3880-// width and height style values which isn't correct.
3881-// * Painting mode isn't implemented.
3882-// * Canvas width/height should is using content-box by default. IE in
3883-// Quirks mode will draw the canvas using border-box. Either change your
3884-// doctype to HTML5
3885-// (http://www.whatwg.org/specs/web-apps/current-work/#the-doctype)
3886-// or use Box Sizing Behavior from WebFX
3887-// (http://webfx.eae.net/dhtml/boxsizing/boxsizing.html)
3888-// * Non uniform scaling does not correctly scale strokes.
3889-// * Optimize. There is always room for speed improvements.
3890-// Only add this code if we do not already have a canvas implementation
3891-
3892-document.createElement("canvas").getContext||function(){function j(){return this.context_||(this.context_=new N(this))}function l(a,b,c){var d=k.call(arguments,2);return function(){return a.apply(b,d.concat(k.call(arguments)))}}function m(a){return String(a).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}function n(a,b,c){a.namespaces[b]||a.namespaces.add(b,c,"#default#VML")}function o(a){n(a,"g_vml_","urn:schemas-microsoft-com:vml"),n(a,"g_o_","urn:schemas-microsoft-com:office:office");if(!a.styleSheets.ex_canvas_){var b=a.createStyleSheet();b.owningElement.id="ex_canvas_",b.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function q(a){var b=a.srcElement;switch(a.propertyName){case"width":b.getContext().clearRect(),b.style.width=b.attributes.width.nodeValue+"px",b.firstChild&&(b.firstChild.style.width=b.clientWidth+"px");break;case"height":b.getContext().clearRect(),b.style.height=b.attributes.height.nodeValue+"px",b.firstChild&&(b.firstChild.style.height=b.clientHeight+"px")}}function r(a){var b=a.srcElement;b.firstChild&&(b.firstChild.style.width=b.clientWidth+"px",b.firstChild.style.height=b.clientHeight+"px")}function v(){return[[1,0,0],[0,1,0],[0,0,1]]}function w(a,b){var c=v();for(var d=0;d<3;d++)for(var e=0;e<3;e++){var f=0;for(var g=0;g<3;g++)f+=a[d][g]*b[g][e];c[d][e]=f}return c}function x(a,b){b.fillStyle=a.fillStyle,b.lineCap=a.lineCap,b.lineJoin=a.lineJoin,b.lineWidth=a.lineWidth,b.miterLimit=a.miterLimit,b.shadowBlur=a.shadowBlur,b.shadowColor=a.shadowColor,b.shadowOffsetX=a.shadowOffsetX,b.shadowOffsetY=a.shadowOffsetY,b.strokeStyle=a.strokeStyle,b.globalAlpha=a.globalAlpha,b.font=a.font,b.textAlign=a.textAlign,b.textBaseline=a.textBaseline,b.arcScaleX_=a.arcScaleX_,b.arcScaleY_=a.arcScaleY_,b.lineScale_=a.lineScale_}function z(a){var b=a.indexOf("(",3),c=a.indexOf(")",b+1),d=a.substring(b+1,c).split(",");if(d.length!=4||a.charAt(3)!="a")d[3]=1;return d}function A(a){return parseFloat(a)/100}function B(a,b,c){return Math.min(c,Math.max(b,a))}function C(a){var b,c,d,e,f,g;e=parseFloat(a[0])/360%360,e<0&&e++,f=B(A(a[1]),0,1),g=B(A(a[2]),0,1);if(f==0)b=c=d=g;else{var h=g<.5?g*(1+f):g+f-g*f,i=2*g-h;b=D(i,h,e+1/3),c=D(i,h,e),d=D(i,h,e-1/3)}return"#"+s[Math.floor(b*255)]+s[Math.floor(c*255)]+s[Math.floor(d*255)]}function D(a,b,c){return c<0&&c++,c>1&&c--,6*c<1?a+(b-a)*6*c:2*c<1?b:3*c<2?a+(b-a)*(2/3-c)*6:a}function F(a){if(a in E)return E[a];var b,c=1;a=String(a);if(a.charAt(0)=="#")b=a;else if(/^rgb/.test(a)){var d=z(a),b="#",e;for(var f=0;f<3;f++)d[f].indexOf("%")!=-1?e=Math.floor(A(d[f])*255):e=+d[f],b+=s[B(e,0,255)];c=+d[3]}else if(/^hsl/.test(a)){var d=z(a);b=C(d),c=d[3]}else b=y[a]||a;return E[a]={color:b,alpha:c}}function I(a){if(H[a])return H[a];var b=document.createElement("div"),c=b.style;try{c.font=a}catch(d){}return H[a]={style:c.fontStyle||G.style,variant:c.fontVariant||G.variant,weight:c.fontWeight||G.weight,size:c.fontSize||G.size,family:c.fontFamily||G.family}}function J(a,b){var c={};for(var d in a)c[d]=a[d];var e=parseFloat(b.currentStyle.fontSize),f=parseFloat(a.size);return typeof a.size=="number"?c.size=a.size:a.size.indexOf("px")!=-1?c.size=f:a.size.indexOf("em")!=-1?c.size=e*f:a.size.indexOf("%")!=-1?c.size=e/100*f:a.size.indexOf("pt")!=-1?c.size=f/.75:c.size=e,c}function K(a){return a.style+" "+a.variant+" "+a.weight+" "+a.size+"px "+a.family}function M(a){return L[a]||"square"}function N(a){this.m_=v(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=g*1,this.globalAlpha=1,this.font="10px sans-serif",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=a;var b="width:"+a.clientWidth+"px;height:"+a.clientHeight+"px;overflow:hidden;position:absolute",c=a.ownerDocument.createElement("div");c.style.cssText=b,a.appendChild(c);var d=c.cloneNode(!1);d.style.backgroundColor="red",d.style.filter="alpha(opacity=0)",a.appendChild(d),this.element_=c,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function P(a,b,c,d){a.currentPath_.push({type:"bezierCurveTo",cp1x:b.x,cp1y:b.y,cp2x:c.x,cp2y:c.y,x:d.x,y:d.y}),a.currentX_=d.x,a.currentY_=d.y}function Q(a,b){var c=F(a.strokeStyle),d=c.color,e=c.alpha*a.globalAlpha,f=a.lineScale_*a.lineWidth;f<1&&(e*=f),b.push("<g_vml_:stroke",' opacity="',e,'"',' joinstyle="',a.lineJoin,'"',' miterlimit="',a.miterLimit,'"',' endcap="',M(a.lineCap),'"',' weight="',f,'px"',' color="',d,'" />')}function R(b,c,d,e){var f=b.fillStyle,h=b.arcScaleX_,i=b.arcScaleY_,j=e.x-d.x,k=e.y-d.y;if(f instanceof V){var l=0,m={x:0,y:0},n=0,o=1;if(f.type_=="gradient"){var p=f.x0_/h,q=f.y0_/i,r=f.x1_/h,s=f.y1_/i,t=S(b,p,q),u=S(b,r,s),v=u.x-t.x,w=u.y-t.y;l=Math.atan2(v,w)*180/Math.PI,l<0&&(l+=360),l<1e-6&&(l=0)}else{var t=S(b,f.x0_,f.y0_);m={x:(t.x-d.x)/j,y:(t.y-d.y)/k},j/=h*g,k/=i*g;var x=a.max(j,k);n=2*f.r0_/x,o=2*f.r1_/x-n}var y=f.colors_;y.sort(function(a,b){return a.offset-b.offset});var z=y.length,A=y[0].color,B=y[z-1].color,C=y[0].alpha*b.globalAlpha,D=y[z-1].alpha*b.globalAlpha,E=[];for(var G=0;G<z;G++){var H=y[G];E.push(H.offset*o+n+" "+H.color)}c.push('<g_vml_:fill type="',f.type_,'"',' method="none" focus="100%"',' color="',A,'"',' color2="',B,'"',' colors="',E.join(","),'"',' opacity="',D,'"',' g_o_:opacity2="',C,'"',' angle="',l,'"',' focusposition="',m.x,",",m.y,'" />')}else if(f instanceof W){if(j&&k){var I=-d.x,J=-d.y;c.push("<g_vml_:fill",' position="',I/j*h*h,",",J/k*i*i,'"',' type="tile"',' src="',f.src_,'" />')}}else{var K=F(b.fillStyle),L=K.color,M=K.alpha*b.globalAlpha;c.push('<g_vml_:fill color="',L,'" opacity="',M,'" />')}}function S(a,b,c){var d=a.m_;return{x:g*(b*d[0][0]+c*d[1][0]+d[2][0])-h,y:g*(b*d[0][1]+c*d[1][1]+d[2][1])-h}}function T(a){return isFinite(a[0][0])&&isFinite(a[0][1])&&isFinite(a[1][0])&&isFinite(a[1][1])&&isFinite(a[2][0])&&isFinite(a[2][1])}function U(a,b,c){if(!T(b))return;a.m_=b;if(c){var d=b[0][0]*b[1][1]-b[0][1]*b[1][0];a.lineScale_=f(e(d))}}function V(a){this.type_=a,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function W(a,b){Y(a);switch(b){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=b;break;default:X("SYNTAX_ERR")}this.src_=a.src,this.width_=a.width,this.height_=a.height}function X(a){throw new Z(a)}function Y(a){(!a||a.nodeType!=1||a.tagName!="IMG")&&X("TYPE_MISMATCH_ERR"),a.readyState!="complete"&&X("INVALID_STATE_ERR")}function Z(a){this.code=this[a],this.message=a+": DOM Exception "+this.code}var a=Math,b=a.round,c=a.sin,d=a.cos,e=a.abs,f=a.sqrt,g=10,h=g/2,i=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],k=Array.prototype.slice;o(document);var p={init:function(a){var b=a||document;b.createElement("canvas"),b.attachEvent("onreadystatechange",l(this.init_,this,b))},init_:function(a){var b=a.getElementsByTagName("canvas");for(var c=0;c<b.length;c++)this.initElement(b[c])},initElement:function(a){if(!a.getContext){a.getContext=j,o(a.ownerDocument),a.innerHTML="",a.attachEvent("onpropertychange",q),a.attachEvent("onresize",r);var b=a.attributes;b.width&&b.width.specified?a.style.width=b.width.nodeValue+"px":a.width=a.clientWidth,b.height&&b.height.specified?a.style.height=b.height.nodeValue+"px":a.height=a.clientHeight}return a}};p.init();var s=[];for(var t=0;t<16;t++)for(var u=0;u<16;u++)s[t*16+u]=t.toString(16)+u.toString(16);var y={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",grey:"#808080",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",oldlace:"#FDF5E6",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",whitesmoke:"#F5F5F5",yellowgreen:"#9ACD32"},E={},G={style:"normal",variant:"normal",weight:"normal",size:10,family:"sans-serif"},H={},L={butt:"flat",round:"round"},O=N.prototype;O.clearRect=function(){this.textMeasureEl_&&(this.textMeasureEl_.removeNode(!0),this.textMeasureEl_=null),this.element_.innerHTML=""},O.beginPath=function(){this.currentPath_=[]},O.moveTo=function(a,b){var c=S(this,a,b);this.currentPath_.push({type:"moveTo",x:c.x,y:c.y}),this.currentX_=c.x,this.currentY_=c.y},O.lineTo=function(a,b){var c=S(this,a,b);this.currentPath_.push({type:"lineTo",x:c.x,y:c.y}),this.currentX_=c.x,this.currentY_=c.y},O.bezierCurveTo=function(a,b,c,d,e,f){var g=S(this,e,f),h=S(this,a,b),i=S(this,c,d);P(this,h,i,g)},O.quadraticCurveTo=function(a,b,c,d){var e=S(this,a,b),f=S(this,c,d),g={x:this.currentX_+2/3*(e.x-this.currentX_),y:this.currentY_+2/3*(e.y-this.currentY_)},h={x:g.x+(f.x-this.currentX_)/3,y:g.y+(f.y-this.currentY_)/3};P(this,g,h,f)},O.arc=function(a,b,f,i,j,k){f*=g;var l=k?"at":"wa",m=a+d(i)*f-h,n=b+c(i)*f-h,o=a+d(j)*f-h,p=b+c(j)*f-h;e(m-o)<1e-7&&!k&&(m+=.125),e(n-p)<1e-7&&k&&(n-=.125);var q=S(this,a,b),r=S(this,m,n),s=S(this,o,p);this.currentPath_.push({type:l,x:q.x,y:q.y,radius:f,xStart:r.x,yStart:r.y,xEnd:s.x,yEnd:s.y})},O.rect=function(a,b,c,d){this.moveTo(a,b),this.lineTo(a+c,b),this.lineTo(a+c,b+d),this.lineTo(a,b+d),this.closePath()},O.strokeRect=function(a,b,c,d){var e=this.currentPath_;this.beginPath(),this.moveTo(a,b),this.lineTo(a+c,b),this.lineTo(a+c,b+d),this.lineTo(a,b+d),this.closePath(),this.stroke(),this.currentPath_=e},O.fillRect=function(a,b,c,d){var e=this.currentPath_;this.beginPath(),this.moveTo(a,b),this.lineTo(a+c,b),this.lineTo(a+c,b+d),this.lineTo(a,b+d),this.closePath(),this.fill(),this.currentPath_=e},O.createLinearGradient=function(a,b,c,d){var e=new V("gradient");return e.x0_=a,e.y0_=b,e.x1_=c,e.y1_=d,e},O.createRadialGradient=function(a,b,c,d,e,f){var g=new V("gradientradial");return g.x0_=a,g.y0_=b,g.r0_=c,g.x1_=d,g.y1_=e,g.r1_=f,g},O.drawImage=function(c,d){var e,f,h,i,j,k,l,m,n=c.runtimeStyle.width,o=c.runtimeStyle.height;c.runtimeStyle.width="auto",c.runtimeStyle.height="auto";var p=c.width,q=c.height;c.runtimeStyle.width=n,c.runtimeStyle.height=o;if(arguments.length==3)e=arguments[1],f=arguments[2],j=k=0,l=h=p,m=i=q;else if(arguments.length==5)e=arguments[1],f=arguments[2],h=arguments[3],i=arguments[4],j=k=0,l=p,m=q;else if(arguments.length==9)j=arguments[1],k=arguments[2],l=arguments[3],m=arguments[4],e=arguments[5],f=arguments[6],h=arguments[7],i=arguments[8];else throw Error("Invalid number of arguments");var r=S(this,e,f),s=l/2,t=m/2,u=[],v=10,w=10;u.push(" <g_vml_:group",' coordsize="',g*v,",",g*w,'"',' coordorigin="0,0"',' style="width:',v,"px;height:",w,"px;position:absolute;");if(this.m_[0][0]!=1||this.m_[0][1]||this.m_[1][1]!=1||this.m_[1][0]){var x=[];x.push("M11=",this.m_[0][0],",","M12=",this.m_[1][0],",","M21=",this.m_[0][1],",","M22=",this.m_[1][1],",","Dx=",b(r.x/g),",","Dy=",b(r.y/g),"");var y=r,z=S(this,e+h,f),A=S(this,e,f+i),B=S(this,e+h,f+i);y.x=a.max(y.x,z.x,A.x,B.x),y.y=a.max(y.y,z.y,A.y,B.y),u.push("padding:0 ",b(y.x/g),"px ",b(y.y/g),"px 0;filter:progid:DXImageTransform.Microsoft.Matrix(",x.join(""),", sizingmethod='clip');")}else u.push("top:",b(r.y/g),"px;left:",b(r.x/g),"px;");u.push(' ">','<g_vml_:image src="',c.src,'"',' style="width:',g*h,"px;"," height:",g*i,'px"',' cropleft="',j/p,'"',' croptop="',k/q,'"',' cropright="',(p-j-l)/p,'"',' cropbottom="',(q-k-m)/q,'"'," />","</g_vml_:group>"),this.element_.insertAdjacentHTML("BeforeEnd",u.join(""))},O.stroke=function(a){var c=[],d=!1,e=10,f=10;c.push("<g_vml_:shape",' filled="',!!a,'"',' style="position:absolute;width:',e,"px;height:",f,'px;"',' coordorigin="0,0"',' coordsize="',g*e,",",g*f,'"',' stroked="',!a,'"',' path="');var h=!1,i={x:null,y:null},j={x:null,y:null};for(var k=0;k<this.currentPath_.length;k++){var l=this.currentPath_[k],m;switch(l.type){case"moveTo":m=l,c.push(" m ",b(l.x),",",b(l.y));break;case"lineTo":c.push(" l ",b(l.x),",",b(l.y));break;case"close":c.push(" x "),l=null;break;case"bezierCurveTo":c.push(" c ",b(l.cp1x),",",b(l.cp1y),",",b(l.cp2x),",",b(l.cp2y),",",b(l.x),",",b(l.y));break;case"at":case"wa":c.push(" ",l.type," ",b(l.x-this.arcScaleX_*l.radius),",",b(l.y-this.arcScaleY_*l.radius)," ",b(l.x+this.arcScaleX_*l.radius),",",b(l.y+this.arcScaleY_*l.radius)," ",b(l.xStart),",",b(l.yStart)," ",b(l.xEnd),",",b(l.yEnd))}if(l){if(i.x==null||l.x<i.x)i.x=l.x;if(j.x==null||l.x>j.x)j.x=l.x;if(i.y==null||l.y<i.y)i.y=l.y;if(j.y==null||l.y>j.y)j.y=l.y}}c.push(' ">'),a?R(this,c,i,j):Q(this,c),c.push("</g_vml_:shape>"),this.element_.insertAdjacentHTML("beforeEnd",c.join(""))},O.fill=function(){this.stroke(!0)},O.closePath=function(){this.currentPath_.push({type:"close"})},O.save=function(){var a={};x(this,a),this.aStack_.push(a),this.mStack_.push(this.m_),this.m_=w(v(),this.m_)},O.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},O.translate=function(a,b){var c=[[1,0,0],[0,1,0],[a,b,1]];U(this,w(c,this.m_),!1)},O.rotate=function(a){var b=d(a),e=c(a),f=[[b,e,0],[-e,b,0],[0,0,1]];U(this,w(f,this.m_),!1)},O.scale=function(a,b){this.arcScaleX_*=a,this.arcScaleY_*=b;var c=[[a,0,0],[0,b,0],[0,0,1]];U(this,w(c,this.m_),!0)},O.transform=function(a,b,c,d,e,f){var g=[[a,b,0],[c,d,0],[e,f,1]];U(this,w(g,this.m_),!0)},O.setTransform=function(a,b,c,d,e,f){var g=[[a,b,0],[c,d,0],[e,f,1]];U(this,g,!0)},O.drawText_=function(a,c,d,e,f){var h=this.m_,i=1e3,j=0,k=i,l={x:0,y:0},n=[],o=J(I(this.font),this.element_),p=K(o),q=this.element_.currentStyle,r=this.textAlign.toLowerCase();switch(r){case"left":case"center":case"right":break;case"end":r=q.direction=="ltr"?"right":"left";break;case"start":r=q.direction=="rtl"?"right":"left";break;default:r="left"}switch(this.textBaseline){case"hanging":case"top":l.y=o.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":l.y=-o.size/2.25}switch(r){case"right":j=i,k=.05;break;case"center":j=k=i/2}var s=S(this,c+l.x,d+l.y);n.push('<g_vml_:line from="',-j,' 0" to="',k,' 0.05" ',' coordsize="100 100" coordorigin="0 0"',' filled="',!f,'" stroked="',!!f,'" style="position:absolute;width:1px;height:1px;">'),f?Q(this,n):R(this,n,{x:-j,y:0},{x:k,y:o.size});var t=h[0][0].toFixed(3)+","+h[1][0].toFixed(3)+","+h[0][1].toFixed(3)+","+h[1][1].toFixed(3)+",0,0",u=b(s.x/g)+","+b(s.y/g);n.push('<g_vml_:skew on="t" matrix="',t,'" ',' offset="',u,'" origin="',j,' 0" />','<g_vml_:path textpathok="true" />','<g_vml_:textpath on="true" string="',m(a),'" style="v-text-align:',r,";font:",m(p),'" /></g_vml_:line>'),this.element_.insertAdjacentHTML("beforeEnd",n.join(""))},O.fillText=function(a,b,c,d){this.drawText_(a,b,c,d,!1)},O.strokeText=function(a,b,c,d){this.drawText_(a,b,c,d,!0)},O.measureText=function(a){if(!this.textMeasureEl_){var b='<span style="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;"></span>';this.element_.insertAdjacentHTML("beforeEnd",b),this.textMeasureEl_=this.element_.lastChild}var c=this.element_.ownerDocument;return this.textMeasureEl_.innerHTML="",this.textMeasureEl_.style.font=this.font,this.textMeasureEl_.appendChild(c.createTextNode(a)),{width:this.textMeasureEl_.offsetWidth}},O.clip=function(){},O.arcTo=function(){},O.createPattern=function(a,b){return new W(a,b)},V.prototype.addColorStop=function(a,b){b=F(b),this.colors_.push({offset:a,color:b.color,alpha:b.alpha})};var $=Z.prototype=new Error;$.INDEX_SIZE_ERR=1,$.DOMSTRING_SIZE_ERR=2,$.HIERARCHY_REQUEST_ERR=3,$.WRONG_DOCUMENT_ERR=4,$.INVALID_CHARACTER_ERR=5,$.NO_DATA_ALLOWED_ERR=6,$.NO_MODIFICATION_ALLOWED_ERR=7,$.NOT_FOUND_ERR=8,$.NOT_SUPPORTED_ERR=9,$.INUSE_ATTRIBUTE_ERR=10,$.INVALID_STATE_ERR=11,$.SYNTAX_ERR=12,$.INVALID_MODIFICATION_ERR=13,$.NAMESPACE_ERR=14,$.INVALID_ACCESS_ERR=15,$.VALIDATION_ERR=16,$.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=p,CanvasRenderingContext2D=N,CanvasGradient=V,CanvasPattern=W,DOMException=Z}(),function(){function c(b){var c,d,e,f,g,h;e=b.length,d=0,c="";while(d<e){f=b.charCodeAt(d++)&255;if(d==e){c+=a.charAt(f>>2),c+=a.charAt((f&3)<<4),c+="==";break}g=b.charCodeAt(d++);if(d==e){c+=a.charAt(f>>2),c+=a.charAt((f&3)<<4|(g&240)>>4),c+=a.charAt((g&15)<<2),c+="=";break}h=b.charCodeAt(d++),c+=a.charAt(f>>2),c+=a.charAt((f&3)<<4|(g&240)>>4),c+=a.charAt((g&15)<<2|(h&192)>>6),c+=a.charAt(h&63)}return c}function d(a){var c,d,e,f,g,h,i;h=a.length,g=0,i="";while(g<h){do c=b[a.charCodeAt(g++)&255];while(g<h&&c==-1);if(c==-1)break;do d=b[a.charCodeAt(g++)&255];while(g<h&&d==-1);if(d==-1)break;i+=String.fromCharCode(c<<2|(d&48)>>4);do{e=a.charCodeAt(g++)&255;if(e==61)return i;e=b[e]}while(g<h&&e==-1);if(e==-1)break;i+=String.fromCharCode((d&15)<<4|(e&60)>>2);do{f=a.charCodeAt(g++)&255;if(f==61)return i;f=b[f]}while(g<h&&f==-1);if(f==-1)break;i+=String.fromCharCode((e&3)<<6|f)}return i}var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1];window.btoa||(window.btoa=c),window.atob||(window.atob=d)}();var CanvasText={letters:{"\n":{width:-1,points:[]}," ":{width:10,points:[]},"!":{width:10,points:[[5,21],[5,7],null,[5,2],[4,1],[5,0],[6,1],[5,2]]},'"':{width:16,points:[[4,21],[4,14],null,[12,21],[12,14]]},"#":{width:21,points:[[11,25],[4,-7],null,[17,25],[10,-7],null,[4,12],[18,12],null,[3,6],[17,6]]},$:{width:20,points:[[8,25],[8,-4],null,[12,25],[12,-4],null,[17,18],[15,20],[12,21],[8,21],[5,20],[3,18],[3,16],[4,14],[5,13],[7,12],[13,10],[15,9],[16,8],[17,6],[17,3],[15,1],[12,0],[8,0],[5,1],[3,3]]},"%":{width:24,points:[[21,21],[3,0],null,[8,21],[10,19],[10,17],[9,15],[7,14],[5,14],[3,16],[3,18],[4,20],[6,21],[8,21],null,[17,7],[15,6],[14,4],[14,2],[16,0],[18,0],[20,1],[21,3],[21,5],[19,7],[17,7]]},"&":{width:26,points:[[23,12],[23,13],[22,14],[21,14],[20,13],[19,11],[17,6],[15,3],[13,1],[11,0],[7,0],[5,1],[4,2],[3,4],[3,6],[4,8],[5,9],[12,13],[13,14],[14,16],[14,18],[13,20],[11,21],[9,20],[8,18],[8,16],[9,13],[11,10],[16,3],[18,1],[20,0],[22,0],[23,1],[23,2]]},"'":{width:10,points:[[5,19],[4,20],[5,21],[6,20],[6,18],[5,16],[4,15]]},"(":{width:14,points:[[11,25],[9,23],[7,20],[5,16],[4,11],[4,7],[5,2],[7,-2],[9,-5],[11,-7]]},")":{width:14,points:[[3,25],[5,23],[7,20],[9,16],[10,11],[10,7],[9,2],[7,-2],[5,-5],[3,-7]]},"*":{width:16,points:[[8,21],[8,9],null,[3,18],[13,12],null,[13,18],[3,12]]},"+":{width:26,points:[[13,18],[13,0],null,[4,9],[22,9]]},",":{width:10,points:[[6,1],[5,0],[4,1],[5,2],[6,1],[6,-1],[5,-3],[4,-4]]},"-":{width:26,points:[[4,9],[22,9]]},".":{width:10,points:[[5,2],[4,1],[5,0],[6,1],[5,2]]},"/":{width:22,points:[[20,25],[2,-7]]},0:{width:20,points:[[9,21],[6,20],[4,17],[3,12],[3,9],[4,4],[6,1],[9,0],[11,0],[14,1],[16,4],[17,9],[17,12],[16,17],[14,20],[11,21],[9,21]]},1:{width:20,points:[[6,17],[8,18],[11,21],[11,0]]},2:{width:20,points:[[4,16],[4,17],[5,19],[6,20],[8,21],[12,21],[14,20],[15,19],[16,17],[16,15],[15,13],[13,10],[3,0],[17,0]]},3:{width:20,points:[[5,21],[16,21],[10,13],[13,13],[15,12],[16,11],[17,8],[17,6],[16,3],[14,1],[11,0],[8,0],[5,1],[4,2],[3,4]]},4:{width:20,points:[[13,21],[3,7],[18,7],null,[13,21],[13,0]]},5:{width:20,points:[[15,21],[5,21],[4,12],[5,13],[8,14],[11,14],[14,13],[16,11],[17,8],[17,6],[16,3],[14,1],[11,0],[8,0],[5,1],[4,2],[3,4]]},6:{width:20,points:[[16,18],[15,20],[12,21],[10,21],[7,20],[5,17],[4,12],[4,7],[5,3],[7,1],[10,0],[11,0],[14,1],[16,3],[17,6],[17,7],[16,10],[14,12],[11,13],[10,13],[7,12],[5,10],[4,7]]},7:{width:20,points:[[17,21],[7,0],null,[3,21],[17,21]]},8:{width:20,points:[[8,21],[5,20],[4,18],[4,16],[5,14],[7,13],[11,12],[14,11],[16,9],[17,7],[17,4],[16,2],[15,1],[12,0],[8,0],[5,1],[4,2],[3,4],[3,7],[4,9],[6,11],[9,12],[13,13],[15,14],[16,16],[16,18],[15,20],[12,21],[8,21]]},9:{width:20,points:[[16,14],[15,11],[13,9],[10,8],[9,8],[6,9],[4,11],[3,14],[3,15],[4,18],[6,20],[9,21],[10,21],[13,20],[15,18],[16,14],[16,9],[15,4],[13,1],[10,0],[8,0],[5,1],[4,3]]},":":{width:10,points:[[5,14],[4,13],[5,12],[6,13],[5,14],null,[5,2],[4,1],[5,0],[6,1],[5,2]]},";":{width:10,points:[[5,14],[4,13],[5,12],[6,13],[5,14],null,[6,1],[5,0],[4,1],[5,2],[6,1],[6,-1],[5,-3],[4,-4]]},"<":{width:24,points:[[20,18],[4,9],[20,0]]},"=":{width:26,points:[[4,12],[22,12],null,[4,6],[22,6]]},">":{width:24,points:[[4,18],[20,9],[4,0]]},"?":{width:18,points:[[3,16],[3,17],[4,19],[5,20],[7,21],[11,21],[13,20],[14,19],[15,17],[15,15],[14,13],[13,12],[9,10],[9,7],null,[9,2],[8,1],[9,0],[10,1],[9,2]]},"@":{width:27,points:[[18,13],[17,15],[15,16],[12,16],[10,15],[9,14],[8,11],[8,8],[9,6],[11,5],[14,5],[16,6],[17,8],null,[12,16],[10,14],[9,11],[9,8],[10,6],[11,5],null,[18,16],[17,8],[17,6],[19,5],[21,5],[23,7],[24,10],[24,12],[23,15],[22,17],[20,19],[18,20],[15,21],[12,21],[9,20],[7,19],[5,17],[4,15],[3,12],[3,9],[4,6],[5,4],[7,2],[9,1],[12,0],[15,0],[18,1],[20,2],[21,3],null,[19,16],[18,8],[18,6],[19,5]]},A:{width:18,points:[[9,21],[1,0],null,[9,21],[17,0],null,[4,7],[14,7]]},B:{width:21,points:[[4,21],[4,0],null,[4,21],[13,21],[16,20],[17,19],[18,17],[18,15],[17,13],[16,12],[13,11],null,[4,11],[13,11],[16,10],[17,9],[18,7],[18,4],[17,2],[16,1],[13,0],[4,0]]},C:{width:21,points:[[18,16],[17,18],[15,20],[13,21],[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5]]},D:{width:21,points:[[4,21],[4,0],null,[4,21],[11,21],[14,20],[16,18],[17,16],[18,13],[18,8],[17,5],[16,3],[14,1],[11,0],[4,0]]},E:{width:19,points:[[4,21],[4,0],null,[4,21],[17,21],null,[4,11],[12,11],null,[4,0],[17,0]]},F:{width:18,points:[[4,21],[4,0],null,[4,21],[17,21],null,[4,11],[12,11]]},G:{width:21,points:[[18,16],[17,18],[15,20],[13,21],[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[18,8],null,[13,8],[18,8]]},H:{width:22,points:[[4,21],[4,0],null,[18,21],[18,0],null,[4,11],[18,11]]},I:{width:8,points:[[4,21],[4,0]]},J:{width:16,points:[[12,21],[12,5],[11,2],[10,1],[8,0],[6,0],[4,1],[3,2],[2,5],[2,7]]},K:{width:21,points:[[4,21],[4,0],null,[18,21],[4,7],null,[9,12],[18,0]]},L:{width:17,points:[[4,21],[4,0],null,[4,0],[16,0]]},M:{width:24,points:[[4,21],[4,0],null,[4,21],[12,0],null,[20,21],[12,0],null,[20,21],[20,0]]},N:{width:22,points:[[4,21],[4,0],null,[4,21],[18,0],null,[18,21],[18,0]]},O:{width:22,points:[[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[19,8],[19,13],[18,16],[17,18],[15,20],[13,21],[9,21]]},P:{width:21,points:[[4,21],[4,0],null,[4,21],[13,21],[16,20],[17,19],[18,17],[18,14],[17,12],[16,11],[13,10],[4,10]]},Q:{width:22,points:[[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[19,8],[19,13],[18,16],[17,18],[15,20],[13,21],[9,21],null,[12,4],[18,-2]]},R:{width:21,points:[[4,21],[4,0],null,[4,21],[13,21],[16,20],[17,19],[18,17],[18,15],[17,13],[16,12],[13,11],[4,11],null,[11,11],[18,0]]},S:{width:20,points:[[17,18],[15,20],[12,21],[8,21],[5,20],[3,18],[3,16],[4,14],[5,13],[7,12],[13,10],[15,9],[16,8],[17,6],[17,3],[15,1],[12,0],[8,0],[5,1],[3,3]]},T:{width:16,points:[[8,21],[8,0],null,[1,21],[15,21]]},U:{width:22,points:[[4,21],[4,6],[5,3],[7,1],[10,0],[12,0],[15,1],[17,3],[18,6],[18,21]]},V:{width:18,points:[[1,21],[9,0],null,[17,21],[9,0]]},W:{width:24,points:[[2,21],[7,0],null,[12,21],[7,0],null,[12,21],[17,0],null,[22,21],[17,0]]},X:{width:20,points:[[3,21],[17,0],null,[17,21],[3,0]]},Y:{width:18,points:[[1,21],[9,11],[9,0],null,[17,21],[9,11]]},Z:{width:20,points:[[17,21],[3,0],null,[3,21],[17,21],null,[3,0],[17,0]]},"[":{width:14,points:[[4,25],[4,-7],null,[5,25],[5,-7],null,[4,25],[11,25],null,[4,-7],[11,-7]]},"\\":{width:14,points:[[0,21],[14,-3]]},"]":{width:14,points:[[9,25],[9,-7],null,[10,25],[10,-7],null,[3,25],[10,25],null,[3,-7],[10,-7]]},"^":{width:14,points:[[3,10],[8,18],[13,10]]},_:{width:16,points:[[0,-2],[16,-2]]},"`":{width:10,points:[[6,21],[5,20],[4,18],[4,16],[5,15],[6,16],[5,17]]},a:{width:19,points:[[15,14],[15,0],null,[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},b:{width:19,points:[[4,21],[4,0],null,[4,11],[6,13],[8,14],[11,14],[13,13],[15,11],[16,8],[16,6],[15,3],[13,1],[11,0],[8,0],[6,1],[4,3]]},c:{width:18,points:[[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},d:{width:19,points:[[15,21],[15,0],null,[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},e:{width:18,points:[[3,8],[15,8],[15,10],[14,12],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},f:{width:12,points:[[10,21],[8,21],[6,20],[5,17],[5,0],null,[2,14],[9,14]]},g:{width:19,points:[[15,14],[15,-2],[14,-5],[13,-6],[11,-7],[8,-7],[6,-6],null,[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},h:{width:19,points:[[4,21],[4,0],null,[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0]]},i:{width:8,points:[[3,21],[4,20],[5,21],[4,22],[3,21],null,[4,14],[4,0]]},j:{width:10,points:[[5,21],[6,20],[7,21],[6,22],[5,21],null,[6,14],[6,-3],[5,-6],[3,-7],[1,-7]]},k:{width:17,points:[[4,21],[4,0],null,[14,14],[4,4],null,[8,8],[15,0]]},l:{width:8,points:[[4,21],[4,0]]},m:{width:30,points:[[4,14],[4,0],null,[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0],null,[15,10],[18,13],[20,14],[23,14],[25,13],[26,10],[26,0]]},n:{width:19,points:[[4,14],[4,0],null,[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0]]},o:{width:19,points:[[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3],[16,6],[16,8],[15,11],[13,13],[11,14],[8,14]]},p:{width:19,points:[[4,14],[4,-7],null,[4,11],[6,13],[8,14],[11,14],[13,13],[15,11],[16,8],[16,6],[15,3],[13,1],[11,0],[8,0],[6,1],[4,3]]},q:{width:19,points:[[15,14],[15,-7],null,[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},r:{width:13,points:[[4,14],[4,0],null,[4,8],[5,11],[7,13],[9,14],[12,14]]},s:{width:17,points:[[14,11],[13,13],[10,14],[7,14],[4,13],[3,11],[4,9],[6,8],[11,7],[13,6],[14,4],[14,3],[13,1],[10,0],[7,0],[4,1],[3,3]]},t:{width:12,points:[[5,21],[5,4],[6,1],[8,0],[10,0],null,[2,14],[9,14]]},u:{width:19,points:[[4,14],[4,4],[5,1],[7,0],[10,0],[12,1],[15,4],null,[15,14],[15,0]]},v:{width:16,points:[[2,14],[8,0],null,[14,14],[8,0]]},w:{width:22,points:[[3,14],[7,0],null,[11,14],[7,0],null,[11,14],[15,0],null,[19,14],[15,0]]},x:{width:17,points:[[3,14],[14,0],null,[14,14],[3,0]]},y:{width:16,points:[[2,14],[8,0],null,[14,14],[8,0],[6,-4],[4,-6],[2,-7],[1,-7]]},z:{width:17,points:[[14,14],[3,0],null,[3,14],[14,14],null,[3,0],[14,0]]},"{":{width:14,points:[[9,25],[7,24],[6,23],[5,21],[5,19],[6,17],[7,16],[8,14],[8,12],[6,10],null,[7,24],[6,22],[6,20],[7,18],[8,17],[9,15],[9,13],[8,11],[4,9],[8,7],[9,5],[9,3],[8,1],[7,0],[6,-2],[6,-4],[7,-6],null,[6,8],[8,6],[8,4],[7,2],[6,1],[5,-1],[5,-3],[6,-5],[7,-6],[9,-7]]},"|":{width:8,points:[[4,25],[4,-7]]},"}":{width:14,points:[[5,25],[7,24],[8,23],[9,21],[9,19],[8,17],[7,16],[6,14],[6,12],[8,10],null,[7,24],[8,22],[8,20],[7,18],[6,17],[5,15],[5,13],[6,11],[10,9],[6,7],[5,5],[5,3],[6,1],[7,0],[8,-2],[8,-4],[7,-6],null,[8,8],[6,6],[6,4],[7,2],[8,1],[9,-1],[9,-3],[8,-5],[7,-6],[5,-7]]},"~":{width:24,points:[[3,6],[3,8],[4,11],[6,12],[8,12],[10,11],[14,8],[16,7],[18,7],[20,8],[21,10],null,[3,8],[4,10],[6,11],[8,11],[10,10],[14,7],[16,6],[18,6],[20,7],[21,10],[21,12]]},"�":{diacritic:"`",letter:"a"},"�":{diacritic:"�",letter:"a"},"�":{diacritic:"^",letter:"a"},"�":{diacritic:"�",letter:"a"},"�":{diacritic:"~",letter:"a"},"�":{diacritic:"`",letter:"e"},"�":{diacritic:"�",letter:"e"},"�":{diacritic:"^",letter:"e"},"�":{diacritic:"�",letter:"e"},"�":{diacritic:"`",letter:"i"},"�":{diacritic:"�",letter:"i"},"�":{diacritic:"^",letter:"i"},"�":{diacritic:"�",letter:"i"},"�":{diacritic:"`",letter:"o"},"�":{diacritic:"�",letter:"o"},"�":{diacritic:"^",letter:"o"},"�":{diacritic:"�",letter:"o"},"�":{diacritic:"~",letter:"o"},"�":{diacritic:"`",letter:"u"},"�":{diacritic:"�",letter:"u"},"�":{diacritic:"^",letter:"u"},"�":{diacritic:"�",letter:"u"},"�":{diacritic:"�",letter:"y"},"�":{diacritic:"�",letter:"y"},"�":{diacritic:"�",letter:"c"},"�":{diacritic:"~",letter:"n"},"�":{diacritic:"`",letter:"A"},"�":{diacritic:"�",letter:"A"},"�":{diacritic:"^",letter:"A"},"�":{diacritic:"�",letter:"A"},"�":{diacritic:"~",letter:"A"},"�":{diacritic:"`",letter:"E"},"�":{diacritic:"�",letter:"E"},"�":{diacritic:"^",letter:"E"},"�":{diacritic:"�",letter:"E"},"�":{diacritic:"`",letter:"I"},"�":{diacritic:"�",letter:"I"},"�":{diacritic:"^",letter:"I"},"�":{diacritic:"�",letter:"I"},"�":{diacritic:"`",letter:"O"},"�":{diacritic:"�",letter:"O"},"�":{diacritic:"^",letter:"O"},"�":{diacritic:"�",letter:"O"},"�":{diacritic:"~",letter:"O"},"�":{diacritic:"`",letter:"U"},"�":{diacritic:"�",letter:"U"},"�":{diacritic:"^",letter:"U"},"�":{diacritic:"�",letter:"U"},"�":{diacritic:"�",letter:"Y"},"�":{diacritic:"�",letter:"C"},"�":{diacritic:"~",letter:"N"}},specialchars:{pi:{width:19,points:[[6,14],[6,0],null,[14,14],[14,0],null,[2,13],[6,16],[13,13],[17,16]]}},diacritics:{"�":{entity:"cedil",points:[[6,-4],[4,-6],[2,-7],[1,-7]]},"�":{entity:"acute",points:[[8,19],[13,22]]},"`":{entity:"grave",points:[[7,22],[12,19]]},"^":{entity:"circ",points:[[5.5,19],[9.5,23],[12.5,19]]},"�":{entity:"trema",points:[[5,21],[6,20],[7,21],[6,22],[5,21],null,[12,21],[13,20],[14,21],[13,22],[12,21]]},"~":{entity:"tilde",points:[[4,18],[7,22],[10,18],[13,22]]}},style:{size:8,font:null,color:"#000000",weight:1,textAlign:"left",textBaseline:"bottom",adjustAlign:!1,angle:0,tracking:1,boundingBoxColor:"#ff0000",originPointColor:"#000000"},debug:!1,_bufferLexemes:{},extend:function(a,b){for(var c in b){if(c in a)continue;a[c]=b[c]}return a},letter:function(a){return CanvasText.letters[a]},parseLexemes:function(a){if(CanvasText._bufferLexemes[a])return CanvasText._bufferLexemes[a];var b,c,d=a.match(/&[A-Za-z]{2,5};|\s|./g),e=[],f=[];for(b=0;b<d.length;b++){c=d[b];if(c.length==1)f.push(c);else{var g=c.substring(1,c.length-1);CanvasText.specialchars[g]?f.push(g):f=f.concat(c.toArray())}}for(b=0;b<f.length;b++)c=f[b],(c=CanvasText.letters[c]||CanvasText.specialchars[c])&&e.push(c);for(b=0;b<e.length;b++)(e===null||typeof e=="undefined")&&delete e[b];return CanvasText._bufferLexemes[a]=e},ascent:function(a){return a=a||CanvasText.style,a.size||CanvasText.style.size},descent:function(a){return a=a||CanvasText.style,7*(a.size||CanvasText.style.size)/25},measure:function(a,b){if(!a)return;b=b||CanvasText.style;var d,e,f=CanvasText.parseLexemes(a),g=0;for(d=f.length-1;d>-1;--d)c=f[d],e=c.diacritic?CanvasText.letter(c.letter).width:c.width,g+=e*(b.tracking||CanvasText.style.tracking)*(b.size||CanvasText.style.size)/25;return g},getDimensions:function(a,b){b=b||CanvasText.style;var c=CanvasText.measure(a,b),d=b.size||CanvasText.style.size,e=b.angle||CanvasText.style.angle;return b.angle==0?{width:c,height:d}:{width:Math.abs(Math.cos(e)*c)+Math.abs(Math.sin(e)*d),height:Math.abs(Math.sin(e)*c)+Math.abs(Math.cos(e)*d)}},drawPoints:function(a,b,c,d,e,f){var g,h,i=!0,j=0;f=f||{x:0,y:0},a.beginPath();for(g=0;g<b.length;g++){h=b[g];if(!h){i=!0;continue}i?(a.moveTo(c+h[0]*e+f.x,d-h[1]*e+f.y),i=!1):a.lineTo(c+h[0]*e+f.x,d-h[1]*e+f.y)}a.stroke(),a.closePath()},draw:function(a,b,c,d){if(!a)return;CanvasText.extend(d,CanvasText.style);var e,f,g=0,h=d.size/25,i=0,j=0,k=CanvasText.parseLexemes(a),l={x:0,y:0},m=CanvasText.measure(a,d),n;d.adjustAlign&&(n=CanvasText.getBestAlign(d.angle,d),CanvasText.extend(d,n));switch(d.textAlign){case"left":break;case"center":l.x=-m/2;break;case"right":l.x=-m}switch(d.textBaseline){case"bottom":break;case"middle":l.y=d.size/2;break;case"top":l.y=d.size}this.save(),this.translate(b,c),this.rotate(d.angle),this.lineCap="round",this.lineWidth=2*h*(d.weight||CanvasText.style.weight),this.strokeStyle=d.color||CanvasText.style.color;for(e=0;e<k.length;e++){f=k[e];if(f.width==-1){i=0,j=d.size*1.4;continue}var o=f.points,p=f.width;if(f.diacritic){var q=CanvasText.diacritics[f.diacritic],r=CanvasText.letter(f.letter);CanvasText.drawPoints(this,q.points,i,j-(f.letter.toUpperCase()==f.letter?3:0),h,l),o=r.points,p=r.width}CanvasText.drawPoints(this,o,i,j,h,l),CanvasText.debug&&(this.save(),this.lineJoin="miter",this.lineWidth=.5,this.strokeStyle=d.boundingBoxColor||CanvasText.style.boundingBoxColor,this.strokeRect(i+l.x,j+l.y,p*h,-d.size),this.fillStyle=d.originPointColor||CanvasText.style.originPointColor,this.beginPath(),this.arc(0,0,1.5,0,Math.PI*2,!0),this.fill(),this.closePath(),this.restore()),i+=p*h*(d.tracking||CanvasText.style.tracking)}return this.restore(),g}};CanvasText.proto=window.CanvasRenderingContext2D?window.CanvasRenderingContext2D.prototype:document.createElement("canvas").getContext("2d").__proto__,CanvasText.proto&&(CanvasText.proto.drawText=CanvasText.draw,CanvasText.proto.measure=CanvasText.measure,CanvasText.proto.getTextBounds=CanvasText.getDimensions,CanvasText.proto.fontAscent=CanvasText.ascent,CanvasText.proto.fontDescent=CanvasText.descent)
3893\ No newline at end of file
3894
3895=== removed file 'addons/web_graph/static/lib/flotr2/flotr2.js'
3896--- addons/web_graph/static/lib/flotr2/flotr2.js 2012-05-07 08:19:08 +0000
3897+++ addons/web_graph/static/lib/flotr2/flotr2.js 1970-01-01 00:00:00 +0000
3898@@ -1,6865 +0,0 @@
3899-/*!
3900- * bean.js - copyright Jacob Thornton 2011
3901- * https://github.com/fat/bean
3902- * MIT License
3903- * special thanks to:
3904- * dean edwards: http://dean.edwards.name/
3905- * dperini: https://github.com/dperini/nwevents
3906- * the entire mootools team: github.com/mootools/mootools-core
3907- */
3908-/*global module:true, define:true*/
3909-!function (name, context, definition) {
3910- if (typeof module !== 'undefined') module.exports = definition(name, context);
3911- else if (typeof define === 'function' && typeof define.amd === 'object') define(definition);
3912- else context[name] = definition(name, context);
3913-}('bean', this, function (name, context) {
3914- var win = window
3915- , old = context[name]
3916- , overOut = /over|out/
3917- , namespaceRegex = /[^\.]*(?=\..*)\.|.*/
3918- , nameRegex = /\..*/
3919- , addEvent = 'addEventListener'
3920- , attachEvent = 'attachEvent'
3921- , removeEvent = 'removeEventListener'
3922- , detachEvent = 'detachEvent'
3923- , doc = document || {}
3924- , root = doc.documentElement || {}
3925- , W3C_MODEL = root[addEvent]
3926- , eventSupport = W3C_MODEL ? addEvent : attachEvent
3927- , slice = Array.prototype.slice
3928- , mouseTypeRegex = /click|mouse|menu|drag|drop/i
3929- , touchTypeRegex = /^touch|^gesture/i
3930- , ONE = { one: 1 } // singleton for quick matching making add() do one()
3931-
3932- , nativeEvents = (function (hash, events, i) {
3933- for (i = 0; i < events.length; i++)
3934- hash[events[i]] = 1
3935- return hash
3936- })({}, (
3937- 'click dblclick mouseup mousedown contextmenu ' + // mouse buttons
3938- 'mousewheel DOMMouseScroll ' + // mouse wheel
3939- 'mouseover mouseout mousemove selectstart selectend ' + // mouse movement
3940- 'keydown keypress keyup ' + // keyboard
3941- 'orientationchange ' + // mobile
3942- 'focus blur change reset select submit ' + // form elements
3943- 'load unload beforeunload resize move DOMContentLoaded readystatechange ' + // window
3944- 'error abort scroll ' + // misc
3945- (W3C_MODEL ? // element.fireEvent('onXYZ'... is not forgiving if we try to fire an event
3946- // that doesn't actually exist, so make sure we only do these on newer browsers
3947- 'show ' + // mouse buttons
3948- 'input invalid ' + // form elements
3949- 'touchstart touchmove touchend touchcancel ' + // touch
3950- 'gesturestart gesturechange gestureend ' + // gesture
3951- 'message readystatechange pageshow pagehide popstate ' + // window
3952- 'hashchange offline online ' + // window
3953- 'afterprint beforeprint ' + // printing
3954- 'dragstart dragenter dragover dragleave drag drop dragend ' + // dnd
3955- 'loadstart progress suspend emptied stalled loadmetadata ' + // media
3956- 'loadeddata canplay canplaythrough playing waiting seeking ' + // media
3957- 'seeked ended durationchange timeupdate play pause ratechange ' + // media
3958- 'volumechange cuechange ' + // media
3959- 'checking noupdate downloading cached updateready obsolete ' + // appcache
3960- '' : '')
3961- ).split(' ')
3962- )
3963-
3964- , customEvents = (function () {
3965- function isDescendant(parent, node) {
3966- while ((node = node.parentNode) !== null) {
3967- if (node === parent) return true
3968- }
3969- return false
3970- }
3971-
3972- function check(event) {
3973- var related = event.relatedTarget
3974- if (!related) return related === null
3975- return (related !== this && related.prefix !== 'xul' && !/document/.test(this.toString()) && !isDescendant(this, related))
3976- }
3977-
3978- return {
3979- mouseenter: { base: 'mouseover', condition: check }
3980- , mouseleave: { base: 'mouseout', condition: check }
3981- , mousewheel: { base: /Firefox/.test(navigator.userAgent) ? 'DOMMouseScroll' : 'mousewheel' }
3982- }
3983- })()
3984-
3985- , fixEvent = (function () {
3986- var commonProps = 'altKey attrChange attrName bubbles cancelable ctrlKey currentTarget detail eventPhase getModifierState isTrusted metaKey relatedNode relatedTarget shiftKey srcElement target timeStamp type view which'.split(' ')
3987- , mouseProps = commonProps.concat('button buttons clientX clientY dataTransfer fromElement offsetX offsetY pageX pageY screenX screenY toElement'.split(' '))
3988- , keyProps = commonProps.concat('char charCode key keyCode'.split(' '))
3989- , touchProps = commonProps.concat('touches targetTouches changedTouches scale rotation'.split(' '))
3990- , preventDefault = 'preventDefault'
3991- , createPreventDefault = function (event) {
3992- return function () {
3993- if (event[preventDefault])
3994- event[preventDefault]()
3995- else
3996- event.returnValue = false
3997- }
3998- }
3999- , stopPropagation = 'stopPropagation'
4000- , createStopPropagation = function (event) {
4001- return function () {
4002- if (event[stopPropagation])
4003- event[stopPropagation]()
4004- else
4005- event.cancelBubble = true
4006- }
4007- }
4008- , createStop = function (synEvent) {
4009- return function () {
4010- synEvent[preventDefault]()
4011- synEvent[stopPropagation]()
4012- synEvent.stopped = true
4013- }
4014- }
4015- , copyProps = function (event, result, props) {
4016- var i, p
4017- for (i = props.length; i--;) {
4018- p = props[i]
4019- if (!(p in result) && p in event) result[p] = event[p]
4020- }
4021- }
4022-
4023- return function (event, isNative) {
4024- var result = { originalEvent: event, isNative: isNative }
4025- if (!event)
4026- return result
4027-
4028- var props
4029- , type = event.type
4030- , target = event.target || event.srcElement
4031-
4032- result[preventDefault] = createPreventDefault(event)
4033- result[stopPropagation] = createStopPropagation(event)
4034- result.stop = createStop(result)
4035- result.target = target && target.nodeType === 3 ? target.parentNode : target
4036-
4037- if (isNative) { // we only need basic augmentation on custom events, the rest is too expensive
4038- if (type.indexOf('key') !== -1) {
4039- props = keyProps
4040- result.keyCode = event.which || event.keyCode
4041- } else if (mouseTypeRegex.test(type)) {
4042- props = mouseProps
4043- result.rightClick = event.which === 3 || event.button === 2
4044- result.pos = { x: 0, y: 0 }
4045- if (event.pageX || event.pageY) {
4046- result.clientX = event.pageX
4047- result.clientY = event.pageY
4048- } else if (event.clientX || event.clientY) {
4049- result.clientX = event.clientX + doc.body.scrollLeft + root.scrollLeft
4050- result.clientY = event.clientY + doc.body.scrollTop + root.scrollTop
4051- }
4052- if (overOut.test(type))
4053- result.relatedTarget = event.relatedTarget || event[(type === 'mouseover' ? 'from' : 'to') + 'Element']
4054- } else if (touchTypeRegex.test(type)) {
4055- props = touchProps
4056- }
4057- copyProps(event, result, props || commonProps)
4058- }
4059- return result
4060- }
4061- })()
4062-
4063- // if we're in old IE we can't do onpropertychange on doc or win so we use doc.documentElement for both
4064- , targetElement = function (element, isNative) {
4065- return !W3C_MODEL && !isNative && (element === doc || element === win) ? root : element
4066- }
4067-
4068- // we use one of these per listener, of any type
4069- , RegEntry = (function () {
4070- function entry(element, type, handler, original, namespaces) {
4071- this.element = element
4072- this.type = type
4073- this.handler = handler
4074- this.original = original
4075- this.namespaces = namespaces
4076- this.custom = customEvents[type]
4077- this.isNative = nativeEvents[type] && element[eventSupport]
4078- this.eventType = W3C_MODEL || this.isNative ? type : 'propertychange'
4079- this.customType = !W3C_MODEL && !this.isNative && type
4080- this.target = targetElement(element, this.isNative)
4081- this.eventSupport = this.target[eventSupport]
4082- }
4083-
4084- entry.prototype = {
4085- // given a list of namespaces, is our entry in any of them?
4086- inNamespaces: function (checkNamespaces) {
4087- var i, j
4088- if (!checkNamespaces)
4089- return true
4090- if (!this.namespaces)
4091- return false
4092- for (i = checkNamespaces.length; i--;) {
4093- for (j = this.namespaces.length; j--;) {
4094- if (checkNamespaces[i] === this.namespaces[j])
4095- return true
4096- }
4097- }
4098- return false
4099- }
4100-
4101- // match by element, original fn (opt), handler fn (opt)
4102- , matches: function (checkElement, checkOriginal, checkHandler) {
4103- return this.element === checkElement &&
4104- (!checkOriginal || this.original === checkOriginal) &&
4105- (!checkHandler || this.handler === checkHandler)
4106- }
4107- }
4108-
4109- return entry
4110- })()
4111-
4112- , registry = (function () {
4113- // our map stores arrays by event type, just because it's better than storing
4114- // everything in a single array. uses '$' as a prefix for the keys for safety
4115- var map = {}
4116-
4117- // generic functional search of our registry for matching listeners,
4118- // `fn` returns false to break out of the loop
4119- , forAll = function (element, type, original, handler, fn) {
4120- if (!type || type === '*') {
4121- // search the whole registry
4122- for (var t in map) {
4123- if (t.charAt(0) === '$')
4124- forAll(element, t.substr(1), original, handler, fn)
4125- }
4126- } else {
4127- var i = 0, l, list = map['$' + type], all = element === '*'
4128- if (!list)
4129- return
4130- for (l = list.length; i < l; i++) {
4131- if (all || list[i].matches(element, original, handler))
4132- if (!fn(list[i], list, i, type))
4133- return
4134- }
4135- }
4136- }
4137-
4138- , has = function (element, type, original) {
4139- // we're not using forAll here simply because it's a bit slower and this
4140- // needs to be fast
4141- var i, list = map['$' + type]
4142- if (list) {
4143- for (i = list.length; i--;) {
4144- if (list[i].matches(element, original, null))
4145- return true
4146- }
4147- }
4148- return false
4149- }
4150-
4151- , get = function (element, type, original) {
4152- var entries = []
4153- forAll(element, type, original, null, function (entry) { return entries.push(entry) })
4154- return entries
4155- }
4156-
4157- , put = function (entry) {
4158- (map['$' + entry.type] || (map['$' + entry.type] = [])).push(entry)
4159- return entry
4160- }
4161-
4162- , del = function (entry) {
4163- forAll(entry.element, entry.type, null, entry.handler, function (entry, list, i) {
4164- list.splice(i, 1)
4165- if (list.length === 0)
4166- delete map['$' + entry.type]
4167- return false
4168- })
4169- }
4170-
4171- // dump all entries, used for onunload
4172- , entries = function () {
4173- var t, entries = []
4174- for (t in map) {
4175- if (t.charAt(0) === '$')
4176- entries = entries.concat(map[t])
4177- }
4178- return entries
4179- }
4180-
4181- return { has: has, get: get, put: put, del: del, entries: entries }
4182- })()
4183-
4184- // add and remove listeners to DOM elements
4185- , listener = W3C_MODEL ? function (element, type, fn, add) {
4186- element[add ? addEvent : removeEvent](type, fn, false)
4187- } : function (element, type, fn, add, custom) {
4188- if (custom && add && element['_on' + custom] === null)
4189- element['_on' + custom] = 0
4190- element[add ? attachEvent : detachEvent]('on' + type, fn)
4191- }
4192-
4193- , nativeHandler = function (element, fn, args) {
4194- return function (event) {
4195- event = fixEvent(event || ((this.ownerDocument || this.document || this).parentWindow || win).event, true)
4196- return fn.apply(element, [event].concat(args))
4197- }
4198- }
4199-
4200- , customHandler = function (element, fn, type, condition, args, isNative) {
4201- return function (event) {
4202- if (condition ? condition.apply(this, arguments) : W3C_MODEL ? true : event && event.propertyName === '_on' + type || !event) {
4203- if (event)
4204- event = fixEvent(event || ((this.ownerDocument || this.document || this).parentWindow || win).event, isNative)
4205- fn.apply(element, event && (!args || args.length === 0) ? arguments : slice.call(arguments, event ? 0 : 1).concat(args))
4206- }
4207- }
4208- }
4209-
4210- , once = function (rm, element, type, fn, originalFn) {
4211- // wrap the handler in a handler that does a remove as well
4212- return function () {
4213- rm(element, type, originalFn)
4214- fn.apply(this, arguments)
4215- }
4216- }
4217-
4218- , removeListener = function (element, orgType, handler, namespaces) {
4219- var i, l, entry
4220- , type = (orgType && orgType.replace(nameRegex, ''))
4221- , handlers = registry.get(element, type, handler)
4222-
4223- for (i = 0, l = handlers.length; i < l; i++) {
4224- if (handlers[i].inNamespaces(namespaces)) {
4225- if ((entry = handlers[i]).eventSupport)
4226- listener(entry.target, entry.eventType, entry.handler, false, entry.type)
4227- // TODO: this is problematic, we have a registry.get() and registry.del() that
4228- // both do registry searches so we waste cycles doing this. Needs to be rolled into
4229- // a single registry.forAll(fn) that removes while finding, but the catch is that
4230- // we'll be splicing the arrays that we're iterating over. Needs extra tests to
4231- // make sure we don't screw it up. @rvagg
4232- registry.del(entry)
4233- }
4234- }
4235- }
4236-
4237- , addListener = function (element, orgType, fn, originalFn, args) {
4238- var entry
4239- , type = orgType.replace(nameRegex, '')
4240- , namespaces = orgType.replace(namespaceRegex, '').split('.')
4241-
4242- if (registry.has(element, type, fn))
4243- return element // no dupe
4244- if (type === 'unload')
4245- fn = once(removeListener, element, type, fn, originalFn) // self clean-up
4246- if (customEvents[type]) {
4247- if (customEvents[type].condition)
4248- fn = customHandler(element, fn, type, customEvents[type].condition, true)
4249- type = customEvents[type].base || type
4250- }
4251- entry = registry.put(new RegEntry(element, type, fn, originalFn, namespaces[0] && namespaces))
4252- entry.handler = entry.isNative ?
4253- nativeHandler(element, entry.handler, args) :
4254- customHandler(element, entry.handler, type, false, args, false)
4255- if (entry.eventSupport)
4256- listener(entry.target, entry.eventType, entry.handler, true, entry.customType)
4257- }
4258-
4259- , del = function (selector, fn, $) {
4260- return function (e) {
4261- var target, i, array = typeof selector === 'string' ? $(selector, this) : selector
4262- for (target = e.target; target && target !== this; target = target.parentNode) {
4263- for (i = array.length; i--;) {
4264- if (array[i] === target) {
4265- return fn.apply(target, arguments)
4266- }
4267- }
4268- }
4269- }
4270- }
4271-
4272- , remove = function (element, typeSpec, fn) {
4273- var k, m, type, namespaces, i
4274- , rm = removeListener
4275- , isString = typeSpec && typeof typeSpec === 'string'
4276-
4277- if (isString && typeSpec.indexOf(' ') > 0) {
4278- // remove(el, 't1 t2 t3', fn) or remove(el, 't1 t2 t3')
4279- typeSpec = typeSpec.split(' ')
4280- for (i = typeSpec.length; i--;)
4281- remove(element, typeSpec[i], fn)
4282- return element
4283- }
4284- type = isString && typeSpec.replace(nameRegex, '')
4285- if (type && customEvents[type])
4286- type = customEvents[type].type
4287- if (!typeSpec || isString) {
4288- // remove(el) or remove(el, t1.ns) or remove(el, .ns) or remove(el, .ns1.ns2.ns3)
4289- if (namespaces = isString && typeSpec.replace(namespaceRegex, ''))
4290- namespaces = namespaces.split('.')
4291- rm(element, type, fn, namespaces)
4292- } else if (typeof typeSpec === 'function') {
4293- // remove(el, fn)
4294- rm(element, null, typeSpec)
4295- } else {
4296- // remove(el, { t1: fn1, t2, fn2 })
4297- for (k in typeSpec) {
4298- if (typeSpec.hasOwnProperty(k))
4299- remove(element, k, typeSpec[k])
4300- }
4301- }
4302- return element
4303- }
4304-
4305- , add = function (element, events, fn, delfn, $) {
4306- var type, types, i, args
4307- , originalFn = fn
4308- , isDel = fn && typeof fn === 'string'
4309-
4310- if (events && !fn && typeof events === 'object') {
4311- for (type in events) {
4312- if (events.hasOwnProperty(type))
4313- add.apply(this, [ element, type, events[type] ])
4314- }
4315- } else {
4316- args = arguments.length > 3 ? slice.call(arguments, 3) : []
4317- types = (isDel ? fn : events).split(' ')
4318- isDel && (fn = del(events, (originalFn = delfn), $)) && (args = slice.call(args, 1))
4319- // special case for one()
4320- this === ONE && (fn = once(remove, element, events, fn, originalFn))
4321- for (i = types.length; i--;) addListener(element, types[i], fn, originalFn, args)
4322- }
4323- return element
4324- }
4325-
4326- , one = function () {
4327- return add.apply(ONE, arguments)
4328- }
4329-
4330- , fireListener = W3C_MODEL ? function (isNative, type, element) {
4331- var evt = doc.createEvent(isNative ? 'HTMLEvents' : 'UIEvents')
4332- evt[isNative ? 'initEvent' : 'initUIEvent'](type, true, true, win, 1)
4333- element.dispatchEvent(evt)
4334- } : function (isNative, type, element) {
4335- element = targetElement(element, isNative)
4336- // if not-native then we're using onpropertychange so we just increment a custom property
4337- isNative ? element.fireEvent('on' + type, doc.createEventObject()) : element['_on' + type]++
4338- }
4339-
4340- , fire = function (element, type, args) {
4341- var i, j, l, names, handlers
4342- , types = type.split(' ')
4343-
4344- for (i = types.length; i--;) {
4345- type = types[i].replace(nameRegex, '')
4346- if (names = types[i].replace(namespaceRegex, ''))
4347- names = names.split('.')
4348- if (!names && !args && element[eventSupport]) {
4349- fireListener(nativeEvents[type], type, element)
4350- } else {
4351- // non-native event, either because of a namespace, arguments or a non DOM element
4352- // iterate over all listeners and manually 'fire'
4353- handlers = registry.get(element, type)
4354- args = [false].concat(args)
4355- for (j = 0, l = handlers.length; j < l; j++) {
4356- if (handlers[j].inNamespaces(names))
4357- handlers[j].handler.apply(element, args)
4358- }
4359- }
4360- }
4361- return element
4362- }
4363-
4364- , clone = function (element, from, type) {
4365- var i = 0
4366- , handlers = registry.get(from, type)
4367- , l = handlers.length
4368-
4369- for (;i < l; i++)
4370- handlers[i].original && add(element, handlers[i].type, handlers[i].original)
4371- return element
4372- }
4373-
4374- , bean = {
4375- add: add
4376- , one: one
4377- , remove: remove
4378- , clone: clone
4379- , fire: fire
4380- , noConflict: function () {
4381- context[name] = old
4382- return this
4383- }
4384- }
4385-
4386- if (win[attachEvent]) {
4387- // for IE, clean up on unload to avoid leaks
4388- var cleanup = function () {
4389- var i, entries = registry.entries()
4390- for (i in entries) {
4391- if (entries[i].type && entries[i].type !== 'unload')
4392- remove(entries[i].element, entries[i].type)
4393- }
4394- win[detachEvent]('onunload', cleanup)
4395- win.CollectGarbage && win.CollectGarbage()
4396- }
4397- win[attachEvent]('onunload', cleanup)
4398- }
4399-
4400- return bean
4401-});
4402-// Underscore.js 1.1.7
4403-// (c) 2011 Jeremy Ashkenas, DocumentCloud Inc.
4404-// Underscore is freely distributable under the MIT license.
4405-// Portions of Underscore are inspired or borrowed from Prototype,
4406-// Oliver Steele's Functional, and John Resig's Micro-Templating.
4407-// For all details and documentation:
4408-// http://documentcloud.github.com/underscore
4409-
4410-(function() {
4411-
4412- // Baseline setup
4413- // --------------
4414-
4415- // Establish the root object, `window` in the browser, or `global` on the server.
4416- var root = this;
4417-
4418- // Save the previous value of the `_` variable.
4419- var previousUnderscore = root._;
4420-
4421- // Establish the object that gets returned to break out of a loop iteration.
4422- var breaker = {};
4423-
4424- // Save bytes in the minified (but not gzipped) version:
4425- var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
4426-
4427- // Create quick reference variables for speed access to core prototypes.
4428- var slice = ArrayProto.slice,
4429- unshift = ArrayProto.unshift,
4430- toString = ObjProto.toString,
4431- hasOwnProperty = ObjProto.hasOwnProperty;
4432-
4433- // All **ECMAScript 5** native function implementations that we hope to use
4434- // are declared here.
4435- var
4436- nativeForEach = ArrayProto.forEach,
4437- nativeMap = ArrayProto.map,
4438- nativeReduce = ArrayProto.reduce,
4439- nativeReduceRight = ArrayProto.reduceRight,
4440- nativeFilter = ArrayProto.filter,
4441- nativeEvery = ArrayProto.every,
4442- nativeSome = ArrayProto.some,
4443- nativeIndexOf = ArrayProto.indexOf,
4444- nativeLastIndexOf = ArrayProto.lastIndexOf,
4445- nativeIsArray = Array.isArray,
4446- nativeKeys = Object.keys,
4447- nativeBind = FuncProto.bind;
4448-
4449- // Create a safe reference to the Underscore object for use below.
4450- var _ = function(obj) { return new wrapper(obj); };
4451-
4452- // Export the Underscore object for **CommonJS**, with backwards-compatibility
4453- // for the old `require()` API. If we're not in CommonJS, add `_` to the
4454- // global object.
4455- if (typeof module !== 'undefined' && module.exports) {
4456- module.exports = _;
4457- _._ = _;
4458- } else {
4459- // Exported as a string, for Closure Compiler "advanced" mode.
4460- root['_'] = _;
4461- }
4462-
4463- // Current version.
4464- _.VERSION = '1.1.7';
4465-
4466- // Collection Functions
4467- // --------------------
4468-
4469- // The cornerstone, an `each` implementation, aka `forEach`.
4470- // Handles objects with the built-in `forEach`, arrays, and raw objects.
4471- // Delegates to **ECMAScript 5**'s native `forEach` if available.
4472- var each = _.each = _.forEach = function(obj, iterator, context) {
4473- if (obj == null) return;
4474- if (nativeForEach && obj.forEach === nativeForEach) {
4475- obj.forEach(iterator, context);
4476- } else if (obj.length === +obj.length) {
4477- for (var i = 0, l = obj.length; i < l; i++) {
4478- if (i in obj && iterator.call(context, obj[i], i, obj) === breaker) return;
4479- }
4480- } else {
4481- for (var key in obj) {
4482- if (hasOwnProperty.call(obj, key)) {
4483- if (iterator.call(context, obj[key], key, obj) === breaker) return;
4484- }
4485- }
4486- }
4487- };
4488-
4489- // Return the results of applying the iterator to each element.
4490- // Delegates to **ECMAScript 5**'s native `map` if available.
4491- _.map = function(obj, iterator, context) {
4492- var results = [];
4493- if (obj == null) return results;
4494- if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
4495- each(obj, function(value, index, list) {
4496- results[results.length] = iterator.call(context, value, index, list);
4497- });
4498- return results;
4499- };
4500-
4501- // **Reduce** builds up a single result from a list of values, aka `inject`,
4502- // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.
4503- _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {
4504- var initial = memo !== void 0;
4505- if (obj == null) obj = [];
4506- if (nativeReduce && obj.reduce === nativeReduce) {
4507- if (context) iterator = _.bind(iterator, context);
4508- return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);
4509- }
4510- each(obj, function(value, index, list) {
4511- if (!initial) {
4512- memo = value;
4513- initial = true;
4514- } else {
4515- memo = iterator.call(context, memo, value, index, list);
4516- }
4517- });
4518- if (!initial) throw new TypeError("Reduce of empty array with no initial value");
4519- return memo;
4520- };
4521-
4522- // The right-associative version of reduce, also known as `foldr`.
4523- // Delegates to **ECMAScript 5**'s native `reduceRight` if available.
4524- _.reduceRight = _.foldr = function(obj, iterator, memo, context) {
4525- if (obj == null) obj = [];
4526- if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {
4527- if (context) iterator = _.bind(iterator, context);
4528- return memo !== void 0 ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);
4529- }
4530- var reversed = (_.isArray(obj) ? obj.slice() : _.toArray(obj)).reverse();
4531- return _.reduce(reversed, iterator, memo, context);
4532- };
4533-
4534- // Return the first value which passes a truth test. Aliased as `detect`.
4535- _.find = _.detect = function(obj, iterator, context) {
4536- var result;
4537- any(obj, function(value, index, list) {
4538- if (iterator.call(context, value, index, list)) {
4539- result = value;
4540- return true;
4541- }
4542- });
4543- return result;
4544- };
4545-
4546- // Return all the elements that pass a truth test.
4547- // Delegates to **ECMAScript 5**'s native `filter` if available.
4548- // Aliased as `select`.
4549- _.filter = _.select = function(obj, iterator, context) {
4550- var results = [];
4551- if (obj == null) return results;
4552- if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);
4553- each(obj, function(value, index, list) {
4554- if (iterator.call(context, value, index, list)) results[results.length] = value;
4555- });
4556- return results;
4557- };
4558-
4559- // Return all the elements for which a truth test fails.
4560- _.reject = function(obj, iterator, context) {
4561- var results = [];
4562- if (obj == null) return results;
4563- each(obj, function(value, index, list) {
4564- if (!iterator.call(context, value, index, list)) results[results.length] = value;
4565- });
4566- return results;
4567- };
4568-
4569- // Determine whether all of the elements match a truth test.
4570- // Delegates to **ECMAScript 5**'s native `every` if available.
4571- // Aliased as `all`.
4572- _.every = _.all = function(obj, iterator, context) {
4573- var result = true;
4574- if (obj == null) return result;
4575- if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);
4576- each(obj, function(value, index, list) {
4577- if (!(result = result && iterator.call(context, value, index, list))) return breaker;
4578- });
4579- return result;
4580- };
4581-
4582- // Determine if at least one element in the object matches a truth test.
4583- // Delegates to **ECMAScript 5**'s native `some` if available.
4584- // Aliased as `any`.
4585- var any = _.some = _.any = function(obj, iterator, context) {
4586- iterator = iterator || _.identity;
4587- var result = false;
4588- if (obj == null) return result;
4589- if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);
4590- each(obj, function(value, index, list) {
4591- if (result |= iterator.call(context, value, index, list)) return breaker;
4592- });
4593- return !!result;
4594- };
4595-
4596- // Determine if a given value is included in the array or object using `===`.
4597- // Aliased as `contains`.
4598- _.include = _.contains = function(obj, target) {
4599- var found = false;
4600- if (obj == null) return found;
4601- if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
4602- any(obj, function(value) {
4603- if (found = value === target) return true;
4604- });
4605- return found;
4606- };
4607-
4608- // Invoke a method (with arguments) on every item in a collection.
4609- _.invoke = function(obj, method) {
4610- var args = slice.call(arguments, 2);
4611- return _.map(obj, function(value) {
4612- return (method.call ? method || value : value[method]).apply(value, args);
4613- });
4614- };
4615-
4616- // Convenience version of a common use case of `map`: fetching a property.
4617- _.pluck = function(obj, key) {
4618- return _.map(obj, function(value){ return value[key]; });
4619- };
4620-
4621- // Return the maximum element or (element-based computation).
4622- _.max = function(obj, iterator, context) {
4623- if (!iterator && _.isArray(obj)) return Math.max.apply(Math, obj);
4624- var result = {computed : -Infinity};
4625- each(obj, function(value, index, list) {
4626- var computed = iterator ? iterator.call(context, value, index, list) : value;
4627- computed >= result.computed && (result = {value : value, computed : computed});
4628- });
4629- return result.value;
4630- };
4631-
4632- // Return the minimum element (or element-based computation).
4633- _.min = function(obj, iterator, context) {
4634- if (!iterator && _.isArray(obj)) return Math.min.apply(Math, obj);
4635- var result = {computed : Infinity};
4636- each(obj, function(value, index, list) {
4637- var computed = iterator ? iterator.call(context, value, index, list) : value;
4638- computed < result.computed && (result = {value : value, computed : computed});
4639- });
4640- return result.value;
4641- };
4642-
4643- // Sort the object's values by a criterion produced by an iterator.
4644- _.sortBy = function(obj, iterator, context) {
4645- return _.pluck(_.map(obj, function(value, index, list) {
4646- return {
4647- value : value,
4648- criteria : iterator.call(context, value, index, list)
4649- };
4650- }).sort(function(left, right) {
4651- var a = left.criteria, b = right.criteria;
4652- return a < b ? -1 : a > b ? 1 : 0;
4653- }), 'value');
4654- };
4655-
4656- // Groups the object's values by a criterion produced by an iterator
4657- _.groupBy = function(obj, iterator) {
4658- var result = {};
4659- each(obj, function(value, index) {
4660- var key = iterator(value, index);
4661- (result[key] || (result[key] = [])).push(value);
4662- });
4663- return result;
4664- };
4665-
4666- // Use a comparator function to figure out at what index an object should
4667- // be inserted so as to maintain order. Uses binary search.
4668- _.sortedIndex = function(array, obj, iterator) {
4669- iterator || (iterator = _.identity);
4670- var low = 0, high = array.length;
4671- while (low < high) {
4672- var mid = (low + high) >> 1;
4673- iterator(array[mid]) < iterator(obj) ? low = mid + 1 : high = mid;
4674- }
4675- return low;
4676- };
4677-
4678- // Safely convert anything iterable into a real, live array.
4679- _.toArray = function(iterable) {
4680- if (!iterable) return [];
4681- if (iterable.toArray) return iterable.toArray();
4682- if (_.isArray(iterable)) return slice.call(iterable);
4683- if (_.isArguments(iterable)) return slice.call(iterable);
4684- return _.values(iterable);
4685- };
4686-
4687- // Return the number of elements in an object.
4688- _.size = function(obj) {
4689- return _.toArray(obj).length;
4690- };
4691-
4692- // Array Functions
4693- // ---------------
4694-
4695- // Get the first element of an array. Passing **n** will return the first N
4696- // values in the array. Aliased as `head`. The **guard** check allows it to work
4697- // with `_.map`.
4698- _.first = _.head = function(array, n, guard) {
4699- return (n != null) && !guard ? slice.call(array, 0, n) : array[0];
4700- };
4701-
4702- // Returns everything but the first entry of the array. Aliased as `tail`.
4703- // Especially useful on the arguments object. Passing an **index** will return
4704- // the rest of the values in the array from that index onward. The **guard**
4705- // check allows it to work with `_.map`.
4706- _.rest = _.tail = function(array, index, guard) {
4707- return slice.call(array, (index == null) || guard ? 1 : index);
4708- };
4709-
4710- // Get the last element of an array.
4711- _.last = function(array) {
4712- return array[array.length - 1];
4713- };
4714-
4715- // Trim out all falsy values from an array.
4716- _.compact = function(array) {
4717- return _.filter(array, function(value){ return !!value; });
4718- };
4719-
4720- // Return a completely flattened version of an array.
4721- _.flatten = function(array) {
4722- return _.reduce(array, function(memo, value) {
4723- if (_.isArray(value)) return memo.concat(_.flatten(value));
4724- memo[memo.length] = value;
4725- return memo;
4726- }, []);
4727- };
4728-
4729- // Return a version of the array that does not contain the specified value(s).
4730- _.without = function(array) {
4731- return _.difference(array, slice.call(arguments, 1));
4732- };
4733-
4734- // Produce a duplicate-free version of the array. If the array has already
4735- // been sorted, you have the option of using a faster algorithm.
4736- // Aliased as `unique`.
4737- _.uniq = _.unique = function(array, isSorted) {
4738- return _.reduce(array, function(memo, el, i) {
4739- if (0 == i || (isSorted === true ? _.last(memo) != el : !_.include(memo, el))) memo[memo.length] = el;
4740- return memo;
4741- }, []);
4742- };
4743-
4744- // Produce an array that contains the union: each distinct element from all of
4745- // the passed-in arrays.
4746- _.union = function() {
4747- return _.uniq(_.flatten(arguments));
4748- };
4749-
4750- // Produce an array that contains every item shared between all the
4751- // passed-in arrays. (Aliased as "intersect" for back-compat.)
4752- _.intersection = _.intersect = function(array) {
4753- var rest = slice.call(arguments, 1);
4754- return _.filter(_.uniq(array), function(item) {
4755- return _.every(rest, function(other) {
4756- return _.indexOf(other, item) >= 0;
4757- });
4758- });
4759- };
4760-
4761- // Take the difference between one array and another.
4762- // Only the elements present in just the first array will remain.
4763- _.difference = function(array, other) {
4764- return _.filter(array, function(value){ return !_.include(other, value); });
4765- };
4766-
4767- // Zip together multiple lists into a single array -- elements that share
4768- // an index go together.
4769- _.zip = function() {
4770- var args = slice.call(arguments);
4771- var length = _.max(_.pluck(args, 'length'));
4772- var results = new Array(length);
4773- for (var i = 0; i < length; i++) results[i] = _.pluck(args, "" + i);
4774- return results;
4775- };
4776-
4777- // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),
4778- // we need this function. Return the position of the first occurrence of an
4779- // item in an array, or -1 if the item is not included in the array.
4780- // Delegates to **ECMAScript 5**'s native `indexOf` if available.
4781- // If the array is large and already in sort order, pass `true`
4782- // for **isSorted** to use binary search.
4783- _.indexOf = function(array, item, isSorted) {
4784- if (array == null) return -1;
4785- var i, l;
4786- if (isSorted) {
4787- i = _.sortedIndex(array, item);
4788- return array[i] === item ? i : -1;
4789- }
4790- if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item);
4791- for (i = 0, l = array.length; i < l; i++) if (array[i] === item) return i;
4792- return -1;
4793- };
4794-
4795-
4796- // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.
4797- _.lastIndexOf = function(array, item) {
4798- if (array == null) return -1;
4799- if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) return array.lastIndexOf(item);
4800- var i = array.length;
4801- while (i--) if (array[i] === item) return i;
4802- return -1;
4803- };
4804-
4805- // Generate an integer Array containing an arithmetic progression. A port of
4806- // the native Python `range()` function. See
4807- // [the Python documentation](http://docs.python.org/library/functions.html#range).
4808- _.range = function(start, stop, step) {
4809- if (arguments.length <= 1) {
4810- stop = start || 0;
4811- start = 0;
4812- }
4813- step = arguments[2] || 1;
4814-
4815- var len = Math.max(Math.ceil((stop - start) / step), 0);
4816- var idx = 0;
4817- var range = new Array(len);
4818-
4819- while(idx < len) {
4820- range[idx++] = start;
4821- start += step;
4822- }
4823-
4824- return range;
4825- };
4826-
4827- // Function (ahem) Functions
4828- // ------------------
4829-
4830- // Create a function bound to a given object (assigning `this`, and arguments,
4831- // optionally). Binding with arguments is also known as `curry`.
4832- // Delegates to **ECMAScript 5**'s native `Function.bind` if available.
4833- // We check for `func.bind` first, to fail fast when `func` is undefined.
4834- _.bind = function(func, obj) {
4835- if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
4836- var args = slice.call(arguments, 2);
4837- return function() {
4838- return func.apply(obj, args.concat(slice.call(arguments)));
4839- };
4840- };
4841-
4842- // Bind all of an object's methods to that object. Useful for ensuring that
4843- // all callbacks defined on an object belong to it.
4844- _.bindAll = function(obj) {
4845- var funcs = slice.call(arguments, 1);
4846- if (funcs.length == 0) funcs = _.functions(obj);
4847- each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });
4848- return obj;
4849- };
4850-
4851- // Memoize an expensive function by storing its results.
4852- _.memoize = function(func, hasher) {
4853- var memo = {};
4854- hasher || (hasher = _.identity);
4855- return function() {
4856- var key = hasher.apply(this, arguments);
4857- return hasOwnProperty.call(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));
4858- };
4859- };
4860-
4861- // Delays a function for the given number of milliseconds, and then calls
4862- // it with the arguments supplied.
4863- _.delay = function(func, wait) {
4864- var args = slice.call(arguments, 2);
4865- return setTimeout(function(){ return func.apply(func, args); }, wait);
4866- };
4867-
4868- // Defers a function, scheduling it to run after the current call stack has
4869- // cleared.
4870- _.defer = function(func) {
4871- return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));
4872- };
4873-
4874- // Internal function used to implement `_.throttle` and `_.debounce`.
4875- var limit = function(func, wait, debounce) {
4876- var timeout;
4877- return function() {
4878- var context = this, args = arguments;
4879- var throttler = function() {
4880- timeout = null;
4881- func.apply(context, args);
4882- };
4883- if (debounce) clearTimeout(timeout);
4884- if (debounce || !timeout) timeout = setTimeout(throttler, wait);
4885- };
4886- };
4887-
4888- // Returns a function, that, when invoked, will only be triggered at most once
4889- // during a given window of time.
4890- _.throttle = function(func, wait) {
4891- return limit(func, wait, false);
4892- };
4893-
4894- // Returns a function, that, as long as it continues to be invoked, will not
4895- // be triggered. The function will be called after it stops being called for
4896- // N milliseconds.
4897- _.debounce = function(func, wait) {
4898- return limit(func, wait, true);
4899- };
4900-
4901- // Returns a function that will be executed at most one time, no matter how
4902- // often you call it. Useful for lazy initialization.
4903- _.once = function(func) {
4904- var ran = false, memo;
4905- return function() {
4906- if (ran) return memo;
4907- ran = true;
4908- return memo = func.apply(this, arguments);
4909- };
4910- };
4911-
4912- // Returns the first function passed as an argument to the second,
4913- // allowing you to adjust arguments, run code before and after, and
4914- // conditionally execute the original function.
4915- _.wrap = function(func, wrapper) {
4916- return function() {
4917- var args = [func].concat(slice.call(arguments));
4918- return wrapper.apply(this, args);
4919- };
4920- };
4921-
4922- // Returns a function that is the composition of a list of functions, each
4923- // consuming the return value of the function that follows.
4924- _.compose = function() {
4925- var funcs = slice.call(arguments);
4926- return function() {
4927- var args = slice.call(arguments);
4928- for (var i = funcs.length - 1; i >= 0; i--) {
4929- args = [funcs[i].apply(this, args)];
4930- }
4931- return args[0];
4932- };
4933- };
4934-
4935- // Returns a function that will only be executed after being called N times.
4936- _.after = function(times, func) {
4937- return function() {
4938- if (--times < 1) { return func.apply(this, arguments); }
4939- };
4940- };
4941-
4942-
4943- // Object Functions
4944- // ----------------
4945-
4946- // Retrieve the names of an object's properties.
4947- // Delegates to **ECMAScript 5**'s native `Object.keys`
4948- _.keys = nativeKeys || function(obj) {
4949- if (obj !== Object(obj)) throw new TypeError('Invalid object');
4950- var keys = [];
4951- for (var key in obj) if (hasOwnProperty.call(obj, key)) keys[keys.length] = key;
4952- return keys;
4953- };
4954-
4955- // Retrieve the values of an object's properties.
4956- _.values = function(obj) {
4957- return _.map(obj, _.identity);
4958- };
4959-
4960- // Return a sorted list of the function names available on the object.
4961- // Aliased as `methods`
4962- _.functions = _.methods = function(obj) {
4963- var names = [];
4964- for (var key in obj) {
4965- if (_.isFunction(obj[key])) names.push(key);
4966- }
4967- return names.sort();
4968- };
4969-
4970- // Extend a given object with all the properties in passed-in object(s).
4971- _.extend = function(obj) {
4972- each(slice.call(arguments, 1), function(source) {
4973- for (var prop in source) {
4974- if (source[prop] !== void 0) obj[prop] = source[prop];
4975- }
4976- });
4977- return obj;
4978- };
4979-
4980- // Fill in a given object with default properties.
4981- _.defaults = function(obj) {
4982- each(slice.call(arguments, 1), function(source) {
4983- for (var prop in source) {
4984- if (obj[prop] == null) obj[prop] = source[prop];
4985- }
4986- });
4987- return obj;
4988- };
4989-
4990- // Create a (shallow-cloned) duplicate of an object.
4991- _.clone = function(obj) {
4992- return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
4993- };
4994-
4995- // Invokes interceptor with the obj, and then returns obj.
4996- // The primary purpose of this method is to "tap into" a method chain, in
4997- // order to perform operations on intermediate results within the chain.
4998- _.tap = function(obj, interceptor) {
4999- interceptor(obj);
5000- return obj;
The diff has been truncated for viewing.