mirror of
https://github.com/documize/community.git
synced 2025-07-22 22:59:43 +02:00
removed unused libs
This commit is contained in:
parent
cc1c216754
commit
daf61dfe9f
14 changed files with 44 additions and 8237 deletions
|
@ -60,7 +60,7 @@ export default Component.extend({
|
|||
autoProcessQueue: true,
|
||||
|
||||
init: function () {
|
||||
this.on("success", function (file /*, response*/ ) {
|
||||
this.on("success", function (/*file, response*/ ) {
|
||||
});
|
||||
|
||||
this.on("queuecomplete", function () {
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
// https://documize.com
|
||||
|
||||
import { helper } from '@ember/component/helper';
|
||||
import dateUtil from '../utils/date';
|
||||
|
||||
export function formattedDate(params) {
|
||||
let format = params[1];
|
||||
|
|
|
@ -14,10 +14,6 @@
|
|||
@import "base.scss";
|
||||
@import "bootstrap.scss";
|
||||
|
||||
|
||||
@import "view/document/all.scss";
|
||||
|
||||
|
||||
@import "view/common.scss";
|
||||
@import "widget/widget.scss";
|
||||
@import "view/navigation.scss";
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
@import "toc.scss";
|
||||
@import "new-section.scss";
|
|
@ -55,3 +55,44 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.document-sidebar-toolbar {
|
||||
margin: 10px 0 0 0;
|
||||
padding: 10px 0;
|
||||
text-align: center;
|
||||
// background-color: $color-sidebar-toolbar;
|
||||
|
||||
> .round-button-mono {
|
||||
background-color: $color-white;
|
||||
border-color: $color-sidebar-border;
|
||||
|
||||
> .material-icons {
|
||||
color: $color-gray;
|
||||
@include ease-in();
|
||||
}
|
||||
|
||||
&:hover {
|
||||
> .material-icons {
|
||||
color: $color-link;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
> .selected {
|
||||
background-color: $color-primary;
|
||||
border-color: $color-primary;
|
||||
|
||||
> .material-icons {
|
||||
color: $color-off-white;
|
||||
@include ease-in();
|
||||
}
|
||||
|
||||
&:hover {
|
||||
> .material-icons {
|
||||
color: $color-white;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,48 +1,10 @@
|
|||
@import "add-section.scss";
|
||||
@import "doc-meta.scss";
|
||||
@import "doc-structure.scss";
|
||||
@import "doc-toc.scss";
|
||||
@import "section-editor.scss";
|
||||
@import "view-attachment.scss";
|
||||
@import "view-activity.scss";
|
||||
@import "view-revision.scss";
|
||||
@import "wysiwyg.scss";
|
||||
|
||||
|
||||
|
||||
.document-sidebar-toolbar {
|
||||
margin: 10px 0 0 0;
|
||||
padding: 10px 0;
|
||||
text-align: center;
|
||||
// background-color: $color-sidebar-toolbar;
|
||||
|
||||
> .round-button-mono {
|
||||
background-color: $color-white;
|
||||
border-color: $color-sidebar-border;
|
||||
|
||||
> .material-icons {
|
||||
color: $color-gray;
|
||||
@include ease-in();
|
||||
}
|
||||
|
||||
&:hover {
|
||||
> .material-icons {
|
||||
color: $color-link;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
> .selected {
|
||||
background-color: $color-primary;
|
||||
border-color: $color-primary;
|
||||
|
||||
> .material-icons {
|
||||
color: $color-off-white;
|
||||
@include ease-in();
|
||||
}
|
||||
|
||||
&:hover {
|
||||
> .material-icons {
|
||||
color: $color-white;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,14 +41,9 @@ module.exports = function (defaults) {
|
|||
}
|
||||
});
|
||||
|
||||
// dropdown/popup/dialog
|
||||
app.import('vendor/tether.js');
|
||||
app.import('vendor/drop.js');
|
||||
|
||||
app.import('vendor/datetimepicker.min.js');
|
||||
app.import('vendor/documize.js');
|
||||
app.import('vendor/dropzone.js');
|
||||
app.import('vendor/hoverIntent.js');
|
||||
app.import('vendor/is.js');
|
||||
app.import('vendor/keycloak.js');
|
||||
app.import('vendor/markdown-it.min.js');
|
||||
|
@ -58,12 +53,8 @@ module.exports = function (defaults) {
|
|||
app.import('vendor/slug.js');
|
||||
app.import('vendor/sortable.js');
|
||||
app.import('vendor/table-editor.min.js');
|
||||
app.import('vendor/tooltip.js');
|
||||
app.import('vendor/underscore.js');
|
||||
app.import('vendor/velocity.js');
|
||||
app.import('vendor/velocity.ui.js');
|
||||
app.import('vendor/waypoints.js');
|
||||
|
||||
app.import('vendor/bootstrap.bundle.min.js');
|
||||
|
||||
return app.toTree();
|
||||
|
|
561
gui/vendor/drop.js
vendored
561
gui/vendor/drop.js
vendored
|
@ -1,561 +0,0 @@
|
|||
// https://github.com/HubSpot/drop
|
||||
/*! tether-drop 1.4.1 */
|
||||
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(["tether"], factory);
|
||||
} else if (typeof exports === 'object') {
|
||||
module.exports = factory(require('tether'));
|
||||
} else {
|
||||
root.Drop = factory(root.Tether);
|
||||
}
|
||||
}(this, function(Tether) {
|
||||
|
||||
/* global Tether */
|
||||
'use strict';
|
||||
|
||||
var _bind = Function.prototype.bind;
|
||||
|
||||
var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();
|
||||
|
||||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
||||
|
||||
var _get = function get(_x2, _x3, _x4) { var _again = true; _function: while (_again) { var object = _x2, property = _x3, receiver = _x4; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x2 = parent; _x3 = property; _x4 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
var _Tether$Utils = Tether.Utils;
|
||||
var extend = _Tether$Utils.extend;
|
||||
var addClass = _Tether$Utils.addClass;
|
||||
var removeClass = _Tether$Utils.removeClass;
|
||||
var hasClass = _Tether$Utils.hasClass;
|
||||
var Evented = _Tether$Utils.Evented;
|
||||
|
||||
function sortAttach(str) {
|
||||
var _str$split = str.split(' ');
|
||||
|
||||
var _str$split2 = _slicedToArray(_str$split, 2);
|
||||
|
||||
var first = _str$split2[0];
|
||||
var second = _str$split2[1];
|
||||
|
||||
if (['left', 'right'].indexOf(first) >= 0) {
|
||||
var _ref = [second, first];
|
||||
first = _ref[0];
|
||||
second = _ref[1];
|
||||
}
|
||||
return [first, second].join(' ');
|
||||
}
|
||||
|
||||
function removeFromArray(arr, item) {
|
||||
var index = undefined;
|
||||
var results = [];
|
||||
while ((index = arr.indexOf(item)) !== -1) {
|
||||
results.push(arr.splice(index, 1));
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
var clickEvents = ['click'];
|
||||
if ('ontouchstart' in document.documentElement) {
|
||||
clickEvents.push('touchstart');
|
||||
}
|
||||
|
||||
var transitionEndEvents = {
|
||||
'WebkitTransition': 'webkitTransitionEnd',
|
||||
'MozTransition': 'transitionend',
|
||||
'OTransition': 'otransitionend',
|
||||
'transition': 'transitionend'
|
||||
};
|
||||
|
||||
var transitionEndEvent = '';
|
||||
for (var _name in transitionEndEvents) {
|
||||
if (({}).hasOwnProperty.call(transitionEndEvents, _name)) {
|
||||
var tempEl = document.createElement('p');
|
||||
if (typeof tempEl.style[_name] !== 'undefined') {
|
||||
transitionEndEvent = transitionEndEvents[_name];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var MIRROR_ATTACH = {
|
||||
left: 'right',
|
||||
right: 'left',
|
||||
top: 'bottom',
|
||||
bottom: 'top',
|
||||
middle: 'middle',
|
||||
center: 'center'
|
||||
};
|
||||
|
||||
var allDrops = {};
|
||||
|
||||
// Drop can be included in external libraries. Calling createContext gives you a fresh
|
||||
// copy of drop which won't interact with other copies on the page (beyond calling the document events).
|
||||
|
||||
function createContext() {
|
||||
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
||||
|
||||
var drop = function drop() {
|
||||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
return new (_bind.apply(DropInstance, [null].concat(args)))();
|
||||
};
|
||||
|
||||
extend(drop, {
|
||||
createContext: createContext,
|
||||
drops: [],
|
||||
defaults: {}
|
||||
});
|
||||
|
||||
var defaultOptions = {
|
||||
classPrefix: 'drop',
|
||||
defaults: {
|
||||
position: 'bottom left',
|
||||
openOn: 'click',
|
||||
beforeClose: null,
|
||||
constrainToScrollParent: true,
|
||||
constrainToWindow: true,
|
||||
classes: '',
|
||||
remove: false,
|
||||
openDelay: 0,
|
||||
closeDelay: 50,
|
||||
// inherited from openDelay and closeDelay if not explicitly defined
|
||||
focusDelay: null,
|
||||
blurDelay: null,
|
||||
hoverOpenDelay: null,
|
||||
hoverCloseDelay: null,
|
||||
tetherOptions: {}
|
||||
}
|
||||
};
|
||||
|
||||
extend(drop, defaultOptions, options);
|
||||
extend(drop.defaults, defaultOptions.defaults, options.defaults);
|
||||
|
||||
if (typeof allDrops[drop.classPrefix] === 'undefined') {
|
||||
allDrops[drop.classPrefix] = [];
|
||||
}
|
||||
|
||||
drop.updateBodyClasses = function () {
|
||||
// There is only one body, so despite the context concept, we still iterate through all
|
||||
// drops which share our classPrefix.
|
||||
|
||||
var anyOpen = false;
|
||||
var drops = allDrops[drop.classPrefix];
|
||||
var len = drops.length;
|
||||
for (var i = 0; i < len; ++i) {
|
||||
if (drops[i].isOpened()) {
|
||||
anyOpen = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (anyOpen) {
|
||||
addClass(document.body, drop.classPrefix + '-open');
|
||||
} else {
|
||||
removeClass(document.body, drop.classPrefix + '-open');
|
||||
}
|
||||
};
|
||||
|
||||
var DropInstance = (function (_Evented) {
|
||||
_inherits(DropInstance, _Evented);
|
||||
|
||||
function DropInstance(opts) {
|
||||
_classCallCheck(this, DropInstance);
|
||||
|
||||
_get(Object.getPrototypeOf(DropInstance.prototype), 'constructor', this).call(this);
|
||||
this.options = extend({}, drop.defaults, opts);
|
||||
this.target = this.options.target;
|
||||
|
||||
if (typeof this.target === 'undefined') {
|
||||
throw new Error('Drop Error: You must provide a target.');
|
||||
}
|
||||
|
||||
var dataPrefix = 'data-' + drop.classPrefix;
|
||||
|
||||
var contentAttr = this.target.getAttribute(dataPrefix);
|
||||
if (contentAttr && this.options.content == null) {
|
||||
this.options.content = contentAttr;
|
||||
}
|
||||
|
||||
var attrsOverride = ['position', 'openOn'];
|
||||
for (var i = 0; i < attrsOverride.length; ++i) {
|
||||
|
||||
var override = this.target.getAttribute(dataPrefix + '-' + attrsOverride[i]);
|
||||
if (override && this.options[attrsOverride[i]] == null) {
|
||||
this.options[attrsOverride[i]] = override;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.options.classes && this.options.addTargetClasses !== false) {
|
||||
addClass(this.target, this.options.classes);
|
||||
}
|
||||
|
||||
drop.drops.push(this);
|
||||
allDrops[drop.classPrefix].push(this);
|
||||
|
||||
this._boundEvents = [];
|
||||
this.bindMethods();
|
||||
this.setupElements();
|
||||
this.setupEvents();
|
||||
this.setupTether();
|
||||
}
|
||||
|
||||
_createClass(DropInstance, [{
|
||||
key: '_on',
|
||||
value: function _on(element, event, handler) {
|
||||
this._boundEvents.push({ element: element, event: event, handler: handler });
|
||||
element.addEventListener(event, handler);
|
||||
}
|
||||
}, {
|
||||
key: 'bindMethods',
|
||||
value: function bindMethods() {
|
||||
this.transitionEndHandler = this._transitionEndHandler.bind(this);
|
||||
}
|
||||
}, {
|
||||
key: 'setupElements',
|
||||
value: function setupElements() {
|
||||
var _this = this;
|
||||
|
||||
this.drop = document.createElement('div');
|
||||
addClass(this.drop, drop.classPrefix);
|
||||
|
||||
if (this.options.classes) {
|
||||
addClass(this.drop, this.options.classes);
|
||||
}
|
||||
|
||||
this.content = document.createElement('div');
|
||||
addClass(this.content, drop.classPrefix + '-content');
|
||||
|
||||
if (typeof this.options.content === 'function') {
|
||||
var generateAndSetContent = function generateAndSetContent() {
|
||||
// content function might return a string or an element
|
||||
var contentElementOrHTML = _this.options.content.call(_this, _this);
|
||||
|
||||
if (typeof contentElementOrHTML === 'string') {
|
||||
_this.content.innerHTML = contentElementOrHTML;
|
||||
} else if (typeof contentElementOrHTML === 'object') {
|
||||
_this.content.innerHTML = '';
|
||||
_this.content.appendChild(contentElementOrHTML);
|
||||
} else {
|
||||
throw new Error('Drop Error: Content function should return a string or HTMLElement.');
|
||||
}
|
||||
};
|
||||
|
||||
generateAndSetContent();
|
||||
this.on('open', generateAndSetContent.bind(this));
|
||||
} else if (typeof this.options.content === 'object') {
|
||||
this.content.appendChild(this.options.content);
|
||||
} else {
|
||||
this.content.innerHTML = this.options.content;
|
||||
}
|
||||
|
||||
this.drop.appendChild(this.content);
|
||||
}
|
||||
}, {
|
||||
key: 'setupTether',
|
||||
value: function setupTether() {
|
||||
// Tether expects two attachment points, one in the target element, one in the
|
||||
// drop. We use a single one, and use the order as well, to allow us to put
|
||||
// the drop on either side of any of the four corners. This magic converts between
|
||||
// the two:
|
||||
var dropAttach = this.options.position.split(' ');
|
||||
dropAttach[0] = MIRROR_ATTACH[dropAttach[0]];
|
||||
dropAttach = dropAttach.join(' ');
|
||||
|
||||
var constraints = [];
|
||||
if (this.options.constrainToScrollParent) {
|
||||
constraints.push({
|
||||
to: 'scrollParent',
|
||||
pin: 'top, bottom',
|
||||
attachment: 'together none'
|
||||
});
|
||||
} else {
|
||||
// To get 'out of bounds' classes
|
||||
constraints.push({
|
||||
to: 'scrollParent'
|
||||
});
|
||||
}
|
||||
|
||||
if (this.options.constrainToWindow !== false) {
|
||||
constraints.push({
|
||||
to: 'window',
|
||||
attachment: 'together'
|
||||
});
|
||||
} else {
|
||||
// To get 'out of bounds' classes
|
||||
constraints.push({
|
||||
to: 'window'
|
||||
});
|
||||
}
|
||||
|
||||
var opts = {
|
||||
element: this.drop,
|
||||
target: this.target,
|
||||
attachment: sortAttach(dropAttach),
|
||||
targetAttachment: sortAttach(this.options.position),
|
||||
classPrefix: drop.classPrefix,
|
||||
offset: '0 0',
|
||||
targetOffset: '0 0',
|
||||
enabled: false,
|
||||
constraints: constraints,
|
||||
addTargetClasses: this.options.addTargetClasses
|
||||
};
|
||||
|
||||
if (this.options.tetherOptions !== false) {
|
||||
this.tether = new Tether(extend({}, opts, this.options.tetherOptions));
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'setupEvents',
|
||||
value: function setupEvents() {
|
||||
var _this2 = this;
|
||||
|
||||
if (!this.options.openOn) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.options.openOn === 'always') {
|
||||
setTimeout(this.open.bind(this));
|
||||
return;
|
||||
}
|
||||
|
||||
var events = this.options.openOn.split(' ');
|
||||
|
||||
if (events.indexOf('click') >= 0) {
|
||||
var openHandler = function openHandler(event) {
|
||||
_this2.toggle(event);
|
||||
event.preventDefault();
|
||||
};
|
||||
|
||||
var closeHandler = function closeHandler(event) {
|
||||
if (!_this2.isOpened()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Clicking inside dropdown
|
||||
if (event.target === _this2.drop || _this2.drop.contains(event.target)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Clicking target
|
||||
if (event.target === _this2.target || _this2.target.contains(event.target)) {
|
||||
return;
|
||||
}
|
||||
|
||||
_this2.close(event);
|
||||
};
|
||||
|
||||
for (var i = 0; i < clickEvents.length; ++i) {
|
||||
var clickEvent = clickEvents[i];
|
||||
this._on(this.target, clickEvent, openHandler);
|
||||
this._on(document, clickEvent, closeHandler);
|
||||
}
|
||||
}
|
||||
|
||||
var inTimeout = null;
|
||||
var outTimeout = null;
|
||||
|
||||
var inHandler = function inHandler(event) {
|
||||
if (outTimeout !== null) {
|
||||
clearTimeout(outTimeout);
|
||||
} else {
|
||||
inTimeout = setTimeout(function () {
|
||||
_this2.open(event);
|
||||
inTimeout = null;
|
||||
}, (event.type === 'focus' ? _this2.options.focusDelay : _this2.options.hoverOpenDelay) || _this2.options.openDelay);
|
||||
}
|
||||
};
|
||||
|
||||
var outHandler = function outHandler(event) {
|
||||
if (inTimeout !== null) {
|
||||
clearTimeout(inTimeout);
|
||||
} else {
|
||||
outTimeout = setTimeout(function () {
|
||||
_this2.close(event);
|
||||
outTimeout = null;
|
||||
}, (event.type === 'blur' ? _this2.options.blurDelay : _this2.options.hoverCloseDelay) || _this2.options.closeDelay);
|
||||
}
|
||||
};
|
||||
|
||||
if (events.indexOf('hover') >= 0) {
|
||||
this._on(this.target, 'mouseover', inHandler);
|
||||
this._on(this.drop, 'mouseover', inHandler);
|
||||
this._on(this.target, 'mouseout', outHandler);
|
||||
this._on(this.drop, 'mouseout', outHandler);
|
||||
}
|
||||
|
||||
if (events.indexOf('focus') >= 0) {
|
||||
this._on(this.target, 'focus', inHandler);
|
||||
this._on(this.drop, 'focus', inHandler);
|
||||
this._on(this.target, 'blur', outHandler);
|
||||
this._on(this.drop, 'blur', outHandler);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'isOpened',
|
||||
value: function isOpened() {
|
||||
if (this.drop) {
|
||||
return hasClass(this.drop, drop.classPrefix + '-open');
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'toggle',
|
||||
value: function toggle(event) {
|
||||
if (this.isOpened()) {
|
||||
this.close(event);
|
||||
} else {
|
||||
this.open(event);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'open',
|
||||
value: function open(event) {
|
||||
var _this3 = this;
|
||||
|
||||
/* eslint no-unused-vars: 0 */
|
||||
if (this.isOpened()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.drop.parentNode) {
|
||||
document.body.appendChild(this.drop);
|
||||
}
|
||||
|
||||
if (typeof this.tether !== 'undefined') {
|
||||
this.tether.enable();
|
||||
}
|
||||
|
||||
addClass(this.drop, drop.classPrefix + '-open');
|
||||
addClass(this.drop, drop.classPrefix + '-open-transitionend');
|
||||
|
||||
setTimeout(function () {
|
||||
if (_this3.drop) {
|
||||
addClass(_this3.drop, drop.classPrefix + '-after-open');
|
||||
}
|
||||
});
|
||||
|
||||
if (typeof this.tether !== 'undefined') {
|
||||
this.tether.position();
|
||||
}
|
||||
|
||||
this.trigger('open');
|
||||
|
||||
drop.updateBodyClasses();
|
||||
}
|
||||
}, {
|
||||
key: '_transitionEndHandler',
|
||||
value: function _transitionEndHandler(e) {
|
||||
if (e.target !== e.currentTarget) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!hasClass(this.drop, drop.classPrefix + '-open')) {
|
||||
removeClass(this.drop, drop.classPrefix + '-open-transitionend');
|
||||
}
|
||||
this.drop.removeEventListener(transitionEndEvent, this.transitionEndHandler);
|
||||
}
|
||||
}, {
|
||||
key: 'beforeCloseHandler',
|
||||
value: function beforeCloseHandler(event) {
|
||||
var shouldClose = true;
|
||||
|
||||
if (!this.isClosing && typeof this.options.beforeClose === 'function') {
|
||||
this.isClosing = true;
|
||||
shouldClose = this.options.beforeClose(event, this) !== false;
|
||||
}
|
||||
|
||||
this.isClosing = false;
|
||||
|
||||
return shouldClose;
|
||||
}
|
||||
}, {
|
||||
key: 'close',
|
||||
value: function close(event) {
|
||||
if (!this.isOpened()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.beforeCloseHandler(event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
removeClass(this.drop, drop.classPrefix + '-open');
|
||||
removeClass(this.drop, drop.classPrefix + '-after-open');
|
||||
|
||||
this.drop.addEventListener(transitionEndEvent, this.transitionEndHandler);
|
||||
|
||||
this.trigger('close');
|
||||
|
||||
if (typeof this.tether !== 'undefined') {
|
||||
this.tether.disable();
|
||||
}
|
||||
|
||||
drop.updateBodyClasses();
|
||||
|
||||
if (this.options.remove) {
|
||||
this.remove(event);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'remove',
|
||||
value: function remove(event) {
|
||||
this.close(event);
|
||||
if (this.drop.parentNode) {
|
||||
this.drop.parentNode.removeChild(this.drop);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'position',
|
||||
value: function position() {
|
||||
if (this.isOpened() && typeof this.tether !== 'undefined') {
|
||||
this.tether.position();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'destroy',
|
||||
value: function destroy() {
|
||||
this.remove();
|
||||
|
||||
if (typeof this.tether !== 'undefined') {
|
||||
this.tether.destroy();
|
||||
}
|
||||
|
||||
for (var i = 0; i < this._boundEvents.length; ++i) {
|
||||
var _boundEvents$i = this._boundEvents[i];
|
||||
var element = _boundEvents$i.element;
|
||||
var _event = _boundEvents$i.event;
|
||||
var handler = _boundEvents$i.handler;
|
||||
|
||||
element.removeEventListener(_event, handler);
|
||||
}
|
||||
|
||||
this._boundEvents = [];
|
||||
|
||||
this.tether = null;
|
||||
this.drop = null;
|
||||
this.content = null;
|
||||
this.target = null;
|
||||
|
||||
removeFromArray(allDrops[drop.classPrefix], this);
|
||||
removeFromArray(drop.drops, this);
|
||||
}
|
||||
}]);
|
||||
|
||||
return DropInstance;
|
||||
})(Evented);
|
||||
|
||||
return drop;
|
||||
}
|
||||
|
||||
var Drop = createContext();
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
Drop.updateBodyClasses();
|
||||
});
|
||||
return Drop;
|
||||
|
||||
}));
|
158
gui/vendor/hoverIntent.js
vendored
158
gui/vendor/hoverIntent.js
vendored
|
@ -1,158 +0,0 @@
|
|||
/*!
|
||||
* hoverIntent v1.8.1 // 2014.08.11 // jQuery v1.9.1+
|
||||
* http://briancherne.github.io/jquery-hoverIntent/
|
||||
*
|
||||
* You may use hoverIntent under the terms of the MIT license. Basically that
|
||||
* means you are free to use hoverIntent as long as this header is left intact.
|
||||
* Copyright 2007, 2014 Brian Cherne
|
||||
*/
|
||||
|
||||
/* hoverIntent is similar to jQuery's built-in "hover" method except that
|
||||
* instead of firing the handlerIn function immediately, hoverIntent checks
|
||||
* to see if the user's mouse has slowed down (beneath the sensitivity
|
||||
* threshold) before firing the event. The handlerOut function is only
|
||||
* called after a matching handlerIn.
|
||||
*
|
||||
* // basic usage ... just like .hover()
|
||||
* .hoverIntent( handlerIn, handlerOut )
|
||||
* .hoverIntent( handlerInOut )
|
||||
*
|
||||
* // basic usage ... with event delegation!
|
||||
* .hoverIntent( handlerIn, handlerOut, selector )
|
||||
* .hoverIntent( handlerInOut, selector )
|
||||
*
|
||||
* // using a basic configuration object
|
||||
* .hoverIntent( config )
|
||||
*
|
||||
* @param handlerIn function OR configuration object
|
||||
* @param handlerOut function OR selector for delegation OR undefined
|
||||
* @param selector selector OR undefined
|
||||
* @author Brian Cherne <brian(at)cherne(dot)net>
|
||||
*/
|
||||
|
||||
(function(factory) {
|
||||
'use strict';
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(['jquery'], factory);
|
||||
} else if (jQuery && !jQuery.fn.hoverIntent) {
|
||||
factory(jQuery);
|
||||
}
|
||||
})(function($) {
|
||||
'use strict';
|
||||
|
||||
// default configuration values
|
||||
var _cfg = {
|
||||
interval: 100,
|
||||
sensitivity: 6,
|
||||
timeout: 0
|
||||
};
|
||||
|
||||
// counter used to generate an ID for each instance
|
||||
var INSTANCE_COUNT = 0;
|
||||
|
||||
// current X and Y position of mouse, updated during mousemove tracking (shared across instances)
|
||||
var cX, cY;
|
||||
|
||||
// saves the current pointer position coordinates based on the given mousemove event
|
||||
var track = function(ev) {
|
||||
cX = ev.pageX;
|
||||
cY = ev.pageY;
|
||||
};
|
||||
|
||||
// compares current and previous mouse positions
|
||||
var compare = function(ev,$el,s,cfg) {
|
||||
// compare mouse positions to see if pointer has slowed enough to trigger `over` function
|
||||
if ( Math.sqrt( (s.pX-cX)*(s.pX-cX) + (s.pY-cY)*(s.pY-cY) ) < cfg.sensitivity ) {
|
||||
$el.off(s.event,track);
|
||||
delete s.timeoutId;
|
||||
// set hoverIntent state as active for this element (permits `out` handler to trigger)
|
||||
s.isActive = true;
|
||||
// overwrite old mouseenter event coordinates with most recent pointer position
|
||||
ev.pageX = cX; ev.pageY = cY;
|
||||
// clear coordinate data from state object
|
||||
delete s.pX; delete s.pY;
|
||||
return cfg.over.apply($el[0],[ev]);
|
||||
} else {
|
||||
// set previous coordinates for next comparison
|
||||
s.pX = cX; s.pY = cY;
|
||||
// use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
|
||||
s.timeoutId = setTimeout( function(){compare(ev, $el, s, cfg);} , cfg.interval );
|
||||
}
|
||||
};
|
||||
|
||||
// triggers given `out` function at configured `timeout` after a mouseleave and clears state
|
||||
var delay = function(ev,$el,s,out) {
|
||||
delete $el.data('hoverIntent')[s.id];
|
||||
return out.apply($el[0],[ev]);
|
||||
};
|
||||
|
||||
$.fn.hoverIntent = function(handlerIn,handlerOut,selector) {
|
||||
// instance ID, used as a key to store and retrieve state information on an element
|
||||
var instanceId = INSTANCE_COUNT++;
|
||||
|
||||
// extend the default configuration and parse parameters
|
||||
var cfg = $.extend({}, _cfg);
|
||||
if ( $.isPlainObject(handlerIn) ) {
|
||||
cfg = $.extend(cfg, handlerIn);
|
||||
if ( !$.isFunction(cfg.out) ) {
|
||||
cfg.out = cfg.over;
|
||||
}
|
||||
} else if ( $.isFunction(handlerOut) ) {
|
||||
cfg = $.extend(cfg, { over: handlerIn, out: handlerOut, selector: selector } );
|
||||
} else {
|
||||
cfg = $.extend(cfg, { over: handlerIn, out: handlerIn, selector: handlerOut } );
|
||||
}
|
||||
|
||||
// A private function for handling mouse 'hovering'
|
||||
var handleHover = function(e) {
|
||||
// cloned event to pass to handlers (copy required for event object to be passed in IE)
|
||||
var ev = $.extend({},e);
|
||||
|
||||
// the current target of the mouse event, wrapped in a jQuery object
|
||||
var $el = $(this);
|
||||
|
||||
// read hoverIntent data from element (or initialize if not present)
|
||||
var hoverIntentData = $el.data('hoverIntent');
|
||||
if (!hoverIntentData) { $el.data('hoverIntent', (hoverIntentData = {})); }
|
||||
|
||||
// read per-instance state from element (or initialize if not present)
|
||||
var state = hoverIntentData[instanceId];
|
||||
if (!state) { hoverIntentData[instanceId] = state = { id: instanceId }; }
|
||||
|
||||
// state properties:
|
||||
// id = instance ID, used to clean up data
|
||||
// timeoutId = timeout ID, reused for tracking mouse position and delaying "out" handler
|
||||
// isActive = plugin state, true after `over` is called just until `out` is called
|
||||
// pX, pY = previously-measured pointer coordinates, updated at each polling interval
|
||||
// event = string representing the namespaced event used for mouse tracking
|
||||
|
||||
// clear any existing timeout
|
||||
if (state.timeoutId) { state.timeoutId = clearTimeout(state.timeoutId); }
|
||||
|
||||
// namespaced event used to register and unregister mousemove tracking
|
||||
var mousemove = state.event = 'mousemove.hoverIntent.hoverIntent'+instanceId;
|
||||
|
||||
// handle the event, based on its type
|
||||
if (e.type === 'mouseenter') {
|
||||
// do nothing if already active
|
||||
if (state.isActive) { return; }
|
||||
// set "previous" X and Y position based on initial entry point
|
||||
state.pX = ev.pageX; state.pY = ev.pageY;
|
||||
// update "current" X and Y position based on mousemove
|
||||
$el.off(mousemove,track).on(mousemove,track);
|
||||
// start polling interval (self-calling timeout) to compare mouse coordinates over time
|
||||
state.timeoutId = setTimeout( function(){compare(ev,$el,state,cfg);} , cfg.interval );
|
||||
} else { // "mouseleave"
|
||||
// do nothing if not already active
|
||||
if (!state.isActive) { return; }
|
||||
// unbind expensive mousemove event
|
||||
$el.off(mousemove,track);
|
||||
// if hoverIntent state is true, then call the mouseOut function after the specified delay
|
||||
state.timeoutId = setTimeout( function(){delay(ev,$el,state,cfg.out);} , cfg.timeout );
|
||||
}
|
||||
};
|
||||
|
||||
// listen for mouseenter and mouseleave
|
||||
return this.on({'mouseenter.hoverIntent':handleHover,'mouseleave.hoverIntent':handleHover}, cfg.selector);
|
||||
};
|
||||
});
|
1811
gui/vendor/tether.js
vendored
1811
gui/vendor/tether.js
vendored
File diff suppressed because it is too large
Load diff
140
gui/vendor/tooltip.js
vendored
140
gui/vendor/tooltip.js
vendored
|
@ -1,140 +0,0 @@
|
|||
// https://github.com/HubSpot/tooltip
|
||||
|
||||
/*! tether-tooltip 1.1.0 */
|
||||
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(["tether-drop","tether"], factory);
|
||||
} else if (typeof exports === 'object') {
|
||||
module.exports = factory(require('tether-drop'), require('tether'));
|
||||
} else {
|
||||
root.Tooltip = factory(root.Drop, root.Tether);
|
||||
}
|
||||
}(this, function(Drop, Tether) {
|
||||
|
||||
/* global Tether Drop */
|
||||
|
||||
'use strict';
|
||||
|
||||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
|
||||
|
||||
var extend = Tether.Utils.extend;
|
||||
|
||||
var _Drop = Drop.createContext({
|
||||
classPrefix: 'tooltip'
|
||||
});
|
||||
|
||||
var defaults = {
|
||||
position: 'top center',
|
||||
openOn: 'hover',
|
||||
classes: 'tooltip-theme-arrows',
|
||||
constrainToWindow: true,
|
||||
constrainToScrollParent: false
|
||||
};
|
||||
|
||||
var tooltipCount = 0;
|
||||
|
||||
var Tooltip = (function () {
|
||||
function Tooltip(options) {
|
||||
_classCallCheck(this, Tooltip);
|
||||
|
||||
this.options = options;
|
||||
|
||||
if (!this.options.target) {
|
||||
throw new Error('Tooltip Error: You must provide a target for Tooltip to attach to');
|
||||
}
|
||||
|
||||
var position = this.options.target.getAttribute('data-tooltip-position');
|
||||
if (position) {
|
||||
if (typeof this.options.position === 'undefined') {
|
||||
this.options.position = position;
|
||||
}
|
||||
}
|
||||
|
||||
var content = this.options.target.getAttribute('data-tooltip');
|
||||
|
||||
if (content) {
|
||||
if (typeof this.options.content === 'undefined') {
|
||||
var contentEl = document.createElement('div');
|
||||
contentEl.innerHTML = content;
|
||||
|
||||
// Add ARIA attributes (see #50)
|
||||
contentEl.setAttribute('role', 'tooltip');
|
||||
contentEl.id = 'drop-tooltip-' + tooltipCount;
|
||||
this.options.target.setAttribute('aria-describedby', contentEl.id);
|
||||
tooltipCount += 1;
|
||||
|
||||
this.options.content = contentEl;
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.options.content) {
|
||||
throw new Error('Tooltip Error: You must provide content for Tooltip to display');
|
||||
}
|
||||
|
||||
this.options = extend({}, defaults, this.options);
|
||||
|
||||
this.drop = new _Drop(this.options);
|
||||
}
|
||||
|
||||
_createClass(Tooltip, [{
|
||||
key: 'close',
|
||||
value: function close() {
|
||||
this.drop.close();
|
||||
}
|
||||
}, {
|
||||
key: 'open',
|
||||
value: function open() {
|
||||
this.drop.open();
|
||||
}
|
||||
}, {
|
||||
key: 'toggle',
|
||||
value: function toggle() {
|
||||
this.drop.toggle();
|
||||
}
|
||||
}, {
|
||||
key: 'remove',
|
||||
value: function remove() {
|
||||
this.drop.remove();
|
||||
}
|
||||
}, {
|
||||
key: 'destroy',
|
||||
value: function destroy() {
|
||||
this.drop.destroy();
|
||||
}
|
||||
}, {
|
||||
key: 'position',
|
||||
value: function position() {
|
||||
this.drop.position();
|
||||
}
|
||||
}]);
|
||||
|
||||
return Tooltip;
|
||||
})();
|
||||
|
||||
var initialized = [];
|
||||
|
||||
Tooltip.init = function () {
|
||||
var tooltipElements = document.querySelectorAll('[data-tooltip]');
|
||||
var len = tooltipElements.length;
|
||||
for (var i = 0; i < len; ++i) {
|
||||
var el = tooltipElements[i];
|
||||
if (initialized.indexOf(el) === -1) {
|
||||
new Tooltip({
|
||||
target: el
|
||||
});
|
||||
initialized.push(el);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
if (Tooltip.autoinit !== false) {
|
||||
Tooltip.init();
|
||||
}
|
||||
});
|
||||
return Tooltip;
|
||||
|
||||
}));
|
4706
gui/vendor/velocity.js
vendored
4706
gui/vendor/velocity.js
vendored
File diff suppressed because it is too large
Load diff
804
gui/vendor/velocity.ui.js
vendored
804
gui/vendor/velocity.ui.js
vendored
|
@ -1,804 +0,0 @@
|
|||
/**********************
|
||||
Velocity UI Pack
|
||||
**********************/
|
||||
|
||||
/* VelocityJS.org UI Pack (5.2.0). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License. Portions copyright Daniel Eden, Christian Pucci. */
|
||||
|
||||
(function(factory) {
|
||||
"use strict";
|
||||
/* CommonJS module. */
|
||||
if (typeof require === "function" && typeof exports === "object") {
|
||||
module.exports = factory();
|
||||
/* AMD module. */
|
||||
} else if (typeof define === "function" && define.amd) {
|
||||
define(["velocity"], factory);
|
||||
/* Browser globals. */
|
||||
} else {
|
||||
factory();
|
||||
}
|
||||
}(function() {
|
||||
"use strict";
|
||||
return function(global, window, document, undefined) {
|
||||
|
||||
/*************
|
||||
Checks
|
||||
*************/
|
||||
var Velocity = global.Velocity;
|
||||
|
||||
if (!Velocity || !Velocity.Utilities) {
|
||||
if (window.console) {
|
||||
console.log("Velocity UI Pack: Velocity must be loaded first. Aborting.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
var $ = Velocity.Utilities;
|
||||
|
||||
var velocityVersion = Velocity.version,
|
||||
requiredVersion = {major: 1, minor: 1, patch: 0};
|
||||
|
||||
function greaterSemver(primary, secondary) {
|
||||
var versionInts = [];
|
||||
|
||||
if (!primary || !secondary) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$.each([primary, secondary], function(i, versionObject) {
|
||||
var versionIntsComponents = [];
|
||||
|
||||
$.each(versionObject, function(component, value) {
|
||||
while (value.toString().length < 5) {
|
||||
value = "0" + value;
|
||||
}
|
||||
versionIntsComponents.push(value);
|
||||
});
|
||||
|
||||
versionInts.push(versionIntsComponents.join(""));
|
||||
});
|
||||
|
||||
return (parseFloat(versionInts[0]) > parseFloat(versionInts[1]));
|
||||
}
|
||||
|
||||
if (greaterSemver(requiredVersion, velocityVersion)) {
|
||||
var abortError = "Velocity UI Pack: You need to update Velocity (velocity.js) to a newer version. Visit http://github.com/julianshapiro/velocity.";
|
||||
alert(abortError);
|
||||
throw new Error(abortError);
|
||||
}
|
||||
|
||||
/************************
|
||||
Effect Registration
|
||||
************************/
|
||||
|
||||
/* Note: RegisterUI is a legacy name. */
|
||||
Velocity.RegisterEffect = Velocity.RegisterUI = function(effectName, properties) {
|
||||
/* Animate the expansion/contraction of the elements' parent's height for In/Out effects. */
|
||||
function animateParentHeight(elements, direction, totalDuration, stagger) {
|
||||
var totalHeightDelta = 0,
|
||||
parentNode;
|
||||
|
||||
/* Sum the total height (including padding and margin) of all targeted elements. */
|
||||
$.each(elements.nodeType ? [elements] : elements, function(i, element) {
|
||||
if (stagger) {
|
||||
/* Increase the totalDuration by the successive delay amounts produced by the stagger option. */
|
||||
totalDuration += i * stagger;
|
||||
}
|
||||
|
||||
parentNode = element.parentNode;
|
||||
|
||||
var propertiesToSum = ["height", "paddingTop", "paddingBottom", "marginTop", "marginBottom"];
|
||||
|
||||
/* If box-sizing is border-box, the height already includes padding and margin */
|
||||
if (Velocity.CSS.getPropertyValue(element, "boxSizing").toString().toLowerCase() === "border-box") {
|
||||
propertiesToSum = ["height"];
|
||||
}
|
||||
|
||||
$.each(propertiesToSum, function(i, property) {
|
||||
totalHeightDelta += parseFloat(Velocity.CSS.getPropertyValue(element, property));
|
||||
});
|
||||
});
|
||||
|
||||
/* Animate the parent element's height adjustment (with a varying duration multiplier for aesthetic benefits). */
|
||||
Velocity.animate(
|
||||
parentNode,
|
||||
{height: (direction === "In" ? "+" : "-") + "=" + totalHeightDelta},
|
||||
{queue: false, easing: "ease-in-out", duration: totalDuration * (direction === "In" ? 0.6 : 1)}
|
||||
);
|
||||
}
|
||||
|
||||
/* Register a custom redirect for each effect. */
|
||||
Velocity.Redirects[effectName] = function(element, redirectOptions, elementsIndex, elementsSize, elements, promiseData, loop) {
|
||||
var finalElement = (elementsIndex === elementsSize - 1),
|
||||
totalDuration = 0;
|
||||
|
||||
loop = loop || properties.loop;
|
||||
if (typeof properties.defaultDuration === "function") {
|
||||
properties.defaultDuration = properties.defaultDuration.call(elements, elements);
|
||||
} else {
|
||||
properties.defaultDuration = parseFloat(properties.defaultDuration);
|
||||
}
|
||||
|
||||
/* Get the total duration used, so we can share it out with everything that doesn't have a duration */
|
||||
for (var callIndex = 0; callIndex < properties.calls.length; callIndex++) {
|
||||
durationPercentage = properties.calls[callIndex][1];
|
||||
if (typeof durationPercentage === "number") {
|
||||
totalDuration += durationPercentage;
|
||||
}
|
||||
}
|
||||
var shareDuration = totalDuration >= 1 ? 0 : properties.calls.length ? (1 - totalDuration) / properties.calls.length : 1;
|
||||
|
||||
/* Iterate through each effect's call array. */
|
||||
for (callIndex = 0; callIndex < properties.calls.length; callIndex++) {
|
||||
var call = properties.calls[callIndex],
|
||||
propertyMap = call[0],
|
||||
redirectDuration = 1000,
|
||||
durationPercentage = call[1],
|
||||
callOptions = call[2] || {},
|
||||
opts = {};
|
||||
|
||||
if (redirectOptions.duration !== undefined) {
|
||||
redirectDuration = redirectOptions.duration;
|
||||
} else if (properties.defaultDuration !== undefined) {
|
||||
redirectDuration = properties.defaultDuration;
|
||||
}
|
||||
|
||||
/* Assign the whitelisted per-call options. */
|
||||
opts.duration = redirectDuration * (typeof durationPercentage === "number" ? durationPercentage : shareDuration);
|
||||
opts.queue = redirectOptions.queue || "";
|
||||
opts.easing = callOptions.easing || "ease";
|
||||
opts.delay = parseFloat(callOptions.delay) || 0;
|
||||
opts.loop = !properties.loop && callOptions.loop;
|
||||
opts._cacheValues = callOptions._cacheValues || true;
|
||||
|
||||
/* Special processing for the first effect call. */
|
||||
if (callIndex === 0) {
|
||||
/* If a delay was passed into the redirect, combine it with the first call's delay. */
|
||||
opts.delay += (parseFloat(redirectOptions.delay) || 0);
|
||||
|
||||
if (elementsIndex === 0) {
|
||||
opts.begin = function() {
|
||||
/* Only trigger a begin callback on the first effect call with the first element in the set. */
|
||||
if (redirectOptions.begin) {
|
||||
redirectOptions.begin.call(elements, elements);
|
||||
}
|
||||
|
||||
var direction = effectName.match(/(In|Out)$/);
|
||||
|
||||
/* Make "in" transitioning elements invisible immediately so that there's no FOUC between now
|
||||
and the first RAF tick. */
|
||||
if ((direction && direction[0] === "In") && propertyMap.opacity !== undefined) {
|
||||
$.each(elements.nodeType ? [elements] : elements, function(i, element) {
|
||||
Velocity.CSS.setPropertyValue(element, "opacity", 0);
|
||||
});
|
||||
}
|
||||
|
||||
/* Only trigger animateParentHeight() if we're using an In/Out transition. */
|
||||
if (redirectOptions.animateParentHeight && direction) {
|
||||
animateParentHeight(elements, direction[0], redirectDuration + opts.delay, redirectOptions.stagger);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/* If the user isn't overriding the display option, default to "auto" for "In"-suffixed transitions. */
|
||||
if (redirectOptions.display !== null) {
|
||||
if (redirectOptions.display !== undefined && redirectOptions.display !== "none") {
|
||||
opts.display = redirectOptions.display;
|
||||
} else if (/In$/.test(effectName)) {
|
||||
/* Inline elements cannot be subjected to transforms, so we switch them to inline-block. */
|
||||
var defaultDisplay = Velocity.CSS.Values.getDisplayType(element);
|
||||
opts.display = (defaultDisplay === "inline") ? "inline-block" : defaultDisplay;
|
||||
}
|
||||
}
|
||||
|
||||
if (redirectOptions.visibility && redirectOptions.visibility !== "hidden") {
|
||||
opts.visibility = redirectOptions.visibility;
|
||||
}
|
||||
}
|
||||
|
||||
/* Special processing for the last effect call. */
|
||||
if (callIndex === properties.calls.length - 1) {
|
||||
/* Append promise resolving onto the user's redirect callback. */
|
||||
var injectFinalCallbacks = function() {
|
||||
if ((redirectOptions.display === undefined || redirectOptions.display === "none") && /Out$/.test(effectName)) {
|
||||
$.each(elements.nodeType ? [elements] : elements, function(i, element) {
|
||||
Velocity.CSS.setPropertyValue(element, "display", "none");
|
||||
});
|
||||
}
|
||||
if (redirectOptions.complete) {
|
||||
redirectOptions.complete.call(elements, elements);
|
||||
}
|
||||
if (promiseData) {
|
||||
promiseData.resolver(elements || element);
|
||||
}
|
||||
};
|
||||
|
||||
opts.complete = function() {
|
||||
if (loop) {
|
||||
Velocity.Redirects[effectName](element, redirectOptions, elementsIndex, elementsSize, elements, promiseData, loop === true ? true : Math.max(0, loop - 1));
|
||||
}
|
||||
if (properties.reset) {
|
||||
for (var resetProperty in properties.reset) {
|
||||
if (!properties.reset.hasOwnProperty(resetProperty)) {
|
||||
continue;
|
||||
}
|
||||
var resetValue = properties.reset[resetProperty];
|
||||
|
||||
/* Format each non-array value in the reset property map to [ value, value ] so that changes apply
|
||||
immediately and DOM querying is avoided (via forcefeeding). */
|
||||
/* Note: Don't forcefeed hooks, otherwise their hook roots will be defaulted to their null values. */
|
||||
if (Velocity.CSS.Hooks.registered[resetProperty] === undefined && (typeof resetValue === "string" || typeof resetValue === "number")) {
|
||||
properties.reset[resetProperty] = [properties.reset[resetProperty], properties.reset[resetProperty]];
|
||||
}
|
||||
}
|
||||
|
||||
/* So that the reset values are applied instantly upon the next rAF tick, use a zero duration and parallel queueing. */
|
||||
var resetOptions = {duration: 0, queue: false};
|
||||
|
||||
/* Since the reset option uses up the complete callback, we trigger the user's complete callback at the end of ours. */
|
||||
if (finalElement) {
|
||||
resetOptions.complete = injectFinalCallbacks;
|
||||
}
|
||||
|
||||
Velocity.animate(element, properties.reset, resetOptions);
|
||||
/* Only trigger the user's complete callback on the last effect call with the last element in the set. */
|
||||
} else if (finalElement) {
|
||||
injectFinalCallbacks();
|
||||
}
|
||||
};
|
||||
|
||||
if (redirectOptions.visibility === "hidden") {
|
||||
opts.visibility = redirectOptions.visibility;
|
||||
}
|
||||
}
|
||||
|
||||
Velocity.animate(element, propertyMap, opts);
|
||||
}
|
||||
};
|
||||
|
||||
/* Return the Velocity object so that RegisterUI calls can be chained. */
|
||||
return Velocity;
|
||||
};
|
||||
|
||||
/*********************
|
||||
Packaged Effects
|
||||
*********************/
|
||||
|
||||
/* Externalize the packagedEffects data so that they can optionally be modified and re-registered. */
|
||||
/* Support: <=IE8: Callouts will have no effect, and transitions will simply fade in/out. IE9/Android 2.3: Most effects are fully supported, the rest fade in/out. All other browsers: full support. */
|
||||
Velocity.RegisterEffect.packagedEffects =
|
||||
{
|
||||
/* Animate.css */
|
||||
"callout.bounce": {
|
||||
defaultDuration: 550,
|
||||
calls: [
|
||||
[{translateY: -30}, 0.25],
|
||||
[{translateY: 0}, 0.125],
|
||||
[{translateY: -15}, 0.125],
|
||||
[{translateY: 0}, 0.25]
|
||||
]
|
||||
},
|
||||
/* Animate.css */
|
||||
"callout.shake": {
|
||||
defaultDuration: 800,
|
||||
calls: [
|
||||
[{translateX: -11}],
|
||||
[{translateX: 11}],
|
||||
[{translateX: -11}],
|
||||
[{translateX: 11}],
|
||||
[{translateX: -11}],
|
||||
[{translateX: 11}],
|
||||
[{translateX: -11}],
|
||||
[{translateX: 0}]
|
||||
]
|
||||
},
|
||||
/* Animate.css */
|
||||
"callout.flash": {
|
||||
defaultDuration: 1100,
|
||||
calls: [
|
||||
[{opacity: [0, "easeInOutQuad", 1]}],
|
||||
[{opacity: [1, "easeInOutQuad"]}],
|
||||
[{opacity: [0, "easeInOutQuad"]}],
|
||||
[{opacity: [1, "easeInOutQuad"]}]
|
||||
]
|
||||
},
|
||||
/* Animate.css */
|
||||
"callout.pulse": {
|
||||
defaultDuration: 825,
|
||||
calls: [
|
||||
[{scaleX: 1.1, scaleY: 1.1}, 0.50, {easing: "easeInExpo"}],
|
||||
[{scaleX: 1, scaleY: 1}, 0.50]
|
||||
]
|
||||
},
|
||||
/* Animate.css */
|
||||
"callout.swing": {
|
||||
defaultDuration: 950,
|
||||
calls: [
|
||||
[{rotateZ: 15}],
|
||||
[{rotateZ: -10}],
|
||||
[{rotateZ: 5}],
|
||||
[{rotateZ: -5}],
|
||||
[{rotateZ: 0}]
|
||||
]
|
||||
},
|
||||
/* Animate.css */
|
||||
"callout.tada": {
|
||||
defaultDuration: 1000,
|
||||
calls: [
|
||||
[{scaleX: 0.9, scaleY: 0.9, rotateZ: -3}, 0.10],
|
||||
[{scaleX: 1.1, scaleY: 1.1, rotateZ: 3}, 0.10],
|
||||
[{scaleX: 1.1, scaleY: 1.1, rotateZ: -3}, 0.10],
|
||||
["reverse", 0.125],
|
||||
["reverse", 0.125],
|
||||
["reverse", 0.125],
|
||||
["reverse", 0.125],
|
||||
["reverse", 0.125],
|
||||
[{scaleX: 1, scaleY: 1, rotateZ: 0}, 0.20]
|
||||
]
|
||||
},
|
||||
"transition.fadeIn": {
|
||||
defaultDuration: 500,
|
||||
calls: [
|
||||
[{opacity: [1, 0]}]
|
||||
]
|
||||
},
|
||||
"transition.fadeOut": {
|
||||
defaultDuration: 500,
|
||||
calls: [
|
||||
[{opacity: [0, 1]}]
|
||||
]
|
||||
},
|
||||
/* Support: Loses rotation in IE9/Android 2.3 (fades only). */
|
||||
"transition.flipXIn": {
|
||||
defaultDuration: 700,
|
||||
calls: [
|
||||
[{opacity: [1, 0], transformPerspective: [800, 800], rotateY: [0, -55]}]
|
||||
],
|
||||
reset: {transformPerspective: 0}
|
||||
},
|
||||
/* Support: Loses rotation in IE9/Android 2.3 (fades only). */
|
||||
"transition.flipXOut": {
|
||||
defaultDuration: 700,
|
||||
calls: [
|
||||
[{opacity: [0, 1], transformPerspective: [800, 800], rotateY: 55}]
|
||||
],
|
||||
reset: {transformPerspective: 0, rotateY: 0}
|
||||
},
|
||||
/* Support: Loses rotation in IE9/Android 2.3 (fades only). */
|
||||
"transition.flipYIn": {
|
||||
defaultDuration: 800,
|
||||
calls: [
|
||||
[{opacity: [1, 0], transformPerspective: [800, 800], rotateX: [0, -45]}]
|
||||
],
|
||||
reset: {transformPerspective: 0}
|
||||
},
|
||||
/* Support: Loses rotation in IE9/Android 2.3 (fades only). */
|
||||
"transition.flipYOut": {
|
||||
defaultDuration: 800,
|
||||
calls: [
|
||||
[{opacity: [0, 1], transformPerspective: [800, 800], rotateX: 25}]
|
||||
],
|
||||
reset: {transformPerspective: 0, rotateX: 0}
|
||||
},
|
||||
/* Animate.css */
|
||||
/* Support: Loses rotation in IE9/Android 2.3 (fades only). */
|
||||
"transition.flipBounceXIn": {
|
||||
defaultDuration: 900,
|
||||
calls: [
|
||||
[{opacity: [0.725, 0], transformPerspective: [400, 400], rotateY: [-10, 90]}, 0.50],
|
||||
[{opacity: 0.80, rotateY: 10}, 0.25],
|
||||
[{opacity: 1, rotateY: 0}, 0.25]
|
||||
],
|
||||
reset: {transformPerspective: 0}
|
||||
},
|
||||
/* Animate.css */
|
||||
/* Support: Loses rotation in IE9/Android 2.3 (fades only). */
|
||||
"transition.flipBounceXOut": {
|
||||
defaultDuration: 800,
|
||||
calls: [
|
||||
[{opacity: [0.9, 1], transformPerspective: [400, 400], rotateY: -10}],
|
||||
[{opacity: 0, rotateY: 90}]
|
||||
],
|
||||
reset: {transformPerspective: 0, rotateY: 0}
|
||||
},
|
||||
/* Animate.css */
|
||||
/* Support: Loses rotation in IE9/Android 2.3 (fades only). */
|
||||
"transition.flipBounceYIn": {
|
||||
defaultDuration: 850,
|
||||
calls: [
|
||||
[{opacity: [0.725, 0], transformPerspective: [400, 400], rotateX: [-10, 90]}, 0.50],
|
||||
[{opacity: 0.80, rotateX: 10}, 0.25],
|
||||
[{opacity: 1, rotateX: 0}, 0.25]
|
||||
],
|
||||
reset: {transformPerspective: 0}
|
||||
},
|
||||
/* Animate.css */
|
||||
/* Support: Loses rotation in IE9/Android 2.3 (fades only). */
|
||||
"transition.flipBounceYOut": {
|
||||
defaultDuration: 800,
|
||||
calls: [
|
||||
[{opacity: [0.9, 1], transformPerspective: [400, 400], rotateX: -15}],
|
||||
[{opacity: 0, rotateX: 90}]
|
||||
],
|
||||
reset: {transformPerspective: 0, rotateX: 0}
|
||||
},
|
||||
/* Magic.css */
|
||||
"transition.swoopIn": {
|
||||
defaultDuration: 850,
|
||||
calls: [
|
||||
[{opacity: [1, 0], transformOriginX: ["100%", "50%"], transformOriginY: ["100%", "100%"], scaleX: [1, 0], scaleY: [1, 0], translateX: [0, -700], translateZ: 0}]
|
||||
],
|
||||
reset: {transformOriginX: "50%", transformOriginY: "50%"}
|
||||
},
|
||||
/* Magic.css */
|
||||
"transition.swoopOut": {
|
||||
defaultDuration: 850,
|
||||
calls: [
|
||||
[{opacity: [0, 1], transformOriginX: ["50%", "100%"], transformOriginY: ["100%", "100%"], scaleX: 0, scaleY: 0, translateX: -700, translateZ: 0}]
|
||||
],
|
||||
reset: {transformOriginX: "50%", transformOriginY: "50%", scaleX: 1, scaleY: 1, translateX: 0}
|
||||
},
|
||||
/* Magic.css */
|
||||
/* Support: Loses rotation in IE9/Android 2.3. (Fades and scales only.) */
|
||||
"transition.whirlIn": {
|
||||
defaultDuration: 850,
|
||||
calls: [
|
||||
[{opacity: [1, 0], transformOriginX: ["50%", "50%"], transformOriginY: ["50%", "50%"], scaleX: [1, 0], scaleY: [1, 0], rotateY: [0, 160]}, 1, {easing: "easeInOutSine"}]
|
||||
]
|
||||
},
|
||||
/* Magic.css */
|
||||
/* Support: Loses rotation in IE9/Android 2.3. (Fades and scales only.) */
|
||||
"transition.whirlOut": {
|
||||
defaultDuration: 750,
|
||||
calls: [
|
||||
[{opacity: [0, "easeInOutQuint", 1], transformOriginX: ["50%", "50%"], transformOriginY: ["50%", "50%"], scaleX: 0, scaleY: 0, rotateY: 160}, 1, {easing: "swing"}]
|
||||
],
|
||||
reset: {scaleX: 1, scaleY: 1, rotateY: 0}
|
||||
},
|
||||
"transition.shrinkIn": {
|
||||
defaultDuration: 750,
|
||||
calls: [
|
||||
[{opacity: [1, 0], transformOriginX: ["50%", "50%"], transformOriginY: ["50%", "50%"], scaleX: [1, 1.5], scaleY: [1, 1.5], translateZ: 0}]
|
||||
]
|
||||
},
|
||||
"transition.shrinkOut": {
|
||||
defaultDuration: 600,
|
||||
calls: [
|
||||
[{opacity: [0, 1], transformOriginX: ["50%", "50%"], transformOriginY: ["50%", "50%"], scaleX: 1.3, scaleY: 1.3, translateZ: 0}]
|
||||
],
|
||||
reset: {scaleX: 1, scaleY: 1}
|
||||
},
|
||||
"transition.expandIn": {
|
||||
defaultDuration: 700,
|
||||
calls: [
|
||||
[{opacity: [1, 0], transformOriginX: ["50%", "50%"], transformOriginY: ["50%", "50%"], scaleX: [1, 0.625], scaleY: [1, 0.625], translateZ: 0}]
|
||||
]
|
||||
},
|
||||
"transition.expandOut": {
|
||||
defaultDuration: 700,
|
||||
calls: [
|
||||
[{opacity: [0, 1], transformOriginX: ["50%", "50%"], transformOriginY: ["50%", "50%"], scaleX: 0.5, scaleY: 0.5, translateZ: 0}]
|
||||
],
|
||||
reset: {scaleX: 1, scaleY: 1}
|
||||
},
|
||||
/* Animate.css */
|
||||
"transition.bounceIn": {
|
||||
defaultDuration: 800,
|
||||
calls: [
|
||||
[{opacity: [1, 0], scaleX: [1.05, 0.3], scaleY: [1.05, 0.3]}, 0.35],
|
||||
[{scaleX: 0.9, scaleY: 0.9, translateZ: 0}, 0.20],
|
||||
[{scaleX: 1, scaleY: 1}, 0.45]
|
||||
]
|
||||
},
|
||||
/* Animate.css */
|
||||
"transition.bounceOut": {
|
||||
defaultDuration: 800,
|
||||
calls: [
|
||||
[{scaleX: 0.95, scaleY: 0.95}, 0.35],
|
||||
[{scaleX: 1.1, scaleY: 1.1, translateZ: 0}, 0.35],
|
||||
[{opacity: [0, 1], scaleX: 0.3, scaleY: 0.3}, 0.30]
|
||||
],
|
||||
reset: {scaleX: 1, scaleY: 1}
|
||||
},
|
||||
/* Animate.css */
|
||||
"transition.bounceUpIn": {
|
||||
defaultDuration: 800,
|
||||
calls: [
|
||||
[{opacity: [1, 0], translateY: [-30, 1000]}, 0.60, {easing: "easeOutCirc"}],
|
||||
[{translateY: 10}, 0.20],
|
||||
[{translateY: 0}, 0.20]
|
||||
]
|
||||
},
|
||||
/* Animate.css */
|
||||
"transition.bounceUpOut": {
|
||||
defaultDuration: 1000,
|
||||
calls: [
|
||||
[{translateY: 20}, 0.20],
|
||||
[{opacity: [0, "easeInCirc", 1], translateY: -1000}, 0.80]
|
||||
],
|
||||
reset: {translateY: 0}
|
||||
},
|
||||
/* Animate.css */
|
||||
"transition.bounceDownIn": {
|
||||
defaultDuration: 800,
|
||||
calls: [
|
||||
[{opacity: [1, 0], translateY: [30, -1000]}, 0.60, {easing: "easeOutCirc"}],
|
||||
[{translateY: -10}, 0.20],
|
||||
[{translateY: 0}, 0.20]
|
||||
]
|
||||
},
|
||||
/* Animate.css */
|
||||
"transition.bounceDownOut": {
|
||||
defaultDuration: 1000,
|
||||
calls: [
|
||||
[{translateY: -20}, 0.20],
|
||||
[{opacity: [0, "easeInCirc", 1], translateY: 1000}, 0.80]
|
||||
],
|
||||
reset: {translateY: 0}
|
||||
},
|
||||
/* Animate.css */
|
||||
"transition.bounceLeftIn": {
|
||||
defaultDuration: 750,
|
||||
calls: [
|
||||
[{opacity: [1, 0], translateX: [30, -1250]}, 0.60, {easing: "easeOutCirc"}],
|
||||
[{translateX: -10}, 0.20],
|
||||
[{translateX: 0}, 0.20]
|
||||
]
|
||||
},
|
||||
/* Animate.css */
|
||||
"transition.bounceLeftOut": {
|
||||
defaultDuration: 750,
|
||||
calls: [
|
||||
[{translateX: 30}, 0.20],
|
||||
[{opacity: [0, "easeInCirc", 1], translateX: -1250}, 0.80]
|
||||
],
|
||||
reset: {translateX: 0}
|
||||
},
|
||||
/* Animate.css */
|
||||
"transition.bounceRightIn": {
|
||||
defaultDuration: 750,
|
||||
calls: [
|
||||
[{opacity: [1, 0], translateX: [-30, 1250]}, 0.60, {easing: "easeOutCirc"}],
|
||||
[{translateX: 10}, 0.20],
|
||||
[{translateX: 0}, 0.20]
|
||||
]
|
||||
},
|
||||
/* Animate.css */
|
||||
"transition.bounceRightOut": {
|
||||
defaultDuration: 750,
|
||||
calls: [
|
||||
[{translateX: -30}, 0.20],
|
||||
[{opacity: [0, "easeInCirc", 1], translateX: 1250}, 0.80]
|
||||
],
|
||||
reset: {translateX: 0}
|
||||
},
|
||||
"transition.slideUpIn": {
|
||||
defaultDuration: 900,
|
||||
calls: [
|
||||
[{opacity: [1, 0], translateY: [0, 20], translateZ: 0}]
|
||||
]
|
||||
},
|
||||
"transition.slideUpOut": {
|
||||
defaultDuration: 900,
|
||||
calls: [
|
||||
[{opacity: [0, 1], translateY: -20, translateZ: 0}]
|
||||
],
|
||||
reset: {translateY: 0}
|
||||
},
|
||||
"transition.slideDownIn": {
|
||||
defaultDuration: 900,
|
||||
calls: [
|
||||
[{opacity: [1, 0], translateY: [0, -20], translateZ: 0}]
|
||||
]
|
||||
},
|
||||
"transition.slideDownOut": {
|
||||
defaultDuration: 900,
|
||||
calls: [
|
||||
[{opacity: [0, 1], translateY: 20, translateZ: 0}]
|
||||
],
|
||||
reset: {translateY: 0}
|
||||
},
|
||||
"transition.slideLeftIn": {
|
||||
defaultDuration: 1000,
|
||||
calls: [
|
||||
[{opacity: [1, 0], translateX: [0, -20], translateZ: 0}]
|
||||
]
|
||||
},
|
||||
"transition.slideLeftOut": {
|
||||
defaultDuration: 1050,
|
||||
calls: [
|
||||
[{opacity: [0, 1], translateX: -20, translateZ: 0}]
|
||||
],
|
||||
reset: {translateX: 0}
|
||||
},
|
||||
"transition.slideRightIn": {
|
||||
defaultDuration: 1000,
|
||||
calls: [
|
||||
[{opacity: [1, 0], translateX: [0, 20], translateZ: 0}]
|
||||
]
|
||||
},
|
||||
"transition.slideRightOut": {
|
||||
defaultDuration: 1050,
|
||||
calls: [
|
||||
[{opacity: [0, 1], translateX: 20, translateZ: 0}]
|
||||
],
|
||||
reset: {translateX: 0}
|
||||
},
|
||||
"transition.slideUpBigIn": {
|
||||
defaultDuration: 850,
|
||||
calls: [
|
||||
[{opacity: [1, 0], translateY: [0, 75], translateZ: 0}]
|
||||
]
|
||||
},
|
||||
"transition.slideUpBigOut": {
|
||||
defaultDuration: 800,
|
||||
calls: [
|
||||
[{opacity: [0, 1], translateY: -75, translateZ: 0}]
|
||||
],
|
||||
reset: {translateY: 0}
|
||||
},
|
||||
"transition.slideDownBigIn": {
|
||||
defaultDuration: 850,
|
||||
calls: [
|
||||
[{opacity: [1, 0], translateY: [0, -75], translateZ: 0}]
|
||||
]
|
||||
},
|
||||
"transition.slideDownBigOut": {
|
||||
defaultDuration: 800,
|
||||
calls: [
|
||||
[{opacity: [0, 1], translateY: 75, translateZ: 0}]
|
||||
],
|
||||
reset: {translateY: 0}
|
||||
},
|
||||
"transition.slideLeftBigIn": {
|
||||
defaultDuration: 800,
|
||||
calls: [
|
||||
[{opacity: [1, 0], translateX: [0, -75], translateZ: 0}]
|
||||
]
|
||||
},
|
||||
"transition.slideLeftBigOut": {
|
||||
defaultDuration: 750,
|
||||
calls: [
|
||||
[{opacity: [0, 1], translateX: -75, translateZ: 0}]
|
||||
],
|
||||
reset: {translateX: 0}
|
||||
},
|
||||
"transition.slideRightBigIn": {
|
||||
defaultDuration: 800,
|
||||
calls: [
|
||||
[{opacity: [1, 0], translateX: [0, 75], translateZ: 0}]
|
||||
]
|
||||
},
|
||||
"transition.slideRightBigOut": {
|
||||
defaultDuration: 750,
|
||||
calls: [
|
||||
[{opacity: [0, 1], translateX: 75, translateZ: 0}]
|
||||
],
|
||||
reset: {translateX: 0}
|
||||
},
|
||||
/* Magic.css */
|
||||
"transition.perspectiveUpIn": {
|
||||
defaultDuration: 800,
|
||||
calls: [
|
||||
[{opacity: [1, 0], transformPerspective: [800, 800], transformOriginX: [0, 0], transformOriginY: ["100%", "100%"], rotateX: [0, -180]}]
|
||||
],
|
||||
reset: {transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%"}
|
||||
},
|
||||
/* Magic.css */
|
||||
/* Support: Loses rotation in IE9/Android 2.3 (fades only). */
|
||||
"transition.perspectiveUpOut": {
|
||||
defaultDuration: 850,
|
||||
calls: [
|
||||
[{opacity: [0, 1], transformPerspective: [800, 800], transformOriginX: [0, 0], transformOriginY: ["100%", "100%"], rotateX: -180}]
|
||||
],
|
||||
reset: {transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%", rotateX: 0}
|
||||
},
|
||||
/* Magic.css */
|
||||
/* Support: Loses rotation in IE9/Android 2.3 (fades only). */
|
||||
"transition.perspectiveDownIn": {
|
||||
defaultDuration: 800,
|
||||
calls: [
|
||||
[{opacity: [1, 0], transformPerspective: [800, 800], transformOriginX: [0, 0], transformOriginY: [0, 0], rotateX: [0, 180]}]
|
||||
],
|
||||
reset: {transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%"}
|
||||
},
|
||||
/* Magic.css */
|
||||
/* Support: Loses rotation in IE9/Android 2.3 (fades only). */
|
||||
"transition.perspectiveDownOut": {
|
||||
defaultDuration: 850,
|
||||
calls: [
|
||||
[{opacity: [0, 1], transformPerspective: [800, 800], transformOriginX: [0, 0], transformOriginY: [0, 0], rotateX: 180}]
|
||||
],
|
||||
reset: {transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%", rotateX: 0}
|
||||
},
|
||||
/* Magic.css */
|
||||
/* Support: Loses rotation in IE9/Android 2.3 (fades only). */
|
||||
"transition.perspectiveLeftIn": {
|
||||
defaultDuration: 950,
|
||||
calls: [
|
||||
[{opacity: [1, 0], transformPerspective: [2000, 2000], transformOriginX: [0, 0], transformOriginY: [0, 0], rotateY: [0, -180]}]
|
||||
],
|
||||
reset: {transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%"}
|
||||
},
|
||||
/* Magic.css */
|
||||
/* Support: Loses rotation in IE9/Android 2.3 (fades only). */
|
||||
"transition.perspectiveLeftOut": {
|
||||
defaultDuration: 950,
|
||||
calls: [
|
||||
[{opacity: [0, 1], transformPerspective: [2000, 2000], transformOriginX: [0, 0], transformOriginY: [0, 0], rotateY: -180}]
|
||||
],
|
||||
reset: {transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%", rotateY: 0}
|
||||
},
|
||||
/* Magic.css */
|
||||
/* Support: Loses rotation in IE9/Android 2.3 (fades only). */
|
||||
"transition.perspectiveRightIn": {
|
||||
defaultDuration: 950,
|
||||
calls: [
|
||||
[{opacity: [1, 0], transformPerspective: [2000, 2000], transformOriginX: ["100%", "100%"], transformOriginY: [0, 0], rotateY: [0, 180]}]
|
||||
],
|
||||
reset: {transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%"}
|
||||
},
|
||||
/* Magic.css */
|
||||
/* Support: Loses rotation in IE9/Android 2.3 (fades only). */
|
||||
"transition.perspectiveRightOut": {
|
||||
defaultDuration: 950,
|
||||
calls: [
|
||||
[{opacity: [0, 1], transformPerspective: [2000, 2000], transformOriginX: ["100%", "100%"], transformOriginY: [0, 0], rotateY: 180}]
|
||||
],
|
||||
reset: {transformPerspective: 0, transformOriginX: "50%", transformOriginY: "50%", rotateY: 0}
|
||||
}
|
||||
};
|
||||
|
||||
/* Register the packaged effects. */
|
||||
for (var effectName in Velocity.RegisterEffect.packagedEffects) {
|
||||
if (Velocity.RegisterEffect.packagedEffects.hasOwnProperty(effectName)) {
|
||||
Velocity.RegisterEffect(effectName, Velocity.RegisterEffect.packagedEffects[effectName]);
|
||||
}
|
||||
}
|
||||
|
||||
/*********************
|
||||
Sequence Running
|
||||
**********************/
|
||||
|
||||
/* Note: Sequence calls must use Velocity's single-object arguments syntax. */
|
||||
Velocity.RunSequence = function(originalSequence) {
|
||||
var sequence = $.extend(true, [], originalSequence);
|
||||
|
||||
if (sequence.length > 1) {
|
||||
$.each(sequence.reverse(), function(i, currentCall) {
|
||||
var nextCall = sequence[i + 1];
|
||||
|
||||
if (nextCall) {
|
||||
/* Parallel sequence calls (indicated via sequenceQueue:false) are triggered
|
||||
in the previous call's begin callback. Otherwise, chained calls are normally triggered
|
||||
in the previous call's complete callback. */
|
||||
var currentCallOptions = currentCall.o || currentCall.options,
|
||||
nextCallOptions = nextCall.o || nextCall.options;
|
||||
|
||||
var timing = (currentCallOptions && currentCallOptions.sequenceQueue === false) ? "begin" : "complete",
|
||||
callbackOriginal = nextCallOptions && nextCallOptions[timing],
|
||||
options = {};
|
||||
|
||||
options[timing] = function() {
|
||||
var nextCallElements = nextCall.e || nextCall.elements;
|
||||
var elements = nextCallElements.nodeType ? [nextCallElements] : nextCallElements;
|
||||
|
||||
if (callbackOriginal) {
|
||||
callbackOriginal.call(elements, elements);
|
||||
}
|
||||
Velocity(currentCall);
|
||||
};
|
||||
|
||||
if (nextCall.o) {
|
||||
nextCall.o = $.extend({}, nextCallOptions, options);
|
||||
} else {
|
||||
nextCall.options = $.extend({}, nextCallOptions, options);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
sequence.reverse();
|
||||
}
|
||||
|
||||
Velocity(sequence[0]);
|
||||
};
|
||||
}((window.jQuery || window.Zepto || window), window, (window ? window.document : undefined));
|
||||
}));
|
Loading…
Add table
Add a link
Reference in a new issue