/* ========================================================================
* bootstrap-tour - v0.12.0
* http://bootstraptour.com
* ========================================================================
* Copyright 2012-2015 Ulrich Sossou
*
* ========================================================================
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://opensource.org/licenses/MIT
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================================
*/
/* ========================================================================
* Bootstrap: transition.js v3.3.7
* http://getbootstrap.com/javascript/#transitions
* ========================================================================
* Copyright 2011-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
// ============================================================
function transitionEnd() {
var el = document.createElement('bootstrap')
var transEndEventNames = {
WebkitTransition : 'webkitTransitionEnd',
MozTransition : 'transitionend',
OTransition : 'oTransitionEnd otransitionend',
transition : 'transitionend'
}
for (var name in transEndEventNames) {
if (el.style[name] !== undefined) {
return { end: transEndEventNames[name] }
}
}
return false // explicit for ie8 ( ._.)
}
// http://blog.alexmaccaw.com/css-transitions
$.fn.emulateTransitionEnd = function (duration) {
var called = false
var $el = this
$(this).one('bsTransitionEnd', function () { called = true })
var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
setTimeout(callback, duration)
return this
}
$(function () {
$.support.transition = transitionEnd()
if (!$.support.transition) return
$.event.special.bsTransitionEnd = {
bindType: $.support.transition.end,
delegateType: $.support.transition.end,
handle: function (e) {
if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
}
}
})
}(jQuery);
/* ========================================================================
* Bootstrap: tooltip.js v3.3.7
* http://getbootstrap.com/javascript/#tooltip
* Inspired by the original jQuery.tipsy by Jason Frame
* ========================================================================
* Copyright 2011-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+function ($) {
'use strict';
// TOOLTIP PUBLIC CLASS DEFINITION
// ===============================
var Tooltip = function (element, options) {
this.type = null
this.options = null
this.enabled = null
this.timeout = null
this.hoverState = null
this.$element = null
this.inState = null
this.init('tooltip', element, options)
}
Tooltip.VERSION = '3.3.7'
Tooltip.TRANSITION_DURATION = 150
Tooltip.DEFAULTS = {
animation: true,
placement: 'top',
selector: false,
template: '
').parent().html();
};
Tour.prototype._reflexEvent = function(reflex) {
if ({}.toString.call(reflex) === '[object Boolean]') {
return 'click';
} else {
return reflex;
}
};
Tour.prototype._reposition = function($tip, step) {
var offsetBottom, offsetHeight, offsetRight, offsetWidth, originalLeft, originalTop, tipOffset;
offsetWidth = $tip[0].offsetWidth;
offsetHeight = $tip[0].offsetHeight;
tipOffset = $tip.offset();
originalLeft = tipOffset.left;
originalTop = tipOffset.top;
offsetBottom = $(document).outerHeight() - tipOffset.top - $tip.outerHeight();
if (offsetBottom < 0) {
tipOffset.top = tipOffset.top + offsetBottom;
}
offsetRight = $('html').outerWidth() - tipOffset.left - $tip.outerWidth();
if (offsetRight < 0) {
tipOffset.left = tipOffset.left + offsetRight;
}
if (tipOffset.top < 0) {
tipOffset.top = 0;
}
if (tipOffset.left < 0) {
tipOffset.left = 0;
}
$tip.offset(tipOffset);
if (step.placement === 'bottom' || step.placement === 'top') {
if (originalLeft !== tipOffset.left) {
return this._replaceArrow($tip, (tipOffset.left - originalLeft) * 2, offsetWidth, 'left');
}
} else {
if (originalTop !== tipOffset.top) {
return this._replaceArrow($tip, (tipOffset.top - originalTop) * 2, offsetHeight, 'top');
}
}
};
Tour.prototype._center = function($tip) {
return $tip.css('top', $(window).outerHeight() / 2 - $tip.outerHeight() / 2);
};
Tour.prototype._replaceArrow = function($tip, delta, dimension, position) {
return $tip.find('.arrow').css(position, delta ? 50 * (1 - delta / dimension) + '%' : '');
};
Tour.prototype._scrollIntoView = function(i) {
var $element, $window, counter, height, offsetTop, scrollTop, step, windowHeight;
step = this.getStep(i);
$element = $(step.element);
if (!$element.length) {
return this._showPopoverAndOverlay(i);
}
$window = $(window);
offsetTop = $element.offset().top;
height = $element.outerHeight();
windowHeight = $window.height();
scrollTop = 0;
switch (step.placement) {
case 'top':
scrollTop = Math.max(0, offsetTop - (windowHeight / 2));
break;
case 'left':
case 'right':
scrollTop = Math.max(0, (offsetTop + height / 2) - (windowHeight / 2));
break;
case 'bottom':
scrollTop = Math.max(0, (offsetTop + height) - (windowHeight / 2));
}
this._debug("Scroll into view. ScrollTop: " + scrollTop + ". Element offset: " + offsetTop + ". Window height: " + windowHeight + ".");
counter = 0;
return $('body, html').stop(true, true).animate({
scrollTop: Math.ceil(scrollTop)
}, (function(_this) {
return function() {
if (++counter === 2) {
_this._showPopoverAndOverlay(i);
return _this._debug("Scroll into view.\nAnimation end element offset: " + ($element.offset().top) + ".\nWindow height: " + ($window.height()) + ".");
}
};
})(this));
};
Tour.prototype._onResize = function(callback, timeout) {
return $(window).on("resize.tour-" + this._options.name, function() {
clearTimeout(timeout);
return timeout = setTimeout(callback, 100);
});
};
Tour.prototype._onScroll = function(callback, timeout) {
return $(window).on("scroll.tour-" + this._options.name, function() {
clearTimeout(timeout);
return timeout = setTimeout(callback, 100);
});
};
Tour.prototype._initMouseNavigation = function() {
var _this;
_this = this;
return $(document).off("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='prev']").off("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='next']").off("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='end']").off("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='pause-resume']").on("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='next']", (function(_this) {
return function(e) {
e.preventDefault();
return _this.next();
};
})(this)).on("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='prev']", (function(_this) {
return function(e) {
e.preventDefault();
if (_this._current > 0) {
return _this.prev();
}
};
})(this)).on("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='end']", (function(_this) {
return function(e) {
e.preventDefault();
return _this.end();
};
})(this)).on("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='pause-resume']", function(e) {
var $this;
e.preventDefault();
$this = $(this);
$this.text(_this._paused ? $this.data('pause-text') : $this.data('resume-text'));
if (_this._paused) {
return _this.resume();
} else {
return _this.pause();
}
});
};
Tour.prototype._initKeyboardNavigation = function() {
if (!this._options.keyboard) {
return;
}
return $(document).on("keyup.tour-" + this._options.name, (function(_this) {
return function(e) {
if (!e.which) {
return;
}
switch (e.which) {
case 39:
e.preventDefault();
if (_this._isLast()) {
return _this.next();
} else {
return _this.end();
}
break;
case 37:
e.preventDefault();
if (_this._current > 0) {
return _this.prev();
}
}
};
})(this));
};
Tour.prototype._makePromise = function(result) {
if (result && $.isFunction(result.then)) {
return result;
} else {
return null;
}
};
Tour.prototype._callOnPromiseDone = function(promise, cb, arg) {
if (promise) {
return promise.then((function(_this) {
return function(e) {
return cb.call(_this, arg);
};
})(this));
} else {
return cb.call(this, arg);
}
};
Tour.prototype._showBackground = function(step, data) {
var $backdrop, base, height, j, len, pos, ref, results, width;
height = $(document).height();
width = $(document).width();
ref = ['top', 'bottom', 'left', 'right'];
results = [];
for (j = 0, len = ref.length; j < len; j++) {
pos = ref[j];
$backdrop = (base = this.backdrops)[pos] != null ? base[pos] : base[pos] = $('
', {
"class": "tour-backdrop " + pos
});
$(step.backdropContainer).append($backdrop);
switch (pos) {
case 'top':
results.push($backdrop.height(data.offset.top > 0 ? data.offset.top : 0).width(width).offset({
top: 0,
left: 0
}));
break;
case 'bottom':
results.push($backdrop.offset({
top: data.offset.top + data.height,
left: 0
}).height(height - (data.offset.top + data.height)).width(width));
break;
case 'left':
results.push($backdrop.offset({
top: data.offset.top,
left: 0
}).height(data.height).width(data.offset.left > 0 ? data.offset.left : 0));
break;
case 'right':
results.push($backdrop.offset({
top: data.offset.top,
left: data.offset.left + data.width
}).height(data.height).width(width - (data.offset.left + data.width)));
break;
default:
results.push(void 0);
}
}
return results;
};
Tour.prototype._showOverlayElement = function(step) {
var $backdropElement, elementData;
$backdropElement = $(step.backdropElement);
if ($backdropElement.length === 0) {
elementData = {
width: 0,
height: 0,
offset: {
top: 0,
left: 0
}
};
} else {
elementData = {
width: $backdropElement.innerWidth(),
height: $backdropElement.innerHeight(),
offset: $backdropElement.offset()
};
$backdropElement.addClass('tour-step-backdrop');
if (step.backdropPadding) {
elementData = this._applyBackdropPadding(step.backdropPadding, elementData);
}
}
return this._showBackground(step, elementData);
};
Tour.prototype._hideOverlayElement = function(step) {
var $backdrop, pos, ref;
$(step.backdropElement).removeClass('tour-step-backdrop');
ref = this.backdrops;
for (pos in ref) {
$backdrop = ref[pos];
if ($backdrop && $backdrop.remove !== void 0) {
$backdrop.remove();
}
}
return this.backdrops = [];
};
Tour.prototype._applyBackdropPadding = function(padding, data) {
if (typeof padding === 'object') {
if (padding.top == null) {
padding.top = 0;
}
if (padding.right == null) {
padding.right = 0;
}
if (padding.bottom == null) {
padding.bottom = 0;
}
if (padding.left == null) {
padding.left = 0;
}
data.offset.top = data.offset.top - padding.top;
data.offset.left = data.offset.left - padding.left;
data.width = data.width + padding.left + padding.right;
data.height = data.height + padding.top + padding.bottom;
} else {
data.offset.top = data.offset.top - padding;
data.offset.left = data.offset.left - padding;
data.width = data.width + (padding * 2);
data.height = data.height + (padding * 2);
}
return data;
};
Tour.prototype._clearTimer = function() {
window.clearTimeout(this._timer);
this._timer = null;
return this._duration = null;
};
Tour.prototype._getProtocol = function(url) {
url = url.split('://');
if (url.length > 1) {
return url[0];
} else {
return 'http';
}
};
Tour.prototype._getHost = function(url) {
url = url.split('//');
url = url.length > 1 ? url[1] : url[0];
return url.split('/')[0];
};
Tour.prototype._getPath = function(path) {
return path.replace(/\/?$/, '').split('?')[0].split('#')[0];
};
Tour.prototype._getQuery = function(path) {
return this._getParams(path, '?');
};
Tour.prototype._getHash = function(path) {
return this._getParams(path, '#');
};
Tour.prototype._getParams = function(path, start) {
var j, len, param, params, paramsObject;
params = path.split(start);
if (params.length === 1) {
return {};
}
params = params[1].split('&');
paramsObject = {};
for (j = 0, len = params.length; j < len; j++) {
param = params[j];
param = param.split('=');
paramsObject[param[0]] = param[1] || '';
}
return paramsObject;
};
Tour.prototype._equal = function(obj1, obj2) {
var j, k, len, obj1Keys, obj2Keys, v;
if ({}.toString.call(obj1) === '[object Object]' && {}.toString.call(obj2) === '[object Object]') {
obj1Keys = Object.keys(obj1);
obj2Keys = Object.keys(obj2);
if (obj1Keys.length !== obj2Keys.length) {
return false;
}
for (k in obj1) {
v = obj1[k];
if (!this._equal(obj2[k], v)) {
return false;
}
}
return true;
} else if ({}.toString.call(obj1) === '[object Array]' && {}.toString.call(obj2) === '[object Array]') {
if (obj1.length !== obj2.length) {
return false;
}
for (k = j = 0, len = obj1.length; j < len; k = ++j) {
v = obj1[k];
if (!this._equal(v, obj2[k])) {
return false;
}
}
return true;
} else {
return obj1 === obj2;
}
};
return Tour;
})();
return Tour;
});