From 271805242fa40e2b31ea6006cbcccf5fe8ead0db Mon Sep 17 00:00:00 2001 From: Stefano Cudini Date: Fri, 21 Nov 2014 19:58:31 +0100 Subject: [PATCH 1/3] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9e0479a4..a550355f 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "powertip", + "name": "jquery-powertip", "title": "PowerTip", "description": "A jQuery plugin that creates hover tooltips.", "version": "1.2.0", From a743aae38bccef49c4229066f24c924be6248727 Mon Sep 17 00:00:00 2001 From: stefanocudini Date: Fri, 21 Nov 2014 20:02:33 +0100 Subject: [PATCH 2/3] added dist version for NPM --- .gitignore | 1 - dist/jquery.powertip.js | 1325 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 1325 insertions(+), 1 deletion(-) create mode 100644 dist/jquery.powertip.js diff --git a/.gitignore b/.gitignore index 2f7b1b90..93f13619 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ -dist node_modules npm-debug.log diff --git a/dist/jquery.powertip.js b/dist/jquery.powertip.js new file mode 100644 index 00000000..d8cc05dd --- /dev/null +++ b/dist/jquery.powertip.js @@ -0,0 +1,1325 @@ +/*! + PowerTip v1.2.0 (2014-11-21) + http://stevenbenner.github.io/jquery-powertip/ + Copyright (c) 2014 Steven Benner (http://stevenbenner.com/). + Released under MIT license. + https://raw.github.com/stevenbenner/jquery-powertip/master/LICENSE.txt +*/ +(function(factory) { + // support loading the plugin as an amd module + if (typeof define === 'function' && define.amd) { + define([ 'jquery' ], factory); + } else { + factory(jQuery); + } +}(function($) { + + // useful private variables + var $document = $(document), + $window = $(window), + $body = $('body'); + + // constants + var DATA_DISPLAYCONTROLLER = 'displayController', + DATA_HASACTIVEHOVER = 'hasActiveHover', + DATA_FORCEDOPEN = 'forcedOpen', + DATA_HASMOUSEMOVE = 'hasMouseMove', + DATA_MOUSEONTOTIP = 'mouseOnToPopup', + DATA_ORIGINALTITLE = 'originalTitle', + DATA_POWERTIP = 'powertip', + DATA_POWERTIPJQ = 'powertipjq', + DATA_POWERTIPTARGET = 'powertiptarget', + EVENT_NAMESPACE = '.powertip', + RAD2DEG = 180 / Math.PI; + + /** + * Session data + * Private properties global to all powerTip instances + */ + var session = { + elements: null, + tooltips: null, + isTipOpen: false, + isFixedTipOpen: false, + isClosing: false, + tipOpenImminent: false, + activeHover: null, + currentX: 0, + currentY: 0, + previousX: 0, + previousY: 0, + desyncTimeout: null, + closeDelayTimeout: null, + mouseTrackingActive: false, + delayInProgress: false, + windowWidth: 0, + windowHeight: 0, + scrollTop: 0, + scrollLeft: 0 + }; + + /** + * Collision enumeration + * @enum {number} + */ + var Collision = { + none: 0, + top: 1, + bottom: 2, + left: 4, + right: 8 + }; + + /** + * Display hover tooltips on the matched elements. + * @param {(Object|string)=} opts The options object to use for the plugin, or + * the name of a method to invoke on the first matched element. + * @param {*=} [arg] Argument for an invoked method (optional). + * @return {jQuery} jQuery object for the matched selectors. + */ + $.fn.powerTip = function(opts, arg) { + var targetElements = this, + options, + tipController; + + // don't do any work if there were no matched elements + if (!targetElements.length) { + return targetElements; + } + + // handle api method calls on the plugin, e.g. powerTip('hide') + if ($.type(opts) === 'string' && $.powerTip[opts]) { + return $.powerTip[opts].call(targetElements, targetElements, arg); + } + + // extend options and instantiate TooltipController + options = $.extend({}, $.fn.powerTip.defaults, opts); + tipController = new TooltipController(options); + + // hook mouse and viewport dimension tracking + initTracking(); + + // setup the elements + targetElements.each(function elementSetup() { + var $this = $(this), + dataPowertip = $this.data(DATA_POWERTIP), + dataElem = $this.data(DATA_POWERTIPJQ), + dataTarget = $this.data(DATA_POWERTIPTARGET), + title; + + // handle repeated powerTip calls on the same element by destroying the + // original instance hooked to it and replacing it with this call + if ($this.data(DATA_DISPLAYCONTROLLER)) { + $.powerTip.destroy($this); + } + + // attempt to use title attribute text if there is no data-powertip, + // data-powertipjq or data-powertiptarget. If we do use the title + // attribute, delete the attribute so the browser will not show it + title = $this.attr('title'); + if (!dataPowertip && !dataTarget && !dataElem && title) { + $this.data(DATA_POWERTIP, title); + $this.data(DATA_ORIGINALTITLE, title); + $this.removeAttr('title'); + } + + // create hover controllers for each element + $this.data( + DATA_DISPLAYCONTROLLER, + new DisplayController($this, options, tipController) + ); + }); + + // attach events to matched elements if the manual option is not enabled + if (!options.manual) { + // attach open events + $.each(options.openEvents, function(idx, evt) { + if ($.inArray(evt, options.closeEvents) > -1) { + // event is in both openEvents and closeEvents, so toggle it + targetElements.on(evt + EVENT_NAMESPACE, function elementToggle(event) { + $.powerTip.toggle(this, event); + }); + } else { + targetElements.on(evt + EVENT_NAMESPACE, function elementOpen(event) { + $.powerTip.show(this, event); + }); + } + }); + + // attach close events + $.each(options.closeEvents, function(idx, evt) { + if ($.inArray(evt, options.openEvents) < 0) { + targetElements.on(evt + EVENT_NAMESPACE, function elementClose(event) { + // set immediate to true for any event without mouse info + $.powerTip.hide(this, !isMouseEvent(event)); + }); + } + }); + + // attach escape key close event + targetElements.on('keydown' + EVENT_NAMESPACE, function elementKeyDown(event) { + // always close tooltip when the escape key is pressed + if (event.keyCode === 27) { + $.powerTip.hide(this, true); + } + }); + } + + // remember elements that the plugin is attached to + session.elements = session.elements ? session.elements.add(targetElements) : targetElements; + + return targetElements; + }; + + /** + * Default options for the powerTip plugin. + */ + $.fn.powerTip.defaults = { + fadeInTime: 200, + fadeOutTime: 100, + followMouse: false, + popupId: 'powerTip', + popupClass: null, + intentSensitivity: 7, + intentPollInterval: 100, + closeDelay: 100, + placement: 'n', + smartPlacement: false, + offset: 10, + mouseOnToPopup: false, + manual: false, + openEvents: [ 'mouseenter', 'focus' ], + closeEvents: [ 'mouseleave', 'blur' ] + }; + + /** + * Default smart placement priority lists. + * The first item in the array is the highest priority, the last is the lowest. + * The last item is also the default, which will be used if all previous options + * do not fit. + */ + $.fn.powerTip.smartPlacementLists = { + n: [ 'n', 'ne', 'nw', 's' ], + e: [ 'e', 'ne', 'se', 'w', 'nw', 'sw', 'n', 's', 'e' ], + s: [ 's', 'se', 'sw', 'n' ], + w: [ 'w', 'nw', 'sw', 'e', 'ne', 'se', 'n', 's', 'w' ], + nw: [ 'nw', 'w', 'sw', 'n', 's', 'se', 'nw' ], + ne: [ 'ne', 'e', 'se', 'n', 's', 'sw', 'ne' ], + sw: [ 'sw', 'w', 'nw', 's', 'n', 'ne', 'sw' ], + se: [ 'se', 'e', 'ne', 's', 'n', 'nw', 'se' ], + 'nw-alt': [ 'nw-alt', 'n', 'ne-alt', 'sw-alt', 's', 'se-alt', 'w', 'e' ], + 'ne-alt': [ 'ne-alt', 'n', 'nw-alt', 'se-alt', 's', 'sw-alt', 'e', 'w' ], + 'sw-alt': [ 'sw-alt', 's', 'se-alt', 'nw-alt', 'n', 'ne-alt', 'w', 'e' ], + 'se-alt': [ 'se-alt', 's', 'sw-alt', 'ne-alt', 'n', 'nw-alt', 'e', 'w' ] + }; + + /** + * Public API + */ + $.powerTip = { + /** + * Attempts to show the tooltip for the specified element. + * @param {jQuery|Element} element The element to open the tooltip for. + * @param {jQuery.Event=} event jQuery event for hover intent and mouse + * tracking (optional). + * @return {jQuery|Element} The original jQuery object or DOM Element. + */ + show: function apiShowTip(element, event) { + // if we were given a mouse event then run the hover intent testing, + // otherwise, simply show the tooltip asap + if (isMouseEvent(event)) { + trackMouse(event); + session.previousX = event.pageX; + session.previousY = event.pageY; + $(element).data(DATA_DISPLAYCONTROLLER).show(); + } else { + $(element).first().data(DATA_DISPLAYCONTROLLER).show(true, true); + } + return element; + }, + + /** + * Repositions the tooltip on the element. + * @param {jQuery|Element} element The element the tooltip is shown for. + * @return {jQuery|Element} The original jQuery object or DOM Element. + */ + reposition: function apiResetPosition(element) { + $(element).first().data(DATA_DISPLAYCONTROLLER).resetPosition(); + return element; + }, + + /** + * Attempts to close any open tooltips. + * @param {(jQuery|Element)=} element The element with the tooltip that + * should be closed (optional). + * @param {boolean=} immediate Disable close delay (optional). + * @return {jQuery|Element|undefined} The original jQuery object or DOM + * Element, if one was specified. + */ + hide: function apiCloseTip(element, immediate) { + var displayController; + + // set immediate to true when no element is specified + immediate = element ? immediate : true; + + // find the relevant display controller + if (element) { + displayController = $(element).first().data(DATA_DISPLAYCONTROLLER); + } else if (session.activeHover) { + displayController = session.activeHover.data(DATA_DISPLAYCONTROLLER); + } + + // if found, hide the tip + if (displayController) { + displayController.hide(immediate); + } + + return element; + }, + + /** + * Toggles the tooltip for the specified element. This will open a closed + * tooltip, or close an open tooltip. + * @param {jQuery|Element} element The element with the tooltip that + * should be toggled. + * @param {jQuery.Event=} event jQuery event for hover intent and mouse + * tracking (optional). + * @return {jQuery|Element} The original jQuery object or DOM Element. + */ + toggle: function apiToggle(element, event) { + if (session.activeHover && session.activeHover.is(element)) { + // tooltip for element is active, so close it + $.powerTip.hide(element, !isMouseEvent(event)); + } else { + // tooltip for element is not active, so open it + $.powerTip.show(element, event); + } + return element; + }, + + /** + * Destroy and roll back any powerTip() instance on the specified elements. + * If no elements are specified then all elements that the plugin is + * currently attached to will be rolled back. + * @param {(jQuery|Element)=} element The element with the powerTip instance. + * @return {jQuery|Element|undefined} The original jQuery object or DOM + * Element, if one was specified. + */ + destroy: function apiDestroy(element) { + var $element = element ? $(element) : session.elements; + + // if the plugin is not hooked to any elements then there is no point + // trying to destroy anything, or dealing with the possible errors + if (!session.elements || session.elements.length === 0) { + return element; + } + + // unhook events and destroy plugin changes to each element + $element.off(EVENT_NAMESPACE).each(function destroy() { + var $this = $(this), + dataAttributes = [ + DATA_ORIGINALTITLE, + DATA_DISPLAYCONTROLLER, + DATA_HASACTIVEHOVER, + DATA_FORCEDOPEN + ]; + + // revert title attribute + if ($this.data(DATA_ORIGINALTITLE)) { + $this.attr('title', $this.data(DATA_ORIGINALTITLE)); + dataAttributes.push(DATA_POWERTIP); + } + + // remove data attributes + $this.removeData(dataAttributes); + }); + + // remove destroyed element from active elements collection + session.elements = session.elements.not($element); + + // if there are no active elements left then we will unhook all of the + // events that we've bound code to and remove the tooltip elements + if (session.elements.length === 0) { + $window.off(EVENT_NAMESPACE); + $document.off(EVENT_NAMESPACE); + session.mouseTrackingActive = false; + session.tooltips.remove(); + session.tooltips = null; + } + + return element; + } + }; + + // API aliasing + $.powerTip.showTip = $.powerTip.show; + $.powerTip.closeTip = $.powerTip.hide; + + /** + * Creates a new CSSCoordinates object. + * @private + * @constructor + */ + function CSSCoordinates() { + var me = this; + + // initialize object properties + me.top = 'auto'; + me.left = 'auto'; + me.right = 'auto'; + me.bottom = 'auto'; + + /** + * Set a property to a value. + * @private + * @param {string} property The name of the property. + * @param {number} value The value of the property. + */ + me.set = function(property, value) { + if ($.isNumeric(value)) { + me[property] = Math.round(value); + } + }; + } + + /** + * Creates a new tooltip display controller. + * @private + * @constructor + * @param {jQuery} element The element that this controller will handle. + * @param {Object} options Options object containing settings. + * @param {TooltipController} tipController The TooltipController object for + * this instance. + */ + function DisplayController(element, options, tipController) { + var hoverTimer = null, + myCloseDelay = null; + + /** + * Begins the process of showing a tooltip. + * @private + * @param {boolean=} immediate Skip intent testing (optional). + * @param {boolean=} forceOpen Ignore cursor position and force tooltip to + * open (optional). + */ + function openTooltip(immediate, forceOpen) { + cancelTimer(); + if (!element.data(DATA_HASACTIVEHOVER)) { + if (!immediate) { + session.tipOpenImminent = true; + hoverTimer = setTimeout( + function intentDelay() { + hoverTimer = null; + checkForIntent(); + }, + options.intentPollInterval + ); + } else { + if (forceOpen) { + element.data(DATA_FORCEDOPEN, true); + } + tipController.showTip(element); + } + } else { + // cursor left and returned to this element, cancel close + cancelClose(); + } + } + + /** + * Begins the process of closing a tooltip. + * @private + * @param {boolean=} disableDelay Disable close delay (optional). + */ + function closeTooltip(disableDelay) { + cancelTimer(); + session.tipOpenImminent = false; + if (element.data(DATA_HASACTIVEHOVER)) { + element.data(DATA_FORCEDOPEN, false); + if (!disableDelay) { + session.delayInProgress = true; + session.closeDelayTimeout = setTimeout( + function closeDelay() { + session.closeDelayTimeout = null; + tipController.hideTip(element); + session.delayInProgress = false; + myCloseDelay = null; + }, + options.closeDelay + ); + // save internal reference close delay id so we can check if the + // active close delay belongs to this instance + myCloseDelay = session.closeDelayTimeout; + } else { + tipController.hideTip(element); + } + } + } + + /** + * Checks mouse position to make sure that the user intended to hover on the + * specified element before showing the tooltip. + * @private + */ + function checkForIntent() { + // calculate mouse position difference + var xDifference = Math.abs(session.previousX - session.currentX), + yDifference = Math.abs(session.previousY - session.currentY), + totalDifference = xDifference + yDifference; + + // check if difference has passed the sensitivity threshold + if (totalDifference < options.intentSensitivity) { + cancelClose(); + tipController.showTip(element); + } else { + // try again + session.previousX = session.currentX; + session.previousY = session.currentY; + openTooltip(); + } + } + + /** + * Cancels active hover timer. + * @private + * @param {boolean=} stopClose Cancel any active close delay timer. + */ + function cancelTimer(stopClose) { + hoverTimer = clearTimeout(hoverTimer); + // cancel the current close delay if the active close delay is for this + // element or the stopClose argument is true + if (session.closeDelayTimeout && myCloseDelay === session.closeDelayTimeout || stopClose) { + cancelClose(); + } + } + + /** + * Cancels any active close delay timer. + * @private + */ + function cancelClose() { + session.closeDelayTimeout = clearTimeout(session.closeDelayTimeout); + session.delayInProgress = false; + } + + /** + * Repositions the tooltip on this element. + * @private + */ + function repositionTooltip() { + tipController.resetPosition(element); + } + + // expose the methods + this.show = openTooltip; + this.hide = closeTooltip; + this.cancel = cancelTimer; + this.resetPosition = repositionTooltip; + } + + /** + * Creates a new Placement Calculator. + * @private + * @constructor + */ + function PlacementCalculator() { + /** + * Compute the CSS position to display a tooltip at the specified placement + * relative to the specified element. + * @private + * @param {jQuery} element The element that the tooltip should target. + * @param {string} placement The placement for the tooltip. + * @param {number} tipWidth Width of the tooltip element in pixels. + * @param {number} tipHeight Height of the tooltip element in pixels. + * @param {number} offset Distance to offset tooltips in pixels. + * @return {CSSCoordinates} A CSSCoordinates object with the position. + */ + function computePlacementCoords(element, placement, tipWidth, tipHeight, offset) { + var placementBase = placement.split('-')[0], // ignore 'alt' for corners + coords = new CSSCoordinates(), + position; + + if (isSvgElement(element)) { + position = getSvgPlacement(element, placementBase); + } else { + position = getHtmlPlacement(element, placementBase); + } + + // calculate the appropriate x and y position in the document + switch (placement) { + case 'n': + coords.set('left', position.left - (tipWidth / 2)); + coords.set('bottom', session.windowHeight - position.top + offset); + break; + case 'e': + coords.set('left', position.left + offset); + coords.set('top', position.top - (tipHeight / 2)); + break; + case 's': + coords.set('left', position.left - (tipWidth / 2)); + coords.set('top', position.top + offset); + break; + case 'w': + coords.set('top', position.top - (tipHeight / 2)); + coords.set('right', session.windowWidth - position.left + offset); + break; + case 'nw': + coords.set('bottom', session.windowHeight - position.top + offset); + coords.set('right', session.windowWidth - position.left - 20); + break; + case 'nw-alt': + coords.set('left', position.left); + coords.set('bottom', session.windowHeight - position.top + offset); + break; + case 'ne': + coords.set('left', position.left - 20); + coords.set('bottom', session.windowHeight - position.top + offset); + break; + case 'ne-alt': + coords.set('bottom', session.windowHeight - position.top + offset); + coords.set('right', session.windowWidth - position.left); + break; + case 'sw': + coords.set('top', position.top + offset); + coords.set('right', session.windowWidth - position.left - 20); + break; + case 'sw-alt': + coords.set('left', position.left); + coords.set('top', position.top + offset); + break; + case 'se': + coords.set('left', position.left - 20); + coords.set('top', position.top + offset); + break; + case 'se-alt': + coords.set('top', position.top + offset); + coords.set('right', session.windowWidth - position.left); + break; + } + + return coords; + } + + /** + * Finds the tooltip attachment point in the document for a HTML DOM element + * for the specified placement. + * @private + * @param {jQuery} element The element that the tooltip should target. + * @param {string} placement The placement for the tooltip. + * @return {Object} An object with the top,left position values. + */ + function getHtmlPlacement(element, placement) { + var objectOffset = element.offset(), + objectWidth = element.outerWidth(), + objectHeight = element.outerHeight(), + left, + top; + + // calculate the appropriate x and y position in the document + switch (placement) { + case 'n': + left = objectOffset.left + objectWidth / 2; + top = objectOffset.top; + break; + case 'e': + left = objectOffset.left + objectWidth; + top = objectOffset.top + objectHeight / 2; + break; + case 's': + left = objectOffset.left + objectWidth / 2; + top = objectOffset.top + objectHeight; + break; + case 'w': + left = objectOffset.left; + top = objectOffset.top + objectHeight / 2; + break; + case 'nw': + left = objectOffset.left; + top = objectOffset.top; + break; + case 'ne': + left = objectOffset.left + objectWidth; + top = objectOffset.top; + break; + case 'sw': + left = objectOffset.left; + top = objectOffset.top + objectHeight; + break; + case 'se': + left = objectOffset.left + objectWidth; + top = objectOffset.top + objectHeight; + break; + } + + return { + top: top, + left: left + }; + } + + /** + * Finds the tooltip attachment point in the document for a SVG element for + * the specified placement. + * @private + * @param {jQuery} element The element that the tooltip should target. + * @param {string} placement The placement for the tooltip. + * @return {Object} An object with the top,left position values. + */ + function getSvgPlacement(element, placement) { + var svgElement = element.closest('svg')[0], + domElement = element[0], + point = svgElement.createSVGPoint(), + boundingBox = domElement.getBBox(), + matrix = domElement.getScreenCTM(), + halfWidth = boundingBox.width / 2, + halfHeight = boundingBox.height / 2, + placements = [], + placementKeys = [ 'nw', 'n', 'ne', 'e', 'se', 's', 'sw', 'w' ], + coords, + rotation, + steps, + x; + + function pushPlacement() { + placements.push(point.matrixTransform(matrix)); + } + + // get bounding box corners and midpoints + point.x = boundingBox.x; + point.y = boundingBox.y; + pushPlacement(); + point.x += halfWidth; + pushPlacement(); + point.x += halfWidth; + pushPlacement(); + point.y += halfHeight; + pushPlacement(); + point.y += halfHeight; + pushPlacement(); + point.x -= halfWidth; + pushPlacement(); + point.x -= halfWidth; + pushPlacement(); + point.y -= halfHeight; + pushPlacement(); + + // determine rotation + if (placements[0].y !== placements[1].y || placements[0].x !== placements[7].x) { + rotation = Math.atan2(matrix.b, matrix.a) * RAD2DEG; + steps = Math.ceil(((rotation % 360) - 22.5) / 45); + if (steps < 1) { + steps += 8; + } + while (steps--) { + placementKeys.push(placementKeys.shift()); + } + } + + // find placement + for (x = 0; x < placements.length; x++) { + if (placementKeys[x] === placement) { + coords = placements[x]; + break; + } + } + + return { + top: coords.y + session.scrollTop, + left: coords.x + session.scrollLeft + }; + } + + // expose methods + this.compute = computePlacementCoords; + } + + /** + * Creates a new tooltip controller. + * @private + * @constructor + * @param {Object} options Options object containing settings. + */ + function TooltipController(options) { + var placementCalculator = new PlacementCalculator(), + tipElement = $('#' + options.popupId); + + // build and append tooltip div if it does not already exist + if (tipElement.length === 0) { + tipElement = $('
', { id: options.popupId }); + // grab body element if it was not populated when the script loaded + // note: this hack exists solely for jsfiddle support + if ($body.length === 0) { + $body = $('body'); + } + $body.append(tipElement); + // remember the tooltip elements that the plugin has created + session.tooltips = session.tooltips ? session.tooltips.add(tipElement) : tipElement; + } + + // hook mousemove for cursor follow tooltips + if (options.followMouse) { + // only one positionTipOnCursor hook per tooltip element, please + if (!tipElement.data(DATA_HASMOUSEMOVE)) { + $document.on('mousemove' + EVENT_NAMESPACE, positionTipOnCursor); + $window.on('scroll' + EVENT_NAMESPACE, positionTipOnCursor); + tipElement.data(DATA_HASMOUSEMOVE, true); + } + } + + /** + * Gives the specified element the active-hover state and queues up the + * showTip function. + * @private + * @param {jQuery} element The element that the tooltip should target. + */ + function beginShowTip(element) { + element.data(DATA_HASACTIVEHOVER, true); + // show tooltip, asap + tipElement.queue(function queueTipInit(next) { + showTip(element); + next(); + }); + } + + /** + * Shows the tooltip, as soon as possible. + * @private + * @param {jQuery} element The element that the tooltip should target. + */ + function showTip(element) { + var tipContent; + + // it is possible, especially with keyboard navigation, to move on to + // another element with a tooltip during the queue to get to this point + // in the code. if that happens then we need to not proceed or we may + // have the fadeout callback for the last tooltip execute immediately + // after this code runs, causing bugs. + if (!element.data(DATA_HASACTIVEHOVER)) { + return; + } + + // if the tooltip is open and we got asked to open another one then the + // old one is still in its fadeOut cycle, so wait and try again + if (session.isTipOpen) { + if (!session.isClosing) { + hideTip(session.activeHover); + } + tipElement.delay(100).queue(function queueTipAgain(next) { + showTip(element); + next(); + }); + return; + } + + // trigger powerTipPreRender event + element.trigger('powerTipPreRender'); + + // set tooltip content + tipContent = getTooltipContent(element); + if (tipContent) { + tipElement.empty().append(tipContent); + } else { + // we have no content to display, give up + return; + } + + // trigger powerTipRender event + element.trigger('powerTipRender'); + + session.activeHover = element; + session.isTipOpen = true; + + tipElement.data(DATA_MOUSEONTOTIP, options.mouseOnToPopup); + + // set tooltip position + if (!options.followMouse) { + positionTipOnElement(element); + session.isFixedTipOpen = true; + } else { + positionTipOnCursor(); + } + + // add custom class to tooltip element + tipElement.addClass(options.popupClass); + + // close tooltip when clicking anywhere on the page, with the exception + // of the tooltip's trigger element and any elements that are within a + // tooltip that has 'mouseOnToPopup' option enabled + $document.on('click' + EVENT_NAMESPACE, function documentClick(event) { + var target = event.target; + if (target !== element[0]) { + if (options.mouseOnToPopup) { + if (target !== tipElement[0] && !$.contains(tipElement[0], target)) { + $.powerTip.hide(); + } + } else { + $.powerTip.hide(); + } + } + }); + + // if we want to be able to mouse on to the tooltip then we need to + // attach hover events to the tooltip that will cancel a close request + // on mouseenter and start a new close request on mouseleave + // only hook these listeners if we're not in manual mode + if (options.mouseOnToPopup && !options.manual) { + tipElement.on('mouseenter' + EVENT_NAMESPACE, function tipMouseEnter() { + // check activeHover in case the mouse cursor entered the + // tooltip during the fadeOut and close cycle + if (session.activeHover) { + session.activeHover.data(DATA_DISPLAYCONTROLLER).cancel(); + } + }); + tipElement.on('mouseleave' + EVENT_NAMESPACE, function tipMouseLeave() { + // check activeHover in case the mouse cursor left the tooltip + // during the fadeOut and close cycle + if (session.activeHover) { + session.activeHover.data(DATA_DISPLAYCONTROLLER).hide(); + } + }); + } + + // fadein + tipElement.fadeIn(options.fadeInTime, function fadeInCallback() { + // start desync polling + if (!session.desyncTimeout) { + session.desyncTimeout = setInterval(closeDesyncedTip, 500); + } + + // trigger powerTipOpen event + element.trigger('powerTipOpen'); + }); + } + + /** + * Hides the tooltip. + * @private + * @param {jQuery} element The element that the tooltip should target. + */ + function hideTip(element) { + // reset session + session.isClosing = true; + session.isTipOpen = false; + + // stop desync polling + session.desyncTimeout = clearInterval(session.desyncTimeout); + + // reset element state + element.data(DATA_HASACTIVEHOVER, false); + element.data(DATA_FORCEDOPEN, false); + + // remove document click handler + $document.off('click' + EVENT_NAMESPACE); + + // unbind the mouseOnToPopup events if they were set + tipElement.off(EVENT_NAMESPACE); + + // fade out + tipElement.fadeOut(options.fadeOutTime, function fadeOutCallback() { + var coords = new CSSCoordinates(); + + // reset session and tooltip element + session.activeHover = null; + session.isClosing = false; + session.isFixedTipOpen = false; + tipElement.removeClass(); + + // support mouse-follow and fixed position tips at the same time by + // moving the tooltip to the last cursor location after it is hidden + coords.set('top', session.currentY + options.offset); + coords.set('left', session.currentX + options.offset); + tipElement.css(coords); + + // trigger powerTipClose event + element.trigger('powerTipClose'); + }); + } + + /** + * Moves the tooltip to the users mouse cursor. + * @private + */ + function positionTipOnCursor() { + // to support having fixed tooltips on the same page as cursor tooltips, + // where both instances are referencing the same tooltip element, we + // need to keep track of the mouse position constantly, but we should + // only set the tip location if a fixed tip is not currently open, a tip + // open is imminent or active, and the tooltip element in question does + // have a mouse-follow using it. + if (!session.isFixedTipOpen && (session.isTipOpen || (session.tipOpenImminent && tipElement.data(DATA_HASMOUSEMOVE)))) { + // grab measurements + var tipWidth = tipElement.outerWidth(), + tipHeight = tipElement.outerHeight(), + coords = new CSSCoordinates(), + collisions, + collisionCount; + + // grab collisions + coords.set('top', session.currentY + options.offset); + coords.set('left', session.currentX + options.offset); + collisions = getViewportCollisions( + coords, + tipWidth, + tipHeight + ); + + // handle tooltip view port collisions + if (collisions !== Collision.none) { + collisionCount = countFlags(collisions); + if (collisionCount === 1) { + // if there is only one collision (bottom or right) then + // simply constrain the tooltip to the view port + if (collisions === Collision.right) { + coords.set('left', session.windowWidth - tipWidth); + } else if (collisions === Collision.bottom) { + coords.set('top', session.scrollTop + session.windowHeight - tipHeight); + } + } else { + // if the tooltip has more than one collision then it is + // trapped in the corner and should be flipped to get it out + // of the users way + coords.set('left', session.currentX - tipWidth - options.offset); + coords.set('top', session.currentY - tipHeight - options.offset); + } + } + + // position the tooltip + tipElement.css(coords); + } + } + + /** + * Sets the tooltip to the correct position relative to the specified target + * element. Based on options settings. + * @private + * @param {jQuery} element The element that the tooltip should target. + */ + function positionTipOnElement(element) { + var priorityList, + finalPlacement; + + if (options.smartPlacement) { + priorityList = $.fn.powerTip.smartPlacementLists[options.placement]; + + // iterate over the priority list and use the first placement option + // that does not collide with the view port. if they all collide + // then the last placement in the list will be used. + $.each(priorityList, function(idx, pos) { + // place tooltip and find collisions + var collisions = getViewportCollisions( + placeTooltip(element, pos), + tipElement.outerWidth(), + tipElement.outerHeight() + ); + + // update the final placement variable + finalPlacement = pos; + + // break if there were no collisions + if (collisions === Collision.none) { + return false; + } + }); + } else { + // if we're not going to use the smart placement feature then just + // compute the coordinates and do it + placeTooltip(element, options.placement); + finalPlacement = options.placement; + } + + // add placement as class for CSS arrows + tipElement.addClass(finalPlacement); + } + + /** + * Sets the tooltip position to the appropriate values to show the tip at + * the specified placement. This function will iterate and test the tooltip + * to support elastic tooltips. + * @private + * @param {jQuery} element The element that the tooltip should target. + * @param {string} placement The placement for the tooltip. + * @return {CSSCoordinates} A CSSCoordinates object with the top, left, and + * right position values. + */ + function placeTooltip(element, placement) { + var iterationCount = 0, + tipWidth, + tipHeight, + coords = new CSSCoordinates(); + + // set the tip to 0,0 to get the full expanded width + coords.set('top', 0); + coords.set('left', 0); + tipElement.css(coords); + + // to support elastic tooltips we need to check for a change in the + // rendered dimensions after the tooltip has been positioned + do { + // grab the current tip dimensions + tipWidth = tipElement.outerWidth(); + tipHeight = tipElement.outerHeight(); + + // get placement coordinates + coords = placementCalculator.compute( + element, + placement, + tipWidth, + tipHeight, + options.offset + ); + + // place the tooltip + tipElement.css(coords); + } while ( + // sanity check: limit to 5 iterations, and... + ++iterationCount <= 5 && + // try again if the dimensions changed after placement + (tipWidth !== tipElement.outerWidth() || tipHeight !== tipElement.outerHeight()) + ); + + return coords; + } + + /** + * Checks for a tooltip desync and closes the tooltip if one occurs. + * @private + */ + function closeDesyncedTip() { + var isDesynced = false; + // It is possible for the mouse cursor to leave an element without + // firing the mouseleave or blur event. This most commonly happens when + // the element is disabled under mouse cursor. If this happens it will + // result in a desynced tooltip because the tooltip was never asked to + // close. So we should periodically check for a desync situation and + // close the tip if such a situation arises. + if (session.isTipOpen && !session.isClosing && !session.delayInProgress && ($.inArray('mouseleave', options.closeEvents) > -1 || $.inArray('mouseout', options.closeEvents) > -1 || $.inArray('blur', options.closeEvents) > -1 || $.inArray('focusout', options.closeEvents) > -1)) { + // user moused onto another tip or active hover is disabled + if (session.activeHover.data(DATA_HASACTIVEHOVER) === false || session.activeHover.is(':disabled')) { + isDesynced = true; + } else { + // hanging tip - have to test if mouse position is not over the + // active hover and not over a tooltip set to let the user + // interact with it. + // for keyboard navigation: this only counts if the element does + // not have focus. + // for tooltips opened via the api: we need to check if it has + // the forcedOpen flag. + if (!isMouseOver(session.activeHover) && !session.activeHover.is(':focus') && !session.activeHover.data(DATA_FORCEDOPEN)) { + if (tipElement.data(DATA_MOUSEONTOTIP)) { + if (!isMouseOver(tipElement)) { + isDesynced = true; + } + } else { + isDesynced = true; + } + } + } + + if (isDesynced) { + // close the desynced tip + hideTip(session.activeHover); + } + } + } + + // expose methods + this.showTip = beginShowTip; + this.hideTip = hideTip; + this.resetPosition = positionTipOnElement; + } + + /** + * Determine whether a jQuery object is an SVG element + * @private + * @param {jQuery} element The element to check + * @return {boolean} Whether this is an SVG element + */ + function isSvgElement(element) { + return Boolean(window.SVGElement && element[0] instanceof SVGElement); + } + + /** + * Determines if the specified jQuery.Event object has mouse data. + * @private + * @param {jQuery.Event=} event The jQuery.Event object to test. + * @return {boolean} True if there is mouse data, otherwise false. + */ + function isMouseEvent(event) { + return Boolean(event && typeof event.pageX === 'number'); + } + + /** + * Initializes the viewport dimension cache and hooks up the mouse position + * tracking and viewport dimension tracking events. + * Prevents attaching the events more than once. + * @private + */ + function initTracking() { + if (!session.mouseTrackingActive) { + session.mouseTrackingActive = true; + + // grab the current viewport dimensions on load + getViewportDimensions(); + $(getViewportDimensions); + + // hook mouse move tracking + $document.on('mousemove' + EVENT_NAMESPACE, trackMouse); + + // hook viewport dimensions tracking + $window.on('resize' + EVENT_NAMESPACE, trackResize); + $window.on('scroll' + EVENT_NAMESPACE, trackScroll); + } + } + + /** + * Updates the viewport dimensions cache. + * @private + */ + function getViewportDimensions() { + session.scrollLeft = $window.scrollLeft(); + session.scrollTop = $window.scrollTop(); + session.windowWidth = $window.width(); + session.windowHeight = $window.height(); + } + + /** + * Updates the window size info in the viewport dimensions cache. + * @private + */ + function trackResize() { + session.windowWidth = $window.width(); + session.windowHeight = $window.height(); + } + + /** + * Updates the scroll offset info in the viewport dimensions cache. + * @private + */ + function trackScroll() { + var x = $window.scrollLeft(), + y = $window.scrollTop(); + if (x !== session.scrollLeft) { + session.currentX += x - session.scrollLeft; + session.scrollLeft = x; + } + if (y !== session.scrollTop) { + session.currentY += y - session.scrollTop; + session.scrollTop = y; + } + } + + /** + * Saves the current mouse coordinates to the session object. + * @private + * @param {jQuery.Event} event The mousemove event for the document. + */ + function trackMouse(event) { + session.currentX = event.pageX; + session.currentY = event.pageY; + } + + /** + * Tests if the mouse is currently over the specified element. + * @private + * @param {jQuery} element The element to check for hover. + * @return {boolean} + */ + function isMouseOver(element) { + // use getBoundingClientRect() because jQuery's width() and height() + // methods do not work with SVG elements + // compute width/height because those properties do not exist on the object + // returned by getBoundingClientRect() in older versions of IE + var elementPosition = element.offset(), + elementBox = element[0].getBoundingClientRect(), + elementWidth = elementBox.right - elementBox.left, + elementHeight = elementBox.bottom - elementBox.top; + + return session.currentX >= elementPosition.left && + session.currentX <= elementPosition.left + elementWidth && + session.currentY >= elementPosition.top && + session.currentY <= elementPosition.top + elementHeight; + } + + /** + * Fetches the tooltip content from the specified element's data attributes. + * @private + * @param {jQuery} element The element to get the tooltip content for. + * @return {(string|jQuery|undefined)} The text/HTML string, jQuery object, or + * undefined if there was no tooltip content for the element. + */ + function getTooltipContent(element) { + var tipText = element.data(DATA_POWERTIP), + tipObject = element.data(DATA_POWERTIPJQ), + tipTarget = element.data(DATA_POWERTIPTARGET), + targetElement, + content; + + if (tipText) { + if ($.isFunction(tipText)) { + tipText = tipText.call(element[0]); + } + content = tipText; + } else if (tipObject) { + if ($.isFunction(tipObject)) { + tipObject = tipObject.call(element[0]); + } + if (tipObject.length > 0) { + content = tipObject.clone(true, true); + } + } else if (tipTarget) { + targetElement = $('#' + tipTarget); + if (targetElement.length > 0) { + content = targetElement.html(); + } + } + + return content; + } + + /** + * Finds any viewport collisions that an element (the tooltip) would have if it + * were absolutely positioned at the specified coordinates. + * @private + * @param {CSSCoordinates} coords Coordinates for the element. + * @param {number} elementWidth Width of the element in pixels. + * @param {number} elementHeight Height of the element in pixels. + * @return {number} Value with the collision flags. + */ + function getViewportCollisions(coords, elementWidth, elementHeight) { + var viewportTop = session.scrollTop, + viewportLeft = session.scrollLeft, + viewportBottom = viewportTop + session.windowHeight, + viewportRight = viewportLeft + session.windowWidth, + collisions = Collision.none; + + if (coords.top < viewportTop || Math.abs(coords.bottom - session.windowHeight) - elementHeight < viewportTop) { + collisions |= Collision.top; + } + if (coords.top + elementHeight > viewportBottom || Math.abs(coords.bottom - session.windowHeight) > viewportBottom) { + collisions |= Collision.bottom; + } + if (coords.left < viewportLeft || coords.right + elementWidth > viewportRight) { + collisions |= Collision.left; + } + if (coords.left + elementWidth > viewportRight || coords.right < viewportLeft) { + collisions |= Collision.right; + } + + return collisions; + } + + /** + * Counts the number of bits set on a flags value. + * @param {number} value The flags value. + * @return {number} The number of bits that have been set. + */ + function countFlags(value) { + var count = 0; + while (value) { + value &= value - 1; + count++; + } + return count; + } + +})); From 97d16306dfa89084444f496b240a6748ac46c1b5 Mon Sep 17 00:00:00 2001 From: stefanocudini Date: Fri, 21 Nov 2014 20:06:07 +0100 Subject: [PATCH 3/3] added dist for NPM dependecies --- dist/CHANGELOG.yml | 133 ++++++++++++++++++ dist/LICENSE.txt | 20 +++ dist/css/jquery.powertip-blue.css | 102 ++++++++++++++ dist/css/jquery.powertip-blue.min.css | 9 ++ dist/css/jquery.powertip-dark.css | 102 ++++++++++++++ dist/css/jquery.powertip-dark.min.css | 9 ++ dist/css/jquery.powertip-green.css | 102 ++++++++++++++ dist/css/jquery.powertip-green.min.css | 9 ++ dist/css/jquery.powertip-light.css | 102 ++++++++++++++ dist/css/jquery.powertip-light.min.css | 9 ++ dist/css/jquery.powertip-orange.css | 102 ++++++++++++++ dist/css/jquery.powertip-orange.min.css | 9 ++ dist/css/jquery.powertip-purple.css | 102 ++++++++++++++ dist/css/jquery.powertip-purple.min.css | 9 ++ dist/css/jquery.powertip-red.css | 102 ++++++++++++++ dist/css/jquery.powertip-red.min.css | 9 ++ dist/css/jquery.powertip-yellow.css | 102 ++++++++++++++ dist/css/jquery.powertip-yellow.min.css | 9 ++ dist/css/jquery.powertip.css | 99 +++++++++++++ dist/css/jquery.powertip.min.css | 9 ++ dist/examples/examples.html | 178 ++++++++++++++++++++++++ dist/jquery.powertip.min.js | 8 ++ 22 files changed, 1335 insertions(+) create mode 100644 dist/CHANGELOG.yml create mode 100644 dist/LICENSE.txt create mode 100644 dist/css/jquery.powertip-blue.css create mode 100644 dist/css/jquery.powertip-blue.min.css create mode 100644 dist/css/jquery.powertip-dark.css create mode 100644 dist/css/jquery.powertip-dark.min.css create mode 100644 dist/css/jquery.powertip-green.css create mode 100644 dist/css/jquery.powertip-green.min.css create mode 100644 dist/css/jquery.powertip-light.css create mode 100644 dist/css/jquery.powertip-light.min.css create mode 100644 dist/css/jquery.powertip-orange.css create mode 100644 dist/css/jquery.powertip-orange.min.css create mode 100644 dist/css/jquery.powertip-purple.css create mode 100644 dist/css/jquery.powertip-purple.min.css create mode 100644 dist/css/jquery.powertip-red.css create mode 100644 dist/css/jquery.powertip-red.min.css create mode 100644 dist/css/jquery.powertip-yellow.css create mode 100644 dist/css/jquery.powertip-yellow.min.css create mode 100644 dist/css/jquery.powertip.css create mode 100644 dist/css/jquery.powertip.min.css create mode 100644 dist/examples/examples.html create mode 100644 dist/jquery.powertip.min.js diff --git a/dist/CHANGELOG.yml b/dist/CHANGELOG.yml new file mode 100644 index 00000000..b80d6bdb --- /dev/null +++ b/dist/CHANGELOG.yml @@ -0,0 +1,133 @@ +v1.3.0: + date: TBD + diff: https://github.com/stevenbenner/jquery-powertip/compare/v1.2.0...master + description: API enhancements, new options, and several bug fixes + changes: + - section: Features & Improvements + changes: + - Added openEvents and closeEvents options. + - Added popupClass option for custom tooltip classes. + - section: API + changes: + - The destroy() API method elements argument is now optional. When omitted all instances will be destroyed. + - Added toggle() method to the API. + - section: Bug Fixes + changes: + - The closeDelay timer is now correctly shared between all tooltips. + - Browser dimensions cache is now initialized as soon as PowerTip loads. + - Fixed queuing issue when the API hide() method is called immediately after show(). + - Fixed error when an element with an open tooltip is deleted. + - The mouseOnToPopup option will now be ignored (forced false) when the manual option is enabled. + - Fixed possible repeated event hooks when mouseOnToPopup is enabled. + - Fixed mouseOnToPopup events being applied to other instances where manual is enabled. + - section: Miscellaneous + changes: + - Fixed script url in the examples HTML file incuded in the release. + - Documented the caching quirks for changing tooltip content. +v1.2.0: + date: 2013-04-03 + diff: https://github.com/stevenbenner/jquery-powertip/compare/v1.1.0...v1.2.0 + description: Major release with lots of improvements and a significant code rewrite + changes: + - section: Features & Improvements + changes: + - Mouse-follow tooltips will now flip out of the way if they become trapped in the bottom-right corner. + - Escape key will now close tooltip for selected element. + - Added support for elastic tooltips. + - Added manual option to disable the built-in event listeners. + - Added nw-alt, ne-alt, sw-alt, and se-alt placement options. + - Added support for SVG elements. + - PowerTip will now use right position for right aligned tooltips, and bottom position for nothern tooltips. + - Data attributes powertip and powertipjq now accept a function. + - powerTip() will now overwrite any previous powerTip() calls on an element. + - Added support for AMD loading of PowerTip. + - section: API + changes: + - Added show() and hide() methods to the API. + - Added reposition() method to the API. + - Added destroy() method to the API. + - You can now pass API method names as strings to the powerTip() function. + - showTip and hideTip API methods are now deprecated in favor of the new show and hide API methods (but they will continue to work until 2.0). + - section: CSS + changes: + - Added 8 new tooltip CSS themes. + - Changed default z-index in CSS themes to int max. + - Added RGB color fallbacks for tooltip arrows (meaning arrows arrows now work in IE8). + - section: Bug Fixes + changes: + - Fixed bug that would cause the CSS position to be updated even when the tooltip is closed. + - Fixed issue that could cause tooltips to close prematurely during the closeDelay period. + - section: Miscellaneous + changes: + - Project now has a fully automated build process. + - Added a complete test suite and hooked up Travis CI. + - Significant rewrite of the code. +v1.1.0: + date: 2012-08-08 + diff: https://github.com/stevenbenner/jquery-powertip/compare/v1.0.4...v1.1.0 + description: Major release with several significant improvements + changes: + - section: Features & Improvements + changes: + - Added smart placement feature. + - Added custom events. + - Added support for keyboard navigation. + - Added support for jsFiddle. + - section: API + changes: + - Added API with showTip() and closeTip() methods. + - section: Bug Fixes + changes: + - Fixed mouse-follow constraint +v1.0.4: + date: 2012-07-31 + diff: https://github.com/stevenbenner/jquery-powertip/compare/v1.0.3...v1.0.4 + description: Minor release to address issues with IE8 + changes: + - section: CSS + changes: + - Added RBG background color fallback for browsers that do not support RGBA. + - section: Bug Fixes + changes: + - Fixed positioning problems with Internet Explorer 8. +v1.0.3: + date: 2012-07-31 + diff: https://github.com/stevenbenner/jquery-powertip/compare/v1.0.2...v1.0.3 + description: Minor release to address a couple issues + changes: + - section: Features & Improvements + changes: + - Added mouse position tracking to scroll events. + - section: Bug Fixes + changes: + - Fixed rare issue that would make fixed placement tooltips follow the mouse. +v1.0.2: + date: 2012-07-26 + diff: https://github.com/stevenbenner/jquery-powertip/compare/v1.0.1...v1.0.2 + description: Minor release to make a couple small improvements and bug fixes + changes: + - section: Features & Improvements + changes: + - Added placement class to tooltip element. + - Added CSS arrows to tooltips. + - Add nw, ne, sw, and sw placement options. + - Changed default closeDelay to 100ms. + - Changed default fadeOutTime to 100ms. + - Changed default placement to north. + - section: Bug Fixes + changes: + - Fixed error when there is no tooltip content. + - Fixed rare error when moused entered a tooltip during its fadeOut cycle. +v1.0.1: + date: 2012-07-11 + diff: https://github.com/stevenbenner/jquery-powertip/compare/v1.0.0...v1.0.1 + description: Minor release to fix a tip tracking issue + changes: + - section: Bug Fixes + changes: + - Fixed rare issue that caused tooltips to become desynced. +v1.0.0: + date: 2012-07-01 + description: Initial public release + changes: + - section: Initial public release diff --git a/dist/LICENSE.txt b/dist/LICENSE.txt new file mode 100644 index 00000000..ac3432b8 --- /dev/null +++ b/dist/LICENSE.txt @@ -0,0 +1,20 @@ +Copyright (c) 2014 Steven Benner (http://stevenbenner.com/) + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/dist/css/jquery.powertip-blue.css b/dist/css/jquery.powertip-blue.css new file mode 100644 index 00000000..4e15bb6b --- /dev/null +++ b/dist/css/jquery.powertip-blue.css @@ -0,0 +1,102 @@ +/** + * PowerTip + * http://stevenbenner.github.io/jquery-powertip/ + * + * Stylesheet for the blue theme. + */ + +#powerTip { + cursor: default; + background-color: #d2e6fa; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 2px 1px rgba(255, 255, 255, 0.5) inset, 0 -2px 2px #a5d2fa inset; + -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 2px 1px rgba(255, 255, 255, 0.5) inset, 0 -2px 2px #a5d2fa inset; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 2px 1px rgba(255, 255, 255, 0.5) inset, 0 -2px 2px #a5d2fa inset; + border: 1px solid #4b91d2; + border-radius: 6px; + color: #000000; + display: none; + padding: 10px; + position: absolute; + white-space: nowrap; + z-index: 2147483647; +} +#powerTip:before { + content: ""; + position: absolute; +} +#powerTip.n:before, #powerTip.s:before { + border-right: 5px solid transparent; + border-left: 5px solid transparent; + left: 50%; + margin-left: -5px; +} +#powerTip.e:before, #powerTip.w:before { + border-bottom: 5px solid transparent; + border-top: 5px solid transparent; + margin-top: -5px; + top: 50%; +} +#powerTip.n:before { + border-top: 10px solid #4b91d2; + border-top: 10px solid rgba(75, 145, 210, 0.8); + bottom: -10px; +} +#powerTip.e:before { + border-right: 10px solid #4b91d2; + border-right: 10px solid rgba(75, 145, 210, 0.8); + left: -10px; +} +#powerTip.s:before { + border-bottom: 10px solid #4b91d2; + border-bottom: 10px solid rgba(75, 145, 210, 0.8); + top: -10px; +} +#powerTip.w:before { + border-left: 10px solid #4b91d2; + border-left: 10px solid rgba(75, 145, 210, 0.8); + right: -10px; +} +#powerTip.ne:before, #powerTip.se:before { + border-right: 10px solid transparent; + border-left: 0; + left: 10px; +} +#powerTip.nw:before, #powerTip.sw:before { + border-left: 10px solid transparent; + border-right: 0; + right: 10px; +} +#powerTip.ne:before, #powerTip.nw:before { + border-top: 10px solid #4b91d2; + border-top: 10px solid rgba(75, 145, 210, 0.8); + bottom: -10px; +} +#powerTip.se:before, #powerTip.sw:before { + border-bottom: 10px solid #4b91d2; + border-bottom: 10px solid rgba(75, 145, 210, 0.8); + top: -10px; +} +#powerTip.nw-alt:before, #powerTip.ne-alt:before, +#powerTip.sw-alt:before, #powerTip.se-alt:before { + border-top: 10px solid #4b91d2; + border-top: 10px solid rgba(75, 145, 210, 0.8); + bottom: -10px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + left: 10px; +} +#powerTip.ne-alt:before { + left: auto; + right: 10px; +} +#powerTip.sw-alt:before, #powerTip.se-alt:before { + border-top: none; + border-bottom: 10px solid #4b91d2; + border-bottom: 10px solid rgba(75, 145, 210, 0.8); + bottom: auto; + top: -10px; +} +#powerTip.se-alt:before { + left: auto; + right: 10px; +} diff --git a/dist/css/jquery.powertip-blue.min.css b/dist/css/jquery.powertip-blue.min.css new file mode 100644 index 00000000..408c1f0e --- /dev/null +++ b/dist/css/jquery.powertip-blue.min.css @@ -0,0 +1,9 @@ +/*! + PowerTip v1.2.0 (2014-11-21) + http://stevenbenner.github.io/jquery-powertip/ + Copyright (c) 2014 Steven Benner (http://stevenbenner.com/). + Released under MIT license. + https://raw.github.com/stevenbenner/jquery-powertip/master/LICENSE.txt +*/ + +#powerTip{cursor:default;background-color:#d2e6fa;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.15),0 2px 1px rgba(255,255,255,.5) inset,0 -2px 2px #a5d2fa inset;-moz-box-shadow:0 1px 1px rgba(0,0,0,.15),0 2px 1px rgba(255,255,255,.5) inset,0 -2px 2px #a5d2fa inset;box-shadow:0 1px 1px rgba(0,0,0,.15),0 2px 1px rgba(255,255,255,.5) inset,0 -2px 2px #a5d2fa inset;border:1px solid #4b91d2;border-radius:6px;color:#000;display:none;padding:10px;position:absolute;white-space:nowrap;z-index:2147483647}#powerTip:before{content:"";position:absolute}#powerTip.n:before,#powerTip.s:before{border-right:5px solid transparent;border-left:5px solid transparent;left:50%;margin-left:-5px}#powerTip.e:before,#powerTip.w:before{border-bottom:5px solid transparent;border-top:5px solid transparent;margin-top:-5px;top:50%}#powerTip.n:before{border-top:10px solid #4b91d2;border-top:10px solid rgba(75,145,210,.8);bottom:-10px}#powerTip.e:before{border-right:10px solid #4b91d2;border-right:10px solid rgba(75,145,210,.8);left:-10px}#powerTip.s:before{border-bottom:10px solid #4b91d2;border-bottom:10px solid rgba(75,145,210,.8);top:-10px}#powerTip.w:before{border-left:10px solid #4b91d2;border-left:10px solid rgba(75,145,210,.8);right:-10px}#powerTip.ne:before,#powerTip.se:before{border-right:10px solid transparent;border-left:0;left:10px}#powerTip.nw:before,#powerTip.sw:before{border-left:10px solid transparent;border-right:0;right:10px}#powerTip.ne:before,#powerTip.nw:before{border-top:10px solid #4b91d2;border-top:10px solid rgba(75,145,210,.8);bottom:-10px}#powerTip.se:before,#powerTip.sw:before{border-bottom:10px solid #4b91d2;border-bottom:10px solid rgba(75,145,210,.8);top:-10px}#powerTip.ne-alt:before,#powerTip.nw-alt:before,#powerTip.se-alt:before,#powerTip.sw-alt:before{border-top:10px solid #4b91d2;border-top:10px solid rgba(75,145,210,.8);bottom:-10px;border-left:5px solid transparent;border-right:5px solid transparent;left:10px}#powerTip.ne-alt:before{left:auto;right:10px}#powerTip.se-alt:before,#powerTip.sw-alt:before{border-top:none;border-bottom:10px solid #4b91d2;border-bottom:10px solid rgba(75,145,210,.8);bottom:auto;top:-10px}#powerTip.se-alt:before{left:auto;right:10px} \ No newline at end of file diff --git a/dist/css/jquery.powertip-dark.css b/dist/css/jquery.powertip-dark.css new file mode 100644 index 00000000..9394b11b --- /dev/null +++ b/dist/css/jquery.powertip-dark.css @@ -0,0 +1,102 @@ +/** + * PowerTip + * http://stevenbenner.github.io/jquery-powertip/ + * + * Stylesheet for the dark monochrome theme. + */ + +#powerTip { + cursor: default; + background-color: #424242; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 2px 1px rgba(255, 255, 255, 0.2) inset, 0 -2px 2px #323232 inset; + -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 2px 1px rgba(255, 255, 255, 0.2) inset, 0 -2px 2px #323232 inset; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 2px 1px rgba(255, 255, 255, 0.2) inset, 0 -2px 2px #323232 inset; + border: 1px solid #000000; + border-radius: 6px; + color: #ffffff; + display: none; + padding: 10px; + position: absolute; + white-space: nowrap; + z-index: 2147483647; +} +#powerTip:before { + content: ""; + position: absolute; +} +#powerTip.n:before, #powerTip.s:before { + border-right: 5px solid transparent; + border-left: 5px solid transparent; + left: 50%; + margin-left: -5px; +} +#powerTip.e:before, #powerTip.w:before { + border-bottom: 5px solid transparent; + border-top: 5px solid transparent; + margin-top: -5px; + top: 50%; +} +#powerTip.n:before { + border-top: 10px solid #000000; + border-top: 10px solid rgba(0, 0, 0, 0.8); + bottom: -10px; +} +#powerTip.e:before { + border-right: 10px solid #000000; + border-right: 10px solid rgba(0, 0, 0, 0.8); + left: -10px; +} +#powerTip.s:before { + border-bottom: 10px solid #000000; + border-bottom: 10px solid rgba(0, 0, 0, 0.8); + top: -10px; +} +#powerTip.w:before { + border-left: 10px solid #000000; + border-left: 10px solid rgba(0, 0, 0, 0.8); + right: -10px; +} +#powerTip.ne:before, #powerTip.se:before { + border-right: 10px solid transparent; + border-left: 0; + left: 10px; +} +#powerTip.nw:before, #powerTip.sw:before { + border-left: 10px solid transparent; + border-right: 0; + right: 10px; +} +#powerTip.ne:before, #powerTip.nw:before { + border-top: 10px solid #000000; + border-top: 10px solid rgba(0, 0, 0, 0.8); + bottom: -10px; +} +#powerTip.se:before, #powerTip.sw:before { + border-bottom: 10px solid #000000; + border-bottom: 10px solid rgba(0, 0, 0, 0.8); + top: -10px; +} +#powerTip.nw-alt:before, #powerTip.ne-alt:before, +#powerTip.sw-alt:before, #powerTip.se-alt:before { + border-top: 10px solid #000000; + border-top: 10px solid rgba(0, 0, 0, 0.8); + bottom: -10px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + left: 10px; +} +#powerTip.ne-alt:before { + left: auto; + right: 10px; +} +#powerTip.sw-alt:before, #powerTip.se-alt:before { + border-top: none; + border-bottom: 10px solid #000000; + border-bottom: 10px solid rgba(0, 0, 0, 0.8); + bottom: auto; + top: -10px; +} +#powerTip.se-alt:before { + left: auto; + right: 10px; +} diff --git a/dist/css/jquery.powertip-dark.min.css b/dist/css/jquery.powertip-dark.min.css new file mode 100644 index 00000000..b8428b92 --- /dev/null +++ b/dist/css/jquery.powertip-dark.min.css @@ -0,0 +1,9 @@ +/*! + PowerTip v1.2.0 (2014-11-21) + http://stevenbenner.github.io/jquery-powertip/ + Copyright (c) 2014 Steven Benner (http://stevenbenner.com/). + Released under MIT license. + https://raw.github.com/stevenbenner/jquery-powertip/master/LICENSE.txt +*/ + +#powerTip{cursor:default;background-color:#424242;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.15),0 2px 1px rgba(255,255,255,.2) inset,0 -2px 2px #323232 inset;-moz-box-shadow:0 1px 1px rgba(0,0,0,.15),0 2px 1px rgba(255,255,255,.2) inset,0 -2px 2px #323232 inset;box-shadow:0 1px 1px rgba(0,0,0,.15),0 2px 1px rgba(255,255,255,.2) inset,0 -2px 2px #323232 inset;border:1px solid #000;border-radius:6px;color:#fff;display:none;padding:10px;position:absolute;white-space:nowrap;z-index:2147483647}#powerTip:before{content:"";position:absolute}#powerTip.n:before,#powerTip.s:before{border-right:5px solid transparent;border-left:5px solid transparent;left:50%;margin-left:-5px}#powerTip.e:before,#powerTip.w:before{border-bottom:5px solid transparent;border-top:5px solid transparent;margin-top:-5px;top:50%}#powerTip.n:before{border-top:10px solid #000;border-top:10px solid rgba(0,0,0,.8);bottom:-10px}#powerTip.e:before{border-right:10px solid #000;border-right:10px solid rgba(0,0,0,.8);left:-10px}#powerTip.s:before{border-bottom:10px solid #000;border-bottom:10px solid rgba(0,0,0,.8);top:-10px}#powerTip.w:before{border-left:10px solid #000;border-left:10px solid rgba(0,0,0,.8);right:-10px}#powerTip.ne:before,#powerTip.se:before{border-right:10px solid transparent;border-left:0;left:10px}#powerTip.nw:before,#powerTip.sw:before{border-left:10px solid transparent;border-right:0;right:10px}#powerTip.ne:before,#powerTip.nw:before{border-top:10px solid #000;border-top:10px solid rgba(0,0,0,.8);bottom:-10px}#powerTip.se:before,#powerTip.sw:before{border-bottom:10px solid #000;border-bottom:10px solid rgba(0,0,0,.8);top:-10px}#powerTip.ne-alt:before,#powerTip.nw-alt:before,#powerTip.se-alt:before,#powerTip.sw-alt:before{border-top:10px solid #000;border-top:10px solid rgba(0,0,0,.8);bottom:-10px;border-left:5px solid transparent;border-right:5px solid transparent;left:10px}#powerTip.ne-alt:before{left:auto;right:10px}#powerTip.se-alt:before,#powerTip.sw-alt:before{border-top:none;border-bottom:10px solid #000;border-bottom:10px solid rgba(0,0,0,.8);bottom:auto;top:-10px}#powerTip.se-alt:before{left:auto;right:10px} \ No newline at end of file diff --git a/dist/css/jquery.powertip-green.css b/dist/css/jquery.powertip-green.css new file mode 100644 index 00000000..da0cf8e9 --- /dev/null +++ b/dist/css/jquery.powertip-green.css @@ -0,0 +1,102 @@ +/** + * PowerTip + * http://stevenbenner.github.io/jquery-powertip/ + * + * Stylesheet for the green theme. + */ + +#powerTip { + cursor: default; + background-color: #f0ffb9; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 2px 1px rgba(255, 255, 255, 0.8) inset, 0 -2px 2px #dcf582 inset; + -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 2px 1px rgba(255, 255, 255, 0.8) inset, 0 -2px 2px #dcf582 inset; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 2px 1px rgba(255, 255, 255, 0.8) inset, 0 -2px 2px #dcf582 inset; + border: 1px solid #9bc800; + border-radius: 6px; + color: #000000; + display: none; + padding: 10px; + position: absolute; + white-space: nowrap; + z-index: 2147483647; +} +#powerTip:before { + content: ""; + position: absolute; +} +#powerTip.n:before, #powerTip.s:before { + border-right: 5px solid transparent; + border-left: 5px solid transparent; + left: 50%; + margin-left: -5px; +} +#powerTip.e:before, #powerTip.w:before { + border-bottom: 5px solid transparent; + border-top: 5px solid transparent; + margin-top: -5px; + top: 50%; +} +#powerTip.n:before { + border-top: 10px solid #9bc800; + border-top: 10px solid rgba(155, 200, 0, 0.8); + bottom: -10px; +} +#powerTip.e:before { + border-right: 10px solid #9bc800; + border-right: 10px solid rgba(155, 200, 0, 0.8); + left: -10px; +} +#powerTip.s:before { + border-bottom: 10px solid #9bc800; + border-bottom: 10px solid rgba(155, 200, 0, 0.8); + top: -10px; +} +#powerTip.w:before { + border-left: 10px solid #9bc800; + border-left: 10px solid rgba(155, 200, 0, 0.8); + right: -10px; +} +#powerTip.ne:before, #powerTip.se:before { + border-right: 10px solid transparent; + border-left: 0; + left: 10px; +} +#powerTip.nw:before, #powerTip.sw:before { + border-left: 10px solid transparent; + border-right: 0; + right: 10px; +} +#powerTip.ne:before, #powerTip.nw:before { + border-top: 10px solid #9bc800; + border-top: 10px solid rgba(155, 200, 0, 0.8); + bottom: -10px; +} +#powerTip.se:before, #powerTip.sw:before { + border-bottom: 10px solid #9bc800; + border-bottom: 10px solid rgba(155, 200, 0, 0.8); + top: -10px; +} +#powerTip.nw-alt:before, #powerTip.ne-alt:before, +#powerTip.sw-alt:before, #powerTip.se-alt:before { + border-top: 10px solid #9bc800; + border-top: 10px solid rgba(155, 200, 0, 0.8); + bottom: -10px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + left: 10px; +} +#powerTip.ne-alt:before { + left: auto; + right: 10px; +} +#powerTip.sw-alt:before, #powerTip.se-alt:before { + border-top: none; + border-bottom: 10px solid #9bc800; + border-bottom: 10px solid rgba(155, 200, 0, 0.8); + bottom: auto; + top: -10px; +} +#powerTip.se-alt:before { + left: auto; + right: 10px; +} diff --git a/dist/css/jquery.powertip-green.min.css b/dist/css/jquery.powertip-green.min.css new file mode 100644 index 00000000..fa61f9d8 --- /dev/null +++ b/dist/css/jquery.powertip-green.min.css @@ -0,0 +1,9 @@ +/*! + PowerTip v1.2.0 (2014-11-21) + http://stevenbenner.github.io/jquery-powertip/ + Copyright (c) 2014 Steven Benner (http://stevenbenner.com/). + Released under MIT license. + https://raw.github.com/stevenbenner/jquery-powertip/master/LICENSE.txt +*/ + +#powerTip{cursor:default;background-color:#f0ffb9;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.15),0 2px 1px rgba(255,255,255,.8) inset,0 -2px 2px #dcf582 inset;-moz-box-shadow:0 1px 1px rgba(0,0,0,.15),0 2px 1px rgba(255,255,255,.8) inset,0 -2px 2px #dcf582 inset;box-shadow:0 1px 1px rgba(0,0,0,.15),0 2px 1px rgba(255,255,255,.8) inset,0 -2px 2px #dcf582 inset;border:1px solid #9bc800;border-radius:6px;color:#000;display:none;padding:10px;position:absolute;white-space:nowrap;z-index:2147483647}#powerTip:before{content:"";position:absolute}#powerTip.n:before,#powerTip.s:before{border-right:5px solid transparent;border-left:5px solid transparent;left:50%;margin-left:-5px}#powerTip.e:before,#powerTip.w:before{border-bottom:5px solid transparent;border-top:5px solid transparent;margin-top:-5px;top:50%}#powerTip.n:before{border-top:10px solid #9bc800;border-top:10px solid rgba(155,200,0,.8);bottom:-10px}#powerTip.e:before{border-right:10px solid #9bc800;border-right:10px solid rgba(155,200,0,.8);left:-10px}#powerTip.s:before{border-bottom:10px solid #9bc800;border-bottom:10px solid rgba(155,200,0,.8);top:-10px}#powerTip.w:before{border-left:10px solid #9bc800;border-left:10px solid rgba(155,200,0,.8);right:-10px}#powerTip.ne:before,#powerTip.se:before{border-right:10px solid transparent;border-left:0;left:10px}#powerTip.nw:before,#powerTip.sw:before{border-left:10px solid transparent;border-right:0;right:10px}#powerTip.ne:before,#powerTip.nw:before{border-top:10px solid #9bc800;border-top:10px solid rgba(155,200,0,.8);bottom:-10px}#powerTip.se:before,#powerTip.sw:before{border-bottom:10px solid #9bc800;border-bottom:10px solid rgba(155,200,0,.8);top:-10px}#powerTip.ne-alt:before,#powerTip.nw-alt:before,#powerTip.se-alt:before,#powerTip.sw-alt:before{border-top:10px solid #9bc800;border-top:10px solid rgba(155,200,0,.8);bottom:-10px;border-left:5px solid transparent;border-right:5px solid transparent;left:10px}#powerTip.ne-alt:before{left:auto;right:10px}#powerTip.se-alt:before,#powerTip.sw-alt:before{border-top:none;border-bottom:10px solid #9bc800;border-bottom:10px solid rgba(155,200,0,.8);bottom:auto;top:-10px}#powerTip.se-alt:before{left:auto;right:10px} \ No newline at end of file diff --git a/dist/css/jquery.powertip-light.css b/dist/css/jquery.powertip-light.css new file mode 100644 index 00000000..03215956 --- /dev/null +++ b/dist/css/jquery.powertip-light.css @@ -0,0 +1,102 @@ +/** + * PowerTip + * http://stevenbenner.github.io/jquery-powertip/ + * + * Stylesheet for the light monochrome theme. + */ + +#powerTip { + cursor: default; + background-color: #f2f2f2; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 2px 1px rgba(255, 255, 255, 0.5) inset, 0 -2px 2px #dcdcdc inset; + -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 2px 1px rgba(255, 255, 255, 0.5) inset, 0 -2px 2px #dcdcdc inset; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 2px 1px rgba(255, 255, 255, 0.5) inset, 0 -2px 2px #dcdcdc inset; + border: 1px solid #acacac; + border-radius: 6px; + color: #000000; + display: none; + padding: 10px; + position: absolute; + white-space: nowrap; + z-index: 2147483647; +} +#powerTip:before { + content: ""; + position: absolute; +} +#powerTip.n:before, #powerTip.s:before { + border-right: 5px solid transparent; + border-left: 5px solid transparent; + left: 50%; + margin-left: -5px; +} +#powerTip.e:before, #powerTip.w:before { + border-bottom: 5px solid transparent; + border-top: 5px solid transparent; + margin-top: -5px; + top: 50%; +} +#powerTip.n:before { + border-top: 10px solid #acacac; + border-top: 10px solid rgba(172, 172, 172, 0.8); + bottom: -10px; +} +#powerTip.e:before { + border-right: 10px solid #acacac; + border-right: 10px solid rgba(172, 172, 172, 0.8); + left: -10px; +} +#powerTip.s:before { + border-bottom: 10px solid #acacac; + border-bottom: 10px solid rgba(172, 172, 172, 0.8); + top: -10px; +} +#powerTip.w:before { + border-left: 10px solid #acacac; + border-left: 10px solid rgba(172, 172, 172, 0.8); + right: -10px; +} +#powerTip.ne:before, #powerTip.se:before { + border-right: 10px solid transparent; + border-left: 0; + left: 10px; +} +#powerTip.nw:before, #powerTip.sw:before { + border-left: 10px solid transparent; + border-right: 0; + right: 10px; +} +#powerTip.ne:before, #powerTip.nw:before { + border-top: 10px solid #acacac; + border-top: 10px solid rgba(172, 172, 172, 0.8); + bottom: -10px; +} +#powerTip.se:before, #powerTip.sw:before { + border-bottom: 10px solid #acacac; + border-bottom: 10px solid rgba(172, 172, 172, 0.8); + top: -10px; +} +#powerTip.nw-alt:before, #powerTip.ne-alt:before, +#powerTip.sw-alt:before, #powerTip.se-alt:before { + border-top: 10px solid #acacac; + border-top: 10px solid rgba(172, 172, 172, 0.8); + bottom: -10px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + left: 10px; +} +#powerTip.ne-alt:before { + left: auto; + right: 10px; +} +#powerTip.sw-alt:before, #powerTip.se-alt:before { + border-top: none; + border-bottom: 10px solid #acacac; + border-bottom: 10px solid rgba(172, 172, 172, 0.8); + bottom: auto; + top: -10px; +} +#powerTip.se-alt:before { + left: auto; + right: 10px; +} diff --git a/dist/css/jquery.powertip-light.min.css b/dist/css/jquery.powertip-light.min.css new file mode 100644 index 00000000..7e00a8e9 --- /dev/null +++ b/dist/css/jquery.powertip-light.min.css @@ -0,0 +1,9 @@ +/*! + PowerTip v1.2.0 (2014-11-21) + http://stevenbenner.github.io/jquery-powertip/ + Copyright (c) 2014 Steven Benner (http://stevenbenner.com/). + Released under MIT license. + https://raw.github.com/stevenbenner/jquery-powertip/master/LICENSE.txt +*/ + +#powerTip{cursor:default;background-color:#f2f2f2;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.15),0 2px 1px rgba(255,255,255,.5) inset,0 -2px 2px #dcdcdc inset;-moz-box-shadow:0 1px 1px rgba(0,0,0,.15),0 2px 1px rgba(255,255,255,.5) inset,0 -2px 2px #dcdcdc inset;box-shadow:0 1px 1px rgba(0,0,0,.15),0 2px 1px rgba(255,255,255,.5) inset,0 -2px 2px #dcdcdc inset;border:1px solid #acacac;border-radius:6px;color:#000;display:none;padding:10px;position:absolute;white-space:nowrap;z-index:2147483647}#powerTip:before{content:"";position:absolute}#powerTip.n:before,#powerTip.s:before{border-right:5px solid transparent;border-left:5px solid transparent;left:50%;margin-left:-5px}#powerTip.e:before,#powerTip.w:before{border-bottom:5px solid transparent;border-top:5px solid transparent;margin-top:-5px;top:50%}#powerTip.n:before{border-top:10px solid #acacac;border-top:10px solid rgba(172,172,172,.8);bottom:-10px}#powerTip.e:before{border-right:10px solid #acacac;border-right:10px solid rgba(172,172,172,.8);left:-10px}#powerTip.s:before{border-bottom:10px solid #acacac;border-bottom:10px solid rgba(172,172,172,.8);top:-10px}#powerTip.w:before{border-left:10px solid #acacac;border-left:10px solid rgba(172,172,172,.8);right:-10px}#powerTip.ne:before,#powerTip.se:before{border-right:10px solid transparent;border-left:0;left:10px}#powerTip.nw:before,#powerTip.sw:before{border-left:10px solid transparent;border-right:0;right:10px}#powerTip.ne:before,#powerTip.nw:before{border-top:10px solid #acacac;border-top:10px solid rgba(172,172,172,.8);bottom:-10px}#powerTip.se:before,#powerTip.sw:before{border-bottom:10px solid #acacac;border-bottom:10px solid rgba(172,172,172,.8);top:-10px}#powerTip.ne-alt:before,#powerTip.nw-alt:before,#powerTip.se-alt:before,#powerTip.sw-alt:before{border-top:10px solid #acacac;border-top:10px solid rgba(172,172,172,.8);bottom:-10px;border-left:5px solid transparent;border-right:5px solid transparent;left:10px}#powerTip.ne-alt:before{left:auto;right:10px}#powerTip.se-alt:before,#powerTip.sw-alt:before{border-top:none;border-bottom:10px solid #acacac;border-bottom:10px solid rgba(172,172,172,.8);bottom:auto;top:-10px}#powerTip.se-alt:before{left:auto;right:10px} \ No newline at end of file diff --git a/dist/css/jquery.powertip-orange.css b/dist/css/jquery.powertip-orange.css new file mode 100644 index 00000000..4cc94f23 --- /dev/null +++ b/dist/css/jquery.powertip-orange.css @@ -0,0 +1,102 @@ +/** + * PowerTip + * http://stevenbenner.github.io/jquery-powertip/ + * + * Stylesheet for the orange theme. + */ + +#powerTip { + cursor: default; + background-color: #ffcdaf; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 2px 1px rgba(255, 255, 255, 0.5) inset, 0 -2px 2px #fab482 inset; + -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 2px 1px rgba(255, 255, 255, 0.5) inset, 0 -2px 2px #fab482 inset; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 2px 1px rgba(255, 255, 255, 0.5) inset, 0 -2px 2px #fab482 inset; + border: 1px solid #f5a550; + border-radius: 6px; + color: #000000; + display: none; + padding: 10px; + position: absolute; + white-space: nowrap; + z-index: 2147483647; +} +#powerTip:before { + content: ""; + position: absolute; +} +#powerTip.n:before, #powerTip.s:before { + border-right: 5px solid transparent; + border-left: 5px solid transparent; + left: 50%; + margin-left: -5px; +} +#powerTip.e:before, #powerTip.w:before { + border-bottom: 5px solid transparent; + border-top: 5px solid transparent; + margin-top: -5px; + top: 50%; +} +#powerTip.n:before { + border-top: 10px solid #f5a550; + border-top: 10px solid rgba(245, 165, 80, 0.8); + bottom: -10px; +} +#powerTip.e:before { + border-right: 10px solid #f5a550; + border-right: 10px solid rgba(245, 165, 80, 0.8); + left: -10px; +} +#powerTip.s:before { + border-bottom: 10px solid #f5a550; + border-bottom: 10px solid rgba(245, 165, 80, 0.8); + top: -10px; +} +#powerTip.w:before { + border-left: 10px solid #f5a550; + border-left: 10px solid rgba(245, 165, 80, 0.8); + right: -10px; +} +#powerTip.ne:before, #powerTip.se:before { + border-right: 10px solid transparent; + border-left: 0; + left: 10px; +} +#powerTip.nw:before, #powerTip.sw:before { + border-left: 10px solid transparent; + border-right: 0; + right: 10px; +} +#powerTip.ne:before, #powerTip.nw:before { + border-top: 10px solid #f5a550; + border-top: 10px solid rgba(245, 165, 80, 0.8); + bottom: -10px; +} +#powerTip.se:before, #powerTip.sw:before { + border-bottom: 10px solid #f5a550; + border-bottom: 10px solid rgba(245, 165, 80, 0.8); + top: -10px; +} +#powerTip.nw-alt:before, #powerTip.ne-alt:before, +#powerTip.sw-alt:before, #powerTip.se-alt:before { + border-top: 10px solid #f5a550; + border-top: 10px solid rgba(245, 165, 80, 0.8); + bottom: -10px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + left: 10px; +} +#powerTip.ne-alt:before { + left: auto; + right: 10px; +} +#powerTip.sw-alt:before, #powerTip.se-alt:before { + border-top: none; + border-bottom: 10px solid #f5a550; + border-bottom: 10px solid rgba(245, 165, 80, 0.8); + bottom: auto; + top: -10px; +} +#powerTip.se-alt:before { + left: auto; + right: 10px; +} diff --git a/dist/css/jquery.powertip-orange.min.css b/dist/css/jquery.powertip-orange.min.css new file mode 100644 index 00000000..a76ac854 --- /dev/null +++ b/dist/css/jquery.powertip-orange.min.css @@ -0,0 +1,9 @@ +/*! + PowerTip v1.2.0 (2014-11-21) + http://stevenbenner.github.io/jquery-powertip/ + Copyright (c) 2014 Steven Benner (http://stevenbenner.com/). + Released under MIT license. + https://raw.github.com/stevenbenner/jquery-powertip/master/LICENSE.txt +*/ + +#powerTip{cursor:default;background-color:#ffcdaf;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.15),0 2px 1px rgba(255,255,255,.5) inset,0 -2px 2px #fab482 inset;-moz-box-shadow:0 1px 1px rgba(0,0,0,.15),0 2px 1px rgba(255,255,255,.5) inset,0 -2px 2px #fab482 inset;box-shadow:0 1px 1px rgba(0,0,0,.15),0 2px 1px rgba(255,255,255,.5) inset,0 -2px 2px #fab482 inset;border:1px solid #f5a550;border-radius:6px;color:#000;display:none;padding:10px;position:absolute;white-space:nowrap;z-index:2147483647}#powerTip:before{content:"";position:absolute}#powerTip.n:before,#powerTip.s:before{border-right:5px solid transparent;border-left:5px solid transparent;left:50%;margin-left:-5px}#powerTip.e:before,#powerTip.w:before{border-bottom:5px solid transparent;border-top:5px solid transparent;margin-top:-5px;top:50%}#powerTip.n:before{border-top:10px solid #f5a550;border-top:10px solid rgba(245,165,80,.8);bottom:-10px}#powerTip.e:before{border-right:10px solid #f5a550;border-right:10px solid rgba(245,165,80,.8);left:-10px}#powerTip.s:before{border-bottom:10px solid #f5a550;border-bottom:10px solid rgba(245,165,80,.8);top:-10px}#powerTip.w:before{border-left:10px solid #f5a550;border-left:10px solid rgba(245,165,80,.8);right:-10px}#powerTip.ne:before,#powerTip.se:before{border-right:10px solid transparent;border-left:0;left:10px}#powerTip.nw:before,#powerTip.sw:before{border-left:10px solid transparent;border-right:0;right:10px}#powerTip.ne:before,#powerTip.nw:before{border-top:10px solid #f5a550;border-top:10px solid rgba(245,165,80,.8);bottom:-10px}#powerTip.se:before,#powerTip.sw:before{border-bottom:10px solid #f5a550;border-bottom:10px solid rgba(245,165,80,.8);top:-10px}#powerTip.ne-alt:before,#powerTip.nw-alt:before,#powerTip.se-alt:before,#powerTip.sw-alt:before{border-top:10px solid #f5a550;border-top:10px solid rgba(245,165,80,.8);bottom:-10px;border-left:5px solid transparent;border-right:5px solid transparent;left:10px}#powerTip.ne-alt:before{left:auto;right:10px}#powerTip.se-alt:before,#powerTip.sw-alt:before{border-top:none;border-bottom:10px solid #f5a550;border-bottom:10px solid rgba(245,165,80,.8);bottom:auto;top:-10px}#powerTip.se-alt:before{left:auto;right:10px} \ No newline at end of file diff --git a/dist/css/jquery.powertip-purple.css b/dist/css/jquery.powertip-purple.css new file mode 100644 index 00000000..3c406944 --- /dev/null +++ b/dist/css/jquery.powertip-purple.css @@ -0,0 +1,102 @@ +/** + * PowerTip + * http://stevenbenner.github.io/jquery-powertip/ + * + * Stylesheet for the purple theme. + */ + +#powerTip { + cursor: default; + background-color: #ebd2fa; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 2px 1px rgba(255, 255, 255, 0.5) inset, 0 -2px 2px #d796ff inset; + -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 2px 1px rgba(255, 255, 255, 0.5) inset, 0 -2px 2px #d796ff inset; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 2px 1px rgba(255, 255, 255, 0.5) inset, 0 -2px 2px #d796ff inset; + border: 1px solid #914bd2; + border-radius: 6px; + color: #000000; + display: none; + padding: 10px; + position: absolute; + white-space: nowrap; + z-index: 2147483647; +} +#powerTip:before { + content: ""; + position: absolute; +} +#powerTip.n:before, #powerTip.s:before { + border-right: 5px solid transparent; + border-left: 5px solid transparent; + left: 50%; + margin-left: -5px; +} +#powerTip.e:before, #powerTip.w:before { + border-bottom: 5px solid transparent; + border-top: 5px solid transparent; + margin-top: -5px; + top: 50%; +} +#powerTip.n:before { + border-top: 10px solid #914bd2; + border-top: 10px solid rgba(145, 75, 210, 0.8); + bottom: -10px; +} +#powerTip.e:before { + border-right: 10px solid #914bd2; + border-right: 10px solid rgba(145, 75, 210, 0.8); + left: -10px; +} +#powerTip.s:before { + border-bottom: 10px solid #914bd2; + border-bottom: 10px solid rgba(145, 75, 210, 0.8); + top: -10px; +} +#powerTip.w:before { + border-left: 10px solid #914bd2; + border-left: 10px solid rgba(145, 75, 210, 0.8); + right: -10px; +} +#powerTip.ne:before, #powerTip.se:before { + border-right: 10px solid transparent; + border-left: 0; + left: 10px; +} +#powerTip.nw:before, #powerTip.sw:before { + border-left: 10px solid transparent; + border-right: 0; + right: 10px; +} +#powerTip.ne:before, #powerTip.nw:before { + border-top: 10px solid #914bd2; + border-top: 10px solid rgba(145, 75, 210, 0.8); + bottom: -10px; +} +#powerTip.se:before, #powerTip.sw:before { + border-bottom: 10px solid #914bd2; + border-bottom: 10px solid rgba(145, 75, 210, 0.8); + top: -10px; +} +#powerTip.nw-alt:before, #powerTip.ne-alt:before, +#powerTip.sw-alt:before, #powerTip.se-alt:before { + border-top: 10px solid #914bd2; + border-top: 10px solid rgba(145, 75, 210, 0.8); + bottom: -10px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + left: 10px; +} +#powerTip.ne-alt:before { + left: auto; + right: 10px; +} +#powerTip.sw-alt:before, #powerTip.se-alt:before { + border-top: none; + border-bottom: 10px solid #914bd2; + border-bottom: 10px solid rgba(145, 75, 210, 0.8); + bottom: auto; + top: -10px; +} +#powerTip.se-alt:before { + left: auto; + right: 10px; +} diff --git a/dist/css/jquery.powertip-purple.min.css b/dist/css/jquery.powertip-purple.min.css new file mode 100644 index 00000000..b72803e8 --- /dev/null +++ b/dist/css/jquery.powertip-purple.min.css @@ -0,0 +1,9 @@ +/*! + PowerTip v1.2.0 (2014-11-21) + http://stevenbenner.github.io/jquery-powertip/ + Copyright (c) 2014 Steven Benner (http://stevenbenner.com/). + Released under MIT license. + https://raw.github.com/stevenbenner/jquery-powertip/master/LICENSE.txt +*/ + +#powerTip{cursor:default;background-color:#ebd2fa;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.15),0 2px 1px rgba(255,255,255,.5) inset,0 -2px 2px #d796ff inset;-moz-box-shadow:0 1px 1px rgba(0,0,0,.15),0 2px 1px rgba(255,255,255,.5) inset,0 -2px 2px #d796ff inset;box-shadow:0 1px 1px rgba(0,0,0,.15),0 2px 1px rgba(255,255,255,.5) inset,0 -2px 2px #d796ff inset;border:1px solid #914bd2;border-radius:6px;color:#000;display:none;padding:10px;position:absolute;white-space:nowrap;z-index:2147483647}#powerTip:before{content:"";position:absolute}#powerTip.n:before,#powerTip.s:before{border-right:5px solid transparent;border-left:5px solid transparent;left:50%;margin-left:-5px}#powerTip.e:before,#powerTip.w:before{border-bottom:5px solid transparent;border-top:5px solid transparent;margin-top:-5px;top:50%}#powerTip.n:before{border-top:10px solid #914bd2;border-top:10px solid rgba(145,75,210,.8);bottom:-10px}#powerTip.e:before{border-right:10px solid #914bd2;border-right:10px solid rgba(145,75,210,.8);left:-10px}#powerTip.s:before{border-bottom:10px solid #914bd2;border-bottom:10px solid rgba(145,75,210,.8);top:-10px}#powerTip.w:before{border-left:10px solid #914bd2;border-left:10px solid rgba(145,75,210,.8);right:-10px}#powerTip.ne:before,#powerTip.se:before{border-right:10px solid transparent;border-left:0;left:10px}#powerTip.nw:before,#powerTip.sw:before{border-left:10px solid transparent;border-right:0;right:10px}#powerTip.ne:before,#powerTip.nw:before{border-top:10px solid #914bd2;border-top:10px solid rgba(145,75,210,.8);bottom:-10px}#powerTip.se:before,#powerTip.sw:before{border-bottom:10px solid #914bd2;border-bottom:10px solid rgba(145,75,210,.8);top:-10px}#powerTip.ne-alt:before,#powerTip.nw-alt:before,#powerTip.se-alt:before,#powerTip.sw-alt:before{border-top:10px solid #914bd2;border-top:10px solid rgba(145,75,210,.8);bottom:-10px;border-left:5px solid transparent;border-right:5px solid transparent;left:10px}#powerTip.ne-alt:before{left:auto;right:10px}#powerTip.se-alt:before,#powerTip.sw-alt:before{border-top:none;border-bottom:10px solid #914bd2;border-bottom:10px solid rgba(145,75,210,.8);bottom:auto;top:-10px}#powerTip.se-alt:before{left:auto;right:10px} \ No newline at end of file diff --git a/dist/css/jquery.powertip-red.css b/dist/css/jquery.powertip-red.css new file mode 100644 index 00000000..9dd7f5ed --- /dev/null +++ b/dist/css/jquery.powertip-red.css @@ -0,0 +1,102 @@ +/** + * PowerTip + * http://stevenbenner.github.io/jquery-powertip/ + * + * Stylesheet for the red theme. + */ + +#powerTip { + cursor: default; + background-color: #ffc8c3; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 2px 1px rgba(255, 255, 255, 0.5) inset, 0 -2px 2px #f5aa9b inset; + -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 2px 1px rgba(255, 255, 255, 0.5) inset, 0 -2px 2px #f5aa9b inset; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 2px 1px rgba(255, 255, 255, 0.5) inset, 0 -2px 2px #f5aa9b inset; + border: 1px solid #eb5037; + border-radius: 6px; + color: #000000; + display: none; + padding: 10px; + position: absolute; + white-space: nowrap; + z-index: 2147483647; +} +#powerTip:before { + content: ""; + position: absolute; +} +#powerTip.n:before, #powerTip.s:before { + border-right: 5px solid transparent; + border-left: 5px solid transparent; + left: 50%; + margin-left: -5px; +} +#powerTip.e:before, #powerTip.w:before { + border-bottom: 5px solid transparent; + border-top: 5px solid transparent; + margin-top: -5px; + top: 50%; +} +#powerTip.n:before { + border-top: 10px solid #eb5037; + border-top: 10px solid rgba(235, 80, 55, 0.8); + bottom: -10px; +} +#powerTip.e:before { + border-right: 10px solid #eb5037; + border-right: 10px solid rgba(235, 80, 55, 0.8); + left: -10px; +} +#powerTip.s:before { + border-bottom: 10px solid #eb5037; + border-bottom: 10px solid rgba(235, 80, 55, 0.8); + top: -10px; +} +#powerTip.w:before { + border-left: 10px solid #eb5037; + border-left: 10px solid rgba(235, 80, 55, 0.8); + right: -10px; +} +#powerTip.ne:before, #powerTip.se:before { + border-right: 10px solid transparent; + border-left: 0; + left: 10px; +} +#powerTip.nw:before, #powerTip.sw:before { + border-left: 10px solid transparent; + border-right: 0; + right: 10px; +} +#powerTip.ne:before, #powerTip.nw:before { + border-top: 10px solid #eb5037; + border-top: 10px solid rgba(235, 80, 55, 0.8); + bottom: -10px; +} +#powerTip.se:before, #powerTip.sw:before { + border-bottom: 10px solid #eb5037; + border-bottom: 10px solid rgba(235, 80, 55, 0.8); + top: -10px; +} +#powerTip.nw-alt:before, #powerTip.ne-alt:before, +#powerTip.sw-alt:before, #powerTip.se-alt:before { + border-top: 10px solid #eb5037; + border-top: 10px solid rgba(235, 80, 55, 0.8); + bottom: -10px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + left: 10px; +} +#powerTip.ne-alt:before { + left: auto; + right: 10px; +} +#powerTip.sw-alt:before, #powerTip.se-alt:before { + border-top: none; + border-bottom: 10px solid #eb5037; + border-bottom: 10px solid rgba(235, 80, 55, 0.8); + bottom: auto; + top: -10px; +} +#powerTip.se-alt:before { + left: auto; + right: 10px; +} diff --git a/dist/css/jquery.powertip-red.min.css b/dist/css/jquery.powertip-red.min.css new file mode 100644 index 00000000..64fefad4 --- /dev/null +++ b/dist/css/jquery.powertip-red.min.css @@ -0,0 +1,9 @@ +/*! + PowerTip v1.2.0 (2014-11-21) + http://stevenbenner.github.io/jquery-powertip/ + Copyright (c) 2014 Steven Benner (http://stevenbenner.com/). + Released under MIT license. + https://raw.github.com/stevenbenner/jquery-powertip/master/LICENSE.txt +*/ + +#powerTip{cursor:default;background-color:#ffc8c3;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.15),0 2px 1px rgba(255,255,255,.5) inset,0 -2px 2px #f5aa9b inset;-moz-box-shadow:0 1px 1px rgba(0,0,0,.15),0 2px 1px rgba(255,255,255,.5) inset,0 -2px 2px #f5aa9b inset;box-shadow:0 1px 1px rgba(0,0,0,.15),0 2px 1px rgba(255,255,255,.5) inset,0 -2px 2px #f5aa9b inset;border:1px solid #eb5037;border-radius:6px;color:#000;display:none;padding:10px;position:absolute;white-space:nowrap;z-index:2147483647}#powerTip:before{content:"";position:absolute}#powerTip.n:before,#powerTip.s:before{border-right:5px solid transparent;border-left:5px solid transparent;left:50%;margin-left:-5px}#powerTip.e:before,#powerTip.w:before{border-bottom:5px solid transparent;border-top:5px solid transparent;margin-top:-5px;top:50%}#powerTip.n:before{border-top:10px solid #eb5037;border-top:10px solid rgba(235,80,55,.8);bottom:-10px}#powerTip.e:before{border-right:10px solid #eb5037;border-right:10px solid rgba(235,80,55,.8);left:-10px}#powerTip.s:before{border-bottom:10px solid #eb5037;border-bottom:10px solid rgba(235,80,55,.8);top:-10px}#powerTip.w:before{border-left:10px solid #eb5037;border-left:10px solid rgba(235,80,55,.8);right:-10px}#powerTip.ne:before,#powerTip.se:before{border-right:10px solid transparent;border-left:0;left:10px}#powerTip.nw:before,#powerTip.sw:before{border-left:10px solid transparent;border-right:0;right:10px}#powerTip.ne:before,#powerTip.nw:before{border-top:10px solid #eb5037;border-top:10px solid rgba(235,80,55,.8);bottom:-10px}#powerTip.se:before,#powerTip.sw:before{border-bottom:10px solid #eb5037;border-bottom:10px solid rgba(235,80,55,.8);top:-10px}#powerTip.ne-alt:before,#powerTip.nw-alt:before,#powerTip.se-alt:before,#powerTip.sw-alt:before{border-top:10px solid #eb5037;border-top:10px solid rgba(235,80,55,.8);bottom:-10px;border-left:5px solid transparent;border-right:5px solid transparent;left:10px}#powerTip.ne-alt:before{left:auto;right:10px}#powerTip.se-alt:before,#powerTip.sw-alt:before{border-top:none;border-bottom:10px solid #eb5037;border-bottom:10px solid rgba(235,80,55,.8);bottom:auto;top:-10px}#powerTip.se-alt:before{left:auto;right:10px} \ No newline at end of file diff --git a/dist/css/jquery.powertip-yellow.css b/dist/css/jquery.powertip-yellow.css new file mode 100644 index 00000000..bd108cd5 --- /dev/null +++ b/dist/css/jquery.powertip-yellow.css @@ -0,0 +1,102 @@ +/** + * PowerTip + * http://stevenbenner.github.io/jquery-powertip/ + * + * Stylesheet for the yellow theme. + */ + +#powerTip { + cursor: default; + background-color: #ffffb4; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 2px 1px rgba(255, 255, 255, 0.8) inset, 0 -2px 2px #fafa6e inset; + -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 2px 1px rgba(255, 255, 255, 0.8) inset, 0 -2px 2px #fafa6e inset; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 2px 1px rgba(255, 255, 255, 0.8) inset, 0 -2px 2px #fafa6e inset; + border: 1px solid #fafa50; + border-radius: 6px; + color: #000000; + display: none; + padding: 10px; + position: absolute; + white-space: nowrap; + z-index: 2147483647; +} +#powerTip:before { + content: ""; + position: absolute; +} +#powerTip.n:before, #powerTip.s:before { + border-right: 5px solid transparent; + border-left: 5px solid transparent; + left: 50%; + margin-left: -5px; +} +#powerTip.e:before, #powerTip.w:before { + border-bottom: 5px solid transparent; + border-top: 5px solid transparent; + margin-top: -5px; + top: 50%; +} +#powerTip.n:before { + border-top: 10px solid #fafa50; + border-top: 10px solid rgba(250, 250, 80, 0.8); + bottom: -10px; +} +#powerTip.e:before { + border-right: 10px solid #fafa50; + border-right: 10px solid rgba(250, 250, 80, 0.8); + left: -10px; +} +#powerTip.s:before { + border-bottom: 10px solid #fafa50; + border-bottom: 10px solid rgba(250, 250, 80, 0.8); + top: -10px; +} +#powerTip.w:before { + border-left: 10px solid #fafa50; + border-left: 10px solid rgba(250, 250, 80, 0.8); + right: -10px; +} +#powerTip.ne:before, #powerTip.se:before { + border-right: 10px solid transparent; + border-left: 0; + left: 10px; +} +#powerTip.nw:before, #powerTip.sw:before { + border-left: 10px solid transparent; + border-right: 0; + right: 10px; +} +#powerTip.ne:before, #powerTip.nw:before { + border-top: 10px solid #fafa50; + border-top: 10px solid rgba(250, 250, 80, 0.8); + bottom: -10px; +} +#powerTip.se:before, #powerTip.sw:before { + border-bottom: 10px solid #fafa50; + border-bottom: 10px solid rgba(250, 250, 80, 0.8); + top: -10px; +} +#powerTip.nw-alt:before, #powerTip.ne-alt:before, +#powerTip.sw-alt:before, #powerTip.se-alt:before { + border-top: 10px solid #fafa50; + border-top: 10px solid rgba(250, 250, 80, 0.8); + bottom: -10px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + left: 10px; +} +#powerTip.ne-alt:before { + left: auto; + right: 10px; +} +#powerTip.sw-alt:before, #powerTip.se-alt:before { + border-top: none; + border-bottom: 10px solid #fafa50; + border-bottom: 10px solid rgba(250, 250, 80, 0.8); + bottom: auto; + top: -10px; +} +#powerTip.se-alt:before { + left: auto; + right: 10px; +} diff --git a/dist/css/jquery.powertip-yellow.min.css b/dist/css/jquery.powertip-yellow.min.css new file mode 100644 index 00000000..4c74cfb9 --- /dev/null +++ b/dist/css/jquery.powertip-yellow.min.css @@ -0,0 +1,9 @@ +/*! + PowerTip v1.2.0 (2014-11-21) + http://stevenbenner.github.io/jquery-powertip/ + Copyright (c) 2014 Steven Benner (http://stevenbenner.com/). + Released under MIT license. + https://raw.github.com/stevenbenner/jquery-powertip/master/LICENSE.txt +*/ + +#powerTip{cursor:default;background-color:#ffffb4;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.15),0 2px 1px rgba(255,255,255,.8) inset,0 -2px 2px #fafa6e inset;-moz-box-shadow:0 1px 1px rgba(0,0,0,.15),0 2px 1px rgba(255,255,255,.8) inset,0 -2px 2px #fafa6e inset;box-shadow:0 1px 1px rgba(0,0,0,.15),0 2px 1px rgba(255,255,255,.8) inset,0 -2px 2px #fafa6e inset;border:1px solid #fafa50;border-radius:6px;color:#000;display:none;padding:10px;position:absolute;white-space:nowrap;z-index:2147483647}#powerTip:before{content:"";position:absolute}#powerTip.n:before,#powerTip.s:before{border-right:5px solid transparent;border-left:5px solid transparent;left:50%;margin-left:-5px}#powerTip.e:before,#powerTip.w:before{border-bottom:5px solid transparent;border-top:5px solid transparent;margin-top:-5px;top:50%}#powerTip.n:before{border-top:10px solid #fafa50;border-top:10px solid rgba(250,250,80,.8);bottom:-10px}#powerTip.e:before{border-right:10px solid #fafa50;border-right:10px solid rgba(250,250,80,.8);left:-10px}#powerTip.s:before{border-bottom:10px solid #fafa50;border-bottom:10px solid rgba(250,250,80,.8);top:-10px}#powerTip.w:before{border-left:10px solid #fafa50;border-left:10px solid rgba(250,250,80,.8);right:-10px}#powerTip.ne:before,#powerTip.se:before{border-right:10px solid transparent;border-left:0;left:10px}#powerTip.nw:before,#powerTip.sw:before{border-left:10px solid transparent;border-right:0;right:10px}#powerTip.ne:before,#powerTip.nw:before{border-top:10px solid #fafa50;border-top:10px solid rgba(250,250,80,.8);bottom:-10px}#powerTip.se:before,#powerTip.sw:before{border-bottom:10px solid #fafa50;border-bottom:10px solid rgba(250,250,80,.8);top:-10px}#powerTip.ne-alt:before,#powerTip.nw-alt:before,#powerTip.se-alt:before,#powerTip.sw-alt:before{border-top:10px solid #fafa50;border-top:10px solid rgba(250,250,80,.8);bottom:-10px;border-left:5px solid transparent;border-right:5px solid transparent;left:10px}#powerTip.ne-alt:before{left:auto;right:10px}#powerTip.se-alt:before,#powerTip.sw-alt:before{border-top:none;border-bottom:10px solid #fafa50;border-bottom:10px solid rgba(250,250,80,.8);bottom:auto;top:-10px}#powerTip.se-alt:before{left:auto;right:10px} \ No newline at end of file diff --git a/dist/css/jquery.powertip.css b/dist/css/jquery.powertip.css new file mode 100644 index 00000000..dd52b809 --- /dev/null +++ b/dist/css/jquery.powertip.css @@ -0,0 +1,99 @@ +/** + * PowerTip + * http://stevenbenner.github.io/jquery-powertip/ + * + * Stylesheet for the monochrome (default) theme. + */ + +#powerTip { + cursor: default; + background-color: #333; + background-color: rgba(0, 0, 0, 0.8); + border-radius: 6px; + color: #fff; + display: none; + padding: 10px; + position: absolute; + white-space: nowrap; + z-index: 2147483647; +} +#powerTip:before { + content: ""; + position: absolute; +} +#powerTip.n:before, #powerTip.s:before { + border-right: 5px solid transparent; + border-left: 5px solid transparent; + left: 50%; + margin-left: -5px; +} +#powerTip.e:before, #powerTip.w:before { + border-bottom: 5px solid transparent; + border-top: 5px solid transparent; + margin-top: -5px; + top: 50%; +} +#powerTip.n:before { + border-top: 10px solid #333; + border-top: 10px solid rgba(0, 0, 0, 0.8); + bottom: -10px; +} +#powerTip.e:before { + border-right: 10px solid #333; + border-right: 10px solid rgba(0, 0, 0, 0.8); + left: -10px; +} +#powerTip.s:before { + border-bottom: 10px solid #333; + border-bottom: 10px solid rgba(0, 0, 0, 0.8); + top: -10px; +} +#powerTip.w:before { + border-left: 10px solid #333; + border-left: 10px solid rgba(0, 0, 0, 0.8); + right: -10px; +} +#powerTip.ne:before, #powerTip.se:before { + border-right: 10px solid transparent; + border-left: 0; + left: 10px; +} +#powerTip.nw:before, #powerTip.sw:before { + border-left: 10px solid transparent; + border-right: 0; + right: 10px; +} +#powerTip.ne:before, #powerTip.nw:before { + border-top: 10px solid #333; + border-top: 10px solid rgba(0, 0, 0, 0.8); + bottom: -10px; +} +#powerTip.se:before, #powerTip.sw:before { + border-bottom: 10px solid #333; + border-bottom: 10px solid rgba(0, 0, 0, 0.8); + top: -10px; +} +#powerTip.nw-alt:before, #powerTip.ne-alt:before, +#powerTip.sw-alt:before, #powerTip.se-alt:before { + border-top: 10px solid #333; + border-top: 10px solid rgba(0, 0, 0, 0.8); + bottom: -10px; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + left: 10px; +} +#powerTip.ne-alt:before { + left: auto; + right: 10px; +} +#powerTip.sw-alt:before, #powerTip.se-alt:before { + border-top: none; + border-bottom: 10px solid #333; + border-bottom: 10px solid rgba(0, 0, 0, 0.8); + bottom: auto; + top: -10px; +} +#powerTip.se-alt:before { + left: auto; + right: 10px; +} diff --git a/dist/css/jquery.powertip.min.css b/dist/css/jquery.powertip.min.css new file mode 100644 index 00000000..ed021fc3 --- /dev/null +++ b/dist/css/jquery.powertip.min.css @@ -0,0 +1,9 @@ +/*! + PowerTip v1.2.0 (2014-11-21) + http://stevenbenner.github.io/jquery-powertip/ + Copyright (c) 2014 Steven Benner (http://stevenbenner.com/). + Released under MIT license. + https://raw.github.com/stevenbenner/jquery-powertip/master/LICENSE.txt +*/ + +#powerTip{cursor:default;background-color:#333;background-color:rgba(0,0,0,.8);border-radius:6px;color:#fff;display:none;padding:10px;position:absolute;white-space:nowrap;z-index:2147483647}#powerTip:before{content:"";position:absolute}#powerTip.n:before,#powerTip.s:before{border-right:5px solid transparent;border-left:5px solid transparent;left:50%;margin-left:-5px}#powerTip.e:before,#powerTip.w:before{border-bottom:5px solid transparent;border-top:5px solid transparent;margin-top:-5px;top:50%}#powerTip.n:before{border-top:10px solid #333;border-top:10px solid rgba(0,0,0,.8);bottom:-10px}#powerTip.e:before{border-right:10px solid #333;border-right:10px solid rgba(0,0,0,.8);left:-10px}#powerTip.s:before{border-bottom:10px solid #333;border-bottom:10px solid rgba(0,0,0,.8);top:-10px}#powerTip.w:before{border-left:10px solid #333;border-left:10px solid rgba(0,0,0,.8);right:-10px}#powerTip.ne:before,#powerTip.se:before{border-right:10px solid transparent;border-left:0;left:10px}#powerTip.nw:before,#powerTip.sw:before{border-left:10px solid transparent;border-right:0;right:10px}#powerTip.ne:before,#powerTip.nw:before{border-top:10px solid #333;border-top:10px solid rgba(0,0,0,.8);bottom:-10px}#powerTip.se:before,#powerTip.sw:before{border-bottom:10px solid #333;border-bottom:10px solid rgba(0,0,0,.8);top:-10px}#powerTip.ne-alt:before,#powerTip.nw-alt:before,#powerTip.se-alt:before,#powerTip.sw-alt:before{border-top:10px solid #333;border-top:10px solid rgba(0,0,0,.8);bottom:-10px;border-left:5px solid transparent;border-right:5px solid transparent;left:10px}#powerTip.ne-alt:before{left:auto;right:10px}#powerTip.se-alt:before,#powerTip.sw-alt:before{border-top:none;border-bottom:10px solid #333;border-bottom:10px solid rgba(0,0,0,.8);bottom:auto;top:-10px}#powerTip.se-alt:before{left:auto;right:10px} \ No newline at end of file diff --git a/dist/examples/examples.html b/dist/examples/examples.html new file mode 100644 index 00000000..d244823d --- /dev/null +++ b/dist/examples/examples.html @@ -0,0 +1,178 @@ + + + + + PowerTip Examples + + + + + + + + +

PowerTip Examples

+ + +
+

Placement examples

+
+ + + + +
+ +
+ + + + + +
+
+ + + +
+

Mouse follow example

+
+ The PowerTip for this box will follow the mouse. +
+
+ + + +
+

Mouse on to tooltip example

+
+ The PowerTip for this box will appear on the right and you will be able to interact with its content. +
+
+ + + +
+

Custom show and hide event examples

+ + + + +
+ + + +
+

API examples

+ + + +
+ Delegated manual mouseover, with lazy-loaded tooltip: + + +
+
+ + + + diff --git a/dist/jquery.powertip.min.js b/dist/jquery.powertip.min.js new file mode 100644 index 00000000..5a91c505 --- /dev/null +++ b/dist/jquery.powertip.min.js @@ -0,0 +1,8 @@ +/*! + PowerTip v1.2.0 (2014-11-21) + http://stevenbenner.github.io/jquery-powertip/ + Copyright (c) 2014 Steven Benner (http://stevenbenner.com/). + Released under MIT license. + https://raw.github.com/stevenbenner/jquery-powertip/master/LICENSE.txt +*/ +!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){function b(){var b=this;b.top="auto",b.left="auto",b.right="auto",b.bottom="auto",b.set=function(c,d){a.isNumeric(d)&&(b[c]=Math.round(d))}}function c(a,b,c){function d(d,e){g(),a.data(u)?h():d?(e&&a.data(v,!0),c.showTip(a)):(E.tipOpenImminent=!0,j=setTimeout(function(){j=null,f()},b.intentPollInterval))}function e(d){g(),E.tipOpenImminent=!1,a.data(u)&&(a.data(v,!1),d?c.hideTip(a):(E.delayInProgress=!0,E.closeDelayTimeout=setTimeout(function(){E.closeDelayTimeout=null,c.hideTip(a),E.delayInProgress=!1,k=null},b.closeDelay),k=E.closeDelayTimeout))}function f(){var e=Math.abs(E.previousX-E.currentX),f=Math.abs(E.previousY-E.currentY),g=e+f;gf&&(f+=8);f--;)p.push(p.shift());for(g=0;g-1||a.inArray("mouseout",c.closeEvents)>-1||a.inArray("blur",c.closeEvents)>-1||a.inArray("focusout",c.closeEvents)>-1)&&(E.activeHover.data(u)===!1||E.activeHover.is(":disabled")?b=!0:m(E.activeHover)||E.activeHover.is(":focus")||E.activeHover.data(v)||(y.data(x)?m(y)||(b=!0):b=!0),b&&g(E.activeHover))}var l=new d,y=a("#"+c.popupId);0===y.length&&(y=a("
",{id:c.popupId}),0===s.length&&(s=a("body")),s.append(y),E.tooltips=E.tooltips?E.tooltips.add(y):y),c.followMouse&&(y.data(w)||(q.on("mousemove"+C,h),r.on("scroll"+C,h),y.data(w,!0))),this.showTip=e,this.hideTip=g,this.resetPosition=i}function f(a){return Boolean(window.SVGElement&&a[0]instanceof SVGElement)}function g(a){return Boolean(a&&"number"==typeof a.pageX)}function h(){E.mouseTrackingActive||(E.mouseTrackingActive=!0,i(),a(i),q.on("mousemove"+C,l),r.on("resize"+C,j),r.on("scroll"+C,k))}function i(){E.scrollLeft=r.scrollLeft(),E.scrollTop=r.scrollTop(),E.windowWidth=r.width(),E.windowHeight=r.height()}function j(){E.windowWidth=r.width(),E.windowHeight=r.height()}function k(){var a=r.scrollLeft(),b=r.scrollTop();a!==E.scrollLeft&&(E.currentX+=a-E.scrollLeft,E.scrollLeft=a),b!==E.scrollTop&&(E.currentY+=b-E.scrollTop,E.scrollTop=b)}function l(a){E.currentX=a.pageX,E.currentY=a.pageY}function m(a){var b=a.offset(),c=a[0].getBoundingClientRect(),d=c.right-c.left,e=c.bottom-c.top;return E.currentX>=b.left&&E.currentX<=b.left+d&&E.currentY>=b.top&&E.currentY<=b.top+e}function n(b){var c,d,e=b.data(z),f=b.data(A),g=b.data(B);return e?(a.isFunction(e)&&(e=e.call(b[0])),d=e):f?(a.isFunction(f)&&(f=f.call(b[0])),f.length>0&&(d=f.clone(!0,!0))):g&&(c=a("#"+g),c.length>0&&(d=c.html())),d}function o(a,b,c){var d=E.scrollTop,e=E.scrollLeft,f=d+E.windowHeight,g=e+E.windowWidth,h=F.none;return(a.topf||Math.abs(a.bottom-E.windowHeight)>f)&&(h|=F.bottom),(a.leftg)&&(h|=F.left),(a.left+b>g||a.right-1?j.on(c+C,function(b){a.powerTip.toggle(this,b)}):j.on(c+C,function(b){a.powerTip.show(this,b)})}),a.each(f.closeEvents,function(b,c){a.inArray(c,f.openEvents)<0&&j.on(c+C,function(b){a.powerTip.hide(this,!g(b))})}),j.on("keydown"+C,function(b){27===b.keyCode&&a.powerTip.hide(this,!0)})),E.elements=E.elements?E.elements.add(j):j,j):j},a.fn.powerTip.defaults={fadeInTime:200,fadeOutTime:100,followMouse:!1,popupId:"powerTip",popupClass:null,intentSensitivity:7,intentPollInterval:100,closeDelay:100,placement:"n",smartPlacement:!1,offset:10,mouseOnToPopup:!1,manual:!1,openEvents:["mouseenter","focus"],closeEvents:["mouseleave","blur"]},a.fn.powerTip.smartPlacementLists={n:["n","ne","nw","s"],e:["e","ne","se","w","nw","sw","n","s","e"],s:["s","se","sw","n"],w:["w","nw","sw","e","ne","se","n","s","w"],nw:["nw","w","sw","n","s","se","nw"],ne:["ne","e","se","n","s","sw","ne"],sw:["sw","w","nw","s","n","ne","sw"],se:["se","e","ne","s","n","nw","se"],"nw-alt":["nw-alt","n","ne-alt","sw-alt","s","se-alt","w","e"],"ne-alt":["ne-alt","n","nw-alt","se-alt","s","sw-alt","e","w"],"sw-alt":["sw-alt","s","se-alt","nw-alt","n","ne-alt","w","e"],"se-alt":["se-alt","s","sw-alt","ne-alt","n","nw-alt","e","w"]},a.powerTip={show:function(b,c){return g(c)?(l(c),E.previousX=c.pageX,E.previousY=c.pageY,a(b).data(t).show()):a(b).first().data(t).show(!0,!0),b},reposition:function(b){return a(b).first().data(t).resetPosition(),b},hide:function(b,c){var d;return c=b?c:!0,b?d=a(b).first().data(t):E.activeHover&&(d=E.activeHover.data(t)),d&&d.hide(c),b},toggle:function(b,c){return E.activeHover&&E.activeHover.is(b)?a.powerTip.hide(b,!g(c)):a.powerTip.show(b,c),b},destroy:function(b){var c=b?a(b):E.elements;return E.elements&&0!==E.elements.length?(c.off(C).each(function(){var b=a(this),c=[y,t,u,v];b.data(y)&&(b.attr("title",b.data(y)),c.push(z)),b.removeData(c)}),E.elements=E.elements.not(c),0===E.elements.length&&(r.off(C),q.off(C),E.mouseTrackingActive=!1,E.tooltips.remove(),E.tooltips=null),b):b}},a.powerTip.showTip=a.powerTip.show,a.powerTip.closeTip=a.powerTip.hide}); \ No newline at end of file