diff --git a/assets/images/close.gif b/lib/assets/images/close.gif similarity index 100% rename from assets/images/close.gif rename to lib/assets/images/close.gif diff --git a/assets/images/delete.gif b/lib/assets/images/delete.gif similarity index 100% rename from assets/images/delete.gif rename to lib/assets/images/delete.gif diff --git a/assets/images/delete.png b/lib/assets/images/delete.png similarity index 100% rename from assets/images/delete.png rename to lib/assets/images/delete.png diff --git a/assets/images/disk.gif b/lib/assets/images/disk.gif similarity index 100% rename from assets/images/disk.gif rename to lib/assets/images/disk.gif diff --git a/assets/images/disks.gif b/lib/assets/images/disks.gif similarity index 100% rename from assets/images/disks.gif rename to lib/assets/images/disks.gif diff --git a/assets/images/icon_info_red.gif b/lib/assets/images/icon_info_red.gif similarity index 100% rename from assets/images/icon_info_red.gif rename to lib/assets/images/icon_info_red.gif diff --git a/assets/images/loading.gif b/lib/assets/images/loading.gif similarity index 100% rename from assets/images/loading.gif rename to lib/assets/images/loading.gif diff --git a/assets/images/remove.gif b/lib/assets/images/remove.gif similarity index 100% rename from assets/images/remove.gif rename to lib/assets/images/remove.gif diff --git a/assets/images/remove.png b/lib/assets/images/remove.png similarity index 100% rename from assets/images/remove.png rename to lib/assets/images/remove.png diff --git a/lib/assets/images/reporting_engine/close.gif b/lib/assets/images/reporting_engine/close.gif new file mode 100644 index 0000000000..f072eb5fc6 Binary files /dev/null and b/lib/assets/images/reporting_engine/close.gif differ diff --git a/lib/assets/images/reporting_engine/delete.gif b/lib/assets/images/reporting_engine/delete.gif new file mode 100644 index 0000000000..7667901311 Binary files /dev/null and b/lib/assets/images/reporting_engine/delete.gif differ diff --git a/lib/assets/images/reporting_engine/delete.png b/lib/assets/images/reporting_engine/delete.png new file mode 100644 index 0000000000..a1af31d833 Binary files /dev/null and b/lib/assets/images/reporting_engine/delete.png differ diff --git a/lib/assets/images/reporting_engine/disk.gif b/lib/assets/images/reporting_engine/disk.gif new file mode 100644 index 0000000000..7e56515ad2 Binary files /dev/null and b/lib/assets/images/reporting_engine/disk.gif differ diff --git a/lib/assets/images/reporting_engine/disks.gif b/lib/assets/images/reporting_engine/disks.gif new file mode 100644 index 0000000000..df582582cb Binary files /dev/null and b/lib/assets/images/reporting_engine/disks.gif differ diff --git a/lib/assets/images/reporting_engine/icon_info_red.gif b/lib/assets/images/reporting_engine/icon_info_red.gif new file mode 100644 index 0000000000..34de8c6b98 Binary files /dev/null and b/lib/assets/images/reporting_engine/icon_info_red.gif differ diff --git a/lib/assets/images/reporting_engine/loading.gif b/lib/assets/images/reporting_engine/loading.gif new file mode 100644 index 0000000000..085ccaecaf Binary files /dev/null and b/lib/assets/images/reporting_engine/loading.gif differ diff --git a/lib/assets/images/reporting_engine/remove.gif b/lib/assets/images/reporting_engine/remove.gif new file mode 100644 index 0000000000..0ac6342b7e Binary files /dev/null and b/lib/assets/images/reporting_engine/remove.gif differ diff --git a/lib/assets/images/reporting_engine/remove.png b/lib/assets/images/reporting_engine/remove.png new file mode 100644 index 0000000000..bd2299292f Binary files /dev/null and b/lib/assets/images/reporting_engine/remove.png differ diff --git a/assets/javascripts/cordinc_tooltip.js b/lib/assets/javascripts/cordinc_tooltip.js similarity index 100% rename from assets/javascripts/cordinc_tooltip.js rename to lib/assets/javascripts/cordinc_tooltip.js diff --git a/assets/javascripts/reporting.js b/lib/assets/javascripts/reporting.js similarity index 100% rename from assets/javascripts/reporting.js rename to lib/assets/javascripts/reporting.js diff --git a/assets/javascripts/reporting/controls.js b/lib/assets/javascripts/reporting/controls.js similarity index 100% rename from assets/javascripts/reporting/controls.js rename to lib/assets/javascripts/reporting/controls.js diff --git a/assets/javascripts/reporting/filters.js b/lib/assets/javascripts/reporting/filters.js similarity index 100% rename from assets/javascripts/reporting/filters.js rename to lib/assets/javascripts/reporting/filters.js diff --git a/assets/javascripts/reporting/group_bys.js b/lib/assets/javascripts/reporting/group_bys.js similarity index 100% rename from assets/javascripts/reporting/group_bys.js rename to lib/assets/javascripts/reporting/group_bys.js diff --git a/assets/javascripts/reporting/lang/reporting-de.js b/lib/assets/javascripts/reporting/lang/reporting-de.js similarity index 100% rename from assets/javascripts/reporting/lang/reporting-de.js rename to lib/assets/javascripts/reporting/lang/reporting-de.js diff --git a/assets/javascripts/reporting/lang/reporting-en.js b/lib/assets/javascripts/reporting/lang/reporting-en.js similarity index 100% rename from assets/javascripts/reporting/lang/reporting-en.js rename to lib/assets/javascripts/reporting/lang/reporting-en.js diff --git a/assets/javascripts/reporting/progressbar.js b/lib/assets/javascripts/reporting/progressbar.js similarity index 100% rename from assets/javascripts/reporting/progressbar.js rename to lib/assets/javascripts/reporting/progressbar.js diff --git a/assets/javascripts/reporting/prototype_progress_bar.js b/lib/assets/javascripts/reporting/prototype_progress_bar.js similarity index 100% rename from assets/javascripts/reporting/prototype_progress_bar.js rename to lib/assets/javascripts/reporting/prototype_progress_bar.js diff --git a/assets/javascripts/reporting/restore_query.js b/lib/assets/javascripts/reporting/restore_query.js similarity index 100% rename from assets/javascripts/reporting/restore_query.js rename to lib/assets/javascripts/reporting/restore_query.js diff --git a/lib/assets/javascripts/reporting_engine/cordinc_tooltip.js b/lib/assets/javascripts/reporting_engine/cordinc_tooltip.js new file mode 100644 index 0000000000..c4c2ee260c --- /dev/null +++ b/lib/assets/javascripts/reporting_engine/cordinc_tooltip.js @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2009 Charles Cordingley (www.cordinc.com) + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * cordinc_tooltip.js, v1.0.2 - 27 August 2008 + * For help see www.cordinc.com/projects/tooltips.html + */ +var Tooltip = Class.create({ + initialize: function(target, tooltip) { + var options = Object.extend({ + start_effect: function(element) {}, + end_effect: function(element) {}, + zindex: 1000, + offset: {x:0, y:0}, + hook: {target:'topRight', tip:'bottomLeft'}, + trigger: false, + DOM_location: false, + className: false, + delay: {} + }, arguments[2] || {}); + this.target = $(target); + this.show_at = (options.show_at_id !== undefined) ? $(options.show_at_id) : undefined + this.tooltip = $(tooltip); + this.options = options; + this.event_target = this.options.trigger?$(this.options.trigger):this.target; + + if (this.options.className) { + this.tooltip.addClassName(this.options.className); + } + this.tooltip.hide(); + this.display=false; + + this.mouse_over = this.displayTooltip.bindAsEventListener(this); + this.mouse_out = this.removeTooltip.bindAsEventListener(this); + this.event_target.observe("mouseover", this.mouse_over); + this.event_target.observe("mouseout", this.mouse_out); + }, + + displayTooltip: function(event){ + event.stop(); + + if (this.display) {return;} + if (this.options.delay.start) { + var self = this; + this.timer_id = setTimeout(function(){self.timer_id = false; self.showTooltip(event);}, this.options.delay.start*1000); + } else { + this.showTooltip(event); + } + }, + + showTooltip: function(event) { + var show_at = (this.show_at !== undefined) ? this.show_at : this.target + this.display=true; + position = this.positionTooltip(event); + + this.clone = this.tooltip.cloneNode(true); + parentId = this.options.DOM_location?$(this.options.DOM_location.parentId):show_at.parentNode; + successorId = this.options.DOM_location?$(this.options.DOM_location.successorId):show_at; + parentId.insertBefore(this.clone, successorId); + + this.clone.setStyle({ + position: 'absolute', + top: position.top + "px", + left: position.left + "px", + display: "inline", + zIndex:this.options.zindex, + /* fix for ur dashboard */ + visibility: 'visible', + width: "400px" + }); + + if (this.options.start_effect) { + this.options.start_effect(this.clone); + } + }, + + positionTooltip: function(event) { + target_position = this.target.cumulativeOffset(); + + tooltip_dimensions = this.tooltip.getDimensions(); + target_dimensions = this.target.getDimensions(); + + this.positionModify(target_position, target_dimensions, this.options.hook.target, 1); + this.positionModify(target_position, tooltip_dimensions, this.options.hook.tip, -1); + + target_position.top += this.options.offset.y; + target_position.left += this.options.offset.x; + + return target_position; + }, + + positionModify: function(position, box, corner, neg) { + if (corner == 'topRight') { + position.left += box.width*neg; + } else if (corner == 'topLeft') { + } else if (corner == 'bottomLeft') { + position.top += box.height*neg; + } else if (corner == 'bottomRight') { + position.top += box.height*neg; + position.left += box.width*neg; + } else if (corner == 'topMid') { + position.left += (box.width/2)*neg; + } else if (corner == 'leftMid') { + position.top += (box.height/2)*neg; + } else if (corner == 'bottomMid') { + position.top += box.height*neg; + position.left += (box.width/2)*neg; + } else if (corner == 'rightMid') { + position.top += (box.height/2)*neg; + position.left += box.width*neg; + } + }, + + removeTooltip: function(event) { + if (this.timer_id) { + clearTimeout(this.timer_id); + this.timer_id = false; + return; + } + + if (this.options.end_effect) { + this.options.end_effect(this.clone); + } + + if (this.options.delay.end) { + var self = this; + setTimeout(function(){self.clearTooltip();}, this.options.delay.end*1000); + } else { + this.clearTooltip(); + } + }, + + clearTooltip: function() { + if (this.clone !== undefined && this.clone !== null) { + this.clone.remove(); + this.clone = null; + this.display=false; + } + }, + + destroy: function() { + this.event_target.stopObserving("mouseover", this.mouse_over); + this.event_target.stopObserving("mouseout", this.mouse_out); + this.clearTooltip(); + } +}) \ No newline at end of file diff --git a/lib/assets/javascripts/reporting_engine/reporting.js b/lib/assets/javascripts/reporting_engine/reporting.js new file mode 100644 index 0000000000..8bb67904ce --- /dev/null +++ b/lib/assets/javascripts/reporting_engine/reporting.js @@ -0,0 +1,72 @@ +/*jslint white: false, nomen: true, devel: true, on: true, debug: false, evil: true, onevar: false, browser: true, white: false, indent: 2 */ +/*global window, $, $$, Reporting, Element */ + +window.Reporting = { + source: ($$("head")[0].select("script[src*='reporting.js']")[0].src), + + require: function (libraryName) { + var jsName = Reporting.source.replace("reporting.js", "reporting/" + libraryName + ".js"); + try { + // inserting via DOM fails in Safari 2.0, so brute force approach + document.write('